diff --git a/THANKS b/THANKS index 78d4025ce09da..ad7b8be68f4bd 100644 --- a/THANKS +++ b/THANKS @@ -72,4 +72,5 @@ svannon, jurkovic.nikola, Willian Krueger, BioHazard, Ille000, Erocoloco, terrorbringer, antihrists, Havenard, scarymovie87, D3VIL, FaTe753, PrinceCreed, spgm, Dakeyras, sombre88, 19Maxx83, moriquendu, Ille, breakerfly, zthoreen, clement.roussel, p.alexej, Ceris, Nayre, Kiper, announce, thmarth, -Ner'zhul, DarkXuan +Ner'zhul, DarkXuan, leak, linencloth, SnakeIce, Supabad, Tome, Nay, Kaelima, +Svannon diff --git a/dep/CMakeLists.txt b/dep/CMakeLists.txt index 3e4060af44694..226d564fdc6e8 100644 --- a/dep/CMakeLists.txt +++ b/dep/CMakeLists.txt @@ -27,7 +27,9 @@ if(CMAKE_SYSTEM_NAME MATCHES "Windows") add_subdirectory(mysqllite) endif() endif() - add_subdirectory(bzip2) + if(TOOLS) + add_subdirectory(bzip2) + endif() add_subdirectory(zlib) endif() diff --git a/dep/PackageList.txt b/dep/PackageList.txt index c71d23764a346..7ab307ecfc570 100644 --- a/dep/PackageList.txt +++ b/dep/PackageList.txt @@ -26,7 +26,7 @@ MersenneTwister (a very fast random number generator) MySQL (the world's most popular open source database software) http://www.mysql.com/ - Version: 5.1.50 (GA) + Version: 5.5.9 (GA) SFMT (SIMD-oriented Fast Mersenne Twister) Based on http://agner.org/random/ diff --git a/dep/mysqllite/CMakeLists.txt b/dep/mysqllite/CMakeLists.txt index 02cbd50a3b324..f9faf45fc452f 100644 --- a/dep/mysqllite/CMakeLists.txt +++ b/dep/mysqllite/CMakeLists.txt @@ -1,5 +1,5 @@ # Copyright (C) 2006 MySQL AB -# Copyright (C) 2008-2010 Trinity +# Copyright (C) 2008-2011 Trinity # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without @@ -9,274 +9,253 @@ # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -set(COMPILATION_COMMENT "Source distribution lite for Trinity Core") -set(PROTOCOL_VERSION "10") -set(DOT_FRM_VERSION "6") -set(MYSQL_TCP_PORT_DEFAULT "0") -set(MYSQL_TCP_PORT "3306") -set(MYSQL_UNIX_ADDR "/tmp/mysql.sock") -set(VERSION "5.1.50") -set(MYSQL_BASE_VERSION "5.1") -set(MYSQL_VERSION_ID "50150") +# Include the platform-specific file. +include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/os/Windows.cmake) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/include/mysql_version.h.in - ${CMAKE_BINARY_DIR}/mysql_version.h @ONLY) +# Add macros +include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/character_sets.cmake) +include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/mysql_version.cmake) + +# Advanced options (mostly useless, but usually still in config.h, so they need to be set...) +set(CYBOZU OFF) +set(BACKUP_TEST OFF) +set(ENABLED_LOCAL_INFILE ON) +set(WITH_FAST_MUTEXES OFF) + +# Handle useful options - hardcode to ON/OFF +set(ENABLED_PROFILING OFF) +set_directory_properties(PROPERTIES COMPILE_DEFINITIONS_DEBUG ENABLED_DEBUG_SYNC) + +# Set DBUG_OFF and other optional release-only flags for non-debug project types +foreach(BUILD_TYPE RELEASE RELWITHDEBINFO MINSIZEREL) + set_directory_properties(PROPERTIES COMPILE_DEFINITIONS_${BUILD_TYPE} DBUG_OFF) + if(WITH_FAST_MUTEXES) + set_directory_properties(PROPERTIES COMPILE_DEFINITIONS_${BUILD_TYPE} "MY_PTHREAD_FASTMUTEX=1") + endif() +endforeach() + +# Set commonly used variables +set(DEFAULT_MYSQL_HOME "C:/Program Files/MySQL/MySQL Server ${MYSQL_BASE_VERSION}" ) +set(SHAREDIR share) +set(DEFAULT_BASEDIR "${DEFAULT_MYSQL_HOME}") +set(MYSQL_DATADIR "${DEFAULT_MYSQL_HOME}/data") +set(DEFAULT_CHARSET_HOME "${DEFAULT_MYSQL_HOME}") +set(PLUGINDIR "${DEFAULT_MYSQL_HOME}/lib/plugin") + +set(COMPILATION_COMMENT "Source distribution lite for TrinityCore") + +# Run platform tests +include(${CMAKE_CURRENT_SOURCE_DIR}/configure.cmake) + +# Use system openssl. +add_definitions(-DHAVE_OPENSSL) include_directories( + ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_BINARY_DIR} + ${OPENSSL_INCLUDE_DIR} ${CMAKE_SOURCE_DIR}/dep/zlib - ${CMAKE_CURRENT_SOURCE_DIR}/include - ${CMAKE_CURRENT_SOURCE_DIR}/libmysql - ${CMAKE_CURRENT_SOURCE_DIR}/sql - ${CMAKE_CURRENT_SOURCE_DIR}/strings + ${CMAKE_CURRENT_SOURCE_DIR}/include + ${CMAKE_CURRENT_SOURCE_DIR}/include/internal ${CMAKE_CURRENT_SOURCE_DIR}/dbug - ${CMAKE_CURRENT_SOURCE_DIR}/extra/yassl/taocrypt/mySTL - ${CMAKE_CURRENT_SOURCE_DIR}/extra/yassl/taocrypt/include - ${CMAKE_CURRENT_SOURCE_DIR}/extra/yassl/include + ${CMAKE_CURRENT_SOURCE_DIR}/strings + ${CMAKE_CURRENT_SOURCE_DIR}/mysys + ${CMAKE_CURRENT_SOURCE_DIR}/libmysql ) -# FIXME only needed if build type is "Debug", but CMAKE_BUILD_TYPE is not set during configure time. set(DBUG_SOURCES - ${CMAKE_CURRENT_SOURCE_DIR}/dbug/dbug.c - ${CMAKE_CURRENT_SOURCE_DIR}/dbug/factorial.c - ${CMAKE_CURRENT_SOURCE_DIR}/dbug/sanity.c -) - -set(TAOCRYPT_SOURCES - ${CMAKE_CURRENT_SOURCE_DIR}/extra/yassl/taocrypt/src/aes.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/extra/yassl/taocrypt/src/aestables.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/extra/yassl/taocrypt/src/algebra.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/extra/yassl/taocrypt/src/arc4.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/extra/yassl/taocrypt/src/asn.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/extra/yassl/taocrypt/src/coding.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/extra/yassl/taocrypt/src/des.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/extra/yassl/taocrypt/src/dh.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/extra/yassl/taocrypt/src/dsa.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/extra/yassl/taocrypt/src/file.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/extra/yassl/taocrypt/src/hash.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/extra/yassl/taocrypt/src/integer.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/extra/yassl/taocrypt/src/md2.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/extra/yassl/taocrypt/src/md4.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/extra/yassl/taocrypt/src/md5.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/extra/yassl/taocrypt/src/misc.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/extra/yassl/taocrypt/src/random.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/extra/yassl/taocrypt/src/ripemd.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/extra/yassl/taocrypt/src/rsa.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/extra/yassl/taocrypt/src/sha.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/extra/yassl/taocrypt/include/aes.hpp - ${CMAKE_CURRENT_SOURCE_DIR}/extra/yassl/taocrypt/include/algebra.hpp - ${CMAKE_CURRENT_SOURCE_DIR}/extra/yassl/taocrypt/include/arc4.hpp - ${CMAKE_CURRENT_SOURCE_DIR}/extra/yassl/taocrypt/include/asn.hpp - ${CMAKE_CURRENT_SOURCE_DIR}/extra/yassl/taocrypt/include/block.hpp - ${CMAKE_CURRENT_SOURCE_DIR}/extra/yassl/taocrypt/include/coding.hpp - ${CMAKE_CURRENT_SOURCE_DIR}/extra/yassl/taocrypt/include/des.hpp - ${CMAKE_CURRENT_SOURCE_DIR}/extra/yassl/taocrypt/include/dh.hpp - ${CMAKE_CURRENT_SOURCE_DIR}/extra/yassl/taocrypt/include/dsa.hpp - ${CMAKE_CURRENT_SOURCE_DIR}/extra/yassl/taocrypt/include/dsa.hpp - ${CMAKE_CURRENT_SOURCE_DIR}/extra/yassl/taocrypt/include/error.hpp - ${CMAKE_CURRENT_SOURCE_DIR}/extra/yassl/taocrypt/include/file.hpp - ${CMAKE_CURRENT_SOURCE_DIR}/extra/yassl/taocrypt/include/hash.hpp - ${CMAKE_CURRENT_SOURCE_DIR}/extra/yassl/taocrypt/include/hmac.hpp - ${CMAKE_CURRENT_SOURCE_DIR}/extra/yassl/taocrypt/include/integer.hpp - ${CMAKE_CURRENT_SOURCE_DIR}/extra/yassl/taocrypt/include/md2.hpp - ${CMAKE_CURRENT_SOURCE_DIR}/extra/yassl/taocrypt/include/md5.hpp - ${CMAKE_CURRENT_SOURCE_DIR}/extra/yassl/taocrypt/include/misc.hpp - ${CMAKE_CURRENT_SOURCE_DIR}/extra/yassl/taocrypt/include/modarith.hpp - ${CMAKE_CURRENT_SOURCE_DIR}/extra/yassl/taocrypt/include/modes.hpp - ${CMAKE_CURRENT_SOURCE_DIR}/extra/yassl/taocrypt/include/random.hpp - ${CMAKE_CURRENT_SOURCE_DIR}/extra/yassl/taocrypt/include/ripemd.hpp - ${CMAKE_CURRENT_SOURCE_DIR}/extra/yassl/taocrypt/include/rsa.hpp - ${CMAKE_CURRENT_SOURCE_DIR}/extra/yassl/taocrypt/include/sha.hpp + ${CMAKE_CURRENT_SOURCE_DIR}/dbug/dbug.c ) -set(YASSL_SOURCES - ${CMAKE_CURRENT_SOURCE_DIR}/extra/yassl/src/buffer.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/extra/yassl/src/cert_wrapper.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/extra/yassl/src/crypto_wrapper.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/extra/yassl/src/handshake.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/extra/yassl/src/lock.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/extra/yassl/src/log.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/extra/yassl/src/socket_wrapper.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/extra/yassl/src/ssl.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/extra/yassl/src/timer.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/extra/yassl/src/yassl_error.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/extra/yassl/src/yassl_imp.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/extra/yassl/src/yassl_int.cpp -) +set(STRINGS_SOURCES + ${CMAKE_CURRENT_SOURCE_DIR}/strings/bchange.c + ${CMAKE_CURRENT_SOURCE_DIR}/strings/bmove_upp.c + ${CMAKE_CURRENT_SOURCE_DIR}/strings/ctype-big5.c + ${CMAKE_CURRENT_SOURCE_DIR}/strings/ctype-bin.c + ${CMAKE_CURRENT_SOURCE_DIR}/strings/ctype-cp932.c + ${CMAKE_CURRENT_SOURCE_DIR}/strings/ctype-czech.c + ${CMAKE_CURRENT_SOURCE_DIR}/strings/ctype-euc_kr.c + ${CMAKE_CURRENT_SOURCE_DIR}/strings/ctype-extra.c + ${CMAKE_CURRENT_SOURCE_DIR}/strings/ctype-gb2312.c + ${CMAKE_CURRENT_SOURCE_DIR}/strings/ctype-gbk.c + ${CMAKE_CURRENT_SOURCE_DIR}/strings/ctype-latin1.c + ${CMAKE_CURRENT_SOURCE_DIR}/strings/ctype-mb.c + ${CMAKE_CURRENT_SOURCE_DIR}/strings/ctype-simple.c + ${CMAKE_CURRENT_SOURCE_DIR}/strings/ctype-tis620.c + ${CMAKE_CURRENT_SOURCE_DIR}/strings/ctype-uca.c + ${CMAKE_CURRENT_SOURCE_DIR}/strings/ctype-ucs2.c + ${CMAKE_CURRENT_SOURCE_DIR}/strings/ctype-utf8.c + ${CMAKE_CURRENT_SOURCE_DIR}/strings/ctype-win1250ch.c + ${CMAKE_CURRENT_SOURCE_DIR}/strings/ctype.c + ${CMAKE_CURRENT_SOURCE_DIR}/strings/decimal.c + ${CMAKE_CURRENT_SOURCE_DIR}/strings/dtoa.c + ${CMAKE_CURRENT_SOURCE_DIR}/strings/int2str.c + ${CMAKE_CURRENT_SOURCE_DIR}/strings/is_prefix.c + ${CMAKE_CURRENT_SOURCE_DIR}/strings/llstr.c + ${CMAKE_CURRENT_SOURCE_DIR}/strings/longlong2str.c + ${CMAKE_CURRENT_SOURCE_DIR}/strings/my_strtoll10.c + ${CMAKE_CURRENT_SOURCE_DIR}/strings/my_vsnprintf.c + ${CMAKE_CURRENT_SOURCE_DIR}/strings/str2int.c + ${CMAKE_CURRENT_SOURCE_DIR}/strings/str_alloc.c + ${CMAKE_CURRENT_SOURCE_DIR}/strings/strcend.c + ${CMAKE_CURRENT_SOURCE_DIR}/strings/strend.c + ${CMAKE_CURRENT_SOURCE_DIR}/strings/strfill.c + ${CMAKE_CURRENT_SOURCE_DIR}/strings/strmake.c + ${CMAKE_CURRENT_SOURCE_DIR}/strings/strmov.c + ${CMAKE_CURRENT_SOURCE_DIR}/strings/strnmov.c + ${CMAKE_CURRENT_SOURCE_DIR}/strings/strxmov.c + ${CMAKE_CURRENT_SOURCE_DIR}/strings/strxnmov.c + ${CMAKE_CURRENT_SOURCE_DIR}/strings/xml.c + ${CMAKE_CURRENT_SOURCE_DIR}/strings/my_strchr.c + ${CMAKE_CURRENT_SOURCE_DIR}/strings/strcont.c + ${CMAKE_CURRENT_SOURCE_DIR}/strings/strappend.c +) +if(NOT HAVE_STRNLEN) + # OSX does not have strnlen + set(STRINGS_SOURCES ${STRINGS_SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/strings/strnlen.c) +endif() -set(LIB_SOURCES - ${DBUG_SOURCES} - ${TAOCRYPT_SOURCES} - ${YASSL_SOURCES} +set(VIO_SOURCES + ${CMAKE_CURRENT_SOURCE_DIR}/vio/vio.c + ${CMAKE_CURRENT_SOURCE_DIR}/vio/viosocket.c + ${CMAKE_CURRENT_SOURCE_DIR}/vio/viossl.c + ${CMAKE_CURRENT_SOURCE_DIR}/vio/viosslfactories.c ) -set(CLIENT_SOURCES - ${CMAKE_CURRENT_SOURCE_DIR}/libmysql/errmsg.c - ${CMAKE_CURRENT_SOURCE_DIR}/libmysql/get_password.c - ${CMAKE_CURRENT_SOURCE_DIR}/libmysql/libmysql.c - ${CMAKE_CURRENT_SOURCE_DIR}/libmysql/manager.c - ${CMAKE_CURRENT_SOURCE_DIR}/libmysql/dll.c +set(MYSYS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/mysys/array.c + ${CMAKE_CURRENT_SOURCE_DIR}/mysys/charset-def.c + ${CMAKE_CURRENT_SOURCE_DIR}/mysys/charset.c + ${CMAKE_CURRENT_SOURCE_DIR}/mysys/checksum.c ${CMAKE_CURRENT_SOURCE_DIR}/mysys/default.c ${CMAKE_CURRENT_SOURCE_DIR}/mysys/errors.c ${CMAKE_CURRENT_SOURCE_DIR}/mysys/hash.c - ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_sleep.c - ${CMAKE_CURRENT_SOURCE_DIR}/mysys/default_modify.c - ${CMAKE_CURRENT_SOURCE_DIR}/mysys/charset-def.c - ${CMAKE_CURRENT_SOURCE_DIR}/mysys/charset.c ${CMAKE_CURRENT_SOURCE_DIR}/mysys/list.c - ${CMAKE_CURRENT_SOURCE_DIR}/mysys/mf_arr_appstr.c + ${CMAKE_CURRENT_SOURCE_DIR}/mysys/md5.c ${CMAKE_CURRENT_SOURCE_DIR}/mysys/mf_cache.c ${CMAKE_CURRENT_SOURCE_DIR}/mysys/mf_dirname.c ${CMAKE_CURRENT_SOURCE_DIR}/mysys/mf_fn_ext.c - ${CMAKE_CURRENT_SOURCE_DIR}/mysys/mf_format.c + ${CMAKE_CURRENT_SOURCE_DIR}/mysys/mf_format.c + ${CMAKE_CURRENT_SOURCE_DIR}/mysys/mf_getdate.c ${CMAKE_CURRENT_SOURCE_DIR}/mysys/mf_iocache.c ${CMAKE_CURRENT_SOURCE_DIR}/mysys/mf_iocache2.c - ${CMAKE_CURRENT_SOURCE_DIR}/mysys/mf_loadpath.c + ${CMAKE_CURRENT_SOURCE_DIR}/mysys/mf_keycache.c + ${CMAKE_CURRENT_SOURCE_DIR}/mysys/mf_keycaches.c + ${CMAKE_CURRENT_SOURCE_DIR}/mysys/mf_loadpath.c ${CMAKE_CURRENT_SOURCE_DIR}/mysys/mf_pack.c ${CMAKE_CURRENT_SOURCE_DIR}/mysys/mf_path.c + ${CMAKE_CURRENT_SOURCE_DIR}/mysys/mf_qsort.c + ${CMAKE_CURRENT_SOURCE_DIR}/mysys/mf_qsort2.c + ${CMAKE_CURRENT_SOURCE_DIR}/mysys/mf_radix.c + ${CMAKE_CURRENT_SOURCE_DIR}/mysys/mf_same.c + ${CMAKE_CURRENT_SOURCE_DIR}/mysys/mf_sort.c + ${CMAKE_CURRENT_SOURCE_DIR}/mysys/mf_soundex.c + ${CMAKE_CURRENT_SOURCE_DIR}/mysys/mf_arr_appstr.c + ${CMAKE_CURRENT_SOURCE_DIR}/mysys/mf_tempdir.c ${CMAKE_CURRENT_SOURCE_DIR}/mysys/mf_tempfile.c - ${CMAKE_CURRENT_SOURCE_DIR}/mysys/mf_unixpath.c + ${CMAKE_CURRENT_SOURCE_DIR}/mysys/mf_unixpath.c ${CMAKE_CURRENT_SOURCE_DIR}/mysys/mf_wcomp.c ${CMAKE_CURRENT_SOURCE_DIR}/mysys/mulalloc.c ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_access.c - ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_alloc.c + ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_aes.c + ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_alloc.c + ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_bit.c + ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_bitmap.c ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_chsize.c ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_compress.c + ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_copy.c ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_create.c ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_delete.c ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_div.c ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_error.c - ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_file.c + ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_file.c ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_fopen.c ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_fstream.c - ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_gethostbyname.c + ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_gethostbyname.c + ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_gethwaddr.c ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_getopt.c + ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_getsystime.c ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_getwd.c + ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_handler.c ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_init.c ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_lib.c + ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_lock.c ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_malloc.c - ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_messnc.c - ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_net.c - ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_once.c + ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_mess.c + ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_mkdir.c + ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_mmap.c + ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_once.c ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_open.c ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_pread.c ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_pthread.c - ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_read.c - ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_realloc.c + ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_quick.c + ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_read.c + ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_redel.c ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_rename.c - ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_seek.c - ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_static.c - ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_symlink.c + ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_seek.c + ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_sleep.c + ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_static.c + ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_symlink.c ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_symlink2.c + ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_sync.c ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_thr_init.c - ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_wincond.c - ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_winthread.c ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_write.c - ${CMAKE_CURRENT_SOURCE_DIR}/mysys/safemalloc.c + ${CMAKE_CURRENT_SOURCE_DIR}/mysys/ptr_cmp.c + ${CMAKE_CURRENT_SOURCE_DIR}/mysys/queues.c + ${CMAKE_CURRENT_SOURCE_DIR}/mysys/stacktrace.c + ${CMAKE_CURRENT_SOURCE_DIR}/mysys/rijndael.c ${CMAKE_CURRENT_SOURCE_DIR}/mysys/sha1.c ${CMAKE_CURRENT_SOURCE_DIR}/mysys/string.c + ${CMAKE_CURRENT_SOURCE_DIR}/mysys/thr_alarm.c + ${CMAKE_CURRENT_SOURCE_DIR}/mysys/thr_lock.c ${CMAKE_CURRENT_SOURCE_DIR}/mysys/thr_mutex.c + ${CMAKE_CURRENT_SOURCE_DIR}/mysys/thr_rwlock.c + ${CMAKE_CURRENT_SOURCE_DIR}/mysys/tree.c ${CMAKE_CURRENT_SOURCE_DIR}/mysys/typelib.c - ${CMAKE_CURRENT_SOURCE_DIR}/mysys/mf_qsort.c - ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_getsystime.c - ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_sync.c - ${CMAKE_CURRENT_SOURCE_DIR}/sql-common/client.c - ${CMAKE_CURRENT_SOURCE_DIR}/sql-common/my_time.c - ${CMAKE_CURRENT_SOURCE_DIR}/sql-common/pack.c - ${CMAKE_CURRENT_SOURCE_DIR}/sql/net_serv.cc - ${CMAKE_CURRENT_SOURCE_DIR}/sql/password.c - ${CMAKE_CURRENT_SOURCE_DIR}/strings/bchange.c - ${CMAKE_CURRENT_SOURCE_DIR}/strings/bmove.c - ${CMAKE_CURRENT_SOURCE_DIR}/strings/bmove_upp.c - ${CMAKE_CURRENT_SOURCE_DIR}/strings/ctype-big5.c - ${CMAKE_CURRENT_SOURCE_DIR}/strings/ctype-bin.c - ${CMAKE_CURRENT_SOURCE_DIR}/strings/ctype-cp932.c - ${CMAKE_CURRENT_SOURCE_DIR}/strings/ctype-czech.c - ${CMAKE_CURRENT_SOURCE_DIR}/strings/ctype-euc_kr.c - ${CMAKE_CURRENT_SOURCE_DIR}/strings/ctype-eucjpms.c - ${CMAKE_CURRENT_SOURCE_DIR}/strings/ctype-extra.c - ${CMAKE_CURRENT_SOURCE_DIR}/strings/ctype-gb2312.c - ${CMAKE_CURRENT_SOURCE_DIR}/strings/ctype-gbk.c - ${CMAKE_CURRENT_SOURCE_DIR}/strings/ctype-latin1.c - ${CMAKE_CURRENT_SOURCE_DIR}/strings/ctype-mb.c - ${CMAKE_CURRENT_SOURCE_DIR}/strings/ctype-simple.c - ${CMAKE_CURRENT_SOURCE_DIR}/strings/ctype-sjis.c - ${CMAKE_CURRENT_SOURCE_DIR}/strings/ctype-tis620.c - ${CMAKE_CURRENT_SOURCE_DIR}/strings/ctype-uca.c - ${CMAKE_CURRENT_SOURCE_DIR}/strings/ctype-ucs2.c - ${CMAKE_CURRENT_SOURCE_DIR}/strings/ctype-ujis.c - ${CMAKE_CURRENT_SOURCE_DIR}/strings/ctype-utf8.c - ${CMAKE_CURRENT_SOURCE_DIR}/strings/ctype-win1250ch.c - ${CMAKE_CURRENT_SOURCE_DIR}/strings/ctype.c - ${CMAKE_CURRENT_SOURCE_DIR}/strings/int2str.c - ${CMAKE_CURRENT_SOURCE_DIR}/strings/is_prefix.c - ${CMAKE_CURRENT_SOURCE_DIR}/strings/llstr.c - ${CMAKE_CURRENT_SOURCE_DIR}/strings/longlong2str.c - ${CMAKE_CURRENT_SOURCE_DIR}/strings/strinstr.c - ${CMAKE_CURRENT_SOURCE_DIR}/strings/strmake.c - ${CMAKE_CURRENT_SOURCE_DIR}/strings/strmov.c - ${CMAKE_CURRENT_SOURCE_DIR}/strings/strnlen.c - ${CMAKE_CURRENT_SOURCE_DIR}/strings/strnmov.c - ${CMAKE_CURRENT_SOURCE_DIR}/strings/strtod.c - ${CMAKE_CURRENT_SOURCE_DIR}/strings/strtoll.c - ${CMAKE_CURRENT_SOURCE_DIR}/strings/strtoull.c - ${CMAKE_CURRENT_SOURCE_DIR}/strings/strxmov.c - ${CMAKE_CURRENT_SOURCE_DIR}/strings/strxnmov.c - ${CMAKE_CURRENT_SOURCE_DIR}/strings/my_strtoll10.c - ${CMAKE_CURRENT_SOURCE_DIR}/strings/my_vsnprintf.c - ${CMAKE_CURRENT_SOURCE_DIR}/strings/str2int.c - ${CMAKE_CURRENT_SOURCE_DIR}/strings/str_alloc.c - ${CMAKE_CURRENT_SOURCE_DIR}/strings/strcend.c - ${CMAKE_CURRENT_SOURCE_DIR}/strings/strcont.c - ${CMAKE_CURRENT_SOURCE_DIR}/strings/strend.c - ${CMAKE_CURRENT_SOURCE_DIR}/strings/strfill.c - ${CMAKE_CURRENT_SOURCE_DIR}/strings/xml.c - ${CMAKE_CURRENT_SOURCE_DIR}/vio/vio.c - ${CMAKE_CURRENT_SOURCE_DIR}/vio/viosocket.c - ${CMAKE_CURRENT_SOURCE_DIR}/vio/viossl.c - ${CMAKE_CURRENT_SOURCE_DIR}/vio/viosslfactories.c - ${LIB_SOURCES} -) - -add_library(libmysql SHARED ${CLIENT_SOURCES} libmysql/libmysql.def) - -# Need to set USE_TLS for building the DLL, since __declspec(thread) -# approach to thread local storage does not work properly in DLLs. -set(mysql_COMPILE_DEFINITIONS - USE_TLS - HAVE_YASSL - YASSL_THREAD_SAFE - YASSL_PREFIX - CMAKE_CONFIGD - DEFAULT_BASEDIR="c:/Program Files/MySQL/" - DEFAULT_CHARSET_HOME="c:/Program Files/MySQL/MySQL Server ${MYSQL_BASE_VERSION}/" - PACKAGE="mysql" - SHAREDIR="share" - __NT__ + ${CMAKE_CURRENT_SOURCE_DIR}/mysys/base64.c + ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_memmem.c + ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_getpagesize.c + ${CMAKE_CURRENT_SOURCE_DIR}/mysys/lf_alloc-pin.c + ${CMAKE_CURRENT_SOURCE_DIR}/mysys/lf_dynarray.c + ${CMAKE_CURRENT_SOURCE_DIR}/mysys/lf_hash.c + ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_atomic.c + ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_getncpus.c + ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_rdtsc.c + ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_winthread.c + ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_wincond.c + ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_winerr.c + ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_winfile.c + ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_windac.c + ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_conio.c ) +if(HAVE_ALARM) + set(MYSYS_SOURCES ${MYSYS_SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_alarm.c) +endif() +if(HAVE_LARGE_PAGES) + set(MYSYS_SOURCES ${MYSYS_SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_largepage.c) +endif() +if(HAVE_MLOCK) + set(MYSYS_SOURCES ${MYSYS_SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/mysys/my_lockmem.c) +endif() -if(ENABLED_DEBUG_SYNC) - set(mysql_COMPILE_DEFINITIONS ${mysql_COMPILE_DEFINITIONS} ENABLED_DEBUG_SYNC) -endif(ENABLED_DEBUG_SYNC) - -if(EXTRA_DEBUG) - set(mysql_COMPILE_DEFINITIONS ${mysql_COMPILE_DEFINITIONS} EXTRA_DEBUG) -endif(EXTRA_DEBUG) - -set(mysql_COMPILE_DEFINITIONS_DEBUG - FORCE_INIT_OF_VARS - SAFEMALLOC - SAFE_MUTEX - ENABLED_DEBUG_SYNC +set(CLIENT_SOURCES + ${CMAKE_CURRENT_SOURCE_DIR}/libmysql/get_password.c + ${CMAKE_CURRENT_SOURCE_DIR}/libmysql/libmysql.c + ${CMAKE_CURRENT_SOURCE_DIR}/libmysql/errmsg.c + ${CMAKE_CURRENT_SOURCE_DIR}/sql-common/client.c + ${CMAKE_CURRENT_SOURCE_DIR}/sql-common/my_time.c + ${CMAKE_CURRENT_SOURCE_DIR}/sql-common/client_plugin.c + ${CMAKE_CURRENT_SOURCE_DIR}/sql/net_serv.cc + ${CMAKE_CURRENT_SOURCE_DIR}/sql-common/pack.c + ${CMAKE_CURRENT_SOURCE_DIR}/sql/password.c ) -set_target_properties(libmysql PROPERTIES COMPILE_DEFINITIONS "${mysql_COMPILE_DEFINITIONS}") -set_target_properties(libmysql PROPERTIES COMPILE_DEFINITIONS_DEBUG "${mysql_COMPILE_DEFINITIONS_DEBUG}") -set_target_properties(libmysql PROPERTIES COMPILE_DEFINITIONS_RELEASE DBUG_OFF) -set_target_properties(libmysql PROPERTIES COMPILE_DEFINITIONS_RELWITHDEBINFO DBUG_OFF) -set_target_properties(libmysql PROPERTIES COMPILE_DEFINITIONS_MINSIZEREL DBUG_OFF) +configure_file(config.h.cmake ${CMAKE_BINARY_DIR}/my_config.h) +configure_file(config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/include/internal/mysql_version.h.in ${CMAKE_BINARY_DIR}/mysql_version.h) -target_link_libraries(libmysql ${ZLIB_LIBRARIES} wsock32) +add_version_info(libmysql CLIENT_SOURCES) +add_library(libmysql SHARED ${CLIENT_SOURCES} ${DBUG_SOURCES} ${MYSYS_SOURCES} ${STRINGS_SOURCES} ${VIO_SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/libmysql/libmysql_exports.def) +target_link_libraries(libmysql zlib ${OPENSSL_LIBRARIES} ${OPENSSL_EXTRA_LIBRARIES} ws2_32) install(TARGETS libmysql RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}") \ No newline at end of file diff --git a/dep/mysqllite/ChangeLog b/dep/mysqllite/ChangeLog deleted file mode 100644 index 569b38133e7a4..0000000000000 --- a/dep/mysqllite/ChangeLog +++ /dev/null @@ -1,1641 +0,0 @@ ------------------------------------------------------------- -revno: 3472 [merge] -tags: clone-5.1.50-build -committer: Alfranio Correia -branch nick: mysql-5.1-security -timestamp: Tue 2010-08-03 12:52:02 +0100 -message: - auto-merge mysql-5.1-security (local) --> mysql-5.1-security - ------------------------------------------------------------ - revno: 3452.3.1 - committer: Alfranio Correia - branch nick: mysql-5.1-bugteam - timestamp: Mon 2010-08-02 20:48:56 +0100 - message: - BUG#55625 RBR breaks on failing 'CREATE TABLE' - - A CREATE...SELECT that fails is written to the binary log if a non-transactional - statement is updated. If the logging format is ROW, the CREATE statement and the - changes are written to the binary log as distinct events and by consequence the - created table is not rolled back in the slave. - - In this patch, we opted to let the slave goes out of sync by not writting to the - binary log the CREATE statement. We do this by simply reseting the binary log's - cache. ------------------------------------------------------------- -revno: 3471 [merge] -committer: Georgi Kodinov -branch nick: merge-5.1-security -timestamp: Mon 2010-08-02 11:03:41 +0300 -message: - merge - ------------------------------------------------------------ - revno: 1810.3987.35 [merge] - committer: Georgi Kodinov - branch nick: merge-5.0-security - timestamp: Mon 2010-08-02 10:45:43 +0300 - message: - merge ------------------------------------------------------------- -revno: 3470 [merge] -committer: Georgi Kodinov -branch nick: merge-5.1-security -timestamp: Mon 2010-08-02 10:50:15 +0300 -message: - merge mysql-5.1-bugteam into mysql-5.1-security - ------------------------------------------------------------ - revno: 3452.1.17 - committer: Davi Arnaut - branch nick: 42733-5.1 - timestamp: Fri 2010-07-30 17:33:10 -0300 - message: - Bug#45288: pb2 returns a lot of compilation warnings on linux - - Fix compiler warnings. - ------------------------------------------------------------ - revno: 3452.1.16 [merge] - committer: Luis Soares - branch nick: mysql-5.1-bugteam-push - timestamp: Fri 2010-07-30 15:32:28 +0100 - message: - Automerge mysql-5.1-bugteam into mysql-5.1-bugteam latest. - ------------------------------------------------------------ - revno: 3452.2.1 - committer: Luis Soares - branch nick: mysql-5.1-bugteam - timestamp: Fri 2010-07-30 14:44:39 +0100 - message: - Revert patch for BUG#34283. Causing lots of test failures in PB2, - mostly because existing test result files were not updated. - ------------------------------------------------------------ - revno: 3452.1.15 - committer: Georgi Kodinov - branch nick: B55188-5.1-bugteam - timestamp: Fri 2010-07-30 17:09:24 +0300 - message: - Disable the tests failing under valgrind because of bug #55503 - ------------------------------------------------------------ - revno: 3452.1.14 - committer: Georgi Kodinov - branch nick: B55188-5.1-bugteam - timestamp: Fri 2010-07-30 16:35:06 +0300 - message: - Bug #55188: GROUP BY, GROUP_CONCAT and TEXT - inconsistent results - - In order to be able to check if the set of the grouping fields in a - GROUP BY has changed (and thus to start a new group) the optimizer - caches the current values of these fields in a set of Cached_item - derived objects. - The Cached_item_str, used for caching varchar and TEXT columns, - is limited in length by the max_sort_length variable. - A String buffer to store the value with an alloced length of either - the max length of the string or the value of max_sort_length - (whichever is smaller) in Cached_item_str's constructor. - Then, at compare time the value of the string to compare to was - truncated to the alloced length of the string buffer inside - Cached_item_str. - This is all fine and valid, but only if you're not assigning - values near or equal to the alloced length of this buffer. - Because when assigning values like this the alloced length is - rounded up and as a result the next set of data will not match the - group buffer, thus leading to wrong results because of the changed - alloced_length. - Fixed by preserving the original maximum length in the - Cached_item_str's constructor and using this instead of the - alloced_length to limit the string to compare to. - Test case added. - ------------------------------------------------------------ - revno: 3452.1.13 [merge] - committer: Davi Arnaut - branch nick: mysql-5.1-bugteam - timestamp: Fri 2010-07-30 09:38:18 -0300 - message: - Merge of mysql-5.0-bugteam into mysql-5.1-bugteam. - ------------------------------------------------------------ - revno: 1810.3995.4 - committer: Davi Arnaut - branch nick: mysql-5.0-bugteam - timestamp: Fri 2010-07-30 09:34:40 -0300 - message: - Bug#54041: MySQL 5.0.92 fails when tests from Connector/C suite run - - Fix a regression (due to a typo) which caused spurious incorrect - argument errors for long data stream parameters if all forms of - logging were disabled (binary, general and slow logs). - ------------------------------------------------------------ - revno: 3452.1.12 - committer: Davi Arnaut - branch nick: mysql-5.1-bugteam - timestamp: Fri 2010-07-30 09:17:10 -0300 - message: - Bug#54041: MySQL 5.0.92 fails when tests from Connector/C suite run - - Fix a regression (due to a typo) which caused spurious incorrect - argument errors for long data stream parameters if all forms of - logging were disabled (binary, general and slow logs). - ------------------------------------------------------------ - revno: 3452.1.11 - committer: - branch nick: mysql-5.1-bugteam - timestamp: Fri 2010-07-30 11:59:34 +0800 - message: - Bug #34283 mysqlbinlog leaves tmpfile after termination if binlog contains load data infile - - With statement- or mixed-mode logging, "LOAD DATA INFILE" queries - are written to the binlog using special types of log events. - When mysqlbinlog reads such events, it re-creates the file in a - temporary directory with a generated filename and outputs a - "LOAD DATA INFILE" query where the filename is replaced by the - generated file. The temporary file is not deleted by mysqlbinlog - after termination. - - To fix the problem, in mixed mode we go to row-based. In SBR, we - document it to remind user the tmpfile is left in a temporary - directory. - ------------------------------------------------------------ - revno: 3452.1.10 - committer: Davi Arnaut - branch nick: 53463-5.1 - timestamp: Wed 2010-07-28 12:59:19 -0300 - message: - Bug#53463: YaSSL patch appears to be reverted - - The problem is that the fix Bug#29784 was mistakenly - reverted when updating YaSSL to a newer version. - - The solution is to re-apply the fix and this time - actually add a meaningful test case so that possible - regressions are caught. - ------------------------------------------------------------ - revno: 3452.1.9 [merge] - committer: Vasil Dimov - branch nick: mysql-5.1-bugteam - timestamp: Thu 2010-07-29 11:57:33 +0300 - message: - Merge mysql-5.1-innodb -> mysql-5.1-bugteam - ------------------------------------------------------------ - revno: 3351.14.179 [merge] - committer: Vasil Dimov - branch nick: mysql-5.1-innodb - timestamp: Thu 2010-07-29 11:51:00 +0300 - message: - Merge mysql-5.1-bugteam -> mysql-5.1-innodb - ------------------------------------------------------------ - revno: 3351.14.178 - committer: Jimmy Yang - branch nick: mysql-5.1-innodb - timestamp: Wed 2010-07-28 03:20:44 -0700 - message: - Fix bug #55581 by backporting fix of #52546 from mysql-trunk-innodb - to mysql-5.1-innodb plugin. - ------------------------------------------------------------ - revno: 3351.14.177 - committer: Vasil Dimov - branch nick: mysql-5.1-innodb - timestamp: Fri 2010-07-23 19:32:38 +0300 - message: - Increment InnoDB Plugin version to 1.0.11. - InnoDB Plugin 1.0.10 has been released with MySQL 5.1.49. - ------------------------------------------------------------ - revno: 3351.14.176 [merge] - committer: Vasil Dimov - branch nick: mysql-5.1-innodb - timestamp: Fri 2010-07-23 12:51:14 +0300 - message: - Merge mysql-5.1 -> mysql-5.1-innodb - ------------------------------------------------------------ - revno: 3351.14.175 [merge] - committer: Vasil Dimov - branch nick: mysql-5.1-innodb - timestamp: Fri 2010-07-09 15:15:09 +0300 - message: - Merge mysql-5.1 -> mysql-5.1-innodb - (no changes introduced by this merge) - ------------------------------------------------------------ - revno: 3351.14.174 - committer: Vasil Dimov - branch nick: mysql-5.1-innodb - timestamp: Wed 2010-07-07 20:51:30 +0300 - message: - Add the innodb_plugin tests to "make dist". - ------------------------------------------------------------ - revno: 3351.14.173 - committer: Jimmy Yang - branch nick: mysql-5.1-innodb - timestamp: Mon 2010-07-05 19:26:38 -0700 - message: - Add innodb_bug53756-master.opt for innodb_bug53756 test. - ------------------------------------------------------------ - revno: 3351.14.172 - committer: Jimmy Yang - branch nick: mysql-5.1-innodb - timestamp: Wed 2010-06-30 22:06:01 -0700 - message: - Port fix for bug #54311 from mysql-trunk-innodb to mysql-5.1-innodb codeline. - Bug #54311: Crash on CHECK PARTITION after concurrent LOAD DATA - and adaptive_hash_index=OFF - ------------------------------------------------------------ - revno: 3351.14.171 - committer: Marko Mäkelä - branch nick: 5.1-innodb - timestamp: Wed 2010-06-30 12:38:47 +0300 - message: - Bug#54358 follow-up: Correct some error handling. - ------------------------------------------------------------ - revno: 3351.14.170 - committer: Marko Mäkelä - branch nick: 5.1-innodb - timestamp: Wed 2010-06-30 12:31:49 +0300 - message: - Correct some comments that were added in the fix of Bug #54358 - (READ UNCOMMITTED access failure of off-page DYNAMIC or COMPRESSED columns). - - Records that lack incompletely written externally stored columns may - be accessed by READ UNCOMMITTED transaction even without involving a - crash during an INSERT or UPDATE operation. I verified this as follows. - - (1) added a delay after the mini-transaction for writing the clustered - index 'stub' record was committed (patch attached) - (2) started mysqld in gdb, setting breakpoints to the where the - assertions about READ UNCOMMITTED were added in the bug fix - (3) invoked ibtest3 --create-options=key_block_size=2 - to create BLOBs in a COMPRESSED table - (4) invoked the following: - yes 'set transaction isolation level read uncommitted; - checksum table blobt3;select sleep(1);'|mysql -uroot test - (5) noted that one of the breakpoints was triggered - (return(NULL) in btr_rec_copy_externally_stored_field()) - - === modified file 'storage/innodb_plugin/row/row0ins.c' - --- storage/innodb_plugin/row/row0ins.c 2010-06-30 08:17:25 +0000 - +++ storage/innodb_plugin/row/row0ins.c 2010-06-30 08:17:25 +0000 - @@ -2120,6 +2120,7 @@ function_exit: - rec_t* rec; - ulint* offsets; - mtr_start(&mtr); - + os_thread_sleep(5000000); - - btr_cur_search_to_nth_level(index, 0, entry, PAGE_CUR_LE, - BTR_MODIFY_TREE, &cursor, 0, - - === modified file 'storage/innodb_plugin/row/row0upd.c' - --- storage/innodb_plugin/row/row0upd.c 2010-06-30 08:11:55 +0000 - +++ storage/innodb_plugin/row/row0upd.c 2010-06-30 08:11:55 +0000 - @@ -1763,6 +1763,7 @@ row_upd_clust_rec( - rec_offs_init(offsets_); - - mtr_start(mtr); - + os_thread_sleep(5000000); - - ut_a(btr_pcur_restore_position(BTR_MODIFY_TREE, pcur, mtr)); - rec = btr_cur_get_rec(btr_cur); - ------------------------------------------------------------ - revno: 3351.14.169 - committer: Marko Mäkelä - branch nick: 5.1-innodb - timestamp: Tue 2010-06-29 16:12:19 +0300 - message: - ChangeLog entry for Bug #54408 - ------------------------------------------------------------ - revno: 3351.14.168 - committer: Marko Mäkelä - branch nick: 5.1-innodb - timestamp: Tue 2010-06-29 16:00:58 +0300 - message: - Bug#54408: txn rollback after recovery: row0umod.c:673 - dict_table_get_format(index->table) - - The REDUNDANT and COMPACT formats store a local 768-byte prefix of - each externally stored column. No row_ext cache is needed, but we - initialized one nevertheless. When the BLOB pointer was zero, we would - ignore the locally stored prefix as well. This triggered an assertion - failure in row_undo_mod_upd_exist_sec(). - - row_build(): Allow ext==NULL when a REDUNDANT or COMPACT table - contains externally stored columns. - - row_undo_search_clust_to_pcur(), row_upd_store_row(): Invoke - row_build() with ext==NULL on REDUNDANT and COMPACT tables. - - rb://382 approved by Jimmy Yang - ------------------------------------------------------------ - revno: 3351.14.167 - committer: Marko Mäkelä - branch nick: 5.1-innodb - timestamp: Tue 2010-06-29 15:56:53 +0300 - message: - ChangeLog entry for Bug #54358 - ------------------------------------------------------------ - revno: 3351.14.166 - committer: Marko Mäkelä - branch nick: 5.1-innodb - timestamp: Tue 2010-06-29 15:55:18 +0300 - message: - Bug#54358: READ UNCOMMITTED access failure of off-page DYNAMIC or COMPRESSED - columns - - When the server crashes after a record stub has been inserted and - before all its off-page columns have been written, the record will - contain incomplete off-page columns after crash recovery. Such records - may only be accessed at the READ UNCOMMITTED isolation level or when - rolling back a recovered transaction in recv_recovery_rollback_active(). - Skip these records at the READ UNCOMMITTED isolation level. - - TODO: Add assertions for checking the above assumptions hold when an - incomplete BLOB is encountered. - - btr_rec_copy_externally_stored_field(): Return NULL if the field is - incomplete. - - row_prebuilt_t::templ_contains_blob: Clarify what "BLOB" means in this - context. Hint: MySQL BLOBs are not the same as InnoDB BLOBs. - - row_sel_store_mysql_rec(): Return FALSE if not all columns could be - retrieved. Previously this function always returned TRUE. Assert that - the record is not delete-marked. - - row_sel_push_cache_row_for_mysql(): Return FALSE if not all columns - could be retrieved. - - row_search_for_mysql(): Skip records containing incomplete off-page - columns. Assert that the transaction isolation level is READ - UNCOMMITTED. - - rb://380 approved by Jimmy Yang - ------------------------------------------------------------ - revno: 3351.14.165 - committer: Jimmy Yang - branch nick: mysql-5.1-innodb - timestamp: Mon 2010-06-28 19:41:37 -0700 - message: - Check in fix for bug #53756: "ALTER TABLE ADD PRIMARY KEY affects - crash recovery" - - rb://369 approved by Marko - ------------------------------------------------------------ - revno: 3452.1.8 - committer: Alexander Barkov - branch nick: mysql-5.1-bugteam.b45012 - timestamp: Thu 2010-07-29 10:12:44 +0400 - message: - Postfix for BUG#45012. - - Problem: The original patch didn't compile on debug_werror - due to wrong format in printf("%d") for size_t variables. - - Fix: Adding cast to (int). - ------------------------------------------------------------ - revno: 3452.1.7 - committer: - branch nick: mysql-5.1-bugteam - timestamp: Thu 2010-07-29 11:00:57 +0800 - message: - BUG#49124 Security issue with /*!-versioned */ SQL statements on Slave - - /*![:version:] Query Code */, where [:version:] is a sequence of 5 - digits representing the mysql server version(e.g /*!50200 ... */), - is a special comment that the query in it can be executed on those - servers whose versions are larger than the version appearing in the - comment. It leads to a security issue when slave's version is larger - than master's. A malicious user can improve his privileges on slaves. - Because slave SQL thread is running with SUPER privileges, so it can - execute queries that he/she does not have privileges on master. - - This bug is fixed with the logic below: - - To replace '!' with ' ' in the magic comments which are not applied on - master. So they become common comments and will not be applied on slave. - - - Example: - 'INSERT INTO t1 VALUES (1) /*!10000, (2)*/ /*!99999 ,(3)*/ - will be binlogged as - 'INSERT INTO t1 VALUES (1) /*!10000, (2)*/ /* 99999 ,(3)*/ - ------------------------------------------------------------ - revno: 3452.1.6 - committer: Davi Arnaut - branch nick: mysql-5.1-bugteam - timestamp: Fri 2010-07-23 21:55:03 -0300 - message: - Bug#55501: Disable innodb plugin usage in the embedded server on certain OSes - - Do not attempt to test the innodb plugin with the embedded server, - it's not supported for now. - ------------------------------------------------------------ - revno: 3452.1.5 [merge] - committer: Sven Sandberg - branch nick: 5.1-bugteam - timestamp: Mon 2010-07-26 11:56:30 +0200 - message: - merged BUG#55322 to 5.1-bugteam - ------------------------------------------------------------ - revno: 3408.1.4 - committer: Sven Sandberg - branch nick: 5.1 - timestamp: Tue 2010-07-20 17:27:13 +0200 - message: - BUG#55322: SHOW BINLOG EVENTS increases @@SESSION.MAX_ALLOWED_PACKET - - Problem: when SHOW BINLOG EVENTS was issued, it increased the value of - @@session.max_allowed_packet. This allowed a non-root user to increase - the amount of memory used by her thread arbitrarily. Thus, it removes - the bound on the amount of system resources used by a client, so it - presents a security risk (DoS attack). - - Fix: it is correct to increase the value of @@session.max_allowed_packet - while executing SHOW BINLOG EVENTS (see BUG 30435). However, the - increase should only be temporary. Thus, the fix is to restore the value - when SHOW BINLOG EVENTS ends. - The value of @@session.max_allowed_packet is also increased in - mysql_binlog_send (i.e., the binlog dump thread). It is not clear if this - can cause any trouble, since normally the client that issues - COM_BINLOG_DUMP will not issue any other commands that would be affected - by the increased value of @@session.max_allowed_packet. However, we - restore the value just in case. - ------------------------------------------------------------ - revno: 3452.1.4 - committer: Alexander Barkov - branch nick: mysql-5.1-bugteam.b45012 - timestamp: Mon 2010-07-26 09:06:18 +0400 - message: - Bug#45012 my_like_range_cp932 generates invalid string - - Problem: The functions my_like_range_xxx() returned - badly formed maximum strings for Asian character sets, - which made problems for storage engines. - - Fix: - - Removed a number my_like_range_xxx() implementations, - which were in fact dumplicate code pieces. - - Using generic my_like_range_mb() instead. - - Setting max_sort_char member properly for Asian character sets - - Adding unittest/strings/strings-t.c, - to test that my_like_range_xxx() return well-formed - min and max strings. - - Notes: - - - No additional tests in mysql/t/ available. - Old tests cover the affected code well enough. - ------------------------------------------------------------ - revno: 3452.1.3 [merge] - committer: Dmitry Shulga - branch nick: 5.1-bugteam-bug42496 - timestamp: Fri 2010-07-23 18:15:56 +0700 - message: - Merge 5.1-bugteam -> 5.1-bug-42496 - ------------------------------------------------------------ - revno: 3457.4.2 [merge] - committer: kevin.lewis@oracle.com - branch nick: mysql-5.1-bugteam - timestamp: Thu 2010-07-22 11:17:26 -0500 - message: - Merge - ------------------------------------------------------------ - revno: 3457.4.1 - committer: kevin.lewis@oracle.com - branch nick: mysql-5.1-bugteam - timestamp: Thu 2010-07-22 11:15:15 -0500 - message: - Bug#49542 - Do as the comment suggests and downgrade directory errors from find_file() to a warning unless they happen during a SHOW command. - ------------------------------------------------------------ - revno: 3452.1.2 - committer: Dmitry Shulga - branch nick: 5.1-bugteam-bug42496 - timestamp: Wed 2010-07-21 14:56:43 +0700 - message: - Fixed bug #42496 - the server could crash on a debug assert after a failure - to write into a closed socket - ------------------------------------------------------------ - revno: 3452.1.1 - committer: Dmitry Shulga - branch nick: 5.1-bugteam-bug51855 - timestamp: Tue 2010-06-29 16:32:03 +0700 - message: - Fixed bug #51855. Race condition in XA START. If several threads - concurrently execute the statement XA START 'x', then mysqld - server could crash. ------------------------------------------------------------- -revno: 3469 -committer: Gleb Shchepa -branch nick: mysql-5.1-security -timestamp: Sun 2010-08-01 22:12:36 +0400 -message: - Bug #54461: crash with longblob and union or update with subquery - - Queries may crash, if - 1) the GREATEST or the LEAST function has a mixed list of - numeric and LONGBLOB arguments and - 2) the result of such a function goes through an intermediate - temporary table. - - An Item that references a LONGBLOB field has max_length of - UINT_MAX32 == (2^32 - 1). - - The current implementation of GREATEST/LEAST returns REAL - result for a mixed list of numeric and string arguments (that - contradicts with the current documentation, this contradiction - was discussed and it was decided to update the documentation). - - The max_length of such a function call was calculated as a - maximum of argument max_length values (i.e. UINT_MAX32). - - That max_length value of UINT_MAX32 was used as a length for - the intermediate temporary table Field_double to hold - GREATEST/LEAST function result. - - The Field_double::val_str() method call on that field - allocates a String value. - - Since an allocation of String reserves an additional byte - for a zero-termination, the size of String buffer was - set to (UINT_MAX32 + 1), that caused an integer overflow: - actually, an empty buffer of size 0 was allocated. - - An initialization of the "first" byte of that zero-size - buffer with '\0' caused a crash. - - The Item_func_min_max::fix_length_and_dec() has been - modified to calculate max_length for the REAL result like - we do it for arithmetical operators. - - - ****** - Bug #54461: crash with longblob and union or update with subquery - - Queries may crash, if - 1) the GREATEST or the LEAST function has a mixed list of - numeric and LONGBLOB arguments and - 2) the result of such a function goes through an intermediate - temporary table. - - An Item that references a LONGBLOB field has max_length of - UINT_MAX32 == (2^32 - 1). - - The current implementation of GREATEST/LEAST returns REAL - result for a mixed list of numeric and string arguments (that - contradicts with the current documentation, this contradiction - was discussed and it was decided to update the documentation). - - The max_length of such a function call was calculated as a - maximum of argument max_length values (i.e. UINT_MAX32). - - That max_length value of UINT_MAX32 was used as a length for - the intermediate temporary table Field_double to hold - GREATEST/LEAST function result. - - The Field_double::val_str() method call on that field - allocates a String value. - - Since an allocation of String reserves an additional byte - for a zero-termination, the size of String buffer was - set to (UINT_MAX32 + 1), that caused an integer overflow: - actually, an empty buffer of size 0 was allocated. - - An initialization of the "first" byte of that zero-size - buffer with '\0' caused a crash. - - The Item_func_min_max::fix_length_and_dec() has been - modified to calculate max_length for the REAL result like - we do it for arithmetical operators. ------------------------------------------------------------- -revno: 3468 -committer: Alexey Kopytov -branch nick: mysql-5.1-security -timestamp: Fri 2010-07-23 15:52:54 +0400 -message: - Bug #54476: crash when group_concat and 'with rollup' in - prepared statements - - Using GROUP_CONCAT() together with the WITH ROLLUP modifier - could crash the server. - - The reason was a combination of several facts: - - 1. The Item_func_group_concat class stores pointers to ORDER - objects representing the columns in the ORDER BY clause of - GROUP_CONCAT(). - - 2. find_order_in_list() called from - Item_func_group_concat::setup() modifies the ORDER objects so - that their 'item' member points to the arguments list - allocated in the Item_func_group_concat constructor. - - 3. In some cases (e.g. in JOIN::rollup_make_fields) a copy of - the original Item_func_group_concat object could be created by - using the Item_func_group_concat::Item_func_group_concat(THD - *thd, Item_func_group_concat *item) copy constructor. The - latter essentially creates a shallow copy of the source - object. Memory for the arguments array is allocated on - thd->mem_root, but the pointers for arguments and ORDER are - copied verbatim. - - What happens in the test case is that when executing the query - for the first time, after a copy of the original - Item_func_group_concat object has been created by - JOIN::rollup_make_fields(), find_order_in_list() is called for - this new object. It then resolves ORDER BY by modifying the - ORDER objects so that they point to elements of the arguments - array which is local to the cloned object. When thd->mem_root - is freed upon completing the execution, pointers in the ORDER - objects become invalid. Those ORDER objects, however, are also - shared with the original Item_func_group_concat object which is - preserved between executions of a prepared statement. So the - first call to find_order_in_list() for the original object on - the second execution tries to dereference an invalid pointer. - - The solution is to create copies of the ORDER objects when - copying Item_func_group_concat to not leave any stale pointers - in other instances with different lifecycles. ------------------------------------------------------------- -revno: 3467 [merge] -committer: Georgi Kodinov -branch nick: merge-5.1-security -timestamp: Wed 2010-07-21 18:56:48 +0300 -message: - merge - ------------------------------------------------------------ - revno: 1810.3987.34 [merge] - committer: Georgi Kodinov - branch nick: merge-5.0-security - timestamp: Wed 2010-07-21 18:49:24 +0300 - message: - merge ------------------------------------------------------------- -revno: 3466 [merge] -committer: Georgi Kodinov -branch nick: merge-5.1-security -timestamp: Wed 2010-07-21 18:54:11 +0300 -message: - merge - ------------------------------------------------------------ - revno: 3457.1.42 [merge] - committer: Georgi Kodinov - branch nick: merge-5.1-bugteam - timestamp: Wed 2010-07-21 18:36:10 +0300 - message: - merge - ------------------------------------------------------------ - revno: 1810.3995.3 [merge] - committer: Georgi Kodinov - branch nick: merge-5.0-bugteam - timestamp: Wed 2010-07-21 18:31:28 +0300 - message: - merge - ------------------------------------------------------------ - revno: 3457.1.41 [merge] - committer: Georgi Kodinov - branch nick: merge-5.1-bugteam - timestamp: Wed 2010-07-21 18:34:20 +0300 - message: - merge - ------------------------------------------------------------ - revno: 3457.1.40 - committer: Georgi Kodinov - branch nick: fix-5.1-bugteam - timestamp: Wed 2010-07-21 18:05:57 +0300 - message: - Addendum #4 to bug #53095 - - SHOW DATABASES LIKE ... was not converting to lowercase on comparison as the - documentation is suggesting. - Fixed it to behave similarly to SHOW TABLES LIKE ... and updated the failing - on MacOSX lowercase_table2 test case. - ------------------------------------------------------------ - revno: 3457.1.39 [merge] - committer: Alexey Kopytov - branch nick: mysql-5.1-bugteam - timestamp: Wed 2010-07-21 14:14:11 +0400 - message: - Automerge. - ------------------------------------------------------------ - revno: 3457.3.1 - committer: Alexey Kopytov - branch nick: 55061-5.1-bugteam - timestamp: Mon 2010-07-12 18:58:55 +0400 - message: - Bug#55061: Build failing on sol 8 x86 - assembler code vs - compiler problem - - GCC-style inline assembly is not supported by the Sun Studio - compilers prior to version 12. - - Added a check for the Sun Studio version to avoid using - _FPU_GETCW() / _FPU_SETCW() when inline assembly is - unsupported. This can lead to some differences in floating - point calculations on Solaris 8/x86 which, however, is not worth - bothering with Sun-style assembly .il templates. - ------------------------------------------------------------ - revno: 3457.1.38 - committer: Davi Arnaut - branch nick: 45288-5.1 - timestamp: Tue 2010-07-20 15:07:36 -0300 - message: - Bug#45288: pb2 returns a lot of compilation warnings on linux - - Fix warnings flagged by the new warning option -Wunused-but-set-variable - that was added to GCC 4.6 and that is enabled by -Wunused and -Wall. The - option causes a warning whenever a local variable is assigned to but is - later unused. It also warns about meaningless pointer dereferences. - ------------------------------------------------------------ - revno: 3457.1.37 - committer: Davi Arnaut - branch nick: 52514-5.1 - timestamp: Tue 2010-07-20 14:44:29 -0300 - message: - Bug#52514: mysql 5.1 do_abi_check does not compile w/ gcc4.5 - due to GCC preprocessor change - - The problem is that newer GCC versions treats missing headers - as fatal errors. The solution is to use a guard macro to prevent - the inclusion of system headers when checking the ABI with the - C Preprocessor. - - Reference: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15638 - http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44836 - ------------------------------------------------------------ - revno: 3457.1.36 - committer: Davi Arnaut - branch nick: 54453-5.1 - timestamp: Tue 2010-07-20 14:36:15 -0300 - message: - Bug#54453: Failing assertion: trx->active_trans when renaming a - table with active trx - - Essentially, the problem is that InnoDB does a implicit commit - when a cursor (table handler) is unlocked/closed, creating - a dissonance between the transaction state within the server - layer and the storage engine layer. Theoretically, a statement - transaction can encompass several table instances in a similar - manner to a multiple statement transaction, hence it does not - make sense to limit a statement transaction to the lifetime of - the table instances (cursors) used within it. - - Since this particular instance of the problem is only triggerable - on 5.1 and is masked on 5.5 due 2PC being skipped (assertion is in - the prepare phase of a 2PC), the solution (which is less risky) is - to explicitly end the transaction before the cached table is unlock - on rename table. - - The patch is to be null merged into trunk. - ------------------------------------------------------------ - revno: 3457.1.35 [merge] - committer: Davi Arnaut - branch nick: mysql-5.1-bugteam - timestamp: Mon 2010-07-19 15:34:28 -0300 - message: - Merge of mysql-5.1 into mysql-5.1-bugteam. - ------------------------------------------------------------ - revno: 3457.1.34 - committer: Jon Olav Hauglid - branch nick: mysql-5.1-bugteam-bug54734 - timestamp: Mon 2010-07-19 11:03:52 +0200 - message: - Bug #54734 assert in Diagnostics_area::set_ok_status - - This assert checks that the server does not try to send OK to the - client if there has been some error during processing. This is done - to make sure that the error is in fact sent to the client. - - The problem was that view errors during processing of WHERE conditions - in UPDATE statements where not detected by the update code. It therefore - tried to send OK to the client, triggering the assert. - The bug was only noticeable in debug builds. - - This patch fixes the problem by making sure that the update code - checks for errors during condition processing and acts accordingly. - ------------------------------------------------------------ - revno: 3457.1.33 - committer: Davi Arnaut - branch nick: mysql-5.1-bugteam - timestamp: Fri 2010-07-16 14:33:35 -0300 - message: - Bug#48327: Some crashes specific to FreeBSD ("embedded") - Bug#47139: Test "merge" crashes in "embedded" run - - Backport patch for Bug#47139 - ------------------------------------------------------------ - revno: 3457.1.32 - committer: Georgi Kodinov - branch nick: fix-5.1-bugteam - timestamp: Fri 2010-07-16 16:56:33 +0300 - message: - Addendum to bug #53814 : test results updates - ------------------------------------------------------------ - revno: 3457.1.31 - committer: Ramil Kalimullin - branch nick: mysql-5.1-bugteam - timestamp: Fri 2010-07-16 11:15:22 +0400 - message: - Fix for bug #50667: The InnoDB plugin prevents initialization - of the "embedded" server - - Problem: mysqltest_embedded failed to load ha_innodb_plugin library - on some platforms (due to some unresolved references). - - Fix: on FreeBSD use -export-dynamic flag building mysqltest_embedded. - That allows to use its global symbols to resolve references in the - dynamically loaded plugin library. - ------------------------------------------------------------ - revno: 3457.1.30 - committer: Georgi Kodinov - branch nick: B53814-5.1-bugteam - timestamp: Wed 2010-06-23 19:25:31 +0300 - message: - Bug #53814: NUMERIC_PRECISION for unsigned bigint field is 19, - should be 20 - - Fixed the numeric precision of the unsigned BIGINT column to - be 20 instead of 19. - ------------------------------------------------------------ - revno: 3457.1.29 [merge] - committer: Alexey Kopytov - branch nick: mysql-5.1-bugteam - timestamp: Thu 2010-07-15 17:01:44 +0400 - message: - Manual merge. - ------------------------------------------------------------ - revno: 1810.3995.2 - committer: Alexey Kopytov - branch nick: mysql-5.0-bugteam - timestamp: Thu 2010-07-15 10:10:16 +0400 - message: - Backport of the fix for bug#25421 to 5.0. - - Calculating the estimated number of records for a range scan - may take a significant time, and it was impossible for a user - to interrupt that process by killing the connection or the - query. - - Fixed by checking the thread's 'killed' status in - check_quick_keys() and interrupting the calculation process if - it is set to a non-zero value. - ------------------------------------------------------------ - revno: 3457.1.28 [merge] - committer: Alexey Kopytov - branch nick: mysql-5.1-bugteam - timestamp: Thu 2010-07-15 16:39:48 +0400 - message: - Null merge. - ------------------------------------------------------------ - revno: 1810.3995.1 - committer: Vasil Dimov - branch nick: mysql-5.0-bugteam - timestamp: Wed 2010-07-07 20:13:53 +0300 - message: - Merge the fix for Bug#49238 from SVN - (without the unrelated whitespace changes): - - ------------------------------------------------------------------------ - r7009 | jyang | 2010-04-29 20:44:56 +0300 (Thu, 29 Apr 2010) | 6 lines - - branches/5.0: Port fix for bug #49238 (Creating/Dropping a temporary - table while at 1023 transactions will cause assert) from 5.1 to - branches/5.1. Separate action for return value DB_TOO_MANY_CONCURRENT_TRXS - from that of DB_MUST_GET_MORE_FILE_SPACE in row_drop_table_for_mysql(). - - - ------------------------------------------------------------------------ - ------------------------------------------------------------ - revno: 3457.1.27 - committer: Davi Arnaut - branch nick: mysql-5.1-bugteam - timestamp: Wed 2010-07-14 16:39:40 -0300 - message: - Bug#42733: Type-punning warnings when compiling MySQL -- - strict aliasing violations. - - Post-merge fix: include my_compiler.h before my_attribute.h - as the latter will undef __attribute__ if the compiler is not - GCC. Based on the compiler version, in my_compiler.h we know - for sure whether the aligned attribute is supported. Furthermore, - undefining attribute might cause bugs if some system header - uses it. - ------------------------------------------------------------ - revno: 3457.1.26 - committer: Davi Arnaut - branch nick: 42733-5.1 - timestamp: Wed 2010-07-14 09:27:13 -0300 - message: - Bug#42733: Type-punning warnings when compiling MySQL -- - strict aliasing violations. - - Another rather noisy violation of strict aliasing rules - is the spatial code which makes use of stack-based memory - (of type Geometry_buffer) to provide placement for Geometry - objects. Although a placement new is allowed to dynamically - change the type of a object, the object returned by the - new placement was being ignored and the original stack-based - object was being casted to the new type, thus violating strict - aliasing rules. - - The solution is to reorganize the code so that the object - returned by the new placement is used instead of casting the - original object. Also, to ensure that the stack-based object - is properly aligned with respect to the objects it provides - placement for, a set of compiler-dependent macros and types - are introduced so that the alignment of objects can be inquired - and specified. - ------------------------------------------------------------ - revno: 3457.1.25 - committer: Davi Arnaut - branch nick: 48327-5.1 - timestamp: Wed 2010-07-14 10:10:12 -0300 - message: - Bug#48327: Some crashes specific to FreeBSD ("embedded") - - Backport fixes from ndb: Rework the constructors of some static - object's to not call dbug functions since the constructors will - be called before main, and consequently, before the dbug library - is initialized. - ------------------------------------------------------------ - revno: 3457.1.24 - committer: Georgi Kodinov - branch nick: B51876-5.1-bugteam - timestamp: Wed 2010-07-14 14:54:51 +0300 - message: - Bug #51876: crash/memory underrun when loading data with ucs2 - and reverse() function - - 3 problems fixed : - 1. The reported problem : caused by incorrect parsing of - the file as ucs data resulting in wrong length of the parsed - string. Fixed by truncating the invalid trailing bytes - (non-complete multibyte characters) when reading from the file - 2. LOAD DATA when reading from a proper UCS2 file wasn't - recognizing the new line characters. Fixed by first looking - if a byte is a new line (or any other special) character before - reading it as a part of a multibyte character. - 3. When using user variables to hold the column data in LOAD - DATA the character set of the user variable was set incorrectly - to the database charset. Fixed by setting it to the charset - specified by LOAD DATA (if any). - ------------------------------------------------------------ - revno: 3457.1.23 - committer: Georgi Kodinov - branch nick: B53493-5.1-bugteam - timestamp: Wed 2010-07-14 11:50:17 +0300 - message: - Bug #53493 : add_to_status does not handle the longlong fields in STATUS_VAR - - bytes_received/bytes_sent are ulonglong so they cannot be handled by the - ulong handling code in add_to_status/add_diff_to_status(). - - Fixed by adding code to handle these two variables in - add_to_status()/add_diff_to_status() and making sure they are not a subject - to the ulong handling code. - ------------------------------------------------------------ - revno: 3457.1.22 - committer: Georgi Kodinov - branch nick: B54004-5.1-bugteam - timestamp: Wed 2010-07-14 13:53:49 +0300 - message: - Bug #54004 : mysql_secure_installation identifies "local host" incorrectly - - The removal of non-local root users is overzealous in - mysql_secure_installation. (Bug #54004) - ------------------------------------------------------------ - revno: 3457.1.21 - committer: Georgi Kodinov - branch nick: B52274-5.1-bugteam - timestamp: Fri 2010-07-09 14:11:12 +0300 - message: - Bug #52274 : Missing path to mysql in mysql_secure_installation - - Added some code to try to find the mysql command line in the most - common places and stop if it's not there. - ------------------------------------------------------------ - revno: 3457.1.20 - committer: Davi Arnaut - branch nick: mysql-5.1-bugteam - timestamp: Fri 2010-07-09 16:37:52 -0300 - message: - Use UNINIT_VAR workaround instead of LINT_INIT. - ------------------------------------------------------------ - revno: 3457.1.19 [merge] - committer: Mattias Jonsson - branch nick: topush-51-bugteam - timestamp: Fri 2010-07-09 15:00:33 +0200 - message: - merge - ------------------------------------------------------------ - revno: 3392.5.1 - committer: Mattias Jonsson - branch nick: b52517-51-bugteam - timestamp: Fri 2010-07-09 13:15:26 +0200 - message: - Bug#52517: Regression in ROW level replication performance with partitions - - In bug-28430 HA_PRIMARY_KEY_REQUIRED_FOR_POSITION - was disabled in the partitioning engine in the first patch, - That bug was later fixed a second time, but that flag - was not removed. - - No need to disable this flag, as it leads to bad - choise in row replication. - ------------------------------------------------------------ - revno: 3457.1.18 [merge] - committer: Mattias Jonsson - branch nick: topush-51-bugteam - timestamp: Fri 2010-07-09 14:59:40 +0200 - message: - merge - ------------------------------------------------------------ - revno: 3457.2.1 - committer: Mattias Jonsson - branch nick: b52455-51-bt - timestamp: Fri 2010-07-09 01:09:31 +0200 - message: - Bug#52455: Subpar INSERT ON DUPLICATE KEY UPDATE performance with many partitions - - The handler function for reading one row from a specific index - was not optimized in the partitioning handler since it - used the default implementation. - - No test case since it is performance only, verified by hand. - ------------------------------------------------------------ - revno: 3457.1.17 - committer: Davi Arnaut - branch nick: mysql-5.1-bugteam - timestamp: Fri 2010-07-09 09:51:21 -0300 - message: - Remove AC_LANG_WERROR, it causes trouble earlier versions - of autoconf and is not strictly needed for now. - ------------------------------------------------------------ - revno: 3457.1.16 - committer: Georgi Kodinov - branch nick: fix-5.1-bugteam - timestamp: Fri 2010-07-09 15:17:47 +0300 - message: - Addendum #2 to bug #53095 : fixed a bad testcase result. - ------------------------------------------------------------ - revno: 3457.1.15 - committer: Davi Arnaut - branch nick: 53445-5.1 - timestamp: Fri 2010-07-09 09:00:17 -0300 - message: - Bug#45288: pb2 returns a lot of compilation warnings on linux - - Although the C standard mandates that sprintf return the number - of bytes written, some very ancient systems (i.e. SunOS 4) - returned a pointer to the buffer instead. Since these systems - are not supported anymore and are hopefully long dead by now, - simply remove the portability wrapper that dealt with this - discrepancy. The autoconf check was causing trouble with GCC. - ------------------------------------------------------------ - revno: 3457.1.14 - committer: Davi Arnaut - branch nick: 53445-5.1 - timestamp: Fri 2010-07-09 08:37:51 -0300 - message: - Bug#53445: Build with -Wall and fix warnings that it generates - - Introduce a MySQL maintainer/developer mode that enables - a set of warning options for the C/C++ compiler. This mode - is intended to help improve the overall quality of the code. - - The warning options are: - - C_WARNINGS="-Wall -Wextra -Wunused -Wwrite-strings -Werror" - CXX_WARNINGS="$C_WARNINGS -Wno-unused-parameter" - - Since -Wall is essentially a moving target, autoconf checks - are not run with warning options enabled, in particualr -Werror. - This decision might be revisited in the future. The patch also - fixes a mistake in the makefiles, where automake CXXFLAGS would - be set to CFLAGS. - ------------------------------------------------------------ - revno: 3457.1.13 - committer: Sergey Glukhov - branch nick: mysql-5.1-bugteam - timestamp: Fri 2010-07-09 14:39:47 +0400 - message: - Bug#54416 MAX from JOIN with HAVING returning NULL with 5.1 and Empty set - The problem there is that HAVING condition evaluates const - parts of condition despite the condition has references - on aggregate functions. Table t1 became const tables - after make_join_statistics and table1.pk = 1, HAVING is - transformed into MAX(1) < 7 and taken away from HAVING. - The fix is to skip evaluation of HAVING conts parts if - HAVING condition has references on aggregate functions. - ------------------------------------------------------------ - revno: 3457.1.12 - committer: - branch nick: mysql-5.1-bugteam - timestamp: Thu 2010-07-08 10:44:26 +0800 - message: - Postfix bug#48321 - Fix the memory leak - ------------------------------------------------------------ - revno: 3457.1.11 - committer: Georgi Kodinov - branch nick: fix-5.1-bugteam - timestamp: Wed 2010-07-07 12:15:58 +0300 - message: - Addendum to the fix for bug #53095 (failing information_schema.test on windows) - - Since the original fix for this bug lowercases the search pattern it's not a - good idea to copy the search pattern to the output instead of the real table - name found (since, depending on the case mode these two names may differ in - case). - Fixed the infrmation_schema.test failure by making sure the actual table - name of an inoformation schema table is passed instead of the lookup pattern - even when the pattern doesn't contain wildcards. - ------------------------------------------------------------ - revno: 3457.1.10 - committer: Davi Arnaut - branch nick: mysql-5.1-bugteam - timestamp: Tue 2010-07-06 19:31:54 -0300 - message: - Fix what is probably the result of a bad merge. No functional change. - ------------------------------------------------------------ - revno: 3457.1.9 - committer: Davi Arnaut - branch nick: 52514-5.1 - timestamp: Tue 2010-07-06 15:36:31 -0300 - message: - Bug#52514: mysql 5.1 do_abi_check does not compile w/ gcc4.5 - due to GCC preprocessor change - - Temporary workaround: disable abi_check if GCC >= 4.5 - ------------------------------------------------------------ - revno: 3457.1.8 - committer: Davi Arnaut - branch nick: 22320-5.1 - timestamp: Mon 2010-07-05 09:00:39 -0300 - message: - Bug#22320: my_atomic-t unit test fails - - The atomic operations implementation on 5.1 has a few problems, - which might cause tests to abort randomly. Since no code in 5.1 - uses atomic operations, simply remove the code. - ------------------------------------------------------------ - revno: 3457.1.7 - committer: Georgi Kodinov - branch nick: B53613-5.1-bugteam - timestamp: Thu 2010-07-01 12:05:09 +0300 - message: - Bug #53613: mysql_upgrade incorrectly revokes TRIGGER privilege on given table - - Fixed an incomplete historical ALTER TABLE MODIFY trimming the trigger - privilege bit from mysql.tables_priv.Table_priv column. - Removed the duplicate ALTER TABLE MODIFY. - Test suite added. - ------------------------------------------------------------ - revno: 3457.1.6 - committer: Georgi Kodinov - branch nick: B53095-5.1-bugteam - timestamp: Fri 2010-06-25 15:59:44 +0300 - message: - Bug #53095: SELECT column_name FROM INFORMATION_SCHEMA.STATISTICS - returns nothing - - When looking for table or database names inside INFORMATION_SCHEMA - we must convert the table and database names to lowercase (just as it's - done in the rest of the server) when lowercase_table_names is non-zero. - This will allow us to find the same tables that we would find if there - is no condition. - - Fixed by converting to lower case when extracting the database and - table name conditions. - Test case added. - ------------------------------------------------------------ - revno: 3457.1.5 - committer: - branch nick: mysql-5.1-bugteam - timestamp: Sun 2010-07-04 16:17:53 +0800 - message: - Postfix for bug#48321 - Some test cases set ANSI_QUOTES in sql_mode. - So we have to use single quotes to quote literal strings. - ------------------------------------------------------------ - revno: 3457.1.4 - committer: - branch nick: mysql-5.1-bugteam - timestamp: Sun 2010-07-04 12:02:49 +0800 - message: - The following statements support the CURRENT_USER() where a user is needed. - DROP USER - RENAME USER CURRENT_USER() ... - GRANT ... TO CURRENT_USER() - REVOKE ... FROM CURRENT_USER() - ALTER DEFINER = CURRENT_USER() EVENTbut, When these statements are binlogged, CURRENT_USER() just is binlogged - as 'CURRENT_USER()', it is not expanded to the real user name. When slave - executes the log event, 'CURRENT_USER()' is expand to the user of slave - SQL thread, but SQL thread's user name always NULL. This breaks the replication. - - After this patch, session's user will be written into query log events - if these statements call CURREN_USER() or 'ALTER EVENT' does not assign a definer. - ------------------------------------------------------------ - revno: 3457.1.3 - committer: Davi Arnaut - branch nick: mysql-5.1-bugteam - timestamp: Sat 2010-07-03 10:20:05 -0300 - message: - Fix somewhat bogus GCC warning. Although needless as the base - class is mostly empty, initialize the base class explicitly in - the copy constructor. - ------------------------------------------------------------ - revno: 3457.1.2 - committer: Davi Arnaut - branch nick: mysql-5.1-bugteam - timestamp: Fri 2010-07-02 18:42:32 -0300 - message: - Bug#53445: Build with -Wall and fix warnings that it generates - - If bzero is not available, resort to memset. Also, remove dead - bzero.c - ------------------------------------------------------------ - revno: 3457.1.1 - committer: Davi Arnaut - branch nick: 53445-5.1 - timestamp: Fri 2010-07-02 15:30:47 -0300 - message: - Bug#53445: Build with -Wall and fix warnings that it generates - - Apart strict-aliasing warnings, fix the remaining warnings - generated by GCC 4.4.4 -Wall and -Wextra flags. - - One major source of warnings was the in-house function my_bcmp - which (unconventionally) took pointers to unsigned characters - as the byte sequences to be compared. Since my_bcmp and bcmp - are deprecated functions whose only difference with memcmp is - the return value, every use of the function is replaced with - memcmp as the special return value wasn't actually being used - by any caller. - - There were also various other warnings, mostly due to type - mismatches, missing return values, missing prototypes, dead - code (unreachable) and ignored return values. ------------------------------------------------------------- -revno: 3465 [merge] -committer: Georgi Kodinov -branch nick: merge-5.1-security -timestamp: Wed 2010-07-21 18:51:36 +0300 -message: - merge - ------------------------------------------------------------ - revno: 3461.1.5 [merge] - committer: Joerg Bruehe - branch nick: mysql-5.1 - timestamp: Wed 2010-07-21 12:09:50 +0200 - message: - Merge the version number increase (5.1.49 -> 5.1.50) into the main tree. - ------------------------------------------------------------ - revno: 3461.1.4 - committer: Georgi Kodinov - branch nick: mysql-5.1 - timestamp: Mon 2010-07-19 17:47:17 +0300 - message: - fix tree names - ------------------------------------------------------------ - revno: 3461.1.3 [merge] - committer: MySQL Build Team - branch nick: mysql-5.1.49-release - timestamp: Mon 2010-07-19 16:30:34 +0200 - message: - 5.1.49 push to mysql-5.1 - ------------------------------------------------------------ - revno: 3408.1.3 [merge] - author: karen.langford@sun.com - committer: sunanda - branch nick: mysql-5.1 - timestamp: Thu 2010-07-08 20:46:26 +0200 - message: - Null-merge from mysql-5.1.46sp1-release - ------------------------------------------------------------ - revno: 3351.58.14 - tags: mysql-5.1.46sp1 - committer: sunanda - branch nick: mysql-5.1.46sp1-release - timestamp: Wed 2010-06-23 12:22:05 +0200 - message: - Backport into build-201006221614-5.1.46sp1 - - > ------------------------------------------------------------ - > revno: 3392.1.1 - > revision-id: gshchepa@mysql.com-20100521184732-0jvpzinv0uwyvr2d - > parent: sven.sandberg@sun.com-20100520153801-yyhujm1qqa4eyfn0 - > committer: Gleb Shchepa - > branch nick: 53804-5.1 - > timestamp: Fri 2010-05-21 22:47:32 +0400 - > message: - > Bug #53804: serious flaws in the alter database .. upgrade - > data directory name command - > - > The check_db_name function has been modified to validate tails of - > #mysql50#-prefixed database names for compliance with MySQL 5.0 - > database name encoding rules (the check_table_name function call - > has been reused). - ------------------------------------------------------------ - revno: 3351.58.13 - committer: sunanda - branch nick: mysql-5.1.46sp1-release - timestamp: Wed 2010-06-23 12:14:23 +0200 - message: - Backport into build-201006221614-5.1.46sp1 - - > ------------------------------------------------------------ - > revno: 3386 - > revision-id: sergey.glukhov@sun.com-20100518082821-yajhvbv1ghmlpu1n - > parent: aelkin@mysql.com-20100516170332-x8priwrdjwolc065 - > committer: Sergey Glukhov - > branch nick: mysql-5.1-bugteam - > timestamp: Tue 2010-05-18 13:28:21 +0500 - > message: - > Bug#48729 SELECT ... FROM INFORMATION_SCHEMA.ROUTINES causes memory to grow - > Analysis showed that in case of accessing I_S table - > ROUTINES we perform unnecessary allocations - > with get_field() function for every processed row that - > in their turn causes significant memory growth. - > the fix is to avoid use of get_field(). - ------------------------------------------------------------ - revno: 3351.58.12 - committer: sunanda - branch nick: mysql-5.1.46sp1-release - timestamp: Wed 2010-06-23 12:03:22 +0200 - message: - Backport into build-201006221614-5.1.46sp1 - - > ------------------------------------------------------------ - > revno: 3367 [merge] - > revision-id: joro@sun.com-20100504140328-srxf3c088j2twnq6 - > parent: kristofer.pettersson@sun.com-20100503172109-f9hracq5pqsaomb1 - > parent: joro@sun.com-20100503151651-nakknn8amrapmdp7 - > committer: Georgi Kodinov - > branch nick: B53371-5.1-bugteam - > timestamp: Tue 2010-05-04 17:03:28 +0300 - > message: - > Bug #53371: COM_FIELD_LIST can be abused to bypass table level grants. - > - > This is the 5.1 merge and extension of the fix. - > The server was happily accepting paths in table name in all places a table - > name is accepted (e.g. a SELECT). This allowed all users that have some - > privilege over some database to read all tables in all databases in all - > mysql server instances that the server file system has access to. - > Fixed by : - > 1. making sure no path elements are allowed in quoted table name when - > constructing the path (note that the path symbols are still valid in table names - > when they're properly escaped by the server). - > 2. checking the #mysql50# prefixed names the same way they're checked for - > path elements in mysql-5.0. - > ------------------------------------------------------------ - > Use --include-merges or -n0 to see merged revisions. - ------------------------------------------------------------ - revno: 3351.58.11 - committer: MySQL Build Team - branch nick: mysql-5.1.46sp1-release - timestamp: Tue 2010-06-22 22:53:01 +0200 - message: - Backport into build-201006221614-5.1.46sp1 - - > ------------------------------------------------------------ - > revno: 3351.41.1 - > revision-id: alexey.kopytov@sun.com-20100430111048-jdls6ofn4kkmpt09 - > parent: sergey.glukhov@sun.com-20100329134249-03wyhzp5k92dzhcb - > committer: Alexey Kopytov - > branch nick: my51-bug48419 - > timestamp: Fri 2010-04-30 15:10:48 +0400 - > message: - > Bug #48419: another explain crash.. - > - > WHERE predicates containing references to empty tables in a - > subquery were handled incorrectly by the optimizer when - > executing EXPLAIN. As a result, the optimizer could try to - > evaluate such predicates rather than just stop with - > "Impossible WHERE noticed after reading const tables" as - > it would do in a non-subquery case. This led to valgrind - > errors and crashes. - > - > Fixed the code checking the above condition so that subqueries - > are not excluded and hence are handled in the same way as top - > level SELECTs. - ------------------------------------------------------------ - revno: 3351.58.10 - committer: MySQL Build Team - branch nick: mysql-5.1.46sp1-release - timestamp: Tue 2010-06-22 22:51:35 +0200 - message: - Backport into build-201006221614-5.1.46sp1 - - > ------------------------------------------------------------ - > revno: 1810.3987.14 - > revision-id: davi.arnaut@sun.com-20100429132816-ictyul6d75itek22 - > parent: ramil@mysql.com-20100429044232-f0pkyx8fnpszf142 - > committer: Davi Arnaut - > branch nick: 50974-5.0 - > timestamp: Thu 2010-04-29 10:28:16 -0300 - > message: - > Bug#50974: Server keeps receiving big (> max_allowed_packet) packets indefinitely. - > - > The server could be tricked to read packets indefinitely if it - > received a packet larger than the maximum size of one packet. - > This problem is aggravated by the fact that it can be triggered - > before authentication. - > - > The solution is to no skip big packets for non-authenticated - > sessions. If a big packet is sent before a session is authen- - > ticated, a error is returned and the connection is closed. - - > ------------------------------------------------------------ - > revno: 3363 [merge] - > revision-id: davi.arnaut@sun.com-20100429231819-i3anwzrdasjmezvt - > parent: davi.arnaut@sun.com-20100401131522-895y8uzvv8ag44gs - > parent: davi.arnaut@sun.com-20100429132816-ictyul6d75itek22 - > committer: Davi Arnaut - > branch nick: mysql-5.1-bugteam - > timestamp: Thu 2010-04-29 20:18:19 -0300 - > message: - > Manual merge. - > ------------------------------------------------------------ - > Use --include-merges or -n0 to see merged revisions. - ------------------------------------------------------------ - revno: 3351.58.9 - committer: MySQL Build Team - branch nick: mysql-5.1.46sp1-release - timestamp: Tue 2010-06-22 22:34:48 +0200 - message: - Backport into build-201006221614-5.1.46sp1 - - > ------------------------------------------------------------ - > revno: 1810.3987.13 - > revision-id: ramil@mysql.com-20100429044232-f0pkyx8fnpszf142 - > parent: alexey.kopytov@sun.com-20100426200600-op06qy98llzpzgl1 - > committer: Ramil Kalimullin - > branch nick: b53237-5.0-bugteam - > timestamp: Thu 2010-04-29 08:42:32 +0400 - > message: - > Fix for bug #53237: mysql_list_fields/COM_FIELD_LIST stack smashing - > - > Problem: "COM_FIELD_LIST is an old command of the MySQL server, before there was real move to only - > SQL. Seems that the data sent to COM_FIELD_LIST( mysql_list_fields() function) is not - > checked for sanity. By sending long data for the table a buffer is overflown, which can - > be used deliberately to include code that harms". - > - > Fix: check incoming data length. - - The patch did not apply cleanly: - - Line numbers are completely off, roughly it is 2030 -> 1313 - - What is called "pend" in the patch, is "arg_end" in the source. - ------------------------------------------------------------ - revno: 3351.58.8 - committer: MySQL Build Team - branch nick: mysql-5.1.46sp1-release - timestamp: Tue 2010-06-22 22:09:31 +0200 - message: - Backport into 5.1.46sp1: - - > revno: 3351.14.56 - > committer: Marko Mdkeld - > branch nick: 5.1-innodb - > timestamp: Mon 2010-04-26 14:08:56 +0300 - > message: - > Add a test case for Bug #52745. - ------------------------------------------------------------ - revno: 3351.58.7 - committer: MySQL Build Team - branch nick: mysql-5.1.46sp1-release - timestamp: Tue 2010-06-22 21:59:35 +0200 - message: - Backport into build-201006221614-5.1.46sp1 - - > ------------------------------------------------------------ - > revno: 3351.14.47 - > revision-id: marko.makela@oracle.com-20100421095033-0acvzxb8um8cms0a - > parent: marko.makela@oracle.com-20100421094032-ir4glqk46qvg2ywn - > committer: Marko Mäkelä - > branch nick: 5.1-innodb - > timestamp: Wed 2010-04-21 12:50:33 +0300 - > message: - > dtuple_convert_big_rec(): Store locally any fields whose maximum length - > is less than 256 bytes. (Bug #52745) - > Add related comments and debug assertions to the "offsets" - > functions in rem0rec.c. - > Approved by Sunny Bains - ------------------------------------------------------------ - revno: 3351.58.6 - committer: MySQL Build Team - branch nick: mysql-5.1.46sp1-release - timestamp: Tue 2010-06-22 21:56:18 +0200 - message: - Backport into build-201006221614-5.1.46sp1 - - > ------------------------------------------------------------ - > revno: 3351.47.2 - > revision-id: marko.makela@oracle.com-20100511104910-nim8kgguawpis7zo - > parent: marko.makela@oracle.com-20100511104500-c6kzd0bg5s42p8e9 - > committer: Marko Mäkelä - > branch nick: mysql-5.1-innodb2 - > timestamp: Tue 2010-05-11 13:49:10 +0300 - > message: - > btr_page_split_and_insert(): Add an assertion - > suggested by Sunny Bains when reviewing Bug #52964. - ------------------------------------------------------------ - revno: 3351.58.5 - committer: MySQL Build Team - branch nick: mysql-5.1.46sp1-release - timestamp: Tue 2010-06-22 21:54:41 +0200 - message: - Backport into build-201006221614-5.1.46sp1 - - > ------------------------------------------------------------ - > revno: 3351.47.1 - > revision-id: marko.makela@oracle.com-20100511104500-c6kzd0bg5s42p8e9 - > parent: vasil.dimov@oracle.com-20100510132852-cz457uqvj8iiy9mm - > committer: Marko Mäkelä - > branch nick: mysql-5.1-innodb2 - > timestamp: Tue 2010-05-11 13:45:00 +0300 - > message: - > Remove a stray expression. Spotted by Sunny Bains. - ------------------------------------------------------------ - revno: 3351.58.4 - committer: MySQL Build Team - branch nick: mysql-5.1.46sp1-release - timestamp: Tue 2010-06-22 21:52:43 +0200 - message: - Backport into build-201006221614-5.1.46sp1 - - > ------------------------------------------------------------ - > revno: 3351.14.74 - > revision-id: marko.makela@oracle.com-20100504093128-44v6glupe1dsh0ug - > parent: marko.makela@oracle.com-20100503122859-k73bl51re93o0mt4 - > committer: Marko Mäkelä - > branch nick: 5.1-innodb - > timestamp: Tue 2010-05-04 12:31:28 +0300 - > message: - > btr_page_split_and_insert(): Correct the fix of Bug #52964. - > When split_rec==NULL, choose the correct node pointer key (first_rec). - ------------------------------------------------------------ - revno: 3351.58.3 - committer: MySQL Build Team - branch nick: mysql-5.1.46sp1-release - timestamp: Tue 2010-06-22 21:50:47 +0200 - message: - Backport into build-201006221614-5.1.46sp1 - - > ------------------------------------------------------------ - > revno: 3351.14.50 - > revision-id: marko.makela@oracle.com-20100421185359-8qaxoa2yyrpzwdd7 - > parent: marko.makela@oracle.com-20100421102723-0i80uezbyu0ekj5d - > committer: Marko Mäkelä - > branch nick: 5.1-innodb - > timestamp: Wed 2010-04-21 21:53:59 +0300 - > message: - > btr_page_split_and_insert(): Avoid an infinite loop. (Bug #52964) - > - > btr_page_tuple_smaller(): New function, refactored from - > btr_page_split_and_insert(). - > - > btr_page_get_split_rec(): Renamed from btr_page_get_sure_split_rec(). - > Note that a NULL return may mean that the tuple is to be inserted into - > either the lower or upper page, to be determined by btr_page_tuple_smaller(). - > - > btr_page_split_and_insert(): When btr_page_get_split_rec() returns NULL, - > invoke btr_page_tuple_smaller() to determine which half-page the tuple - > belongs to. - > - > Reviewed by Sunny Bains - ------------------------------------------------------------ - revno: 3351.58.2 - committer: MySQL Build Team - branch nick: mysql-5.1.46sp1-release - timestamp: Tue 2010-06-22 21:42:14 +0200 - message: - Backport into build-201006221614-5.1.46sp1 - - > ------------------------------------------------------------ - > revno: 3362 - > revision-id: davi.arnaut@sun.com-20100401131522-895y8uzvv8ag44gs - > parent: ramil@mysql.com-20100429045409-r7r5lcyiruis15v7 - > committer: Davi Arnaut - > branch nick: 50755-5.1 - > timestamp: Thu 2010-04-01 10:15:22 -0300 - > message: - > Bug#50755: Crash if stored routine def contains version comments - > - > The problem was that a syntactically invalid trigger could cause - > the server to crash when trying to list triggers. The crash would - > happen due to a mishap in the backup/restore procedure that should - > protect parser items which are not associated with the trigger. The - > backup/restore is used to isolate the parse tree (and context) of - > a statement from the load (and parsing) of a trigger. In this case, - > a error during the parsing of a trigger could cause the improper - > backup/restore sequence. - > - > The solution is to properly restore the original statement context - > before the parser is exited due to syntax errors in the trigger body. - ------------------------------------------------------------ - revno: 3351.58.1 - author: karen.langford@oracle.com - committer: MySQL Build Team - branch nick: mysql-5.1.46sp1-release - timestamp: Tue 2010-06-22 19:21:25 +0200 - message: - Set version number for mysql-5.1.46sp1 release - ------------------------------------------------------------ - revno: 3461.1.2 - tags: mysql-5.1.49 - author: karen.langford@oracle.com - committer: Karen Langford - branch nick: mysql-5.1.49-release - timestamp: Fri 2010-07-09 14:23:48 +0200 - message: - Fix bug #55039 Failing assertion: space_id > 0 in fil0fil.c. diff --git a/dep/mysqllite/EXCEPTIONS-CLIENT b/dep/mysqllite/EXCEPTIONS-CLIENT deleted file mode 100644 index c570ff7ba24d2..0000000000000 --- a/dep/mysqllite/EXCEPTIONS-CLIENT +++ /dev/null @@ -1,119 +0,0 @@ -MySQL FLOSS License Exception - -The MySQL AB Exception for Free/Libre and Open Source -Software-only Applications Using MySQL Client Libraries (the -"FLOSS Exception"). - -Version 0.6, 7 March 2007 - -Exception Intent - -We want specified Free/Libre and Open Source Software (``FLOSS'') -applications to be able to use specified GPL-licensed MySQL client -libraries (the ``Program'') despite the fact that not all FLOSS -licenses are compatible with version 2 of the GNU General Public -License (the ``GPL''). - -Legal Terms and Conditions - -As a special exception to the terms and conditions of version 2.0 -of the GPL: - - 1. You are free to distribute a Derivative Work that is formed - entirely from the Program and one or more works (each, a - "FLOSS Work") licensed under one or more of the licenses - listed below in section 1, as long as: - a. You obey the GPL in all respects for the Program and the - Derivative Work, except for identifiable sections of the - Derivative Work which are not derived from the Program, - and which can reasonably be considered independent and - separate works in themselves, - b. all identifiable sections of the Derivative Work which - are not derived from the Program, and which can - reasonably be considered independent and separate works - in themselves, - i. are distributed subject to one of the FLOSS licenses - listed below, and - ii. the object code or executable form of those sections - are accompanied by the complete corresponding - machine-readable source code for those sections on - the same medium and under the same FLOSS license as - the corresponding object code or executable forms of - those sections, and - c. any works which are aggregated with the Program or with a - Derivative Work on a volume of a storage or distribution - medium in accordance with the GPL, can reasonably be - considered independent and separate works in themselves - which are not derivatives of either the Program, a - Derivative Work or a FLOSS Work. - If the above conditions are not met, then the Program may only - be copied, modified, distributed or used under the terms and - conditions of the GPL or another valid licensing option from - MySQL AB. - - 2. FLOSS License List - -License name Version(s)/Copyright Date -Academic Free License 2.0 -Apache Software License 1.0/1.1/2.0 -Apple Public Source License 2.0 -Artistic license From Perl 5.8.0 -BSD license "July 22 1999" -Common Development and Distribution License (CDDL) 1.0 -Common Public License 1.0 -Eclipse Public License 1.0 -GNU Library or "Lesser" General Public License (LGPL) 2.0/2.1 -Jabber Open Source License 1.0 -MIT license (As listed in file MIT-License.txt) --- -Mozilla Public License (MPL) 1.0/1.1 -Open Software License 2.0 -OpenSSL license (with original SSLeay license) "2003" ("1998") -PHP License 3.0 -Python license (CNRI Python License) --- -Python Software Foundation License 2.1.1 -Sleepycat License "1999" -University of Illinois/NCSA Open Source License --- -W3C License "2001" -X11 License "2001" -Zlib/libpng License --- -Zope Public License 2.0 - - Due to the many variants of some of the above licenses, we - require that any version follow the 2003 version of the Free - Software Foundation's Free Software Definition - (http://www.gnu.org/philosophy/free-sw.html) or version 1.9 of - the Open Source Definition by the Open Source Initiative - (http://www.opensource.org/docs/definition.php). - - 3. Definitions - - a. Terms used, but not defined, herein shall have the - meaning provided in the GPL. - b. Derivative Work means a derivative work under copyright - law. - - 4. Applicability: This FLOSS Exception applies to all Programs - that contain a notice placed by MySQL AB saying that the - Program may be distributed under the terms of this FLOSS - Exception. If you create or distribute a work which is a - Derivative Work of both the Program and any other work - licensed under the GPL, then this FLOSS Exception is not - available for that work; thus, you must remove the FLOSS - Exception notice from that work and comply with the GPL in all - respects, including by retaining all GPL notices. You may - choose to redistribute a copy of the Program exclusively under - the terms of the GPL by removing the FLOSS Exception notice - from that copy of the Program, provided that the copy has - never been modified by you or any third party. - -Appendix A. Qualified Libraries and Packages - -The following is a non-exhaustive list of libraries and packages -which are covered by the FLOSS License Exception. Please note that -this appendix is provided merely as an additional service to -specific FLOSS projects wishing to simplify licensing information -for their users. Compliance with one of the licenses noted under -the "FLOSS license list" section remains a prerequisite. - -Package Name Qualifying License and Version -Apache Portable Runtime (APR) Apache Software License 2.0 diff --git a/dep/mysqllite/INSTALL-SOURCE b/dep/mysqllite/INSTALL-SOURCE deleted file mode 100644 index bc7cd9032d16d..0000000000000 --- a/dep/mysqllite/INSTALL-SOURCE +++ /dev/null @@ -1,8388 +0,0 @@ - -Chapter 2. Installing and Upgrading MySQL - - This chapter describes how to obtain and install MySQL. A summary - of the procedure follows and later sections provide the details. - If you plan to upgrade an existing version of MySQL to a newer - version rather than install MySQL for the first time, see Section - 2.4.1, "Upgrading MySQL," for information about upgrade procedures - and about issues that you should consider before upgrading. - - If you are interested in migrating to MySQL from another database - system, you may wish to read Section A.8, "MySQL 5.1 FAQ: - Migration," which contains answers to some common questions - concerning migration issues. - - 1. Determine whether MySQL runs and is supported on your - platform. - Please note that not all platforms are equally suitable for - running MySQL, and that not all platforms on which MySQL is - known to run are officially supported by Oracle Corporation: - - 2. Choose which distribution to install. - Several versions of MySQL are available, and most are - available in several distribution formats. You can choose from - pre-packaged distributions containing binary (precompiled) - programs or source code. When in doubt, use a binary - distribution. We also provide public access to our current - source tree for those who want to see our most recent - developments and help us test new code. To determine which - version and type of distribution you should use, see Section - 2.1.2, "Choosing Which MySQL Distribution to Install." - - 3. Download the distribution that you want to install. - For instructions, see Section 2.1.3, "How to Get MySQL." To - verify the integrity of the distribution, use the instructions - in Section 2.1.4, "Verifying Package Integrity Using MD5 - Checksums or GnuPG." - - 4. Install the distribution. - To install MySQL from a binary distribution, use the - instructions in Section 2.2, "Installing MySQL from Generic - Binaries on Unix/Linux." - To install MySQL from a source distribution or from the - current development source tree, use the instructions in - Section 2.3, "MySQL Installation Using a Source Distribution." - - 5. Perform any necessary post-installation setup. - After installing MySQL, read Section 2.13, "Post-Installation - Setup and Testing." This section contains important - information about making sure the MySQL server is working - properly. It also describes how to secure the initial MySQL - user accounts, which have no passwords until you assign - passwords. The section applies whether you install MySQL using - a binary or source distribution. - - 6. If you want to run the MySQL benchmark scripts, Perl support - for MySQL must be available. See Section 2.15, "Perl - Installation Notes." - -2.1. General Installation Guidance - - The immediately following sections contain the information - necessary to choose, download, and verify your distribution. The - instructions in later sections of the chapter describe how to - install the distribution that you choose. For binary - distributions, see the instructions at Section 2.2, "Installing - MySQL from Generic Binaries on Unix/Linux" or the corresponding - section for your platform if available. To build MySQL from - source, use the instructions in Section 2.3, "MySQL Installation - Using a Source Distribution." - -2.1.1. Operating Systems Supported by MySQL Community Server - - This section lists the operating systems on which MySQL Community - Server is known to run. - -Important - - Oracle Corporation does not necessarily provide official support - for all the platforms listed in this section. For information - about those platforms that are officially supported, see - http://www.mysql.com/support/supportedplatforms.html on the MySQL - Web site. - - We use GNU Autoconf, so it is possible to port MySQL to all modern - systems that have a C++ compiler and a working implementation of - POSIX threads. (Thread support is needed for the server. To - compile only the client code, the only requirement is a C++ - compiler.) - - MySQL has been reported to compile successfully on the following - combinations of operating system and thread package. - - * AIX 4.x, 5.x with native threads. See Section 2.12, - "Installing MySQL on AIX." AIX 5.3 should be upgraded to - technology level 7 (5300-07). - - * FreeBSD 5.x and up with native threads. See Section 2.10, - "Installing MySQL on FreeBSD." - - * HP-UX 11.x with the native threads. See Section 2.11, - "Installing MySQL on HP-UX." - - * Linux, builds on all fairly recent Linux distributions with - glibc 2.3. See Section 2.6, "Installing MySQL on Linux." - - * Mac OS X. See Section 2.7, "Installing MySQL on Mac OS X." - - * Solaris 2.8 on SPARC and x86, including support for native - threads. See Section 2.8, "Installing MySQL on Solaris." - - * Windows 2000, Windows XP, Windows Vista, Windows Server 2003, - and Windows Server 2008. See Section 2.5, "Installing MySQL on - Windows." - - MySQL has also been known to run on other systems in the past. See - Section 2.1, "General Installation Guidance." Some porting effort - might be required for current versions of MySQL on these systems. - - Not all platforms are equally well-suited for running MySQL. How - well a certain platform is suited for a high-load mission-critical - MySQL server is determined by the following factors: - - * General stability of the thread library. A platform may have - an excellent reputation otherwise, but MySQL is only as stable - as the thread library it calls, even if everything else is - perfect. - - * The capability of the kernel and the thread library to take - advantage of symmetric multi-processor (SMP) systems. In other - words, when a process creates a thread, it should be possible - for that thread to run on a CPU different from the original - process. - - * The capability of the kernel and the thread library to run - many threads that acquire and release a mutex over a short - critical region frequently without excessive context switches. - If the implementation of pthread_mutex_lock() is too anxious - to yield CPU time, this hurts MySQL tremendously. If this - issue is not taken care of, adding extra CPUs actually makes - MySQL slower. - - * General file system stability and performance. - - * Table size. If your tables are large, performance is affected - by the ability of the file system to deal with large files and - dealing with them efficiently. - - * Our level of expertise here at Oracle Corporation with the - platform. If we know a platform well, we enable - platform-specific optimizations and fixes at compile time. We - can also provide advice on configuring your system optimally - for MySQL. - - * The amount of testing we have done internally for similar - configurations. - - * The number of users that have run MySQL successfully on the - platform in similar configurations. If this number is high, - the likelihood of encountering platform-specific surprises is - much smaller. - -2.1.2. Choosing Which MySQL Distribution to Install - - When preparing to install MySQL, you should decide which version - to use. MySQL development occurs in several release series, and - you can pick the one that best fits your needs. After deciding - which version to install, you can choose a distribution format. - Releases are available in binary or source format. - -2.1.2.1. Choosing Which Version of MySQL to Install - - The first decision to make is whether you want to use a production - (stable) release or a development release. In the MySQL - development process, multiple release series co-exist, each at a - different stage of maturity: - - * MySQL 5.5 is the current development release series. - - * MySQL 5.1 is the current General Availability (Production) - release series. New releases are issued for bugfixes only; no - new features are being added that could affect stability. - - * MySQL 5.0 is the previous stable (production-quality) release - series. MySQL 5.0 is now at the end of the product lifecycle. - Active development and support for this version has ended. - Extended support for MySQL 5.0 remains available. According to - the http://www.mysql.com/about/legal/lifecycle/, only Security - and Severity Level 1 issues are still being fixed for MySQL - 5.0. - - * MySQL 4.1, 4.0, and 3.23 are old stable (production-quality) - release series. Active development and support for these - versions has ended. - - We do not believe in a complete code freeze because this prevents - us from making bugfixes and other fixes that must be done. By - "somewhat frozen" we mean that we may add small things that should - not affect anything that currently works in a production release. - Naturally, relevant bugfixes from an earlier series propagate to - later series. - - Normally, if you are beginning to use MySQL for the first time or - trying to port it to some system for which there is no binary - distribution, go with the General Availability release series. - Currently, this is MySQL 5.1. All MySQL releases, even those from - development series, are checked with the MySQL benchmarks and an - extensive test suite before being issued. - - If you are running an older system and want to upgrade, but do not - want to take the chance of having a nonseamless upgrade, you - should upgrade to the latest version in the same release series - you are using (where only the last part of the version number is - newer than yours). We have tried to fix only fatal bugs and make - only small, relatively "safe" changes to that version. - - If you want to use new features not present in the production - release series, you can use a version from a development series. - Note that development releases are not as stable as production - releases. - - If you want to use the very latest sources containing all current - patches and bugfixes, you can use one of our Bazaar repositories. - These are not "releases" as such, but are available as previews of - the code on which future releases are to be based. - - The MySQL naming scheme uses release names that consist of three - numbers and a suffix; for example, mysql-5.0.14-rc. The numbers - within the release name are interpreted as follows: - - * The first number (5) is the major version and describes the - file format. All MySQL 5 releases have the same file format. - - * The second number (0) is the release level. Taken together, - the major version and release level constitute the release - series number. - - * The third number (14) is the version number within the release - series. This is incremented for each new release. Usually you - want the latest version for the series you have chosen. - - For each minor update, the last number in the version string is - incremented. When there are major new features or minor - incompatibilities with previous versions, the second number in the - version string is incremented. When the file format changes, the - first number is increased. - - Release names also include a suffix to indicates the stability - level of the release. Releases within a series progress through a - set of suffixes to indicate how the stability level improves. The - possible suffixes are: - - * alpha indicates that the release is for preview purposes only. - Known bugs should be documented in the News section (see - Appendix C, "MySQL Change History"). Most alpha releases - implement new commands and extensions. Active development that - may involve major code changes can occur in an alpha release. - However, we do conduct testing before issuing a release. - - * beta indicates that the release is appropriate for use with - new development. Within beta releases, the features and - compatibility should remain consistent. However, beta releases - may contain numerous and major unaddressed bugs. - All APIs, externally visible structures, and columns for SQL - statements will not change during future beta, release - candidate, or production releases. - - * rc indicates a Release Candidate. Release candidates are - believed to be stable, having passed all of MySQL's internal - testing, and with all known fatal runtime bugs fixed. However, - the release has not been in widespread use long enough to know - for sure that all bugs have been identified. Only minor fixes - are added. (A release candidate is what formerly was known as - a gamma release.) - - * If there is no suffix, it indicates that the release is a - General Availability (GA) or Production release. GA releases - are stable, having successfully passed through all earlier - release stages and are believed to be reliable, free of - serious bugs, and suitable for use in production systems. Only - critical bugfixes are applied to the release. - - MySQL uses a naming scheme that is slightly different from most - other products. In general, it is usually safe to use any version - that has been out for a couple of weeks without being replaced by - a new version within the same release series. - - All releases of MySQL are run through our standard tests and - benchmarks to ensure that they are relatively safe to use. Because - the standard tests are extended over time to check for all - previously found bugs, the test suite keeps getting better. - - All releases have been tested at least with these tools: - - * An internal test suite - The mysql-test directory contains an extensive set of test - cases. We run these tests for every server binary. See Section - 22.1.2, "MySQL Test Suite," for more information about this - test suite. - - * The MySQL benchmark suite - This suite runs a range of common queries. It is also a test - to determine whether the latest batch of optimizations - actually made the code faster. See Section 7.1.3, "The MySQL - Benchmark Suite." - - We also test the newest MySQL version in our internal production - environment, on at least one machine. We have more than 100GB of - data to work with. - -2.1.2.2. Choosing a Distribution Format - - After choosing which version of MySQL to install, you should - decide whether to use a binary distribution or a source - distribution. In most cases, you should probably use a binary - distribution, if one exists for your platform. Binary - distributions are available in native format for many platforms, - such as RPM files for Linux or PKG package installers for Mac OS X - or Solaris. Distributions also are available as Zip archives or - compressed tar files. - - Reasons to choose a binary distribution include the following: - - * Binary distributions generally are easier to install than - source distributions. - - * To satisfy different user requirements, we provide several - servers in binary distributions. mysqld is an optimized server - that is a smaller, faster binary. mysqld-debug is compiled - with debugging support. - Each of these servers is compiled from the same source - distribution, though with different configuration options. All - native MySQL clients can connect to servers from either MySQL - version. - - Under some circumstances, you may be better off installing MySQL - from a source distribution: - - * You want to install MySQL at some explicit location. The - standard binary distributions are ready to run at any - installation location, but you might require even more - flexibility to place MySQL components where you want. - - * You want to configure mysqld to ensure that features are - available that might not be included in the standard binary - distributions. Here is a list of the most common extra options - that you may want to use to ensure feature availability: - - + --with-libwrap - - + --with-named-z-libs (this is done for some of the - binaries) - - + --with-debug[=full] - - * You want to configure mysqld without some features that are - included in the standard binary distributions. For example, - distributions normally are compiled with support for all - character sets. If you want a smaller MySQL server, you can - recompile it with support for only the character sets you - need. - - * You have a special compiler (such as pgcc) or want to use - compiler options that are better optimized for your processor. - Binary distributions are compiled with options that should - work on a variety of processors from the same processor - family. - - * You want to use the latest sources from one of the Bazaar - repositories to have access to all current bugfixes. For - example, if you have found a bug and reported it to the MySQL - development team, the bugfix is committed to the source - repository and you can access it there. The bugfix does not - appear in a release until a release actually is issued. - - * You want to read (or modify) the C and C++ code that makes up - MySQL. For this purpose, you should get a source distribution, - because the source code is always the ultimate manual. - - * Source distributions contain more tests and examples than - binary distributions. - -2.1.2.3. How and When Updates Are Released - - MySQL is evolving quite rapidly and we want to share new - developments with other MySQL users. We try to produce a new - release whenever we have new and useful features that others also - seem to have a need for. - - We also try to help users who request features that are easy to - implement. We take note of what our licensed users want, and we - especially take note of what our support customers want and try to - help them in this regard. - - No one is required to download a new release. The News section - helps you determine whether the new release has something you - really want. See Appendix C, "MySQL Change History." - - We use the following policy when updating MySQL: - - * Enterprise Server releases are meant to appear every 18 - months, supplemented by quarterly service packs and monthly - rapid updates. Community Server releases are meant to appear 2 - to 3 times per year. - - * Releases are issued within each series. For each release, the - last number in the version is one more than the previous - release within the same series. - - * Binary distributions for some platforms are made by us for - major releases. Other people may make binary distributions for - other systems, but probably less frequently. - - * We make fixes available as soon as we have identified and - corrected small or noncritical but annoying bugs. The fixes - are available in source form immediately from our public - Bazaar repositories, and are included in the next release. - - * If by any chance a security vulnerability or critical bug is - found in a release, our policy is to fix it in a new release - as soon as possible. (We would like other companies to do - this, too!) - -2.1.3. How to Get MySQL - - Check our downloads page at http://dev.mysql.com/downloads/ for - information about the current version of MySQL and for downloading - instructions. For a complete up-to-date list of MySQL download - mirror sites, see http://dev.mysql.com/downloads/mirrors.html. You - can also find information there about becoming a MySQL mirror site - and how to report a bad or out-of-date mirror. - - Our main mirror is located at http://mirrors.sunsite.dk/mysql/. - -2.1.4. Verifying Package Integrity Using MD5 Checksums or GnuPG - - After you have downloaded the MySQL package that suits your needs - and before you attempt to install it, you should make sure that it - is intact and has not been tampered with. There are three means of - integrity checking: - - * MD5 checksums - - * Cryptographic signatures using GnuPG, the GNU Privacy Guard - - * For RPM packages, the built-in RPM integrity verification - mechanism - - The following sections describe how to use these methods. - - If you notice that the MD5 checksum or GPG signatures do not - match, first try to download the respective package one more time, - perhaps from another mirror site. If you repeatedly cannot - successfully verify the integrity of the package, please notify us - about such incidents, including the full package name and the - download site you have been using, at webmaster@mysql.com or - build@mysql.com. Do not report downloading problems using the - bug-reporting system. - -2.1.4.1. Verifying the MD5 Checksum - - After you have downloaded a MySQL package, you should make sure - that its MD5 checksum matches the one provided on the MySQL - download pages. Each package has an individual checksum that you - can verify with the following command, where package_name is the - name of the package you downloaded: -shell> md5sum package_name - - Example: -shell> md5sum mysql-standard-5.1.50-linux-i686.tar.gz -aaab65abbec64d5e907dcd41b8699945 mysql-standard-5.1.50-linux-i686.ta -r.gz - - You should verify that the resulting checksum (the string of - hexadecimal digits) matches the one displayed on the download page - immediately below the respective package. - -Note - - Make sure to verify the checksum of the archive file (for example, - the .zip or .tar.gz file) and not of the files that are contained - inside of the archive. - - Note that not all operating systems support the md5sum command. On - some, it is simply called md5, and others do not ship it at all. - On Linux, it is part of the GNU Text Utilities package, which is - available for a wide range of platforms. You can download the - source code from http://www.gnu.org/software/textutils/ as well. - If you have OpenSSL installed, you can use the command openssl md5 - package_name instead. A Windows implementation of the md5 command - line utility is available from http://www.fourmilab.ch/md5/. - winMd5Sum is a graphical MD5 checking tool that can be obtained - from http://www.nullriver.com/index/products/winmd5sum. - -2.1.4.2. Signature Checking Using GnuPG - - Another method of verifying the integrity and authenticity of a - package is to use cryptographic signatures. This is more reliable - than using MD5 checksums, but requires more work. - - We sign MySQL downloadable packages with GnuPG (GNU Privacy - Guard). GnuPG is an Open Source alternative to the well-known - Pretty Good Privacy (PGP) by Phil Zimmermann. See - http://www.gnupg.org/ for more information about GnuPG and how to - obtain and install it on your system. Most Linux distributions - ship with GnuPG installed by default. For more information about - GnuPG, see http://www.openpgp.org/. - - To verify the signature for a specific package, you first need to - obtain a copy of our public GPG build key, which you can download - from http://keyserver.pgp.com/. The key that you want to obtain is - named build@mysql.com. Alternatively, you can cut and paste the - key directly from the following text: ------BEGIN PGP PUBLIC KEY BLOCK----- -Version: GnuPG v1.4.5 (GNU/Linux) - -mQGiBD4+owwRBAC14GIfUfCyEDSIePvEW3SAFUdJBtoQHH/nJKZyQT7h9bPlUWC3 -RODjQReyCITRrdwyrKUGku2FmeVGwn2u2WmDMNABLnpprWPkBdCk96+OmSLN9brZ -fw2vOUgCmYv2hW0hyDHuvYlQA/BThQoADgj8AW6/0Lo7V1W9/8VuHP0gQwCgvzV3 -BqOxRznNCRCRxAuAuVztHRcEAJooQK1+iSiunZMYD1WufeXfshc57S/+yeJkegNW -hxwR9pRWVArNYJdDRT+rf2RUe3vpquKNQU/hnEIUHJRQqYHo8gTxvxXNQc7fJYLV -K2HtkrPbP72vwsEKMYhhr0eKCbtLGfls9krjJ6sBgACyP/Vb7hiPwxh6rDZ7ITnE -kYpXBACmWpP8NJTkamEnPCia2ZoOHODANwpUkP43I7jsDmgtobZX9qnrAXw+uNDI -QJEXM6FSbi0LLtZciNlYsafwAPEOMDKpMqAK6IyisNtPvaLd8lH0bPAnWqcyefep -rv0sxxqUEMcM3o7wwgfN83POkDasDbs3pjwPhxvhz6//62zQJ7Q7TXlTUUwgUGFj -a2FnZSBzaWduaW5nIGtleSAod3d3Lm15c3FsLmNvbSkgPGJ1aWxkQG15c3FsLmNv -bT6IXQQTEQIAHQULBwoDBAMVAwIDFgIBAheABQJLcC5lBQkQ8/JZAAoJEIxxjTtQ -cuH1oD4AoIcOQ4EoGsZvy06D0Ei5vcsWEy8dAJ4g46i3WEcdSWxMhcBSsPz65sh5 -lohMBBMRAgAMBQI+PqPRBYMJZgC7AAoJEElQ4SqycpHyJOEAn1mxHijft00bKXvu -cSo/pECUmppiAJ41M9MRVj5VcdH/KN/KjRtW6tHFPYhMBBMRAgAMBQI+QoIDBYMJ -YiKJAAoJELb1zU3GuiQ/lpEAoIhpp6BozKI8p6eaabzF5MlJH58pAKCu/ROofK8J -Eg2aLos+5zEYrB/LsrkCDQQ+PqMdEAgA7+GJfxbMdY4wslPnjH9rF4N2qfWsEN/l -xaZoJYc3a6M02WCnHl6ahT2/tBK2w1QI4YFteR47gCvtgb6O1JHffOo2HfLmRDRi -Rjd1DTCHqeyX7CHhcghj/dNRlW2Z0l5QFEcmV9U0Vhp3aFfWC4Ujfs3LU+hkAWzE -7zaD5cH9J7yv/6xuZVw411x0h4UqsTcWMu0iM1BzELqX1DY7LwoPEb/O9Rkbf4fm -Le11EzIaCa4PqARXQZc4dhSinMt6K3X4BrRsKTfozBu74F47D8Ilbf5vSYHbuE5p -/1oIDznkg/p8kW+3FxuWrycciqFTcNz215yyX39LXFnlLzKUb/F5GwADBQf+Lwqq -a8CGrRfsOAJxim63CHfty5mUc5rUSnTslGYEIOCR1BeQauyPZbPDsDD9MZ1ZaSaf -anFvwFG6Llx9xkU7tzq+vKLoWkm4u5xf3vn55VjnSd1aQ9eQnUcXiL4cnBGoTbOW -I39EcyzgslzBdC++MPjcQTcA7p6JUVsP6oAB3FQWg54tuUo0Ec8bsM8b3Ev42Lmu -QT5NdKHGwHsXTPtl0klk4bQk4OajHsiy1BMahpT27jWjJlMiJc+IWJ0mghkKHt92 -6s/ymfdf5HkdQ1cyvsz5tryVI3Fx78XeSYfQvuuwqp2H139pXGEkg0n6KdUOetdZ -Whe70YGNPw1yjWJT1IhMBBgRAgAMBQI+PqMdBQkJZgGAAAoJEIxxjTtQcuH17p4A -n3r1QpVC9yhnW2cSAjq+kr72GX0eAJ4295kl6NxYEuFApmr1+0uUq/SlsQ== -=Mski - ------END PGP PUBLIC KEY BLOCK----- - - To import the build key into your personal public GPG keyring, use - gpg --import. For example, if you have saved the key in a file - named mysql_pubkey.asc, the import command looks like this: -shell> gpg --import mysql_pubkey.asc -gpg: key 5072E1F5: public key "MySQL Package signing key (www.mysql.c -om) " imported -gpg: Total number processed: 1 -gpg: imported: 1 -gpg: no ultimately trusted keys found - - You can also download the key from the public keyserver using the - public key id, 5072E1F5: -shell> gpg --recv-keys 5072E1F5 -gpg: requesting key 5072E1F5 from hkp server subkeys.pgp.net -gpg: key 5072E1F5: "MySQL Package signing key (www.mysql.com) " 2 new signatures -gpg: no ultimately trusted keys found -gpg: Total number processed: 1 -gpg: new signatures: 2 - - If you want to import the key into your RPM configuration to - validate RPM install packages, you should be able to import the - key directly: -shell> rpm --import mysql_pubkey.asc - - If you experience problems, try exporting the key from gpg and - importing: -shell> gpg --export -a 5072e1f5 > 5072e1f5.asc -shell> rpm --import 5072e1f5.asc - - Alternatively, rpm also supports loading the key directly from a - URL, and you cas use this manual page: -shell> rpm --import http://dev.mysql.com/doc/refman/5.1/en/checking-g -pg-signature.html - - After you have downloaded and imported the public build key, - download your desired MySQL package and the corresponding - signature, which also is available from the download page. The - signature file has the same name as the distribution file with an - .asc extension, as shown by the examples in the following table. - Distribution file mysql-standard-5.1.50-linux-i686.tar.gz - Signature file mysql-standard-5.1.50-linux-i686.tar.gz.asc - - Make sure that both files are stored in the same directory and - then run the following command to verify the signature for the - distribution file: -shell> gpg --verify package_name.asc - - Example: -shell> gpg --verify mysql-standard-5.1.50-linux-i686.tar.gz.asc -gpg: Signature made Tue 12 Jul 2005 23:35:41 EST using DSA key ID 507 -2E1F5 -gpg: Good signature from "MySQL Package signing key (www.mysql.com) < -build@mysql.com>" - - The Good signature message indicates that everything is all right. - You can ignore any insecure memory warning you might obtain. - - See the GPG documentation for more information on how to work with - public keys. - -2.1.4.3. Signature Checking Using RPM - - For RPM packages, there is no separate signature. RPM packages - have a built-in GPG signature and MD5 checksum. You can verify a - package by running the following command: -shell> rpm --checksig package_name.rpm - - Example: -shell> rpm --checksig MySQL-server-5.1.50-0.glibc23.i386.rpm -MySQL-server-5.1.50-0.glibc23.i386.rpm: md5 gpg OK - -Note - - If you are using RPM 4.1 and it complains about (GPG) NOT OK - (MISSING KEYS: GPG#5072e1f5), even though you have imported the - MySQL public build key into your own GPG keyring, you need to - import the key into the RPM keyring first. RPM 4.1 no longer uses - your personal GPG keyring (or GPG itself). Rather, it maintains - its own keyring because it is a system-wide application and a - user's GPG public keyring is a user-specific file. To import the - MySQL public key into the RPM keyring, first obtain the key as - described in Section 2.1.4.2, "Signature Checking Using GnuPG." - Then use rpm --import to import the key. For example, if you have - saved the public key in a file named mysql_pubkey.asc, import it - using this command: -shell> rpm --import mysql_pubkey.asc - - If you need to obtain the MySQL public key, see Section 2.1.4.2, - "Signature Checking Using GnuPG." - -2.1.5. Installation Layouts - - This section describes the default layout of the directories - created by installing binary or source distributions provided by - Oracle Corporation. A distribution provided by another vendor - might use a layout different from those shown here. - - Installations created from our Linux RPM distributions result in - files under the following system directories. - Directory Contents of Directory - /usr/bin Client programs and scripts - /usr/sbin The mysqld server - /var/lib/mysql Log files, databases - /usr/share/info Manual in Info format - /usr/share/man Unix manual pages - /usr/include/mysql Include (header) files - /usr/lib/mysql Libraries - /usr/share/mysql Error message and character set files - /usr/share/sql-bench Benchmarks - - On Unix, a tar file binary distribution is installed by unpacking - it at the installation location you choose (typically - /usr/local/mysql) and creates the following directories in that - location. - Directory Contents of Directory - bin Client programs and the mysqld server - data Log files, databases - docs Manual in Info format - man Unix manual pages - include Include (header) files - lib Libraries - scripts mysql_install_db - share/mysql Error message files - sql-bench Benchmarks - - A source distribution is installed after you configure and compile - it. By default, the installation step installs files under - /usr/local, in the following subdirectories. - Directory Contents of Directory - bin Client programs and scripts - include/mysql Include (header) files - Docs Manual in Info, CHM formats - man Unix manual pages - lib/mysql Libraries - libexec The mysqld server - share/mysql Error message files - sql-bench Benchmarks and crash-me test - var Databases and log files - - Within its installation directory, the layout of a source - installation differs from that of a binary installation in the - following ways: - - * The mysqld server is installed in the libexec directory rather - than in the bin directory. - - * The data directory is var rather than data. - - * mysql_install_db is installed in the bin directory rather than - in the scripts directory. - - * The header file and library directories are include/mysql and - lib/mysql rather than include and lib. - - You can create your own binary installation from a compiled source - distribution by executing the scripts/make_binary_distribution - script from the top directory of the source distribution. - -2.1.6. Compiler-Specific Build Characteristics - - In some cases, the compiler used to build MySQL affects the - features available for use. The notes in this section apply for - binary distributions provided by Oracle Corporation or that you - compile yourself from source. - - icc (Intel C++ Compiler) Builds - - A server built with icc has these characteristics: - - * SSL support is not included. - - * InnoDB Plugin is not included. - -2.2. Installing MySQL from Generic Binaries on Unix/Linux - - This section covers the installation of MySQL binary distributions - that are provided for various platforms in the form of compressed - tar files (files with a .tar.gz extension). - - To obtain MySQL, see Section 2.1.3, "How to Get MySQL." - - Oracle provides a set of binary distributions of MySQL. In - addition to binaries provided in platform-specific package - formats, we offer binary distributions for a number of platforms - in the form of compressed tar files (.tar.gz files). For Windows - distributions, see Section 2.5, "Installing MySQL on Windows." - - If you want to compile a debug version of MySQL from a source - distribution, you should add --with-debug or --with-debug=full to - the configure command used to configure the distribution and - remove any -fomit-frame-pointer options. - - MySQL tar file binary distributions have names of the form - mysql-VERSION-OS.tar.gz, where VERSION is a number (for example, - 5.1.50), and OS indicates the type of operating system for which - the distribution is intended (for example, pc-linux-i686). - - In addition to these generic packages, we also offer binaries in - platform-specific package formats for selected platforms. See the - platform specific sections for more information, for more - information on how to install these. - - You need the following tools to install a MySQL tar file binary - distribution: - - * GNU gunzip to uncompress the distribution. - - * A reasonable tar to unpack the distribution. GNU tar is known - to work. Some operating systems come with a preinstalled - version of tar that is known to have problems. For example, - the tar provided with early versions of Mac OS X, SunOS 4.x, - Solaris 8, Solaris 9, Solaris 10 and OpenSolaris, and HP-UX - are known to have problems with long file names. - - + On Mac OS X, you can use the preinstalled gnutar program. - - + On Solaris 10 and OpenSolaris you can use the - preinstalled gtar. - - + On other systems with a deficient tar, you should install - GNU tar first. - -Warning - - If you have previously installed a MySQL installation using your - operating system native package management system, such as yum or - apt-get, you may experience problems installing using a native - binary. Make sure your previous MySQL previous installation has - been removed entirely (using your package management system), and - that any additional files, such as old versions of your data - files, have also been removed. You should also check the existence - of configuration files such as /etc/my.cnf or the /etc/mysql - directory have been deleted. - - If you run into problems and need to file a bug report, please use - the instructions in Section 1.7, "How to Report Bugs or Problems." - - The basic commands that you must execute to install and use a - MySQL binary distribution are: - -Note - - The following process assumes that you have root (administrator) - access to your system. Alternatively you can prefix each command - using the sudo (Linux) or pfexec (OpenSolaris) command. -shell> groupadd mysql -shell> useradd -g mysql mysql -shell> cd /usr/local -shell> gunzip < /path/to/mysql-VERSION-OS.tar.gz | tar xvf - -shell> ln -s full-path-to-mysql-VERSION-OS mysql -shell> cd mysql -shell> chown -R mysql . -shell> chgrp -R mysql . -shell> scripts/mysql_install_db --user=mysql -shell> chown -R root . -shell> chown -R mysql data -shell> bin/mysqld_safe --user=mysql & - -Note - - This procedure does not set up any passwords for MySQL accounts. - After following the procedure, proceed to Section 2.13, - "Post-Installation Setup and Testing." - - A more detailed version of the preceding description for - installing a binary distribution follows: - -Note - - The following process assumes that you have root (administrator) - access to your system. Alternatively you can prefix each command - using the sudo (Linux) or pfexec (OpenSolaris) command. - - 1. If your system does not already have a user and group for - mysqld to run as, you may need to create one. -shell> groupadd mysql -shell> useradd -g mysql mysql - -Note - The above will create a user that has login permissions to - your server. You may wish to disable the account, as the user - is only required for ownership, not login, purposes. - These commands add the mysql group and the mysql user. The - syntax for useradd and groupadd may differ slightly on - different versions of Unix, or they may have different names - such as adduser and addgroup. - You might want to call the user and group something else - instead of mysql. If so, substitute the appropriate name in - the following steps. - - 2. Pick the directory under which you want to unpack the - distribution and change location into it. In the following - example, we unpack the distribution under /usr/local. (The - instructions, therefore, assume that you have permission to - create files and directories in /usr/local. If that directory - is protected, you must perform the installation as root.) -shell> cd /usr/local - - 3. Obtain a distribution file using the instructions in Section - 2.1.3, "How to Get MySQL." For a given release, binary - distributions for all platforms are built from the same MySQL - source distribution. - - 4. Unpack the distribution, which creates the installation - directory. Then create a symbolic link to that directory: -shell> gunzip < /path/to/mysql-VERSION-OS.tar.gz | tar xvf - -shell> ln -s full-path-to-mysql-VERSION-OS mysql - The tar command creates a directory named mysql-VERSION-OS. - The ln command makes a symbolic link to that directory. This - lets you refer more easily to the installation directory as - /usr/local/mysql. - With GNU tar, no separate invocation of gunzip is necessary. - You can replace the first line with the following alternative - command to uncompress and extract the distribution: -shell> tar zxvf /path/to/mysql-VERSION-OS.tar.gz - - 5. Change location into the installation directory: -shell> cd mysql - You will find several files and subdirectories in the mysql - directory. The most important for installation purposes are - the bin and scripts subdirectories: - - + The bin directory contains client programs and the - server. You should add the full path name of this - directory to your PATH environment variable so that your - shell finds the MySQL programs properly. See Section - 2.14, "Environment Variables." - - + The scripts directory contains the mysql_install_db - script used to initialize the mysql database containing - the grant tables that store the server access - permissions. - - 6. Ensure that the distribution contents are accessible to mysql. - If you unpacked the distribution as mysql, no further action - is required. If you unpacked the distribution as root, its - contents will be owned by root. Change its ownership to mysql - by executing the following commands as root in the - installation directory: -shell> chown -R mysql . -shell> chgrp -R mysql . - The first command changes the owner attribute of the files to - the mysql user. The second changes the group attribute to the - mysql group. - - 7. If you have not installed MySQL before, you must create the - MySQL data directory and initialize the grant tables: -shell> scripts/mysql_install_db --user=mysql - If you run the command as root, include the --user option as - shown. If you run the while logged in as that user, you can - omit the --user option. - The command should create the data directory and its contents - with mysql as the owner. - After creating or updating the grant tables, you need to - restart the server manually. - - 8. Most of the MySQL installation can be owned by root if you - like. The exception is that the data directory must be owned - by mysql. To accomplish this, run the following commands as - root in the installation directory: -shell> chown -R root . -shell> chown -R mysql data - - 9. If the plugin directory is writable by the server, it may be - possible for a user to write executable code to a file in the - directory using SELECT ... INTO DUMPFILE. This can be - prevented by making plugin_dir read only to the server or by - setting --secure-file-priv to a directory where SELECT writes - can be made safely. - 10. If you want MySQL to start automatically when you boot your - machine, you can copy support-files/mysql.server to the - location where your system has its startup files. More - information can be found in the support-files/mysql.server - script itself and in Section 2.13.1.2, "Starting and Stopping - MySQL Automatically." - 11. You can set up new accounts using the bin/mysql_setpermission - script if you install the DBI and DBD::mysql Perl modules. See - Section 4.6.14, "mysql_setpermission --- Interactively Set - Permissions in Grant Tables." For Perl module installation - instructions, see Section 2.15, "Perl Installation Notes." - 12. If you would like to use mysqlaccess and have the MySQL - distribution in some nonstandard location, you must change the - location where mysqlaccess expects to find the mysql client. - Edit the bin/mysqlaccess script at approximately line 18. - Search for a line that looks like this: -$MYSQL = '/usr/local/bin/mysql'; # path to mysql executable - Change the path to reflect the location where mysql actually - is stored on your system. If you do not do this, a Broken pipe - error will occur when you run mysqlaccess. - - After everything has been unpacked and installed, you should test - your distribution. To start the MySQL server, use the following - command: -shell> bin/mysqld_safe --user=mysql & - - If you run the command as root, you must use the --user option as - shown. The value of the option is the name of the login account - that you created in the first step to use for running the server. - If you run the command while logged in as mysql, you can omit the - --user option. - - If the command fails immediately and prints mysqld ended, you can - find some information in the host_name.err file in the data - directory. - - More information about mysqld_safe is given in Section 4.3.2, - "mysqld_safe --- MySQL Server Startup Script." - -Note - - The accounts that are listed in the MySQL grant tables initially - have no passwords. After starting the server, you should set up - passwords for them using the instructions in Section 2.13, - "Post-Installation Setup and Testing." - -2.3. MySQL Installation Using a Source Distribution - - Before you proceed with an installation from source, first check - whether our binary is available for your platform and whether it - works for you. We put a great deal of effort into ensuring that - our binaries are built with the best possible options. - - To obtain a source distribution for MySQL, Section 2.1.3, "How to - Get MySQL." If you want to build MySQL from source on Windows, see - Section 2.5.9, "Installing MySQL from Source on Windows." - - MySQL source distributions are provided as compressed tar archives - and have names of the form mysql-VERSION.tar.gz, where VERSION is - a number like 5.1.50. - - You need the following tools to build and install MySQL from - source: - - * GNU gunzip to uncompress the distribution. - - * A reasonable tar to unpack the distribution. GNU tar is known - to work. Some operating systems come with a preinstalled - version of tar that is known to have problems. For example, - the tar provided with early versions of Mac OS X, SunOS 4.x, - Solaris 8, Solaris 9, Solaris 10 and OpenSolaris, and HP-UX - are known to have problems with long file names. On Mac OS X, - you can use the preinstalled gnutar program. On Solaris 10 and - OpenSolaris you can use the preinstalled gtar. On other - systems with a deficient tar, you should install GNU tar - first. - - * A working ANSI C++ compiler. GCC 3.2 or later, Sun Studio 10 - or later, Visual Studio 2005 or later, and many current - vendor-supplied compilers are known to work. - - * A good make program. GNU make is always recommended and is - sometimes required. (BSD make fails, and vendor-provided make - implementations may fail as well.) If you have problems, use - GNU make 3.75 or newer. - - * libtool 1.5.24 or later is also recommended. - - If you are using a version of gcc recent enough to understand the - -fno-exceptions option, it is very important that you use this - option. Otherwise, you may compile a binary that crashes randomly. - Also use -felide-constructors and -fno-rtti along with - -fno-exceptions. When in doubt, do the following: -CFLAGS="-O3" CXX=gcc CXXFLAGS="-O3 -felide-constructors \ - -fno-exceptions -fno-rtti" ./configure \ - --prefix=/usr/local/mysql --enable-assembler \ - --with-mysqld-ldflags=-all-static - - On most systems, this gives you a fast and stable binary. - - If you run into problems and need to file a bug report, please use - the instructions in Section 1.7, "How to Report Bugs or Problems." - -2.3.1. Source Installation Overview - - The basic commands that you must execute to install a MySQL source - distribution are: -shell> groupadd mysql -shell> useradd -g mysql mysql -shell> gunzip < mysql-VERSION.tar.gz | tar -xvf - -shell> cd mysql-VERSION -shell> ./configure --prefix=/usr/local/mysql -shell> make -shell> make install -shell> cp support-files/my-medium.cnf /etc/my.cnf -shell> cd /usr/local/mysql -shell> chown -R mysql . -shell> chgrp -R mysql . -shell> bin/mysql_install_db --user=mysql -shell> chown -R root . -shell> chown -R mysql var -shell> bin/mysqld_safe --user=mysql & - - If you start from a source RPM, do the following: -shell> rpmbuild --rebuild --clean MySQL-VERSION.src.rpm - - This makes a binary RPM that you can install. For older versions - of RPM, you may have to replace the command rpmbuild with rpm - instead. - -Note - - This procedure does not set up any passwords for MySQL accounts. - After following the procedure, proceed to Section 2.13, - "Post-Installation Setup and Testing," for post-installation setup - and testing. - - A more detailed version of the preceding description for - installing MySQL from a source distribution follows: - - 1. Add a login user and group for mysqld to run as: -shell> groupadd mysql -shell> useradd -g mysql mysql - These commands add the mysql group and the mysql user. The - syntax for useradd and groupadd may differ slightly on - different versions of Unix, or they may have different names - such as adduser and addgroup. - You might want to call the user and group something else - instead of mysql. If so, substitute the appropriate name in - the following steps. - - 2. Perform the following steps as the mysql user, except as - noted. - - 3. Pick the directory under which you want to unpack the - distribution and change location into it. - - 4. Obtain a distribution file using the instructions in Section - 2.1.3, "How to Get MySQL." - - 5. Unpack the distribution into the current directory: -shell> gunzip < /path/to/mysql-VERSION.tar.gz | tar xvf - - This command creates a directory named mysql-VERSION. - With GNU tar, no separate invocation of gunzip is necessary. - You can use the following alternative command to uncompress - and extract the distribution: -shell> tar zxvf /path/to/mysql-VERSION-OS.tar.gz - - 6. Change location into the top-level directory of the unpacked - distribution: -shell> cd mysql-VERSION - Note that currently you must configure and build MySQL from - this top-level directory. You cannot build it in a different - directory. - - 7. Configure the release and compile everything: -shell> ./configure --prefix=/usr/local/mysql -shell> make - When you run configure, you might want to specify other - options. Run ./configure --help for a list of options. Section - 2.3.2, "Typical configure Options," discusses some of the more - useful options. - If configure fails and you are going to send mail to a MySQL - mailing list to ask for assistance, please include any lines - from config.log that you think can help solve the problem. - Also include the last couple of lines of output from - configure. To file a bug report, please use the instructions - in Section 1.7, "How to Report Bugs or Problems." - If the compile fails, see Section 2.3.4, "Dealing with - Problems Compiling MySQL," for help. - - 8. Install the distribution: -shell> make install - You might need to run this command as root. - If you want to set up an option file, use one of those present - in the support-files directory as a template. For example: -shell> cp support-files/my-medium.cnf /etc/my.cnf - You might need to run this command as root. - If you want to configure support for InnoDB tables, you should - edit the /etc/my.cnf file, remove the # character before the - option lines that start with innodb_..., and modify the option - values to be what you want. See Section 4.2.3.3, "Using Option - Files," and Section 13.6.2, "InnoDB Configuration." - - 9. Change location into the installation directory: -shell> cd /usr/local/mysql - 10. If you ran the make install command as root, the installed - files will be owned by root. Ensure that the installation is - accessible to mysql by executing the following commands as - root in the installation directory: -shell> chown -R mysql . -shell> chgrp -R mysql . - The first command changes the owner attribute of the files to - the mysql user. The second changes the group attribute to the - mysql group. - 11. If you have not installed MySQL before, you must create the - MySQL data directory and initialize the grant tables: -shell> bin/mysql_install_db --user=mysql - If you run the command as root, include the --user option as - shown. If you run the command while logged in as mysql, you - can omit the --user option. - The command should create the data directory and its contents - with mysql as the owner. - After using mysql_install_db to create the grant tables for - MySQL, you must restart the server manually. The mysqld_safe - command to do this is shown in a later step. - 12. Most of the MySQL installation can be owned by root if you - like. The exception is that the data directory must be owned - by mysql. To accomplish this, run the following commands as - root in the installation directory: -shell> chown -R root . -shell> chown -R mysql var - 13. If the plugin directory is writable by the server, it may be - possible for a user to write executable code to a file in the - directory using SELECT ... INTO DUMPFILE. This can be - prevented by making plugin_dir read only to the server or by - setting --secure-file-priv to a directory where SELECT writes - can be made safely. - 14. If you want MySQL to start automatically when you boot your - machine, you can copy support-files/mysql.server to the - location where your system has its startup files. More - information can be found in the support-files/mysql.server - script itself; see also Section 2.13.1.2, "Starting and - Stopping MySQL Automatically." - 15. You can set up new accounts using the bin/mysql_setpermission - script if you install the DBI and DBD::mysql Perl modules. See - Section 4.6.14, "mysql_setpermission --- Interactively Set - Permissions in Grant Tables." For Perl module installation - instructions, see Section 2.15, "Perl Installation Notes." - - After everything has been installed, you should test your - distribution. To start the MySQL server, use the following - command: -shell> /usr/local/mysql/bin/mysqld_safe --user=mysql & - - If you run the command as root, you should use the --user option - as shown. The value of the option is the name of the login account - that you created in the first step to use for running the server. - If you run the command while logged in as that user, you can omit - the --user option. - - If the command fails immediately and prints mysqld ended, you can - find some information in the host_name.err file in the data - directory. - - More information about mysqld_safe is given in Section 4.3.2, - "mysqld_safe --- MySQL Server Startup Script." - -Note - - The accounts that are listed in the MySQL grant tables initially - have no passwords. After starting the server, you should set up - passwords for them using the instructions in Section 2.13, - "Post-Installation Setup and Testing." - -2.3.2. Typical configure Options - - The configure script gives you a great deal of control over how - you configure a MySQL source distribution. Typically you do this - using options on the configure command line. You can also affect - configure using certain environment variables. See Section 2.14, - "Environment Variables." For a full list of options supported by - configure, run this command: -shell> ./configure --help - - A list of the available configure options is provided in the table - below. - - Table 2.1. Build (configure) Reference - Formats Description Default Introduced Removed - --bindir=DIR User executables EPREFIX/bin - --build=BUILD Configure for building on BUILD guessed - --cache-file=FILE Cache test results in FILE disabled - -C Alias for `--cache-file=config.cache' - --config-cache - --datadir=DIR Read-only architecture-independent data PREFIX/share - - --disable-FEATURE Do not include FEATURE - --disable-dependency-tracking Disable dependency tracking - --disable-grant-options Disable GRANT options - --disable-largefile Omit support for large files - --disable-libtool-lock Disable libtool lock - --disable-thread-safe-client Compile the client without threads - 5.1.7 - --enable-FEATURE Enable FEATURE - --enable-assembler Use assembler versions of some string functions - if available - --enable-debug-sync Compile in Debug Sync facility 5.1.41 - --enable-dependency-tracking Do not reject slow dependency - extractors - --enable-fast-install Optimize for fast installation yes - --enable-local-infile Enable LOAD DATA LOCAL INFILE disabled - --enable-shared Build shared libraries yes - --enable-static Build static libraries yes - --enable-thread-safe-client Compile the client with threads - --exec-prefix=EPREFIX Install architecture-dependent files in - EPREFIX - -h Display this help and exit - --help - --help=short Display options specific to this package - --help=recursive Display the short help of all the included - packages - --host=HOST Cross-compile to build programs to run on HOST - --includedir=DIR C header files PREFIX/include - --infodir=DIR Info documentation PREFIX/info - --libdir=DIR Object code libraries EPREFIX/lib - --libexecdir=DIR Program executables EPREFIX/libexec - --localstatedir=DIR Modifiable single-machine data PREFIX/var - --mandir=DIR man documentation PREFIX/man - -n Do not create output files - --no-create - --oldincludedir=DIR C header files for non-gcc /usr/include - --prefix=PREFIX Install architecture-independent files in PREFIX - - --program-prefix=PREFIX Prepend PREFIX to installed program names - - --program-suffix=SUFFIX Append SUFFIX to installed program names - - --program-transform-name=PROGRAM run sed PROGRAM on installed - program names - -q Do not print `checking...' messages - --quiet - --sbindir=DIR System administrative executables EPREFIX/sbin - --sharedstatedir=DIR Modifiable architecture-independent data - PREFIX/com - --srcdir=DIR Find the sources in DIR configure directory or .. - --sysconfdir=DIR Read-only single-machine data PREFIX/etc - --target=TARGET Configure for building compilers for TARGET - -V Display version information and exit - --version - --with-PACKAGE Use PACKAGE - --with-archive-storage-engine Enable the Archive Storage Engine no - - --with-atomic-ops Implement atomic operations using pthread - rwlocks or atomic CPU instructions for multi-processor 5.1.12 - --with-berkeley-db Use BerkeleyDB located in DIR no - --with-berkeley-db-includes Find Berkeley DB headers in DIR - --with-berkeley-db-libs Find Berkeley DB libraries in DIR - --with-big-tables Support tables with more than 4 G rows even on - 32 bit platforms - --with-blackhole-storage-engine Enable the Blackhole Storage - Engine no - --with-charset Default character set - --with-client-ldflags Extra linking arguments for clients - --with-collation Default collation - --with-comment Comment about compilation environment - --with-csv-storage-engine Enable the CSV Storage Engine yes - --with-darwin-mwcc Use Metrowerks CodeWarrior wrappers on OS - X/Darwin - --with-debug Add debug code 5.1.7 - --with-debug=full Add debug code (adds memory checker, very slow) - - --with-embedded-privilege-control Build parts to check user's - privileges (only affects embedded library) - --with-embedded-server Build the embedded server - --with-error-inject Enable error injection in MySQL Server - 5.1.11 - --with-example-storage-engine Enable the Example Storage Engine no - - --with-extra-charsets Use charsets in addition to default - --with-fast-mutexes Compile with fast mutexes enabled 5.1.5 - --with-federated-storage-engine Enable federated storage engine no - 5.1.3 5.1.9 - --with-gnu-ld Assume the C compiler uses GNU ld no - --with-innodb Enable innobase storage engine no 5.1.3 5.1.9 - --with-lib-ccflags Extra CC options for libraries - --with-libwrap=DIR Compile in libwrap (tcp_wrappers) support - --with-low-memory Try to use less memory to compile to avoid - memory limitations - --with-machine-type Set the machine type, like "powerpc" - --with-max-indexes=N Sets the maximum number of indexes per table - 64 - --with-mysqld-ldflags Extra linking arguments for mysqld - --with-mysqld-libs Extra libraries to link with for mysqld - --with-mysqld-user What user the mysqld daemon shall be run as - - --with-mysqlmanager Build the mysqlmanager binary Build if server - is built - --with-named-curses-libs Use specified curses libraries - --with-named-thread-libs Use specified thread libraries - --with-ndb-ccflags Extra CC options for ndb compile - --with-ndb-docs Include the NDB Cluster ndbapi and mgmapi - documentation - --with-ndb-port Port for NDB Cluster management server - --with-ndb-port-base Port for NDB Cluster management server - --with-ndb-sci=DIR Provide MySQL with a custom location of sci - library - --with-ndb-test Include the NDB Cluster ndbapi test programs - --with-ndbcluster Include the NDB Cluster table handler no - --with-openssl=DIR Include the OpenSSL support - --with-openssl-includes Find OpenSSL headers in DIR - --with-openssl-libs Find OpenSSL libraries in DIR - --with-other-libc=DIR Link against libc and other standard - libraries installed in the specified nonstandard location - --with-pic Try to use only PIC/non-PIC objects Use both - --with-plugin-PLUGIN Forces the named plugin to be linked into - mysqld statically 5.1.11 - --with-plugins Plugins to include in mysqld none 5.1.11 - --with-pstack Use the pstack backtrace library - --with-pthread Force use of pthread library - --with-row-based-replication Include row-based replication 5.1.5 - 5.1.6 - --with-server-suffix Append value to the version string - --with-ssl=DIR Include SSL support 5.1.11 - --with-system-type Set the system type, like "sun-solaris10" - --with-tags Include additional configurations automatic - --with-tcp-port Which port to use for MySQL services 3306 - --with-unix-socket-path Where to put the unix-domain socket - --with-yassl Include the yaSSL support - --with-zlib-dir=no|bundled|DIR Provide MySQL with a custom - location of compression library - --without-PACKAGE Do not use PACKAGE - --without-bench Skip building of the benchmark suite - --without-debug Build a production version without debugging code - - --without-docs Skip building of the documentation - --without-extra-tools Skip building utilities in the tools - directory - --without-geometry Do not build geometry-related parts - --without-libedit Use system libedit instead of bundled copy - --without-man Skip building of the man pages - --without-ndb-binlog Disable ndb binlog 5.1.6 - --without-ndb-debug Disable special ndb debug features - --without-plugin-PLUGIN Exclude PLUGIN 5.1.11 - --without-query-cache Do not build query cache - --without-readline Use system readline instead of bundled copy - - --without-row-based-replication Don't include row-based - replication 5.1.7 5.1.14 - --without-server Only build the client - --without-uca Skip building of the national Unicode collations - - Some of the configure options available are described here. For - options that may be of use if you have difficulties building - MySQL, see Section 2.3.4, "Dealing with Problems Compiling MySQL." - - * To compile just the MySQL client libraries and client programs - and not the server, use the --without-server option: -shell> ./configure --without-server - If you have no C++ compiler, some client programs such as - mysql cannot be compiled because they require C++.. In this - case, you can remove the code in configure that tests for the - C++ compiler and then run ./configure with the - --without-server option. The compile step should still try to - build all clients, but you can ignore any warnings about files - such as mysql.cc. (If make stops, try make -k to tell it to - continue with the rest of the build even if errors occur.) - - * If you want to build the embedded MySQL library (libmysqld.a), - use the --with-embedded-server option. - - * If you do not want your log files and database directories - located under /usr/local/var, use a configure command - something like one of these: -shell> ./configure --prefix=/usr/local/mysql -shell> ./configure --prefix=/usr/local \ - --localstatedir=/usr/local/mysql/data - The first command changes the installation prefix so that - everything is installed under /usr/local/mysql rather than the - default of /usr/local. The second command preserves the - default installation prefix, but overrides the default - location for database directories (normally /usr/local/var) - and changes it to /usr/local/mysql/data. - You can also specify the installation directory and data - directory locations at server startup time by using the - --basedir and --datadir options. These can be given on the - command line or in an MySQL option file, although it is more - common to use an option file. See Section 4.2.3.3, "Using - Option Files." - - * This option specifies the port number on which the server - listens for TCP/IP connections. The default is port 3306. To - listen on a different port, use a configure command like this: -shell> ./configure --with-tcp-port=3307 - - * If you are using Unix and you want the MySQL socket file - location to be somewhere other than the default location - (normally in the directory /tmp or /var/run), use a configure - command like this: -shell> ./configure \ - --with-unix-socket-path=/usr/local/mysql/tmp/mysql.sock - The socket file name must be an absolute path name. You can - also change the location of mysql.sock at server startup by - using a MySQL option file. See Section B.5.4.5, "How to - Protect or Change the MySQL Unix Socket File." - - * If you want to compile statically linked programs (for - example, to make a binary distribution, to get better - performance, or to work around problems with some Red Hat - Linux distributions), run configure like this: -shell> ./configure --with-client-ldflags=-all-static \ - --with-mysqld-ldflags=-all-static - - * If you are using gcc and do not have libg++ or libstdc++ - installed, you can tell configure to use gcc as your C++ - compiler: -shell> CC=gcc CXX=gcc ./configure - When you use gcc as your C++ compiler, it does not attempt to - link in libg++ or libstdc++. This may be a good thing to do - even if you have those libraries installed. Some versions of - them have caused strange problems for MySQL users in the past. - The following list indicates some compilers and environment - variable settings that are commonly used with each one. - - + gcc 2.7.2: -CC=gcc CXX=gcc CXXFLAGS="-O3 -felide-constructors" - - + gcc 2.95.2: -CFLAGS="-O3 -mpentiumpro" CXX=gcc CXXFLAGS="-O3 -mpentiumpro \ --felide-constructors -fno-exceptions -fno-rtti" - - + pgcc 2.90.29 or newer: -CFLAGS="-O3 -mpentiumpro -mstack-align-double" CXX=gcc \ -CXXFLAGS="-O3 -mpentiumpro -mstack-align-double \ --felide-constructors -fno-exceptions -fno-rtti" - In most cases, you can get a reasonably optimized MySQL binary - by using the options from the preceding list and adding the - following options to the configure line: ---prefix=/usr/local/mysql --enable-assembler \ ---with-mysqld-ldflags=-all-static - The full configure line would, in other words, be something - like the following for all recent gcc versions: -CFLAGS="-O3 -mpentiumpro" CXX=gcc CXXFLAGS="-O3 -mpentiumpro \ --felide-constructors -fno-exceptions -fno-rtti" ./configure \ ---prefix=/usr/local/mysql --enable-assembler \ ---with-mysqld-ldflags=-all-static - The binaries we provide on the MySQL Web site at - http://dev.mysql.com/downloads/ are all compiled with full - optimization and should be perfect for most users. See Section - 2.2, "Installing MySQL from Generic Binaries on Unix/Linux." - There are some configuration settings you can tweak to build - an even faster binary, but these are only for advanced users. - See Section 7.9.1, "How Compiling and Linking Affects the - Speed of MySQL." - If the build fails and produces errors about your compiler or - linker not being able to create the shared library - libmysqlclient.so.N (where N is a version number), you can - work around this problem by giving the --disable-shared option - to configure. In this case, configure does not build a shared - libmysqlclient.so.N library. - - * By default, MySQL uses the latin1 (cp1252 West European) - character set. To change the default set, use the - --with-charset option: -shell> ./configure --with-charset=CHARSET - CHARSET may be one of binary, armscii8, ascii, big5, cp1250, - cp1251, cp1256, cp1257, cp850, cp852, cp866, cp932, dec8, - eucjpms, euckr, gb2312, gbk, geostd8, greek, hebrew, hp8, - keybcs2, koi8r, koi8u, latin1, latin2, latin5, latin7, macce, - macroman, sjis, swe7, tis620, ucs2, ujis, utf8. (Additional - character sets might be available. Check the output from - ./configure --help for the current list.) - The default collation may also be specified. MySQL uses the - latin1_swedish_ci collation by default. To change this, use - the --with-collation option: -shell> ./configure --with-collation=COLLATION - To change both the character set and the collation, use both - the --with-charset and --with-collation options. The collation - must be a legal collation for the character set. (Use the SHOW - COLLATION statement to determine which collations are - available for each character set.) - With the configure option --with-extra-charsets=LIST, you can - define which additional character sets should be compiled into - the server. LIST is one of the following: - - + A list of character set names separated by spaces - - + complex to include all character sets that can't be - dynamically loaded - - + all to include all character sets into the binaries - Clients that want to convert characters between the server and - the client should use the SET NAMES statement. See Section - 5.1.4, "Server System Variables," and Section 9.1.4, - "Connection Character Sets and Collations." - - * To configure MySQL with debugging code, use the --with-debug - option: -shell> ./configure --with-debug - This causes a safe memory allocator to be included that can - find some errors and that provides output about what is - happening. See MySQL Internals: Porting - (http://forge.mysql.com/wiki/MySQL_Internals_Porting). - As of MySQL 5.1.12, using --with-debug to configure MySQL with - debugging support enables you to use the - --debug="d,parser_debug" option when you start the server. - This causes the Bison parser that is used to process SQL - statements to dump a parser trace to the server's standard - error output. Typically, this output is written to the error - log. - - * To cause the Debug Sync facility to be compiled into the - server, use the --enable-debug-sync option. This facility is - used for testing and debugging. When compiled in, Debug Sync - is disabled by default. To enable it, start mysqld with the - --debug-sync-timeout=N option, where N is a timeout value - greater than 0. (The default value is 0, which disables Debug - Sync.) N becomes the default timeout for individual - synchronization points. - Debug Sync is also compiled in if you configure with the - --with-debug option (which implies --enable-debug-sync), - unless you also use the --disable-debug-sync option. - For a description of the Debug Sync facility and how to use - synchronization points, see MySQL Internals: Test - Synchronization - (http://forge.mysql.com/wiki/MySQL_Internals_Test_Synchronizat - ion). - The --enable-debug-sync and --disable-debug-sync options were - added in MySQL 5.1.41. - - * If your client programs are using threads, you must compile a - thread-safe version of the MySQL client library with the - --enable-thread-safe-client configure option. This creates a - libmysqlclient_r library with which you should link your - threaded applications. See Section 21.9.16.2, "How to Make a - Threaded Client." - - * Some features require that the server be built with - compression library support, such as the COMPRESS() and - UNCOMPRESS() functions, and compression of the client/server - protocol. The --with-zlib-dir=no|bundled|DIR option provides - control over compression library support. The value no - explicitly disables compression support. bundled causes the - zlib library bundled in the MySQL sources to be used. A DIR - path name specifies the directory in which to find the - compression library sources. - - * It is possible to build MySQL with large table support using - the --with-big-tables option. - This option causes the variables that store table row counts - to be declared as unsigned long long rather than unsigned - long. This enables tables to hold up to approximately - 1.844E+19 ((2^32)^2) rows rather than 2^32 (~4.295E+09) rows. - Previously it was necessary to pass -DBIG_TABLES to the - compiler manually in order to enable this feature. - - * Run configure with the --disable-grant-options option to cause - the --bootstrap, --skip-grant-tables, and --init-file options - for mysqld to be disabled. For Windows, the configure.js - script recognizes the DISABLE_GRANT_OPTIONS flag, which has - the same effect. The capability is available as of MySQL - 5.1.15. - - * This option allows MySQL Community Server features to be - enabled. Additional options may be required for individual - features, such as --enable-profiling to enable statement - profiling. This option was added in MySQL 5.1.24. It is - enabled by default as of MySQL 5.1.28; to disable it, use - --disable-community-features. - - * When given with --enable-community-features, the - --enable-profiling option enables the statement profiling - capability exposed by the SHOW PROFILE and SHOW PROFILES - statements. (See Section 12.4.5.33, "SHOW PROFILES Syntax.") - This option was added in MySQL 5.1.24. It is enabled by - default as of MySQL 5.1.28; to disable it, use - --disable-profiling. - - * See Section 2.1, "General Installation Guidance," for options - that pertain to particular operating systems. - - * See Section 5.5.6.2, "Using SSL Connections," for options that - pertain to configuring MySQL to support secure (encrypted) - connections. - - * Several configure options apply to plugin selection and - building: ---with-plugins=PLUGIN[,PLUGIN]... ---with-plugins=GROUP ---with-plugin-PLUGIN ---without-plugin-PLUGIN - PLUGIN is an individual plugin name such as csv or archive. - As shorthand, GROUP is a configuration group name such as none - (select no plugins) or all (select all plugins). - You can build a plugin as static (compiled into the server) or - dynamic (built as a dynamic library that must be installed - using the INSTALL PLUGIN statement before it can be used). - Some plugins might not support static or dynamic build. - configure --help shows the following information pertaining to - plugins: - - + The plugin-related options - - + The names of all available plugins - - + For each plugin, a description of its purpose, which - build types it supports (static or dynamic), and which - plugin groups it is a part of. - --with-plugins can take a list of one or more plugin names - separated by commas, or a plugin group name. The named plugins - are configured to be built as static plugins. - --with-plugin-PLUGIN configures the given plugin to be built - as a static plugin. - --without-plugin-PLUGIN disables the given plugin from being - built. - If a plugin is named both with a --with and --without option, - the result is undefined. - For any plugin that is not explicitly selected or disabled, it - is selected to be built dynamically if it supports dynamic - build, and not built if it does not support dynamic build. - (Thus, in the case that no plugin options are given, all - plugins that support dynamic build are selected to be built as - dynamic plugins. Plugins that do not support dynamic build are - not built.) - -2.3.3. Installing from the Development Source Tree - -Caution - - You should read this section only if you are interested in helping - us test our new code. If you just want to get MySQL up and running - on your system, you should use a standard release distribution - (either a binary or source distribution). - - To obtain the most recent development source tree, you must have - Bazaar installed. You can obtain Bazaar from the Bazaar VCS Web - site (http://bazaar-vcs.org). Bazaar is supported by any platform - that supports Python, and is therefore compatible with any Linux, - Unix, Windows or Mac OS X host. Instructions for downloading and - installing Bazaar on the different platforms are available on the - Bazaar Web site. - - All MySQL projects are hosted on Launchpad - (http://launchpad.net/). MySQL projects, including MySQL server, - MySQL Workbench, and others are available from the Sun/MySQL - Engineering (http://launchpad.net/~mysql) page. For the - repositories related only to MySQL server, see the MySQL Server - (http://launchpad.net/mysql-server) page. - - To build under Unix/Linux, you must have the following tools - installed: - - * GNU make, available from http://www.gnu.org/software/make/. - Although some platforms come with their own make - implementations, it is highly recommended that you use GNU - make. It may already be available on your system as gmake. - - * autoconf 2.58 (or newer), available from - http://www.gnu.org/software/autoconf/. - - * automake 1.8.1, available from - http://www.gnu.org/software/automake/. - - * libtool 1.5, available from - http://www.gnu.org/software/libtool/. - - * m4, available from http://www.gnu.org/software/m4/. - - * bison, available from http://www.gnu.org/software/bison/. You - should use the latest version of bison where possible. Version - 1.75 and version 2.1 are known to work. There have been - reported problems with bison 1.875. If you experience - problems, upgrade to a later, rather than earlier, version. - Versions of bison older than 1.75 may report this error: -sql_yacc.yy:#####: fatal error: maximum table size (32767) exceeded - The maximum table size is not actually exceeded; the error is - caused by bugs in older versions of bison. - - To build under Windows you must have Microsoft Visual C++ 2005 - Express Edition, Visual Studio .Net 2003 (7.1), or Visual Studio - 2005 (8.0) compiler system. - - Once the necessary tools are installed, you must create a local - branch of the MySQL source code on your machine: - - 1. To obtain a copy of the MySQL source code, you must create a - new Bazaar branch. If you do not already have a Bazaar - repository directory set up, you need to initialize a new - directory: -shell> mkdir mysql-server -shell> bzr init-repo --trees mysql-server - - 2. Once you have an initialized directory, you can branch from - the public MySQL server repositories to create a local source - tree. To create a branch of a specific version: -shell> cd mysql-server -shell> bzr branch lp:mysql-server/5.1 mysql-5.1 - - 3. The initial download will take some time to complete, - depending on the speed of your connection. Please be patient. - Once you have downloaded the first tree, additional trees - should take significantly less time to download. - - 4. When building from the Bazaar branch, you may want to create a - copy of your active branch so that you can make configuration - and other changes without affecting the original branch - contents. You can achieve this by branching from the original - branch: -shell> bzr branch mysql-5.1 mysql-5.1-build - - 5. To obtain changes made after you have set up the branch - initially, update it using the pull option periodically. Use - this command in the top-level directory of the local copy: -shell> bzr pull - You can examine the changeset comments for the tree by using - the log option to bzr: -shell> bzr log - You can also browse changesets, comments, and source code - online. To browse this information for MySQL 5.1, go to the - Launchpad MySQL Server (http://launchpad.net/mysql-server) - page. - If you see diffs (changes) or code that you have a question - about, do not hesitate to send email to the MySQL internals - mailing list. See Section 1.6.1, "MySQL Mailing Lists." Also, - if you think you have a better idea on how to do something, - send an email message to the list with a patch. - - After you have the local branch, you can build MySQL server from - the source code. On Windows, the build process is different from - Unix/Linux: see Section 2.5.9, "Installing MySQL from Source on - Windows." - - On Unix/Linux, use the autoconf system to create the configure - script so that you can configure the build environment before - building. The following example shows the typical commands - required to build MySQL from a source tree. - - 1. Change location to the top-level directory of the source tree; - replace mysql-5.1 with the appropriate directory name. -shell> cd mysql-5.1 - - 2. Prepare the source tree for configuration. - Prior to MySQL 5.1.12, you must separately configure the - InnoDB storage engine. Run the following command from the main - source directory: -shell> (cd storage/innobase; autoreconf --force --install) - You can omit the previous command for MySQL 5.1.12 and later, - or if you do not require InnoDB support. - Prepare the remainder of the source tree: -shell> autoreconf --force --install - As an alternative to the preceding autoreconf command, you can - use BUILD/autorun.sh, which acts as a shortcut for the - following sequence of commands: -shell> aclocal; autoheader -shell> libtoolize --automake --force -shell> automake --force --add-missing; autoconf - If you get some strange errors during this stage, verify that - you have the correct version of libtool installed. - - 3. Configure the source tree and compile MySQL: -shell> ./configure # Add your favorite options here -shell> make - For a description of some configure options, see Section - 2.3.2, "Typical configure Options." - A collection of our standard configuration scripts is located - in the BUILD/ subdirectory. For example, you may find it more - convenient to use the BUILD/compile-pentium-debug script than - the preceding set of shell commands. To compile on a different - architecture, modify the script by removing flags that are - Pentium-specific, or use another script that may be more - appropriate. These scripts are provided on an "as-is" basis. - They are not officially maintained and their contents may - change from release to release. - - 4. When the build is done, run make install. Be careful with this - on a production machine; the command may overwrite your live - release installation. If you already have MySQL installed and - do not want to overwrite it, run ./configure with values for - the --prefix, --with-tcp-port, and --with-unix-socket-path - options different from those used for your production server. - - 5. Play hard with your new installation and try to make the new - features crash. Start by running make test. See Section - 22.1.2, "MySQL Test Suite." - - 6. If you have gotten to the make stage, but the distribution - does not compile, please enter the problem into our bugs - database using the instructions given in Section 1.7, "How to - Report Bugs or Problems." If you have installed the latest - versions of the required GNU tools, and they crash trying to - process our configuration files, please report that also. - However, if you get a command not found error or a similar - problem for aclocal, configure, or other required tools, do - not report it. Instead, make sure that all the required tools - are installed and that your PATH variable is set correctly so - that your shell can find them. - -2.3.4. Dealing with Problems Compiling MySQL - - All MySQL programs compile cleanly for us with no warnings on - Solaris or Linux using gcc. On other systems, warnings may occur - due to differences in system include files. See Section 2.3.5, - "MIT-pthreads Notes," for warnings that may occur when using - MIT-pthreads. For other problems, check the following list. - - The solution to many problems involves reconfiguring. If you do - need to reconfigure, take note of the following: - - * If configure is run after it has previously been run, it may - use information that was gathered during its previous - invocation. This information is stored in config.cache. When - configure starts up, it looks for that file and reads its - contents if it exists, on the assumption that the information - is still correct. That assumption is invalid when you - reconfigure. - - * Each time you run configure, you must run make again to - recompile. However, you may want to remove old object files - from previous builds first because they were compiled using - different configuration options. - - To prevent old configuration information or object files from - being used, run these commands before re-running configure: -shell> rm config.cache -shell> make clean - - Alternatively, you can run make distclean. - - The following list describes some of the problems when compiling - MySQL that have been found to occur most often: - - * If you get errors such as the ones shown here when compiling - sql_yacc.cc, you probably have run out of memory or swap - space: -Internal compiler error: program cc1plus got fatal signal 11 -Out of virtual memory -Virtual memory exhausted - The problem is that gcc requires a huge amount of memory to - compile sql_yacc.cc with inline functions. Try running - configure with the --with-low-memory option: -shell> ./configure --with-low-memory - This option causes -fno-inline to be added to the compile line - if you are using gcc and -O0 if you are using something else. - You should try the --with-low-memory option even if you have - so much memory and swap space that you think you can't - possibly have run out. This problem has been observed to occur - even on systems with generous hardware configurations, and the - --with-low-memory option usually fixes it. - - * By default, configure picks c++ as the compiler name and GNU - c++ links with -lg++. If you are using gcc, that behavior can - cause problems during configuration such as this: -configure: error: installation or configuration problem: -C++ compiler cannot create executables. - You might also observe problems during compilation related to - g++, libg++, or libstdc++. - One cause of these problems is that you may not have g++, or - you may have g++ but not libg++, or libstdc++. Take a look at - the config.log file. It should contain the exact reason why - your C++ compiler didn't work. To work around these problems, - you can use gcc as your C++ compiler. Try setting the - environment variable CXX to "gcc -O3". For example: -shell> CXX="gcc -O3" ./configure - This works because gcc compiles C++ source files as well as - g++ does, but does not link in libg++ or libstdc++ by default. - Another way to fix these problems is to install g++, libg++, - and libstdc++. However, do not use libg++ or libstdc++ with - MySQL because this only increases the binary size of mysqld - without providing any benefits. Some versions of these - libraries have also caused strange problems for MySQL users in - the past. - - * If your compile fails with errors such as any of the - following, you must upgrade your version of make to GNU make: -making all in mit-pthreads -make: Fatal error in reader: Makefile, line 18: -Badly formed macro assignment - Or: -make: file `Makefile' line 18: Must be a separator (: - Or: -pthread.h: No such file or directory - Solaris and FreeBSD are known to have troublesome make - programs. - GNU make 3.75 is known to work. - - * If you want to define flags to be used by your C or C++ - compilers, do so by adding the flags to the CFLAGS and - CXXFLAGS environment variables. You can also specify the - compiler names this way using CC and CXX. For example: -shell> CC=gcc -shell> CFLAGS=-O3 -shell> CXX=gcc -shell> CXXFLAGS=-O3 -shell> export CC CFLAGS CXX CXXFLAGS - See Section 2.2, "Installing MySQL from Generic Binaries on - Unix/Linux," for a list of flag definitions that have been - found to be useful on various systems. - - * If you get errors such as those shown here when compiling - mysqld, configure did not correctly detect the type of the - last argument to accept(), getsockname(), or getpeername(): -cxx: Error: mysqld.cc, line 645: In this statement, the referenced - type of the pointer value ''length'' is ''unsigned long'', - which is not compatible with ''int''. -new_sock = accept(sock, (struct sockaddr *)&cAddr, &length); - To fix this, edit the config.h file (which is generated by - configure). Look for these lines: -/* Define as the base type of the last arg to accept */ -#define SOCKET_SIZE_TYPE XXX - Change XXX to size_t or int, depending on your operating - system. (You must do this each time you run configure because - configure regenerates config.h.) - - * The sql_yacc.cc file is generated from sql_yacc.yy. Normally, - the build process does not need to create sql_yacc.cc because - MySQL comes with a pre-generated copy. However, if you do need - to re-create it, you might encounter this error: -"sql_yacc.yy", line xxx fatal: default action causes potential... - This is a sign that your version of yacc is deficient. You - probably need to install bison (the GNU version of yacc) and - use that instead. - - * On Debian Linux 3.0, you need to install gawk instead of the - default mawk. - - * If you need to debug mysqld or a MySQL client, run configure - with the --with-debug option, and then recompile and link your - clients with the new client library. See MySQL Internals: - Porting (http://forge.mysql.com/wiki/MySQL_Internals_Porting). - - * If you get a compilation error on Linux (for example, SuSE - Linux 8.1 or Red Hat Linux 7.3) similar to the following one, - you probably do not have g++ installed: -libmysql.c:1329: warning: passing arg 5 of `gethostbyname_r' from -incompatible pointer type -libmysql.c:1329: too few arguments to function `gethostbyname_r' -libmysql.c:1329: warning: assignment makes pointer from integer -without a cast -make[2]: *** [libmysql.lo] Error 1 - By default, the configure script attempts to determine the - correct number of arguments by using g++ (the GNU C++ - compiler). This test yields incorrect results if g++ is not - installed. There are two ways to work around this problem: - - + Make sure that the GNU C++ g++ is installed. On some - Linux distributions, the required package is called gpp; - on others, it is named gcc-c++. - - + Use gcc as your C++ compiler by setting the CXX - environment variable to gcc: -export CXX="gcc" - You must run configure again after making either of those - changes. - -2.3.5. MIT-pthreads Notes - - This section describes some of the issues involved in using - MIT-pthreads. - - On Linux, you should not use MIT-pthreads. Use the installed - LinuxThreads implementation instead. See Section 2.6, "Installing - MySQL on Linux." - - If your system does not provide native thread support, you should - build MySQL using the MIT-pthreads package. This includes older - FreeBSD systems, SunOS 4.x, Solaris 2.4 and earlier, and some - others. See Section 2.1, "General Installation Guidance." - - MIT-pthreads is not part of the MySQL 5.1 source distribution. If - you require this package, you need to download it separately from - http://dev.mysql.com/Downloads/Contrib/pthreads-1_60_beta6-mysql.t - ar.gz - - After downloading, extract this source archive into the top level - of the MySQL source directory. It creates a new subdirectory named - mit-pthreads. - - * On most systems, you can force MIT-pthreads to be used by - running configure with the --with-mit-threads option: -shell> ./configure --with-mit-threads - Building in a nonsource directory is not supported when using - MIT-pthreads because we want to minimize our changes to this - code. - - * The checks that determine whether to use MIT-pthreads occur - only during the part of the configuration process that deals - with the server code. If you have configured the distribution - using --without-server to build only the client code, clients - do not know whether MIT-pthreads is being used and use Unix - socket file connections by default. Because Unix socket files - do not work under MIT-pthreads on some platforms, this means - you need to use -h or --host with a value other than localhost - when you run client programs. - - * When MySQL is compiled using MIT-pthreads, system locking is - disabled by default for performance reasons. You can tell the - server to use system locking with the --external-locking - option. This is needed only if you want to be able to run two - MySQL servers against the same data files, but that is not - recommended, anyway. - - * Sometimes the pthread bind() command fails to bind to a socket - without any error message (at least on Solaris). The result is - that all connections to the server fail. For example: -shell> mysqladmin version -mysqladmin: connect to server at '' failed; -error: 'Can't connect to mysql server on localhost (146)' - The solution to this problem is to kill the mysqld server and - restart it. This has happened to us only when we have forcibly - stopped the server and restarted it immediately. - - * With MIT-pthreads, the sleep() system call isn't interruptible - with SIGINT (break). This is noticeable only when you run - mysqladmin --sleep. You must wait for the sleep() call to - terminate before the interrupt is served and the process - stops. - - * When linking, you might receive warning messages like these - (at least on Solaris); they can be ignored: -ld: warning: symbol `_iob' has differing sizes: - (file /my/local/pthreads/lib/libpthread.a(findfp.o) value=0x4; -file /usr/lib/libc.so value=0x140); - /my/local/pthreads/lib/libpthread.a(findfp.o) definition taken -ld: warning: symbol `__iob' has differing sizes: - (file /my/local/pthreads/lib/libpthread.a(findfp.o) value=0x4; -file /usr/lib/libc.so value=0x140); - /my/local/pthreads/lib/libpthread.a(findfp.o) definition taken - - * Some other warnings also can be ignored: -implicit declaration of function `int strtoll(...)' -implicit declaration of function `int strtoul(...)' - - * We have not been able to make readline work with MIT-pthreads. - (This is not necessary, but may be of interest to some.) - -2.4. Upgrading or Downgrading MySQL - -2.4.1. Upgrading MySQL - - As a general rule, to upgrade from one release series to another, - you should go to the next series rather than skipping a series. To - upgrade from a release series previous to MySQL 5.0, upgrade to - each successive release series in turn until you have reached - MySQL 5.0, and then proceed with the upgrade to MySQL 5.1. For - example, if you currently are running MySQL 4.1 and wish to - upgrade to a newer series, upgrade to MySQL 5.0 first before - upgrading to 5.1, and so forth. For information on upgrading to - MySQL 5.0, see the MySQL 5.0 Reference Manual; for earlier - releases, see the MySQL 3.23, 4.0, 4.1 Reference Manual. - - If you perform a binary (in-place) upgrade without dumping and - reloading tables, you cannot upgrade directly from MySQL 4.1 to - 5.1. This occurs due to an incompatible change in the MyISAM table - index format in MySQL 5.0. Upgrade from MySQL 4.1 to 5.0 and - repair all MyISAM tables (see Section 2.4.4, "Rebuilding or - Repairing Tables or Indexes"). Then upgrade from MySQL 5.0 to 5.1 - and check and repair your tables. - - To upgrade from MySQL 5.0 to 5.1, use the items in the following - checklist as a guide: - - * Before any upgrade, back up your databases, including the - mysql database that contains the grant tables. See Section - 6.2, "Database Backup Methods." - - * Read all the notes in Section 2.4.1.1, "Upgrading from MySQL - 5.0 to 5.1." These notes enable you to identify upgrade issues - that apply to your current MySQL installation. Some - incompatibilities discussed in that section require your - attention before upgrading. Others should be dealt with after - upgrading. - - * Read Appendix C, "MySQL Change History" as well, which - provides information about features that are new in MySQL 5.1 - or differ from those found in MySQL 5.0. - - * After upgrading to a new version of MySQL, run mysql_upgrade - (see Section 4.4.8, "mysql_upgrade --- Check Tables for MySQL - Upgrade"). This program checks your tables, and attempts to - repair them if necessary. It also updates your grant tables to - make sure that they have the current structure so that you can - take advantage of any new capabilities. (Some releases of - MySQL introduce changes to the structure of the grant tables - to add new privileges or features.) - mysql_upgrade does not upgrade the contents of the help - tables. For upgrade instructions, see Section 5.1.8, - "Server-Side Help." - - * If you run MySQL Server on Windows, see Section 2.5.7, - "Upgrading MySQL on Windows." - - * If you use replication, see Section 16.4.3, "Upgrading a - Replication Setup," for information on upgrading your - replication setup. - - * If you upgrade an installation originally produced by - installing multiple RPM packages, it is best to upgrade all - the packages, not just some. For example, if you previously - installed the server and client RPMs, do not upgrade just the - server RPM. - - * As of MySQL 5.1.9, the mysqld-max server is included in binary - distributions. There is no separate MySQL-Max distribution. As - of MySQL 5.1.12, there is no mysqld-max server at all in - binary distributions. They contain a server that includes the - features previously included in mysqld-max. - - * If you have created a user-defined function (UDF) with a given - name and upgrade MySQL to a version that implements a new - built-in function with the same name, the UDF becomes - inaccessible. To correct this, use DROP FUNCTION to drop the - UDF, and then use CREATE FUNCTION to re-create the UDF with a - different nonconflicting name. The same is true if the new - version of MySQL implements a built-in function with the same - name as an existing stored function. See Section 8.2.4, - "Function Name Parsing and Resolution," for the rules - describing how the server interprets references to different - kinds of functions. - - You can always move the MySQL format files and data files between - different versions on systems with the same architecture as long - as you stay within versions for the same release series of MySQL. - - If you are cautious about using new versions, you can always - rename your old mysqld before installing a newer one. For example, - if you are using MySQL 5.0.13 and want to upgrade to 5.1.10, - rename your current server from mysqld to mysqld-5.0.13. If your - new mysqld then does something unexpected, you can simply shut it - down and restart with your old mysqld. - - If, after an upgrade, you experience problems with compiled client - programs, such as Commands out of sync or unexpected core dumps, - you probably have used old header or library files when compiling - your programs. In this case, you should check the date for your - mysql.h file and libmysqlclient.a library to verify that they are - from the new MySQL distribution. If not, recompile your programs - with the new headers and libraries. Recompilation might also be - necessary for programs compiled against the shared client library - if the library major version number has changed (for example from - libmysqlclient.so.15 to libmysqlclient.so.16. - - If problems occur, such as that the new mysqld server does not - start or that you cannot connect without a password, verify that - you do not have an old my.cnf file from your previous - installation. You can check this with the --print-defaults option - (for example, mysqld --print-defaults). If this command displays - anything other than the program name, you have an active my.cnf - file that affects server or client operation. - - If your MySQL installation contains a large amount of data that - might take a long time to convert after an in-place upgrade, you - might find it useful to create a "dummy" database instance for - assessing what conversions might be needed and the work involved - to perform them. Make a copy of your MySQL instance that contains - a full copy of the mysql database, plus all other databases - without data. Run your upgrade procedure on this dummy instance to - see what actions might be needed so that you can better evaluate - the work involved when performing actual data conversion on your - original database instance. - - It is a good idea to rebuild and reinstall the Perl DBD::mysql - module whenever you install a new release of MySQL. The same - applies to other MySQL interfaces as well, such as PHP mysql - extensions and the Python MySQLdb module. - -2.4.1.1. Upgrading from MySQL 5.0 to 5.1 - - After upgrading a 5.0 installation to 5.0.10 or above, it is - necessary to upgrade your grant tables. Otherwise, creating stored - procedures and functions might not work. To perform this upgrade, - run mysql_upgrade. - -Note - - It is good practice to back up your data before installing any new - version of software. Although MySQL works very hard to ensure a - high level of quality, you should protect your data by making a - backup. - - To upgrade to 5.1 from any previous version, MySQL recommends that - you dump your tables with mysqldump before upgrading and reload - the dump file after upgrading. - - If you perform a binary (in-place) upgrade without dumping and - reloading tables, you cannot upgrade directly from MySQL 4.1 to - 5.1. This occurs due to an incompatible change in the MyISAM table - index format in MySQL 5.0. Upgrade from MySQL 4.1 to 5.0 and - repair all MyISAM tables (see Section 2.4.4, "Rebuilding or - Repairing Tables or Indexes"). Then upgrade from MySQL 5.0 to 5.1 - and check and repair your tables. - - In general, you should do the following when upgrading from MySQL - 5.0 to 5.1: - - * Read all the items in the following sections to see whether - any of them might affect your applications: - - + Section 2.4.1, "Upgrading MySQL," has general update - information. - - + The items in the change lists found later in this section - enable you to identify upgrade issues that apply to your - current MySQL installation. - - + The MySQL 5.1 change history describes significant new - features you can use in 5.1 or that differ from those - found in MySQL 5.0. Some of these changes may result in - incompatibilities. See Section C.1, "Changes in Release - 5.1.x (Production)." - Note particularly any changes that are marked Known issue or - Incompatible change. These incompatibilities with earlier - versions of MySQL may require your attention before you - upgrade. Our aim is to avoid these changes, but occasionally - they are necessary to correct problems that would be worse - than an incompatibility between releases. If any upgrade issue - applicable to your installation involves an incompatibility - that requires special handling, follow the instructions given - in the incompatibility description. Often this will involve - dumping and reloading tables, or use of a statement such as - CHECK TABLE or REPAIR TABLE. - For dump and reload instructions, see Section 2.4.4, - "Rebuilding or Repairing Tables or Indexes." Any procedure - that involves REPAIR TABLE with the USE_FRM option must be - done before upgrading. Use of this statement with a version of - MySQL different from the one used to create the table (that - is, using it after upgrading) may damage the table. See - Section 12.4.2.6, "REPAIR TABLE Syntax." - - * Before upgrading to a new version of MySQL, Section 2.4.3, - "Checking Whether Tables or Indexes Must Be Rebuilt," to see - whether changes to table formats or to character sets or - collations were made between your current version of MySQL and - the version to which you are upgrading. If so and these - changes result in an incompatibility between MySQL versions, - you will need to upgrade the affected tables using the - instructions in Section 2.4.4, "Rebuilding or Repairing Tables - or Indexes." - - * After upgrading to a new version of MySQL, run mysql_upgrade - (see Section 4.4.8, "mysql_upgrade --- Check Tables for MySQL - Upgrade"). This program checks your tables, and attempts to - repair them if necessary. It also updates your grant tables to - make sure that they have the current structure so that you can - take advantage of any new capabilities. (Some releases of - MySQL introduce changes to the structure of the grant tables - to add new privileges or features.) - mysql_upgrade does not upgrade the contents of the help - tables. For upgrade instructions, see Section 5.1.8, - "Server-Side Help." - - * If you run MySQL Server on Windows, see Section 2.5.7, - "Upgrading MySQL on Windows." - - * If you use replication, see Section 16.4.3, "Upgrading a - Replication Setup," for information on upgrading your - replication setup. - - If your MySQL installation contains a large amount of data that - might take a long time to convert after an in-place upgrade, you - might find it useful to create a "dummy" database instance for - assessing what conversions might be needed and the work involved - to perform them. Make a copy of your MySQL instance that contains - a full copy of the mysql database, plus all other databases - without data. Run your upgrade procedure on this dummy instance to - see what actions might be needed so that you can better evaluate - the work involved when performing actual data conversion on your - original database instance. - - MySQL Enterprise MySQL Enterprise subscribers will find more - information about upgrading in the Knowledge Base articles found - at Upgrading - (https://kb.mysql.com/search.php?cat=search&category=41). Access - to the MySQL Knowledge Base collection of articles is one of the - advantages of subscribing to MySQL Enterprise. For more - information, see - http://www.mysql.com/products/enterprise/advisors.html. - - The following lists describe changes that may affect applications - and that you should watch out for when upgrading from MySQL 5.0 to - 5.1. - - Configuration Changes: - - * Before MySQL 5.1.11, to build MySQL from source with SSL - support enabled, you would invoke configure with either the - --with-openssl or --with-yassl option. In MySQL 5.1.11, those - options both have been replaced by the --with-ssl option. By - default, --with-ssl causes the bundled yaSSL library to be - used. To select OpenSSL instead, give the option as - --with-ssl=path, where path is the directory where the OpenSSL - header files and libraries are located. - - Server Changes: - - * Known issue: After a binary upgrade to MySQL 5.1 from a MySQL - 5.0 installation that contains ARCHIVE tables, accessing those - tables will cause the server to crash, even if you have run - mysql_upgrade or CHECK TABLE ... FOR UPGRADE. To work around - this problem, use mysqldump to dump all ARCHIVE tables before - upgrading, and reload them into MySQL 5.1 after upgrading. - - * Known issue: The fix for - Bug#23491: http://bugs.mysql.com/bug.php?id=23491 introduced a - problem with SHOW CREATE VIEW, which is used by mysqldump. - This causes an incompatibility when upgrading from versions - affected by that bug fix (MySQL 5.0.40 through 5.0.43, MySQL - 5.1.18 through 5.1.19): If you use mysqldump before upgrading - from an affected version and reload the data after upgrading - to a higher version, you must drop and recreate your views. - - * Known issue: Dumps performed by using mysqldump to generate a - dump file before the upgrade and reloading the file after - upgrading are subject to the following problem: - Before MySQL 5.0.40, mysqldump displays SPATIAL index - definitions using prefix lengths for the indexed columns. - These prefix lengths are accepted in MySQL 5.0, but not as of - MySQL 5.1. If you use mysqldump from versions of MySQL older - than 5.0.40, any table containing SPATIAL indexes will cause - an error when the dump file is reloaded into MySQL 5.1 or - higher. - For example, a table definition might look like this when - dumped in MySQL 5.0: -CREATE TABLE `t` ( - `g` geometry NOT NULL, - SPATIAL KEY `g` (`g`(32)) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 - The SPATIAL index definition will not be accepted in MySQL - 5.1. To work around this, edit the dump file to remove the - prefix: -CREATE TABLE `t` ( - `g` geometry NOT NULL, - SPATIAL KEY `g` (`g`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 - Dump files can be large, so it may be preferable to dump table - definitions and data separately to make it easier to edit the - definitions: -shell> mysqldump --no-data other_args > definitions.sql -shell> mysqldump --no-create-info other_args > data.sql - Then edit definitions.sql before reloading definitions.sql and - data.sql, in that order. - If you upgrade to a version of MySQL 5.0 higher than 5.0.40 - before upgrading to MySQL 5.1, this problem does not occur. - - * Known issue: Before MySQL 5.1.30, the CHECK TABLE ... FOR - UPGRADE statement did not check for incompatible collation - changes made in MySQL 5.1.24. (This also affects mysqlcheck - and mysql_upgrade, which cause that statement to be executed.) - Prior to the fix made in 5.1.30, a binary upgrade (performed - without dumping tables with mysqldump before the upgrade and - reloading the dump file after the upgrade) would corrupt - tables. After the fix, CHECK TABLE ... FOR UPGRADE properly - detects the problem and warns about tables that need repair. - However, the fix is not backward compatible and can result in - a downgrading problem under these circumstances: - - 1. Perform a binary upgrade to a version of MySQL that - includes the fix. - - 2. Run CHECK TABLE ... FOR UPGRADE (or mysqlcheck or - mysql_upgrade) to upgrade tables. - - 3. Perform a binary downgrade to a version of MySQL that - does not include the fix. - The solution is to dump tables with mysqldump before the - downgrade and reload the dump file after the downgrade. - Alternatively, drop and recreate affected indexes. - - * Known issue: MySQL introduces encoding for table names that - have non-ASCII characters (see Section 8.2.3, "Mapping of - Identifiers to File Names"). After a binary upgrade from MySQL - 5.0 to 5.1 or higher, the server recognizes names that have - non-ASCII characters and adds a #mysql50# prefix to them. - As of MySQL 5.1.31, mysql_upgrade encodes these names by - executing the following command: -mysqlcheck --all-databases --check-upgrade --fix-db-names --fix-table --names - Prior to MySQL 5.1.31, mysql_upgrade does not execute this - command, so you should execute it manually if you have - database or table names that contain nonalphanumeric - characters. - Prior to MySQL 5.1.23, the mysqlcheck command does not perform - the name encoding for views. To work around this problem, drop - each affected view and recreate it. - mysqlcheck cannot fix names that contain literal instances of - the @ character that is used for encoding special characters. - If you have databases or tables that contain this character, - use mysqldump to dump them before upgrading to MySQL 5.1, and - then reload the dump file after upgrading. - - * Known issue: When upgrading from MySQL 5.0 to versions of 5.1 - prior to 5.1.23, running mysqlcheck (or mysql_upgrade, which - runs mysqlcheck) to upgrade tables fails for names that must - be written as quoted identifiers. To work around this problem, - rename each affected table to a name that does not require - quoting: -RENAME TABLE `tab``le_a` TO table_a; -RENAME TABLE `table b` TO table_b; - After renaming the tables, run the mysql_upgrade program. Then - rename the tables back to their original names: -RENAME TABLE table_a TO `tab``le_a`; -RENAME TABLE table_b TO `table b`; - - * Known issue: In connection with view creation, the server - created arc directories inside database directories and - maintained useless copies of .frm files there. Creation and - renaming procedures of those copies as well as creation of arc - directories has been discontinued in MySQL 5.1.29. - This change does cause a problem when downgrading to older - server versions which manifests itself under these - circumstances: - - 1. Create a view v_orig in MySQL 5.1.29 or higher. - - 2. Rename the view to v_new and then back to v_orig. - - 3. Downgrade to an older 5.1.x server and run mysql_upgrade. - - 4. Try to rename v_orig to v_new again. This operation - fails. - As a workaround to avoid this problem, use either of these - approaches: - - + Dump your data using mysqldump before downgrading and - reload the dump file after downgrading. - - + Instead of renaming a view after the downgrade, drop it - and recreate it. - - * Incompatible change: Character set or collation changes were - made in MySQL 5.1.21, 5.1.23, and 5.1.24 that may require - table indexes to be rebuilt. For details, see Section 2.4.3, - "Checking Whether Tables or Indexes Must Be Rebuilt." - - * Incompatible change: MySQL 5.1 implements support for a plugin - API that enables the loading and unloading of components at - runtime, without restarting the server. Section 22.2, "The - MySQL Plugin API." The plugin API requires the mysql.plugin - table. After upgrading from an older version of MySQL, you - should run the mysql_upgrade command to create this table. See - Section 4.4.8, "mysql_upgrade --- Check Tables for MySQL - Upgrade." - Plugins are installed in the directory named by the plugin_dir - system variable. This variable also controls the location from - which the server loads user-defined functions (UDFs), which is - a change from earlier versions of MySQL. That is, all UDF - library files now must be installed in the plugin directory. - When upgrading from an older version of MySQL, you must - migrate your UDF files to the plugin directory. - - * Incompatible change: The table_cache system variable has been - renamed to table_open_cache. Any scripts that refer to - table_cache must be updated to use the new name. - - * Incompatible change: In MySQL 5.1.36, options for loading - plugins such as pluggable storage engines were changed from - boolean to tristate format. The implementations overlap, but - if you previously used options of the form --plugin_name=0 or - --plugin_name=1, you should instead use --plugin_name=OFF or - --plugin_name=ON, respectively. For details, see Section - 5.1.3, "Server Options for Loading Plugins." - - * Incompatible change: From MySQL 5.1.24 to 5.1.31, the UPDATE - statement was changed such that assigning NULL to a NOT NULL - column caused an error even when strict SQL mode was not - enabled. The original behavior before MySQL 5.1.24 was that - such assignments caused an error only in strict SQL mode, and - otherwise set the column to the implicit default value for the - column data type and generated a warning. (For information - about implicit default values, see Section 10.1.4, "Data Type - Default Values.") - The change caused compatibility problems for applications that - relied on the original behavior. It also caused replication - problems between servers that had the original behavior and - those that did not, for applications that assigned NULL to NOT - NULL columns in UPDATE statements without strict SQL mode - enabled. The change was reverted in MySQL 5.1.32 so that - UPDATE again had the original behavior. Problems can still - occur if you replicate between servers that have the modified - UPDATE behavior and those that do not. - - * Incompatible change: As of MySQL 5.1.29, the default binary - logging mode has been changed from MIXED to STATEMENT for - compatibility with MySQL 5.0. - - * Incompatible change: In MySQL 5.1.25, a change was made to the - way that the server handles prepared statements. This affects - prepared statements processed at the SQL level (using the - PREPARE statement) and those processed using the binary - client-server protocol (using the mysql_stmt_prepare() C API - function). - Previously, changes to metadata of tables or views referred to - in a prepared statement could cause a server crash when the - statement was next executed, or perhaps an error at execute - time with a crash occurring later. For example, this could - happen after dropping a table and recreating it with a - different definition. - Now metadata changes to tables or views referred to by - prepared statements are detected and cause automatic - repreparation of the statement when it is next executed. - Metadata changes occur for DDL statements such as those that - create, drop, alter, rename, or truncate tables, or that - analyze, optimize, or repair tables. Repreparation also occurs - after referenced tables or views are flushed from the table - definition cache, either implicitly to make room for new - entries in the cache, or explicitly due to FLUSH TABLES. - Repreparation is automatic, but to the extent that it occurs, - performance of prepared statements is diminished. - Table content changes (for example, with INSERT or UPDATE) do - not cause repreparation, nor do SELECT statements. - An incompatibility with previous versions of MySQL is that a - prepared statement may now return a different set of columns - or different column types from one execution to the next. For - example, if the prepared statement is SELECT * FROM t1, - altering t1 to contain a different number of columns causes - the next execution to return a number of columns different - from the previous execution. - Older versions of the client library cannot handle this change - in behavior. For applications that use prepared statements - with the new server, an upgrade to the new client library is - strongly recommended. - Along with this change to statement repreparation, the default - value of the table_definition_cache system variable has been - increased from 128 to 256. The purpose of this increase is to - lessen the chance that prepared statements will need - repreparation due to referred-to tables/views having been - flushed from the cache to make room for new entries. - A new status variable, Com_stmt_reprepare, has been introduced - to track the number of repreparations. - - * Incompatible change: As of MySQL 5.1.23, within a stored - routine, it is no longer permissible to declare a cursor for a - SHOW or DESCRIBE statement. This happened to work in some - instances, but is no longer supported. In many cases, a - workaround for this change is to use the cursor with a SELECT - query to read from an INFORMATION_SCHEMA table that produces - the same information as the SHOW statement. - - * Incompatible change: SHOW CREATE VIEW displays view - definitions using an AS alias_name clause for each column. If - a column is created from an expression, the default alias is - the expression text, which can be quite long. As of MySQL - 5.1.23, aliases for column names in CREATE VIEW statements are - checked against the maximum column length of 64 characters - (not the maximum alias length of 256 characters). As a result, - views created from the output of SHOW CREATE VIEW fail if any - column alias exceeds 64 characters. This can cause problems - for replication or loading dump files. For additional - information and workarounds, see Section D.4, "Restrictions on - Views." - - * Incompatible change: Several issues were identified for stored - programs (stored procedures and functions, triggers, and - events) and views containing non-ASCII symbols. These issues - involved conversion errors due to incomplete character set - information when translating these objects to and from stored - format. - To address these problems, the representation for these - objects was changed in MySQL 5.1.21. However, the fixes affect - all stored programs and views. (For example, you will see - warnings about "no creation context.") To avoid warnings from - the server about the use of old definitions from any release - prior to 5.1.21, you should dump stored programs and views - with mysqldump after upgrading to 5.1.21 or higher, and then - reload them to recreate them with new definitions. Invoke - mysqldump with a --default-character-set option that names the - non-ASCII character set that was used for the definitions when - the objects were originally defined. - - * Incompatible change: As of MySQL 5.1.20, mysqld_safe supports - error logging to syslog on systems that support the logger - command. The new --syslog and --skip-syslog options can be - used instead of the --log-error option to control logging - behavior, as described in Section 4.3.2, "mysqld_safe --- - MySQL Server Startup Script." - In 5.1.21 and up, the default is --skip-syslog, which is - compatible with the default behavior of writing an error log - file for releases prior to 5.1.20. - In 5.1.20 only, the following conditions apply: 1) The default - is to use syslog, which is not compatible with releases prior - to 5.1.20. 2) Logging to syslog may fail to operate correctly - in some cases. For these reasons, avoid using MySQL 5.1.20. - - * Incompatible change: As of MySQL 5.1.18, the plugin interface - and its handling of system variables was changed. Command-line - options such as --skip-innodb now cause an error if InnoDB is - not built-in or plugin-loaded. You should use - --loose-skip-innodb if you do not want any error even if - InnoDB is not available. The --loose prefix modifier should be - used for all command-line options where you are uncertain - whether the plugin exists and when you want the operation to - proceed even if the option is necessarily ignored due to the - absence of the plugin. (For a desecription of how --loose - works, see Section 4.2.3.1, "Using Options on the Command - Line.") - - * Incompatible change: As of MySQL 5.1.15, InnoDB rolls back - only the last statement on a transaction timeout. A new - option, --innodb_rollback_on_timeout, causes InnoDB to abort - and roll back the entire transaction if a transaction timeout - occurs (the same behavior as in MySQL 4.1). - - * Incompatible change: As of MySQL 5.1.15, the following - conditions apply to enabling the read_only system variable: - - + If you attempt to enable read_only while you have any - explicit locks (acquired with LOCK TABLES or have a - pending transaction, an error will occur. - - + If other clients hold explicit table locks or have - pending transactions, the attempt to enable read_only - blocks until the locks are released and the transactions - end. While the attempt to enable read_only is pending, - requests by other clients for table locks or to begin - transactions also block until read_only has been set. - - + read_only can be enabled while you hold a global read - lock (acquired with FLUSH TABLES WITH READ LOCK) because - that does not involve table locks. - Previously, the attempt to enable read_only would return - immediately even if explicit locks or transactions were - pending, so some data changes could occur for statements - executing in the server at the same time. - - * Incompatible change: The number of function names affected by - IGNORE_SPACE was reduced significantly in MySQL 5.1.13, from - about 200 to about 30. (For details about IGNORE_SPACE, see - Section 8.2.4, "Function Name Parsing and Resolution.") This - change improves the consistency of parser operation. However, - it also introduces the possibility of incompatibility for old - SQL code that relies on the following conditions: - - + IGNORE_SPACE is disabled. - - + The presence or absence of whitespace following a - function name is used to distinguish between a built-in - function and stored function that have the same name (for - example, PI() versus PI ()). - For functions that are no longer affected by IGNORE_SPACE as - of MySQL 5.1.13, that strategy no longer works. Either of the - following approaches can be used if you have code that is - subject to the preceding incompatibility: - - + If a stored function has a name that conflicts with a - built-in function, refer to the stored function with a - schema name qualifier, regardless of whether whitespace - is present. For example, write schema_name.PI() or - schema_name.PI (). - - + Alternatively, rename the stored function to use a - nonconflicting name and change invocations of the - function to use the new name. - - * Incompatible change: For utf8 columns, the full-text parser - incorrectly considered several nonword punctuation and - whitespace characters as word characters, causing some - searches to return incorrect results. The fix involves a - change to the full-text parser in MySQL 5.1.12, so as of - 5.1.12, any tables that have FULLTEXT indexes on utf8 columns - must be repaired with REPAIR TABLE: -REPAIR TABLE tbl_name QUICK; - - * Incompatible change: Storage engines can be pluggable at - runtime, so the distinction between disabled and invalid - storage engines no longer applies. As of MySQL 5.1.12, this - affects the NO_ENGINE_SUBSTITUTION SQL mode, as described in - Section 5.1.7, "Server SQL Modes." - - * Incompatible change: The structure of FULLTEXT indexes has - been changed in MySQL 5.1.6. After upgrading to MySQL 5.1.6 or - greater, any tables that have FULLTEXT indexes must be - repaired with REPAIR TABLE: -REPAIR TABLE tbl_name QUICK; - - * Incompatible change: In MySQL 5.1.6, when log tables were - implemented, the default log destination for the general query - and slow query log was TABLE. As of MySQL 5.1.21, this default - has been changed to FILE, which is compatible with MySQL 5.0, - but incompatible with earlier releases of MySQL 5.1. If you - are upgrading from MySQL 5.0 to 5.1.21 or higher, no logging - option changes should be necessary. However, if you are - upgrading from 5.1.6 through 5.1.20 to 5.1.21 or higher and - were using TABLE logging, use the --log-output=TABLE option - explicitly to preserve your server's table-logging behavior. - - * Incompatible change: For ENUM columns that had enumeration - values containing commas, the commas were mapped to 0xff - internally. However, this rendered the commas - indistinguishable from true 0xff characters in the values. - This no longer occurs. However, the fix requires that you dump - and reload any tables that have ENUM columns containing true - 0xff in their values: Dump the tables using mysqldump with the - current server before upgrading from a version of MySQL 5.1 - older than 5.1.15 to version 5.1.15 or newer. - - * As of MySQL 5.1.12, the lc_time_names system variable - specifies the locale that controls the language used to - display day and month names and abbreviations. This variable - affects the output from the DATE_FORMAT(), DAYNAME() and - MONTHNAME() functions. See Section 9.7, "MySQL Server Locale - Support." - - * As of MySQL 5.1.9, mysqld_safe no longer implicitly invokes - mysqld-max if it exists. Instead, it invokes mysqld unless a - --mysqld or --mysqld-version option is given to specify - another server explicitly. If you previously relied on the - implicit invocation of mysqld-max, you should use an - appropriate option now. As of MySQL 5.1.12, there is no longer - any separate mysqld-max server, so no change should be - necessary. - - SQL Changes: - - * Known issue: Prior to MySQL 5.1.17, the parser accepted - invalid code in SQL condition handlers, leading to server - crashes or unexpected execution behavior in stored programs. - Specifically, the parser permitted a condition handler to - refer to labels for blocks that enclose the handler - declaration. This was incorrect because block label scope does - not include the code for handlers declared within the labeled - block. - As of 5.1.17, the parser rejects this invalid construct, but - if you perform a binary upgrade (without dumping and reloading - your databases), existing handlers that contain the construct - still are invalid and should be rewritten even if they appear - to function as you expect. - To find affected handlers, use mysqldump to dump all stored - procedures and functions, triggers, and events. Then attempt - to reload them into an upgraded server. Handlers that contain - illegal label references will be rejected. - For more information about condition handlers and writing them - to avoid invalid jumps, see Section 12.7.4.2, "DECLARE for - Handlers." - - * Incompatible change: The parser accepted statements that - contained /* ... */ that were not properly closed with */, - such as SELECT 1 /* + 2. As of MySQL 5.1.23, statements that - contain unclosed /*-comments now are rejected with a syntax - error. - This fix has the potential to cause incompatibilities. Because - of Bug#26302: http://bugs.mysql.com/bug.php?id=26302, which - caused the trailing */ to be truncated from comments in views, - stored routines, triggers, and events, it is possible that - objects of those types may have been stored with definitions - that now will be rejected as syntactically invalid. Such - objects should be dropped and re-created so that their - definitions do not contain truncated comments. - - * Incompatible change: Multiple-table DELETE statements - containing ambiguous aliases could have unintended side - effects such as deleting rows from the wrong table. Example: -DELETE FROM t1 AS a2 USING t1 AS a1 INNER JOIN t2 AS a2; - As of MySQL 5.1.23, alias declarations can be declared only in - the table_references part. Elsewhere in the statement, alias - references are permitted but not alias declarations. - Statements containing aliases that are no longer permitted - must be rewritten. - - * Incompatible change: As of MySQL 5.1.8, TYPE = engine_name is - still accepted as a synonym for the ENGINE = engine_name table - option but generates a warning. You should note that this - option is not available in MySQL 5.1.7, and is removed - altogether in MySQL 5.5 and produces a syntax error. - TYPE has been deprecated since MySQL 4.0. - - * Incompatible change: The namespace for triggers changed in - MySQL 5.0.10. Previously, trigger names had to be unique per - table. Now they must be unique within the schema (database). - An implication of this change is that DROP TRIGGER syntax now - uses a schema name instead of a table name (schema name is - optional and, if omitted, the current schema will be used). - When upgrading from a version of MySQL 5 older than 5.0.10 to - MySQL 5.0.10 or newer, you must drop all triggers and - re-create them or DROP TRIGGER will not work after the - upgrade. Here is a suggested procedure for doing this: - - 1. Upgrade to MySQL 5.0.10 or later to be able to access - trigger information in the INFORMATION_SCHEMA.TRIGGERS - table. (This should work even for pre-5.0.10 triggers.) - - 2. Dump all trigger definitions using the following SELECT - statement: -SELECT CONCAT('CREATE TRIGGER ', t.TRIGGER_SCHEMA, '.', t.TRIGGER_NAM -E, - ' ', t.ACTION_TIMING, ' ', t.EVENT_MANIPULATION, ' ON ' -, - t.EVENT_OBJECT_SCHEMA, '.', t.EVENT_OBJECT_TABLE, - ' FOR EACH ROW ', t.ACTION_STATEMENT, '//' ) -INTO OUTFILE '/tmp/triggers.sql' -FROM INFORMATION_SCHEMA.TRIGGERS AS t; - The statement uses INTO OUTFILE, so you must have the - FILE privilege. The file will be created on the server - host. Use a different file name if you like. To be 100% - safe, inspect the trigger definitions in the triggers.sql - file, and perhaps make a backup of the file. - - 3. Stop the server and drop all triggers by removing all - .TRG files in your database directories. Change location - to your data directory and issue this command: -shell> rm */*.TRG - - 4. Start the server and re-create all triggers using the - triggers.sql file: -mysql> delimiter // ; -mysql> source /tmp/triggers.sql // - - 5. Check that all triggers were successfully created using - the SHOW TRIGGERS statement. - - * Incompatible change: MySQL 5.1.6 introduces the TRIGGER - privilege. Previously, the SUPER privilege was needed to - create or drop triggers. Now those operations require the - TRIGGER privilege. This is a security improvement because you - no longer need to grant users the SUPER privilege to enable - them to create triggers. However, the requirement that the - account named in a trigger's DEFINER clause must have the - SUPER privilege has changed to a requirement for the TRIGGER - privilege. When upgrading from a previous version of MySQL 5.0 - or 5.1 to MySQL 5.1.6 or newer, be sure to update your grant - tables by running mysql_upgrade. This will assign the TRIGGER - privilege to all accounts that had the SUPER privilege. If you - fail to update the grant tables, triggers may fail when - activated. After updating the grant tables, you can revoke the - SUPER privilege from those accounts that no longer otherwise - require it. - - * Some keywords may be reserved in MySQL 5.1 that were not - reserved in MySQL 5.0. See Section 8.3, "Reserved Words." - - * The BACKUP TABLE, and RESTORE TABLE statements are deprecated. - mysqldump or mysqlhotcopy can be used as alternatives. - - * The LOAD DATA FROM MASTER and LOAD TABLE FROM MASTER - statements are deprecated. See Section 12.5.2.2, "LOAD DATA - FROM MASTER Syntax," for recommended alternatives. - - * The INSTALL PLUGIN and UNINSTALL PLUGIN statements that are - used for the plugin API are new. So is the WITH PARSER clause - for FULLTEXT index creation that associates a parser plugin - with a full-text index. Section 22.2, "The MySQL Plugin API." - - C API Changes: - - * Incompatible change: As of MySQL 5.1.7, the - mysql_stmt_attr_get() C API function returns a boolean rather - than an unsigned int for STMT_ATTR_UPDATE_MAX_LENGTH. - (Bug#16144: http://bugs.mysql.com/bug.php?id=16144) - -2.4.2. Downgrading MySQL - - This section describes what you should do to downgrade to an older - MySQL version in the unlikely case that the previous version - worked better than the new one. - - If you are downgrading within the same release series (for - example, from 5.0.13 to 5.0.12) the general rule is that you just - have to install the new binaries on top of the old ones. There is - no need to do anything with the databases. As always, however, it - is always a good idea to make a backup. - - The following items form a checklist of things you should do - whenever you perform a downgrade: - - * Read the upgrading section for the release series from which - you are downgrading to be sure that it does not have any - features you really need. See Section 2.4.1, "Upgrading - MySQL." - - * If there is a downgrading section for that version, you should - read that as well. - - * To see which new features were added between the version to - which you are downgrading and your current version, see the - change logs (Appendix C, "MySQL Change History"). - - * Check Section 2.4.3, "Checking Whether Tables or Indexes Must - Be Rebuilt," to see whether changes to table formats or to - character sets or collations were made between your current - version of MySQL and the version to which you are downgrading. - If so and these changes result in an incompatibility between - MySQL versions, you will need to downgrade the affected tables - using the instructions in Section 2.4.4, "Rebuilding or - Repairing Tables or Indexes." - - In most cases, you can move the MySQL format files and data files - between different versions on the same architecture as long as you - stay within versions for the same release series of MySQL. - - If you downgrade from one release series to another, there may be - incompatibilities in table storage formats. In this case, use - mysqldump to dump your tables before downgrading. After - downgrading, reload the dump file using mysql or mysqlimport to - re-create your tables. For examples, see Section 2.4.5, "Copying - MySQL Databases to Another Machine." - - A typical symptom of a downward-incompatible table format change - when you downgrade is that you cannot open tables. In that case, - use the following procedure: - - 1. Stop the older MySQL server that you are downgrading to. - - 2. Restart the newer MySQL server you are downgrading from. - - 3. Dump any tables that were inaccessible to the older server by - using mysqldump to create a dump file. - - 4. Stop the newer MySQL server and restart the older one. - - 5. Reload the dump file into the older server. Your tables should - be accessible. - - It might also be the case that system tables in the mysql database - have changed and that downgrading introduces some loss of - functionality or requires some adjustments. Here are some - examples: - - * Trigger creation requires the TRIGGER privilege as of MySQL - 5.1. In MySQL 5.0, there is no TRIGGER privilege and SUPER is - required instead. If you downgrade from MySQL 5.1 to 5.0, you - will need to give the SUPER privilege to those accounts that - had the TRIGGER privilege in 5.1. - - * Triggers were added in MySQL 5.0, so if you downgrade from 5.0 - to 4.1, you cannot use triggers at all. - - * The mysql.proc.comment column definition changed between MySQL - 5.1 and 5.5. After a downgrade from 5.5 to 5.1, this table is - seen as corrupt and in need of repair. To workaround this - problem, execute mysql_upgrade from the version of MySQL to - which you downgraded. - -2.4.2.1. Downgrading to MySQL 5.0 - - When downgrading to MySQL 5.0 from MySQL 5.1, you should keep in - mind the following issues relating to features found in MySQL 5.1, - but not in MySQL 5.0: - - * Partitioning. MySQL 5.0 does not support user-defined - partitioning. If a table was created as a partitioned table in - 5.1 (or if an table created in a previous version of MySQL was - altered to include partitions after an upgrade to 5.1), the - table is accessible after downgrade only if you do one of the - following: - - + Export the table using mysqldump and then drop it in - MySQL 5.1; import the table again following the downgrade - to MySQL 5.0. - - + Prior to the downgrade, remove the table's partitioning - using ALTER TABLE table_name REMOVE PARTITIONING. - - * Event Scheduler. MySQL 5.0 does not support scheduled events. - If your databases contain scheduled event definitions, you - should prevent them from being dumped when you use mysqldump - by using the --skip-events option. (See Section 4.5.4, - "mysqldump --- A Database Backup Program.") - - * Stored routines. MySQL 5.1.21 added a number of new columns - to the mysql.proc table in which stored routine definitions - are stored. If you are downgrading from MySQL 5.1.21 or later - to MySQL 5.0, you cannot import the MySQL 5.1 routine - definitions into MySQL 5.0.46 or earlier using the dump of - mysql.proc created by mysqldump (such as when using the - --all-databases option). Instead, you should run mysqldump - --routines prior to performing the downgrade and run the - stored routines DDL statements following the downgrade. - See Bug#11986: http://bugs.mysql.com/bug.php?id=11986, - Bug#30029: http://bugs.mysql.com/bug.php?id=30029, and - Bug#30660: http://bugs.mysql.com/bug.php?id=30660, for more - information. - - * Triggers. Trigger creation requires the TRIGGER privilege as - of MySQL 5.1. In MySQL 5.0, there is no TRIGGER privilege and - SUPER is required instead. If you downgrade from MySQL 5.1 to - 5.0, you will need to give the SUPER privilege to those - accounts that had the TRIGGER privilege in 5.1. - -2.4.3. Checking Whether Tables or Indexes Must Be Rebuilt - - A binary upgrade or downgrade is one that installs one version of - MySQL "in place" over an existing version, without dumping and - reloading tables: - - 1. Stop the server for the existing version if it is running. - - 2. Install a different version of MySQL. This is an upgrade if - the new version is higher than the original version, a - downgrade if the version is lower. - - 3. Start the server for the new version. - - In many cases, the tables from the previous version of MySQL can - be used without problem by the new version. However, sometimes - changes occur that require tables or table indexes to be rebuilt, - as described in this section. If you have tables that are affected - by any of the issues described here, rebuild the tables or indexes - as necessary using the instructions given in Section 2.4.4, - "Rebuilding or Repairing Tables or Indexes." - - Table Incompatibilities - - After a binary upgrade to MySQL 5.1 from a MySQL 5.0 installation - that contains ARCHIVE tables, accessing those tables causes the - server to crash, even if you have run mysql_upgrade or CHECK TABLE - ... FOR UPGRADE. To work around this problem, use mysqldump to - dump all ARCHIVE tables before upgrading, and reload them into - MySQL 5.1 after upgrading. The same problem occurs for binary - downgrades from MySQL 5.1 to 5.0. - - Index Incompatibilities - - If you perform a binary upgrade without dumping and reloading - tables, you cannot upgrade directly from MySQL 4.1 to 5.1 or - higher. This occurs due to an incompatible change in the MyISAM - table index format in MySQL 5.0. Upgrade from MySQL 4.1 to 5.0 and - repair all MyISAM tables. Then upgrade from MySQL 5.0 to 5.1 and - check and repair your tables. - - Modifications to the handling of character sets or collations - might change the character sort order, which causes the ordering - of entries in any index that uses an affected character set or - collation to be incorrect. Such changes result in several possible - problems: - - * Comparison results that differ from previous results - - * Inability to find some index values due to misordered index - entries - - * Misordered ORDER BY results - - * Tables that CHECK TABLE reports as being in need of repair - - The solution to these problems is to rebuild any indexes that use - an affected character set or collation, either by dropping and - re-creating the indexes, or by dumping and reloading the entire - table. For information about rebuilding indexes, see Section - 2.4.4, "Rebuilding or Repairing Tables or Indexes." - - To check whether a table has indexes that must be rebuilt, consult - the following list. It indicates which versions of MySQL - introduced character set or collation changes that require indexes - to be rebuilt. Each entry indicates the version in which the - change occurred and the character sets or collations that the - change affects. If the change is associated with a particular bug - report, the bug number is given. - - The list applies both for binary upgrades and downgrades. For - example, Bug#27877: http://bugs.mysql.com/bug.php?id=27877 was - fixed in MySQL 5.1.24 and 5.4.0, so it applies to upgrades from - versions older than 5.1.24 to 5.1.24 or newer, and to downgrades - from 5.1.24 or newer to versions older than 5.1.24. - - In many cases, you can use CHECK TABLE ... FOR UPGRADE to identify - tables for which index rebuilding is required. (It will report: - Table upgrade required. Please do "REPAIR TABLE `tbl_name`" or - dump/reload to fix it!) In these cases, you can also use - mysqlcheck --check-upgrade or mysql_upgrade, which execute CHECK - TABLE. However, the use of CHECK TABLE applies only after - upgrades, not downgrades. Also, CHECK TABLE is not applicable to - all storage engines. For details about which storage engines CHECK - TABLE supports, see Section 12.4.2.3, "CHECK TABLE Syntax." - - Changes that cause index rebuilding to be necessary: - - * MySQL 5.0.48, 5.1.21 - (Bug#29461: http://bugs.mysql.com/bug.php?id=29461) - Affects indexes for columns that use any of these character - sets: eucjpms, euc_kr, gb2312, latin7, macce, ujis - Affected tables can be detected by CHECK TABLE ... FOR UPGRADE - as of MySQL 5.1.29, 5.4.0 (see - Bug#39585: http://bugs.mysql.com/bug.php?id=39585). - - * MySQL 5.0.48, 5.1.23 - (Bug#27562: http://bugs.mysql.com/bug.php?id=27562) - Affects indexes that use the ascii_general_ci collation for - columns that contain any of these characters: '`' GRAVE - ACCENT, '[' LEFT SQUARE BRACKET, '\' REVERSE SOLIDUS, ']' - RIGHT SQUARE BRACKET, '~' TILDE - Affected tables can be detected by CHECK TABLE ... FOR UPGRADE - as of MySQL 5.1.29, 5.4.0 (see - Bug#39585: http://bugs.mysql.com/bug.php?id=39585). - - * MySQL 5.1.24, 5.4.0 - (Bug#27877: http://bugs.mysql.com/bug.php?id=27877) - Affects indexes that use the utf8_general_ci or - ucs2_general_ci collation for columns that contain 'ß' LATIN - SMALL LETTER SHARP S (German). - Affected tables can be detected by CHECK TABLE ... FOR UPGRADE - as of MySQL 5.1.30, 5.4.0 (see - Bug#40053: http://bugs.mysql.com/bug.php?id=40053). - -2.4.4. Rebuilding or Repairing Tables or Indexes - - This section describes how to rebuild a table. This can be - necessitated by changes to MySQL such as how data types are - handled or changes to character set handling. For example, an - error in a collation might have been corrected, necessitating a - table rebuild to update the indexes for character columns that use - the collation. (For examples, see Section 2.4.3, "Checking Whether - Tables or Indexes Must Be Rebuilt.") It might also be that a table - repair or upgrade should be done as indicated by a table check - operation such as that performed by CHECK TABLE, mysqlcheck, or - mysql_upgrade. - - Methods for rebuilding a table include dumping and reloading it, - or using ALTER TABLE or REPAIR TABLE. - -Note - - If you are rebuilding tables because a different version of MySQL - will not handle them after a binary (in-place) upgrade or - downgrade, you must use the dump-and-reload method. Dump the - tables before upgrading or downgrading using your original version - of MySQL. Then reload the tables after upgrading or downgrading. - - If you use the dump-and-reload method of rebuilding tables only - for the purpose of rebuilding indexes, you can perform the dump - either before or after upgrading or downgrading. Reloading still - must be done afterward. - - To rebuild a table by dumping and reloading it, use mysqldump to - create a dump file and mysql to reload the file: -shell> mysqldump db_name t1 > dump.sql -shell> mysql db_name < dump.sql - - To rebuild all the tables in a single database, specify the - database name without any following table name: -shell> mysqldump db_name > dump.sql -shell> mysql db_name < dump.sql - - To rebuild all tables in all databases, use the --all-databases - option: -shell> mysqldump --all-databases > dump.sql -shell> mysql < dump.sql - - To rebuild a table with ALTER TABLE, use a "null" alteration; that - is, an ALTER TABLE statement that "changes" the table to use the - storage engine that it already has. For example, if t1 is a MyISAM - table, use this statement: -mysql> ALTER TABLE t1 ENGINE = MyISAM; - - If you are not sure which storage engine to specify in the ALTER - TABLE statement, use SHOW CREATE TABLE to display the table - definition. - - If you must rebuild a table because a table checking operation - indicates that the table is corrupt or needs an upgrade, you can - use REPAIR TABLE if that statement supports the table's storage - engine. For example, to repair a MyISAM table, use this statement: -mysql> REPAIR TABLE t1; - - For storage engines such as InnoDB that REPAIR TABLE does not - support, use mysqldump to create a dump file and mysql to reload - the file, as described earlier. - - For specifics about which storage engines REPAIR TABLE supports, - see Section 12.4.2.6, "REPAIR TABLE Syntax." - - mysqlcheck --repair provides command-line access to the REPAIR - TABLE statement. This can be a more convenient means of repairing - tables because you can use the --databases or --all-databases - option to repair all tables in specific databases or all - databases, respectively: -shell> mysqlcheck --repair --databases db_name ... -shell> mysqlcheck --repair --all-databases - -2.4.5. Copying MySQL Databases to Another Machine - - You can copy the .frm, .MYI, and .MYD files for MyISAM tables - between different architectures that support the same - floating-point format. (MySQL takes care of any byte-swapping - issues.) See Section 13.5, "The MyISAM Storage Engine." - - In cases where you need to transfer databases between different - architectures, you can use mysqldump to create a file containing - SQL statements. You can then transfer the file to the other - machine and feed it as input to the mysql client. - - Use mysqldump --help to see what options are available. - - The easiest (although not the fastest) way to move a database - between two machines is to run the following commands on the - machine on which the database is located: -shell> mysqladmin -h 'other_hostname' create db_name -shell> mysqldump db_name | mysql -h 'other_hostname' db_name - - If you want to copy a database from a remote machine over a slow - network, you can use these commands: -shell> mysqladmin create db_name -shell> mysqldump -h 'other_hostname' --compress db_name | mysql db_na -me - - You can also store the dump in a file, transfer the file to the - target machine, and then load the file into the database there. - For example, you can dump a database to a compressed file on the - source machine like this: -shell> mysqldump --quick db_name | gzip > db_name.gz - - Transfer the file containing the database contents to the target - machine and run these commands there: -shell> mysqladmin create db_name -shell> gunzip < db_name.gz | mysql db_name - - You can also use mysqldump and mysqlimport to transfer the - database. For large tables, this is much faster than simply using - mysqldump. In the following commands, DUMPDIR represents the full - path name of the directory you use to store the output from - mysqldump. - - First, create the directory for the output files and dump the - database: -shell> mkdir DUMPDIR -shell> mysqldump --tab=DUMPDIR db_name - - Then transfer the files in the DUMPDIR directory to some - corresponding directory on the target machine and load the files - into MySQL there: -shell> mysqladmin create db_name # create database -shell> cat DUMPDIR/*.sql | mysql db_name # create tables in databas -e -shell> mysqlimport db_name DUMPDIR/*.txt # load data into tables - - Do not forget to copy the mysql database because that is where the - grant tables are stored. You might have to run commands as the - MySQL root user on the new machine until you have the mysql - database in place. - - After you import the mysql database on the new machine, execute - mysqladmin flush-privileges so that the server reloads the grant - table information. - -2.5. Installing MySQL on Windows - - This section describes the process for installing MySQL on - Windows. - - To run MySQL on Windows, you need the following: - - * A Windows operating system such as Windows 2000, Windows XP, - Windows Vista, Windows Server 2003, or Windows Server 2008. - Both 32-bit and 64-bit versions are supported. - In addition to running MySQL as a standard application, you - can also run the MySQL server as a Windows service. By using a - service you can monitor and control the operation of the - server through the standard Windows service management tools. - For more information, see Section 2.5.5.6, "Starting MySQL as - a Windows Service." - Generally, you should install MySQL on Windows using an - account that has administrator rights. Otherwise, you may - encounter problems with certain operations such as editing the - PATH environment variable or accessing the Service Control - Manager. Once installed, MySQL does not need to be executed - using a user with Administrator privileges. - - * TCP/IP protocol support. - - * Enough space on the hard drive to unpack, install, and create - the databases in accordance with your requirements (generally - a minimum of 200 megabytes is recommended.) - - For a list of limitations within the Windows version of MySQL, see - Section D.7.3, "Windows Platform Limitations." - - In addition to the MySQL Server package, you may need or want - additional components to use MySQL with your application or - development environment. These include, but are not limited to: - - * If you plan to connect to the MySQL server via ODBC, you need - a Connector/ODBC driver. For more information, including - installation and configuration instructions, see Section 21.1, - "MySQL Connector/ODBC." - - * If you plan to use MySQL server with .NET applications, you - need the Connector/NET driver. For more information, including - installation and configuration instructions, see Section 21.2, - "MySQL Connector/NET." - - MySQL distributions for Windows can be downloaded from - http://dev.mysql.com/downloads/. See Section 2.1.3, "How to Get - MySQL." - - MySQL for Windows is available in several distribution formats, - detailed below. Generally speaking, you should use a binary - distribution that includes an installer. It is simpler to use than - the others, and you need no additional tools to get MySQL up and - running. The installer for the Windows version of MySQL, combined - with a GUI Config Wizard, automatically installs MySQL, creates an - option file, starts the server, and secures the default user - accounts. - - * Binary installer distribution. The installable distribution - comes packaged as a Microsoft Windows Installer (MSI) package - that you can install manually or automatically on your - systems. Two formats are available, an essentials package that - contains all the files you need to install and configure - MySQL, but no additional components, and a complete package - that includes MySQL, configuration tools, benchmarks and other - components. For more information on the specific differences, - see Section 2.5.2, "Choosing An Installation Package" - For instructions on installing MySQL using one of the MSI - installation packages, see Section 2.5.3, "Installing MySQL - with the MSI Package." - - * Standard binary distribution format packaged as a Zip file - containing all of the necessary files that you unpack into - your chosen location. This package contains all of the files - in the full Windows MSI Installer package, but does not - including an installation program. - For instructions on installing MySQL using the Zip file, see - Section 2.5.5, "Installing MySQL from a noinstall Zip - Archive." - - * The source distribution contains all the code and support - files for building the executables using the Visual Studio - compiler system. - For instructions on building MySQL from source on Windows, see - Section 2.5.9, "Installing MySQL from Source on Windows." - - MySQL on Windows considerations: - - * Large Table Support - If you need tables with a size larger than 4GB, install MySQL - on an NTFS or newer file system. Do not forget to use MAX_ROWS - and AVG_ROW_LENGTH when you create tables. See Section - 12.1.17, "CREATE TABLE Syntax." - - * MySQL and Virus Checking Software - Using virus scanning software such as Norton/Symantec - Anti-Virus on directories containing MySQL data and temporary - tables can cause issues, both in terms of the performance of - MySQL and the virus-scanning software mis-identifying the - contents of the files as containing spam. This is because of - the fingerprinting mechanism used by the virus scanning - software, and the way in which MySQL rapidly updates different - files, which may be identified as a potential security risk. - After installing MySQL Server, it is recommended that you - disable virus scanning on the main directory (datadir) being - used to store your MySQL table data. There is usually a system - built into the virus scanning software to permit certain - directories to be specifically ignored during virus scanning. - In addition, by default, MySQL creates temporary files in the - standard Windows temporary directory. To prevent the temporary - files also being scanned, you should configure a separate - temporary directory for MySQL temporary files and add this to - the virus scanning exclusion list. To do this, add a - configuration option for the tmpdir parameter to your my.ini - configuration file. For more information, see Section 2.5.5.2, - "Creating an Option File." - -2.5.1. Windows Installation Layout - - For MySQL 5.1 on Windows, the default installation directory is - C:\Program Files\MySQL\MySQL Server 5.1. Some Windows users prefer - to install in C:\mysql, the directory that formerly was used as - the default. However, the layout of the subdirectories remains the - same. - - For MySQL 5.1.23 and earlier, all of the files are located within - this parent directory, using the following structure: - - Table 2.2. Installation Layout for Windows using MySQL 5.1.23 and - earlier - Directory Contents of Directory - bin Client programs and the mysqld server - data Log files, databases - Docs Manual in CHM format - examples Example programs and scripts - include Include (header) files - lib Libraries - scripts Utility scripts - share Error message files - - For MySQL 5.1.24 and later, the default location of data directory - was changed. The remainder of the directory structure remains the - same: - - Table 2.3. Installation Layout for Windows using MySQL 5.1.24 and - later - Directory Contents of Directory - bin Client programs and the mysqld server - C:\Documents and Settings\All Users\Application Data\MySQL Log - files, databases - Docs Manual in CHM format - examples Example programs and scripts - include Include (header) files - lib Libraries - scripts Utility scripts - share Error message files - -2.5.2. Choosing An Installation Package - - For MySQL 5.1, there are three installation packages to choose - from when installing MySQL on Windows: - Packaging - Feature Essentials Complete Zip (No-install) - Installer Yes Yes No - Directory-only - MySQL Server Instance Config Wizard Yes Yes No - Test Suite No Yes Yes - MySQL Server Yes Yes Yes - MySQL Client Programs Yes Yes Yes - C Headers/Libraries Yes Yes Yes - Embedded Server No Optional Yes - Scripts and Examples No Optional Yes - - In the above table: - - * Yes indiciates that the component is installed by default. - - * No indicates that the component is not installed or included. - - * Optional indicates that the component is included with the - package, but not installed unless explicitly requested using - the Custom installation mode. - - The workflow for installing using the MSI installer is shown - below: - - Figure 2.1. Installation Workflow for Windows using MSI - Installation Workflow for Windows using MSI - - The workflow for installing using the MSI installer is shown - below: - - Figure 2.2. Installation Workflow for Windows using Zip - Installation Workflow for Windows using Zip - -Note - - For the Essentials and Complete packages in the MSI installer, you - can select individual components to be installed by using the - Custom mode, including disable the components confiurated for - installation by default. - - Full details on the components are suggested uses are provided - below for reference: - - * Windows Essentials : This package has a file name similar to - mysql-essential-5.1.50-win32.msi and is supplied as a - Microsoft Installer (MSI) package. The package includes the - minimum set of files needed to install MySQL on Windows, - including the MySQL Server Instance Config Wizard. This - package does not include optional components such as the - embedded server, developer headers and libraries or benchmark - suite. - To install using this package, see Section 2.5.3, "Installing - MySQL with the MSI Package." - - * Windows MSI Installer (Complete): This package has a file name - similar to mysql-5.1.50-win32.zip and contains all files - needed for a complete Windows installation, including the - MySQL Server Instance Config Wizard. This package includes - optional components such as the embedded server and benchmark - suite. - To install using this package, see Section 2.5.3, "Installing - MySQL with the MSI Package." - - * Without installer: This package has a file name similar to - mysql-noinstall-5.1.50-win32.zip and contains all the files - found in the Complete install package, with the exception of - the MySQL Server Instance Config Wizard. This package does not - include an automated installer, and must be manually installed - and configured. - - The Essentials package is recommended for most users. Both the - Essentials and Complete distributions are available as an .msi - file for use with the Windows Installer. The Noinstall - distribution is packaged as Zip archives. To use Zip archives, you - must have a tool that can unpack .zip files. - - When using the MSI installers you can automate the installation - process. For more information, see Section 2.5.3.2, "Installing - MySQL Automatically using MSI." To automate the creation of a - MySQL instance, see Section 2.5.4.13, "Creating an Instance from - the Command Line." - - Your choice of install package affects the installation process - you must follow. If you choose to install either the Essentials or - Complete install packages, see Section 2.5.3, "Installing MySQL - with the MSI Package." If you choose to install MySQL from the - Noinstall archive, see Section 2.5.5, "Installing MySQL from a - noinstall Zip Archive." - -2.5.3. Installing MySQL with the MSI Package - - The MSI package are designed to install and configure MySQL in - such a way that you can immediately get started using MySQL. - - The MySQL Installation Wizard and MySQL Config Wizard are - available in the Essentials and Complete install packages. They - are recommended for most standard MySQL installations. Exceptions - include users who need to install multiple instances of MySQL on a - single server host and advanced users who want complete control of - server configuration. - - * For information on installing using the GUI MSI installer - process, see Section 2.5.3, "Installing MySQL with the MSI - Package." - - * For information on installing using the command line using the - MSI package, see Section 2.5.3.2, "Installing MySQL - Automatically using MSI." - - * If you have previously installed MySQL using the MSI package - and want to remove MySQL, see Section 2.5.3.3, "Removing MySQL - Installed from the MSI Package." - - The workflow sequence for using the installer is shown in the - figure below: - - Figure 2.3. Installation Workflow for Windows using MSI Installer - Installation Workflow for Windows using MSI Installer - -Note - - Microsoft Windows XP and later include a firewall which - specifically blocks ports. If you plan on using MySQL through a - network port then you should open and create an exception for this - port before performing the installation. To check and if necessary - add an exception to the firewall settings: - - 1. First ensure that you are logged in as an Administrator or a - user with Administrator privileges. - - 2. Go to the Control Panel, and double click the Windows Firewall - icon. - - 3. Choose the Allow a program through Windows Firewall option and - click the Add port button. - - 4. Enter MySQL into the Name text box and 3306 (or the port of - your choice) into the Port number text box. - - 5. Also ensure that the TCP protocol radio button is selected. - - 6. If you wish, you can also limit access to the MySQL server by - choosing the Change scope button. - - 7. Confirm your choices by clicking the OK button. - - Additionally, when running the MySQL Installation Wizard on - Windows Vista, ensure that you are logged in as a user with - administrative rights. - -Note - - When using Windows Vista, you may want to disable User Account - Control (UAC) before performing the installation. If you do not do - so, then MySQL may be identified as a security risk, which will - mean that you need to enable MySQL. You can disable the security - checking by following these instructions: - - 1. Open Control Panel. - - 2. Under the User Accounts and Family Safety, select Add or - remove user accounts. - - 3. Click the Got to the main User Accounts page link. - - 4. Click on Turn User Account Control on or off. You may be - prompted to provide permission to change this setting. Click - Continue. - - 5. Deselect or unceck the checkbox next to Use User Account - Control (UAC) to help protect your computer. Click OK to save - the setting. - - You will need to restart to complete the process. Click Restart - Now to reboot the machine and apply the changes. You can then - follow the instructions below for installing Windows. - -2.5.3.1. Using the MySQL Installation Wizard - - MySQL Installation Wizard is an installer for the MySQL server - that uses the latest installer technologies for Microsoft Windows. - The MySQL Installation Wizard, in combination with the MySQL - Config Wizard, enables a user to install and configure a MySQL - server that is ready for use immediately after installation. - - The MySQL Installation Wizard uses the standard Microsoft - Installer Engine (MSI) system is the standard installer for all - MySQL server distributions, version 4.1.5 and higher. Users of - previous versions of MySQL need to shut down and remove their - existing MySQL installations manually before installing MySQL with - the MySQL Installation Wizard. See Section 2.5.3.1.6, "Upgrading - MySQL with the Installation Wizard," for more information on - upgrading from a previous version. - - If you are upgrading an installation from MySQL 5.1.31 or earlier - to MySQL 5.1.32 or later, read the notes provided in Section - 2.5.3.1.6, "Upgrading MySQL with the Installation Wizard." - - The Microsoft Windows Installer Engine was updated with the - release of Windows XP; those using a previous version of Windows - can reference this Microsoft Knowledge Base article - (http://support.microsoft.com/default.aspx?scid=kb;EN-US;292539) - for information on upgrading to the latest version of the Windows - Installer Engine. - - In addition, Microsoft has introduced the WiX (Windows Installer - XML) toolkit. This is the first highly acknowledged Open Source - project from Microsoft. We have switched to WiX because it is an - Open Source project and it enables us to handle the complete - Windows installation process in a flexible manner using scripts. - - Improving the MySQL Installation Wizard depends on the support and - feedback of users like you. If you find that the MySQL - Installation Wizard is lacking some feature important to you, or - if you discover a bug, please report it in our bugs database using - the instructions given in Section 1.7, "How to Report Bugs or - Problems." - -2.5.3.1.1. Downloading and Starting the MySQL Installation Wizard - - The MySQL installation packages can be downloaded from - http://dev.mysql.com/downloads/. If the package you download is - contained within a Zip archive, you need to extract the archive - first. - - The process for starting the wizard depends on the contents of the - installation package you download. If there is a setup.exe file - present, double-click it to start the installation process. If - there is an .msi file present, double-click it to start the - installation process. - -2.5.3.1.2. Choosing an Install Type - - There are three installation types available: Typical, Complete, - and Custom. - - The Typical installation type installs the MySQL server, the mysql - command-line client, and the command-line utilities. The - command-line clients and utilities include mysqldump, myisamchk, - and several other tools to help you manage the MySQL server. - - The Complete installation type installs all components included in - the installation package. The full installation package includes - components such as the embedded server library, the benchmark - suite, support scripts, and documentation. - - The Custom installation type gives you complete control over which - packages you wish to install and the installation path that is - used. See Section 2.5.3.1.3, "The Custom Install Dialog," for more - information on performing a custom install. - - If you choose the Typical or Complete installation types and click - the Next button, you advance to the confirmation screen to verify - your choices and begin the installation. If you choose the Custom - installation type and click the Next button, you advance to the - custom installation dialog, described in Section 2.5.3.1.3, "The - Custom Install Dialog." - -2.5.3.1.3. The Custom Install Dialog - - If you wish to change the installation path or the specific - components that are installed by the MySQL Installation Wizard, - choose the Custom installation type. - - A tree view on the left side of the custom install dialog lists - all available components. Components that are not installed have a - red X icon; components that are installed have a gray icon. To - change whether a component is installed, click that component's - icon and choose a new option from the drop-down list that appears. - - You can change the default installation path by clicking the - Change... button to the right of the displayed installation path. - - After choosing your installation components and installation path, - click the Next button to advance to the confirmation dialog. - -2.5.3.1.4. The Confirmation Dialog - - Once you choose an installation type and optionally choose your - installation components, you advance to the confirmation dialog. - Your installation type and installation path are displayed for you - to review. - - To install MySQL if you are satisfied with your settings, click - the Install button. To change your settings, click the Back - button. To exit the MySQL Installation Wizard without installing - MySQL, click the Cancel button. - - In MySQL 5.1.47 and earlier, after installation is complete, you - have the option of registering with the MySQL web site. - Registration gives you access to post in the MySQL forums at - forums.mysql.com (http://forums.mysql.com), along with the ability - to report bugs at bugs.mysql.com (http://bugs.mysql.com) and to - subscribe to our newsletter. - - The final screen of the installer provides a summary of the - installation and gives you the option to launch the MySQL Config - Wizard, which you can use to create a configuration file, install - the MySQL service, and configure security settings. - -2.5.3.1.5. Changes Made by MySQL Installation Wizard - - Once you click the Install button, the MySQL Installation Wizard - begins the installation process and makes certain changes to your - system which are described in the sections that follow. - - Changes to the Registry - - The MySQL Installation Wizard creates one Windows registry key in - a typical install situation, located in - HKEY_LOCAL_MACHINE\SOFTWARE\MySQL AB. - - The MySQL Installation Wizard creates a key named after the major - version of the server that is being installed, such as MySQL - Server 5.1. It contains two string values, Location and Version. - The Location string contains the path to the installation - directory. In a default installation it contains C:\Program - Files\MySQL\MySQL Server 5.1\. The Version string contains the - release number. For example, for an installation of MySQL Server - 5.1.50, the key contains a value of 5.1.50. - - These registry keys are used to help external tools identify the - installed location of the MySQL server, preventing a complete scan - of the hard-disk to determine the installation path of the MySQL - server. The registry keys are not required to run the server, and - if you install MySQL using the noinstall Zip archive, the registry - keys are not created. - - Changes to the Start Menu - - The MySQL Installation Wizard creates a new entry in the Windows - Start menu under a common MySQL menu heading named after the major - version of MySQL that you have installed. For example, if you - install MySQL 5.1, the MySQL Installation Wizard creates a MySQL - Server 5.1 section in the Start menu. - - The following entries are created within the new Start menu - section: - - * MySQL Command Line Client: This is a shortcut to the mysql - command-line client and is configured to connect as the root - user. The shortcut prompts for a root user password when you - connect. - - * MySQL Server Instance Config Wizard: This is a shortcut to the - MySQL Config Wizard. Use this shortcut to configure a newly - installed server, or to reconfigure an existing server. - - * MySQL Documentation: This is a link to the MySQL server - documentation that is stored locally in the MySQL server - installation directory. This option is not available when the - MySQL server is installed using the Essentials installation - package. - - Changes to the File System - - The MySQL Installation Wizard by default installs the MySQL 5.1 - server to C:\Program Files\MySQL\MySQL Server 5.1, where Program - Files is the default location for applications in your system, and - 5.1 is the major version of your MySQL server. This is the - recommended location for the MySQL server, replacing the former - default location C:\mysql. - - By default, all MySQL applications are stored in a common - directory at C:\Program Files\MySQL, where Program Files is the - default location for applications in your Windows installation. A - typical MySQL installation on a developer machine might look like - this: -C:\Program Files\MySQL\MySQL Server 5.1 -C:\Program Files\MySQL\MySQL Workbench 5.1 OSS - - This approach makes it easier to manage and maintain all MySQL - applications installed on a particular system. - - In MySQL 5.1.23 and earlier, the default location for the data - files used by MySQL is located within the corresponding MySQL - Server installation directory. For MySQL 5.1.24 and later, the - default location of the data directory is the AppData directory - configured for the user that installed the MySQL application. - -2.5.3.1.6. Upgrading MySQL with the Installation Wizard - - The MySQL Installation Wizard can perform server upgrades - automatically using the upgrade capabilities of MSI. That means - you do not need to remove a previous installation manually before - installing a new release. The installer automatically shuts down - and removes the previous MySQL service before installing the new - version. - - Automatic upgrades are available only when upgrading between - installations that have the same major and minor version numbers. - For example, you can upgrade automatically from MySQL 5.1.34 to - MySQL 5.1.37, but not from MySQL 5.0 to MySQL 5.1. - - In MySQL 5.1.32 and later, the EXE version of the MSI installer - packages were removed. When upgrading an existing MySQL - installation from the old EXE based installer to the MSI based - installer, please keep the following notes in mind: - - * The MSI installer will not identify an existing installation - that was installed using the old EXE installer. This means - that the installer will not stop the existing server, or - detect that the existing password is required before - installing the new version. To work around this: - - 1. Stop the current server manually using net stop or - mysqladmin shutdown. - - 2. Remove the existing installation manually by using the - Add/Remove Programs control panel. This will keep the - existing configuration and data files, as these are not - removed automatically. - - 3. Install the new version of MySQL using the MSI installer. - When running the installation, skip updating the security - by deselecting the checkbox on the security screen. - - 4. Complete the installation, and then start the server - again. You should be able to login with your existing - user and password credentials. - - * You can only upgrade the version and release using the MSI - installer. For example, you can upgrade an open source - installation with an open source installer. You cannot upgrade - an open source installation using the enterprise installer. - - See Section 2.5.7, "Upgrading MySQL on Windows." - -2.5.3.2. Installing MySQL Automatically using MSI - - The Microsoft Installer (MSI) supports a both a quiet and a - passive mode that can be used to install MySQL automatically - without requireing intervention. You can use this either in - scripts to automatically install MySQL or through a terminal - connection such as Telnet where you do not have access to the - standard Windows user interface. The MSI packages can also be used - in combination with Microsoft's Group Policy system (part of - Windows Server 2003 and Windows Server 2008) to install MySQL - across multiple machines. - - To install MySQL from one of the MSI packages automatically from - the command line (or within a script), you need to use the - msiexec.exe tool. For example, to perform a quiet installation - (which shows no dialog boxes or progress): -shell> msiexec /i /quiet mysql-5.1.39.msi - - The /i indicates that you want to perform an installation. The - /quiet option indicates that you want no interactive elements. - - To provide a dialog box showing the progress during installation, - and the dialog boxes providing information on the installation and - registration of MySQL, use /passive mode instead of /quiet: -shell> msiexec /i /passive mysql-5.1.39.msi - - Regardless of the mode of the installation, installing the package - in this manner performs a 'Typical' installation, and installs the - default components into the standard location. - - You can also use this method to uninstall MySQL by using the - /uninstall or /x options: -shell> msiexec /x /quiet mysql-5.1.39.msi - - To install MySQL and configure a MySQL instance from the command - line, see Section 2.5.4.13, "Creating an Instance from the Command - Line." - - For information on using MSI packages to install software - automatically using Group Policy, see How to use Group Policy to - remotely install software in Windows Server 2003 - (http://support.microsoft.com/kb/816102). - -2.5.3.3. Removing MySQL Installed from the MSI Package - - To uninstall a MySQL where you have used the MSI packages, you - must use the Add/Remove Programs tool within Control Panel. To do - this: - - 1. Right-click the start menu and choose Control Panel. - - 2. If the Control Panel is set to category mode (you will see - Pick a category at the top of the Control Panel window), - double-click Add or Remove Programs. If the Control is set to - classic mode, double-click the Add or Remove Programs icon. - - 3. Find MySQL in the list of installed software. MySQL Server is - installed against major version numbers (MySQL 5.0, MySQL 5.1, - etc.). Select the version that you want to remove and click - Remove. - - 4. You will be prompted to confirm the removal. Click Yes to - remove MySQL. - - When MySQL is removed using this method, only the installed - components are removed. Any database information (including the - tables and data), import or export files, log files, and binary - logs produced during execution are kept in their configured - location. - - If you try to install MySQL again the information will be retained - and you will be prompted to enter the password configured with the - original installation. - - If you want to delete MySQL completely, delete the associated data - directory. On Windows XP and Windows Server 2003, before MySQL - 5.1.24, the default data directory would be located within the - MySQL installation directory. On MySQL 5.1.24 and later, the - default data directory is the configured AppData directory, which - is C:\Documents and Settings\All Users\Application Data\MySQL by - default. On Windows 7 and Windows Server 2008, the default data - directory location is C:\ProgramData\Mysql. - -2.5.4. MySQL Server Instance Config Wizard - - The MySQL Server Instance Config Wizard helps automate the process - of configuring your server. It creates a custom MySQL - configuration file (my.ini or my.cnf) by asking you a series of - questions and then applying your responses to a template to - generate the configuration file that is tuned to your - installation. - - The complete and essential MSI installation packages include the - MySQL Server Instance Config Wizard in the MySQL 5.1 server. The - MySQL Server Instance Config Wizard is only available for Windows. - - The workflow sequence for using the MySQL Server Instance Config - Wizard is shown in the figure below: - - Figure 2.4. MySQL Server Instance Config Wizard Workflow - MySQL Server Instance Config Wizard Workflow - -2.5.4.1. Starting the MySQL Server Instance Config Wizard - - The MySQL Server Instance Config Wizard is normally started as - part of the installation process. You should only need to run the - MySQL Server Instance Config Wizard again when you need to change - the configuration parameters of your server. - - If you chose not to open a port prior to installing MySQL on - Windows Vista, you can choose to use the MySQL Server Instance - Config Wizard after installation. However, you must open a port in - the Windows Firewall. To do this see the instructions given in - Section 2.5.3.1.1, "Downloading and Starting the MySQL - Installation Wizard." Rather than opening a port, you also have - the option of adding MySQL as a program that bypasses the Windows - Firewall. One or the other option is sufficient---you need not do - both. Additionally, when running the MySQL Server Config Wizard on - Windows Vista ensure that you are logged in as a user with - administrative rights. - MySQL Server Instance Config Wizard - - You can launch the MySQL Config Wizard by clicking the MySQL - Server Instance Config Wizard entry in the MySQL section of the - Windows Start menu. - - Alternatively, you can navigate to the bin directory of your MySQL - installation and launch the MySQLInstanceConfig.exe file directly. - - The MySQL Server Instance Config Wizard places the my.ini file in - the installation directory for the MySQL server. This helps - associate configuration files with particular server instances. - - To ensure that the MySQL server knows where to look for the my.ini - file, an argument similar to this is passed to the MySQL server as - part of the service installation: ---defaults-file="C:\Program Files\MySQL\MySQL Server 5.1\my.ini" - - Here, C:\Program Files\MySQL\MySQL Server 5.1 is replaced with the - installation path to the MySQL Server. The --defaults-file option - instructs the MySQL server to read the specified file for - configuration options when it starts. - - Apart from making changes to the my.ini file by running the MySQL - Server Instance Config Wizard again, you can modify it by opening - it with a text editor and making any necessary changes. You can - also modify the server configuration with the - http://www.mysql.com/products/administrator/ utility. For more - information about server configuration, see Section 5.1.2, "Server - Command Options." - - MySQL clients and utilities such as the mysql and mysqldump - command-line clients are not able to locate the my.ini file - located in the server installation directory. To configure the - client and utility applications, create a new my.ini file in the - Windows installation directory (for example, C:\WINDOWS). - - Under Windows Server 2003, Windows Server 2000, Windows XP, and - Windows Vista MySQL Server Instance Config Wizard will configure - MySQL to work as a Windows service. To start and stop MySQL you - use the Services application that is supplied as part of the - Windows Administrator Tools. - -2.5.4.2. Choosing a Maintenance Option - - If the MySQL Server Instance Config Wizard detects an existing - configuration file, you have the option of either reconfiguring - your existing server, or removing the server instance by deleting - the configuration file and stopping and removing the MySQL - service. - - To reconfigure an existing server, choose the Re-configure - Instance option and click the Next button. Any existing - configuration file is not overwritten, but renamed (within the - same directory) using a timestamp (Windows) or sequential number - (Linux). To remove the existing server instance, choose the Remove - Instance option and click the Next button. - - If you choose the Remove Instance option, you advance to a - confirmation window. Click the Execute button. The MySQL Server - Config Wizard stops and removes the MySQL service, and then - deletes the configuration file. The server installation and its - data folder are not removed. - - If you choose the Re-configure Instance option, you advance to the - Configuration Type dialog where you can choose the type of - installation that you wish to configure. - -2.5.4.3. Choosing a Configuration Type - - When you start the MySQL Server Instance Config Wizard for a new - MySQL installation, or choose the Re-configure Instance option for - an existing installation, you advance to the Configuration Type - dialog. - MySQL Server Instance Config Wizard: Configuration Type - - There are two configuration types available: Detailed - Configuration and Standard Configuration. The Standard - Configuration option is intended for new users who want to get - started with MySQL quickly without having to make many decisions - about server configuration. The Detailed Configuration option is - intended for advanced users who want more fine-grained control - over server configuration. - - If you are new to MySQL and need a server configured as a - single-user developer machine, the Standard Configuration should - suit your needs. Choosing the Standard Configuration option causes - the MySQL Config Wizard to set all configuration options - automatically with the exception of Service Options and Security - Options. - - The Standard Configuration sets options that may be incompatible - with systems where there are existing MySQL installations. If you - have an existing MySQL installation on your system in addition to - the installation you wish to configure, the Detailed Configuration - option is recommended. - - To complete the Standard Configuration, please refer to the - sections on Service Options and Security Options in Section - 2.5.4.10, "The Service Options Dialog," and Section 2.5.4.11, "The - Security Options Dialog," respectively. - -2.5.4.4. The Server Type Dialog - - There are three different server types available to choose from. - The server type that you choose affects the decisions that the - MySQL Server Instance Config Wizard makes with regard to memory, - disk, and processor usage. - MySQL Server Instance Config Wizard: Server Type - - * Developer Machine: Choose this option for a typical desktop - workstation where MySQL is intended only for personal use. It - is assumed that many other desktop applications are running. - The MySQL server is configured to use minimal system - resources. - - * Server Machine: Choose this option for a server machine where - the MySQL server is running alongside other server - applications such as FTP, email, and Web servers. The MySQL - server is configured to use a moderate portion of the system - resources. - - * Dedicated MySQL Server Machine: Choose this option for a - server machine that is intended to run only the MySQL server. - It is assumed that no other applications are running. The - MySQL server is configured to use all available system - resources. - -Note - - By selecting one of the preconfigured configurations, the values - and settings of various options in your my.cnf or my.ini will be - altered accordingly. The default values and options as described - in the reference manual may therefore be different to the options - and values that were created during the execution of the Config - Wizard. - -2.5.4.5. The Database Usage Dialog - - The Database Usage dialog enables you to indicate the storage - engines that you expect to use when creating MySQL tables. The - option you choose determines whether the InnoDB storage engine is - available and what percentage of the server resources are - available to InnoDB. - MySQL Server Instance Config Wizard: Usage Dialog - - * Multifunctional Database: This option enables both the InnoDB - and MyISAM storage engines and divides resources evenly - between the two. This option is recommended for users who use - both storage engines on a regular basis. - - * Transactional Database Only: This option enables both the - InnoDB and MyISAM storage engines, but dedicates most server - resources to the InnoDB storage engine. This option is - recommended for users who use InnoDB almost exclusively and - make only minimal use of MyISAM. - - * Non-Transactional Database Only: This option disables the - InnoDB storage engine completely and dedicates all server - resources to the MyISAM storage engine. This option is - recommended for users who do not use InnoDB. - - The Config Wizard uses a template to generate the server - configuration file. The Database Usage dialog sets one of the - following option strings: -Multifunctional Database: MIXED -Transactional Database Only: INNODB -Non-Transactional Database Only: MYISAM - - When these options are processed through the default template - (my-template.ini) the result is: -Multifunctional Database: -default-storage-engine=InnoDB -_myisam_pct=50 - -Transactional Database Only: -default-storage-engine=InnoDB -_myisam_pct=5 - -Non-Transactional Database Only: -default-storage-engine=MyISAM -_myisam_pct=100 -skip-innodb - - The _myisam_pct value is used to calculate the percentage of - resources dedicated to MyISAM. The remaining resources are - allocated to InnoDB. - -2.5.4.6. The InnoDB Tablespace Dialog - - Some users may want to locate the InnoDB tablespace files in a - different location than the MySQL server data directory. Placing - the tablespace files in a separate location can be desirable if - your system has a higher capacity or higher performance storage - device available, such as a RAID storage system. - MySQL Server Instance Config Wizard: InnoDB Data Tablespace - - To change the default location for the InnoDB tablespace files, - choose a new drive from the drop-down list of drive letters and - choose a new path from the drop-down list of paths. To create a - custom path, click the ... button. - - If you are modifying the configuration of an existing server, you - must click the Modify button before you change the path. In this - situation you must move the existing tablespace files to the new - location manually before starting the server. - -2.5.4.7. The Concurrent Connections Dialog - - To prevent the server from running out of resources, it is - important to limit the number of concurrent connections to the - MySQL server that can be established. The Concurrent Connections - dialog enables you to choose the expected usage of your server, - and sets the limit for concurrent connections accordingly. It is - also possible to set the concurrent connection limit manually. - MySQL Server Instance Config Wizard: Connections - - * Decision Support (DSS)/OLAP: Choose this option if your server - does not require a large number of concurrent connections. The - maximum number of connections is set at 100, with an average - of 20 concurrent connections assumed. - - * Online Transaction Processing (OLTP): Choose this option if - your server requires a large number of concurrent connections. - The maximum number of connections is set at 500. - - * Manual Setting: Choose this option to set the maximum number - of concurrent connections to the server manually. Choose the - number of concurrent connections from the drop-down box - provided, or enter the maximum number of connections into the - drop-down box if the number you desire is not listed. - -2.5.4.8. The Networking and Strict Mode Options Dialog - - Use the Networking Options dialog to enable or disable TCP/IP - networking and to configure the port number that is used to - connect to the MySQL server. - MySQL Server Instance Config Wizard: Network Configuration - - TCP/IP networking is enabled by default. To disable TCP/IP - networking, uncheck the box next to the Enable TCP/IP Networking - option. - - Port 3306 is used by default. To change the port used to access - MySQL, choose a new port number from the drop-down box or type a - new port number directly into the drop-down box. If the port - number you choose is in use, you are prompted to confirm your - choice of port number. - - Set the Server SQL Mode to either enable or disable strict mode. - Enabling strict mode (default) makes MySQL behave more like other - database management systems. If you run applications that rely on - MySQL's old "forgiving" behavior, make sure to either adapt those - applications or to disable strict mode. For more information about - strict mode, see Section 5.1.7, "Server SQL Modes." - -2.5.4.9. The Character Set Dialog - - The MySQL server supports multiple character sets and it is - possible to set a default server character set that is applied to - all tables, columns, and databases unless overridden. Use the - Character Set dialog to change the default character set of the - MySQL server. - MySQL Server Instance Config Wizard: Character Set - - * Standard Character Set: Choose this option if you want to use - latin1 as the default server character set. latin1 is used for - English and many Western European languages. - - * Best Support For Multilingualism: Choose this option if you - want to use utf8 as the default server character set. This is - a Unicode character set that can store characters from many - different languages. - - * Manual Selected Default Character Set / Collation: Choose this - option if you want to pick the server's default character set - manually. Choose the desired character set from the provided - drop-down list. - -2.5.4.10. The Service Options Dialog - - On Windows platforms, the MySQL server can be installed as a - Windows service. When installed this way, the MySQL server can be - started automatically during system startup, and even restarted - automatically by Windows in the event of a service failure. - - The MySQL Server Instance Config Wizard installs the MySQL server - as a service by default, using the service name MySQL. If you do - not wish to install the service, uncheck the box next to the - Install As Windows Service option. You can change the service name - by picking a new service name from the drop-down box provided or - by entering a new service name into the drop-down box. - -Note - - Service names can include any legal character except forward (/) - or backward (\) slashes, and must be less than 256 characters - long. - -Warning - - If you are installing multiple versions of MySQL onto the same - machine, you must choose a different service name for each version - that you install. If you do not choose a different service for - each installed version then the service manager information will - be inconsistent and this will cause problems when you try to - uninstall a previous version. - - If you have already installed multiple versions using the same - service name, you must manually edit the contents of the - HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services parameters - within the Windows registry to update the association of the - service name with the correct server version. - - Typically, when installing multiple versions you create a service - name based on the version information. For example, you might - install MySQL 5.x as mysql5, or specific versions such as MySQL - 5.1.30 as mysql50130. - - To install the MySQL server as a service but not have it started - automatically at startup, uncheck the box next to the Launch the - MySQL Server Automatically option. - -2.5.4.11. The Security Options Dialog - - The content of the security options portion of the MySQL Server - Instance Configuration Wizard will depend on whether this is a new - installation, or modifying an existing installation. - - * Setting the root password for a new installation - It is strongly recommended that you set a root password for - your MySQL server, and the MySQL Server Instance Config Wizard - requires by default that you do so. If you do not wish to set - a root password, uncheck the box next to the Modify Security - Settings option. - -Note - If you have previously installed MySQL, but not deleted the - data directory associated with the previous installation, you - may be prompted to provide the current root password. The - password will be the one configured with your old data - directory. If you do not want to use this data, or do not know - the root password, you should cancel the installation, delete - the previous installation data, and then restart the - installation process. For more information on deleting MySQL - data on Microsoft Windows, see Section 2.5.3.3, "Removing - MySQL Installed from the MSI Package." - MySQL Server Instance Config Wizard: Security - - * To set the root password, enter the desired password into both - the New root password and Confirm boxes. - Setting the root password for an existing installation - If you are modifying the configuration of an existing - configuration, or you are installing an upgrade and the MySQL - Server Instance Configuration Wizard has detected an existing - MySQL system, then you must enter the existing password for - root before changing the configuration information. - MySQL Server Instance Config Wizard: Security (Existing - Installation) - If you want to change the current root password, enter the - desired new password into both the New root password and - Confirm boxes. - - To permit root logins from across the network, check the box next - to the Enable root access from remote machines option. This - decreases the security of your root account. - - To create an anonymous user account, check the box next to the - Create An Anonymous Account option. Creating an anonymous account - can decrease server security and cause login and permission - difficulties. For this reason, it is not recommended. - -2.5.4.12. The Confirmation Dialog - - The final dialog in the MySQL Server Instance Config Wizard is the - Confirmation Dialog. To start the configuration process, click the - Execute button. To return to a previous dialog, click the Back - button. To exit the MySQL Server Instance Config Wizard without - configuring the server, click the Cancel button. - MySQL Server Instance Config Wizard: Confirmation - - After you click the Execute button, the MySQL Server Instance - Config Wizard performs a series of tasks and displays the progress - onscreen as the tasks are performed. - - The MySQL Server Instance Config Wizard first determines - configuration file options based on your choices using a template - prepared by MySQL developers and engineers. This template is named - my-template.ini and is located in your server installation - directory. - - The MySQL Config Wizard then writes these options to the - corresponding configuration file. - - If you chose to create a service for the MySQL server, the MySQL - Server Instance Config Wizard creates and starts the service. If - you are reconfiguring an existing service, the MySQL Server - Instance Config Wizard restarts the service to apply your - configuration changes. - - If you chose to set a root password, the MySQL Config Wizard - connects to the server, sets your new root password, and applies - any other security settings you may have selected. - - After the MySQL Server Instance Config Wizard has completed its - tasks, it displays a summary. Click the Finish button to exit the - MySQL Server Config Wizard. - -2.5.4.13. Creating an Instance from the Command Line - - In addition to using the GUI interface to the MySQL Server - Instance Config Wizard, you can also create instances - automatically from the command line. - - To use the MySQL Server Instance Config Wizard on the command - line, you need to use the MySQLInstanceConfig.exe command that is - installed with MySQL in the bin directory within the installation - directory. MySQLInstanceConfig.exe takes a number of command-line - arguments the set the properties that would normally be selected - through the GUI interface, and then creates a new configuration - file (my.ini) by combining these selections with a template - configuration file to produce the working configuration file. - - The main command line options are provided in the table below. - Some of the options are required, while some options are optional. - - Table 2.4. MySQL Server Instance Config Wizard Command Line - Options - Option Description - Required Parameters - -nPRODUCTNAME The name of the instance when installed - -pPATH Path of the base directory for installation. This is - equivalent to the directory when using the basedir configuration - parameter - -vVERSION The version tag to use for this installation - Action to Perform - -i Install an instance - -r Remove an instance - -s Stop an existing instance - -q Perform the operation quietly - -lFILENAME Sae the installation progress in a logfile - Config File to Use - -tFILENAME Path to the template config file that will be used to - generate the installed configuration file - -cFILENAME Path to a config file to be generated - - The -t and -c options work together to set the configuration - parameters for a new instance. The -t option specifies the - template configuration file to use as the basic configuration, - which are then merged with the configuration parameters generated - by the MySQL Server Instance Config Wizard into the configuration - file specified by the -c option. - - A sample template file, my-template.ini is provided in the - toplevel MySQL installation directory. The file contains elements - are replaced automatically by the MySQL Server Instance Config - Wizard during configuration. - - If you specify a configuration file that already exists, the - existing configuration file will be saved in the file with the - original, with the date and time added. For example, the mysql.ini - will be copied to mysql 2009-10-27 1646.ini.bak. - - The parameters that you can specify on the command line are listed - in the table below. - - Table 2.5. MySQL Server Instance Config Wizard Parameters - Parameter Description - ServiceName=$ Specify the name of the service to be created - AddBinToPath={yes | no} Specifies whether to add the binary - directory of MySQL to the standard PATH environment variable - ServerType={DEVELOPMENT | SERVER | DEDICATED} Specify the server - type. For more information, see Section 2.5.4.4, "The Server Type - Dialog" - DatabaseType={MIXED | INNODB | MYISAM} Specify the default - database type. For more information, see Section 2.5.4.5, "The - Database Usage Dialog" - ConnectionUsage={DSS | OLTP} Specify the type of connection - support, this automates the setting for the number of concurrent - connections (see the ConnectionCount parameter). For more - information, see Section 2.5.4.7, "The Concurrent Connections - Dialog" - ConnectionCount=# Specify the number of concurrent connections to - support. For more information, see Section 2.5.4.4, "The Server - Type Dialog" - SkipNetworking={yes | no} Specify whether network support should - be supported. Specifying yes disables network access altogether - Port=# Specify the network port number to use for network - connections. For more information, see Section 2.5.4.8, "The - Networking and Strict Mode Options Dialog" - StrictMode={yes | no} Specify whether to use the strict SQL mode. - For more information, see Section 2.5.4.8, "The Networking and - Strict Mode Options Dialog" - Charset=$ Specify the default character set. For more information, - see Section 2.5.4.9, "The Character Set Dialog" - RootPassword=$ Specify the root password - RootCurrentPassword=$ Specify the current root password then - stopping or reconfiguring an existing service - -Note - - When specifying options on the command line, you can enclose the - entire command-line option and the value you are specifying using - double quotation marks. This enables you to use spaces in the - options. For example, "-cC:\mysql.ini". - - The following command installs a MySQL Server 5.1 instance from - the directory C:\Program Files\MySQL\MySQL Server 5.1 using the - service name MySQL51 and setting the root password to 1234. -shell> MySQLInstanceConfig.exe -i -q "-lC:\mysql_install_log.txt" » - "-nMySQL Server 5.1" "-pC:\Program Files\MySQL\MySQL Server 5.1" - -v5.1.39 » - "-tmy-template.ini" "-cC:\mytest.ini" ServerType=DEVELOPMENT Datab -aseType=MIXED » - ConnectionUsage=DSS Port=3311 ServiceName=MySQL51 RootPassword=123 -4 - - In the above example, a log file will be generated in - mysql_install_log.txt containing the information about the - instance creation process. The log file generated by the above - example is shown below: -Welcome to the MySQL Server Instance Configuration Wizard 1.0.16.0 -Date: 2009-10-27 17:07:21 - -Installing service ... - -Product Name: MySQL Server 5.1 -Version: 5.1.39 -Installation Path: C:\Program Files\MySQL\MySQL Server 5.1\ - -Creating configuration file C:\mytest.ini using template my-template. -ini. -Options: -DEVELOPMENT -MIXED -DSS -STRICTMODE - -Variables: -port: 3311 -default-character-set: latin1 -basedir: "C:/Program Files/MySQL/MySQL Server 5.1/" -datadir: "C:/Program Files/MySQL/MySQL Server 5.1/Data/" - - -Creating Windows service entry. -Service name: "MySQL51" -Parameters: "C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld" -- -defaults-file="C:\mytest.ini" MySQL51. -Windows service MySQL51 installed. - - When using the command-line, the return values in the following - table indicate an error performing the specified option. - - Table 2.6. Return Value from MySQL Server Instance Config Wizard - Value Description - 2 Configuration template file cannot be found - 3 The Windows service entry cannot be created - 4 Could not connect to the Service Control Manager - 5 The MySQL service cannot be started - 6 The MySQL service cannot be stopped - 7 The security settings cannot be applied - 8 The configuration file cannot be written - 9 The Windows service entry cannot be removed - - You can perform an installation of MySQL automatically using the - MSI packe. For more information, see Section 2.5.3.2, "Installing - MySQL Automatically using MSI." - -2.5.5. Installing MySQL from a noinstall Zip Archive - - Users who are installing from the noinstall package can use the - instructions in this section to manually install MySQL. The - process for installing MySQL from a Zip archive is as follows: - - 1. Extract the archive to the desired install directory - - 2. Create an option file - - 3. Choose a MySQL server type - - 4. Start the MySQL server - - 5. Secure the default user accounts - - This process is described in the sections that follow. - -2.5.5.1. Extracting the Install Archive - - To install MySQL manually, do the following: - - 1. If you are upgrading from a previous version please refer to - Section 2.5.7, "Upgrading MySQL on Windows," before beginning - the upgrade process. - - 2. Make sure that you are logged in as a user with administrator - privileges. - - 3. Choose an installation location. Traditionally, the MySQL - server is installed in C:\mysql. The MySQL Installation Wizard - installs MySQL under C:\Program Files\MySQL. If you do not - install MySQL at C:\mysql, you must specify the path to the - install directory during startup or in an option file. See - Section 2.5.5.2, "Creating an Option File." - - 4. Extract the install archive to the chosen installation - location using your preferred Zip archive tool. Some tools may - extract the archive to a folder within your chosen - installation location. If this occurs, you can move the - contents of the subfolder into the chosen installation - location. - -2.5.5.2. Creating an Option File - - If you need to specify startup options when you run the server, - you can indicate them on the command line or place them in an - option file. For options that are used every time the server - starts, you may find it most convenient to use an option file to - specify your MySQL configuration. This is particularly true under - the following circumstances: - - * The installation or data directory locations are different - from the default locations (C:\Program Files\MySQL\MySQL - Server 5.1 and C:\Program Files\MySQL\MySQL Server 5.1\data). - - * You need to tune the server settings, such as memory, cache, - or InnoDB configuration information. - - When the MySQL server starts on Windows, it looks for option files - in several locations, such as the Windows directory, C:\, and the - MySQL installation directory (for the full list of locations, see - Section 4.2.3.3, "Using Option Files"). The Windows directory - typically is named something like C:\WINDOWS. You can determine - its exact location from the value of the WINDIR environment - variable using the following command: -C:\> echo %WINDIR% - - MySQL looks for options in each location first in the my.ini file, - and then in the my.cnf file. However, to avoid confusion, it is - best if you use only one file. If your PC uses a boot loader where - C: is not the boot drive, your only option is to use the my.ini - file. Whichever option file you use, it must be a plain text file. - - You can also make use of the example option files included with - your MySQL distribution; see Section 4.2.3.3.2, "Preconfigured - Option Files." - - An option file can be created and modified with any text editor, - such as Notepad. For example, if MySQL is installed in E:\mysql - and the data directory is in E:\mydata\data, you can create an - option file containing a [mysqld] section to specify values for - the basedir and datadir options: -[mysqld] -# set basedir to your installation path -basedir=E:/mysql -# set datadir to the location of your data directory -datadir=E:/mydata/data - - Note that Windows path names are specified in option files using - (forward) slashes rather than backslashes. If you do use - backslashes, double them: -[mysqld] -# set basedir to your installation path -basedir=E:\\mysql -# set datadir to the location of your data directory -datadir=E:\\mydata\\data - - The rules for use of backslash in option file values are given in - Section 4.2.3.3, "Using Option Files." - - MySQL Enterprise For expert advice on the start-up options - appropriate to your circumstances, subscribe to the MySQL - Enterprise Monitor. For more information, see - http://www.mysql.com/products/enterprise/advisors.html. - - In MySQL 5.1.23 and earlier, the MySQL installer places the data - directory directly under the directory where you install MySQL. On - MySQL 5.1.24 and later, the data directory is located within the - AppData directory for the user running MySQL. - - If you would like to use a data directory in a different location, - you should copy the entire contents of the data directory to the - new location. For example, if you want to use E:\mydata as the - data directory instead, you must do two things: - - 1. Move the entire data directory and all of its contents from - the default location (for example C:\Program Files\MySQL\MySQL - Server 5.1\data) to E:\mydata. - - 2. Use a --datadir option to specify the new data directory - location each time you start the server. - -2.5.5.3. Selecting a MySQL Server Type - - The following table shows the available servers for Windows in - MySQL 5.1.20 and earlier. - Binary Description - mysqld-nt Optimized binary with named-pipe support - mysqld Optimized binary without named-pipe support - mysqld-debug Like mysqld-nt, but compiled with full debugging and - automatic memory allocation checking - - The following table shows the available servers for Windows in - MySQL 5.1.21 and later. - Binary Description - mysqld Optimized binary with named-pipe support - mysqld-debug Like mysqld, but compiled with full debugging and - automatic memory allocation checking - - All of the preceding binaries are optimized for modern Intel - processors, but should work on any Intel i386-class or higher - processor. - - Each of the servers in a distribution support the same set of - storage engines. The SHOW ENGINES statement displays which engines - a given server supports. - - All Windows MySQL 5.1 servers have support for symbolic linking of - database directories. - - MySQL supports TCP/IP on all Windows platforms. MySQL servers on - Windows support named pipes as indicated in the following list. - However, the default is to use TCP/IP regardless of platform. - (Named pipes are slower than TCP/IP in many Windows - configurations.) - - Use of named pipes is subject to these conditions: - - * Named pipes are enabled only if you start the server with the - --enable-named-pipe option. It is necessary to use this option - explicitly because some users have experienced problems with - shutting down the MySQL server when named pipes were used. - - * For MySQL 5.1.20 and earlier, named-pipe connections are - permitted only by the mysqld-nt and mysqld-debug servers. For - MySQL 5.1.21 and later, the mysqld and mysqld-debug servers - both contain support for named-pipe connections. - -Note - - Most of the examples in this manual use mysqld as the server name. - If you choose to use a different server, such as mysqld-nt or - mysqld-debug, make the appropriate substitutions in the commands - that are shown in the examples. - -2.5.5.4. Starting the Server for the First Time - - This section gives a general overview of starting the MySQL - server. The following sections provide more specific information - for starting the MySQL server from the command line or as a - Windows service. - - The information here applies primarily if you installed MySQL - using the Noinstall version, or if you wish to configure and test - MySQL manually rather than with the GUI tools. - - The examples in these sections assume that MySQL is installed - under the default location of C:\Program Files\MySQL\MySQL Server - 5.1. Adjust the path names shown in the examples if you have MySQL - installed in a different location. - - Clients have two options. They can use TCP/IP, or they can use a - named pipe if the server supports named-pipe connections. - - MySQL for Windows also supports shared-memory connections if the - server is started with the --shared-memory option. Clients can - connect through shared memory by using the --protocol=MEMORY - option. - - For information about which server binary to run, see Section - 2.5.5.3, "Selecting a MySQL Server Type." - - Testing is best done from a command prompt in a console window (or - "DOS window"). In this way you can have the server display status - messages in the window where they are easy to see. If something is - wrong with your configuration, these messages make it easier for - you to identify and fix any problems. - - To start the server, enter this command: -C:\> "C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld" --console - - For a server that includes InnoDB support, you should see the - messages similar to those following as it starts (the path names - and sizes may differ): -InnoDB: The first specified datafile c:\ibdata\ibdata1 did not exist: -InnoDB: a new database to be created! -InnoDB: Setting file c:\ibdata\ibdata1 size to 209715200 -InnoDB: Database physically writes the file full: wait... -InnoDB: Log file c:\iblogs\ib_logfile0 did not exist: new to be creat -ed -InnoDB: Setting log file c:\iblogs\ib_logfile0 size to 31457280 -InnoDB: Log file c:\iblogs\ib_logfile1 did not exist: new to be creat -ed -InnoDB: Setting log file c:\iblogs\ib_logfile1 size to 31457280 -InnoDB: Log file c:\iblogs\ib_logfile2 did not exist: new to be creat -ed -InnoDB: Setting log file c:\iblogs\ib_logfile2 size to 31457280 -InnoDB: Doublewrite buffer not found: creating new -InnoDB: Doublewrite buffer created -InnoDB: creating foreign key constraint system tables -InnoDB: foreign key constraint system tables created -011024 10:58:25 InnoDB: Started - - When the server finishes its startup sequence, you should see - something like this, which indicates that the server is ready to - service client connections: -mysqld: ready for connections -Version: '5.1.50' socket: '' port: 3306 - - The server continues to write to the console any further - diagnostic output it produces. You can open a new console window - in which to run client programs. - - If you omit the --console option, the server writes diagnostic - output to the error log in the data directory (C:\Program - Files\MySQL\MySQL Server 5.1\data by default). The error log is - the file with the .err extension. - -Note - - The accounts that are listed in the MySQL grant tables initially - have no passwords. After starting the server, you should set up - passwords for them using the instructions in Section 2.13, - "Post-Installation Setup and Testing." - -2.5.5.5. Starting MySQL from the Windows Command Line - - The MySQL server can be started manually from the command line. - This can be done on any version of Windows. - - To start the mysqld server from the command line, you should start - a console window (or "DOS window") and enter this command: -C:\> "C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld" - - The path to mysqld may vary depending on the install location of - MySQL on your system. - - You can stop the MySQL server by executing this command: -C:\> "C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqladmin" -u root - shutdown - -Note - - If the MySQL root user account has a password, you need to invoke - mysqladmin with the -p option and supply the password when - prompted. - - This command invokes the MySQL administrative utility mysqladmin - to connect to the server and tell it to shut down. The command - connects as the MySQL root user, which is the default - administrative account in the MySQL grant system. Note that users - in the MySQL grant system are wholly independent from any login - users under Windows. - - If mysqld doesn't start, check the error log to see whether the - server wrote any messages there to indicate the cause of the - problem. The error log is located in the C:\Program - Files\MySQL\MySQL Server 5.1\data directory. It is the file with a - suffix of .err. You can also try to start the server as mysqld - --console; in this case, you may get some useful information on - the screen that may help solve the problem. - - The last option is to start mysqld with the --standalone and - --debug options. In this case, mysqld writes a log file - C:\mysqld.trace that should contain the reason why mysqld doesn't - start. See MySQL Internals: Porting - (http://forge.mysql.com/wiki/MySQL_Internals_Porting). - - Use mysqld --verbose --help to display all the options that mysqld - supports. - -2.5.5.6. Starting MySQL as a Windows Service - - On Windows, the recommended way to run MySQL is to install it as a - Windows service, whereby MySQL starts and stops automatically when - Windows starts and stops. A MySQL server installed as a service - can also be controlled from the command line using NET commands, - or with the graphical Services utility. Generally, to install - MySQL as a Windows service you should be logged in using an - account that has administrator rights. - - The Services utility (the Windows Service Control Manager) can be - found in the Windows Control Panel (under Administrative Tools on - Windows 2000, XP, Vista and Server 2003). To avoid conflicts, it - is advisable to close the Services utility while performing server - installation or removal operations from the command line. - - Before installing MySQL as a Windows service, you should first - stop the current server if it is running by using the following - command: -C:\> "C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqladmin" - -u root shutdown - -Note - - If the MySQL root user account has a password, you need to invoke - mysqladmin with the -p option and supply the password when - prompted. - - This command invokes the MySQL administrative utility mysqladmin - to connect to the server and tell it to shut down. The command - connects as the MySQL root user, which is the default - administrative account in the MySQL grant system. Note that users - in the MySQL grant system are wholly independent from any login - users under Windows. - - Install the server as a service using this command: -C:\> "C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld" --install - - The service-installation command does not start the server. - Instructions for that are given later in this section. - - To make it easier to invoke MySQL programs, you can add the path - name of the MySQL bin directory to your Windows system PATH - environment variable: - - * On the Windows desktop, right-click the My Computer icon, and - select Properties. - - * Next select the Advanced tab from the System Properties menu - that appears, and click the Environment Variables button. - - * Under System Variables, select Path, and then click the Edit - button. The Edit System Variable dialogue should appear. - - * Place your cursor at the end of the text appearing in the - space marked Variable Value. (Use the End key to ensure that - your cursor is positioned at the very end of the text in this - space.) Then enter the complete path name of your MySQL bin - directory (for example, C:\Program Files\MySQL\MySQL Server - 5.1\bin), Note that there should be a semicolon separating - this path from any values present in this field. Dismiss this - dialogue, and each dialogue in turn, by clicking OK until all - of the dialogues that were opened have been dismissed. You - should now be able to invoke any MySQL executable program by - typing its name at the DOS prompt from any directory on the - system, without having to supply the path. This includes the - servers, the mysql client, and all MySQL command-line - utilities such as mysqladmin and mysqldump. - You should not add the MySQL bin directory to your Windows - PATH if you are running multiple MySQL servers on the same - machine. - -Warning - - You must exercise great care when editing your system PATH by - hand; accidental deletion or modification of any portion of the - existing PATH value can leave you with a malfunctioning or even - unusable system. - - The following additional arguments can be used in MySQL 5.1 when - installing the service: - - * You can specify a service name immediately following the - --install option. The default service name is MySQL. - - * If a service name is given, it can be followed by a single - option. By convention, this should be - --defaults-file=file_name to specify the name of an option - file from which the server should read options when it starts. - The use of a single option other than --defaults-file is - possible but discouraged. --defaults-file is more flexible - because it enables you to specify multiple startup options for - the server by placing them in the named option file. - - * You can also specify a --local-service option following the - service name. This causes the server to run using the - LocalService Windows account that has limited system - privileges. This account is available only for Windows XP or - newer. If both --defaults-file and --local-service are given - following the service name, they can be in any order. - - For a MySQL server that is installed as a Windows service, the - following rules determine the service name and option files that - the server uses: - - * If the service-installation command specifies no service name - or the default service name (MySQL) following the --install - option, the server uses the a service name of MySQL and reads - options from the [mysqld] group in the standard option files. - - * If the service-installation command specifies a service name - other than MySQL following the --install option, the server - uses that service name. It reads options from the [mysqld] - group and the group that has the same name as the service in - the standard option files. This enables you to use the - [mysqld] group for options that should be used by all MySQL - services, and an option group with the service name for use by - the server installed with that service name. - - * If the service-installation command specifies a - --defaults-file option after the service name, the server - reads options only from the [mysqld] group of the named file - and ignores the standard option files. - - As a more complex example, consider the following command: -C:\> "C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld" - --install MySQL --defaults-file=C:\my-opts.cnf - - Here, the default service name (MySQL) is given after the - --install option. If no --defaults-file option had been given, - this command would have the effect of causing the server to read - the [mysqld] group from the standard option files. However, - because the --defaults-file option is present, the server reads - options from the [mysqld] option group, and only from the named - file. - - You can also specify options as Start parameters in the Windows - Services utility before you start the MySQL service. - - Once a MySQL server has been installed as a service, Windows - starts the service automatically whenever Windows starts. The - service also can be started immediately from the Services utility, - or by using a NET START MySQL command. The NET command is not case - sensitive. - - When run as a service, mysqld has no access to a console window, - so no messages can be seen there. If mysqld does not start, check - the error log to see whether the server wrote any messages there - to indicate the cause of the problem. The error log is located in - the MySQL data directory (for example, C:\Program - Files\MySQL\MySQL Server 5.1\data). It is the file with a suffix - of .err. - - When a MySQL server has been installed as a service, and the - service is running, Windows stops the service automatically when - Windows shuts down. The server also can be stopped manually by - using the Services utility, the NET STOP MySQL command, or the - mysqladmin shutdown command. - - You also have the choice of installing the server as a manual - service if you do not wish for the service to be started - automatically during the boot process. To do this, use the - --install-manual option rather than the --install option: -C:\> "C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld" --install-m -anual - - To remove a server that is installed as a service, first stop it - if it is running by executing NET STOP MySQL. Then use the - --remove option to remove it: -C:\> "C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqld" --remove - - If mysqld is not running as a service, you can start it from the - command line. For instructions, see Section 2.5.5.5, "Starting - MySQL from the Windows Command Line." - - Please see Section 2.5.6, "Troubleshooting a MySQL Installation - Under Windows," if you encounter difficulties during installation. - -2.5.5.7. Testing The MySQL Installation - - You can test whether the MySQL server is working by executing any - of the following commands: -C:\> "C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqlshow" -C:\> "C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqlshow" -u root -mysql -C:\> "C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqladmin" version - status proc -C:\> "C:\Program Files\MySQL\MySQL Server 5.1\bin\mysql" test - -Note - - By default, mysqlshow will try to connect using the ODBC user. - This user is not created by default. You should specify a valid - user, or root with the right password to check the operation of - the server. - - If mysqld is slow to respond to TCP/IP connections from client - programs, there is probably a problem with your DNS. In this case, - start mysqld with the --skip-name-resolve option and use only - localhost and IP numbers in the Host column of the MySQL grant - tables. - - You can force a MySQL client to use a named-pipe connection rather - than TCP/IP by specifying the --pipe or --protocol=PIPE option, or - by specifying . (period) as the host name. Use the --socket option - to specify the name of the pipe if you do not want to use the - default pipe name. - - Note that if you have set a password for the root account, deleted - the anonymous account, or created a new user account, then you - must use the appropriate -u and -p options with the commands shown - above in order to connect with the MySQL Server. See Section - 4.2.2, "Connecting to the MySQL Server." - - For more information about mysqlshow, see Section 4.5.6, - "mysqlshow --- Display Database, Table, and Column Information." - -2.5.6. Troubleshooting a MySQL Installation Under Windows - - When installing and running MySQL for the first time, you may - encounter certain errors that prevent the MySQL server from - starting. The purpose of this section is to help you diagnose and - correct some of these errors. - - Your first resource when troubleshooting server issues is the - error log. The MySQL server uses the error log to record - information relevant to the error that prevents the server from - starting. The error log is located in the data directory specified - in your my.ini file. The default data directory location is - C:\Program Files\MySQL\MySQL Server 5.1\data. See Section 5.2.2, - "The Error Log." - - Another source of information regarding possible errors is the - console messages displayed when the MySQL service is starting. Use - the NET START MySQL command from the command line after installing - mysqld as a service to see any error messages regarding the - starting of the MySQL server as a service. See Section 2.5.5.6, - "Starting MySQL as a Windows Service." - - The following examples show other common error messages you may - encounter when installing MySQL and starting the server for the - first time: - - * If the MySQL server cannot find the mysql privileges database - or other critical files, you may see these messages: -System error 1067 has occurred. -Fatal error: Can't open privilege tables: Table 'mysql.host' doesn't -exist - These messages often occur when the MySQL base or data - directories are installed in different locations than the - default locations (C:\Program Files\MySQL\MySQL Server 5.1 and - C:\Program Files\MySQL\MySQL Server 5.1\data, respectively). - This situation may occur when MySQL is upgraded and installed - to a new location, but the configuration file is not updated - to reflect the new location. In addition, there may be old and - new configuration files that conflict. Be sure to delete or - rename any old configuration files when upgrading MySQL. - If you have installed MySQL to a directory other than - C:\Program Files\MySQL\MySQL Server 5.1, you need to ensure - that the MySQL server is aware of this through the use of a - configuration (my.ini) file. The my.ini file needs to be - located in your Windows directory, typically C:\WINDOWS. You - can determine its exact location from the value of the WINDIR - environment variable by issuing the following command from the - command prompt: -C:\> echo %WINDIR% - An option file can be created and modified with any text - editor, such as Notepad. For example, if MySQL is installed in - E:\mysql and the data directory is D:\MySQLdata, you can - create the option file and set up a [mysqld] section to - specify values for the basedir and datadir options: -[mysqld] -# set basedir to your installation path -basedir=E:/mysql -# set datadir to the location of your data directory -datadir=D:/MySQLdata - Note that Windows path names are specified in option files - using (forward) slashes rather than backslashes. If you do use - backslashes, double them: -[mysqld] -# set basedir to your installation path -basedir=C:\\Program Files\\MySQL\\MySQL Server 5.1 -# set datadir to the location of your data directory -datadir=D:\\MySQLdata - The rules for use of backslash in option file values are given - in Section 4.2.3.3, "Using Option Files." - If you change the datadir value in your MySQL configuration - file, you must move the contents of the existing MySQL data - directory before restarting the MySQL server. - See Section 2.5.5.2, "Creating an Option File." - - * If you reinstall or upgrade MySQL without first stopping and - removing the existing MySQL service and install MySQL using - the MySQL Config Wizard, you may see this error: -Error: Cannot create Windows service for MySql. Error: 0 - This occurs when the Config Wizard tries to install the - service and finds an existing service with the same name. - One solution to this problem is to choose a service name other - than mysql when using the configuration wizard. This enables - the new service to be installed correctly, but leaves the - outdated service in place. Although this is harmless, it is - best to remove old services that are no longer in use. - To permanently remove the old mysql service, execute the - following command as a user with administrative privileges, on - the command-line: -C:\> sc delete mysql -[SC] DeleteService SUCCESS - If the sc utility is not available for your version of - Windows, download the delsrv utility from - http://www.microsoft.com/windows2000/techinfo/reskit/tools/exi - sting/delsrv-o.asp and use the delsrv mysql syntax. - -2.5.7. Upgrading MySQL on Windows - - This section lists some of the steps you should take when - upgrading MySQL on Windows. - - 1. Review Section 2.4.1, "Upgrading MySQL," for additional - information on upgrading MySQL that is not specific to - Windows. - - 2. You should always back up your current MySQL installation - before performing an upgrade. See Section 6.2, "Database - Backup Methods." - - 3. Download the latest Windows distribution of MySQL from - http://dev.mysql.com/downloads/. - - 4. Before upgrading MySQL, you must stop the server. If the - server is installed as a service, stop the service with the - following command from the command prompt: -C:\> NET STOP MySQL - If you are not running the MySQL server as a service, use the - following command to stop it: -C:\> "C:\Program Files\MySQL\MySQL Server 5.1\bin\mysqladmin" -u root - shutdown - -Note - If the MySQL root user account has a password, you need to - invoke mysqladmin with the -p option and supply the password - when prompted. - - 5. When upgrading to MySQL 5.1 from a version previous to 4.1.5, - or when upgrading from a version of MySQL installed from a Zip - archive to a version of MySQL installed with the MySQL - Installation Wizard, you must manually remove the previous - installation and MySQL service (if the server is installed as - a service). - To remove the MySQL service, use the following command: -C:\> C:\mysql\bin\mysqld --remove - If you do not remove the existing service, the MySQL - Installation Wizard may fail to properly install the new MySQL - service. - - 6. When upgrading from MySQL 5.1.23 to MySQL 5.1.24, the change - in the default location of the data directory from a directory - within the MySQL installation to the AppData folder means that - you must manually copy the data files from your old - installation to the new location. - - 7. If you are using the MySQL Installation Wizard, start the - wizard as described in Section 2.5.3.1, "Using the MySQL - Installation Wizard." - - 8. If you are installing MySQL from a Zip archive, extract the - archive. You may either overwrite your existing MySQL - installation (usually located at C:\mysql), or install it into - a different directory, such as C:\mysql5. Overwriting the - existing installation is recommended. - - 9. If you were running MySQL as a Windows service and you had to - remove the service earlier in this procedure, reinstall the - service. (See Section 2.5.5.6, "Starting MySQL as a Windows - Service.") - 10. Restart the server. For example, use NET START MySQL if you - run MySQL as a service, or invoke mysqld directly otherwise. - 11. If you encounter errors, see Section 2.5.6, "Troubleshooting a - MySQL Installation Under Windows." - -2.5.8. Windows Post-Installation Procedures - - On Windows, you need not create the data directory and the grant - tables. MySQL Windows distributions include the grant tables with - a set of preinitialized accounts in the mysql database under the - data directory. It is unnecessary to run the mysql_install_db - script that is used on Unix. Regarding passwords, if you installed - MySQL using the Windows Installation Wizard, you may have already - assigned passwords to the accounts. (See Section 2.5.3.1, "Using - the MySQL Installation Wizard.") Otherwise, use the - password-assignment procedure given in Section 2.13.2, "Securing - the Initial MySQL Accounts." - - Before setting up passwords, you might want to try running some - client programs to make sure that you can connect to the server - and that it is operating properly. Make sure that the server is - running (see Section 2.5.5.4, "Starting the Server for the First - Time"), and then issue the following commands to verify that you - can retrieve information from the server. You may need to specify - directory different from C:\mysql\bin on the command line. If you - used the Windows Installation Wizard, the default directory is - C:\Program Files\MySQL\MySQL Server 5.1, and the mysql and - mysqlshow client programs are in C:\Program Files\MySQL\MySQL - Server 5.1\bin. See Section 2.5.3.1, "Using the MySQL Installation - Wizard," for more information. - - Use mysqlshow to see what databases exist: -C:\> C:\mysql\bin\mysqlshow -+--------------------+ -| Databases | -+--------------------+ -| information_schema | -| mysql | -| test | -+--------------------+ - - The list of installed databases may vary, but will always include - the minimum of mysql and information_schema. In most cases, the - test database will also be installed automatically. - - The preceding command (and commands for other MySQL programs such - as mysql) may not work if the correct MySQL account does not - exist. For example, the program may fail with an error, or you may - not be able to view all databases. If you installed using the MSI - packages and used the MySQL Server Instance Config Wizard, then - the root user will have been created automatically with the - password you supplied. In this case, you should use the -u root - and -p options. (You will also need to use the -u root and -p - options if you have already secured the initial MySQL accounts.) - With -p, you will be prompted for the root password. For example: -C:\> C:\mysql\bin\mysqlshow -u root -p -Enter password: (enter root password here) -+--------------------+ -| Databases | -+--------------------+ -| information_schema | -| mysql | -| test | -+--------------------+ - - If you specify a database name, mysqlshow displays a list of the - tables within the database: -C:\> C:\mysql\bin\mysqlshow mysql -Database: mysql -+---------------------------+ -| Tables | -+---------------------------+ -| columns_priv | -| db | -| event | -| func | -| help_category | -| help_keyword | -| help_relation | -| help_topic | -| host | -| plugin | -| proc | -| procs_priv | -| servers | -| tables_priv | -| time_zone | -| time_zone_leap_second | -| time_zone_name | -| time_zone_transition | -| time_zone_transition_type | -| user | -+---------------------------+ - - Use the mysql program to select information from a table in the - mysql database: -C:\> C:\mysql\bin\mysql -e "SELECT Host,Db,User FROM mysql.db" -+------+--------+------+ -| host | db | user | -+------+--------+------+ -| % | test | | -| % | test_% | | -+------+--------+------+ - - For more information about mysqlshow and mysql, see Section 4.5.6, - "mysqlshow --- Display Database, Table, and Column Information," - and Section 4.5.1, "mysql --- The MySQL Command-Line Tool." - - If you are running a version of Windows that supports services, - you can set up the MySQL server to run automatically when Windows - starts. See Section 2.5.5.6, "Starting MySQL as a Windows - Service." - -2.5.9. Installing MySQL from Source on Windows - - These instructions describe how to build binaries from source for - MySQL 5.1 on Windows. Instructions are provided for building - binaries from a standard source distribution or from the Bazaar - tree that contains the latest development source. - -Note - - The instructions here are strictly for users who want to test - MySQL on Microsoft Windows from the latest source distribution or - from the Bazaar tree. For production use, we do not advise using a - MySQL server built by yourself from source. Normally, it is best - to use precompiled binary distributions of MySQL that are built - specifically for optimal performance on Windows by Oracle - Corporation. Instructions for installing binary distributions are - available in Section 2.5, "Installing MySQL on Windows." - - To build MySQL on Windows from source, you must satisfy the - following system, compiler, and resource requirements: - - * Windows 2000, Windows XP, or newer version. - Windows Vista is supported when using Visual Studio 2005 - provided you have installed the following updates: - - + Microsoft Visual Studio 2005 Professional Edition - ENU - Service Pack 1 (KB926601) - (http://support.microsoft.com/?kbid=926601) - - + Security Update for Microsoft Visual Studio 2005 - Professional Edition - ENU (KB937061) - (http://support.microsoft.com/?kbid=937061) - - + Update for Microsoft Visual Studio 2005 Professional - Edition - ENU (KB932232) - (http://support.microsoft.com/?kbid=932232) - - * CMake, which can be downloaded from http://www.cmake.org. - After installing, modify your path to include the cmake - binary. - - * Microsoft Visual C++ 2005 Express Edition, Visual Studio .Net - 2003 (7.1), or Visual Studio 2005 (8.0) compiler system. - - * If you are using Visual C++ 2005 Express Edition, you must - also install an appropriate Platform SDK. More information and - links to downloads for various Windows platforms is available - from - http://www.microsoft.com/downloads/details.aspx?familyid=0baf2 - b35-c656-4969-ace8-e4c0c0716adb. - - * If you are compiling from a Bazaar tree or making changes to - the parser, you need bison for Windows, which can be - downloaded from - http://gnuwin32.sourceforge.net/packages/bison.htm. Download - the package labeled "Complete package, excluding sources". - After installing the package, modify your path to include the - bison binary and ensure that this binary is accessible from - Visual Studio. - - * Cygwin might be necessary if you want to run the test script - or package the compiled binaries and support files into a Zip - archive. (Cygwin is needed only to test or package the - distribution, not to build it.) Cygwin is available from - http://cygwin.com. - - * 3GB to 5GB of disk space. - - The exact system requirements for Visual Studio can be found here: - http://msdn.microsoft.com/vstudio/Previous/2003/sysreqs/default.as - px and - http://msdn.microsoft.com/vstudio/products/sysreqs/default.aspx - - You also need a MySQL source distribution for Windows, which can - be obtained two ways: - - * Obtain a source distribution packaged by Oracle Corporation. - These are available from http://dev.mysql.com/downloads/. - - * Package a source distribution yourself from the latest Bazaar - developer source tree. For instructions on pulling the latest - source files, see Section 2.3.3, "Installing from the - Development Source Tree." - - If you find something not working as expected, or you have - suggestions about ways to improve the current build process on - Windows, please send a message to the win32 mailing list. See - Section 1.6.1, "MySQL Mailing Lists." - -2.5.9.1. Building MySQL from Source Using CMake and Visual Studio - - You can build MySQL on Windows by using a combination of cmake and - Microsoft Visual Studio .NET 2003 (7.1), Microsoft Visual Studio - 2005 (8.0), Microsoft Visual Studio 2008 (9.0) or Microsoft Visual - C++ 2005 Express Edition. You must have the appropriate Microsoft - Platform SDK installed. - -Note - - To compile from the source code on Windows you must use the - standard source distribution (for example, mysql-5.1.50.tar.gz). - You build from the same distribution as used to build MySQL on - Unix, Linux and other platforms. Do not use the Windows Source - distributions as they do not contain the necessary configuration - script and other files. - - Follow this procedure to build MySQL: - - 1. If you are installing from a packaged source distribution, - create a work directory (for example, C:\workdir), and unpack - the source distribution there using WinZip or another Windows - tool that can read .zip files. This directory is the work - directory in the following instructions. - -Note - You must run the commands in the win directory from the - top-level source directory. Do not change into the win - directory, as the commands will not be executed correctly. - - 2. Start a command shell. If you have not configured the PATH and - other environment variables for all command shells, you may be - able to start a command shell from the Start Menu within the - Windows Visual Studio menu that contains the necessary - environment changes. - - 3. Within the command shell, navigate to the work directory and - run the following command: -C:\workdir>win\configure.js options - If you have associated the .js file extension with an - application such as a text editor, then you may need to use - the following command to force configure.js to be executed as - a script: -C:\workdir>cscript win\configure.js options - These options are available for configure.js: - - + WITH_INNOBASE_STORAGE_ENGINE: Enable the InnoDB storage - engine. - - + WITH_PARTITION_STORAGE_ENGINE: Enable user-defined - partitioning. - - + WITH_ARCHIVE_STORAGE_ENGINE: Enable the ARCHIVE storage - engine. - - + WITH_BLACKHOLE_STORAGE_ENGINE: Enable the BLACKHOLE - storage engine. - - + WITH_EXAMPLE_STORAGE_ENGINE: Enable the EXAMPLE storage - engine. - - + WITH_FEDERATED_STORAGE_ENGINE: Enable the FEDERATED - storage engine. - - + WITH_NDBCLUSTER_STORAGE_ENGINE: Enable the NDBCLUSTER - storage engine in the MySQL server; cause binaries for - the MySQL Cluster management and data node, management - client, and other programs to be built. - This option is supported only in MySQL Cluster NDB 7.0 - (NDBCLUSTER storage engine versions 6.4.0 and later) - using the MySQL Cluster sources. It cannot be used to - enable clustering support in other MySQL source trees or - distributions. - - + MYSQL_SERVER_SUFFIX=suffix: Server suffix, default none. - - + COMPILATION_COMMENT=comment: Server comment, default - "Source distribution". - - + MYSQL_TCP_PORT=port: Server port, default 3306. - - + DISABLE_GRANT_OPTIONS: Disables the --bootstrap, - --skip-grant-tables, and --init-file options for mysqld. - This option is available as of MySQL 5.1.15. - For example (type the command on one line): -C:\workdir>win\configure.js WITH_INNOBASE_STORAGE_ENGINE - WITH_PARTITION_STORAGE_ENGINE MYSQL_SERVER_SUFFIX=-pro - - 4. From the work directory, execute the win\build-vs9.bat - (Windows Visual Studio 2008), win\build-vs8.bat (Windows - Visual Studio 2005), or win\build-vs71.bat (Windows Visual - Stidion 2003) script, depending on the version of Visual - Studio you have installed. The script invokes CMake, which - generates the mysql.sln solution file. - You can also use the corresponding 64-bit file (for example - win\build-vs8_x64.bat or win\build-vs9_x64.bat) to build the - 64-bit version of MySQL. However, you cannot build the 64-bit - version with Visual Studio Express Edition. You must use - Visual Studio 2005 (8.0) or higher. - - 5. From the work directory, open the generated mysql.sln file - with Visual Studio and select the proper configuration using - the Configuration menu. The menu provides Debug, Release, - RelwithDebInfo, MinRelInfo options. Then select Solution > - Build to build the solution. - Remember the configuration that you use in this step. It is - important later when you run the test script because that - script needs to know which configuration you used. - - 6. Test the server. The server built using the preceding - instructions expects that the MySQL base directory and data - directory are C:\mysql and C:\mysql\data by default. If you - want to test your server using the source tree root directory - and its data directory as the base directory and data - directory, you need to tell the server their path names. You - can either do this on the command line with the --basedir and - --datadir options, or by placing appropriate options in an - option file. (See Section 4.2.3.3, "Using Option Files.") If - you have an existing data directory elsewhere that you want to - use, you can specify its path name instead. - When the server is running in standalone fashion or as a - service based on your configuration, try to connect to it from - the mysql interactive command-line utility. - You can also run the standard test script, mysql-test-run.pl. - This script is written in Perl, so you'll need either Cygwin - or ActiveState Perl to run it. You may also need to install - the modules required by the script. To run the test script, - change location into the mysql-test directory under the work - directory, set the MTR_VS_CONFIG environment variable to the - configuration you selected earlier (or use the --vs-config - option), and invoke mysql-test-run.pl. For example (using - Cygwin and the bash shell): -shell> cd mysql-test -shell> export MTR_VS_CONFIG=debug -shell> ./mysql-test-run.pl --force --timer -shell> ./mysql-test-run.pl --force --timer --ps-protocol - - When you are satisfied that the programs you have built are - working correctly, stop the server. Now you can install the - distribution. One way to do this is to use the make_win_bin_dist - script in the scripts directory of the MySQL source distribution - (see Section 4.4.2, "make_win_bin_dist --- Package MySQL - Distribution as ZIP Archive"). This is a shell script, so you must - have Cygwin installed if you want to use it. It creates a Zip - archive of the built executables and support files that you can - unpack in the location at which you want to install MySQL. - - It is also possible to install MySQL by copying directories and - files directly: - - 1. Create the directories where you want to install MySQL. For - example, to install into C:\mysql, use these commands: -C:\> mkdir C:\mysql -C:\> mkdir C:\mysql\bin -C:\> mkdir C:\mysql\data -C:\> mkdir C:\mysql\share -C:\> mkdir C:\mysql\scripts - If you want to compile other clients and link them to MySQL, - you should also create several additional directories: -C:\> mkdir C:\mysql\include -C:\> mkdir C:\mysql\lib -C:\> mkdir C:\mysql\lib\debug -C:\> mkdir C:\mysql\lib\opt - If you want to benchmark MySQL, create this directory: -C:\> mkdir C:\mysql\sql-bench - Benchmarking requires Perl support. See Section 2.15, "Perl - Installation Notes." - - 2. From the work directory, copy into the C:\mysql directory the - following files and directories: -C:\> cd \workdir -C:\workdir> mkdir C:\mysql -C:\workdir> mkdir C:\mysql\bin -C:\workdir> copy client\Release\*.exe C:\mysql\bin -C:\workdir> copy sql\Release\mysqld.exe C:\mysql\bin\mysqld.exe -C:\workdir> xcopy scripts\*.* C:\mysql\scripts /E -C:\workdir> xcopy share\*.* C:\mysql\share /E - If you want to compile other clients and link them to MySQL, - you should also copy several libraries and header files: -C:\workdir> copy lib\Release\mysqlclient.lib C:\mysql\lib\debug -C:\workdir> copy lib\Release\libmysql.* C:\mysql\lib\debug -C:\workdir> copy lib\Release\zlib.* C:\mysql\lib\debug -C:\workdir> copy lib\Release\mysqlclient.lib C:\mysql\lib\opt -C:\workdir> copy lib\Release\libmysql.* C:\mysql\lib\opt -C:\workdir> copy lib\Release\zlib.* C:\mysql\lib\opt -C:\workdir> copy include\*.h C:\mysql\include -C:\workdir> copy libmysql\libmysql.def C:\mysql\include - -Note - If you have compiled a Debug, rather than Release solution, - you can replace Release with Debug in the source file names - shown above. - If you want to benchmark MySQL, you should also do this: -C:\workdir> xcopy sql-bench\*.* C:\mysql\bench /E - - After installation, set up and start the server in the same way as - for binary Windows distributions. This includes creating the - system tables by running mysql_install_db. For more information, - see Section 2.5, "Installing MySQL on Windows." - -2.5.10. Compiling MySQL Clients on Windows - - In your source files, you should include my_global.h before - mysql.h: -#include -#include - - my_global.h includes any other files needed for Windows - compatibility (such as windows.h) if you compile your program on - Windows. - - You can either link your code with the dynamic libmysql.lib - library, which is just a wrapper to load in libmysql.dll on - demand, or link with the static mysqlclient.lib library. - - The MySQL client libraries are compiled as threaded libraries, so - you should also compile your code to be multi-threaded. - -2.6. Installing MySQL on Linux - - The following sections covers the installation of Linux using - RPMs. For information on using a generic binary package using tar, - see Section 2.2, "Installing MySQL from Generic Binaries on - Unix/Linux." For information on installing from source, see - Section 2.3, "MySQL Installation Using a Source Distribution." - - mysql.server can be found in the support-files directory under the - MySQL installation directory or in a MySQL source tree. You can - install it as /etc/init.d/mysql for automatic MySQL startup and - shutdown. See Section 2.13.1.2, "Starting and Stopping MySQL - Automatically." - -2.6.1. Installing MySQL from RPM Packages on Linux - - The recommended way to install MySQL on RPM-based Linux - distributions is by using the RPM packages. The RPMs that we - provide to the community should work on all versions of Linux that - support RPM packages and use glibc 2.3. To obtain RPM packages, - see Section 2.1.3, "How to Get MySQL." - - For non-RPM Linux distributions, you can install MySQL using a - .tar.gz package. See Section 2.2, "Installing MySQL from Generic - Binaries on Unix/Linux." - - We do provide some platform-specific RPMs; the difference between - a platform-specific RPM and a generic RPM is that a - platform-specific RPM is built on the targeted platform and is - linked dynamically whereas a generic RPM is linked statically with - LinuxThreads. - -Note - - RPM distributions of MySQL often are provided by other vendors. Be - aware that they may differ in features and capabilities from those - built by us, and that the instructions in this manual do not - necessarily apply to installing them. The vendor's instructions - should be consulted instead. - - In most cases, you need to install only the MySQL-server and - MySQL-client packages to get a functional MySQL installation. The - other packages are not required for a standard installation. - - RPMs for MySQL Cluster. Beginning with MySQL 5.1.24, standard - MySQL server RPMs built by MySQL no longer provide support for the - NDBCLUSTER storage engine. MySQL Cluster users wanting to upgrade - MySQL 5.1.23 or earlier installations from RPMs built by MySQL - should upgrade to MySQL Cluster NDB 6.2 or MySQL Cluster NDB 6.3; - RPMs that should work with most Linux distributions are available - for both of these release series. - -Important - - When upgrading a MySQL Cluster RPM installation, you must upgrade - all installed RPMs, including the Server and Client RPMs. - - For more information about installing MySQL Cluster from RPMs, see - Section 17.2.1.1, "MySQL Cluster Multi-Computer Installation." - - For upgrades, if your installation was originally produced by - installing multiple RPM packages, it is best to upgrade all the - packages, not just some. For example, if you previously installed - the server and client RPMs, do not upgrade just the server RPM. - - The RPM packages shown in the following list are available. The - names shown here use a suffix of .glibc23.i386.rpm, but particular - packages can have different suffixes, described later. - - * MySQL-server-VERSION.glibc23.i386.rpm - The MySQL server. You need this unless you only want to - connect to a MySQL server running on another machine. - - * MySQL-client-VERSION.glibc23.i386.rpm - The standard MySQL client programs. You probably always want - to install this package. - - * MySQL-devel-VERSION.glibc23.i386.rpm - The libraries and include files that are needed if you want to - compile other MySQL clients, such as the Perl modules. - - * MySQL-debuginfo-VERSION.glibc23.i386.rpm - This package contains debugging information. debuginfo RPMs - are never needed to use MySQL software; this is true both for - the server and for client programs. However, they contain - additional information that might be needed by a debugger to - analyze a crash. - - * MySQL-shared-VERSION.glibc23.i386.rpm - This package contains the shared libraries - (libmysqlclient.so*) that certain languages and applications - need to dynamically load and use MySQL. It contains - single-threaded and thread-safe libraries. If you install this - package, do not install the MySQL-shared-compat package. - - * MySQL-shared-compat-VERSION.glibc23.i386.rpm - This package includes the shared libraries for MySQL 3.23, - 4.0, and so on, up to the current release. It contains - single-threaded and thread-safe libraries. Install this - package instead of MySQL-shared if you have applications - installed that are dynamically linked against older versions - of MySQL but you want to upgrade to the current version - without breaking the library dependencies. - - * MySQL-shared-compat-advanced-gpl-VERSION.glibc23.i386.rpm, - MySQL-shared-compat-advanced-VERSION.glibc23.i386.rpm - These are like the MySQL-shared-compat package, but are for - the "MySQL Enterprise Server - Advanced Edition" products. - Install these packages rather than the normal - MySQL-shared-compat package if you want to included shared - client libraries for older MySQL versions. - - * MySQL-embedded-VERSION.glibc23.i386.rpm - The embedded MySQL server library. - - * MySQL-ndb-management-VERSION.glibc23.i386.rpm, - MySQL-ndb-storage-VERSION.glibc23.i386.rpm, - MySQL-ndb-tools-VERSION.glibc23.i386.rpm, - MySQL-ndb-extra-VERSION.glibc23.i386.rpm - Packages that contain additional files for MySQL Cluster - installations. - -Note - The MySQL-ndb-tools RPM requires a working installation of - perl. Prior to MySQL 5.1.18, the DBI and HTML::Template - packages were also required. See Section 2.15, "Perl - Installation Notes," and Section 17.4.21, "ndb_size.pl --- - NDBCLUSTER Size Requirement Estimator," for more information. - - * MySQL-test-VERSION.glibc23.i386.rpm - This package includes the MySQL test suite. - - * MySQL-VERSION.src.rpm - This contains the source code for all of the previous - packages. It can also be used to rebuild the RPMs on other - architectures (for example, Alpha or SPARC). - - The suffix of RPM package names (following the VERSION value) has - the following syntax: -.PLATFORM.CPU.rpm - - The PLATFORM and CPU values indicate the type of system for which - the package is built. PLATFORM indicates the platform and CPU - indicates the processor type or family. - - All packages are dynamically linked against glibc 2.3. The - PLATFORM value indicates whether the package is platform - independent or intended for a specific platform, as shown in the - following table. - glibc23 Platform independent, should run on any Linux distribution - that supports glibc 2.3 - rhel3, rhel4 Red Hat Enterprise Linux 3 or 4 - sles9, sles10 SuSE Linux Enterprise Server 9 or 10 - - In MySQL 5.1, only glibc23 packages are available currently. - - The CPU value indicates the processor type or family for which the - package is built. - i386 x86 processor, 386 and up - i586 x86 processor, Pentium and up - x86_64 64-bit x86 processor - ia64 Itanium (IA-64) processor - - To see all files in an RPM package (for example, a MySQL-server - RPM), run a command like this: -shell> rpm -qpl MySQL-server-VERSION.glibc23.i386.rpm - - To perform a standard minimal installation, install the server and - client RPMs: -shell> rpm -i MySQL-server-VERSION.glibc23.i386.rpm -shell> rpm -i MySQL-client-VERSION.glibc23.i386.rpm - - To install only the client programs, install just the client RPM: -shell> rpm -i MySQL-client-VERSION.glibc23.i386.rpm - - RPM provides a feature to verify the integrity and authenticity of - packages before installing them. If you would like to learn more - about this feature, see Section 2.1.4, "Verifying Package - Integrity Using MD5 Checksums or GnuPG." - - The server RPM places data under the /var/lib/mysql directory. The - RPM also creates a login account for a user named mysql (if one - does not exist) to use for running the MySQL server, and creates - the appropriate entries in /etc/init.d/ to start the server - automatically at boot time. (This means that if you have performed - a previous installation and have made changes to its startup - script, you may want to make a copy of the script so that you do - not lose it when you install a newer RPM.) See Section 2.13.1.2, - "Starting and Stopping MySQL Automatically," for more information - on how MySQL can be started automatically on system startup. - - If you want to install the MySQL RPM on older Linux distributions - that do not support initialization scripts in /etc/init.d - (directly or via a symlink), you should create a symbolic link - that points to the location where your initialization scripts - actually are installed. For example, if that location is - /etc/rc.d/init.d, use these commands before installing the RPM to - create /etc/init.d as a symbolic link that points there: -shell> cd /etc -shell> ln -s rc.d/init.d . - - However, all current major Linux distributions should support the - new directory layout that uses /etc/init.d, because it is required - for LSB (Linux Standard Base) compliance. - - In MySQL 5.1.49 and later, during an upgrade installation using - the RPM packages, if the MySQL server is running when the upgrade - occurs, the MySQL server is stopped, the upgrade occurs, and the - MySQL server is restarted. If the MySQL server is not already - running when the RPM upgrade occurs, the MySQL server is not - started at the end of the installation. - - If the RPM files that you install include MySQL-server, the mysqld - server should be up and running after installation. You should be - able to start using MySQL. - - If something goes wrong, you can find more information in the - binary installation section. See Section 2.2, "Installing MySQL - from Generic Binaries on Unix/Linux." - -Note - - The accounts that are listed in the MySQL grant tables initially - have no passwords. After starting the server, you should set up - passwords for them using the instructions in Section 2.13, - "Post-Installation Setup and Testing." - - During RPM installation, a user named mysql and a group named - mysql are created on the system. This is done using the useradd, - groupadd, and usermod commands. Those commands require appropriate - administrative privileges, which is ensured for locally managed - users and groups (as listed in the /etc/passwd and /etc/group - files) by the RPM installation process being run by root. - - If you log in as the mysql user, you may find that MySQL displays - "Invalid (old?) table or database name" errors that mention - .mysqlgui, lost+found, .mysqlgui, .bash_history, .fonts.cache-1, - .lesshst, .mysql_history, .profile, .viminfo, and similar files - created by MySQL or operating system utilities. You can safely - ignore these error messages or remove the files or directories - that cause them if you do not need them. - - For nonlocal user management (LDAP, NIS, and so forth), the - administrative tools may require additional authentication (such - as a password), and will fail if the installing user does not - provide this authentication. Even if they fail, the RPM - installation will not abort but succeed, and this is intentional. - If they failed, some of the intended transfer of ownership may be - missing, and it is recommended that the system administrator then - manually ensures some appropriate user andgroup exists and - manually transfers ownership following the actions in the RPM spec - file. - -2.7. Installing MySQL on Mac OS X - - MySQL for Mac OS X is available in a number of different forms: - - * Native Package Installer format, which uses the native Mac OS - X installer to walk you through the installation of MySQL. For - more information, see Section 2.7.1, "Installing MySQL Using - the Installation Package." You can use the package installer - with Mac OS X 10.3 and later, and available for both PowerPC - and Intel architectures, and both 32-bit and 64-bit - architectures. There is no Universal Binary available using - the package installation method. The user you use to perform - the installation must have administrator privileges. - - * Tar package format, which uses a file packaged using the Unix - tar and gzip commands. To use this method, you will need to - open a Terminal window. You do not need administrator - privileges using this method, as you can install the MySQL - server anywhere using this method. For more information on - using this method, you can use the generic instructions for - using a tarball, Section 2.2, "Installing MySQL from Generic - Binaries on Unix/Linux."You can use the package installer with - Mac OS X 10.3 and later, and available for both PowerPC and - Intel architectures, and both 32-bit and 64-bit architectures. - A Universal Binary, incorporating both Power PC and Intel - architectures and 32-bit and 64-bit binaries is available. - In addition to the core installation, the Package Installer - also includes Section 2.7.2, "Installing the MySQL Startup - Item" and Section 2.7.3, "Installing and Using the MySQL - Preference Pane," both of which simplify the management of - your installation. - - * Mac OS X server includes a version of MySQL as standard. If - you want to use a more recent version than that supplied with - the Mac OS X server release, you can make use of the package - or tar formats. For more information on using the MySQL - bundled with Mac OS X, see Section 2.7.4, "Using MySQL on Mac - OS X Server." - - For additional information on using MySQL on Mac OS X, see Section - 2.7.5, "MySQL Installation on Mac OS X Notes." - -2.7.1. Installing MySQL Using the Installation Package - - You can install MySQL on Mac OS X 10.3.x ("Panther") or newer - using a Mac OS X binary package in PKG format instead of the - binary tarball distribution. Please note that older versions of - Mac OS X (for example, 10.1.x or 10.2.x) are not supported by this - package. - - The package is located inside a disk image (.dmg) file that you - first need to mount by double-clicking its icon in the Finder. It - should then mount the image and display its contents. - -Note - - Before proceeding with the installation, be sure to shut down all - running MySQL server instances by either using the MySQL Manager - Application (on Mac OS X Server) or via mysqladmin shutdown on the - command line. - - When installing from the package version, you should also install - the MySQL Preference Pane, which will enable you to control the - startup and execution of your MySQL server from System - Preferences. For more information, see Section 2.7.3, "Installing - and Using the MySQL Preference Pane." - - When installing using the package installer, the files are - installed into a directory within /usr/local matching the name of - the installation version and platform. For example, the installer - file mysql-5.1.39-osx10.5-x86_64.pkg installs MySQL into - /usr/local/mysql-5.1.39-osx10.5-x86_64 . The installation layout - of the directory is as shown in the following table: - Directory Contents of Directory - bin Client programs and the mysqld server - data Log files, databases - docs Manual in Info format - include Include (header) files - lib Libraries - man Unix manual pages - mysql-test MySQL test suite - scripts Contains the mysql_install_db script - share/mysql Error message files - sql-bench Benchmarks - support-files Scripts and sample configuration files - /tmp/mysql.sock The location of the MySQL Unix socket - - During the package installer process, a symbolic link from - /usr/local/mysql to the version/platform specific directory - created during installation will be created automatically. - - 1. Download and open the MySQL package installer, which is - provided on a disk image (.dmg). Double-click to open the disk - image, which includes the main MySQL installation package, the - MySQLStartupItem.pkg installation package, and the - MySQL.prefPane. - - 2. Double-click the MySQL installer package. It will be named - according to the version of MySQL you have downloaded. For - example, if you have downloaded MySQL 5.1.39, double-click - mysql-5.1.39-osx10.5-x86.pkg. - - 3. You will be presented with the opening installer dialog. Click - Continue to begin installation. - MySQL Package Installer: Step 1 - - 4. A copy of the installation instructions and other important - information relevant to this installation are displayed. Click - Continue . - - 5. If you have downloaded the community version of MySQL, you - will be shown a copy of the relevent GNU General Public - License. Click Continue . - - 6. Select the drive you want to use to install the MySQL Startup - Item. The drive must have a valid, bootable, Mac OS X - operating system installed. Click Continue. - MySQL Package Installer: Step 4 - - 7. You will be asked to confirm the details of the installation, - including the space required for the installation. To change - the drive on which the startup item is installed you can click - either Go Back or Change Install Location.... To install the - startup item, click Install. - - 8. Once the installation has been completed successfully, you - will be shown an Install Succeeded message. - - For convenience, you may also want to install the Section 2.7.2, - "Installing the MySQL Startup Item" and Section 2.7.3, "Installing - and Using the MySQL Preference Pane." - -2.7.2. Installing the MySQL Startup Item - - The MySQL Installation Package includes a startup item that can be - used to automatically start up and shut down MySQL. - - To install the MySQL Startup Item: - - 1. Download and open the MySQL package installer, which is - provided on a disk image (.dmg). Double-click to open the disk - image, which includes the main MySQL installation package, the - MySQLStartupItem.pkg installation package, and the - MySQL.prefPane. - - 2. Double-click the MySQLStartItem.pkg file to start the - installation process. - - 3. You will be presented with the Install MySQL Startup Item - dialog. - MySQL Startup Item Installer: Step 1 - Click Continue to continue the installation process. - - 4. A copy of the installation instructions and other important - information relevant to this installation are displayed. Click - Continue . - - 5. Select the drive you want to use to install the MySQL Startup - Item. The drive must have a valid, bootable, Mac OS X - operating system installed. Click Continue. - MySQL Startup Item Installer: Step 3 - - 6. You will be asked to confirm the details of the installation. - To change the drive on which the startup item is installed you - can click either Go Back or Change Install Location.... To - install the startup item, click Install. - - 7. Once the installation has been completed successfully, you - will be shown an Install Succeeded message. - MySQL Startup Item Installer: Step 5 - - The Startup Item for MySQL is installed into - /Library/StartupItems/MySQLCOM. The Startup Item installation adds - a variable MYSQLCOM=-YES- to the system configuration file - /etc/hostconfig. If you want to disable the automatic startup of - MySQL, change this variable to MYSQLCOM=-NO-. - - After the installation, you can start up MySQL by running the - following commands in a terminal window. You must have - administrator privileges to perform this task. - - If you have installed the Startup Item, use this command to start - the server: -shell> sudo /Library/StartupItems/MySQLCOM/MySQLCOM start - - You may be prompted for your password to complete the startup. - - If you have installed the Startup Item, use this command to stop - the server: -shell> sudo /Library/StartupItems/MySQLCOM/MySQLCOM stop - - You may be prompted for your password to complete the shutdown. - -2.7.3. Installing and Using the MySQL Preference Pane - - The MySQL Package installer disk image also includes a custom - MySQL Preference Pane that enables you to start, stop and control - automated startup during boot of your MySQL installation. - - To install the MySQL Preference Pane: - - 1. Download and open the MySQL package installer package, which - is provided on a disk image (.dmg). Double-click to open the - disk image, which includes the main MySQL installation - package, the MySQLStartupItem.pkg installation package, and - the MySQL.prefPane. - - 2. Double-click the MySQL.prefPane. The MySQL System Preferences - will open. - - 3. If this is the first time you have installed the preference - pane, you will be asked to confirm installation and whether - you want to install the preference pane for all users, or only - the current user. To install the preference pane for all users - you will need administrator privileges. If necessary, you will - be prompted for the username and password for a user with - administrator privileges. - - 4. If you already have the MySQL Preference Pane installed, you - will be asked to confirm whether you want to overwrite the - existing MySQL Preference Pane. - -Note - - The MySQL Preference Pane only starts and stops MySQL installation - installed from the MySQL package installation that have been - installed in the default location. - - Once the MySQL Preference Pane has been installed, you can control - your MySQL server instance using the preference pane. To use the - preference pane, open the System Preferences... from the Apple - menu. Select the MySQL preference pane by clicking the MySQL logo - within the Other section of the preference panes list. - MySQL Preference Pane - - The MySQL Preference Pane shows the current status of the MySQL - server, showing stopped (in red) if the server is not running and - running (in green) if the server has already been started. The - preference pane will also show the current setting for whether the - MySQL server has been set to start up automatically. - - * To start MySQL using the preference pane: - Click Start MySQL Server. You may be prompted for the username - and password of a user with administrator privileges to start - the MySQL server. - - * To stop MySQL using the preference pane: - Click Stop MySQL Server. You may be prompted for the username - and password of a user with administrator privileges to - shutdown the MySQL server. - - * To automatically start the MySQL server when the system boots: - Check the checkbox next to Automatically Start MySQL Server on - Startup. - - * To disable the automatic starting of the MySQL server when the - system boots: - Uncheck the checkbox next to Automatically Start MySQL Server - on Startup. - - You can close the System Preferences... once you have completed - your settings. - -2.7.4. Using MySQL on Mac OS X Server - - If you are running Mac OS X Server, a version of MySQL should - already be installed. The following table shows the versions of - MySQL that ship with Mac OS X Server versions. - Mac OS X Server Version MySQL Version - 10.2-10.2.2 3.23.51 - 10.2.3-10.2.6 3.23.53 - 10.3 4.0.14 - 10.3.2 4.0.16 - 10.4.0 4.1.10a - 10.5.0 5.0.45 - 10.6.0 5.0.82 - - The installation layout of MySQL on Mac OS X Server is as shown in - the table below: - Directory Contents of Directory - /usr/bin Client programs - /var/mysql Log files, databases - /usr/libexec The mysqld server - /usr/share/man Unix manual pages - /usr/share/mysql/mysql-test MySQL test suite - /usr/share/mysql Contains the mysql_install_db script - /var/mysql/mysql.sock The location of the MySQL Unix socket - -Note - - The MySQL server bundled with Mac OS X Server does not include the - MySQL client libraries and header files required if you want to - access and use MySQL from a third-party driver, such as Perl DBI - or PHP. For more information on obtaining and installing MySQL - libraries, see Mac OS X Server version 10.5: MySQL libraries - available for download (http://support.apple.com/kb/TA25017). - Alternatively, you can ignore the bundled MySQL server and install - MySQL from the package or tarball installation. - - For more information on managing the bundled MySQL instance in Mac - OS X Server 10.5, see Mac OS X Server: Web Technologies - Administration For Version 10.5 Leopard - (http://images.apple.com/server/macosx/docs/Web_Technologies_Admin - _v10.5.pdf). For more information on managing the bundled MySQL - instance in Mac OS X Server 10.6, see Mac OS X Server: Web - Technologies Administration Version 10.6 Snow Leopard - (http://manuals.info.apple.com/en_US/WebTech_v10.6.pdf). - -2.7.5. MySQL Installation on Mac OS X Notes - - You should keep the following issues and notes in mind: - - * The default location for the MySQL Unix socket is different on - Mac OS X and Mac OS X Server depending on the installation - type you chose. The default locations by installation are as - follows: - - Package Installer from MySQL /tmp/mysql.sock - Tarball from MySQL /tmp/mysql.sock - MySQL Bundled with Mac OS X Server /var/mysql/mysql.sock - To prevent issues, you should either change the configuration - of the socket used within your application (for example, - changing php.ini), or you should configure the socket location - using a MySQL configuration file and the socket option. For - more information, see Section 5.1.2, "Server Command Options." - - * You may need (or want) to create a specific mysql user to own - the MySQL directory and data. On Mac OS X 10.4 and lower you - can do this by using the Netinfo Manager application, located - within the Utilities folder within the Applications folder. On - Mac OS X 10.5 and later you can do this through the Directory - Utility. From Mac OS X 10.5 and later (including Mac OS X - Server 10.5) the mysql should already exist. For use in single - user mode, an entry for _mysql (note the underscore prefix) - should already exist within the system /etc/passwd file. - - * Due to a bug in the Mac OS X package installer, you may see - this error message in the destination disk selection dialog: -You cannot install this software on this disk. (null) - If this error occurs, click the Go Back button once to return - to the previous screen. Then click Continue to advance to the - destination disk selection again, and you should be able to - choose the destination disk correctly. We have reported this - bug to Apple and it is investigating this problem. - - * Because the MySQL package installer installs the MySQL - contents into a version and platform specific directory, you - can use this to upgrade and migrate your database between - versions. You will need to either copy the data directory from - the old version to the new version, or alternatively specify - an alternative datadir value to set location of the data - directory. - - * You might want to add aliases to your shell's resource file to - make it easier to access commonly used programs such as mysql - and mysqladmin from the command line. The syntax for bash is: -alias mysql=/usr/local/mysql/bin/mysql -alias mysqladmin=/usr/local/mysql/bin/mysqladmin - For tcsh, use: -alias mysql /usr/local/mysql/bin/mysql -alias mysqladmin /usr/local/mysql/bin/mysqladmin - Even better, add /usr/local/mysql/bin to your PATH environment - variable. You can do this by modifying the appropriate startup - file for your shell. For more information, see Section 4.2.1, - "Invoking MySQL Programs." - - * After you have copied over the MySQL database files from the - previous installation and have successfully started the new - server, you should consider removing the old installation - files to save disk space. Additionally, you should also remove - older versions of the Package Receipt directories located in - /Library/Receipts/mysql-VERSION.pkg. - -2.8. Installing MySQL on Solaris - - MySQL on Solaris and OpenSolaris is available in a number of - different formats. - - * For information on installing using the native Solaris PKG - format, see Section 2.8.1, "Installing using a Solaris PKG." - - * On OpenSolaris, the standard package repositories include - MySQL packages specially built for OpenSolaris that include - entries for the Service Management Framework (SMF) to enable - control of the installation using the SMF administration - commands. For more information, see Section 2.8.2, "Installing - MySQL on OpenSolaris using native packages." - - * To use a standard tar binary installation, use the notes - provided in Section 2.2, "Installing MySQL from Generic - Binaries on Unix/Linux." Check the notes and hints at the end - of this section for Solaris specific notes that you may need - before or after installation. - - * For information on installing MySQL on Solaris or OpenSolaris - using a source distribution, first check the Solaris advice, - Section 2.8.3, "Solaris Source Build Notes." For detailed - instructions on installing from source, see Section 2.3, - "MySQL Installation Using a Source Distribution." - - To obtain a binary MySQL distribution for Solaris in tarball or - PKG format, http://dev.mysql.com/downloads/mysql/5.1.html. - - Additional notes to be aware of when installing and using MySQL on - Solaris: - - * If you want to use MySQL with the mysql user and group, use - the groupadd and useradd commands: -groupadd mysql -useradd -g mysql mysql - - * If you install MySQL using a binary tarball distribution on - Solaris, you may run into trouble even before you get the - MySQL distribution unpacked, as the Solaris tar cannot handle - long file names. This means that you may see errors when you - try to unpack MySQL. - If this occurs, you must use GNU tar (gtar) to unpack the - distribution. In Solaris 10 and OpenSolaris gtar is normally - located in /usr/sfw/bin/gtar, but may not be included in the - default path definition. - - * When using Solaris 10 for x86_64, you should mount any file - systems on which you intend to store InnoDB files with the - forcedirectio option. (By default mounting is done without - this option.) Failing to do so will cause a significant drop - in performance when using the InnoDB storage engine on this - platform. - - * If you would like MySQL to start automatically, you can copy - support-files/mysql.server to /etc/init.d and create a - symbolic link to it named /etc/rc3.d/S99mysql.server. - - * If too many processes try to connect very rapidly to mysqld, - you should see this error in the MySQL log: -Error in accept: Protocol error - You might try starting the server with the --back_log=50 - option as a workaround for this. - - * To configure the generation of core files on Solaris you - should use the coreadm command. Because of the security - implications of generating a core on a setuid() application, - by default, Solaris does not support core files on setuid() - programs. However, you can modify this behavior using coreadm. - If you enable setuid() core files for the current user, they - will be generated using the mode 600 and owned by the - superuser. - -2.8.1. Installing using a Solaris PKG - - You can install MySQL on Solaris and OpenSolaris using a binary - package using the native Solaris PKG format instead of the binary - tarball distribution. - - To use this package, download the corresponding - mysql-VERSION-solaris10-PLATFORM.pkg.gz file, then decompress it. - For example -shell> gunzip mysql-5.1.48-solaris10-x86_64.pkg.gz - - To install a new package, use pkgadd and follow the onscreen - prompts. You must have root privileges to perform this operation: -shell> pkgadd -d mysql-5.1.48-solaris10-x86_64.pkg - -The following packages are available: - 1 mysql MySQL Community Server (GPL) - (i86pc) 5.1.48 - -Select package(s) you wish to process (or 'all' to process -all packages). (default: all) [?,??,q]: - - The PKG installer installs all of the files and tools needed, and - then initializes your database if one does not exist. To complete - the installation, you should set the root password for MySQL as - provided in the instructions at the end of the installation. - Alternatively, you can run the mysql_secure_installation script - that comes with the installation. - - The default installation directory is /opt/mysql. You can only - change the root path of the installation when using pkgadd, which - can be used to install MySQL in a different Solaris zone. If you - need to install in a specific directory, use the binary tar file. - - The pkg installer copies a suitable startup script for MySQL into - /etc/init.d/mysql. To enable MySQL to startup and shutdown - automatically, you should create a link between this file and the - init script directories. For example, to ensure safe startup and - shutdown of MySQL you could use the following commands to add the - right links: -shell> ln /etc/init.d/mysql /etc/rc3.d/S91mysql -shell> ln /etc/init.d/mysql /etc/rc0.d/K02mysql - - To remove MySQL, the installed package name is mysql. You can use - this in combination with the pkgrm command to remove the - installation. - -2.8.2. Installing MySQL on OpenSolaris using native packages - - OpenSolaris includes standard packages for MySQL in the core - repository. The MySQL packages are based on a specific release of - MySQL and updated periodically. For the latest release you must - either the native Solaris PKG, tar or source installations. The - native OpenSolris packages include SMF files so that you can - easily control your MySQL installation, including automatic - startup and recovery, using the native service management tools. - - To install MySQL on OpenSolaris, use the pkg command. You will - need to be logged in as root, or use the pfexec tool, as shown in - the example below: -shell> pfexec pkg install SUNWmysql51 - - The package set installs three individual packages, - SUNWmysql51lib, which contains the MySQL client libraries; - SUNWmysql51r which contains the root components, including SMF and - configuration files; and SUNWmysql51u which contains the scripts, - binary tools and other files. You can install these packages - individually if you only need the corresponding components. - - The MySQL files are installed into /usr/mysql which symbolic links - for the sub directories (bin, lib, etc.) to a version specific - directory. For MySQL 5.1, the full installation is located in - /usr/mysql/5.1. The default data directory is /var/mysql/5.1/data. - The configuration file is installed in /etc/mysql/5.1/my.cnf. This - layout permits multiple versions of MySQL to be installed, without - overwriting the data and binaries from other versions. - - Once installed, you must run mysql_install_db to initalize the - database, and use the mysql_secure_installation to secure your - installation. - -Using SMF to manage your MySQL installation - - Once installed, you can start and stop your MySQL server using the - installed SMF configuration. The service name is mysql, or if you - have multiple versions installed, you should use the full version - name, for example mysql:version_51. To start and enable MySQL to - be started at boot time: -shell> svcadm enable mysql - - To disable MySQL from starting during boot time, and shut the - MySQL server down if it is running, use: -shell> svcadm disable mysql - - To restart MySQL, for example after a configuration file changes, - use the restart option: -shell> svcadm restart mysql - - You can also use SMF to configure the data directory and enable - full 64-bit mode. For example, to set the data directory used by - MySQL: -shell> svccfg -svc:> select mysql:version_51 -svc:/application/database/mysql:version_51> setprop mysql/data=/data0 -/mysql - - - By default, the 32-bit binaries are used. To enable the 64-bit - server on 64-bit platforms, set the enable_64bit parameter. For - example: -svc:/application/database/mysql:version_51> setprop mysql/enable_64bi -t=1 - - You need to refresh the SMF after settings these options: -shell> svcadm refresh mysql - -2.8.3. Solaris Source Build Notes - - When building MySQL on Solaris you can use either the Sun Studio - or GNU cc compilers. For more information on specific notes and - environments, use the following hints. - - * When building you should ensure that your PATH variable - includes the necessary tools, including ar for building - libraries. Some tools are located in /usr/ccs/bin. - - * When running configure, you should specify the C and C++ - compiler explicitly to ensure that the right C compiler - combination is used: -$ configure CC=gcc CXX=g++ - - * For detailed information on performance tuning your MySQL - installation for Solaris, you can use the information from - Krish Shankar - (http://blogs.sun.com/krishs/entry/sun_studio_compiler_options - _for) and the Sun Solaris MySQL Performance Tuning - (http://developers.sun.com/solaris/articles/mysql_perf_tune.ht - ml) pages. - - * If you have an UltraSPARC system, you can get 4% better - performance by adding -mcpu=v8 -Wa,-xarch=v8plusa to the - CFLAGS and CXXFLAGS environment variables. - - * If you have Sun's Forte 5.00 (or newer) or Sun Studio - compiler, you can run configure like this: -CC=cc CFLAGS="-Xa -fast -native -xstrconst -mt" \ -CXX=CC CXXFLAGS="-noex -mt" \ -./configure --prefix=/usr/local/mysql --enable-assembler - - * To create a 64-bit SPARC binary with Sun's Forte or Sun Studio - compiler, use the following configuration options: -CC=cc CFLAGS="-Xa -fast -native -xstrconst -mt -xarch=v9" \ -CXX=CC CXXFLAGS="-noex -mt -xarch=v9" ASFLAGS="-xarch=v9" \ -./configure --prefix=/usr/local/mysql --enable-assembler - To create a 64-bit Solaris binary using gcc, add -m64 to - CFLAGS and CXXFLAGS and remove --enable-assembler from the - configure line. - In the MySQL benchmarks, we obtained a 4% speed increase on - UltraSPARC when using Forte 5.0 in 32-bit mode, as compared to - using gcc 3.2 with the -mcpu flag. - If you create a 64-bit mysqld binary, it is 4% slower than the - 32-bit binary, but can handle more threads and memory. - - * If you get a problem with fdatasync or sched_yield, you can - fix this by adding LIBS=-lrt to the configure line - - * Solaris does not provide static versions of all system - libraries (libpthreads and libdl), so you cannot compile MySQL - with --static. If you try to do so, you get one of the - following errors: -ld: fatal: library -ldl: not found -undefined reference to `dlopen' -cannot find -lrt - - * If you link your own MySQL client programs, you may see the - following error at runtime: -ld.so.1: fatal: libmysqlclient.so.#: -open failed: No such file or directory - This problem can be avoided by one of the following methods: - - + Use the crle tool to add the directory containing the - libmysqlclient library file to the list of standard - library directories. You need administrator privileges to - do this. Make sure you update the library information, - rather than replace it with the new path. For example, - the following command adds the directory to the list of - standard directories searched for libraries. -shell> crle -u -l /usr/local/mysql/lib - For 64-bit libraries, add the -64 option: -shell> crle -64 -u -l /usr/local/mysql/lib - - + Link clients with the - -Wl,r/full/path/to/libmysqlclient.so flag rather than - with -Lpath). - - + Copy libmysqclient.so to /usr/lib. - - + Add the path name of the directory where - libmysqlclient.so is located to the LD_RUN_PATH - environment variable before running your client. - - * If you have problems with configure trying to link with -lz - when you do not have zlib installed, you have two options: - - + If you want to be able to use the compressed - communication protocol, you need to get and install zlib - from ftp.gnu.org. - - + Run configure with the --with-named-z-libs=no option when - building MySQL. - - * If you are using gcc and have problems with loading - user-defined functions (UDFs) into MySQL, try adding -lgcc to - the link line for the UDF. - -2.9. Installing MySQL on i5/OS - - The i5/OS POWER MySQL package was created in cooperation with IBM. - MySQL works within the Portable Application Solution Environment - (PASE) on the System i series of hardware and will also provide - database services for the Zend Core for i5/OS. - - MySQL for i5/OS is provided both as a tar file and as a save file - (.savf) package that can be downloaded and installed directly - without any additional installation steps required. To install - MySQL using the tar file, see Section 2.2, "Installing MySQL from - Generic Binaries on Unix/Linux." - - MySQL is only supported on i5/OS V5R4 or later releases. The i5/OS - PASE must be installed for MySQL to operate. You must be able to - login as a user in *SECOFR class. - - You should the installation notes and tips for i5/OS before - starting installation. See i5/OS Installation Notes. - - Before Installation: - -Note - - The installation package will use an existing configuration if you - have previously installed MySQL (which is identified by looking - for the file /etc/my.cnf). The values for the data directory - (DATADIR) and owner of the MySQL files (USRPRF) specified during - the installation will be ignored, and the values determined from - the /etc/my.cnf will be used instead. - - If you want to change these parameters during a new install, you - should temporarily rename /etc/my.cnf, install MySQL using the new - parameters you want to use, and then merge your previous - /etc/my.cnf configuration settings with the new /etc/my.cnf file - that is created during installation. - - * You must have a user profile with PASE with suitable - privileges. The user should be within the *SECOFR class, such - as the QSECOFR user ID. You can use the WRKUSRPRF command to - check your user profile. - - * For network connections to MySQL, you must have TCP/IP - enabled. You should also check the following: - - + Ensure that a name has defined for the system. Run the - Configure TCP/IP (CFGTCP) command and select option 12 - (Change TCP/IP domain information) to display this - setting. Make sure that a value is listed in the Host - name field. - - + Make sure that the system has a loopback entry which - represents the localhost or 127.0.0.1. - - + Ensure that the IP address of the IBM i machine is mapped - correctly to the host name. - - To install MySQL on i5/OS, follow these steps: - - 1. On the System i machine, create a save file that will be used - to receive the downloaded installation save file. The file - should be located within the General Purpose Library (QGPL): -CRTSAVF FILE(QGPL/MYSQLINST) TESXT('MySQL Save file') - - 2. Download the MySQL installation save file in 32-bit - (mysql-5.1.39-i5os-power-32bit.savf) or 64-bit - (mysql-5.1.39-i5os-power-64bit.savf) from MySQL Downloads - (http://dev.mysql.com/downloads). - - 3. You need to FTP the downloaded .savf file directly into the - QGPL/MYSQLINST file on the System i server. You can do this - through FTP using the following steps after logging in to the - System i machine: -ftp> bin -ftp> cd qgpl -ftp> put mysql-5.1.39-i5os-power.savf mysqlinst - - 4. Log into the System i server using a user in the *SECOFR - class, such as the QSECOFR user ID. - - 5. You need to restore the installation library stored in the - .savf save file: -RSTLIB MYSQLINST DEV(*SAVF) SAVF(QGPL/MYSQLINST) MBROPT(*ALL) ALWOBJD -IF(*ALL) - -Note - You can ignore the security changes-type message at the bottom - of the installation panel. - - 6. Once you have finished restoring the MYSQLINST library, check - that all the necessary objects for installation are on the - system by using the Display Library (DSPLIB) command: -DSPLIB LIB(MYSQLINST) - - 7. You need to execute the installation command, - MYSQLINST/INSMYSQL. You can specify three parameter settings - during installation: - - + DIR('/QOpenSys/usr/local/mysql') sets the installation - location for the MySQL files. The directory will be - created if it does not already exist. - - + DATADIR('/QOpenSys/usr/local/mysql/data') sets the - location of the directory that will be used to store the - database files and binary logs. The default setting is - /QOpenSys/usr/local/mysql/data. Note that if the - installer detects an existing installation (due to the - existence of /etc/my.cnf), then the existing setting will - be used instead of the default. - - + USRPRF(MYSQL) sets the user profile that will own the - files that are installed. The profile will be created if - it does not already exist. - -Note - You should choose an appropriate user for using the MySQL - server installation. The user will be used whenever you - need to do any administration on the MySQL server. - Once you have set the appropriate parameters, you can begin - the installation. - The installation copies all the necessary files into a - directory matching the DIR configuration value; sets the - ownership on those files, sets up the MySQL environment and - creates the MySQL configuration file (in /etc/my.cnf) - completing all the steps in a typical binary installation - process automatically. If this is a new installation of MySQL, - or if the installer detects that this is a new version - (because the /etc/my.cnf file does not exist), then the - initial core MySQL databases will also be created during - installation. - Once the installation has been completed, you will get a - notice advising you to set the password for the root user. For - more information, Section 2.13, "Post-Installation Setup and - Testing." - - 8. Once the installation has completed, you can delete the - installation file: -DLTLIB LIB(MYSQLINST) - - Upgrading an existing MySQL instance - - You need to execute the upgrade command, MYSQLINST/UPGMYSQL. - -Note - - You cannot use MYSQLINST/UPGMYSQL to upgrade between major - versions of MySQL (for example from 5.0 to 5.1). For information - and advice on migrating between major versions you can use the - advice provided in Section 2.4.1.1, "Upgrading from MySQL 5.0 to - 5.1." - - You must specify 6 parameters to perform an upgrade: - - * DIR('/QOpenSys/usr/local/'): Sets the installation location - for the MySQL files. The directory will be created if it does - not already exist. This is the directory that the MySQL server - will be installed into, inside a directory with a name - matching the version and release. For example, if installing - MySQL 5.1.39 with the DIR set to /QOpenSys/usr/local/ would - result in /QOpenSys/usr/local/mysql-5.1.39-i5os-power64 and a - symbolic link to this directory will be created in - /QOpenSys/usr/local/mysql. - - * DATADIR('/QOpenSys/mysql/data'): Sets the location of the - directory that will be upgraded. - - * USRPRF('MYSQL'): Sets the user profile that will own the files - that are installed. The profile will be created if it does not - already exist; if it is created as part of the upgrade - process, it will be disabled initially. You may wish to enable - this user profile so that it can be used to start the MySQL - server later. It is best practice to use the one previously - created during the first installation. - - * MYSQLUSR('root user'): Any user account in the current MySQL - server with SUPER privileges. - - * PASSWORD('root user password'): The password for the above - account. This is necessary as the upgrade starts the MySQL - server to upgrade the tables and the password is need to be - able to shutdown the MySQL server. - - * CURINST('path to previous install'): The full path to the - installation that is being upgraded. For example an - installation in /QOpenSys/usr/local/ will be - /QOpenSys/usr/local/msyql-5.1.30-i5os-power64. Failure to - specify this option may result in corruption of your existing - data files. - - For example: -MYSQLINST/UPGMYSQL DIR('/QOpenSys/usr/local/') DATADIR('/QOpenSys/mys -ql/data') » - USERPRF(MYSQL) MYSQLUSR('root') PASSWORD('root') CURINST('/QOpen -Sys/usr/local/mysql-5.1.30-i5os-power64') - - You should receive a Program Message indicating UPGRADE - SUCCESSFUL! upon completion or an error message if there is a - problem.You can view the upgrade programs progression and the - error in the text file upgrade.log in the installation directory. - - To start MySQL: - - 1. Log into the System i server using the user profile create or - specified during installation. By default, this is MYSQL. - -Note - You should start mysqld_safe using a user that in the PASE - environment has the id=0 (the equivalent of the standard Unix - root user). If you do not use a user with this ID then the - system will be unable to change the user when executing mysqld - as set using --user option. If this happens, mysqld may be - unable to read the files located within the MySQL data - directory and the execution will fail. - - 2. Enter the PASE environment using call qp2term. - - 3. Start the MySQL server by changing to the installation - directory and running mysqld_safe, specifying the user name - used to install the server. The installer conveniently - installs a symbolic link to the installation directory - (mysql-5.0.42-i5os-power-32bit) as /opt/mysql/mysql: -> cd /opt/mysql/mysql -> bin/mysqld_safe --user=mysql & - You should see a message similar to the following: -Starting mysqld daemon with databases » - from /opt/mysql/mysql-enterprise-5.0.42-i5os-power-32bit/data - - If you are having problems starting MySQL server, see Section - 2.13.1.3, "Starting and Troubleshooting the MySQL Server." - - To stop MySQL: - - 1. Log into the System i server using the user profile create or - specified during installation. By default, this is MYSQL. - - 2. Enter the PASE environment using call qp2term. - - 3. Stop the MySQL server by changing into the installation - directory and running mysqladmin, specifying the user name - used to install the server: -> cd /opt/mysql/mysql -> bin/mysqladmin -u root shutdown - If the session that you started and stopped MySQL are the - same, you may get the log output from mysqld: - STOPPING server from pid file » - /opt/mysql/mysql-enterprise-5.0.42-i5os-power-32bit/data/I5DBX.R -CHLAND.IBM.COM.pid - 070718 10:34:20 mysqld ended - If the sessions used to start and stop MySQL are different, - you will not receive any confirmation of the shutdown. - - Note and tips - - * A problem has been identified with the installation process on - DBCS systems. If you are having problems install MySQL on a - DBCS system, you need to change your job's coded character set - identifier (CSSID) to 37 (EBCDIC) before executing the install - command, INSMYSQL. To do this, determine your existing CSSID - (using DSPJOB and selecting option 2), execute CHGJOB - CSSID(37), run INSMYSQL to install MySQL and then execute - CHGJOB again with your original CSSID. - - * If you want to use the Perl scripts that are included with - MySQL, you need to download the iSeries Tools for Developers - (5799-PTL). See - http://www-03.ibm.com/servers/enable/site/porting/tools/. - -2.10. Installing MySQL on FreeBSD - - This section provides information about using MySQL on variants of - FreeBSD Unix. - - The easiest (and preferred) way to install MySQL is to use the - mysql-server and mysql-client ports available at - http://www.freebsd.org/. Using these ports gives you the following - benefits: - - * A working MySQL with all optimizations enabled that are known - to work on your version of FreeBSD. - - * Automatic configuration and build. - - * Startup scripts installed in /usr/local/etc/rc.d. - - * The ability to use pkg_info -L to see which files are - installed. - - * The ability to use pkg_delete to remove MySQL if you no longer - want it on your machine. - - The MySQL build process requires GNU make (gmake) to work. If GNU - make is not available, you must install it first before compiling - MySQL. - - The recommended way to compile and install MySQL on FreeBSD with - gcc (2.95.2 and up) is: -CC=gcc CFLAGS="-O2 -fno-strength-reduce" \ - CXX=gcc CXXFLAGS="-O2 -fno-rtti -fno-exceptions \ - -felide-constructors -fno-strength-reduce" \ - ./configure --prefix=/usr/local/mysql --enable-assembler -gmake -gmake install -cd /usr/local/mysql -bin/mysql_install_db --user=mysql -bin/mysqld_safe & - - FreeBSD is known to have a very low default file handle limit. See - Section B.5.2.18, "'File' Not Found and Similar Errors." Start the - server by using the --open-files-limit option for mysqld_safe, or - raise the limits for the mysqld user in /etc/login.conf and - rebuild it with cap_mkdb /etc/login.conf. Also be sure that you - set the appropriate class for this user in the password file if - you are not using the default (use chpass mysqld-user-name). See - Section 4.3.2, "mysqld_safe --- MySQL Server Startup Script." - - In current versions of FreeBSD (at least 4.x and greater), you may - increase the limit on the amount of memory available for a process - by adding the following entries to the /boot/loader.conf file and - rebooting the machine (these are not settings that can be changed - at run time with the sysctl command): -kern.maxdsiz="1073741824" # 1GB -kern.dfldsiz="1073741824" # 1GB -kern.maxssiz="134217728" # 128MB - - For older versions of FreeBSD, you must recompile your kernel to - change the maximum data segment size for a process. In this case, - you should look at the MAXDSIZ option in the LINT config file for - more information. - - If you get problems with the current date in MySQL, setting the TZ - variable should help. See Section 2.14, "Environment Variables." - -2.11. Installing MySQL on HP-UX - - If you install MySQL using a binary tarball distribution on HP-UX, - you may run into trouble even before you get the MySQL - distribution unpacked, as the HP-UX tar cannot handle long file - names. This means that you may see errors when you try to unpack - MySQL. - - If this occurs, you must use GNU tar (gtar) to unpack the - distribution. - - Because of some critical bugs in the standard HP-UX libraries, you - should install the following patches before trying to run MySQL on - HP-UX 11.0: -PHKL_22840 Streams cumulative -PHNE_22397 ARPA cumulative - - This solves the problem of getting EWOULDBLOCK from recv() and - EBADF from accept() in threaded applications. - - If you are using gcc 2.95.1 on an unpatched HP-UX 11.x system, you - may get the following error: -In file included from /usr/include/unistd.h:11, - from ../include/global.h:125, - from mysql_priv.h:15, - from item.cc:19: -/usr/include/sys/unistd.h:184: declaration of C function ... -/usr/include/sys/pthread.h:440: previous declaration ... -In file included from item.h:306, - from mysql_priv.h:158, - from item.cc:19: - - The problem is that HP-UX does not define pthreads_atfork() - consistently. It has conflicting prototypes in - /usr/include/sys/unistd.h:184 and /usr/include/sys/pthread.h:440. - - One solution is to copy /usr/include/sys/unistd.h into - mysql/include and edit unistd.h and change it to match the - definition in pthread.h. Look for this line: -extern int pthread_atfork(void (*prepare)(), void (*parent)(), - void (*child)()); - - Change it to look like this: -extern int pthread_atfork(void (*prepare)(void), void (*parent)(void) -, - void (*child)(void)); - - After making the change, the following configure line should work: -CFLAGS="-fomit-frame-pointer -O3 -fpic" CXX=gcc \ -CXXFLAGS="-felide-constructors -fno-exceptions -fno-rtti -O3" \ -./configure --prefix=/usr/local/mysql --disable-shared - - If you are using HP-UX compiler, you can use the following command - (which has been tested with cc B.11.11.04): -CC=cc CXX=aCC CFLAGS=+DD64 CXXFLAGS=+DD64 ./configure \ - --with-extra-character-set=complex - - You can ignore any errors of the following type: -aCC: warning 901: unknown option: `-3': use +help for online -documentation - - If you get the following error from configure, verify that you do - not have the path to the K&R compiler before the path to the HP-UX - C and C++ compiler: -checking for cc option to accept ANSI C... no -configure: error: MySQL requires an ANSI C compiler (and a C++ compil -er). -Try gcc. See the Installation chapter in the Reference Manual. - - Another reason for not being able to compile is that you didn't - define the +DD64 flags as just described. - - Another possibility for HP-UX 11 is to use the MySQL binaries - provided at http://dev.mysql.com/downloads/, which we have built - and tested ourselves. We have also received reports that the HP-UX - 10.20 binaries supplied by MySQL can be run successfully on HP-UX - 11. If you encounter problems, you should be sure to check your - HP-UX patch level. - -2.12. Installing MySQL on AIX - - Automatic detection of xlC is missing from Autoconf, so a number - of variables need to be set before running configure. The - following example uses the IBM compiler: -export CC="xlc_r -ma -O3 -qstrict -qoptimize=3 -qmaxmem=8192 " -export CXX="xlC_r -ma -O3 -qstrict -qoptimize=3 -qmaxmem=8192" -export CFLAGS="-I /usr/local/include" -export LDFLAGS="-L /usr/local/lib" -export CPPFLAGS=$CFLAGS -export CXXFLAGS=$CFLAGS - -./configure --prefix=/usr/local \ - --localstatedir=/var/mysql \ - --sbindir='/usr/local/bin' \ - --libexecdir='/usr/local/bin' \ - --enable-thread-safe-client \ - --enable-large-files - - The preceding options are used to compile the MySQL distribution - that can be found at http://www-frec.bull.com/. - - If you change the -O3 to -O2 in the preceding configure line, you - must also remove the -qstrict option. This is a limitation in the - IBM C compiler. - - If you are using gcc to compile MySQL, you must use the - -fno-exceptions flag, because the exception handling in gcc is not - thread-safe! There are also some known problems with IBM's - assembler that may cause it to generate bad code when used with - gcc. - - Use the following configure line with gcc 2.95 on AIX: -CC="gcc -pipe -mcpu=power -Wa,-many" \ -CXX="gcc -pipe -mcpu=power -Wa,-many" \ -CXXFLAGS="-felide-constructors -fno-exceptions -fno-rtti" \ -./configure --prefix=/usr/local/mysql --with-low-memory - - The -Wa,-many option is necessary for the compile to be - successful. IBM is aware of this problem but is in no hurry to fix - it because of the workaround that is available. We do not know if - the -fno-exceptions is required with gcc 2.95, but because MySQL - doesn't use exceptions and the option generates faster code, you - should always use it with gcc. - - If you get a problem with assembler code, try changing the - -mcpu=xxx option to match your CPU. Typically power2, power, or - powerpc may need to be used. Alternatively, you might need to use - 604 or 604e. We are not positive but suspect that power would - likely be safe most of the time, even on a power2 machine. - - If you do not know what your CPU is, execute a uname -m command. - It produces a string that looks like 000514676700, with a format - of xxyyyyyymmss where xx and ss are always 00, yyyyyy is a unique - system ID and mm is the ID of the CPU Planar. A chart of these - values can be found at - http://www16.boulder.ibm.com/pseries/en_US/cmds/aixcmds5/uname.htm - . - - This gives you a machine type and a machine model you can use to - determine what type of CPU you have. - - If you have problems with threads on AIX 5.3, you should upgrade - AIX 5.3 to technology level 7 (5300-07). - - If you have problems with signals (MySQL dies unexpectedly under - high load), you may have found an OS bug with threads and signals. - In this case, you can tell MySQL not to use signals by configuring - as follows: -CFLAGS=-DDONT_USE_THR_ALARM CXX=gcc \ -CXXFLAGS="-felide-constructors -fno-exceptions -fno-rtti \ --DDONT_USE_THR_ALARM" \ -./configure --prefix=/usr/local/mysql --with-debug \ - --with-low-memory - - This doesn't affect the performance of MySQL, but has the side - effect that you can't kill clients that are "sleeping" on a - connection with mysqladmin kill or mysqladmin shutdown. Instead, - the client dies when it issues its next command. - - On some versions of AIX, linking with libbind.a makes - getservbyname() dump core. This is an AIX bug and should be - reported to IBM. - - For AIX 4.2.1 and gcc, you have to make the following changes. - - After configuring, edit config.h and include/my_config.h and - change the line that says this: -#define HAVE_SNPRINTF 1 - - to this: -#undef HAVE_SNPRINTF - - And finally, in mysqld.cc, you need to add a prototype for - initgroups(). -#ifdef _AIX41 -extern "C" int initgroups(const char *,int); -#endif - - For 32-bit binaries, if you need to allocate a lot of memory to - the mysqld process, it is not enough to just use ulimit -d - unlimited. You may also have to modify mysqld_safe to add a line - something like this: -export LDR_CNTRL='MAXDATA=0x80000000' - - You can find more information about using a lot of memory at - http://publib16.boulder.ibm.com/pseries/en_US/aixprggd/genprogc/lr - g_prg_support.htm. - - Users of AIX 4.3 should use gmake instead of the make utility - included with AIX. - - As of AIX 4.1, the C compiler has been unbundled from AIX as a - separate product. gcc 3.3.2 can be obtained here: - ftp://ftp.software.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/ppc/gc - c/ - - The steps for compiling MySQL on AIX with gcc 3.3.2 are similar to - those for using gcc 2.95 (in particular, the need to edit config.h - and my_config.h after running configure). However, before running - configure, you should also patch the curses.h file as follows: -/opt/freeware/lib/gcc-lib/powerpc-ibm-aix5.2.0.0/3.3.2/include/curses -.h.ORIG - Mon Dec 26 02:17:28 2005 ---- /opt/freeware/lib/gcc-lib/powerpc-ibm-aix5.2.0.0/3.3.2/include/cu -rses.h -Mon Dec 26 02:40:13 2005 -*************** -*** 2023,2029 **** - - - #endif /* _AIX32_CURSES */ -! #if defined(__USE_FIXED_PROTOTYPES__) || defined(__cplusplus) || de -fined -(__STRICT_ANSI__) - extern int delwin (WINDOW *); - extern int endwin (void); - extern int getcurx (WINDOW *); ---- 2023,2029 ---- - - - #endif /* _AIX32_CURSES */ -! #if 0 && (defined(__USE_FIXED_PROTOTYPES__) || defined(__cplusplus) -|| defined -(__STRICT_ANSI__)) - extern int delwin (WINDOW *); - extern int endwin (void); - extern int getcurx (WINDOW *); - -2.13. Post-Installation Setup and Testing - - After installing MySQL, there are some issues that you should - address. For example, on Unix, you should initialize the data - directory and create the MySQL grant tables. On all platforms, an - important security concern is that the initial accounts in the - grant tables have no passwords. You should assign passwords to - prevent unauthorized access to the MySQL server. Optionally, you - can create time zone tables to enable recognition of named time - zones. - - The following sections include post-installation procedures that - are specific to Windows systems and to Unix systems. Another - section, Section 2.13.1.3, "Starting and Troubleshooting the MySQL - Server," applies to all platforms; it describes what to do if you - have trouble getting the server to start. Section 2.13.2, - "Securing the Initial MySQL Accounts," also applies to all - platforms. You should follow its instructions to make sure that - you have properly protected your MySQL accounts by assigning - passwords to them. - - When you are ready to create additional user accounts, you can - find information on the MySQL access control system and account - management in Section 5.4, "The MySQL Access Privilege System," - and Section 5.5, "MySQL User Account Management." - -2.13.1. Unix Post-Installation Procedures - - After installing MySQL on Unix, you must initialize the grant - tables, start the server, and make sure that the server works - satisfactorily. You may also wish to arrange for the server to be - started and stopped automatically when your system starts and - stops. You should also assign passwords to the accounts in the - grant tables. - - On Unix, the grant tables are set up by the mysql_install_db - program. For some installation methods, this program is run for - you automatically: - - * If you install MySQL on Linux using RPM distributions, the - server RPM runs mysql_install_db. - - * If you install MySQL on Mac OS X using a PKG distribution, the - installer runs mysql_install_db. - - Otherwise, you'll need to run mysql_install_db yourself. - - The following procedure describes how to initialize the grant - tables (if that has not previously been done) and start the - server. It also suggests some commands that you can use to test - whether the server is accessible and working properly. For - information about starting and stopping the server automatically, - see Section 2.13.1.2, "Starting and Stopping MySQL Automatically." - - After you complete the procedure and have the server running, you - should assign passwords to the accounts created by - mysql_install_db and perhaps tighten access to test databases. For - instructions, see Section 2.13.2, "Securing the Initial MySQL - Accounts." - - In the examples shown here, the server runs under the user ID of - the mysql login account. This assumes that such an account exists. - Either create the account if it does not exist, or substitute the - name of a different existing login account that you plan to use - for running the server. - - 1. Change location into the top-level directory of your MySQL - installation, represented here by BASEDIR: -shell> cd BASEDIR - BASEDIR is likely to be something like /usr/local/mysql or - /usr/local. The following steps assume that you have changed - location to this directory. - - 2. If necessary, run the mysql_install_db program to set up the - initial MySQL grant tables containing the privileges that - determine how users are permitted to connect to the server. - You'll need to do this if you used a distribution type for - which the installation procedure doesn't run the program for - you. - Typically, mysql_install_db needs to be run only the first - time you install MySQL, so you can skip this step if you are - upgrading an existing installation, However, mysql_install_db - does not overwrite any existing privilege tables, so it should - be safe to run in any circumstances. - To initialize the grant tables, use one of the following - commands, depending on whether mysql_install_db is located in - the bin or scripts directory: -shell> bin/mysql_install_db --user=mysql -shell> scripts/mysql_install_db --user=mysql - It might be necessary to specify other options such as - --basedir or --datadir if mysql_install_db does not use the - correct locations for the installation directory or data - directory. For example: -shell> bin/mysql_install_db --user=mysql \ - --basedir=/opt/mysql/mysql \ - --datadir=/opt/mysql/mysql/data - The mysql_install_db script creates the server's data - directory. Under the data directory, it creates directories - for the mysql database that holds the grant tables and the - test database that you can use to test MySQL. The script also - creates privilege table entries for root and anonymous-user - accounts. The accounts have no passwords initially. Section - 2.13.2, "Securing the Initial MySQL Accounts," describes the - initial privileges. Briefly, these privileges permit the MySQL - root user to do anything, and permit anybody to create or use - databases with a name of test or starting with test_. - It is important to make sure that the database directories and - files are owned by the mysql login account so that the server - has read and write access to them when you run it later. To - ensure this, the --user option should be used as shown if you - run mysql_install_db as root. Otherwise, you should execute - the script while logged in as mysql, in which case you can - omit the --user option from the command. - mysql_install_db creates several tables in the mysql database, - including user, db, host, tables_priv, columns_priv, func, and - others. See Section 5.4, "The MySQL Access Privilege System," - for a complete listing and description of these tables. - If you do not want to have the test database, you can remove - it after starting the server, using the instructions in - Section 2.13.2, "Securing the Initial MySQL Accounts." - If you have trouble with mysql_install_db at this point, see - Section 2.13.1.1, "Problems Running mysql_install_db." - - 3. Start the MySQL server: -shell> bin/mysqld_safe --user=mysql & - It is important that the MySQL server be run using an - unprivileged (non-root) login account. To ensure this, the - --user option should be used as shown if you run mysqld_safe - as system root. Otherwise, you should execute the script while - logged in to the system as mysql, in which case you can omit - the --user option from the command. - Further instructions for running MySQL as an unprivileged user - are given in Section 5.3.6, "How to Run MySQL as a Normal - User." - If you neglected to create the grant tables by running - mysql_install_db before proceeding to this step, the following - message appears in the error log file when you start the - server: -mysqld: Can't find file: 'host.frm' - This error also occurs if you run mysql_install_db as root - without the --user option. Remove the data directory and run - mysql_install_db with the --user option as described - previously. - If you have other problems starting the server, see Section - 2.13.1.3, "Starting and Troubleshooting the MySQL Server." - - 4. Use mysqladmin to verify that the server is running. The - following commands provide simple tests to check whether the - server is up and responding to connections: -shell> bin/mysqladmin version -shell> bin/mysqladmin variables - The output from mysqladmin version varies slightly depending - on your platform and version of MySQL, but should be similar - to that shown here: -shell> bin/mysqladmin version -mysqladmin Ver 14.12 Distrib 5.1.50, for pc-linux-gnu on i686 -... - -Server version 5.1.50 -Protocol version 10 -Connection Localhost via UNIX socket -UNIX socket /var/lib/mysql/mysql.sock -Uptime: 14 days 5 hours 5 min 21 sec - -Threads: 1 Questions: 366 Slow queries: 0 -Opens: 0 Flush tables: 1 Open tables: 19 -Queries per second avg: 0.000 - To see what else you can do with mysqladmin, invoke it with - the --help option. - - 5. Verify that you can shut down the server: -shell> bin/mysqladmin -u root shutdown - - 6. Verify that you can start the server again. Do this by using - mysqld_safe or by invoking mysqld directly. For example: -shell> bin/mysqld_safe --user=mysql --log & - If mysqld_safe fails, see Section 2.13.1.3, "Starting and - Troubleshooting the MySQL Server." - - 7. Run some simple tests to verify that you can retrieve - information from the server. The output should be similar to - what is shown here: -shell> bin/mysqlshow -+--------------------+ -| Databases | -+--------------------+ -| information_schema | -| mysql | -| test | -+--------------------+ - -shell> bin/mysqlshow mysql -Database: mysql -+---------------------------+ -| Tables | -+---------------------------+ -| columns_priv | -| db | -| event | -| func | -| help_category | -| help_keyword | -| help_relation | -| help_topic | -| host | -| plugin | -| proc | -| procs_priv | -| servers | -| tables_priv | -| time_zone | -| time_zone_leap_second | -| time_zone_name | -| time_zone_transition | -| time_zone_transition_type | -| user | -+---------------------------+ - -shell> bin/mysql -e "SELECT Host,Db,User FROM db" mysql -+------+--------+------+ -| host | db | user | -+------+--------+------+ -| % | test | | -| % | test_% | | -+------+--------+------+ - - 8. There is a benchmark suite in the sql-bench directory (under - the MySQL installation directory) that you can use to compare - how MySQL performs on different platforms. The benchmark suite - is written in Perl. It requires the Perl DBI module that - provides a database-independent interface to the various - databases, and some other additional Perl modules: -DBI -DBD::mysql -Data::Dumper -Data::ShowTable - These modules can be obtained from CPAN - (http://www.cpan.org/). See also Section 2.15.1, "Installing - Perl on Unix." - The sql-bench/Results directory contains the results from many - runs against different databases and platforms. To run all - tests, execute these commands: -shell> cd sql-bench -shell> perl run-all-tests - If you do not have the sql-bench directory, you probably - installed MySQL using RPM files other than the source RPM. - (The source RPM includes the sql-bench benchmark directory.) - In this case, you must first install the benchmark suite - before you can use it. There are separate benchmark RPM files - named mysql-bench-VERSION.i386.rpm that contain benchmark code - and data. - If you have a source distribution, there are also tests in its - tests subdirectory that you can run. For example, to run - auto_increment.tst, execute this command from the top-level - directory of your source distribution: -shell> mysql -vvf test < ./tests/auto_increment.tst - The expected result of the test can be found in the - ./tests/auto_increment.res file. - - 9. At this point, you should have the server running. However, - none of the initial MySQL accounts have a password, and the - server permits permissive access to test databases. To tighten - security, follow the instructions in Section 2.13.2, "Securing - the Initial MySQL Accounts." - - The MySQL 5.1 installation procedure creates time zone tables in - the mysql database. However, you must populate the tables manually - using the instructions in Section 9.6, "MySQL Server Time Zone - Support." - -2.13.1.1. Problems Running mysql_install_db - - The purpose of the mysql_install_db script is to generate new - MySQL privilege tables. It does not overwrite existing MySQL - privilege tables, and it does not affect any other data. - - If you want to re-create your privilege tables, first stop the - mysqld server if it is running. Then rename the mysql directory - under the data directory to save it, and then run - mysql_install_db. Suppose that your current directory is the MySQL - installation directory and that mysql_install_db is located in the - bin directory and the data directory is named data. To rename the - mysql database and re-run mysql_install_db, use these commands. -shell> mv data/mysql data/mysql.old -shell> bin/mysql_install_db --user=mysql - - When you run mysql_install_db, you might encounter the following - problems: - - * mysql_install_db fails to install the grant tables - You may find that mysql_install_db fails to install the grant - tables and terminates after displaying the following messages: -Starting mysqld daemon with databases from XXXXXX -mysqld ended - In this case, you should examine the error log file very - carefully. The log should be located in the directory XXXXXX - named by the error message and should indicate why mysqld - didn't start. If you do not understand what happened, include - the log when you post a bug report. See Section 1.7, "How to - Report Bugs or Problems." - - * There is a mysqld process running - This indicates that the server is running, in which case the - grant tables have probably been created already. If so, there - is no need to run mysql_install_db at all because it needs to - be run only once (when you install MySQL the first time). - - * Installing a second mysqld server does not work when one - server is running - This can happen when you have an existing MySQL installation, - but want to put a new installation in a different location. - For example, you might have a production installation, but you - want to create a second installation for testing purposes. - Generally the problem that occurs when you try to run a second - server is that it tries to use a network interface that is in - use by the first server. In this case, you should see one of - the following error messages: -Can't start server: Bind on TCP/IP port: -Address already in use -Can't start server: Bind on unix socket... - For instructions on setting up multiple servers, see Section - 5.6, "Running Multiple MySQL Servers on the Same Machine." - - * You do not have write access to the /tmp directory - If you do not have write access to create temporary files or a - Unix socket file in the default location (the /tmp directory), - an error occurs when you run mysql_install_db or the mysqld - server. - You can specify different locations for the temporary - directory and Unix socket file by executing these commands - prior to starting mysql_install_db or mysqld, where - some_tmp_dir is the full path name to some directory for which - you have write permission: -shell> TMPDIR=/some_tmp_dir/ -shell> MYSQL_UNIX_PORT=/some_tmp_dir/mysql.sock -shell> export TMPDIR MYSQL_UNIX_PORT - Then you should be able to run mysql_install_db and start the - server with these commands: -shell> bin/mysql_install_db --user=mysql -shell> bin/mysqld_safe --user=mysql & - If mysql_install_db is located in the scripts directory, - modify the first command to scripts/mysql_install_db. - See Section B.5.4.5, "How to Protect or Change the MySQL Unix - Socket File," and Section 2.14, "Environment Variables." - - There are some alternatives to running the mysql_install_db script - provided in the MySQL distribution: - - * If you want the initial privileges to be different from the - standard defaults, you can modify mysql_install_db before you - run it. However, it is preferable to use GRANT and REVOKE to - change the privileges after the grant tables have been set up. - In other words, you can run mysql_install_db, and then use - mysql -u root mysql to connect to the server as the MySQL root - user so that you can issue the necessary GRANT and REVOKE - statements. - If you want to install MySQL on several machines with the same - privileges, you can put the GRANT and REVOKE statements in a - file and execute the file as a script using mysql after - running mysql_install_db. For example: -shell> bin/mysql_install_db --user=mysql -shell> bin/mysql -u root < your_script_file - By doing this, you can avoid having to issue the statements - manually on each machine. - - * It is possible to re-create the grant tables completely after - they have previously been created. You might want to do this - if you're just learning how to use GRANT and REVOKE and have - made so many modifications after running mysql_install_db that - you want to wipe out the tables and start over. - To re-create the grant tables, remove all the .frm, .MYI, and - .MYD files in the mysql database directory. Then run the - mysql_install_db script again. - - * You can start mysqld manually using the --skip-grant-tables - option and add the privilege information yourself using mysql: -shell> bin/mysqld_safe --user=mysql --skip-grant-tables & -shell> bin/mysql mysql - From mysql, manually execute the SQL commands contained in - mysql_install_db. Make sure that you run mysqladmin - flush-privileges or mysqladmin reload afterward to tell the - server to reload the grant tables. - Note that by not using mysql_install_db, you not only have to - populate the grant tables manually, you also have to create - them first. - -2.13.1.2. Starting and Stopping MySQL Automatically - - Generally, you start the mysqld server in one of these ways: - - * Invoke mysqld directly. This works on any platform. - - * Run the MySQL server as a Windows service. The service can be - set to start the server automatically when Windows starts, or - as a manual service that you start on request. For - instructions, see Section 2.5.5.6, "Starting MySQL as a - Windows Service." - - * Invoke mysqld_safe, which tries to determine the proper - options for mysqld and then runs it with those options. This - script is used on Unix and Unix-like systems. See Section - 4.3.2, "mysqld_safe --- MySQL Server Startup Script." - - * Invoke mysql.server. This script is used primarily at system - startup and shutdown on systems that use System V-style run - directories, where it usually is installed under the name - mysql. The mysql.server script starts the server by invoking - mysqld_safe. See Section 4.3.3, "mysql.server --- MySQL Server - Startup Script." - - * On Mac OS X, install a separate MySQL Startup Item package to - enable the automatic startup of MySQL on system startup. The - Startup Item starts the server by invoking mysql.server. See - Section 2.7, "Installing MySQL on Mac OS X," for details. - - The mysqld_safe and mysql.server scripts and the Mac OS X Startup - Item can be used to start the server manually, or automatically at - system startup time. mysql.server and the Startup Item also can be - used to stop the server. - - To start or stop the server manually using the mysql.server - script, invoke it with start or stop arguments: -shell> mysql.server start -shell> mysql.server stop - - Before mysql.server starts the server, it changes location to the - MySQL installation directory, and then invokes mysqld_safe. If you - want the server to run as some specific user, add an appropriate - user option to the [mysqld] group of the /etc/my.cnf option file, - as shown later in this section. (It is possible that you will need - to edit mysql.server if you've installed a binary distribution of - MySQL in a nonstandard location. Modify it to change location into - the proper directory before it runs mysqld_safe. If you do this, - your modified version of mysql.server may be overwritten if you - upgrade MySQL in the future, so you should make a copy of your - edited version that you can reinstall.) - - mysql.server stop stops the server by sending a signal to it. You - can also stop the server manually by executing mysqladmin - shutdown. - - To start and stop MySQL automatically on your server, you need to - add start and stop commands to the appropriate places in your - /etc/rc* files. - - If you use the Linux server RPM package - (MySQL-server-VERSION.rpm), the mysql.server script is installed - in the /etc/init.d directory with the name mysql. You need not - install it manually. See Section 2.6.1, "Installing MySQL from RPM - Packages on Linux," for more information on the Linux RPM - packages. - - Some vendors provide RPM packages that install a startup script - under a different name such as mysqld. - - If you install MySQL from a source distribution or using a binary - distribution format that does not install mysql.server - automatically, you can install it manually. The script can be - found in the support-files directory under the MySQL installation - directory or in a MySQL source tree. - - To install mysql.server manually, copy it to the /etc/init.d - directory with the name mysql, and then make it executable. Do - this by changing location into the appropriate directory where - mysql.server is located and executing these commands: -shell> cp mysql.server /etc/init.d/mysql -shell> chmod +x /etc/init.d/mysql - - Older Red Hat systems use the /etc/rc.d/init.d directory rather - than /etc/init.d. Adjust the preceding commands accordingly. - Alternatively, first create /etc/init.d as a symbolic link that - points to /etc/rc.d/init.d: -shell> cd /etc -shell> ln -s rc.d/init.d . - - After installing the script, the commands needed to activate it to - run at system startup depend on your operating system. On Linux, - you can use chkconfig: -shell> chkconfig --add mysql - - On some Linux systems, the following command also seems to be - necessary to fully enable the mysql script: -shell> chkconfig --level 345 mysql on - - On FreeBSD, startup scripts generally should go in - /usr/local/etc/rc.d/. The rc(8) manual page states that scripts in - this directory are executed only if their basename matches the - *.sh shell file name pattern. Any other files or directories - present within the directory are silently ignored. In other words, - on FreeBSD, you should install the mysql.server script as - /usr/local/etc/rc.d/mysql.server.sh to enable automatic startup. - - As an alternative to the preceding setup, some operating systems - also use /etc/rc.local or /etc/init.d/boot.local to start - additional services on startup. To start up MySQL using this - method, you could append a command like the one following to the - appropriate startup file: -/bin/sh -c 'cd /usr/local/mysql; ./bin/mysqld_safe --user=mysql &' - - For other systems, consult your operating system documentation to - see how to install startup scripts. - - You can add options for mysql.server in a global /etc/my.cnf file. - A typical /etc/my.cnf file might look like this: -[mysqld] -datadir=/usr/local/mysql/var -socket=/var/tmp/mysql.sock -port=3306 -user=mysql - -[mysql.server] -basedir=/usr/local/mysql - - The mysql.server script supports the following options: basedir, - datadir, and pid-file. If specified, they must be placed in an - option file, not on the command line. mysql.server supports only - start and stop as command-line arguments. - - The following table shows which option groups the server and each - startup script read from option files. - Script Option Groups - mysqld [mysqld], [server], [mysqld-major_version] - mysqld_safe [mysqld], [server], [mysqld_safe] - mysql.server [mysqld], [mysql.server], [server] - - [mysqld-major_version] means that groups with names like - [mysqld-5.0] and [mysqld-5.1] are read by servers having versions - 5.0.x, 5.1.x, and so forth. This feature can be used to specify - options that can be read only by servers within a given release - series. - - For backward compatibility, mysql.server also reads the - [mysql_server] group and mysqld_safe also reads the [safe_mysqld] - group. However, you should update your option files to use the - [mysql.server] and [mysqld_safe] groups instead when using MySQL - 5.1. - - See Section 4.2.3.3, "Using Option Files." - -2.13.1.3. Starting and Troubleshooting the MySQL Server - - This section provides troubleshooting suggestions for problems - starting the server on Unix. If you are using Windows, see Section - 2.5.6, "Troubleshooting a MySQL Installation Under Windows." - - If you have problems starting the server, here are some things to - try: - - * Check the error log to see why the server does not start. - - * Specify any special options needed by the storage engines you - are using. - - * Make sure that the server knows where to find the data - directory. - - * Make sure that the server can access the data directory. The - ownership and permissions of the data directory and its - contents must be set such that the server can read and modify - them. - - * Verify that the network interfaces the server wants to use are - available. - - Some storage engines have options that control their behavior. You - can create a my.cnf file and specify startup options for the - engines that you plan to use. If you are going to use storage - engines that support transactional tables (InnoDB, NDB), be sure - that you have them configured the way you want before starting the - server: - - * If you are using InnoDB tables, see Section 13.6.2, "InnoDB - Configuration." - - * If you are using MySQL Cluster, see Section 17.3, "MySQL - Cluster Configuration." - - MySQL Enterprise For expert advice on start-up options appropriate - to your circumstances, subscribe to The MySQL Enterprise Monitor. - For more information, see - http://www.mysql.com/products/enterprise/advisors.html. - - Storage engines will use default option values if you specify - none, but it is recommended that you review the available options - and specify explicit values for those for which the defaults are - not appropriate for your installation. - - When the mysqld server starts, it changes location to the data - directory. This is where it expects to find databases and where it - expects to write log files. The server also writes the pid - (process ID) file in the data directory. - - The data directory location is hardwired in when the server is - compiled. This is where the server looks for the data directory by - default. If the data directory is located somewhere else on your - system, the server will not work properly. You can determine what - the default path settings are by invoking mysqld with the - --verbose and --help options. - - If the default locations do not match the MySQL installation - layout on your system, you can override them by specifying options - to mysqld or mysqld_safe on the command line or in an option file. - - To specify the location of the data directory explicitly, use the - --datadir option. However, normally you can tell mysqld the - location of the base directory under which MySQL is installed and - it looks for the data directory there. You can do this with the - --basedir option. - - To check the effect of specifying path options, invoke mysqld with - those options followed by the --verbose and --help options. For - example, if you change location into the directory where mysqld is - installed and then run the following command, it shows the effect - of starting the server with a base directory of /usr/local: -shell> ./mysqld --basedir=/usr/local --verbose --help - - You can specify other options such as --datadir as well, but - --verbose and --help must be the last options. - - Once you determine the path settings you want, start the server - without --verbose and --help. - - If mysqld is currently running, you can find out what path - settings it is using by executing this command: -shell> mysqladmin variables - - Or: -shell> mysqladmin -h host_name variables - - host_name is the name of the MySQL server host. - - If you get Errcode 13 (which means Permission denied) when - starting mysqld, this means that the privileges of the data - directory or its contents do not permit server access. In this - case, you change the permissions for the involved files and - directories so that the server has the right to use them. You can - also start the server as root, but this raises security issues and - should be avoided. - - On Unix, change location into the data directory and check the - ownership of the data directory and its contents to make sure the - server has access. For example, if the data directory is - /usr/local/mysql/var, use this command: -shell> ls -la /usr/local/mysql/var - - If the data directory or its files or subdirectories are not owned - by the login account that you use for running the server, change - their ownership to that account. If the account is named mysql, - use these commands: -shell> chown -R mysql /usr/local/mysql/var -shell> chgrp -R mysql /usr/local/mysql/var - - If it possible that even with correct ownership, MySQL may fail to - start up if there is other security software running on your - system that manages application access to various parts of the - file system. In this case, you may need to reconfigure that - software to enable mysqld to access the directories it uses during - normal operation. - - If the server fails to start up correctly, check the error log. - Log files are located in the data directory (typically C:\Program - Files\MySQL\MySQL Server 5.1\data on Windows, - /usr/local/mysql/data for a Unix binary distribution, and - /usr/local/var for a Unix source distribution). Look in the data - directory for files with names of the form host_name.err and - host_name.log, where host_name is the name of your server host. - Then examine the last few lines of these files. On Unix, you can - use tail to display them: -shell> tail host_name.err -shell> tail host_name.log - - The error log should contain information that indicates why the - server couldn't start. - - If either of the following errors occur, it means that some other - program (perhaps another mysqld server) is using the TCP/IP port - or Unix socket file that mysqld is trying to use: -Can't start server: Bind on TCP/IP port: Address already in use -Can't start server: Bind on unix socket... - - Use ps to determine whether you have another mysqld server - running. If so, shut down the server before starting mysqld again. - (If another server is running, and you really want to run multiple - servers, you can find information about how to do so in Section - 5.6, "Running Multiple MySQL Servers on the Same Machine.") - - If no other server is running, try to execute the command telnet - your_host_name tcp_ip_port_number. (The default MySQL port number - is 3306.) Then press Enter a couple of times. If you do not get an - error message like telnet: Unable to connect to remote host: - Connection refused, some other program is using the TCP/IP port - that mysqld is trying to use. You'll need to track down what - program this is and disable it, or else tell mysqld to listen to a - different port with the --port option. In this case, you'll also - need to specify the port number for client programs when - connecting to the server via TCP/IP. - - Another reason the port might be inaccessible is that you have a - firewall running that blocks connections to it. If so, modify the - firewall settings to permit access to the port. - - If the server starts but you can't connect to it, you should make - sure that you have an entry in /etc/hosts that looks like this: -127.0.0.1 localhost - - This problem occurs only on systems that do not have a working - thread library and for which MySQL must be configured to use - MIT-pthreads. - - If you cannot get mysqld to start, you can try to make a trace - file to find the problem by using the --debug option. See MySQL - Internals: Porting - (http://forge.mysql.com/wiki/MySQL_Internals_Porting). - -2.13.2. Securing the Initial MySQL Accounts - - Part of the MySQL installation process is to set up the mysql - database that contains the grant tables: - - * Windows distributions contain preinitialized grant tables. - - * On Unix, the mysql_install_db program populates the grant - tables. Some installation methods run this program for you. - Others require that you execute it manually. For details, see - Section 2.13.1, "Unix Post-Installation Procedures." - - The mysql.user grant table defines the initial MySQL user accounts - and their access privileges: - - * Some accounts have the user name root. These are superuser - accounts that have all privileges and can do anything. The - initial root account passwords are empty, so anyone can - connect to the MySQL server as root without a password and be - granted all privileges. - - + On Windows, root accounts are created that permit - connections from the local host only. Connections can be - made by specifying a host name of localhost or 127.0.0.1. - If the user selects the Enable root access from remote - machines option during installation, the Windows - installer creates another root account that permits - connections from any host. - - + On Unix, each root account permits connections from the - local host. Connections can be made by specifying a host - name of localhost, 127.0.0.1, or the actual host name or - IP number. - An attempt to connect to the host 127.0.0.1 normally resolves - to the localhost account. However, this fails if the server is - run with the --skip-name-resolve option, so the 127.0.0.1 - account is useful in that case. - - * Some accounts are for anonymous users. These have an empty - user name. The anonymous accounts have no password, so anyone - can use them to connect to the MySQL server. - - + On Windows, there is one anonymous account that permits - connections from the local host. Connections can be made - by specifying a host name of localhost. The account has - no global privileges. (Before MySQL 5.1.16, it has all - global privileges, just like the root accounts.) - - + On Unix, each anonymous account permits connections from - the local host. Connections can be made by specifying a - host name of localhost for one of the accounts, or the - actual host name or IP number for the other. - - To display which accounts exist in the mysql.user table and check - whether their passwords are empty, use the following statement: -mysql> SELECT User, Host, Password FROM mysql.user; -+------+--------------------+----------+ -| User | Host | Password | -+------+--------------------+----------+ -| root | localhost | | -| root | myhost.example.com | | -| root | 127.0.0.1 | | -| | localhost | | -| | myhost.example.com | | -+------+--------------------+----------+ - - This output indicates that there are several root and - anonymous-user accounts, none of which have passwords. The output - might differ on your system, but the presence of accounts with - empty passwords means that your MySQL installation is unprotected - until you do something about it: - - * You should assign a password to each MySQL root account. - - * If you want to prevent clients from connecting as anonymous - users without a password, you should either assign a password - to each anonymous account or else remove the accounts. - - In addition, the mysql.db table contains rows that permits all - accounts to access the test database and other databases with - names that start with test_. This is true even for accounts that - otherwise have no special privileges such as the default anonymous - accounts. This is convenient for testing but inadvisable on - production servers. Administrators who want database access - restricted only to accounts that have permissions granted - explicitly for that purpose should remove these mysql.db table - rows. - - The following instructions describe how to set up passwords for - the initial MySQL accounts, first for for the root accounts, then - for the anonymous accounts. The instructions also cover how to - remove the anonymous accounts, should you prefer not to permit - anonymous access at all, and describe how to remove permissive - access to test databases. Replace newpwd in the examples with the - password that you want to use. Replace host_name with the name of - the server host. You can determine this name from the output of - the preceding SELECT statement. For the output shown, host_name is - myhost.example.com. - -Note - - If you forget your root password after setting it, see Section - B.5.4.1, "How to Reset the Root Password." - - You might want to defer setting the passwords until later, to - avoid the need to specify them while you perform additional setup - or testing. However, be sure to set them before using your - installation for production purposes. - - To set up additional accounts, see Section 5.5.2, "Adding User - Accounts." - -Assigning root Account Passwords - - The root account passwords can be set several ways. The following - discussion demonstrates three methods: - - * Use the SET PASSWORD statement - - * Use the UPDATE statement - - * Use the mysqladmin command-line client program - - To assign passwords using SET PASSWORD, connect to the server as - root and issue a SET PASSWORD statement for each root account - listed in the mysql.user table. Be sure to encrypt the password - using the PASSWORD() function. - - For Windows, do this: -shell> mysql -u root -mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newpwd'); -mysql> SET PASSWORD FOR 'root'@'127.0.0.1' = PASSWORD('newpwd'); -mysql> SET PASSWORD FOR 'root'@'%' = PASSWORD('newpwd'); - - The last statement is unnecessary if the mysql.user table has no - root account with a host value of %. - - For Unix, do this: -shell> mysql -u root -mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newpwd'); -mysql> SET PASSWORD FOR 'root'@'127.0.0.1' = PASSWORD('newpwd'); -mysql> SET PASSWORD FOR 'root'@'host_name' = PASSWORD('newpwd'); - - You can also use a single statement that assigns a password to all - root accounts by using UPDATE to modify the mysql.user table - directly. This method works on any platform: -shell> mysql -u root -mysql> UPDATE mysql.user SET Password = PASSWORD('newpwd') - -> WHERE User = 'root'; -mysql> FLUSH PRIVILEGES; - - The FLUSH statement causes the server to reread the grant tables. - Without it, the password change remains unnoticed by the server - until you restart it. - - To assign passwords to the root accounts using mysqladmin, execute - the following commands: -shell> mysqladmin -u root password "newpwd" -shell> mysqladmin -u root -h host_name password "newpwd" - - Those commands apply both to Windows and to Unix. The double - quotation marks around the password are not always necessary, but - you should use them if the password contains spaces or other - characters that are special to your command interpreter. - - The mysqladmin method of setting the root account passwords does - not work for the 'root'@'127.0.0.1' account. Use the SET PASSWORD - method shown earlier. - - After the root passwords have been set, you must supply the - appropriate password whenever you connect as root to the server. - For example, to shut down the server with mysqladmin, use this - command: -shell> mysqladmin -u root -p shutdown -Enter password: (enter root password here) - -Assigning Anonymous Account Passwords - - The mysql commands in the following instructions include a -p - option based on the assumption that you have set the root account - passwords using the preceding instructions and must specify that - password when connecting to the server. - - To assign passwords to the anonymous accounts, connect to the - server as root, then use either SET PASSWORD or UPDATE. Be sure to - encrypt the password using the PASSWORD() function. - - To use SET PASSWORD on Windows, do this: -shell> mysql -u root -p -Enter password: (enter root password here) -mysql> SET PASSWORD FOR ''@'localhost' = PASSWORD('newpwd'); - - To use SET PASSWORD on Unix, do this: -shell> mysql -u root -p -Enter password: (enter root password here) -mysql> SET PASSWORD FOR ''@'localhost' = PASSWORD('newpwd'); -mysql> SET PASSWORD FOR ''@'host_name' = PASSWORD('newpwd'); - - To set the anonymous-user account passwords with a single UPDATE - statement, do this (on any platform): -shell> mysql -u root -p -Enter password: (enter root password here) -mysql> UPDATE mysql.user SET Password = PASSWORD('newpwd') - -> WHERE User = ''; -mysql> FLUSH PRIVILEGES; - - The FLUSH statement causes the server to reread the grant tables. - Without it, the password change remains unnoticed by the server - until you restart it. - -Removing Anonymous Accounts - - If you prefer to remove any anonymous accounts rather than - assigning them passwords, do so as follows on Windows: -shell> mysql -u root -p -Enter password: (enter root password here) -mysql> DROP USER ''@'localhost'; - - On Unix, remove the anonymous accounts like this: -shell> mysql -u root -p -Enter password: (enter root password here) -mysql> DROP USER ''@'localhost'; -mysql> DROP USER ''@'host_name'; - -Securing Test Databases - - By default, the mysql.db table contains rows that permit access by - any user to the test database and other databases with names that - start with test_. (These rows have an empty User column value, - which for access-checking purposes matches any user name.) This - means that such databases can be used even by accounts that - otherwise possess no privileges. If you want to remove any-user - access to test databases, do so as follows: -shell> mysql -u root -p -Enter password: (enter root password here) -mysql> DELETE FROM mysql.db WHERE Db LIKE 'test%'; -mysql> FLUSH PRIVILEGES; - - The FLUSH statement causes the server to reread the grant tables. - Without it, the privilege change remains unnoticed by the server - until you restart it. - - With the preceding change, only users who have global database - privileges or privileges granted explicitly for the test database - can use it. However, if you do not want the database to exist at - all, drop it: -mysql> DROP DATABASE test; - -2.14. Environment Variables - - This section lists all the environment variables that are used - directly or indirectly by MySQL. Most of these can also be found - in other places in this manual. - - Note that any options on the command line take precedence over - values specified in option files and environment variables, and - values in option files take precedence over values in environment - variables. - - In many cases, it is preferable to use an option file instead of - environment variables to modify the behavior of MySQL. See Section - 4.2.3.3, "Using Option Files." - Variable Description - CXX The name of your C++ compiler (for running configure). - CC The name of your C compiler (for running configure). - CFLAGS Flags for your C compiler (for running configure). - CXXFLAGS Flags for your C++ compiler (for running configure). - DBI_USER The default user name for Perl DBI. - DBI_TRACE Trace options for Perl DBI. - HOME The default path for the mysql history file is - $HOME/.mysql_history. - LD_RUN_PATH Used to specify the location of libmysqlclient.so. - MYSQL_DEBUG Debug trace options when debugging. - MYSQL_GROUP_SUFFIX Option group suffix value (like specifying - --defaults-group-suffix). - MYSQL_HISTFILE The path to the mysql history file. If this - variable is set, its value overrides the default for - $HOME/.mysql_history. - MYSQL_HOME The path to the directory in which the server-specific - my.cnf file resides (as of MySQL 5.0.3). - MYSQL_HOST The default host name used by the mysql command-line - client. - MYSQL_PS1 The command prompt to use in the mysql command-line - client. - MYSQL_PWD The default password when connecting to mysqld. Note - that using this is insecure. See Section 5.3.2.2, "End-User - Guidelines for Password Security." - MYSQL_TCP_PORT The default TCP/IP port number. - MYSQL_UNIX_PORT The default Unix socket file name; used for - connections to localhost. - PATH Used by the shell to find MySQL programs. - TMPDIR The directory where temporary files are created. - TZ This should be set to your local time zone. See Section - B.5.4.6, "Time Zone Problems." - UMASK The user-file creation mode when creating files. See note - following table. - UMASK_DIR The user-directory creation mode when creating - directories. See note following table. - USER The default user name on Windows and NetWare used when - connecting to mysqld. - - The UMASK and UMASK_DIR variables, despite their names, are used - as modes, not masks: - - * If UMASK is set, mysqld uses ($UMASK | 0600) as the mode for - file creation, so that newly created files have a mode in the - range from 0600 to 0666 (all values octal). - - * If UMASK_DIR is set, mysqld uses ($UMASK_DIR | 0700) as the - base mode for directory creation, which then is AND-ed with - ~(~$UMASK & 0666), so that newly created directories have a - mode in the range from 0700 to 0777 (all values octal). The - AND operation may remove read and write permissions from the - directory mode, but not execute permissions. - - MySQL assumes that the value for UMASK or UMASK_DIR is in octal if - it starts with a zero. - -2.15. Perl Installation Notes - - Perl support for MySQL is provided by means of the DBI/DBD client - interface. The interface requires Perl 5.6.0, and 5.6.1 or later - is preferred. DBI does not work if you have an older version of - Perl. - - To use transactions with Perl DBI, you must use DBD::mysql 2.0900 - or newer. To use the MySQL 4.1 or newer client library, you must - use DBD::mysql 2.9003 or newer. Support for server-side prepared - statements requires DBD::mysql 3.0009 or newer. Current versions - of DBD::mysql on CPAN are 4.xxxx or higher and support all these - capabilities. - - Perl support is not included with MySQL distributions. You can - obtain the necessary modules from http://search.cpan.org for Unix, - or by using the ActiveState ppm program on Windows. The following - sections describe how to do this. - - Perl support for MySQL must be installed if you want to run the - MySQL benchmark scripts; see Section 7.1.3, "The MySQL Benchmark - Suite." It is also required for the MySQL Cluster ndb_size.pl - utility; see Section 17.4.21, "ndb_size.pl --- NDBCLUSTER Size - Requirement Estimator." - -2.15.1. Installing Perl on Unix - - MySQL Perl support requires that you have installed MySQL client - programming support (libraries and header files). Most - installation methods install the necessary files. However, if you - installed MySQL from RPM files on Linux, be sure that you've - installed the developer RPM. The client programs are in the client - RPM, but client programming support is in the developer RPM. - - If you want to install Perl support, the files you need can be - obtained from the CPAN (Comprehensive Perl Archive Network) at - http://search.cpan.org. - - The easiest way to install Perl modules on Unix is to use the CPAN - module. For example: -shell> perl -MCPAN -e shell -cpan> install DBI -cpan> install DBD::mysql - - The DBD::mysql installation runs a number of tests. These tests - attempt to connect to the local MySQL server using the default - user name and password. (The default user name is your login name - on Unix, and ODBC on Windows. The default password is "no - password.") If you cannot connect to the server with those values - (for example, if your account has a password), the tests fail. You - can use force install DBD::mysql to ignore the failed tests. - - DBI requires the Data::Dumper module. It may be installed; if not, - you should install it before installing DBI. - - It is also possible to download the module distributions in the - form of compressed tar archives and build the modules manually. - For example, to unpack and build a DBI distribution, use a - procedure such as this: - - 1. Unpack the distribution into the current directory: -shell> gunzip < DBI-VERSION.tar.gz | tar xvf - - This command creates a directory named DBI-VERSION. - - 2. Change location into the top-level directory of the unpacked - distribution: -shell> cd DBI-VERSION - - 3. Build the distribution and compile everything: -shell> perl Makefile.PL -shell> make -shell> make test -shell> make install - - The make test command is important because it verifies that the - module is working. Note that when you run that command during the - DBD::mysql installation to exercise the interface code, the MySQL - server must be running or the test fails. - - It is a good idea to rebuild and reinstall the DBD::mysql - distribution whenever you install a new release of MySQL, - particularly if you notice symptoms such as that all your DBI - scripts fail after you upgrade MySQL. - - If you do not have access rights to install Perl modules in the - system directory or if you want to install local Perl modules, the - following reference may be useful: - http://servers.digitaldaze.com/extensions/perl/modules.html#module - s - - Look under the heading "Installing New Modules that Require - Locally Installed Modules." - -2.15.2. Installing ActiveState Perl on Windows - - On Windows, you should do the following to install the MySQL DBD - module with ActiveState Perl: - - 1. Get ActiveState Perl from - http://www.activestate.com/Products/ActivePerl/ and install - it. - - 2. Open a console window (a "DOS window"). - - 3. If necessary, set the HTTP_proxy variable. For example, you - might try a setting like this: -set HTTP_proxy=my.proxy.com:3128 - - 4. Start the PPM program: -C:\> C:\perl\bin\ppm.pl - - 5. If you have not previously done so, install DBI: -ppm> install DBI - - 6. If this succeeds, run the following command: -ppm> install DBD-mysql - - This procedure should work with ActiveState Perl 5.6 or newer. - - If you cannot get the procedure to work, you should install the - MyODBC driver instead and connect to the MySQL server through - ODBC: -use DBI; -$dbh= DBI->connect("DBI:ODBC:$dsn",$user,$password) || - die "Got error $DBI::errstr when connecting to $dsn\n"; - -2.15.3. Problems Using the Perl DBI/DBD Interface - - If Perl reports that it cannot find the ../mysql/mysql.so module, - the problem is probably that Perl cannot locate the - libmysqlclient.so shared library. You should be able to fix this - problem by one of the following methods: - - * Compile the DBD::mysql distribution with perl Makefile.PL - -static -config rather than perl Makefile.PL. - - * Copy libmysqlclient.so to the directory where your other - shared libraries are located (probably /usr/lib or /lib). - - * Modify the -L options used to compile DBD::mysql to reflect - the actual location of libmysqlclient.so. - - * On Linux, you can add the path name of the directory where - libmysqlclient.so is located to the /etc/ld.so.conf file. - - * Add the path name of the directory where libmysqlclient.so is - located to the LD_RUN_PATH environment variable. Some systems - use LD_LIBRARY_PATH instead. - - Note that you may also need to modify the -L options if there are - other libraries that the linker fails to find. For example, if the - linker cannot find libc because it is in /lib and the link command - specifies -L/usr/lib, change the -L option to -L/lib or add -L/lib - to the existing link command. - - If you get the following errors from DBD::mysql, you are probably - using gcc (or using an old binary compiled with gcc): -/usr/bin/perl: can't resolve symbol '__moddi3' -/usr/bin/perl: can't resolve symbol '__divdi3' - - Add -L/usr/lib/gcc-lib/... -lgcc to the link command when the - mysql.so library gets built (check the output from make for - mysql.so when you compile the Perl client). The -L option should - specify the path name of the directory where libgcc.a is located - on your system. - - Another cause of this problem may be that Perl and MySQL are not - both compiled with gcc. In this case, you can solve the mismatch - by compiling both with gcc. - - You may see the following error from DBD::mysql when you run the - tests: -t/00base............install_driver(mysql) failed: -Can't load '../blib/arch/auto/DBD/mysql/mysql.so' for module DBD::mys -ql: -../blib/arch/auto/DBD/mysql/mysql.so: undefined symbol: -uncompress at /usr/lib/perl5/5.00503/i586-linux/DynaLoader.pm line 16 -9. - - This means that you need to include the -lz compression library on - the link line. That can be done by changing the following line in - the file lib/DBD/mysql/Install.pm: -$sysliblist .= " -lm"; - - Change that line to: -$sysliblist .= " -lm -lz"; - - After this, you must run make realclean and then proceed with the - installation from the beginning. - - If you want to install DBI on SCO, you have to edit the Makefile - in DBI-xxx and each subdirectory. Note that the following assumes - gcc 2.95.2 or newer: -OLD: NEW: -CC = cc CC = gcc -CCCDLFLAGS = -KPIC -W1,-Bexport CCCDLFLAGS = -fpic -CCDLFLAGS = -wl,-Bexport CCDLFLAGS = - -LD = ld LD = gcc -G -fpic -LDDLFLAGS = -G -L/usr/local/lib LDDLFLAGS = -L/usr/local/lib -LDFLAGS = -belf -L/usr/local/lib LDFLAGS = -L/usr/local/lib - -LD = ld LD = gcc -G -fpic -OPTIMISE = -Od OPTIMISE = -O1 - -OLD: -CCCFLAGS = -belf -dy -w0 -U M_XENIX -DPERL_SCO5 -I/usr/local/include - -NEW: -CCFLAGS = -U M_XENIX -DPERL_SCO5 -I/usr/local/include - - These changes are necessary because the Perl dynaloader does not - load the DBI modules if they were compiled with icc or cc. - - If you want to use the Perl module on a system that does not - support dynamic linking (such as SCO), you can generate a static - version of Perl that includes DBI and DBD::mysql. The way this - works is that you generate a version of Perl with the DBI code - linked in and install it on top of your current Perl. Then you use - that to build a version of Perl that additionally has the DBD code - linked in, and install that. - - On SCO, you must have the following environment variables set: -LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib:/usr/progressive/lib - - Or: -LD_LIBRARY_PATH=/usr/lib:/lib:/usr/local/lib:/usr/ccs/lib:\ - /usr/progressive/lib:/usr/skunk/lib -LIBPATH=/usr/lib:/lib:/usr/local/lib:/usr/ccs/lib:\ - /usr/progressive/lib:/usr/skunk/lib -MANPATH=scohelp:/usr/man:/usr/local1/man:/usr/local/man:\ - /usr/skunk/man: - - First, create a Perl that includes a statically linked DBI module - by running these commands in the directory where your DBI - distribution is located: -shell> perl Makefile.PL -static -config -shell> make -shell> make install -shell> make perl - - Then, you must install the new Perl. The output of make perl - indicates the exact make command you need to execute to perform - the installation. On SCO, this is make -f Makefile.aperl inst_perl - MAP_TARGET=perl. - - Next, use the just-created Perl to create another Perl that also - includes a statically linked DBD::mysql by running these commands - in the directory where your DBD::mysql distribution is located: -shell> perl Makefile.PL -static -config -shell> make -shell> make install -shell> make perl - - Finally, you should install this new Perl. Again, the output of - make perl indicates the command to use. diff --git a/dep/mysqllite/INSTALL-WIN-SOURCE b/dep/mysqllite/INSTALL-WIN-SOURCE deleted file mode 100644 index 0954800edb420..0000000000000 --- a/dep/mysqllite/INSTALL-WIN-SOURCE +++ /dev/null @@ -1,289 +0,0 @@ - -2.5.9. Installing MySQL from Source on Windows - - These instructions describe how to build binaries from source for - MySQL 5.1 on Windows. Instructions are provided for building - binaries from a standard source distribution or from the Bazaar - tree that contains the latest development source. - -Note - - The instructions here are strictly for users who want to test - MySQL on Microsoft Windows from the latest source distribution or - from the Bazaar tree. For production use, we do not advise using a - MySQL server built by yourself from source. Normally, it is best - to use precompiled binary distributions of MySQL that are built - specifically for optimal performance on Windows by Oracle - Corporation. Instructions for installing binary distributions are - available in Section 2.5, "Installing MySQL on Windows." - - To build MySQL on Windows from source, you must satisfy the - following system, compiler, and resource requirements: - - * Windows 2000, Windows XP, or newer version. - Windows Vista is supported when using Visual Studio 2005 - provided you have installed the following updates: - - + Microsoft Visual Studio 2005 Professional Edition - ENU - Service Pack 1 (KB926601) - (http://support.microsoft.com/?kbid=926601) - - + Security Update for Microsoft Visual Studio 2005 - Professional Edition - ENU (KB937061) - (http://support.microsoft.com/?kbid=937061) - - + Update for Microsoft Visual Studio 2005 Professional - Edition - ENU (KB932232) - (http://support.microsoft.com/?kbid=932232) - - * CMake, which can be downloaded from http://www.cmake.org. - After installing, modify your path to include the cmake - binary. - - * Microsoft Visual C++ 2005 Express Edition, Visual Studio .Net - 2003 (7.1), or Visual Studio 2005 (8.0) compiler system. - - * If you are using Visual C++ 2005 Express Edition, you must - also install an appropriate Platform SDK. More information and - links to downloads for various Windows platforms is available - from - http://www.microsoft.com/downloads/details.aspx?familyid=0baf2 - b35-c656-4969-ace8-e4c0c0716adb. - - * If you are compiling from a Bazaar tree or making changes to - the parser, you need bison for Windows, which can be - downloaded from - http://gnuwin32.sourceforge.net/packages/bison.htm. Download - the package labeled "Complete package, excluding sources". - After installing the package, modify your path to include the - bison binary and ensure that this binary is accessible from - Visual Studio. - - * Cygwin might be necessary if you want to run the test script - or package the compiled binaries and support files into a Zip - archive. (Cygwin is needed only to test or package the - distribution, not to build it.) Cygwin is available from - http://cygwin.com. - - * 3GB to 5GB of disk space. - - The exact system requirements for Visual Studio can be found here: - http://msdn.microsoft.com/vstudio/Previous/2003/sysreqs/default.as - px and - http://msdn.microsoft.com/vstudio/products/sysreqs/default.aspx - - You also need a MySQL source distribution for Windows, which can - be obtained two ways: - - * Obtain a source distribution packaged by Oracle Corporation. - These are available from http://dev.mysql.com/downloads/. - - * Package a source distribution yourself from the latest Bazaar - developer source tree. For instructions on pulling the latest - source files, see Section 2.3.3, "Installing from the - Development Source Tree." - - If you find something not working as expected, or you have - suggestions about ways to improve the current build process on - Windows, please send a message to the win32 mailing list. See - Section 1.6.1, "MySQL Mailing Lists." - -2.5.9.1. Building MySQL from Source Using CMake and Visual Studio - - You can build MySQL on Windows by using a combination of cmake and - Microsoft Visual Studio .NET 2003 (7.1), Microsoft Visual Studio - 2005 (8.0), Microsoft Visual Studio 2008 (9.0) or Microsoft Visual - C++ 2005 Express Edition. You must have the appropriate Microsoft - Platform SDK installed. - -Note - - To compile from the source code on Windows you must use the - standard source distribution (for example, mysql-5.1.50.tar.gz). - You build from the same distribution as used to build MySQL on - Unix, Linux and other platforms. Do not use the Windows Source - distributions as they do not contain the necessary configuration - script and other files. - - Follow this procedure to build MySQL: - - 1. If you are installing from a packaged source distribution, - create a work directory (for example, C:\workdir), and unpack - the source distribution there using WinZip or another Windows - tool that can read .zip files. This directory is the work - directory in the following instructions. - -Note - You must run the commands in the win directory from the - top-level source directory. Do not change into the win - directory, as the commands will not be executed correctly. - - 2. Start a command shell. If you have not configured the PATH and - other environment variables for all command shells, you may be - able to start a command shell from the Start Menu within the - Windows Visual Studio menu that contains the necessary - environment changes. - - 3. Within the command shell, navigate to the work directory and - run the following command: -C:\workdir>win\configure.js options - If you have associated the .js file extension with an - application such as a text editor, then you may need to use - the following command to force configure.js to be executed as - a script: -C:\workdir>cscript win\configure.js options - These options are available for configure.js: - - + WITH_INNOBASE_STORAGE_ENGINE: Enable the InnoDB storage - engine. - - + WITH_PARTITION_STORAGE_ENGINE: Enable user-defined - partitioning. - - + WITH_ARCHIVE_STORAGE_ENGINE: Enable the ARCHIVE storage - engine. - - + WITH_BLACKHOLE_STORAGE_ENGINE: Enable the BLACKHOLE - storage engine. - - + WITH_EXAMPLE_STORAGE_ENGINE: Enable the EXAMPLE storage - engine. - - + WITH_FEDERATED_STORAGE_ENGINE: Enable the FEDERATED - storage engine. - - + WITH_NDBCLUSTER_STORAGE_ENGINE: Enable the NDBCLUSTER - storage engine in the MySQL server; cause binaries for - the MySQL Cluster management and data node, management - client, and other programs to be built. - This option is supported only in MySQL Cluster NDB 7.0 - (NDBCLUSTER storage engine versions 6.4.0 and later) - using the MySQL Cluster sources. It cannot be used to - enable clustering support in other MySQL source trees or - distributions. - - + MYSQL_SERVER_SUFFIX=suffix: Server suffix, default none. - - + COMPILATION_COMMENT=comment: Server comment, default - "Source distribution". - - + MYSQL_TCP_PORT=port: Server port, default 3306. - - + DISABLE_GRANT_OPTIONS: Disables the --bootstrap, - --skip-grant-tables, and --init-file options for mysqld. - This option is available as of MySQL 5.1.15. - For example (type the command on one line): -C:\workdir>win\configure.js WITH_INNOBASE_STORAGE_ENGINE - WITH_PARTITION_STORAGE_ENGINE MYSQL_SERVER_SUFFIX=-pro - - 4. From the work directory, execute the win\build-vs9.bat - (Windows Visual Studio 2008), win\build-vs8.bat (Windows - Visual Studio 2005), or win\build-vs71.bat (Windows Visual - Stidion 2003) script, depending on the version of Visual - Studio you have installed. The script invokes CMake, which - generates the mysql.sln solution file. - You can also use the corresponding 64-bit file (for example - win\build-vs8_x64.bat or win\build-vs9_x64.bat) to build the - 64-bit version of MySQL. However, you cannot build the 64-bit - version with Visual Studio Express Edition. You must use - Visual Studio 2005 (8.0) or higher. - - 5. From the work directory, open the generated mysql.sln file - with Visual Studio and select the proper configuration using - the Configuration menu. The menu provides Debug, Release, - RelwithDebInfo, MinRelInfo options. Then select Solution > - Build to build the solution. - Remember the configuration that you use in this step. It is - important later when you run the test script because that - script needs to know which configuration you used. - - 6. Test the server. The server built using the preceding - instructions expects that the MySQL base directory and data - directory are C:\mysql and C:\mysql\data by default. If you - want to test your server using the source tree root directory - and its data directory as the base directory and data - directory, you need to tell the server their path names. You - can either do this on the command line with the --basedir and - --datadir options, or by placing appropriate options in an - option file. (See Section 4.2.3.3, "Using Option Files.") If - you have an existing data directory elsewhere that you want to - use, you can specify its path name instead. - When the server is running in standalone fashion or as a - service based on your configuration, try to connect to it from - the mysql interactive command-line utility. - You can also run the standard test script, mysql-test-run.pl. - This script is written in Perl, so you'll need either Cygwin - or ActiveState Perl to run it. You may also need to install - the modules required by the script. To run the test script, - change location into the mysql-test directory under the work - directory, set the MTR_VS_CONFIG environment variable to the - configuration you selected earlier (or use the --vs-config - option), and invoke mysql-test-run.pl. For example (using - Cygwin and the bash shell): -shell> cd mysql-test -shell> export MTR_VS_CONFIG=debug -shell> ./mysql-test-run.pl --force --timer -shell> ./mysql-test-run.pl --force --timer --ps-protocol - - When you are satisfied that the programs you have built are - working correctly, stop the server. Now you can install the - distribution. One way to do this is to use the make_win_bin_dist - script in the scripts directory of the MySQL source distribution - (see Section 4.4.2, "make_win_bin_dist --- Package MySQL - Distribution as ZIP Archive"). This is a shell script, so you must - have Cygwin installed if you want to use it. It creates a Zip - archive of the built executables and support files that you can - unpack in the location at which you want to install MySQL. - - It is also possible to install MySQL by copying directories and - files directly: - - 1. Create the directories where you want to install MySQL. For - example, to install into C:\mysql, use these commands: -C:\> mkdir C:\mysql -C:\> mkdir C:\mysql\bin -C:\> mkdir C:\mysql\data -C:\> mkdir C:\mysql\share -C:\> mkdir C:\mysql\scripts - If you want to compile other clients and link them to MySQL, - you should also create several additional directories: -C:\> mkdir C:\mysql\include -C:\> mkdir C:\mysql\lib -C:\> mkdir C:\mysql\lib\debug -C:\> mkdir C:\mysql\lib\opt - If you want to benchmark MySQL, create this directory: -C:\> mkdir C:\mysql\sql-bench - Benchmarking requires Perl support. See Section 2.15, "Perl - Installation Notes." - - 2. From the work directory, copy into the C:\mysql directory the - following files and directories: -C:\> cd \workdir -C:\workdir> mkdir C:\mysql -C:\workdir> mkdir C:\mysql\bin -C:\workdir> copy client\Release\*.exe C:\mysql\bin -C:\workdir> copy sql\Release\mysqld.exe C:\mysql\bin\mysqld.exe -C:\workdir> xcopy scripts\*.* C:\mysql\scripts /E -C:\workdir> xcopy share\*.* C:\mysql\share /E - If you want to compile other clients and link them to MySQL, - you should also copy several libraries and header files: -C:\workdir> copy lib\Release\mysqlclient.lib C:\mysql\lib\debug -C:\workdir> copy lib\Release\libmysql.* C:\mysql\lib\debug -C:\workdir> copy lib\Release\zlib.* C:\mysql\lib\debug -C:\workdir> copy lib\Release\mysqlclient.lib C:\mysql\lib\opt -C:\workdir> copy lib\Release\libmysql.* C:\mysql\lib\opt -C:\workdir> copy lib\Release\zlib.* C:\mysql\lib\opt -C:\workdir> copy include\*.h C:\mysql\include -C:\workdir> copy libmysql\libmysql.def C:\mysql\include - -Note - If you have compiled a Debug, rather than Release solution, - you can replace Release with Debug in the source file names - shown above. - If you want to benchmark MySQL, you should also do this: -C:\workdir> xcopy sql-bench\*.* C:\mysql\bench /E - - After installation, set up and start the server in the same way as - for binary Windows distributions. This includes creating the - system tables by running mysql_install_db. For more information, - see Section 2.5, "Installing MySQL on Windows." diff --git a/dep/mysqllite/README b/dep/mysqllite/README index 8b6ccdfe5cfd4..769313d7e610d 100644 --- a/dep/mysqllite/README +++ b/dep/mysqllite/README @@ -1,49 +1,524 @@ +MySQL Server + This is a release of MySQL, a dual-license SQL database server. -MySQL is brought to you by the MySQL team at Sun Microsystems, Inc. +For the avoidance of doubt, this particular copy of the software +is released under the version 2 of the GNU General Public License. +MySQL is brought to you by the MySQL team at Oracle. + +Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. -License information can be found in these files: -- For GPL (free) distributions, see the COPYING file and - the EXCEPTIONS-CLIENT file. -- For commercial distributions, see the LICENSE.mysql file. +License information can be found in the COPYING file. + +This distribution may include materials developed by third +parties. For license and attribution notices for these +materials, please refer to the documentation that accompanies +this distribution (see the Licenses for Third-Party Components +appendix). A copy of the license/notices is also reproduced +below. GPLv2 Disclaimer For the avoidance of doubt, except that if any license choice -other than GPL or LGPL is available it will apply instead, Sun -elects to use only the General Public License version 2 (GPLv2) -at this time for any software where a choice of GPL license versions -is made available with the language indicating that GPLv2 or any -later version may be used, or where a choice of which version of -the GPL is applied is otherwise unspecified. - -For further information about MySQL or additional documentation, see: +other than GPL or LGPL is available it will apply instead, +Oracle elects to use only the General Public License version 2 +(GPLv2) at this time for any software where a choice of GPL +license versions is made available with the language indicating +that GPLv2 or any later version may be used, or where a choice +of which version of the GPL is applied is otherwise unspecified. + +For further information about MySQL or additional documentation, +see: - The latest information about MySQL: http://www.mysql.com - The current MySQL documentation: http://dev.mysql.com/doc -Some manual sections of special interest: - -- If you are migrating from an older version of MySQL, please read the - "Upgrading from..." section first! +Some Reference Manual sections of special interest: +- If you are migrating from an older version of MySQL, please + read the "Upgrading from..." section. - To see what MySQL can do, take a look at the features section. - For installation instructions, see the Installing and Upgrading -chapter. -- For the new features/bugfix history, see the Change History appendix. -- For the currently known bugs/misfeatures (known errors) see the -Problems - and Common Errors appendix. -- For a list of developers and other contributors, see the Credits + chapter. +- For the new features/bugfix history, see the MySQL Change History appendix. +- For currently known bugs, see the Errors and Common Problems + appendix. + +You can browse the MySQL Reference Manual online or download it +in any of several formats at the URL given earlier in this file. +Source distributions include a local copy of the manual in the +Docs directory. + +******************************************************************** + +Third-Party Component Notices + +********************************************************************* + +%%The following software may be included in this product: +FindGTest.cmake (part of CMake 2.8.0) + +Use of any of this software is governed by the terms of the license below: + +# Copyright 2009 Kitware, Inc. +# Copyright 2009 Philip Lowman +# Copyright 2009 Daniel Blezek +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#=========================================================================== +# (To distributed this file outside of CMake, substitute the full +# License text for the above reference.) +# +# Thanks to Daniel Blezek for the GTEST_ADD_TESTS code + + +Text of Copyright.txt mentioned above: + +CMake - Cross Platform Makefile Generator +Copyright 2000-2009 Kitware, Inc., Insight Software Consortium +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 names of Kitware, Inc., the Insight Software Consortium, + nor the names of their 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 +HOLDER 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. + +*************************************************************************** + +%%The following software may be included in this product: +Cmake + +Use of any of this software is governed by the terms of the license below: + +CMake is distributed under BSD License + + Copyright (c) 2008, Kitware, Inc. + 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 Kitware, Inc. 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 Kitware, Inc. "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 Kitware Inc. 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. + +Additional License(s) + +cmake-2.4.8/Utilities/cmtar/compat/gethostname.c: + gethostname.c: minimal substitute for missing gethostname() function + created 2000-Mar-02 jmk + requires SVR4 uname() and -lc + + by Jim Knoble + Copyright ? 2000 Jim Knoble + + 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 and + that both that copyright notice and this permission notice appear in + supporting documentation. + + This 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 author(s) 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. + +---------------------------------- + +* Originally written by Steven M. Bellovin while +* at the University of North Carolina at Chapel Hill. Later tweaked by +* a couple of people on Usenet. Completely overhauled by Rich $alz +* and Jim Berets in August, 1990. +* +* This code is in the public domain and has no copyright. + +------------------------------- + + THIS CODE IS SPECIFICALLY EXEMPTED FROM THE NCURSES PACKAGE COPYRIGHT. + You may freely copy it for use as a template for your own field types. + If you develop a field type that might be of general use, please send + it back to the ncurses maintainers for inclusion in the next version. + +************************************************************************** + + * Author : Per Foreby, perf@efd.lth.se + * Author : Juergen Pfeifer, juergen.pfeifer@gmx.net + +************************************************************************** + +---------------------------------------- + + Copyright (c) 2002 Insight Consortium. All rights reserved. + See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for + details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +-------------------------------------------- + + Skeleton parser for Yacc-like parsing with Bison, + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software + Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You 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. + + As a special exception, when this file is copied by Bison into a + Bison output file, you may use that output file without restriction. + This special exception was added by the Free Software Foundation + in version 1.24 of Bison. + +--------------------------------------------------- -A local copy of the MySQL Reference Manual can be found in the Docs -directory in GNU Info format. You can also browse the manual online or -download it in any of several formats at the URL given earlier in this -file. +cmake-2.4.8/Utilities/cmzlib/zlib.h: + zlib.h -- interface of the 'zlib' general purpose compression library + version 1.1.4, March 11th, 2002 -************************************************************ + Copyright (C) 1995-2002 Jean-loup Gailly and Mark Adler -IMPORTANT: + 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 + +---------------------------------------------- + + This source code was modified by Martin Hedenfalk for use in Curl. His + latest changes were done 2000-09-18. + + It has since been patched away like a madman by Daniel Stenberg to make it + better applied to curl conditions, and to make it not use globals, pollute + name space and more. This source code awaits a rewrite to work around the + paragraph 2 in the BSD licenses as explained below. + + Copyright (c) 1995, 1996, 1997, 1998, 1999 Kungliga Tekniska Hgskolan + It has since been patched and modified a lot by Daniel Stenberg to make it + better applied to curl conditions, and to make it not use globals, pollute + name space and more. This source code awaits a rewrite to work around the + paragraph 2 in the BSD licenses as explained below. + + Copyright (c) 1998, 1999 Kungliga Tekniska Hgskolan + (Royal Institute of Technology, Stockholm, Sweden). + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + 3. Neither the name of the Institute 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 INSTITUTE 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 INSTITUTE 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. + +--------------------------------------------- + + Permission to use, copy, modify, and distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED + WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF + MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND + CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER. + +-------------------------------------------------- + +cmake-2.4.8/Utilities/cmcurl/inet_pton.c, +cmake-2.4.8/Source/CTest/Curl/inet_pton.c: + This is from the BIND 4.9.4 release, modified to compile by itself + + Copyright (c) 1996 by Internet Software Consortium. + + Permission to use, copy, modify, and distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM + DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL + INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, + OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. + +------------------------------------------------------- + +* Copyright (C) 2001 by Eric Kidd. All rights reserved. +* Copyright (C) 2001 by Luke Howard. All rights reserved. +* Copyright (C) 2002 Ximian, Inc. +* +* 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 not be used to endorse or promote products +* derived from this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY +* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +* SUCH DAMAGE. + +--------------------------------------------------- + + Copyright (c) 1994 + The Regents of the University of California. All rights reserved. + + This code is derived from software contributed to Berkeley by + Chuck Karish of Mindcraft, Inc. + + 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. Neither the name of the University nor the names of its contributors + Copyright (c) 1985, 1986 The Regents of the University of California. + All rights reserved. + + This code is derived from software contributed to Berkeley by + James A. Woods, derived from original work by Spencer Thomas + and Joseph Orost. + +------------------------------------------------ + + Copyright (c) 1989, 1993, 1994 + The Regents of the University of California. All rights reserved. + + This code is derived from software contributed to Berkeley by + Guido van Rossum. + + Copyright (c) 1990 The Regents of the University of California. + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. All advertising materials mentioning features or use of this software + must display the following acknowledgement: + This product includes software developed by the University of + California, Berkeley and its contributors. + 4. Neither the name of the 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 REGENTS 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 REGENTS 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. + +------------------------------------------------------ + + Project ___| | | | _ \| | + / __| | | | |_) | | + | (__| |_| | _ <| |___ + \___|\___/|_| \_\_____| + + Copyright (C) 1998 - 2004, Daniel Stenberg, , et al. + + Copyright (C) 2004, Daniel Stenberg, , et al. + + This software is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at http://curl.haxx.se/docs/copyright.html. + + You may opt to use, copy, modify, merge, publish, distribute and/or sell + copies of the Software, and permit persons to whom the Software is + furnished to do so, under the terms of the COPYING file. + + This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + KIND, either express or implied. + +------------------------------------------------------------ -Bug or error reports should be sent to http://bugs.mysql.com. +*************************************************************************** + Copyright (c) 1998 Free Software Foundation, Inc. + Copyright (c) 1998,2000 Free Software Foundation, Inc. + + 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, distribute with modifications, 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 ABOVE 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. + + + Except as contained in this notice, the name(s) of the above copyright + holders shall not be used in advertising or otherwise to promote the sale, + use or other dealings in this Software without prior written + authorization. +*************************************************************************** +------------------------------------------------------ + + Copyright (c) 1997 Todd C. Miller + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. 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 ``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. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR + ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. *************************************************************************** @@ -52,31 +527,29 @@ Fred Fish's Dbug Library Use of any of this software is governed by the terms of the license below: - * - * N O T I C E * - * * - * Copyright Abandoned, 1987, Fred Fish * - * * - * * + * 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. * - * * + * 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 * + * 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. * - * * + * 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. * - * * + * 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. * - * + * chantability or fitness for any particular purpose. * *************************************************************************** @@ -85,28 +558,27 @@ dbug_analyze.c (part of Fred Fish's Dbug Library) Use of any of this software is governed by the terms of the license below: -* * -* 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. +* 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. * *************************************************************************** @@ -567,6 +1039,189 @@ Use of any of this software is governed by the terms of the license below: *************************************************************************** +%%The following software may be included in this product: +libevent + +Use of any of this software is governed by the terms of the license below: + +/* + * Copyright (c) 2000-2004 Niels Provos + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. 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. + */ + +Additional License(s) + +http://creativecommons.org/licenses/publicdomain + +*************************************************************************** + +%%The following software may be included in this product: +Async DNS Library + +Use of any of this software is governed by the terms of the license below: + +/* Async DNS Library + * Adam Langley + * http://www.imperialviolet.org/eventdns.html + * Public Domain code + * + * This software is Public Domain. To view a copy of the public domain dedication, + * visit http://creativecommons.org/licenses/publicdomain/ or send a letter to + * Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. + * + * I ask and expect, but do not require, that all derivative works contain an + * attribution similar to: + * Parts developed by Adam Langley + * + * You may wish to replace the word "Parts" with something else depending on + * the amount of original code. + * + * (Derivative works does not include programs which link against, run or include + * the source verbatim in their source distributions) + * + * Version: 0.1b + */ + +*************************************************************************** + +%%The following software may be included in this product: +log.c + +Use of any of this software is governed by the terms of the license below: + +/* $OpenBSD: err.c,v 1.2 2002/06/25 15:50:15 mickey Exp $ */ + +/* + * log.c + * + * Based on err.c, which was adapted from OpenBSD libc *err* *warn* code. + * + * Copyright (c) 2005 Nick Mathewson + * + * Copyright (c) 2000 Dug Song + * + * Copyright (c) 1993 + * The Regents of the University of California. All rights +reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the 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 REGENTS 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 REGENTS 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. + */ + +*************************************************************************** + +%%The following software may be included in this product: +min_heap.h + +Use of any of this software is governed by the terms of the license below: + +/* + * Copyright (c) 2006 Maxim Yegorushkin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. 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. + */ + +*************************************************************************** + +%%The following software may be included in this product: +win32.c + +Use of any of this software is governed by the terms of the license below: + +/* + * Copyright 2000-2002 Niels Provos + * Copyright 2003 Michael A. Davis + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. 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. + */ + +*************************************************************************** + %%The following software may be included in this product: regex++ @@ -666,6 +1321,111 @@ http://bioinfo.mbb.yale.edu/genome/yeast/cluster/database/mysql/include/t_ctype. *************************************************************************** +%%The following software may be included in this product: +SHA-1 in C + +Use of any of this software is governed by the terms of the license below: + + SHA-1 in C + By Steve Reid + 100% Public Domain + +Additional License(s) + +100% Public Domain + +*************************************************************************** + +%%The following software may be included in this product: +TCMalloc (part of google-perftools) + +Use of any of this software is governed by the terms of the license below: + +# Copyright (c) 1998-2006, Google Inc. +# 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 Google Inc. 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. + +Additional License(s) + +*** File src/tests/ptmalloc/thread-m.h contains this GPLv2 (or later) +text: + +/* Basic platform-independent macro definitions for mutexes and + thread-specific data. + Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Wolfram Gloger , 1996. + + The GNU C 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; either version 2 of the + License, or (at your option) any later version. + + The GNU C 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 the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite + 330, Boston, MA 02111-1307, USA. */ + + + +*** File src/tests/ptmalloc/malloc-machine.h contains this BSD like text: + +/* Basic platform-independent macro definitions for mutexes, + thread-specific data and parameters for malloc. + Posix threads (pthreads) version. + Copyright (C) 2004 Wolfram Gloger . + +Permission to use, copy, modify, distribute, and sell this software +and its documentation for any purpose is hereby granted without fee, +provided that (i) the above copyright notices and this permission +notice appear in all copies of the software and related documentation, +and (ii) the name of Wolfram Gloger may not be used in any advertising +or publicity relating to the software. + +THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + +IN NO EVENT SHALL WOLFRAM GLOGER BE LIABLE FOR ANY SPECIAL, +INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY +DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY +OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +*/ + +*************************************************************************** + %%The following software may be included in this product: The tz database @@ -717,6 +1477,184 @@ archived older versions of code and data; there is also a smaller HTTP mirror. *************************************************************************** +%%The following software may be included in this product: +UnicodeData.txt + +Use of any of this software is governed by the terms of the license below: + +Unicode Terms of Use + + For the general privacy policy governing access to this site, see the + Unicode Privacy Policy. For trademark usage, see the Unicode + Consortium (R) Trademarks and Logo Policy. + Notice to End User: Terms of Use + Carefully read the following legal agreement ("Agreement"). Use or + copying of the software and/or codes provided with this agreement (The + "Software") constitutes your acceptance of these terms + + 1. Unicode Copyright. + 1. Copyright (c) 1991-2008 Unicode, Inc. All rights reserved. + 2. Certain documents and files on this website contain a + legend indicating that "Modification is permitted." Any person + is hereby authorized, without fee, to modify such documents + and files to create derivative works conforming to the + Unicode (R) Standard, subject to Terms and Conditions herein. + 3. Any person is hereby authorized, without fee, to view, use, + reproduce, and distribute all documents and files solely for + informational purposes in the creation of products supporting + the Unicode Standard, subject to the Terms and Conditions + herein. + 4. Further specifications of rights and restrictions + pertaining to the use of the particular set of data files + known as the "Unicode Character Database" can be found in + Exhibit 1. + 5. Each version of the Unicode Standard has further + specifications of rights and restrictions of use. For the book + editions, these are found on the back of the title page. For + the online edition, certain files (such as the PDF files for + book chapters and code charts) carry specific restrictions. + All other files are covered under these general Terms of Use. + To request a permission to reproduce any part of the Unicode + Standard, please contact the Unicode Consortium. + 6. No license is granted to "mirror" the Unicode website where + a fee is charged for access to the "mirror" site. + 7. Modification is not permitted with respect to this + document. All copies of this document must be verbatim. + 2. Restricted Rights Legend. Any technical data or software which is + licensed to the United States of America, its agencies and/or + instrumentalities under this Agreement is commercial technical data + or commercial computer software developed exclusively at private + expense as defined in FAR 2.101, or DFARS 252.227-7014 (June 1995), + as applicable. For technical data, use, duplication, or disclosure + by the Government is subject to restrictions as set forth in DFARS + 202.227-7015 Technical Data, Commercial and Items (Nov 1995) and + this Agreement. For Software, in accordance with FAR 12-212 or DFARS + 227-7202, as applicable, use, duplication or disclosure by the + Government is subject to the restrictions set forth in this + Agreement. + 3. Warranties and Disclaimers. + 1. This publication and/or website may include technical or + typographical errors or other inaccuracies . Changes are + periodically added to the information herein; these changes + will be incorporated in new editions of the publication and/or + website. Unicode may make improvements and/or changes in the + product(s) and/or program(s) described in this publication + and/or website at any time. + 2. If this file has been purchased on magnetic or optical + media from Unicode, Inc. the sole and exclusive remedy for any + claim will be exchange of the defective media within ninety + (90) days of original purchase. + 3. EXCEPT AS PROVIDED IN SECTION C.2, THIS PUBLICATION AND/OR + SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND + EITHER EXPRESS, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT + LIMITED TO, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + PARTICULAR PURPOSE, OR NON-INFRINGEMENT. UNICODE AND ITS + LICENSORS ASSUME NO RESPONSIBILITY FOR ERRORS OR OMISSIONS IN + THIS PUBLICATION AND/OR SOFTWARE OR OTHER DOCUMENTS WHICH ARE + REFERENCED BY OR LINKED TO THIS PUBLICATION OR THE UNICODE + WEBSITE. + 4. Waiver of Damages. In no event shall Unicode or its licensors be + liable for any special, incidental, indirect or consequential + damages of any kind, or any damages whatsoever, whether or not + Unicode was advised of the possibility of the damage, including, + without limitation, those resulting from the following: loss of use, + data or profits, in connection with the use, modification or + distribution of this information or its derivatives. + 5. Trademarks. + 1. Unicode and the Unicode logo are registered trademarks of + Unicode, Inc. + 2. This site contains product names and corporate names of + other companies. All product names and company names and logos + mentioned herein are the trademarks or registered trademarks + of their respective owners. Other products and corporate names + mentioned herein which are trademarks of a third party are + used only for explanation and for the owners' benefit and with + no intent to infringe. + 3. Use of third party products or information referred to + herein is at the user's risk. + 6. Miscellaneous. + 1. Jurisdiction and Venue. This server is operated from a + location in the State of California, United States of America. + Unicode makes no representation that the materials are + appropriate for use in other locations. If you access this + server from other locations, you are responsible for + compliance with local laws. This Agreement, all use of this + site and any claims and damages resulting from use of this + site are governed solely by the laws of the State of + California without regard to any principles which would apply + the laws of a different jurisdiction. The user agrees that any + disputes regarding this site shall be resolved solely in the + courts located in Santa Clara County, California. The user + agrees said courts have personal jurisdiction and agree to + waive any right to transfer the dispute to any other forum. + 2. Modification by Unicode Unicode shall have the right to + modify this Agreement at any time by posting it to this site. + The user may not assign any part of this Agreement without + Unicode's prior written consent. + 3. Taxes. The user agrees to pay any taxes arising from access + to this website or use of the information herein, except for + those based on Unicode's net income. + 4. Severability. If any provision of this Agreement is + declared invalid or unenforceable, the remaining provisions of + this Agreement shall remain in effect. + 5. Entire Agreement. This Agreement constitutes the entire + agreement between the parties. + +EXHIBIT 1 +UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE + + Unicode Data Files include all data files under the directories +http://www.unicode.org/Public/, http://www.unicode.org/reports/, and +http://www.unicode.org/cldr/data/ . Unicode Software includes any source code +published in the Unicode Standard or under the directories +http://www.unicode.org/Public/, http://www.unicode.org/reports/, and +http://www.unicode.org/cldr/data/. + + NOTICE TO USER: Carefully read the following legal agreement. BY +DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S DATA FILES +("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"), YOU UNEQUIVOCALLY ACCEPT, AND +AGREE TO BE BOUND BY, ALL OF THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU +DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES +OR SOFTWARE. + + COPYRIGHT AND PERMISSION NOTICE + + Copyright (c) 1991-2008 Unicode, Inc. All rights reserved. Distributed under +the Terms of Use in http://www.unicode.org/copyright.html. + + Permission is hereby granted, free of charge, to any person obtaining a copy +of the Unicode data files and any associated documentation (the "Data Files") or +Unicode software and any associated documentation (the "Software") to deal in +the Data Files or Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, and/or sell copies of +the Data Files or Software, and to permit persons to whom the Data Files or +Software are furnished to do so, provided that (a) the above copyright notice(s) +and this permission notice appear with all copies of the Data Files or Software, +(b) both the above copyright notice(s) and this permission notice appear in +associated documentation, and (c) there is clear notice in each modified Data +File or in the Software as well as in the documentation associated with the Data +File(s) or Software that the data or software has been modified. + + THE DATA FILES AND SOFTWARE ARE 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 OF THIRD +PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS +NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL +DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING +OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA FILES OR SOFTWARE. + + Except as contained in this notice, the name of a copyright holder shall not +be used in advertising or otherwise to promote the sale, use or other dealings +in these Data Files or Software without prior written authorization of the +copyright holder. + + Unicode and the Unicode logo are trademarks of Unicode, Inc., and may be +registered in some jurisdictions. All other trademarks and registered trademarks +mentioned herein are the property of their respective owners. + +*************************************************************************** + %%The following software may be included in this product: zlib @@ -750,6 +1688,35 @@ Use of any of this software is governed by the terms of the license below: *************************************************************************** +%%The following software may be included in this product: +dtoa.c + +Use of any of this software is governed by the terms of the license below: + +/**************************************************************** + + 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. + + ***************************************************************/ + +*************************************************************************** + %%The following software may be included in this product: getarg.{c,h} @@ -1251,7 +2218,7 @@ http://src.opensolaris.org/source/xref//sfw/usr/src/cmd/gdb/gdb-6.3/include/ieee /* IEEE Standard 695-1980 "Universal Format for Object Modules" -header file + header file Contributed by Cygnus Support. */ *************************************************************************** @@ -1281,8 +2248,7 @@ Use of any of this software is governed by the terms of the license below: You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -02111-1307, USA. + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -*************************************************************************** +********************************************************************** diff --git a/dep/mysqllite/VERSION b/dep/mysqllite/VERSION new file mode 100644 index 0000000000000..f85cac84d7e54 --- /dev/null +++ b/dep/mysqllite/VERSION @@ -0,0 +1,4 @@ +MYSQL_VERSION_MAJOR=5 +MYSQL_VERSION_MINOR=5 +MYSQL_VERSION_PATCH=9 +MYSQL_VERSION_EXTRA= diff --git a/dep/mysqllite/cmake/character_sets.cmake b/dep/mysqllite/cmake/character_sets.cmake new file mode 100644 index 0000000000000..6b7df9039c80c --- /dev/null +++ b/dep/mysqllite/cmake/character_sets.cmake @@ -0,0 +1,43 @@ +# 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +#Charsets and collations +IF(NOT DEFAULT_CHARSET) +SET(DEFAULT_CHARSET "latin1") +ENDIF() + +IF(NOT DEFAULT_COLLATIONS) +SET(DEFAULT_COLLATION "latin1_swedish_ci") +ENDIF() + +SET(CHARSETS_AVAILABLE +binary armscii8 ascii big5 cp1250 cp1251 cp1256 cp1257 +cp850 cp852 cp866 cp932 dec8 euckr gb2312 gbk geostd8 +greek hebrew hp8 keybcs2 koi8r koi8u +latin1 latin2 latin5 latin7 macce macroman +swe7 tis620 ucs2 utf8 utf8mb4 utf16 utf32) + +SET(MYSQL_DEFAULT_CHARSET_NAME "${DEFAULT_CHARSET}") +SET(MYSQL_DEFAULT_COLLATION_NAME "${DEFAULT_COLLATION}") + +FOREACH(cs in ${CHARSETS_AVAILABLE}) + SET(HAVE_CHARSET_${cs} 1) +ENDFOREACH() + +SET(HAVE_UCA_COLLATIONS 1) + +SET(HAVE_UTF8_GENERAL_CS 1) +SET(USE_MB 1) +SET(USE_MB_IDENT 1) diff --git a/dep/mysqllite/cmake/mysql_version.cmake b/dep/mysqllite/cmake/mysql_version.cmake new file mode 100644 index 0000000000000..3c20f77e9d358 --- /dev/null +++ b/dep/mysqllite/cmake/mysql_version.cmake @@ -0,0 +1,107 @@ +# 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +# +# Global constants, only to be changed between major releases. +# + +SET(SHARED_LIB_MAJOR_VERSION "16") +SET(PROTOCOL_VERSION "10") +SET(DOT_FRM_VERSION "6") + +# Generate "something" to trigger cmake rerun when VERSION changes +CONFIGURE_FILE( + ${CMAKE_CURRENT_SOURCE_DIR}/VERSION + ${CMAKE_CURRENT_BINARY_DIR}/VERSION.dep +) + +# Read value for a variable from VERSION. + +MACRO(MYSQL_GET_CONFIG_VALUE keyword var) + IF(NOT ${var}) + FILE (STRINGS ${CMAKE_CURRENT_SOURCE_DIR}/VERSION str REGEX "^[ ]*${keyword}=") + IF(str) + STRING(REPLACE "${keyword}=" "" str ${str}) + STRING(REGEX REPLACE "[ ].*" "" str "${str}") + SET(${var} ${str}) + ENDIF() + ENDIF() +ENDMACRO() + + +# Read mysql version for configure script + +MACRO(GET_MYSQL_VERSION) + MYSQL_GET_CONFIG_VALUE("MYSQL_VERSION_MAJOR" MAJOR_VERSION) + MYSQL_GET_CONFIG_VALUE("MYSQL_VERSION_MINOR" MINOR_VERSION) + MYSQL_GET_CONFIG_VALUE("MYSQL_VERSION_PATCH" PATCH_VERSION) + MYSQL_GET_CONFIG_VALUE("MYSQL_VERSION_EXTRA" EXTRA_VERSION) + + IF(NOT MAJOR_VERSION OR NOT MINOR_VERSION OR NOT PATCH_VERSION) + MESSAGE(FATAL_ERROR "VERSION file cannot be parsed.") + ENDIF() + + SET(VERSION "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}${EXTRA_VERSION}") + MESSAGE("-- MySQL ${VERSION}") + SET(MYSQL_BASE_VERSION "${MAJOR_VERSION}.${MINOR_VERSION}" CACHE INTERNAL "MySQL Base version") + SET(MYSQL_NO_DASH_VERSION "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}") + STRING(REPLACE "-" "_" MYSQL_RPM_VERSION "${VERSION}") + MATH(EXPR MYSQL_VERSION_ID "10000*${MAJOR_VERSION} + 100*${MINOR_VERSION} + ${PATCH_VERSION}") +ENDMACRO() + +# Get mysql version and other interesting variables +GET_MYSQL_VERSION() + +SET(MYSQL_TCP_PORT_DEFAULT "3306") + +IF(NOT MYSQL_TCP_PORT) + SET(MYSQL_TCP_PORT ${MYSQL_TCP_PORT_DEFAULT}) + SET(MYSQL_TCP_PORT_DEFAULT "0") +ELSEIF(MYSQL_TCP_PORT EQUAL MYSQL_TCP_PORT_DEFAULT) + SET(MYSQL_TCP_PORT_DEFAULT "0") +ENDIF() + + +IF(NOT MYSQL_UNIX_ADDR) + SET(MYSQL_UNIX_ADDR "/tmp/mysql.sock") +ENDIF() +IF(NOT COMPILATION_COMMENT) + SET(COMPILATION_COMMENT "Source distribution lite for Trinity Core") +ENDIF() + +# Windows 'date' command has unpredictable output, so cannot rely on it to +# set MYSQL_COPYRIGHT_YEAR - if someone finds a portable way to do so then +# it might be useful +# EXECUTE_PROCESS(COMMAND "date" "/T" OUTPUT_VARIABLE TMP_DATE) +# STRING(REGEX REPLACE "(..)/(..)/..(..).*" "\\3\\2\\1" MYSQL_COPYRIGHT_YEAR ${TMP_DATE}) + +# Add version information to the exe and dll files +# Refer to http://msdn.microsoft.com/en-us/library/aa381058(VS.85).aspx +# for more info. +IF(MSVC) + GET_FILENAME_COMPONENT(MYSQL_CMAKE_SCRIPT_DIR ${CMAKE_CURRENT_LIST_FILE} PATH) + + SET(FILETYPE VFT_DLL) + CONFIGURE_FILE(${MYSQL_CMAKE_SCRIPT_DIR}/versioninfo.rc.in + ${CMAKE_CURRENT_BINARY_DIR}/versioninfo_dll.rc) + + FUNCTION(ADD_VERSION_INFO target sources_var) + SET(rcfile ${CMAKE_CURRENT_BINARY_DIR}/versioninfo_dll.rc) + SET(${sources_var} ${${sources_var}} ${rcfile} PARENT_SCOPE) + ENDFUNCTION() +ELSE() + FUNCTION(ADD_VERSION_INFO) + ENDFUNCTION() +ENDIF() diff --git a/dep/mysqllite/cmake/os/Windows.cmake b/dep/mysqllite/cmake/os/Windows.cmake new file mode 100644 index 0000000000000..19c230cc3d587 --- /dev/null +++ b/dep/mysqllite/cmake/os/Windows.cmake @@ -0,0 +1,142 @@ +# Copyright (C) 2010 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +# This file includes Windows specific hacks, mostly around compiler flags + +INCLUDE (CheckCSourceCompiles) +INCLUDE (CheckCXXSourceCompiles) +INCLUDE (CheckStructHasMember) +INCLUDE (CheckLibraryExists) +INCLUDE (CheckFunctionExists) +INCLUDE (CheckCCompilerFlag) +INCLUDE (CheckCSourceRuns) +INCLUDE (CheckSymbolExists) +INCLUDE (CheckTypeSize) + +# avoid running system checks by using pre-cached check results +# system checks are expensive on VS since every tiny program is to be compiled in +# a VC solution. +GET_FILENAME_COMPONENT(_SCRIPT_DIR ${CMAKE_CURRENT_LIST_FILE} PATH) +INCLUDE(${_SCRIPT_DIR}/WindowsCache.cmake) + + +# OS display name (version_compile_os etc). +# Used by the test suite to ignore bugs on some platforms, +IF(CMAKE_SIZEOF_VOID_P MATCHES 8) + SET(SYSTEM_TYPE "Win64") +ELSE() + SET(SYSTEM_TYPE "Win32") +ENDIF() + +# Intel compiler is almost Visual C++ +# (same compile flags etc). Set MSVC flag +IF(CMAKE_C_COMPILER MATCHES "icl") + SET(MSVC TRUE) +ENDIF() + +ADD_DEFINITIONS("-D__WIN__ -D_CRT_SECURE_NO_DEPRECATE") +ADD_DEFINITIONS("-D_WIN32_WINNT=0x0501") +# Speed up build process excluding unused header files +ADD_DEFINITIONS("-DWIN32_LEAN_AND_MEAN") + +# Adjust compiler and linker flags +IF(MINGW AND CMAKE_SIZEOF_VOID_P EQUAL 4) + # mininal architecture flags, i486 enables GCC atomics + ADD_DEFINITIONS(-march=i486) +ENDIF() + +IF(MSVC) + # Remove support for exceptions + FOREACH(flag CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_INIT) + STRING(REPLACE "/EHsc" "" "${flag}" "${${flag}}") + ENDFOREACH() + + # Fix CMake's predefined huge stack size + STRING(REGEX REPLACE "/STACK:([^ ]+)" "" CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}") + + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4800 /wd4805 /wd4996 /wd4244 /wd4267 /wd4090") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4800 /wd4805 /wd4996 /we4099 /wd4244 /wd4267") +ENDIF() + +# System checks +SET(SIGNAL_WITH_VIO_CLOSE 1) # Something that runtime team needs + +# IPv6 constants appeared in Vista SDK first. We need to define them in any case if they are +# not in headers, to handle dual mode sockets correctly. +CHECK_SYMBOL_EXISTS(IPPROTO_IPV6 "winsock2.h" HAVE_IPPROTO_IPV6) +IF(NOT HAVE_IPPROTO_IPV6) + SET(HAVE_IPPROTO_IPV6 41) +ENDIF() +CHECK_SYMBOL_EXISTS(IPV6_V6ONLY "winsock2.h;ws2ipdef.h" HAVE_IPV6_V6ONLY) +IF(NOT HAVE_IPV6_V6ONLY) + SET(IPV6_V6ONLY 27) +ENDIF() + +# Some standard functions exist there under different +# names (e.g popen is _popen or strok_r is _strtok_s) +# If a replacement function exists, HAVE_FUNCTION is +# defined to 1. CMake variable will also +# be defined to the replacement name. +# So for example, CHECK_FUNCTION_REPLACEMENT(popen _popen) +# will define HAVE_POPEN to 1 and set variable named popen +# to _popen. If the header template, one needs to have +# cmakedefine popen @popen@ which will expand to +# define popen _popen after CONFIGURE_FILE + +MACRO(CHECK_FUNCTION_REPLACEMENT function replacement) + STRING(TOUPPER ${function} function_upper) + CHECK_FUNCTION_EXISTS(${function} HAVE_${function_upper}) + IF(NOT HAVE_${function_upper}) + CHECK_FUNCTION_EXISTS(${replacement} HAVE_${replacement}) + IF(HAVE_${replacement}) + SET(HAVE_${function_upper} 1 ) + SET(${function} ${replacement}) + ENDIF() + ENDIF() +ENDMACRO() +MACRO(CHECK_SYMBOL_REPLACEMENT symbol replacement header) + STRING(TOUPPER ${symbol} symbol_upper) + CHECK_SYMBOL_EXISTS(${symbol} ${header} HAVE_${symbol_upper}) + IF(NOT HAVE_${symbol_upper}) + CHECK_SYMBOL_EXISTS(${replacement} ${header} HAVE_${replacement}) + IF(HAVE_${replacement}) + SET(HAVE_${symbol_upper} 1) + SET(${symbol} ${replacement}) + ENDIF() + ENDIF() +ENDMACRO() + +CHECK_SYMBOL_REPLACEMENT(S_IROTH _S_IREAD sys/stat.h) +CHECK_SYMBOL_REPLACEMENT(S_IFIFO _S_IFIFO sys/stat.h) +CHECK_SYMBOL_REPLACEMENT(SIGQUIT SIGTERM signal.h) +CHECK_SYMBOL_REPLACEMENT(SIGPIPE SIGINT signal.h) +CHECK_SYMBOL_REPLACEMENT(isnan _isnan float.h) +CHECK_SYMBOL_REPLACEMENT(finite _finite float.h) +CHECK_FUNCTION_REPLACEMENT(popen _popen) +CHECK_FUNCTION_REPLACEMENT(pclose _pclose) +CHECK_FUNCTION_REPLACEMENT(access _access) +CHECK_FUNCTION_REPLACEMENT(strcasecmp _stricmp) +CHECK_FUNCTION_REPLACEMENT(strncasecmp _strnicmp) +CHECK_FUNCTION_REPLACEMENT(snprintf _snprintf) +CHECK_FUNCTION_REPLACEMENT(strtok_r strtok_s) +CHECK_FUNCTION_REPLACEMENT(strtoll _strtoi64) +CHECK_FUNCTION_REPLACEMENT(strtoull _strtoui64) +CHECK_FUNCTION_REPLACEMENT(vsnprintf _vsnprintf) +CHECK_TYPE_SIZE(ssize_t SIZE_OF_SSIZE_T) +IF(NOT HAVE_SIZE_OF_SSIZE_T) + SET(ssize_t SSIZE_T) +ENDIF() + +SET(FN_NO_CASE_SENSE 1) diff --git a/dep/mysqllite/cmake/os/WindowsCache.cmake b/dep/mysqllite/cmake/os/WindowsCache.cmake new file mode 100644 index 0000000000000..ff068bfeaf617 --- /dev/null +++ b/dep/mysqllite/cmake/os/WindowsCache.cmake @@ -0,0 +1,356 @@ +# Copyright (C) 2010 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +# Avoid system checks on Windows by pre-caching results. Most of the system checks +# are not relevant for Windows anyway and it takes lot more time to run them, +# since CMake to creates a Visual Studio project for each tiny test. +# Note that only we cache values on VC++ only, MinGW would give slightly +# different results. + +IF(MSVC) +SET(HAVE_ACCESS 1 CACHE INTERNAL "") +SET(HAVE_AIO_H CACHE INTERNAL "") +SET(HAVE_AIO_READ CACHE INTERNAL "") +SET(HAVE_ALARM CACHE INTERNAL "") +SET(HAVE_ALLOCA_H CACHE INTERNAL "") +SET(HAVE_ARPA_INET_H CACHE INTERNAL "") +SET(HAVE_ASM_MSR_H CACHE INTERNAL "") +SET(HAVE_BACKTRACE CACHE INTERNAL "") +SET(HAVE_BACKTRACE_SYMBOLS CACHE INTERNAL "") +SET(HAVE_BACKTRACE_SYMBOLS_FD CACHE INTERNAL "") +SET(HAVE_BFILL CACHE INTERNAL "") +SET(HAVE_BMOVE CACHE INTERNAL "") +SET(HAVE_BSD_SIGNALS CACHE INTERNAL "") +SET(HAVE_BSEARCH 1 CACHE INTERNAL "") +SET(HAVE_BSS_START CACHE INTERNAL "") +SET(HAVE_BZERO CACHE INTERNAL "") +SET(HAVE_CHOWN CACHE INTERNAL "") +SET(HAVE_CLOCK_GETTIME CACHE INTERNAL "") +SET(HAVE_COMPRESS CACHE INTERNAL "") +SET(HAVE_CRYPT CACHE INTERNAL "") +SET(HAVE_CRYPT_H CACHE INTERNAL "") +SET(HAVE_CUSERID CACHE INTERNAL "") +SET(HAVE_CXX_NEW 1 CACHE INTERNAL "") +SET(HAVE_DECL_MADVISE CACHE INTERNAL "") +SET(HAVE_DIRECTIO CACHE INTERNAL "") +SET(HAVE_DIRENT_H CACHE INTERNAL "") +SET(HAVE_DLERROR CACHE INTERNAL "") +SET(HAVE_DLFCN_H CACHE INTERNAL "") +SET(HAVE_DLOPEN CACHE INTERNAL "") +SET(HAVE_DOPRNT CACHE INTERNAL "") +SET(HAVE_EXECINFO_H CACHE INTERNAL "") +SET(HAVE_FCHMOD CACHE INTERNAL "") +SET(HAVE_FCNTL CACHE INTERNAL "") +SET(HAVE_FCNTL_H 1 CACHE INTERNAL "") +SET(HAVE_FCNTL_NONBLOCK CACHE INTERNAL "") +SET(HAVE_FCONVERT CACHE INTERNAL "") +SET(HAVE_FDATASYNC CACHE INTERNAL "") +SET(HAVE_DECL_FDATASYNC CACHE INTERNAL "") +SET(HAVE_FENV_H CACHE INTERNAL "") +SET(HAVE_FESETROUND CACHE INTERNAL "") +SET(HAVE_FGETLN CACHE INTERNAL "") +SET(HAVE_FINITE CACHE INTERNAL "") +SET(HAVE_FINITE_IN_MATH_H CACHE INTERNAL "") +SET(HAVE_FLOATINGPOINT_H CACHE INTERNAL "") +SET(HAVE_FLOAT_H 1 CACHE INTERNAL "") +SET(HAVE_FLOCKFILE CACHE INTERNAL "") +SET(HAVE_FNMATCH_H CACHE INTERNAL "") +SET(HAVE_FPSETMASK CACHE INTERNAL "") +SET(HAVE_FPU_CONTROL_H CACHE INTERNAL "") +SET(HAVE_FSEEKO CACHE INTERNAL "") +SET(HAVE_FSYNC CACHE INTERNAL "") +SET(HAVE_FTIME 1 CACHE INTERNAL "") +SET(HAVE_FTRUNCATE CACHE INTERNAL "") +SET(HAVE_GETADDRINFO 1 CACHE INTERNAL "") +SET(HAVE_GETCWD 1 CACHE INTERNAL "") +SET(HAVE_GETHOSTBYADDR_R CACHE INTERNAL "") +SET(HAVE_GETHOSTBYNAME_R CACHE INTERNAL "") +SET(HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE CACHE INTERNAL "") +SET(HAVE_GETHOSTBYNAME_R_RETURN_INT CACHE INTERNAL "") +SET(HAVE_GETHRTIME CACHE INTERNAL "") +SET(HAVE_GETLINE CACHE INTERNAL "") +SET(HAVE_GETNAMEINFO CACHE INTERNAL "") +SET(HAVE_GETPAGESIZE CACHE INTERNAL "") +SET(HAVE_GETPASS CACHE INTERNAL "") +SET(HAVE_GETPASSPHRASE CACHE INTERNAL "") +SET(HAVE_GETPWNAM CACHE INTERNAL "") +SET(HAVE_GETPWUID CACHE INTERNAL "") +SET(HAVE_GETRLIMIT CACHE INTERNAL "") +SET(HAVE_GETRUSAGE CACHE INTERNAL "") +SET(HAVE_GETTIMEOFDAY CACHE INTERNAL "") +SET(HAVE_GETWD CACHE INTERNAL "") +SET(HAVE_GMTIME_R CACHE INTERNAL "") +SET(HAVE_GRP_H CACHE INTERNAL "") +SET(HAVE_IA64INTRIN_H CACHE INTERNAL "") +SET(HAVE_IEEEFP_H CACHE INTERNAL "") +SET(HAVE_INDEX CACHE INTERNAL "") +SET(HAVE_INITGROUPS CACHE INTERNAL "") +SET(HAVE_INTTYPES_H CACHE INTERNAL "") +SET(HAVE_IPPROTO_IPV6 CACHE INTERNAL "") +SET(HAVE_IPV6 TRUE CACHE INTERNAL "") +SET(HAVE_IPV6_V6ONLY 1 CACHE INTERNAL "") +SET(HAVE_ISINF CACHE INTERNAL "") +SET(HAVE_ISNAN CACHE INTERNAL "") +SET(HAVE_ISSETUGID CACHE INTERNAL "") +SET(HAVE_LANGINFO_H CACHE INTERNAL "") +SET(HAVE_LDIV 1 CACHE INTERNAL "") +SET(HAVE_LIMITS_H 1 CACHE INTERNAL "") +SET(HAVE_LOCALE_H 1 CACHE INTERNAL "") +SET(HAVE_LOCALTIME_R CACHE INTERNAL "") +SET(HAVE_LOG2 CACHE INTERNAL "") +SET(HAVE_LONGJMP 1 CACHE INTERNAL "") +SET(HAVE_LRAND48 CACHE INTERNAL "") +SET(HAVE_LSTAT CACHE INTERNAL "") +SET(HAVE_MADVISE CACHE INTERNAL "") +SET(HAVE_MALLINFO CACHE INTERNAL "") +SET(HAVE_MALLOC_H 1 CACHE INTERNAL "") +SET(HAVE_MEMALIGN CACHE INTERNAL "") +SET(HAVE_MEMCPY 1 CACHE INTERNAL "") +SET(HAVE_MEMMOVE 1 CACHE INTERNAL "") +SET(HAVE_MEMORY_H 1 CACHE INTERNAL "") +SET(HAVE_MKSTEMP CACHE INTERNAL "") +SET(HAVE_MLOCK CACHE INTERNAL "") +SET(HAVE_MLOCKALL CACHE INTERNAL "") +SET(HAVE_MMAP CACHE INTERNAL "") +SET(HAVE_MMAP64 CACHE INTERNAL "") +SET(HAVE_NETINET_IN6_H CACHE INTERNAL "") +SET(HAVE_NETINET_IN_H CACHE INTERNAL "") +SET(HAVE_NL_LANGINFO CACHE INTERNAL "") +SET(HAVE_PASE_ENVIRONMENT CACHE INTERNAL "") +SET(HAVE_PATHS_H CACHE INTERNAL "") +SET(HAVE_PCLOSE CACHE INTERNAL "") +SET(HAVE_PERROR 1 CACHE INTERNAL "") +SET(HAVE_PEERCRED CACHE INTERNAL "") +SET(HAVE_POLL_H CACHE INTERNAL "") +SET(HAVE_POPEN CACHE INTERNAL "") +SET(HAVE_POLL CACHE INTERNAL "") +SET(HAVE_PORT_CREATE CACHE INTERNAL "") +SET(HAVE_PORT_H CACHE INTERNAL "") +SET(HAVE_POSIX_FALLOCATE CACHE INTERNAL "") +SET(HAVE_POSIX_SIGNALS CACHE INTERNAL "") +SET(HAVE_PREAD CACHE INTERNAL "") +SET(HAVE_PRINTSTACK CACHE INTERNAL "") +SET(HAVE_PTHREAD_ATTR_CREATE CACHE INTERNAL "") +SET(HAVE_PTHREAD_ATTR_GETSTACKSIZE CACHE INTERNAL "") +SET(HAVE_PTHREAD_ATTR_SETSCOPE CACHE INTERNAL "") +SET(HAVE_PTHREAD_ATTR_SETSTACKSIZE CACHE INTERNAL "") +SET(HAVE_PTHREAD_CONDATTR_CREATE CACHE INTERNAL "") +SET(HAVE_PTHREAD_CONDATTR_SETCLOCK CACHE INTERNAL "") +SET(HAVE_PTHREAD_INIT CACHE INTERNAL "") +SET(HAVE_PTHREAD_KEY_DELETE CACHE INTERNAL "") +SET(HAVE_PTHREAD_RWLOCK_RDLOCK CACHE INTERNAL "") +SET(HAVE_PTHREAD_SIGMASK CACHE INTERNAL "") +SET(HAVE_PTHREAD_THREADMASK CACHE INTERNAL "") +SET(HAVE_PTHREAD_YIELD_NP CACHE INTERNAL "") +SET(HAVE_PTHREAD_YIELD_ZERO_ARG CACHE INTERNAL "") +SET(HAVE_PUTENV 1 CACHE INTERNAL "") +SET(HAVE_PWD_H CACHE INTERNAL "") +SET(HAVE_RDTSCLL CACHE INTERNAL "") +SET(HAVE_READDIR_R CACHE INTERNAL "") +SET(HAVE_READLINK CACHE INTERNAL "") +SET(HAVE_READ_REAL_TIME CACHE INTERNAL "") +SET(HAVE_REALPATH CACHE INTERNAL "") +SET(HAVE_REGCOMP CACHE INTERNAL "") +SET(HAVE_RENAME 1 CACHE INTERNAL "") +SET(HAVE_RE_COMP CACHE INTERNAL "") +SET(HAVE_RINT CACHE INTERNAL "") +SET(HAVE_RWLOCK_INIT CACHE INTERNAL "") +SET(HAVE_SCHED_H CACHE INTERNAL "") +SET(HAVE_SCHED_YIELD CACHE INTERNAL "") +SET(HAVE_SELECT 1 CACHE INTERNAL "") +SET(HAVE_SELECT_H CACHE INTERNAL "") +SET(HAVE_SEMAPHORE_H CACHE INTERNAL "") +SET(HAVE_SETENV CACHE INTERNAL "") +SET(HAVE_SETFD CACHE INTERNAL "") +SET(HAVE_SETLOCALE 1 CACHE INTERNAL "") +SET(HAVE_SHMAT CACHE INTERNAL "") +SET(HAVE_SHMCTL CACHE INTERNAL "") +SET(HAVE_SHMDT CACHE INTERNAL "") +SET(HAVE_SHMGET CACHE INTERNAL "") +SET(HAVE_SIGACTION CACHE INTERNAL "") +SET(HAVE_SIGADDSET CACHE INTERNAL "") +SET(HAVE_SIGEMPTYSET CACHE INTERNAL "") +SET(HAVE_SIGHOLD CACHE INTERNAL "") +SET(HAVE_SIGINT 1 CACHE INTERNAL "") +SET(HAVE_SIGPIPE CACHE INTERNAL "") +SET(HAVE_SIGQUIT CACHE INTERNAL "") +SET(HAVE_SIGSET CACHE INTERNAL "") +SET(HAVE_SIGTERM 1 CACHE INTERNAL "") +SET(HAVE_SIGTHREADMASK CACHE INTERNAL "") +SET(HAVE_SIGWAIT CACHE INTERNAL "") +SET(HAVE_SIZEOF_BOOL FALSE CACHE INTERNAL "") +SET(HAVE_SIZEOF_CHAR TRUE CACHE INTERNAL "") +SET(SIZEOF_CHAR 1 CACHE INTERNAL "") +SET(HAVE_SIZEOF_CHARP TRUE CACHE INTERNAL "") +SET(SIZEOF_CHARP ${CMAKE_SIZEOF_VOID_P} CACHE INTERNAL "") +SET(HAVE_SIZEOF_IN6_ADDR TRUE CACHE INTERNAL "") +SET(HAVE_SIZEOF_INT TRUE CACHE INTERNAL "") +SET(SIZEOF_INT 4 CACHE INTERNAL "") +SET(HAVE_SIZEOF_INT16 FALSE CACHE INTERNAL "") +SET(HAVE_SIZEOF_INT32 FALSE CACHE INTERNAL "") +SET(HAVE_SIZEOF_INT64 FALSE CACHE INTERNAL "") +SET(HAVE_SIZEOF_INT8 FALSE CACHE INTERNAL "") +SET(HAVE_SIZEOF_LONG TRUE CACHE INTERNAL "") +SET(SIZEOF_LONG 4 CACHE INTERNAL "") +SET(HAVE_SIZEOF_LONG_LONG TRUE CACHE INTERNAL "") +SET(SIZEOF_LONG_LONG 8 CACHE INTERNAL "") +SET(HAVE_SIZEOF_MODE_T FALSE CACHE INTERNAL "") +SET(HAVE_SIZEOF_OFF_T TRUE CACHE INTERNAL "") +SET(SIZEOF_OFF_T 4 CACHE INTERNAL "") +SET(HAVE_SIZEOF_SHORT TRUE CACHE INTERNAL "") +SET(SIZEOF_SHORT 2 CACHE INTERNAL "") +SET(HAVE_SIZEOF_SIGSET_T FALSE CACHE INTERNAL "") +SET(HAVE_SIZEOF_SIZE_T TRUE CACHE INTERNAL "") +SET(SIZEOF_SIZE_T ${CMAKE_SIZEOF_VOID_P} CACHE INTERNAL "") +SET(HAVE_SIZEOF_SOCKADDR_IN6 TRUE CACHE INTERNAL "") +SET(HAVE_SIZEOF_SOCKLEN_T FALSE CACHE INTERNAL "") +SET(HAVE_SIZEOF_UCHAR FALSE CACHE INTERNAL "") +SET(HAVE_SIZEOF_UINT FALSE CACHE INTERNAL "") +SET(HAVE_SIZEOF_UINT16 FALSE CACHE INTERNAL "") +SET(HAVE_SIZEOF_UINT32 FALSE CACHE INTERNAL "") +SET(HAVE_SIZEOF_UINT64 FALSE CACHE INTERNAL "") +SET(HAVE_SIZEOF_UINT8 FALSE CACHE INTERNAL "") +SET(HAVE_SIZEOF_ULONG FALSE CACHE INTERNAL "") +SET(HAVE_SIZEOF_U_INT32_T FALSE CACHE INTERNAL "") +SET(HAVE_SIZE_OF_SSIZE_T FALSE CACHE INTERNAL "") +SET(HAVE_SLEEP CACHE INTERNAL "") +SET(HAVE_SNPRINTF CACHE INTERNAL "") +SET(HAVE_SOCKADDR_STORAGE_SS_FAMILY 1 CACHE INTERNAL "") +SET(HAVE_SOLARIS_STYLE_GETHOST CACHE INTERNAL "") +SET(STACK_DIRECTION -1 CACHE INTERNAL "") +SET(HAVE_STDARG_H 1 CACHE INTERNAL "") +SET(HAVE_STDDEF_H 1 CACHE INTERNAL "") +SET(HAVE_STDINT_H CACHE INTERNAL "") +SET(HAVE_STDLIB_H 1 CACHE INTERNAL "") +SET(HAVE_STPCPY CACHE INTERNAL "") +SET(HAVE_STRCASECMP CACHE INTERNAL "") +SET(HAVE_STRCOLL 1 CACHE INTERNAL "") +SET(HAVE_STRDUP 1 CACHE INTERNAL "") +SET(HAVE_STRERROR 1 CACHE INTERNAL "") +SET(HAVE_STRINGS_H CACHE INTERNAL "") +SET(HAVE_STRING_H 1 CACHE INTERNAL "") +SET(HAVE_STRLCAT CACHE INTERNAL "") +SET(HAVE_STRLCPY CACHE INTERNAL "") +SET(HAVE_STRNCASECMP CACHE INTERNAL "") +IF(MSVC_VERSION GREATER 1310) +SET(HAVE_STRNLEN 1 CACHE INTERNAL "") +ENDIF() +SET(HAVE_STRPBRK 1 CACHE INTERNAL "") +SET(HAVE_STRSEP CACHE INTERNAL "") +SET(HAVE_STRSIGNAL CACHE INTERNAL "") +SET(HAVE_STRSTR 1 CACHE INTERNAL "") +SET(HAVE_STRTOK_R CACHE INTERNAL "") +SET(HAVE_STRTOL 1 CACHE INTERNAL "") +SET(HAVE_STRTOLL CACHE INTERNAL "") +SET(HAVE_STRTOUL 1 CACHE INTERNAL "") +SET(HAVE_STRTOULL CACHE INTERNAL "") +SET(HAVE_SVR3_SIGNALS CACHE INTERNAL "") +SET(HAVE_SYNCH_H CACHE INTERNAL "") +SET(HAVE_SYSENT_H CACHE INTERNAL "") +SET(HAVE_SYS_CDEFS_H CACHE INTERNAL "") +SET(HAVE_SYS_DIR_H CACHE INTERNAL "") +SET(HAVE_SYS_ERRLIST CACHE INTERNAL "") +SET(HAVE_SYS_FILE_H CACHE INTERNAL "") +SET(HAVE_SYS_FPU_H CACHE INTERNAL "") +SET(HAVE_SYS_IOCTL_H CACHE INTERNAL "") +SET(HAVE_SYS_IPC_H CACHE INTERNAL "") +SET(HAVE_SYS_MALLOC_H CACHE INTERNAL "") +SET(HAVE_SYS_MMAN_H CACHE INTERNAL "") +SET(HAVE_SYS_PARAM_H CACHE INTERNAL "") +SET(HAVE_SYS_PRCTL_H CACHE INTERNAL "") +SET(HAVE_SYS_PTEM_H CACHE INTERNAL "") +SET(HAVE_SYS_PTE_H CACHE INTERNAL "") +SET(HAVE_SYS_RESOURCE_H CACHE INTERNAL "") +SET(HAVE_SYS_SELECT_H CACHE INTERNAL "") +SET(HAVE_SYS_SHM_H CACHE INTERNAL "") +SET(HAVE_SYS_SOCKET_H CACHE INTERNAL "") +SET(HAVE_SYS_STAT_H 1 CACHE INTERNAL "") +SET(HAVE_SYS_STREAM_H CACHE INTERNAL "") +SET(HAVE_SYS_TERMCAP_H CACHE INTERNAL "") +SET(HAVE_SYS_TIMEB_H 1 CACHE INTERNAL "") +SET(HAVE_SYS_TIMES_H CACHE INTERNAL "") +SET(HAVE_SYS_TIME_H CACHE INTERNAL "") +SET(HAVE_SYS_TYPES_H 1 CACHE INTERNAL "") +SET(HAVE_SYS_UN_H CACHE INTERNAL "") +SET(HAVE_SYS_UTIME_H 1 CACHE INTERNAL "") +SET(HAVE_SYS_VADVISE_H CACHE INTERNAL "") +SET(HAVE_SYS_WAIT_H CACHE INTERNAL "") +SET(HAVE_TCGETATTR CACHE INTERNAL "") +SET(HAVE_TELL 1 CACHE INTERNAL "") +SET(HAVE_TEMPNAM 1 CACHE INTERNAL "") +SET(HAVE_TERMCAP_H CACHE INTERNAL "") +SET(HAVE_TERMIOS_H CACHE INTERNAL "") +SET(HAVE_TERMIO_H CACHE INTERNAL "") +SET(HAVE_TERM_H CACHE INTERNAL "") +SET(HAVE_THR_SETCONCURRENCY CACHE INTERNAL "") +SET(HAVE_THR_YIELD CACHE INTERNAL "") +SET(HAVE_TIME 1 CACHE INTERNAL "") +SET(HAVE_TIMES CACHE INTERNAL "") +SET(HAVE_TIMESPEC_TS_SEC CACHE INTERNAL "") +SET(HAVE_TIME_H 1 CACHE INTERNAL "") +SET(HAVE_TZNAME 1 CACHE INTERNAL "") +SET(HAVE_UNISTD_H CACHE INTERNAL "") +SET(HAVE_UTIME_H CACHE INTERNAL "") +SET(HAVE_VALLOC CACHE INTERNAL "") +SET(HAVE_VARARGS_H 1 CACHE INTERNAL "") +SET(HAVE_VASPRINTF CACHE INTERNAL "") +SET(HAVE_VPRINTF 1 CACHE INTERNAL "") +IF(MSVC_VERSION GREATER 1310) +SET(HAVE_VSNPRINTF 1 CACHE INTERNAL "") +ENDIF() +SET(HAVE_WEAK_SYMBOL CACHE INTERNAL "") +SET(HAVE_WORDS_BIGENDIAN TRUE CACHE INTERNAL "") +SET(WORDS_BIGENDIAN CACHE INTERNAL "") +SET(HAVE__S_IFIFO 1 CACHE INTERNAL "") +SET(HAVE__S_IREAD 1 CACHE INTERNAL "") +SET(HAVE__finite 1 CACHE INTERNAL "") +SET(HAVE__isnan 1 CACHE INTERNAL "") +SET(HAVE__pclose 1 CACHE INTERNAL "") +SET(HAVE__popen 1 CACHE INTERNAL "") +SET(HAVE__snprintf 1 CACHE INTERNAL "") +SET(HAVE__stricmp 1 CACHE INTERNAL "") +SET(HAVE__strnicmp 1 CACHE INTERNAL "") +SET(HAVE__strtoi64 1 CACHE INTERNAL "") +SET(HAVE__strtoui64 1 CACHE INTERNAL "") +IF(MSVC_VERSION GREATER 1310) + SET(HAVE_strtok_s 1 CACHE INTERNAL "") +ENDIF() +SET(STDC_HEADERS CACHE 1 INTERNAL "") +SET(STRUCT_DIRENT_HAS_D_INO CACHE INTERNAL "") +SET(STRUCT_DIRENT_HAS_D_INO CACHE INTERNAL "") +SET(STRUCT_DIRENT_HAS_D_NAMLEN CACHE INTERNAL "") +SET(TIME_WITH_SYS_TIME CACHE INTERNAL "") +SET(TIOCSTAT_IN_SYS_IOCTL CACHE INTERNAL "") +SET(HAVE_S_IROTH CACHE INTERNAL "") +SET(HAVE_S_IFIFO CACHE INTERNAL "") +SET(QSORT_TYPE_IS_VOID 1 CACHE INTERNAL "") +SET(SIGNAL_RETURN_TYPE_IS_VOID 1 CACHE INTERNAL "") +SET(C_HAS_inline CACHE INTERNAL "") +SET(C_HAS___inline 1 CACHE INTERNAL "") +SET(FIONREAD_IN_SYS_IOCTL CACHE INTERNAL "") +SET(GWINSZ_IN_SYS_IOCTL CACHE INTERNAL "") +SET(HAVE_CXXABI_H CACHE INTERNAL "") +SET(HAVE_NDIR_H CACHE INTERNAL "") +SET(HAVE_SYS_NDIR_H CACHE INTERNAL "") +SET(HAVE_SYS_NDIR_H CACHE INTERNAL "") +SET(HAVE_ASM_TERMBITS_H CACHE INTERNAL "") +SET(HAVE_TERMBITS_H CACHE INTERNAL "") +SET(HAVE_VIS_H CACHE INTERNAL "") +SET(HAVE_WCHAR_H 1 CACHE INTERNAL "") +SET(HAVE_WCTYPE_H 1 CACHE INTERNAL "") +SET(HAVE_PTHREAD_RWLOCKATTR_SETKIND_NP CACHE INTERNAL "") +SET(HAVE_SOCKADDR_IN_SIN_LEN CACHE INTERNAL "") +SET(HAVE_SOCKADDR_IN6_SIN6_LEN CACHE INTERNAL "") +ENDIF() diff --git a/dep/mysqllite/include/my_user.h b/dep/mysqllite/cmake/stack_direction.c similarity index 51% rename from dep/mysqllite/include/my_user.h rename to dep/mysqllite/cmake/stack_direction.c index 44eebf1551d9b..11bcf803bfa0f 100644 --- a/dep/mysqllite/include/my_user.h +++ b/dep/mysqllite/cmake/stack_direction.c @@ -1,5 +1,5 @@ -/* Copyright (C) 2005 MySQL AB - +/* 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. @@ -11,24 +11,21 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ + +/* Check stack direction (0-down, 1-up) */ +int f(int *a) +{ + int b; + return(&b > a)?1:0; +} /* - This is a header for libraries containing functions used in both server and - only some of clients (but not in libmysql)... + Prevent compiler optimizations by calling function + through pointer. */ - -#ifndef _my_user_h_ -#define _my_user_h_ - -#include - -C_MODE_START - -void parse_user(const char *user_id_str, size_t user_id_len, - char *user_name_str, size_t *user_name_len, - char *host_name_str, size_t *host_name_len); - -C_MODE_END - -#endif /* _my_user_h_ */ +volatile int (*ptr_f)(int *) = f; +int main() +{ + int a; + return ptr_f(&a); +} \ No newline at end of file diff --git a/dep/mysqllite/cmake/versioninfo.rc.in b/dep/mysqllite/cmake/versioninfo.rc.in new file mode 100644 index 0000000000000..11cedc38a39b1 --- /dev/null +++ b/dep/mysqllite/cmake/versioninfo.rc.in @@ -0,0 +1,23 @@ +#include +VS_VERSION_INFO VERSIONINFO +FILEVERSION @MAJOR_VERSION@,@MINOR_VERSION@,@PATCH_VERSION@,0 +PRODUCTVERSION @MAJOR_VERSION@,@MINOR_VERSION@,@PATCH_VERSION@,0 +FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +FILEFLAGS 0 +FILEOS VOS__WINDOWS32 +FILETYPE @FILETYPE@ +FILESUBTYPE VFT2_UNKNOWN +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904E4" + BEGIN + VALUE "FileVersion", "@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH_VERSION@.0\0" + VALUE "ProductVersion", "@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH_VERSION@.0\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1252 + END +END diff --git a/dep/mysqllite/config.h.cmake b/dep/mysqllite/config.h.cmake new file mode 100644 index 0000000000000..204e10324101b --- /dev/null +++ b/dep/mysqllite/config.h.cmake @@ -0,0 +1,618 @@ +/* Copyright (C) 2009, 2011, Oracle and/or its affiliates. All rights + reserved + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You 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 */ + +#ifndef MY_CONFIG_H +#define MY_CONFIG_H +#cmakedefine DOT_FRM_VERSION @DOT_FRM_VERSION@ +/* Headers we may want to use. */ +#cmakedefine STDC_HEADERS 1 +#cmakedefine _GNU_SOURCE 1 +#cmakedefine HAVE_ALLOCA_H 1 +#cmakedefine HAVE_AIO_H 1 +#cmakedefine HAVE_ARPA_INET_H 1 +#cmakedefine HAVE_ASM_MSR_H 1 +#cmakedefine HAVE_ASM_TERMBITS_H 1 +#cmakedefine HAVE_BSEARCH 1 +#cmakedefine HAVE_CRYPT_H 1 +#cmakedefine HAVE_CURSES_H 1 +#cmakedefine HAVE_CXXABI_H 1 +#cmakedefine HAVE_NCURSES_H 1 +#cmakedefine HAVE_NDIR_H 1 +#cmakedefine HAVE_DIRENT_H 1 +#cmakedefine HAVE_DLFCN_H 1 +#cmakedefine HAVE_EXECINFO_H 1 +#cmakedefine HAVE_FCNTL_H 1 +#cmakedefine HAVE_FENV_H 1 +#cmakedefine HAVE_FLOAT_H 1 +#cmakedefine HAVE_FLOATINGPOINT_H 1 +#cmakedefine HAVE_FNMATCH_H 1 +#cmakedefine HAVE_FPU_CONTROL_H 1 +#cmakedefine HAVE_GRP_H 1 +#cmakedefine HAVE_EXPLICIT_TEMPLATE_INSTANTIATION 1 +#cmakedefine HAVE_IA64INTRIN_H 1 +#cmakedefine HAVE_IEEEFP_H 1 +#cmakedefine HAVE_INTTYPES_H 1 +#cmakedefine HAVE_LIMITS_H 1 +#cmakedefine HAVE_LOCALE_H 1 +#cmakedefine HAVE_MALLOC_H 1 +#cmakedefine HAVE_MEMORY_H 1 +#cmakedefine HAVE_NETINET_IN_H 1 +#cmakedefine HAVE_PATHS_H 1 +#cmakedefine HAVE_POLL_H 1 +#cmakedefine HAVE_PORT_H 1 +#cmakedefine HAVE_PWD_H 1 +#cmakedefine HAVE_SCHED_H 1 +#cmakedefine HAVE_SELECT_H 1 +#cmakedefine HAVE_SOLARIS_LARGE_PAGES 1 +#cmakedefine HAVE_STDDEF_H 1 +#cmakedefine HAVE_STDLIB_H 1 +#cmakedefine HAVE_STDARG_H 1 +#cmakedefine HAVE_STRINGS_H 1 +#cmakedefine HAVE_STRING_H 1 +#cmakedefine HAVE_STDINT_H 1 +#cmakedefine HAVE_SEMAPHORE_H 1 +#cmakedefine HAVE_SYNCH_H 1 +#cmakedefine HAVE_SYSENT_H 1 +#cmakedefine HAVE_SYS_DIR_H 1 +#cmakedefine HAVE_SYS_CDEFS_H 1 +#cmakedefine HAVE_SYS_FILE_H 1 +#cmakedefine HAVE_SYS_FPU_H 1 +#cmakedefine HAVE_SYS_IOCTL_H 1 +#cmakedefine HAVE_SYS_IPC_H 1 +#cmakedefine HAVE_SYS_MALLOC_H 1 +#cmakedefine HAVE_SYS_MMAN_H 1 +#cmakedefine HAVE_SYS_NDIR_H 1 +#cmakedefine HAVE_SYS_PTE_H 1 +#cmakedefine HAVE_SYS_PTEM_H 1 +#cmakedefine HAVE_SYS_PRCTL_H 1 +#cmakedefine HAVE_SYS_RESOURCE_H 1 +#cmakedefine HAVE_SYS_SELECT_H 1 +#cmakedefine HAVE_SYS_SHM_H 1 +#cmakedefine HAVE_SYS_SOCKET_H 1 +#cmakedefine HAVE_SYS_STAT_H 1 +#cmakedefine HAVE_SYS_STREAM_H 1 +#cmakedefine HAVE_SYS_TERMCAP_H 1 +#cmakedefine HAVE_SYS_TIMEB_H 1 +#cmakedefine HAVE_SYS_TIMES_H 1 +#cmakedefine HAVE_SYS_TIME_H 1 +#cmakedefine HAVE_SYS_TYPES_H 1 +#cmakedefine HAVE_SYS_UN_H 1 +#cmakedefine HAVE_SYS_VADVISE_H 1 +#cmakedefine HAVE_TERM_H 1 +#cmakedefine HAVE_TERMBITS_H 1 +#cmakedefine HAVE_TERMIOS_H 1 +#cmakedefine HAVE_TERMIO_H 1 +#cmakedefine HAVE_TERMCAP_H 1 +#cmakedefine HAVE_TIME_H 1 +#cmakedefine HAVE_UNISTD_H 1 +#cmakedefine HAVE_UTIME_H 1 +#cmakedefine HAVE_VARARGS_H 1 +#cmakedefine HAVE_VIS_H 1 +#cmakedefine HAVE_SYS_UTIME_H 1 +#cmakedefine HAVE_SYS_WAIT_H 1 +#cmakedefine HAVE_SYS_PARAM_H 1 + +/* Libraries */ +#cmakedefine HAVE_LIBPTHREAD 1 +#cmakedefine HAVE_LIBM 1 +#cmakedefine HAVE_LIBDL 1 +#cmakedefine HAVE_LIBRT 1 +#cmakedefine HAVE_LIBSOCKET 1 +#cmakedefine HAVE_LIBNSL 1 +#cmakedefine HAVE_LIBCRYPT 1 +#cmakedefine HAVE_LIBMTMALLOC 1 +#cmakedefine HAVE_LIBWRAP 1 +/* Does "struct timespec" have a "sec" and "nsec" field? */ +#cmakedefine HAVE_TIMESPEC_TS_SEC 1 + +/* Readline */ +#cmakedefine HAVE_HIST_ENTRY 1 +#cmakedefine USE_LIBEDIT_INTERFACE 1 +#cmakedefine USE_NEW_READLINE_INTERFACE 1 + +#cmakedefine FIONREAD_IN_SYS_IOCTL 1 +#cmakedefine GWINSZ_IN_SYS_IOCTL 1 +#cmakedefine TIOCSTAT_IN_SYS_IOCTL 1 + +/* Functions we may want to use. */ +#cmakedefine HAVE_AIOWAIT 1 +#cmakedefine HAVE_ALARM 1 +#cmakedefine HAVE_ALLOCA 1 +#cmakedefine HAVE_BFILL 1 +#cmakedefine HAVE_BMOVE 1 +#cmakedefine HAVE_BZERO 1 +#cmakedefine HAVE_INDEX 1 +#cmakedefine HAVE_CHOWN 1 +#cmakedefine HAVE_CLOCK_GETTIME 1 +#cmakedefine HAVE_CRYPT 1 +#cmakedefine HAVE_CUSERID 1 +#cmakedefine HAVE_CXX_NEW 1 +#cmakedefine HAVE_DIRECTIO 1 +#cmakedefine HAVE_DLERROR 1 +#cmakedefine HAVE_DLOPEN 1 +#cmakedefine HAVE_DOPRNT 1 +#cmakedefine HAVE_FCHMOD 1 +#cmakedefine HAVE_FCNTL 1 +#cmakedefine HAVE_FCONVERT 1 +#cmakedefine HAVE_FDATASYNC 1 +#cmakedefine HAVE_FESETROUND 1 +#cmakedefine HAVE_FINITE 1 +#cmakedefine HAVE_FP_EXCEPT 1 +#cmakedefine HAVE_FPSETMASK 1 +#cmakedefine HAVE_FSEEKO 1 +#cmakedefine HAVE_FSYNC 1 +#cmakedefine HAVE_FTIME 1 +#cmakedefine HAVE_GETADDRINFO 1 +#cmakedefine HAVE_GETCWD 1 +#cmakedefine HAVE_GETHOSTBYADDR_R 1 +#cmakedefine HAVE_GETHOSTBYNAME_R 1 +#cmakedefine HAVE_GETHRTIME 1 +#cmakedefine HAVE_GETLINE 1 +#cmakedefine HAVE_GETNAMEINFO 1 +#cmakedefine HAVE_GETPAGESIZE 1 +#cmakedefine HAVE_GETPASS 1 +#cmakedefine HAVE_GETPASSPHRASE 1 +#cmakedefine HAVE_GETPWNAM 1 +#cmakedefine HAVE_GETPWUID 1 +#cmakedefine HAVE_GETRLIMIT 1 +#cmakedefine HAVE_GETRUSAGE 1 +#cmakedefine HAVE_GETTIMEOFDAY 1 +#cmakedefine HAVE_GETWD 1 +#cmakedefine HAVE_GMTIME_R 1 +#cmakedefine gmtime_r @gmtime_r@ +#cmakedefine HAVE_INITGROUPS 1 +#cmakedefine HAVE_ISSETUGID 1 +#cmakedefine HAVE_ISNAN 1 +#cmakedefine HAVE_ISINF 1 +#cmakedefine HAVE_LARGE_PAGE_OPTION 1 +#cmakedefine HAVE_LDIV 1 +#cmakedefine HAVE_LRAND48 1 +#cmakedefine HAVE_LOCALTIME_R 1 +#cmakedefine HAVE_LOG2 1 +#cmakedefine HAVE_LONGJMP 1 +#cmakedefine HAVE_LSTAT 1 +#cmakedefine HAVE_MEMALIGN 1 +/* #cmakedefine HAVE_MLOCK 1 see Bug#54662 */ +#cmakedefine HAVE_NPTL 1 +#cmakedefine HAVE_NL_LANGINFO 1 +#cmakedefine HAVE_MADVISE 1 +#cmakedefine HAVE_DECL_MADVISE 1 +#cmakedefine HAVE_DECL_TGOTO 1 +#cmakedefine HAVE_DECL_MHA_MAPSIZE_VA +#cmakedefine HAVE_MALLINFO 1 +#cmakedefine HAVE_MEMCPY 1 +#cmakedefine HAVE_MEMMOVE 1 +#cmakedefine HAVE_MKSTEMP 1 +#cmakedefine HAVE_MLOCKALL 1 +#cmakedefine HAVE_MMAP 1 +#cmakedefine HAVE_MMAP64 1 +#cmakedefine HAVE_PERROR 1 +#cmakedefine HAVE_POLL 1 +#cmakedefine HAVE_PORT_CREATE 1 +#cmakedefine HAVE_POSIX_FALLOCATE 1 +#cmakedefine HAVE_PREAD 1 +#cmakedefine HAVE_PAUSE_INSTRUCTION 1 +#cmakedefine HAVE_FAKE_PAUSE_INSTRUCTION 1 +#cmakedefine HAVE_RDTSCLL 1 +#cmakedefine HAVE_READ_REAL_TIME 1 +#cmakedefine HAVE_PTHREAD_ATTR_CREATE 1 +#cmakedefine HAVE_PTHREAD_ATTR_GETSTACKSIZE 1 +#cmakedefine HAVE_PTHREAD_ATTR_SETPRIO 1 +#cmakedefine HAVE_PTHREAD_ATTR_SETSCHEDPARAM 1 +#cmakedefine HAVE_PTHREAD_ATTR_SETSCOPE 1 +#cmakedefine HAVE_PTHREAD_ATTR_SETSTACKSIZE 1 +#cmakedefine HAVE_PTHREAD_CONDATTR_CREATE 1 +#cmakedefine HAVE_PTHREAD_CONDATTR_SETCLOCK 1 +#cmakedefine HAVE_PTHREAD_INIT 1 +#cmakedefine HAVE_PTHREAD_KEY_DELETE 1 +#cmakedefine HAVE_PTHREAD_KEY_DELETE 1 +#cmakedefine HAVE_PTHREAD_KILL 1 +#cmakedefine HAVE_PTHREAD_RWLOCK_RDLOCK 1 +#cmakedefine HAVE_PTHREAD_SETPRIO_NP 1 +#cmakedefine HAVE_PTHREAD_SETSCHEDPARAM 1 +#cmakedefine HAVE_PTHREAD_SIGMASK 1 +#cmakedefine HAVE_PTHREAD_THREADMASK 1 +#cmakedefine HAVE_PTHREAD_YIELD_NP 1 +#cmakedefine HAVE_PTHREAD_YIELD_ZERO_ARG 1 +#cmakedefine PTHREAD_ONCE_INITIALIZER @PTHREAD_ONCE_INITIALIZER@ +#cmakedefine HAVE_PUTENV 1 +#cmakedefine HAVE_RE_COMP 1 +#cmakedefine HAVE_REGCOMP 1 +#cmakedefine HAVE_READDIR_R 1 +#cmakedefine HAVE_READLINK 1 +#cmakedefine HAVE_REALPATH 1 +#cmakedefine HAVE_RENAME 1 +#cmakedefine HAVE_RINT 1 +#cmakedefine HAVE_RWLOCK_INIT 1 +#cmakedefine HAVE_SCHED_YIELD 1 +#cmakedefine HAVE_SELECT 1 +#cmakedefine HAVE_SETFD 1 +#cmakedefine HAVE_SETENV 1 +#cmakedefine HAVE_SETLOCALE 1 +#cmakedefine HAVE_SIGADDSET 1 +#cmakedefine HAVE_SIGEMPTYSET 1 +#cmakedefine HAVE_SIGHOLD 1 +#cmakedefine HAVE_SIGSET 1 +#cmakedefine HAVE_SIGSET_T 1 +#cmakedefine HAVE_SIGACTION 1 +#cmakedefine HAVE_SIGTHREADMASK 1 +#cmakedefine HAVE_SIGWAIT 1 +#cmakedefine HAVE_SLEEP 1 +#cmakedefine HAVE_SNPRINTF 1 +#cmakedefine HAVE_STPCPY 1 +#cmakedefine HAVE_STRERROR 1 +#cmakedefine HAVE_STRCOLL 1 +#cmakedefine HAVE_STRSIGNAL 1 +#cmakedefine HAVE_STRLCPY 1 +#cmakedefine HAVE_STRLCAT 1 +#cmakedefine HAVE_FGETLN 1 +#cmakedefine HAVE_STRNLEN 1 +#cmakedefine HAVE_STRPBRK 1 +#cmakedefine HAVE_STRSEP 1 +#cmakedefine HAVE_STRSTR 1 +#cmakedefine HAVE_STRTOK_R 1 +#cmakedefine HAVE_STRTOL 1 +#cmakedefine HAVE_STRTOLL 1 +#cmakedefine HAVE_STRTOUL 1 +#cmakedefine HAVE_STRTOULL 1 +#cmakedefine HAVE_SHMAT 1 +#cmakedefine HAVE_SHMCTL 1 +#cmakedefine HAVE_SHMDT 1 +#cmakedefine HAVE_SHMGET 1 +#cmakedefine HAVE_TELL 1 +#cmakedefine HAVE_TEMPNAM 1 +#cmakedefine HAVE_THR_SETCONCURRENCY 1 +#cmakedefine HAVE_THR_YIELD 1 +#cmakedefine HAVE_TIME 1 +#cmakedefine HAVE_TIMES 1 +#cmakedefine HAVE_VALLOC 1 +#define HAVE_VIO_READ_BUFF 1 +#cmakedefine HAVE_VASPRINTF 1 +#cmakedefine HAVE_VPRINTF 1 +#cmakedefine HAVE_VSNPRINTF 1 +#cmakedefine HAVE_FTRUNCATE 1 +#cmakedefine HAVE_TZNAME 1 +#cmakedefine HAVE_AIO_READ 1 +/* Symbols we may use */ +#cmakedefine HAVE_SYS_ERRLIST 1 +/* used by stacktrace functions */ +#cmakedefine HAVE_BSS_START 1 +#cmakedefine HAVE_BACKTRACE 1 +#cmakedefine HAVE_BACKTRACE_SYMBOLS 1 +#cmakedefine HAVE_BACKTRACE_SYMBOLS_FD 1 +#cmakedefine HAVE_PRINTSTACK 1 +#cmakedefine HAVE_STRUCT_SOCKADDR_IN6 1 +#cmakedefine HAVE_STRUCT_IN6_ADDR 1 +#cmakedefine HAVE_NETINET_IN6_H 1 +#cmakedefine HAVE_IPV6 1 +#cmakedefine ss_family @ss_family@ +#cmakedefine HAVE_SOCKADDR_IN_SIN_LEN 1 +#cmakedefine HAVE_SOCKADDR_IN6_SIN6_LEN 1 +#cmakedefine HAVE_TIMESPEC_TS_SEC 1 +#cmakedefine STRUCT_DIRENT_HAS_D_INO 1 +#cmakedefine STRUCT_DIRENT_HAS_D_NAMLEN 1 +#cmakedefine SPRINTF_RETURNS_INT 1 + +#define USE_MB 1 +#define USE_MB_IDENT 1 + +#cmakedefine HAVE_VALGRIND + +/* Types we may use */ +#ifdef __APPLE__ + /* + Special handling required for OSX to support universal binaries that + mix 32 and 64 bit architectures. + */ + #if(__LP64__) + #define SIZEOF_LONG 8 + #else + #define SIZEOF_LONG 4 + #endif + #define SIZEOF_VOIDP SIZEOF_LONG + #define SIZEOF_CHARP SIZEOF_LONG + #define SIZEOF_SIZE_T SIZEOF_LONG +#else +/* No indentation, to fetch the lines from verification scripts */ +#cmakedefine SIZEOF_LONG @SIZEOF_LONG@ +#cmakedefine SIZEOF_VOIDP @SIZEOF_VOIDP@ +#cmakedefine SIZEOF_CHARP @SIZEOF_CHARP@ +#cmakedefine SIZEOF_SIZE_T @SIZEOF_CHARP@ +#endif + +#cmakedefine SIZEOF_CHAR @SIZEOF_CHAR@ +#define HAVE_CHAR 1 +#define HAVE_LONG 1 +#define HAVE_CHARP 1 +#cmakedefine SIZEOF_SHORT @SIZEOF_SHORT@ +#define HAVE_SHORT 1 +#cmakedefine SIZEOF_INT @SIZEOF_INT@ +#define HAVE_INT 1 +#cmakedefine SIZEOF_LONG_LONG @SIZEOF_LONG_LONG@ +#cmakedefine HAVE_LONG_LONG 1 +#cmakedefine SIZEOF_OFF_T @SIZEOF_OFF_T@ +#cmakedefine HAVE_OFF_T 1 +#cmakedefine SIZEOF_SIGSET_T @SIZEOF_SIGSET_T@ +#cmakedefine HAVE_SIGSET_T 1 +#cmakedefine HAVE_SIZE_T 1 +#cmakedefine SIZEOF_UCHAR @SIZEOF_UCHAR@ +#cmakedefine HAVE_UCHAR 1 +#cmakedefine SIZEOF_UINT @SIZEOF_UINT@ +#cmakedefine HAVE_UINT 1 +#cmakedefine SIZEOF_ULONG @SIZEOF_ULONG@ +#cmakedefine HAVE_ULONG 1 +#cmakedefine SIZEOF_INT8 @SIZEOF_INT8@ +#cmakedefine HAVE_INT8 1 +#cmakedefine SIZEOF_UINT8 @SIZEOF_UINT8@ +#cmakedefine HAVE_UINT8 1 +#cmakedefine SIZEOF_INT16 @SIZEOF_INT16@ +#cmakedefine HAVE_INT16 1 +#cmakedefine SIZEOF_UINT16 @SIZEOF_UINT16@ +#cmakedefine HAVE_UINT16 1 +#cmakedefine SIZEOF_INT32 @SIZEOF_INT32@ +#cmakedefine HAVE_INT32 1 +#cmakedefine SIZEOF_UINT32 @SIZEOF_UINT32@ +#cmakedefine HAVE_UINT32 1 +#cmakedefine SIZEOF_U_INT32_T @SIZEOF_U_INT32_T@ +#cmakedefine HAVE_U_INT32_T 1 +#cmakedefine SIZEOF_INT64 @SIZEOF_INT64@ +#cmakedefine HAVE_INT64 1 +#cmakedefine SIZEOF_UINT64 @SIZEOF_UINT64@ +#cmakedefine HAVE_UINT64 1 +#cmakedefine SIZEOF_BOOL @SIZEOF_BOOL@ +#cmakedefine HAVE_BOOL 1 + +#cmakedefine SOCKET_SIZE_TYPE @SOCKET_SIZE_TYPE@ + +#cmakedefine HAVE_MBSTATE_T + +#define MAX_INDEXES 64 + +#cmakedefine QSORT_TYPE_IS_VOID 1 +#cmakedefine RETQSORTTYPE @RETQSORTTYPE@ + +#cmakedefine SIGNAL_RETURN_TYPE_IS_VOID 1 +#cmakedefine RETSIGTYPE @RETSIGTYPE@ +#cmakedefine VOID_SIGHANDLER 1 +#define STRUCT_RLIMIT struct rlimit + +#ifdef __APPLE__ + #if __BIG_ENDIAN + #define WORDS_BIGENDIAN 1 + #endif +#else +#cmakedefine WORDS_BIGENDIAN 1 +#endif + +/* 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. */ +#cmakedefine C_HAS_inline 1 +#if !(C_HAS_inline) +#ifndef __cplusplus +# define inline @C_INLINE@ +#endif +#endif + + +#cmakedefine TARGET_OS_LINUX 1 + +#cmakedefine HAVE_WCTYPE_H 1 +#cmakedefine HAVE_WCHAR_H 1 +#cmakedefine HAVE_LANGINFO_H 1 +#cmakedefine HAVE_MBRLEN +#cmakedefine HAVE_MBSCMP +#cmakedefine HAVE_MBSRTOWCS +#cmakedefine HAVE_WCRTOMB +#cmakedefine HAVE_MBRTOWC +#cmakedefine HAVE_WCSCOLL +#cmakedefine HAVE_WCSDUP +#cmakedefine HAVE_WCWIDTH +#cmakedefine HAVE_WCTYPE +#cmakedefine HAVE_ISWLOWER 1 +#cmakedefine HAVE_ISWUPPER 1 +#cmakedefine HAVE_TOWLOWER 1 +#cmakedefine HAVE_TOWUPPER 1 +#cmakedefine HAVE_ISWCTYPE 1 +#cmakedefine HAVE_WCHAR_T 1 +#cmakedefine HAVE_WCTYPE_T 1 +#cmakedefine HAVE_WINT_T 1 + + +#cmakedefine HAVE_STRCASECMP 1 +#cmakedefine HAVE_STRNCASECMP 1 +#cmakedefine HAVE_STRDUP 1 +#cmakedefine HAVE_LANGINFO_CODESET +#cmakedefine HAVE_TCGETATTR 1 +#cmakedefine HAVE_FLOCKFILE 1 + +#cmakedefine HAVE_WEAK_SYMBOL 1 +#cmakedefine HAVE_ABI_CXA_DEMANGLE 1 + + +#cmakedefine HAVE_POSIX_SIGNALS 1 +#cmakedefine HAVE_BSD_SIGNALS 1 +#cmakedefine HAVE_SVR3_SIGNALS 1 +#cmakedefine HAVE_V7_SIGNALS 1 + + +#cmakedefine HAVE_SOLARIS_STYLE_GETHOST 1 +#cmakedefine HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE 1 +#cmakedefine HAVE_GETHOSTBYNAME_R_RETURN_INT 1 + +#cmakedefine MY_ATOMIC_MODE_DUMMY 1 +#cmakedefine MY_ATOMIC_MODE_RWLOCKS 1 +#cmakedefine HAVE_GCC_ATOMIC_BUILTINS 1 +#cmakedefine HAVE_SOLARIS_ATOMIC 1 +#cmakedefine HAVE_DECL_SHM_HUGETLB 1 +#cmakedefine HAVE_LARGE_PAGES 1 +#cmakedefine HUGETLB_USE_PROC_MEMINFO 1 +#cmakedefine NO_FCNTL_NONBLOCK 1 +#cmakedefine NO_ALARM 1 + +#cmakedefine _LARGE_FILES 1 +#cmakedefine _LARGEFILE_SOURCE 1 +#cmakedefine _LARGEFILE64_SOURCE 1 +#cmakedefine _FILE_OFFSET_BITS @_FILE_OFFSET_BITS@ + +#cmakedefine TIME_WITH_SYS_TIME 1 + +#cmakedefine STACK_DIRECTION @STACK_DIRECTION@ + +#define SYSTEM_TYPE "@SYSTEM_TYPE@" +#define MACHINE_TYPE "@CMAKE_SYSTEM_PROCESSOR@" +#cmakedefine HAVE_DTRACE 1 + +#cmakedefine SIGNAL_WITH_VIO_CLOSE 1 + +/* Windows stuff, mostly functions, that have Posix analogs but named differently */ +#cmakedefine S_IROTH @S_IROTH@ +#cmakedefine S_IFIFO @S_IFIFO@ +#cmakedefine IPPROTO_IPV6 @IPPROTO_IPV6@ +#cmakedefine IPV6_V6ONLY @IPV6_V6ONLY@ +#cmakedefine sigset_t @sigset_t@ +#cmakedefine mode_t @mode_t@ +#cmakedefine SIGQUIT @SIGQUIT@ +#cmakedefine SIGPIPE @SIGPIPE@ +#cmakedefine isnan @isnan@ +#cmakedefine finite @finite@ +#cmakedefine popen @popen@ +#cmakedefine pclose @pclose@ +#cmakedefine ssize_t @ssize_t@ +#cmakedefine strcasecmp @strcasecmp@ +#cmakedefine strncasecmp @strncasecmp@ +#cmakedefine snprintf @snprintf@ +#cmakedefine strtok_r @strtok_r@ +#cmakedefine strtoll @strtoll@ +#cmakedefine strtoull @strtoull@ +#cmakedefine vsnprintf @vsnprintf@ +#if (_MSC_VER > 1310) +# define HAVE_SETENV +#define setenv(a,b,c) _putenv_s(a,b) +#endif + + + + +/* + MySQL features +*/ +#cmakedefine ENABLED_LOCAL_INFILE 1 +#cmakedefine ENABLED_PROFILING 1 +#cmakedefine EXTRA_DEBUG 1 +#cmakedefine BACKUP_TEST 1 +#cmakedefine CYBOZU 1 + +/* Character sets and collations */ +#cmakedefine MYSQL_DEFAULT_CHARSET_NAME "latin1" +#cmakedefine MYSQL_DEFAULT_COLLATION_NAME "latin1_swedish_ci" + +#cmakedefine USE_MB 1 +#cmakedefine USE_MB_IDENT 1 +#cmakedefine USE_STRCOLL 1 + +/* This should mean case insensitive file system */ +#cmakedefine FN_NO_CASE_SENSE 1 + +#cmakedefine HAVE_CHARSET_armscii8 1 +#cmakedefine HAVE_CHARSET_ascii 1 +#cmakedefine HAVE_CHARSET_big5 1 +#cmakedefine HAVE_CHARSET_cp1250 1 +#cmakedefine HAVE_CHARSET_cp1251 1 +#cmakedefine HAVE_CHARSET_cp1256 1 +#cmakedefine HAVE_CHARSET_cp1257 1 +#cmakedefine HAVE_CHARSET_cp850 1 +#cmakedefine HAVE_CHARSET_cp852 1 +#cmakedefine HAVE_CHARSET_cp866 1 +#cmakedefine HAVE_CHARSET_cp932 1 +#cmakedefine HAVE_CHARSET_dec8 1 +#cmakedefine HAVE_CHARSET_eucjpms 1 +#cmakedefine HAVE_CHARSET_euckr 1 +#cmakedefine HAVE_CHARSET_gb2312 1 +#cmakedefine HAVE_CHARSET_gbk 1 +#cmakedefine HAVE_CHARSET_geostd8 1 +#cmakedefine HAVE_CHARSET_greek 1 +#cmakedefine HAVE_CHARSET_hebrew 1 +#cmakedefine HAVE_CHARSET_hp8 1 +#cmakedefine HAVE_CHARSET_keybcs2 1 +#cmakedefine HAVE_CHARSET_koi8r 1 +#cmakedefine HAVE_CHARSET_koi8u 1 +#cmakedefine HAVE_CHARSET_latin1 1 +#cmakedefine HAVE_CHARSET_latin2 1 +#cmakedefine HAVE_CHARSET_latin5 1 +#cmakedefine HAVE_CHARSET_latin7 1 +#cmakedefine HAVE_CHARSET_macce 1 +#cmakedefine HAVE_CHARSET_macroman 1 +#cmakedefine HAVE_CHARSET_sjis 1 +#cmakedefine HAVE_CHARSET_swe7 1 +#cmakedefine HAVE_CHARSET_tis620 1 +#cmakedefine HAVE_CHARSET_ucs2 1 +#cmakedefine HAVE_CHARSET_ujis 1 +#cmakedefine HAVE_CHARSET_utf8mb4 1 +#cmakedefine HAVE_CHARSET_utf8mb3 1 +#cmakedefine HAVE_CHARSET_utf8 1 +#cmakedefine HAVE_CHARSET_utf16 1 +#cmakedefine HAVE_CHARSET_utf32 1 +#cmakedefine HAVE_UCA_COLLATIONS 1 +#cmakedefine HAVE_COMPRESS 1 + + +/* + Stuff that always need to be defined (compile breaks without it) +*/ +#define HAVE_SPATIAL 1 +#define HAVE_RTREE_KEYS 1 +#define HAVE_QUERY_CACHE 1 +#define BIG_TABLES 1 + +/* + Important storage engines (those that really need define + WITH__STORAGE_ENGINE for the whole server) +*/ +#cmakedefine WITH_MYISAM_STORAGE_ENGINE 1 +#cmakedefine WITH_MYISAMMRG_STORAGE_ENGINE 1 +#cmakedefine WITH_HEAP_STORAGE_ENGINE 1 +#cmakedefine WITH_CSV_STORAGE_ENGINE 1 +#cmakedefine WITH_PARTITION_STORAGE_ENGINE 1 +#cmakedefine WITH_PERFSCHEMA_STORAGE_ENGINE 1 +#cmakedefine WITH_NDBCLUSTER_STORAGE_ENGINE 1 +#if (WITH_NDBCLUSTER_STORAGE_ENGINE) && !defined(EMBEDDED_LIBRARY) +# define HAVE_NDB_BINLOG 1 +#endif + +#cmakedefine DEFAULT_MYSQL_HOME "@DEFAULT_MYSQL_HOME@" +#cmakedefine SHAREDIR "@SHAREDIR@" +#cmakedefine DEFAULT_BASEDIR "@DEFAULT_BASEDIR@" +#cmakedefine MYSQL_DATADIR "@MYSQL_DATADIR@" +#cmakedefine DEFAULT_CHARSET_HOME "@DEFAULT_CHARSET_HOME@" +#cmakedefine PLUGINDIR "@PLUGINDIR@" +#cmakedefine DEFAULT_SYSCONFDIR "@DEFAULT_SYSCONFDIR@" + +#cmakedefine SO_EXT "@CMAKE_SHARED_MODULE_SUFFIX@" + +#define MYSQL_MAJOR_VERSION @MAJOR_VERSION@ +#define MYSQL_MINOR_VERSION @MINOR_VERSION@ + +#define PACKAGE "mysql" +#define PACKAGE_BUGREPORT "" +#define PACKAGE_NAME "MySQL Server" +#define PACKAGE_STRING "MySQL Server @VERSION@" +#define PACKAGE_TARNAME "mysql" +#define PACKAGE_VERSION "@VERSION@" +#define VERSION "@VERSION@" +#define PROTOCOL_VERSION 10 + + +#endif diff --git a/dep/mysqllite/configure.cmake b/dep/mysqllite/configure.cmake new file mode 100644 index 0000000000000..954b60a45f67f --- /dev/null +++ b/dep/mysqllite/configure.cmake @@ -0,0 +1,1101 @@ + +# 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +# + +INCLUDE (CheckCSourceCompiles) +INCLUDE (CheckCXXSourceCompiles) +INCLUDE (CheckStructHasMember) +INCLUDE (CheckLibraryExists) +INCLUDE (CheckFunctionExists) +INCLUDE (CheckCCompilerFlag) +INCLUDE (CheckCSourceRuns) +INCLUDE (CheckSymbolExists) + + +# WITH_PIC options.Not of much use, PIC is taken care of on platforms +# where it makes sense anyway. +IF(UNIX) + IF(APPLE) + # OSX executable are always PIC + SET(WITH_PIC ON) + ELSE() + OPTION(WITH_PIC "Generate PIC objects" OFF) + IF(WITH_PIC) + SET(CMAKE_C_FLAGS + "${CMAKE_C_FLAGS} ${CMAKE_SHARED_LIBRARY_C_FLAGS}") + SET(CMAKE_CXX_FLAGS + "${CMAKE_CXX_FLAGS} ${CMAKE_SHARED_LIBRARY_CXX_FLAGS}") + ENDIF() + ENDIF() +ENDIF() + + + +# System type affects version_compile_os variable +IF(NOT SYSTEM_TYPE) + IF(PLATFORM) + SET(SYSTEM_TYPE ${PLATFORM}) + ELSE() + SET(SYSTEM_TYPE ${CMAKE_SYSTEM_NAME}) + ENDIF() +ENDIF() + + +# Always enable -Wall for gnu C/C++ +IF(CMAKE_COMPILER_IS_GNUCXX) + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-unused-parameter") +ENDIF() +IF(CMAKE_COMPILER_IS_GNUCC) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") +ENDIF() + + +IF(CMAKE_COMPILER_IS_GNUCXX) + # MySQL "canonical" GCC flags. At least -fno-rtti flag affects + # ABI and cannot be simply removed. + SET(CMAKE_CXX_FLAGS + "${CMAKE_CXX_FLAGS} -fno-implicit-templates -fno-exceptions -fno-rtti") + IF(CMAKE_CXX_FLAGS) + STRING(REGEX MATCH "fno-implicit-templates" NO_IMPLICIT_TEMPLATES + ${CMAKE_CXX_FLAGS}) + IF (NO_IMPLICIT_TEMPLATES) + SET(HAVE_EXPLICIT_TEMPLATE_INSTANTIATION TRUE) + ENDIF() + ENDIF() + + IF (CMAKE_EXE_LINKER_FLAGS MATCHES " -static " + OR CMAKE_EXE_LINKER_FLAGS MATCHES " -static$") + SET(HAVE_DLOPEN FALSE CACHE "Disable dlopen due to -static flag" FORCE) + SET(WITHOUT_DYNAMIC_PLUGINS TRUE) + ENDIF() +ENDIF() + +IF(WITHOUT_DYNAMIC_PLUGINS) + MESSAGE("Dynamic plugins are disabled.") +ENDIF(WITHOUT_DYNAMIC_PLUGINS) + +# Large files, common flag +SET(_LARGEFILE_SOURCE 1) + +# If finds the size of a type, set SIZEOF_ and HAVE_ +FUNCTION(MY_CHECK_TYPE_SIZE type defbase) + CHECK_TYPE_SIZE("${type}" SIZEOF_${defbase}) + IF(SIZEOF_${defbase}) + SET(HAVE_${defbase} 1 PARENT_SCOPE) + ENDIF() +ENDFUNCTION() + +# Same for structs, setting HAVE_STRUCT_ instead +FUNCTION(MY_CHECK_STRUCT_SIZE type defbase) + CHECK_TYPE_SIZE("struct ${type}" SIZEOF_${defbase}) + IF(SIZEOF_${defbase}) + SET(HAVE_STRUCT_${defbase} 1 PARENT_SCOPE) + ENDIF() +ENDFUNCTION() + +# Searches function in libraries +# if function is found, sets output parameter result to the name of the library +# if function is found in libc, result will be empty +FUNCTION(MY_SEARCH_LIBS func libs result) + IF(${${result}}) + # Library is already found or was predefined + RETURN() + ENDIF() + CHECK_FUNCTION_EXISTS(${func} HAVE_${func}_IN_LIBC) + IF(HAVE_${func}_IN_LIBC) + SET(${result} "" PARENT_SCOPE) + RETURN() + ENDIF() + FOREACH(lib ${libs}) + CHECK_LIBRARY_EXISTS(${lib} ${func} "" HAVE_${func}_IN_${lib}) + IF(HAVE_${func}_IN_${lib}) + SET(${result} ${lib} PARENT_SCOPE) + SET(HAVE_${result} 1 PARENT_SCOPE) + RETURN() + ENDIF() + ENDFOREACH() +ENDFUNCTION() + +# Find out which libraries to use. +IF(UNIX) + MY_SEARCH_LIBS(floor m LIBM) + IF(NOT LIBM) + MY_SEARCH_LIBS(__infinity m LIBM) + ENDIF() + MY_SEARCH_LIBS(gethostbyname_r "nsl_r;nsl" LIBNSL) + MY_SEARCH_LIBS(bind "bind;socket" LIBBIND) + MY_SEARCH_LIBS(crypt crypt LIBCRYPT) + MY_SEARCH_LIBS(setsockopt socket LIBSOCKET) + MY_SEARCH_LIBS(dlopen dl LIBDL) + MY_SEARCH_LIBS(sched_yield rt LIBRT) + IF(NOT LIBRT) + MY_SEARCH_LIBS(clock_gettime rt LIBRT) + ENDIF() + FIND_PACKAGE(Threads) + + SET(CMAKE_REQUIRED_LIBRARIES + ${LIBM} ${LIBNSL} ${LIBBIND} ${LIBCRYPT} ${LIBSOCKET} ${LIBDL} ${CMAKE_THREAD_LIBS_INIT} ${LIBRT}) + + LIST(REMOVE_DUPLICATES CMAKE_REQUIRED_LIBRARIES) + LINK_LIBRARIES(${CMAKE_THREAD_LIBS_INIT}) + + OPTION(WITH_LIBWRAP "Compile with tcp wrappers support" OFF) + IF(WITH_LIBWRAP) + SET(SAVE_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}) + SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} wrap) + CHECK_C_SOURCE_COMPILES( + " + #include + int allow_severity = 0; + int deny_severity = 0; + int main() + { + hosts_access(0); + }" + HAVE_LIBWRAP) + SET(CMAKE_REQUIRED_LIBRARIES ${SAVE_CMAKE_REQUIRED_LIBRARIES}) + IF(HAVE_LIBWRAP) + SET(MYSYS_LIBWRAP_SOURCE ${CMAKE_SOURCE_DIR}/mysys/my_libwrap.c) + SET(LIBWRAP "wrap") + ENDIF() + ENDIF() +ENDIF() + +# +# Tests for header files +# +INCLUDE (CheckIncludeFiles) + +CHECK_INCLUDE_FILES ("stdlib.h;stdarg.h;string.h;float.h" STDC_HEADERS) +CHECK_INCLUDE_FILES (sys/types.h HAVE_SYS_TYPES_H) +CHECK_INCLUDE_FILES (alloca.h HAVE_ALLOCA_H) +CHECK_INCLUDE_FILES (aio.h HAVE_AIO_H) +CHECK_INCLUDE_FILES (arpa/inet.h HAVE_ARPA_INET_H) +CHECK_INCLUDE_FILES (crypt.h HAVE_CRYPT_H) +CHECK_INCLUDE_FILES (cxxabi.h HAVE_CXXABI_H) +CHECK_INCLUDE_FILES (dirent.h HAVE_DIRENT_H) +CHECK_INCLUDE_FILES (dlfcn.h HAVE_DLFCN_H) +CHECK_INCLUDE_FILES (execinfo.h HAVE_EXECINFO_H) +CHECK_INCLUDE_FILES (fcntl.h HAVE_FCNTL_H) +CHECK_INCLUDE_FILES (fenv.h HAVE_FENV_H) +CHECK_INCLUDE_FILES (float.h HAVE_FLOAT_H) +CHECK_INCLUDE_FILES (floatingpoint.h HAVE_FLOATINGPOINT_H) +CHECK_INCLUDE_FILES (fpu_control.h HAVE_FPU_CONTROL_H) +CHECK_INCLUDE_FILES (grp.h HAVE_GRP_H) +CHECK_INCLUDE_FILES (ieeefp.h HAVE_IEEEFP_H) +CHECK_INCLUDE_FILES (inttypes.h HAVE_INTTYPES_H) +CHECK_INCLUDE_FILES (langinfo.h HAVE_LANGINFO_H) +CHECK_INCLUDE_FILES (limits.h HAVE_LIMITS_H) +CHECK_INCLUDE_FILES (locale.h HAVE_LOCALE_H) +CHECK_INCLUDE_FILES (malloc.h HAVE_MALLOC_H) +CHECK_INCLUDE_FILES (memory.h HAVE_MEMORY_H) +CHECK_INCLUDE_FILES (ndir.h HAVE_NDIR_H) +CHECK_INCLUDE_FILES (netinet/in.h HAVE_NETINET_IN_H) +CHECK_INCLUDE_FILES (paths.h HAVE_PATHS_H) +CHECK_INCLUDE_FILES (port.h HAVE_PORT_H) +CHECK_INCLUDE_FILES (poll.h HAVE_POLL_H) +CHECK_INCLUDE_FILES (pwd.h HAVE_PWD_H) +CHECK_INCLUDE_FILES (sched.h HAVE_SCHED_H) +CHECK_INCLUDE_FILES (select.h HAVE_SELECT_H) +CHECK_INCLUDE_FILES (semaphore.h HAVE_SEMAPHORE_H) +CHECK_INCLUDE_FILES ("sys/types.h;sys/dir.h" HAVE_SYS_DIR_H) +CHECK_INCLUDE_FILES (sys/ndir.h HAVE_SYS_NDIR_H) +CHECK_INCLUDE_FILES (sys/pte.h HAVE_SYS_PTE_H) +CHECK_INCLUDE_FILES (stddef.h HAVE_STDDEF_H) +CHECK_INCLUDE_FILES (stdint.h HAVE_STDINT_H) +CHECK_INCLUDE_FILES (stdlib.h HAVE_STDLIB_H) +CHECK_INCLUDE_FILES (strings.h HAVE_STRINGS_H) +CHECK_INCLUDE_FILES (string.h HAVE_STRING_H) +CHECK_INCLUDE_FILES (synch.h HAVE_SYNCH_H) +CHECK_INCLUDE_FILES (sysent.h HAVE_SYSENT_H) +CHECK_INCLUDE_FILES (sys/cdefs.h HAVE_SYS_CDEFS_H) +CHECK_INCLUDE_FILES (sys/file.h HAVE_SYS_FILE_H) +CHECK_INCLUDE_FILES (sys/fpu.h HAVE_SYS_FPU_H) +CHECK_INCLUDE_FILES (sys/ioctl.h HAVE_SYS_IOCTL_H) +CHECK_INCLUDE_FILES (sys/ipc.h HAVE_SYS_IPC_H) +CHECK_INCLUDE_FILES (sys/malloc.h HAVE_SYS_MALLOC_H) +CHECK_INCLUDE_FILES (sys/mman.h HAVE_SYS_MMAN_H) +CHECK_INCLUDE_FILES (sys/prctl.h HAVE_SYS_PRCTL_H) +CHECK_INCLUDE_FILES (sys/resource.h HAVE_SYS_RESOURCE_H) +CHECK_INCLUDE_FILES (sys/select.h HAVE_SYS_SELECT_H) +CHECK_INCLUDE_FILES (sys/shm.h HAVE_SYS_SHM_H) +CHECK_INCLUDE_FILES (sys/socket.h HAVE_SYS_SOCKET_H) +CHECK_INCLUDE_FILES (sys/stat.h HAVE_SYS_STAT_H) +CHECK_INCLUDE_FILES (sys/stream.h HAVE_SYS_STREAM_H) +CHECK_INCLUDE_FILES (sys/termcap.h HAVE_SYS_TERMCAP_H) +CHECK_INCLUDE_FILES ("time.h;sys/timeb.h" HAVE_SYS_TIMEB_H) +CHECK_INCLUDE_FILES ("curses.h;term.h" HAVE_TERM_H) +CHECK_INCLUDE_FILES (asm/termbits.h HAVE_ASM_TERMBITS_H) +CHECK_INCLUDE_FILES (termbits.h HAVE_TERMBITS_H) +CHECK_INCLUDE_FILES (termios.h HAVE_TERMIOS_H) +CHECK_INCLUDE_FILES (termio.h HAVE_TERMIO_H) +CHECK_INCLUDE_FILES (termcap.h HAVE_TERMCAP_H) +CHECK_INCLUDE_FILES (unistd.h HAVE_UNISTD_H) +CHECK_INCLUDE_FILES (utime.h HAVE_UTIME_H) +CHECK_INCLUDE_FILES (varargs.h HAVE_VARARGS_H) +CHECK_INCLUDE_FILES (sys/time.h HAVE_SYS_TIME_H) +CHECK_INCLUDE_FILES (sys/utime.h HAVE_SYS_UTIME_H) +CHECK_INCLUDE_FILES (sys/wait.h HAVE_SYS_WAIT_H) +CHECK_INCLUDE_FILES (sys/param.h HAVE_SYS_PARAM_H) +CHECK_INCLUDE_FILES (sys/vadvise.h HAVE_SYS_VADVISE_H) +CHECK_INCLUDE_FILES (fnmatch.h HAVE_FNMATCH_H) +CHECK_INCLUDE_FILES (stdarg.h HAVE_STDARG_H) +CHECK_INCLUDE_FILES ("stdlib.h;sys/un.h" HAVE_SYS_UN_H) +CHECK_INCLUDE_FILES (vis.h HAVE_VIS_H) +CHECK_INCLUDE_FILES (wchar.h HAVE_WCHAR_H) +CHECK_INCLUDE_FILES (wctype.h HAVE_WCTYPE_H) + +IF(HAVE_SYS_STREAM_H) + # Needs sys/stream.h on Solaris + CHECK_INCLUDE_FILES ("sys/stream.h;sys/ptem.h" HAVE_SYS_PTEM_H) +ELSE() + CHECK_INCLUDE_FILES (sys/ptem.h HAVE_SYS_PTEM_H) +ENDIF() + +# Figure out threading library +# +FIND_PACKAGE (Threads) + +FUNCTION(MY_CHECK_PTHREAD_ONCE_INIT) + CHECK_C_COMPILER_FLAG("-Werror" HAVE_WERROR_FLAG) + IF(NOT HAVE_WERROR_FLAG) + RETURN() + ENDIF() + SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -Werror") + CHECK_C_SOURCE_COMPILES(" + #include + void foo(void) {} + int main() + { + pthread_once_t once_control = PTHREAD_ONCE_INIT; + pthread_once(&once_control, foo); + return 0; + }" + HAVE_PTHREAD_ONCE_INIT + ) + # http://bugs.opensolaris.org/bugdatabase/printableBug.do?bug_id=6611808 + IF(NOT HAVE_PTHREAD_ONCE_INIT) + CHECK_C_SOURCE_COMPILES(" + #include + void foo(void) {} + int main() + { + pthread_once_t once_control = { PTHREAD_ONCE_INIT }; + pthread_once(&once_control, foo); + return 0; + }" + HAVE_ARRAY_PTHREAD_ONCE_INIT + ) + ENDIF() + IF(HAVE_PTHREAD_ONCE_INIT) + SET(PTHREAD_ONCE_INITIALIZER "PTHREAD_ONCE_INIT" PARENT_SCOPE) + ENDIF() + IF(HAVE_ARRAY_PTHREAD_ONCE_INIT) + SET(PTHREAD_ONCE_INITIALIZER "{ PTHREAD_ONCE_INIT }" PARENT_SCOPE) + ENDIF() +ENDFUNCTION() + +IF(CMAKE_USE_PTHREADS_INIT) + MY_CHECK_PTHREAD_ONCE_INIT() +ENDIF() + +# +# Tests for functions +# +#CHECK_FUNCTION_EXISTS (aiowait HAVE_AIOWAIT) +CHECK_FUNCTION_EXISTS (aio_read HAVE_AIO_READ) +CHECK_FUNCTION_EXISTS (alarm HAVE_ALARM) +SET(HAVE_ALLOCA 1) +CHECK_FUNCTION_EXISTS (backtrace HAVE_BACKTRACE) +CHECK_FUNCTION_EXISTS (backtrace_symbols HAVE_BACKTRACE_SYMBOLS) +CHECK_FUNCTION_EXISTS (backtrace_symbols_fd HAVE_BACKTRACE_SYMBOLS_FD) +CHECK_FUNCTION_EXISTS (printstack HAVE_PRINTSTACK) +CHECK_FUNCTION_EXISTS (bfill HAVE_BFILL) +CHECK_FUNCTION_EXISTS (bmove HAVE_BMOVE) +CHECK_FUNCTION_EXISTS (bsearch HAVE_BSEARCH) +CHECK_FUNCTION_EXISTS (index HAVE_INDEX) +CHECK_FUNCTION_EXISTS (bzero HAVE_BZERO) +CHECK_FUNCTION_EXISTS (clock_gettime HAVE_CLOCK_GETTIME) +CHECK_FUNCTION_EXISTS (cuserid HAVE_CUSERID) +CHECK_FUNCTION_EXISTS (directio HAVE_DIRECTIO) +CHECK_FUNCTION_EXISTS (_doprnt HAVE_DOPRNT) +CHECK_FUNCTION_EXISTS (flockfile HAVE_FLOCKFILE) +CHECK_FUNCTION_EXISTS (ftruncate HAVE_FTRUNCATE) +CHECK_FUNCTION_EXISTS (getline HAVE_GETLINE) +CHECK_FUNCTION_EXISTS (compress HAVE_COMPRESS) +CHECK_FUNCTION_EXISTS (crypt HAVE_CRYPT) +CHECK_FUNCTION_EXISTS (dlerror HAVE_DLERROR) +CHECK_FUNCTION_EXISTS (dlopen HAVE_DLOPEN) +CHECK_FUNCTION_EXISTS (fchmod HAVE_FCHMOD) +CHECK_FUNCTION_EXISTS (fcntl HAVE_FCNTL) +CHECK_FUNCTION_EXISTS (fconvert HAVE_FCONVERT) +CHECK_FUNCTION_EXISTS (fdatasync HAVE_FDATASYNC) +CHECK_SYMBOL_EXISTS(fdatasync "unistd.h" HAVE_DECL_FDATASYNC) +CHECK_FUNCTION_EXISTS (fesetround HAVE_FESETROUND) +CHECK_FUNCTION_EXISTS (fpsetmask HAVE_FPSETMASK) +CHECK_FUNCTION_EXISTS (fseeko HAVE_FSEEKO) +CHECK_FUNCTION_EXISTS (fsync HAVE_FSYNC) +CHECK_FUNCTION_EXISTS (getcwd HAVE_GETCWD) +CHECK_FUNCTION_EXISTS (gethostbyaddr_r HAVE_GETHOSTBYADDR_R) +CHECK_FUNCTION_EXISTS (gethostbyname_r HAVE_GETHOSTBYNAME_R) +CHECK_FUNCTION_EXISTS (gethrtime HAVE_GETHRTIME) +CHECK_FUNCTION_EXISTS (getnameinfo HAVE_GETNAMEINFO) +CHECK_FUNCTION_EXISTS (getpass HAVE_GETPASS) +CHECK_FUNCTION_EXISTS (getpassphrase HAVE_GETPASSPHRASE) +CHECK_FUNCTION_EXISTS (getpwnam HAVE_GETPWNAM) +CHECK_FUNCTION_EXISTS (getpwuid HAVE_GETPWUID) +CHECK_FUNCTION_EXISTS (getrlimit HAVE_GETRLIMIT) +CHECK_FUNCTION_EXISTS (getrusage HAVE_GETRUSAGE) +CHECK_FUNCTION_EXISTS (getwd HAVE_GETWD) +CHECK_FUNCTION_EXISTS (gmtime_r HAVE_GMTIME_R) +CHECK_FUNCTION_EXISTS (initgroups HAVE_INITGROUPS) +CHECK_FUNCTION_EXISTS (issetugid HAVE_ISSETUGID) +CHECK_FUNCTION_EXISTS (ldiv HAVE_LDIV) +CHECK_FUNCTION_EXISTS (localtime_r HAVE_LOCALTIME_R) +CHECK_FUNCTION_EXISTS (longjmp HAVE_LONGJMP) +CHECK_FUNCTION_EXISTS (lstat HAVE_LSTAT) +CHECK_FUNCTION_EXISTS (madvise HAVE_MADVISE) +CHECK_FUNCTION_EXISTS (mallinfo HAVE_MALLINFO) +CHECK_FUNCTION_EXISTS (memcpy HAVE_MEMCPY) +CHECK_FUNCTION_EXISTS (memmove HAVE_MEMMOVE) +CHECK_FUNCTION_EXISTS (mkstemp HAVE_MKSTEMP) +CHECK_FUNCTION_EXISTS (mlock HAVE_MLOCK) +CHECK_FUNCTION_EXISTS (mlockall HAVE_MLOCKALL) +CHECK_FUNCTION_EXISTS (mmap HAVE_MMAP) +CHECK_FUNCTION_EXISTS (mmap64 HAVE_MMAP64) +CHECK_FUNCTION_EXISTS (perror HAVE_PERROR) +CHECK_FUNCTION_EXISTS (poll HAVE_POLL) +CHECK_FUNCTION_EXISTS (port_create HAVE_PORT_CREATE) +CHECK_FUNCTION_EXISTS (posix_fallocate HAVE_POSIX_FALLOCATE) +CHECK_FUNCTION_EXISTS (pread HAVE_PREAD) +CHECK_FUNCTION_EXISTS (pthread_attr_create HAVE_PTHREAD_ATTR_CREATE) +CHECK_FUNCTION_EXISTS (pthread_attr_getstacksize HAVE_PTHREAD_ATTR_GETSTACKSIZE) +CHECK_FUNCTION_EXISTS (pthread_attr_setscope HAVE_PTHREAD_ATTR_SETSCOPE) +CHECK_FUNCTION_EXISTS (pthread_attr_setstacksize HAVE_PTHREAD_ATTR_SETSTACKSIZE) +CHECK_FUNCTION_EXISTS (pthread_condattr_create HAVE_PTHREAD_CONDATTR_CREATE) +CHECK_FUNCTION_EXISTS (pthread_condattr_setclock HAVE_PTHREAD_CONDATTR_SETCLOCK) +CHECK_FUNCTION_EXISTS (pthread_init HAVE_PTHREAD_INIT) +CHECK_FUNCTION_EXISTS (pthread_key_delete HAVE_PTHREAD_KEY_DELETE) +CHECK_FUNCTION_EXISTS (pthread_rwlock_rdlock HAVE_PTHREAD_RWLOCK_RDLOCK) +CHECK_FUNCTION_EXISTS (pthread_sigmask HAVE_PTHREAD_SIGMASK) +CHECK_FUNCTION_EXISTS (pthread_threadmask HAVE_PTHREAD_THREADMASK) +CHECK_FUNCTION_EXISTS (pthread_yield_np HAVE_PTHREAD_YIELD_NP) +CHECK_FUNCTION_EXISTS (putenv HAVE_PUTENV) +CHECK_FUNCTION_EXISTS (readdir_r HAVE_READDIR_R) +CHECK_FUNCTION_EXISTS (readlink HAVE_READLINK) +CHECK_FUNCTION_EXISTS (re_comp HAVE_RE_COMP) +CHECK_FUNCTION_EXISTS (regcomp HAVE_REGCOMP) +CHECK_FUNCTION_EXISTS (realpath HAVE_REALPATH) +CHECK_FUNCTION_EXISTS (rename HAVE_RENAME) +CHECK_FUNCTION_EXISTS (rwlock_init HAVE_RWLOCK_INIT) +CHECK_FUNCTION_EXISTS (sched_yield HAVE_SCHED_YIELD) +CHECK_FUNCTION_EXISTS (setenv HAVE_SETENV) +CHECK_FUNCTION_EXISTS (setlocale HAVE_SETLOCALE) +CHECK_FUNCTION_EXISTS (setfd HAVE_SETFD) +CHECK_FUNCTION_EXISTS (sigaction HAVE_SIGACTION) +CHECK_FUNCTION_EXISTS (sigthreadmask HAVE_SIGTHREADMASK) +CHECK_FUNCTION_EXISTS (sigwait HAVE_SIGWAIT) +CHECK_FUNCTION_EXISTS (sigaddset HAVE_SIGADDSET) +CHECK_FUNCTION_EXISTS (sigemptyset HAVE_SIGEMPTYSET) +CHECK_FUNCTION_EXISTS (sighold HAVE_SIGHOLD) +CHECK_FUNCTION_EXISTS (sigset HAVE_SIGSET) +CHECK_FUNCTION_EXISTS (sleep HAVE_SLEEP) +CHECK_FUNCTION_EXISTS (snprintf HAVE_SNPRINTF) +CHECK_FUNCTION_EXISTS (stpcpy HAVE_STPCPY) +CHECK_FUNCTION_EXISTS (strcoll HAVE_STRCOLL) +CHECK_FUNCTION_EXISTS (strerror HAVE_STRERROR) +CHECK_FUNCTION_EXISTS (strlcpy HAVE_STRLCPY) +CHECK_FUNCTION_EXISTS (strnlen HAVE_STRNLEN) +CHECK_FUNCTION_EXISTS (strlcat HAVE_STRLCAT) +CHECK_FUNCTION_EXISTS (strsignal HAVE_STRSIGNAL) +CHECK_FUNCTION_EXISTS (fgetln HAVE_FGETLN) +CHECK_FUNCTION_EXISTS (strpbrk HAVE_STRPBRK) +CHECK_FUNCTION_EXISTS (strsep HAVE_STRSEP) +CHECK_FUNCTION_EXISTS (strstr HAVE_STRSTR) +CHECK_FUNCTION_EXISTS (strtok_r HAVE_STRTOK_R) +CHECK_FUNCTION_EXISTS (strtol HAVE_STRTOL) +CHECK_FUNCTION_EXISTS (strtoll HAVE_STRTOLL) +CHECK_FUNCTION_EXISTS (strtoul HAVE_STRTOUL) +CHECK_FUNCTION_EXISTS (strtoull HAVE_STRTOULL) +CHECK_FUNCTION_EXISTS (strcasecmp HAVE_STRCASECMP) +CHECK_FUNCTION_EXISTS (strncasecmp HAVE_STRNCASECMP) +CHECK_FUNCTION_EXISTS (strdup HAVE_STRDUP) +CHECK_FUNCTION_EXISTS (shmat HAVE_SHMAT) +CHECK_FUNCTION_EXISTS (shmctl HAVE_SHMCTL) +CHECK_FUNCTION_EXISTS (shmdt HAVE_SHMDT) +CHECK_FUNCTION_EXISTS (shmget HAVE_SHMGET) +CHECK_FUNCTION_EXISTS (tell HAVE_TELL) +CHECK_FUNCTION_EXISTS (tempnam HAVE_TEMPNAM) +CHECK_FUNCTION_EXISTS (thr_setconcurrency HAVE_THR_SETCONCURRENCY) +CHECK_FUNCTION_EXISTS (thr_yield HAVE_THR_YIELD) +CHECK_FUNCTION_EXISTS (vasprintf HAVE_VASPRINTF) +CHECK_FUNCTION_EXISTS (vsnprintf HAVE_VSNPRINTF) +CHECK_FUNCTION_EXISTS (vprintf HAVE_VPRINTF) +CHECK_FUNCTION_EXISTS (valloc HAVE_VALLOC) +CHECK_FUNCTION_EXISTS (memalign HAVE_MEMALIGN) +CHECK_FUNCTION_EXISTS (chown HAVE_CHOWN) +CHECK_FUNCTION_EXISTS (nl_langinfo HAVE_NL_LANGINFO) + +#-------------------------------------------------------------------- +# Support for WL#2373 (Use cycle counter for timing) +#-------------------------------------------------------------------- + +CHECK_INCLUDE_FILES(time.h HAVE_TIME_H) +CHECK_INCLUDE_FILES(sys/time.h HAVE_SYS_TIME_H) +CHECK_INCLUDE_FILES(sys/times.h HAVE_SYS_TIMES_H) +CHECK_INCLUDE_FILES(asm/msr.h HAVE_ASM_MSR_H) +#msr.h has rdtscll() + +CHECK_INCLUDE_FILES(ia64intrin.h HAVE_IA64INTRIN_H) + +CHECK_FUNCTION_EXISTS(times HAVE_TIMES) +CHECK_FUNCTION_EXISTS(gettimeofday HAVE_GETTIMEOFDAY) +CHECK_FUNCTION_EXISTS(read_real_time HAVE_READ_REAL_TIME) +# This should work on AIX. + +CHECK_FUNCTION_EXISTS(ftime HAVE_FTIME) +# This is still a normal call for milliseconds. + +CHECK_FUNCTION_EXISTS(time HAVE_TIME) +# We can use time() on Macintosh if there is no ftime(). + +CHECK_FUNCTION_EXISTS(rdtscll HAVE_RDTSCLL) +# I doubt that we'll ever reach the check for this. + + +# +# Tests for symbols +# + +CHECK_SYMBOL_EXISTS(sys_errlist "stdio.h" HAVE_SYS_ERRLIST) +CHECK_SYMBOL_EXISTS(madvise "sys/mman.h" HAVE_DECL_MADVISE) +CHECK_SYMBOL_EXISTS(tzname "time.h" HAVE_TZNAME) +CHECK_SYMBOL_EXISTS(lrand48 "stdlib.h" HAVE_LRAND48) +CHECK_SYMBOL_EXISTS(getpagesize "unistd.h" HAVE_GETPAGESIZE) +CHECK_SYMBOL_EXISTS(TIOCGWINSZ "sys/ioctl.h" GWINSZ_IN_SYS_IOCTL) +CHECK_SYMBOL_EXISTS(FIONREAD "sys/ioctl.h" FIONREAD_IN_SYS_IOCTL) +CHECK_SYMBOL_EXISTS(TIOCSTAT "sys/ioctl.h" TIOCSTAT_IN_SYS_IOCTL) +CHECK_SYMBOL_EXISTS(gettimeofday "sys/time.h" HAVE_GETTIMEOFDAY) + +CHECK_SYMBOL_EXISTS(finite "math.h" HAVE_FINITE_IN_MATH_H) +IF(HAVE_FINITE_IN_MATH_H) + SET(HAVE_FINITE TRUE CACHE INTERNAL "") +ELSE() + CHECK_SYMBOL_EXISTS(finite "ieeefp.h" HAVE_FINITE) +ENDIF() +CHECK_SYMBOL_EXISTS(log2 math.h HAVE_LOG2) +CHECK_SYMBOL_EXISTS(isnan math.h HAVE_ISNAN) +CHECK_SYMBOL_EXISTS(rint math.h HAVE_RINT) + +# isinf() prototype not found on Solaris +CHECK_CXX_SOURCE_COMPILES( +"#include +int main() { + isinf(0.0); + return 0; +}" HAVE_ISINF) + + + +# +# Test for endianess +# +INCLUDE(TestBigEndian) +IF(APPLE) + # Cannot run endian test on universal PPC/Intel binaries + # would return inconsistent result. + # config.h.cmake includes a special #ifdef for Darwin +ELSE() + TEST_BIG_ENDIAN(WORDS_BIGENDIAN) +ENDIF() + +# +# Tests for type sizes (and presence) +# +INCLUDE (CheckTypeSize) +set(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} + -D_LARGEFILE_SOURCE -D_LARGE_FILES -D_FILE_OFFSET_BITS=64 + -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS) +SET(CMAKE_EXTRA_INCLUDE_FILES signal.h) +MY_CHECK_TYPE_SIZE(sigset_t SIGSET_T) +IF(NOT SIZEOF_SIGSET_T) + SET(sigset_t int) +ENDIF() +MY_CHECK_TYPE_SIZE(mode_t MODE_T) +IF(NOT SIZEOF_MODE_T) + SET(mode_t int) +ENDIF() + + +IF(HAVE_STDINT_H) + SET(CMAKE_EXTRA_INCLUDE_FILES stdint.h) +ENDIF(HAVE_STDINT_H) + +SET(HAVE_VOIDP 1) +SET(HAVE_CHARP 1) +SET(HAVE_LONG 1) +SET(HAVE_SIZE_T 1) + +IF(NOT APPLE) +MY_CHECK_TYPE_SIZE("void *" VOIDP) +MY_CHECK_TYPE_SIZE("char *" CHARP) +MY_CHECK_TYPE_SIZE(long LONG) +MY_CHECK_TYPE_SIZE(size_t SIZE_T) +ENDIF() + +MY_CHECK_TYPE_SIZE(char CHAR) +MY_CHECK_TYPE_SIZE(short SHORT) +MY_CHECK_TYPE_SIZE(int INT) +MY_CHECK_TYPE_SIZE("long long" LONG_LONG) +SET(CMAKE_EXTRA_INCLUDE_FILES stdio.h sys/types.h) +MY_CHECK_TYPE_SIZE(off_t OFF_T) +MY_CHECK_TYPE_SIZE(uchar UCHAR) +MY_CHECK_TYPE_SIZE(uint UINT) +MY_CHECK_TYPE_SIZE(ulong ULONG) +MY_CHECK_TYPE_SIZE(int8 INT8) +MY_CHECK_TYPE_SIZE(uint8 UINT8) +MY_CHECK_TYPE_SIZE(int16 INT16) +MY_CHECK_TYPE_SIZE(uint16 UINT16) +MY_CHECK_TYPE_SIZE(int32 INT32) +MY_CHECK_TYPE_SIZE(uint32 UINT32) +MY_CHECK_TYPE_SIZE(u_int32_t U_INT32_T) +MY_CHECK_TYPE_SIZE(int64 INT64) +MY_CHECK_TYPE_SIZE(uint64 UINT64) +SET (CMAKE_EXTRA_INCLUDE_FILES sys/types.h) +MY_CHECK_TYPE_SIZE(bool BOOL) +SET(CMAKE_EXTRA_INCLUDE_FILES) +IF(HAVE_SYS_SOCKET_H) + SET(CMAKE_EXTRA_INCLUDE_FILES sys/socket.h) +ENDIF(HAVE_SYS_SOCKET_H) +MY_CHECK_TYPE_SIZE(socklen_t SOCKLEN_T) +SET(CMAKE_EXTRA_INCLUDE_FILES) + +IF(HAVE_IEEEFP_H) + SET(CMAKE_EXTRA_INCLUDE_FILES ieeefp.h) + MY_CHECK_TYPE_SIZE(fp_except FP_EXCEPT) +ENDIF() + + +# +# Code tests +# + +CHECK_C_SOURCE_COMPILES(" +#ifdef _WIN32 +#include +#include +#else +#include +#include +#include +#endif +int main() +{ + getaddrinfo( 0, 0, 0, 0); + return 0; +}" +HAVE_GETADDRINFO) + +CHECK_C_SOURCE_COMPILES(" +#ifdef _WIN32 +#include +#include +#else +#include +#include +#include +#endif +int main() +{ + select(0,0,0,0,0); + return 0; +}" +HAVE_SELECT) + +# +# Check if timespec has ts_sec and ts_nsec fields +# + +CHECK_C_SOURCE_COMPILES(" +#include + +int main(int ac, char **av) +{ + struct timespec abstime; + abstime.ts_sec = time(NULL)+1; + abstime.ts_nsec = 0; +} +" HAVE_TIMESPEC_TS_SEC) + + +# +# Check return type of qsort() +# +CHECK_C_SOURCE_COMPILES(" +#include +#ifdef __cplusplus +extern \"C\" +#endif +void qsort(void *base, size_t nel, size_t width, + int (*compar) (const void *, const void *)); +int main(int ac, char **av) {} +" QSORT_TYPE_IS_VOID) +IF(QSORT_TYPE_IS_VOID) + SET(RETQSORTTYPE "void") +ELSE(QSORT_TYPE_IS_VOID) + SET(RETQSORTTYPE "int") +ENDIF(QSORT_TYPE_IS_VOID) + +IF(WIN32) +SET(SOCKET_SIZE_TYPE int) +ELSE() +CHECK_CXX_SOURCE_COMPILES(" +#include +int main(int argc, char **argv) +{ + getsockname(0,0,(socklen_t *) 0); + return 0; +}" +HAVE_SOCKET_SIZE_T_AS_socklen_t) + +IF(HAVE_SOCKET_SIZE_T_AS_socklen_t) + SET(SOCKET_SIZE_TYPE socklen_t) +ELSE() + CHECK_CXX_SOURCE_COMPILES(" + #include + int main(int argc, char **argv) + { + getsockname(0,0,(int *) 0); + return 0; + }" + HAVE_SOCKET_SIZE_T_AS_int) + IF(HAVE_SOCKET_SIZE_T_AS_int) + SET(SOCKET_SIZE_TYPE int) + ELSE() + CHECK_CXX_SOURCE_COMPILES(" + #include + int main(int argc, char **argv) + { + getsockname(0,0,(size_t *) 0); + return 0; + }" + HAVE_SOCKET_SIZE_T_AS_size_t) + IF(HAVE_SOCKET_SIZE_T_AS_size_t) + SET(SOCKET_SIZE_TYPE size_t) + ELSE() + SET(SOCKET_SIZE_TYPE int) + ENDIF() + ENDIF() +ENDIF() +ENDIF() + +CHECK_CXX_SOURCE_COMPILES(" +#include +int main() +{ + pthread_yield(); + return 0; +} +" HAVE_PTHREAD_YIELD_ZERO_ARG) + +IF(NOT STACK_DIRECTION) + IF(CMAKE_CROSSCOMPILING) + MESSAGE(FATAL_ERROR + "STACK_DIRECTION is not defined. Please specify -DSTACK_DIRECTION=1 " + "or -DSTACK_DIRECTION=-1 when calling cmake.") + ELSE() + TRY_RUN(STACKDIR_RUN_RESULT STACKDIR_COMPILE_RESULT + ${CMAKE_BINARY_DIR} + ${CMAKE_SOURCE_DIR}/cmake/stack_direction.c + ) + # Test program returns 0 (down) or 1 (up). + # Convert to -1 or 1 + IF(STACKDIR_RUN_RESULT EQUAL 0) + SET(STACK_DIRECTION -1 CACHE INTERNAL "Stack grows direction") + ELSE() + SET(STACK_DIRECTION 1 CACHE INTERNAL "Stack grows direction") + ENDIF() + MESSAGE(STATUS "Checking stack direction : ${STACK_DIRECTION}") + ENDIF() +ENDIF() + +# +# Check return type of signal handlers +# +CHECK_C_SOURCE_COMPILES(" +#include +#ifdef signal +# undef signal +#endif +#ifdef __cplusplus +extern \"C\" void (*signal (int, void (*)(int)))(int); +#else +void (*signal ()) (); +#endif +int main(int ac, char **av) {} +" SIGNAL_RETURN_TYPE_IS_VOID) +IF(SIGNAL_RETURN_TYPE_IS_VOID) + SET(RETSIGTYPE void) + SET(VOID_SIGHANDLER 1) +ELSE(SIGNAL_RETURN_TYPE_IS_VOID) + SET(RETSIGTYPE int) +ENDIF(SIGNAL_RETURN_TYPE_IS_VOID) + + +CHECK_INCLUDE_FILES("time.h;sys/time.h" TIME_WITH_SYS_TIME) +CHECK_SYMBOL_EXISTS(O_NONBLOCK "unistd.h;fcntl.h" HAVE_FCNTL_NONBLOCK) +IF(NOT HAVE_FCNTL_NONBLOCK) + SET(NO_FCNTL_NONBLOCK 1) +ENDIF() + +# +# Test for how the C compiler does inline, if at all +# +CHECK_C_SOURCE_COMPILES(" +static inline int foo(){return 0;} +int main(int argc, char *argv[]){return 0;}" + C_HAS_inline) +IF(NOT C_HAS_inline) + CHECK_C_SOURCE_COMPILES(" + static __inline int foo(){return 0;} + int main(int argc, char *argv[]){return 0;}" + C_HAS___inline) + SET(C_INLINE __inline) +ENDIF() + +IF(NOT CMAKE_CROSSCOMPILING AND NOT MSVC) + STRING(TOLOWER ${CMAKE_SYSTEM_PROCESSOR} processor) + IF(processor MATCHES "86" OR processor MATCHES "amd64" OR processor MATCHES "x64") + #Check for x86 PAUSE instruction + # We have to actually try running the test program, because of a bug + # in Solaris on x86_64, where it wrongly reports that PAUSE is not + # supported when trying to run an application. See + # http://bugs.opensolaris.org/bugdatabase/printableBug.do?bug_id=6478684 + CHECK_C_SOURCE_RUNS(" + int main() + { + __asm__ __volatile__ (\"pause\"); + return 0; + }" HAVE_PAUSE_INSTRUCTION) + ENDIF() + IF (NOT HAVE_PAUSE_INSTRUCTION) + CHECK_C_SOURCE_COMPILES(" + int main() + { + __asm__ __volatile__ (\"rep; nop\"); + return 0; + } + " HAVE_FAKE_PAUSE_INSTRUCTION) + ENDIF() +ENDIF() + +CHECK_SYMBOL_EXISTS(tcgetattr "termios.h" HAVE_TCGETATTR 1) + +# +# Check type of signal routines (posix, 4.2bsd, 4.1bsd or v7) +# +CHECK_C_SOURCE_COMPILES(" + #include + int main(int ac, char **av) + { + sigset_t ss; + struct sigaction sa; + sigemptyset(&ss); sigsuspend(&ss); + sigaction(SIGINT, &sa, (struct sigaction *) 0); + sigprocmask(SIG_BLOCK, &ss, (sigset_t *) 0); + }" + HAVE_POSIX_SIGNALS) + +IF(NOT HAVE_POSIX_SIGNALS) + CHECK_C_SOURCE_COMPILES(" + #include + int main(int ac, char **av) + { + int mask = sigmask(SIGINT); + sigsetmask(mask); sigblock(mask); sigpause(mask); + }" + HAVE_BSD_SIGNALS) + IF (NOT HAVE_BSD_SIGNALS) + CHECK_C_SOURCE_COMPILES(" + #include + void foo() { } + int main(int ac, char **av) + { + int mask = sigmask(SIGINT); + sigset(SIGINT, foo); sigrelse(SIGINT); + sighold(SIGINT); sigpause(SIGINT); + }" + HAVE_SVR3_SIGNALS) + IF (NOT HAVE_SVR3_SIGNALS) + SET(HAVE_V7_SIGNALS 1) + ENDIF(NOT HAVE_SVR3_SIGNALS) + ENDIF(NOT HAVE_BSD_SIGNALS) +ENDIF(NOT HAVE_POSIX_SIGNALS) + +# Assume regular sprintf +SET(SPRINTFS_RETURNS_INT 1) + +IF(CMAKE_COMPILER_IS_GNUCXX AND HAVE_CXXABI_H) +CHECK_CXX_SOURCE_COMPILES(" + #include + int main(int argc, char **argv) + { + char *foo= 0; int bar= 0; + foo= abi::__cxa_demangle(foo, foo, 0, &bar); + return 0; + }" + HAVE_ABI_CXA_DEMANGLE) +ENDIF() + +CHECK_C_SOURCE_COMPILES(" + int main(int argc, char **argv) + { + extern char *__bss_start; + return __bss_start ? 1 : 0; + }" +HAVE_BSS_START) + +CHECK_C_SOURCE_COMPILES(" + int main() + { + extern void __attribute__((weak)) foo(void); + return 0; + }" + HAVE_WEAK_SYMBOL +) + + +CHECK_CXX_SOURCE_COMPILES(" + #include + int main() + { + char *c = new char; + return 0; + }" + HAVE_CXX_NEW +) + +CHECK_CXX_SOURCE_COMPILES(" + #undef inline + #if !defined(SCO) && !defined(__osf__) && !defined(_REENTRANT) + #define _REENTRANT + #endif + #include + #include + #include + #include + #include + #include + int main() + { + + struct hostent *foo = + gethostbyaddr_r((const char *) 0, + 0, 0, (struct hostent *) 0, (char *) NULL, 0, (int *)0); + return 0; + } + " + HAVE_SOLARIS_STYLE_GETHOST) + +CHECK_CXX_SOURCE_COMPILES(" + #undef inline + #if !defined(SCO) && !defined(__osf__) && !defined(_REENTRANT) + #define _REENTRANT + #endif + #include + #include + #include + #include + #include + #include + int main() + { + int ret = gethostbyname_r((const char *) 0, + (struct hostent*) 0, (char*) 0, 0, (struct hostent **) 0, (int *) 0); + return 0; + }" + HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE) + +CHECK_CXX_SOURCE_COMPILES(" + #undef inline + #if !defined(SCO) && !defined(__osf__) && !defined(_REENTRANT) + #define _REENTRANT + #endif + #include + #include + #include + #include + #include + #include + int main() + { + int ret = gethostbyname_r((const char *) 0, (struct hostent*) 0, (struct hostent_data*) 0); + return 0; + }" + HAVE_GETHOSTBYNAME_R_RETURN_INT) + + +# Use of ALARMs to wakeup on timeout on sockets +# +# This feature makes use of a mutex and is a scalability hog we +# try to avoid using. However we need support for SO_SNDTIMEO and +# SO_RCVTIMEO socket options for this to work. So we will check +# if this feature is supported by a simple TRY_RUN macro. However +# on some OS's there is support for setting those variables but +# they are silently ignored. For those OS's we will not attempt +# to use SO_SNDTIMEO and SO_RCVTIMEO even if it is said to work. +# See Bug#29093 for the problem with SO_SND/RCVTIMEO on HP/UX. +# To use alarm is simple, simply avoid setting anything. + +IF(WIN32) + SET(HAVE_SOCKET_TIMEOUT 1) +ELSEIF(CMAKE_SYSTEM MATCHES "HP-UX") + SET(HAVE_SOCKET_TIMEOUT 0) +ELSEIF(CMAKE_CROSSCOMPILING) + SET(HAVE_SOCKET_TIMEOUT 0) +ELSE() +SET(CMAKE_REQUIRED_LIBRARIES ${LIBNSL} ${LIBSOCKET}) +CHECK_C_SOURCE_RUNS( +" + #include + #include + #include + + int main() + { + int fd = socket(AF_INET, SOCK_STREAM, 0); + struct timeval tv; + int ret= 0; + tv.tv_sec= 2; + tv.tv_usec= 0; + ret|= setsockopt(fd, SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof(tv)); + ret|= setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv)); + return !!ret; + } +" HAVE_SOCKET_TIMEOUT) +ENDIF() + +SET(NO_ALARM "${HAVE_SOCKET_TIMEOUT}" CACHE BOOL + "No need to use alarm to implement socket timeout") +SET(SIGNAL_WITH_VIO_CLOSE "${HAVE_SOCKET_TIMEOUT}") +MARK_AS_ADVANCED(NO_ALARM) + + +IF(CMAKE_COMPILER_IS_GNUCXX) +IF(WITH_ATOMIC_OPS STREQUAL "up") + SET(MY_ATOMIC_MODE_DUMMY 1 CACHE BOOL "Assume single-CPU mode, no concurrency") +ELSEIF(WITH_ATOMIC_OPS STREQUAL "rwlocks") + SET(MY_ATOMIC_MODE_RWLOCK 1 CACHE BOOL "Use pthread rwlocks for atomic ops") +ELSEIF(WITH_ATOMIC_OPS STREQUAL "smp") +ELSEIF(NOT WITH_ATOMIC_OPS) + CHECK_CXX_SOURCE_COMPILES(" + int main() + { + int foo= -10; int bar= 10; + long long int foo64= -10; long long int bar64= 10; + if (!__sync_fetch_and_add(&foo, bar) || foo) + return -1; + bar= __sync_lock_test_and_set(&foo, bar); + if (bar || foo != 10) + return -1; + bar= __sync_val_compare_and_swap(&bar, foo, 15); + if (bar) + return -1; + if (!__sync_fetch_and_add(&foo64, bar64) || foo64) + return -1; + bar64= __sync_lock_test_and_set(&foo64, bar64); + if (bar64 || foo64 != 10) + return -1; + bar64= __sync_val_compare_and_swap(&bar64, foo, 15); + if (bar64) + return -1; + return 0; + }" + HAVE_GCC_ATOMIC_BUILTINS) +ELSE() + MESSAGE(FATAL_ERROR "${WITH_ATOMIC_OPS} is not a valid value for WITH_ATOMIC_OPS!") +ENDIF() +ENDIF() + +SET(WITH_ATOMIC_LOCKS "${WITH_ATOMIC_LOCKS}" CACHE STRING +"Implement atomic operations using pthread rwlocks or atomic CPU +instructions for multi-processor or uniprocessor +configuration. By default gcc built-in sync functions are used, +if available and 'smp' configuration otherwise.") +MARK_AS_ADVANCED(WITH_ATOMIC_LOCKS MY_ATOMIC_MODE_RWLOCK MY_ATOMIC_MODE_DUMMY) + +IF(WITH_VALGRIND) + CHECK_INCLUDE_FILES("valgrind/memcheck.h;valgrind/valgrind.h" + HAVE_VALGRIND_HEADERS) + IF(HAVE_VALGRIND_HEADERS) + SET(HAVE_VALGRIND 1) + ENDIF() +ENDIF() + +#-------------------------------------------------------------------- +# Check for IPv6 support +#-------------------------------------------------------------------- +CHECK_INCLUDE_FILE(netinet/in6.h HAVE_NETINET_IN6_H) + +IF(UNIX) + SET(CMAKE_EXTRA_INCLUDE_FILES sys/types.h netinet/in.h sys/socket.h) + IF(HAVE_NETINET_IN6_H) + SET(CMAKE_EXTRA_INCLUDE_FILES ${CMAKE_EXTRA_INCLUDE_FILES} netinet/in6.h) + ENDIF() +ELSEIF(WIN32) + SET(CMAKE_EXTRA_INCLUDE_FILES ${CMAKE_EXTRA_INCLUDE_FILES} winsock2.h ws2ipdef.h) +ENDIF() + +MY_CHECK_STRUCT_SIZE("sockaddr_in6" SOCKADDR_IN6) +MY_CHECK_STRUCT_SIZE("in6_addr" IN6_ADDR) + +IF(HAVE_STRUCT_SOCKADDR_IN6 OR HAVE_STRUCT_IN6_ADDR) + SET(HAVE_IPV6 TRUE CACHE INTERNAL "") +ENDIF() + + +# Check for sockaddr_storage.ss_family +# It is called differently under OS400 and older AIX + +CHECK_STRUCT_HAS_MEMBER("struct sockaddr_storage" + ss_family "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_SOCKADDR_STORAGE_SS_FAMILY) +IF(NOT HAVE_SOCKADDR_STORAGE_SS_FAMILY) + CHECK_STRUCT_HAS_MEMBER("struct sockaddr_storage" + __ss_family "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_SOCKADDR_STORAGE___SS_FAMILY) + IF(HAVE_SOCKADDR_STORAGE___SS_FAMILY) + SET(ss_family __ss_family) + ENDIF() +ENDIF() + +# +# Check if struct sockaddr_in::sin_len is available. +# + +CHECK_STRUCT_HAS_MEMBER("struct sockaddr_in" sin_len + "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_SOCKADDR_IN_SIN_LEN) + +# +# Check if struct sockaddr_in6::sin6_len is available. +# + +CHECK_STRUCT_HAS_MEMBER("struct sockaddr_in6" sin6_len + "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_SOCKADDR_IN6_SIN6_LEN) + +SET(CMAKE_EXTRA_INCLUDE_FILES) + +CHECK_STRUCT_HAS_MEMBER("struct dirent" d_ino "dirent.h" STRUCT_DIRENT_HAS_D_INO) +CHECK_STRUCT_HAS_MEMBER("struct dirent" d_namlen "dirent.h" STRUCT_DIRENT_HAS_D_NAMLEN) +SET(SPRINTF_RETURNS_INT 1) diff --git a/dep/mysqllite/dbug/dbug.c b/dep/mysqllite/dbug/dbug.c index 8fa5ed9af6b3e..2c06eeff95aa0 100644 --- a/dep/mysqllite/dbug/dbug.c +++ b/dep/mysqllite/dbug/dbug.c @@ -57,28 +57,47 @@ * 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") - * - * DBUG_EXECUTE_IF - * incremental mode (-#+t:-d,info ...) - * DBUG_SET, _db_explain_ - * thread-local settings + * 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 -#if defined(MSDOS) || defined(__WIN__) -#include + +#ifdef HAVE_FNMATCH_H +#include +#else +#define fnmatch(A,B,C) strcmp(A,B) #endif +#if defined(__WIN__) +#include +#endif #ifndef DBUG_OFF @@ -95,21 +114,23 @@ * 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 TRACE_ON 000001 /* Trace enabled */ -#define DEBUG_ON 000002 /* Debug enabled */ -#define FILE_ON 000004 /* File name print enabled */ -#define LINE_ON 000010 /* Line number print enabled */ -#define DEPTH_ON 000020 /* Function nest level print enabled */ -#define PROCESS_ON 000040 /* Process name print enabled */ -#define NUMBER_ON 000100 /* Number each line of output */ -#define PROFILE_ON 000200 /* Print out profiling code */ -#define PID_ON 000400 /* Identify each line with process id */ -#define TIMESTAMP_ON 001000 /* timestamp every line of output */ -#define SANITY_CHECK_ON 002000 /* Check safemalloc on DBUG_ENTER */ -#define FLUSH_ON_WRITE 004000 /* Flush on every write */ -#define OPEN_APPEND 010000 /* Open for append */ +#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 FLUSH_ON_WRITE (1 << 10) /* Flush on every write */ +#define OPEN_APPEND (1 << 11) /* 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) @@ -119,11 +140,7 @@ * Typedefs to make things more obvious. */ -#ifndef __WIN__ -typedef int BOOLEAN; -#else -#define BOOLEAN BOOL -#endif +#define BOOLEAN my_bool /* * Make it easy to change storage classes if necessary. @@ -139,7 +156,7 @@ typedef int BOOLEAN; * (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. + * 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, @@ -154,6 +171,8 @@ typedef int BOOLEAN; #ifdef M_I386 /* predefined by xenix 386 compiler */ #define AUTOS_REVERSE 1 +#else +#define AUTOS_REVERSE 0 #endif /* @@ -164,8 +183,6 @@ typedef int BOOLEAN; static void perror(); /* Fake system/library error print routine */ #endif -IMPORT int _sanity(const char *file,uint line); /* safemalloc sanity checker */ - /* * The user may specify a list of functions to trace or * debug. These lists are kept in a linear linked list, @@ -174,9 +191,18 @@ IMPORT int _sanity(const char *file,uint line); /* safemalloc sanity checker */ struct link { struct link *next_link; /* Pointer to the next link */ - char str[1]; /* Pointer to link's contents */ + 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 @@ -188,18 +214,18 @@ struct link { */ struct settings { - int flags; /* Current settings flags */ - int maxdepth; /* Current maximum trace depth */ - uint delay; /* Delay after each output line */ - int 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 */ + 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) @@ -212,18 +238,19 @@ struct settings { 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 */ - char **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 */ - int level; /* Current function nesting level */ - int jmplevel; /* Remember nesting level at setjmp() */ + 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 @@ -244,12 +271,16 @@ typedef struct _db_code_state_ { The test below is so we could call functions with DBUG_ENTER before my_thread_init(). */ -#define get_code_state_or_return if (!cs && !((cs=code_state()))) return +#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 */ -static struct link *ListAdd(struct link *, const char *, const char *); -static struct link *ListDel(struct link *, const char *, const char *); +#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 */ @@ -260,10 +291,18 @@ 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 BOOLEAN DoTrace(CODE_STATE *cs); +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)) +#if defined(HAVE_ACCESS) static BOOLEAN Writable(const char *pathname); /* Change file owner and group */ static void ChangeOwner(CODE_STATE *cs, char *pathname); @@ -275,109 +314,76 @@ 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 BOOLEAN InList(struct link *linkp,const char *cp); -static void dbug_flush(CODE_STATE *); +static void DbugFlush(CODE_STATE *); static void DbugExit(const char *why); static const char *DbugStrTok(const char *s); - -#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 +static void DbugVfprintf(FILE *stream, const char* format, va_list args); /* * Miscellaneous printf format strings. */ -#define ERR_MISSING_RETURN "%s: missing DBUG_RETURN or DBUG_VOID_RETURN macro in function \"%s\"\n" +#define ERR_MISSING_RETURN "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) +#if !defined(HAVE_ACCESS) #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 -pthread_mutex_t THR_LOCK_dbug; +static pthread_mutex_t THR_LOCK_dbug; static CODE_STATE *code_state(void) { - CODE_STATE *cs=0; - struct st_my_thread_var *tmp; + 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) { - pthread_mutex_init(&THR_LOCK_dbug,MY_MUTEX_INIT_FAST); + init_done=TRUE; + pthread_mutex_init(&THR_LOCK_dbug, NULL); bzero(&init_settings, sizeof(init_settings)); init_settings.out_file=stderr; init_settings.flags=OPEN_APPEND; - init_done=TRUE; } - if ((tmp=my_thread_var)) + if (!(cs_ptr= (CODE_STATE**) my_thread_var_dbug())) + return 0; /* Thread not initialised */ + if (!(cs= *cs_ptr)) { - if (!(cs=(CODE_STATE *) tmp->dbug)) - { - 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; - tmp->dbug= (void*) cs; - } + 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. */ @@ -403,20 +409,19 @@ static CODE_STATE *code_state(void) void _db_process_(const char *name) { - CODE_STATE *cs=0; + 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 setting + * DbugParse parse control string and set current debugger settings * * DESCRIPTION * @@ -438,15 +443,17 @@ void _db_process_(const char *name) * * 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 */ -static void DbugParse(CODE_STATE *cs, const char *control) +int DbugParse(CODE_STATE *cs, const char *control) { const char *end; - int rel=0; + int rel, f_used=0; struct settings *stack; - get_code_state_or_return; stack= cs->stack; if (control[0] == '-' && control[1] == '#') @@ -455,13 +462,8 @@ static void DbugParse(CODE_STATE *cs, const char *control) rel= control[0] == '+' || control[0] == '-'; if ((!rel || (!stack->out_file && !stack->next))) { - /* - We need to free what's already in init_settings, because unlike - the thread related stack frames there's a chance that something - is in these variables already. - */ - if (stack == &init_settings) - FreeState(cs, stack, 0); + /* Free memory associated with the state before resetting its members */ + FreeState(cs, stack, 0); stack->flags= 0; stack->delay= 0; stack->maxdepth= 0; @@ -480,11 +482,16 @@ static void DbugParse(CODE_STATE *cs, const char *control) 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 */ + /* + Never share with the global parent - it can change under your feet. + + Reset out_file to stderr to prevent sharing of trace files between + global and session settings. + */ + stack->out_file= stderr; stack->functions= ListCopy(init_settings.functions); stack->p_functions= ListCopy(init_settings.p_functions); stack->keywords= ListCopy(init_settings.keywords); @@ -492,6 +499,7 @@ static void DbugParse(CODE_STATE *cs, const char *control) } else { + stack->out_file= stack->next->out_file; stack->functions= stack->next->functions; stack->p_functions= stack->next->p_functions; stack->keywords= stack->next->keywords; @@ -504,7 +512,6 @@ static void DbugParse(CODE_STATE *cs, const char *control) { int c, sign= (*control == '+') ? 1 : (*control == '-') ? -1 : 0; if (sign) control++; - if (!rel) sign=0; c= *control++; if (*control == ',') control++; /* XXX when adding new cases here, don't forget _db_explain_ ! */ @@ -533,6 +540,7 @@ static void DbugParse(CODE_STATE *cs, const char *control) stack->delay= atoi(control); break; case 'f': + f_used= 1; if (sign < 0 && control == end) { if (!is_shared(stack,functions)) @@ -559,15 +567,6 @@ static void DbugParse(CODE_STATE *cs, const char *control) 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; @@ -659,20 +658,117 @@ static void DbugParse(CODE_STATE *cs, const char *control) 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 @@ -690,19 +786,21 @@ static void DbugParse(CODE_STATE *cs, const char *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_(CODE_STATE *cs, const char *control) +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); - - DbugParse(cs, control); + if (DbugParse(cs, control)) + FixTraceFlags(old_fflags, cs); } - /* * FUNCTION * @@ -723,10 +821,25 @@ void _db_set_(CODE_STATE *cs, const char *control) void _db_push_(const char *control) { - CODE_STATE *cs=0; + CODE_STATE *cs; + uint old_fflags; get_code_state_or_return; + old_fflags=fflags(cs); PushState(cs); - DbugParse(cs, control); + 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); } /* @@ -749,6 +862,7 @@ void _db_set_init_(const char *control) CODE_STATE tmp_cs; bzero((uchar*) &tmp_cs, sizeof(tmp_cs)); tmp_cs.stack= &init_settings; + tmp_cs.process= db_process ? db_process : "dbug"; DbugParse(&tmp_cs, control); } @@ -772,15 +886,18 @@ void _db_set_init_(const char *control) void _db_pop_() { struct settings *discard; - CODE_STATE *cs=0; + uint old_fflags; + CODE_STATE *cs; get_code_state_or_return; discard= cs->stack; - if (discard->next != NULL) + if (discard != &init_settings) { + old_fflags=fflags(cs); cs->stack= discard->next; FreeState(cs, discard, 1); + FixTraceFlags(old_fflags, cs); } } @@ -805,11 +922,16 @@ void _db_pop_() buf=strnmov(buf, (S), len+1); \ if (buf >= end) goto overflow; \ } while (0) -#define list_to_buf(l) do { \ +#define list_to_buf(l, f) do { \ struct link *listp=(l); \ while (listp) \ { \ - str_to_buf(listp->str); \ + if (listp->flags & (f)) \ + { \ + str_to_buf(listp->str); \ + if (listp->flags & SUBDIR) \ + char_to_buf('/'); \ + } \ listp=listp->next_link; \ } \ } while (0) @@ -849,9 +971,18 @@ void _db_pop_() #define op_list_to_buf(C, val, cond) do { \ if ((cond)) \ { \ + int f=ListFlags(val); \ colon_to_buf; \ char_to_buf((C)); \ - list_to_buf(val); \ + 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 { \ @@ -866,7 +997,7 @@ int _db_explain_ (CODE_STATE *cs, char *buf, size_t len) { char *start=buf, *end=buf+len-4; - get_code_state_or_return *buf=0; + 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); @@ -886,7 +1017,6 @@ int _db_explain_ (CODE_STATE *cs, char *buf, size_t len) 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; @@ -934,15 +1064,11 @@ int _db_explain_init_(char *buf, size_t len) * * SYNOPSIS * - * VOID _db_enter_(_func_, _file_, _line_, - * _sfunc_, _sfile_, _slevel_, _sframep_) + * 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 - * char **_sfunc_; save previous _func_ - * char **_sfile_; save previous _file_ - * int *_slevel_; save previous nesting level - * char ***_sframep_; save previous frame pointer + * struct _db_stack_frame_ allocated on the caller's stack * * DESCRIPTION * @@ -966,55 +1092,48 @@ int _db_explain_init_(char *buf, size_t len) */ void _db_enter_(const char *_func_, const char *_file_, - uint _line_, const char **_sfunc_, const char **_sfile_, - uint *_slevel_, char ***_sframep_ __attribute__((unused))) + uint _line_, struct _db_stack_frame_ *_stack_frame_) { - int save_errno=errno; - CODE_STATE *cs=0; - get_code_state_or_return; + 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; - *_sfunc_= cs->func; - *_sfile_= cs->file; + _stack_frame_->func= cs->func; + _stack_frame_->file= cs->file; cs->func= _func_; cs->file= _file_; - *_slevel_= ++cs->level; -#ifndef THREAD - *_sframep_= cs->framep; - cs->framep= (char **) _sframep_; - if (DoProfile(cs)) - { - long stackused; - if (*cs->framep == NULL) - stackused= 0; - else + _stack_frame_->prev= cs->framep; + _stack_frame_->level= ++cs->level | framep_trace_flag(cs, cs->framep); + cs->framep= _stack_frame_; + + switch (DoTrace(cs)) { + case ENABLE_TRACE: + cs->framep->level|= TRACE_ON; + if (!TRACING) break; + /* fall through */ + case DO_TRACE: + if (TRACING) { - stackused= ((long)(*cs->framep)) - ((long)(cs->framep)); - stackused= stackused > 0 ? stackused : -stackused; + 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 */ } - (void) fprintf(cs->stack->prof_file, PROF_EFMT , Clock(), cs->func); -#ifdef AUTOS_REVERSE - (void) fprintf(cs->stack->prof_file, PROF_SFMT, cs->framep, stackused, *_sfunc_); -#else - (void) fprintf(cs->stack->prof_file, PROF_SFMT, (ulong) cs->framep, stackused, - cs->func); -#endif - (void) fflush(cs->stack->prof_file); + break; + case DISABLE_TRACE: + cs->framep->level&= ~TRACE_ON; + /* fall through */ + case DONT_TRACE: + break; } -#endif - if (DoTrace(cs)) - { - 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); - dbug_flush(cs); /* This does a unlock */ - } -#ifdef SAFEMALLOC - if (cs->stack->flags & SANITY_CHECK_ON) - if (_sanity(_file_,_line_)) /* Check of safemalloc */ - cs->stack->flags &= ~SANITY_CHECK_ON; -#endif errno=save_errno; } @@ -1025,11 +1144,9 @@ void _db_enter_(const char *_func_, const char *_file_, * * SYNOPSIS * - * VOID _db_return_(_line_, _sfunc_, _sfile_, _slevel_) + * VOID _db_return_(_line_, _stack_frame_) * int _line_; current source line number - * char **_sfunc_; where previous _func_ is to be retrieved - * char **_sfile_; where previous _file_ is to be retrieved - * int *_slevel_; where previous level was stashed + * struct _db_stack_frame_ allocated on the caller's stack * * DESCRIPTION * @@ -1040,52 +1157,41 @@ void _db_enter_(const char *_func_, const char *_file_, * */ -/* helper macro */ -void _db_return_(uint _line_, const char **_sfunc_, - const char **_sfile_, uint *_slevel_) +void _db_return_(uint _line_, struct _db_stack_frame_ *_stack_frame_) { int save_errno=errno; - CODE_STATE *cs=0; + uint _slevel_= _stack_frame_->level & ~TRACE_ON; + CODE_STATE *cs; get_code_state_or_return; - if (cs->level != (int) *_slevel_) + if (cs->framep != _stack_frame_) { - if (!cs->locked) - pthread_mutex_lock(&THR_LOCK_dbug); - (void) fprintf(cs->stack->out_file, ERR_MISSING_RETURN, cs->process, - cs->func); - dbug_flush(cs); + char buf[512]; + my_snprintf(buf, sizeof(buf), ERR_MISSING_RETURN, cs->func); + DbugExit(buf); } - else + + if (DoTrace(cs) & DO_TRACE) { -#ifdef SAFEMALLOC - if (cs->stack->flags & SANITY_CHECK_ON) - { - if (_sanity(*_sfile_,_line_)) - cs->stack->flags &= ~SANITY_CHECK_ON; - } -#endif -#ifndef THREAD - if (DoProfile(cs)) - (void) fprintf(cs->stack->prof_file, PROF_XFMT, Clock(), cs->func); -#endif - if (DoTrace(cs)) + 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); - dbug_flush(cs); + DbugFlush(cs); } } - cs->level= *_slevel_-1; - cs->func= *_sfunc_; - cs->file= *_sfile_; -#ifndef THREAD + /* + 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= (char **) *cs->framep; -#endif + cs->framep= cs->framep->prev; errno=save_errno; } @@ -1112,7 +1218,7 @@ void _db_return_(uint _line_, const char **_sfunc_, void _db_pargs_(uint _line_, const char *keyword) { - CODE_STATE *cs=0; + CODE_STATE *cs; get_code_state_or_return; cs->u_line= _line_; cs->u_keyword= keyword; @@ -1148,13 +1254,12 @@ void _db_pargs_(uint _line_, const char *keyword) void _db_doprnt_(const char *format,...) { va_list args; - - CODE_STATE *cs=0; + CODE_STATE *cs; get_code_state_or_return; va_start(args,format); - if (_db_keyword_(cs, cs->u_keyword)) + if (_db_keyword_(cs, cs->u_keyword, 0)) { int save_errno=errno; if (!cs->locked) @@ -1165,14 +1270,25 @@ void _db_doprnt_(const char *format,...) else (void) fprintf(cs->stack->out_file, "%s: ", cs->func); (void) fprintf(cs->stack->out_file, "%s: ", cs->u_keyword); - (void) vfprintf(cs->stack->out_file, format, args); - (void) fputc('\n',cs->stack->out_file); - dbug_flush(cs); + DbugVfprintf(cs->stack->out_file, format, args); + DbugFlush(cs); errno=save_errno; } va_end(args); } +/* + * This function is intended as a + * vfprintf clone with consistent, platform independent output for + * problematic formats like %p, %zd and %lld. + */ +static void DbugVfprintf(FILE *stream, const char* format, va_list args) +{ + char cvtbuf[1024]; + (void) my_vsnprintf(cvtbuf, sizeof(cvtbuf), format, args); + (void) fprintf(stream, "%s\n", cvtbuf); +} + /* * FUNCTION @@ -1189,19 +1305,17 @@ void _db_doprnt_(const char *format,...) * * DESCRIPTION * Dump N characters in a binary array. - * Is used to examine corrputed memory or arrays. + * Is used to examine corrupted 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=0; + CODE_STATE *cs; get_code_state_or_return; - if (_db_keyword_(cs, keyword)) + if (_db_keyword_(cs, keyword, 0)) { if (!cs->locked) pthread_mutex_lock(&THR_LOCK_dbug); @@ -1215,9 +1329,8 @@ void _db_dump_(uint _line_, const char *keyword, { fprintf(cs->stack->out_file, "%s: ", cs->func); } - sprintf(dbuff,"%s: Memory: 0x%lx Bytes: (%ld)\n", + (void) fprintf(cs->stack->out_file, "%s: Memory: 0x%lx Bytes: (%ld)\n", keyword, (ulong) memory, (long) length); - (void) fputs(dbuff,cs->stack->out_file); pos=0; while (length-- > 0) @@ -1233,7 +1346,7 @@ void _db_dump_(uint _line_, const char *keyword, fputc(' ',cs->stack->out_file); } (void) fputc('\n',cs->stack->out_file); - dbug_flush(cs); + DbugFlush(cs); } } @@ -1241,93 +1354,75 @@ void _db_dump_(uint _line_, const char *keyword, /* * FUNCTION * - * ListAdd add to the list modifiers from debug control string - * - * SYNOPSIS - * - * static struct link *ListAdd(listp, ctlp, end) - * struct link *listp; - * char *ctlp; - * char *end; + * 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 adds it to listp, returning a pointer - * to the new list - * - * 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 *ListAdd(struct link *head, - const char *ctlp, const char *end) -{ - const char *start; - struct link *new_malloc; - int len; - - while (ctlp < end) - { - start= ctlp; - while (ctlp < end && *ctlp != ',') - ctlp++; - len=ctlp-start; - new_malloc= (struct link *) DbugMalloc(sizeof(struct link)+len); - memcpy(new_malloc->str, start, len); - new_malloc->str[len]=0; - new_malloc->next_link= head; - head= new_malloc; - ctlp++; - } - return head; -} - -/* - * FUNCTION + * parses the list, and modifies "listp", returning a pointer + * to the new list. * - * ListDel remove from the list modifiers in debug control string + * The mode of operation is defined by "todo" parameter. * - * SYNOPSIS - * - * static struct link *ListDel(listp, ctlp, end) - * struct link *listp; - * char *ctlp; - * char *end; - * - * DESCRIPTION - * - * Given pointer to a comma separated list of strings in "cltp", - * parses the list, and removes these strings from the listp, - * returning a pointer to the new list. + * 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 *ListDel(struct link *head, - const char *ctlp, const char *end) +static struct link *ListAddDel(struct link *head, const char *ctlp, + const char *end, int todo) { const char *start; struct link **cur; - int len; + size_t len; + int subdir; - while (ctlp < end) + ctlp--; +next: + while (++ctlp < end) { start= ctlp; + subdir=0; while (ctlp < end && *ctlp != ',') ctlp++; len=ctlp-start; - cur=&head; - do + if (start[len-1] == '/') + { + len--; + subdir=SUBDIR; + } + if (len == 0) continue; + for (cur=&head; *cur; cur=&((*cur)->next_link)) { - while (*cur && !strncmp((*cur)->str, start, len)) + if (!strncmp((*cur)->str, start, len)) { - struct link *delme=*cur; - *cur=(*cur)->next_link; - free((void*) delme); + 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; } - } while (*cur && *(cur=&((*cur)->next_link))); + } + *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; } @@ -1359,7 +1454,7 @@ static struct link *ListCopy(struct link *orig) { struct link *new_malloc; struct link *head; - int len; + size_t len; head= NULL; while (orig != NULL) @@ -1368,6 +1463,7 @@ static struct link *ListCopy(struct link *orig) 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; @@ -1380,47 +1476,52 @@ static struct link *ListCopy(struct link *orig) * * InList test a given string for member of a given list * - * SYNOPSIS - * - * static BOOLEAN InList(linkp, cp) - * struct link *linkp; - * char *cp; - * * 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 then the string is treated - * as if it is in the list (I.E all strings are in the null list). + * 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 BOOLEAN InList(struct link *linkp, const char *cp) +static int InList(struct link *linkp, const char *cp) { - REGISTER struct link *scan; - REGISTER BOOLEAN result; + int result; - if (linkp == NULL) - result= TRUE; - else + for (result=MATCHED; linkp != NULL; linkp= linkp->next_link) { - result= FALSE; - for (scan= linkp; scan != NULL; scan= scan->next_link) - { - if (!strcmp(scan->str, cp)) - { - result= TRUE; - break; - } - } + 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 @@ -1447,8 +1548,8 @@ static void PushState(CODE_STATE *cs) struct settings *new_malloc; new_malloc= (struct settings *) DbugMalloc(sizeof(struct settings)); + bzero(new_malloc, sizeof(struct settings)); new_malloc->next= cs->stack; - new_malloc->out_file= NULL; cs->stack= new_malloc; } @@ -1479,11 +1580,17 @@ static void FreeState(CODE_STATE *cs, struct settings *state, int free_state) FreeList(state->processes); if (!is_shared(state, p_functions)) FreeList(state->p_functions); + if (!is_shared(state, out_file)) DBUGCloseFile(cs, state->out_file); - (void) fflush(cs->stack->out_file); - if (state->prof_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); } @@ -1510,8 +1617,12 @@ void _db_end_() { struct settings *discard; static struct settings tmp; - CODE_STATE *cs=0; - + 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)) @@ -1545,108 +1656,48 @@ void _db_end_() * * DoTrace check to see if tracing is current enabled * - * SYNOPSIS - * - * static BOOLEAN DoTrace(stack) - * * DESCRIPTION * - * Checks to see if tracing is enabled based on whether the - * user has specified tracing, the maximum trace depth has - * not yet been reached, the current function is selected, - * and the current process is selected. Returns TRUE if - * tracing is enabled, FALSE otherwise. + * 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 BOOLEAN DoTrace(CODE_STATE *cs) +static int DoTrace(CODE_STATE *cs) { - return (TRACING && cs->level <= cs->stack->maxdepth && - InList(cs->stack->functions, cs->func) && - InList(cs->stack->processes, cs->process)); -} - - -/* - * 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) && - InList(cs->stack->processes, cs->process); + 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; } -#endif FILE *_db_fp_(void) { - CODE_STATE *cs=0; + CODE_STATE *cs; get_code_state_or_return NULL; return cs->stack->out_file; } - -/* - * FUNCTION - * - * _db_strict_keyword_ test keyword for member of keyword list - * - * SYNOPSIS - * - * BOOLEAN _db_strict_keyword_(keyword) - * char *keyword; - * - * DESCRIPTION - * - * Similar to _db_keyword_, but keyword is NOT accepted if keyword list - * is empty. Used in DBUG_EXECUTE_IF() - for actions that must not be - * executed by default. - * - * Returns TRUE if keyword accepted, FALSE otherwise. - * - */ - -BOOLEAN _db_strict_keyword_(const char *keyword) -{ - CODE_STATE *cs=0; - get_code_state_or_return FALSE; - if (!DEBUGGING || cs->stack->keywords == NULL) - return FALSE; - return _db_keyword_(cs, keyword); -} - /* * FUNCTION * * _db_keyword_ test keyword for member of keyword list * - * SYNOPSIS - * - * BOOLEAN _db_keyword_(keyword) - * char *keyword; - * * DESCRIPTION * * Test a keyword to determine if it is in the currently active - * keyword list. As with the function list, a keyword is accepted + * 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 @@ -1658,15 +1709,13 @@ BOOLEAN _db_strict_keyword_(const char *keyword) * */ -BOOLEAN _db_keyword_(CODE_STATE *cs, const char *keyword) +BOOLEAN _db_keyword_(CODE_STATE *cs, const char *keyword, int strict) { - get_code_state_or_return FALSE; + get_code_state_if_not_set_or_return FALSE; + strict=strict ? INCLUDE : INCLUDE|MATCHED; - return (DEBUGGING && - (!TRACING || cs->level <= cs->stack->maxdepth) && - InList(cs->stack->functions, cs->func) && - InList(cs->stack->keywords, keyword) && - InList(cs->stack->processes, cs->process)); + return DEBUGGING && DoTrace(cs) & DO_TRACE && + InList(cs->stack->keywords, keyword) & strict; } /* @@ -1759,11 +1808,7 @@ 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); @@ -1834,7 +1879,7 @@ static void DBUGOpenFile(CODE_STATE *cs, { if (end) { - int len=end-name; + size_t len=end-name; memcpy(cs->stack->name, name, len); cs->stack->name[len]=0; } @@ -1867,77 +1912,12 @@ static void DBUGOpenFile(CODE_STATE *cs, 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 * @@ -1957,12 +1937,12 @@ static FILE *OpenProfile(CODE_STATE *cs, const char *name) static void DBUGCloseFile(CODE_STATE *cs, FILE *fp) { - if (fp != stderr && fp != stdout && fclose(fp) == EOF) + if (fp != NULL && fp != stderr && fp != stdout && fclose(fp) == EOF) { pthread_mutex_lock(&THR_LOCK_dbug); (void) fprintf(cs->stack->out_file, ERR_CLOSE, cs->process); perror(""); - dbug_flush(cs); + DbugFlush(cs); } } @@ -1991,7 +1971,7 @@ 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); + DBUG_ABORT(); } @@ -2122,42 +2102,6 @@ static BOOLEAN Writable(const char *pathname) #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 * @@ -2179,7 +2123,7 @@ static void ChangeOwner(CODE_STATE *cs, char *pathname) EXPORT void _db_setjmp_() { - CODE_STATE *cs=0; + CODE_STATE *cs; get_code_state_or_return; cs->jmplevel= cs->level; @@ -2206,7 +2150,7 @@ EXPORT void _db_setjmp_() EXPORT void _db_longjmp_() { - CODE_STATE *cs=0; + CODE_STATE *cs; get_code_state_or_return; cs->level= cs->jmplevel; @@ -2257,11 +2201,9 @@ char *s; /* This is because some systems (MSDOS!!) dosn't flush fileheader */ /* and dbug-file isn't readable after a system crash !! */ -static void dbug_flush(CODE_STATE *cs) +static void DbugFlush(CODE_STATE *cs) { -#ifndef THREAD if (cs->stack->flags & FLUSH_ON_WRITE) -#endif { (void) fflush(cs->stack->out_file); if (cs->stack->delay) @@ -2269,130 +2211,61 @@ static void dbug_flush(CODE_STATE *cs) } if (!cs->locked) pthread_mutex_unlock(&THR_LOCK_dbug); -} /* dbug_flush */ +} /* DbugFlush */ -void _db_lock_file_() -{ - CODE_STATE *cs=0; - get_code_state_or_return; - pthread_mutex_lock(&THR_LOCK_dbug); - cs->locked=1; -} +/* For debugging */ -void _db_unlock_file_() +void _db_flush_() { - CODE_STATE *cs=0; + CODE_STATE *cs= NULL; get_code_state_or_return; - cs->locked=0; - pthread_mutex_unlock(&THR_LOCK_dbug); + (void) fflush(cs->stack->out_file); } -/* - * 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() +#ifndef __WIN__ +void _db_suicide_() { - struct rusage ru; - - (void) getrusage(RUSAGE_SELF, &ru); - return ru.ru_utime.tv_sec*1000 + ru.ru_utime.tv_usec/1000; + int retval; + sigset_t new_mask; + sigfillset(&new_mask); + + fprintf(stderr, "SIGKILL myself\n"); + fflush(stderr); + + retval= kill(getpid(), SIGKILL); + assert(retval == 0); + retval= sigsuspend(&new_mask); + fprintf(stderr, "sigsuspend returned %d errno %d \n", retval, errno); + assert(FALSE); /* With full signal mask, we should never return here. */ } +#endif /* ! __WIN__ */ -#elif defined(MSDOS) || defined(__WIN__) -static ulong Clock() +void _db_lock_file_() { - return clock()*(1000/CLOCKS_PER_SEC); + CODE_STATE *cs; + get_code_state_or_return; + pthread_mutex_lock(&THR_LOCK_dbug); + cs->locked=1; } -#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() +void _db_unlock_file_() { - return 0; + CODE_STATE *cs; + get_code_state_or_return; + cs->locked=0; + pthread_mutex_unlock(&THR_LOCK_dbug); } -#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; +const char* _db_get_func_(void) { - 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; + CODE_STATE *cs; + get_code_state_or_return NULL; + return cs->func; } -#endif /* NO_VARARGS */ #else diff --git a/dep/mysqllite/dbug/factorial.c b/dep/mysqllite/dbug/factorial.c deleted file mode 100644 index 7b190ea8d8e91..0000000000000 --- a/dep/mysqllite/dbug/factorial.c +++ /dev/null @@ -1,27 +0,0 @@ -#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/dep/mysqllite/dbug/sanity.c b/dep/mysqllite/dbug/sanity.c deleted file mode 100644 index df43fc14ba92f..0000000000000 --- a/dep/mysqllite/dbug/sanity.c +++ /dev/null @@ -1,13 +0,0 @@ -/* 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/dep/mysqllite/dbug/user.r b/dep/mysqllite/dbug/user.r index ef67ef7a7cfef..5628f5a4fa118 100644 --- a/dep/mysqllite/dbug/user.r +++ b/dep/mysqllite/dbug/user.r @@ -512,7 +512,7 @@ possible since all code preceding the first call to .B DBUG_PUSH is essentially invisible to -.B dbug +.I dbug (this can be worked around by inserting a temporary .B DBUG_PUSH(argv[1]) @@ -708,7 +708,7 @@ EX:\ \fCDBUG_PROCESS\ (argv[0]);\fR .SP 1 .LI DBUG_PUSH\ Sets a new debugger state by pushing the current -.B dbug +.I dbug state onto an internal stack and setting up the new state using the debug control string passed as the macro argument. The most common usage is to set the state specified by a debug control string @@ -769,14 +769,14 @@ the 'd' flag. Used to conditionally execute "dangerous" actions, e.g to crash the program testing how recovery works, or to introduce an artificial delay checking for race conditions. .SP 1 -EX:\ \fCDBUG_EXECUTE_IF\ ("crashme",\ abort\ ());\fR +EX:\ \fCDBUG_EXECUTE_IF\ ("crashme",\ DBUG_ABORT()\ ());\fR .SP 1 .LI DBUG_EVALUATE\ The DBUG_EVALUATE macro is similar to DBUG_EXECUTE, but it can be used in the expression context. The first argument is the debug keyword that is used to choose whether the second (keyword is enabled) or the third (keyword is not enabled) argument is evaluated. When -.B dbug +.I dbug is compiled off, the third argument is evaluated. .SP 1 EX:\fC @@ -796,7 +796,7 @@ EX:\fC .br if (prepare_transaction () || .br - DBUG_EVALUATE ("crashme", (abort (), 0), 0) || + DBUG_EVALUATE ("crashme", (DBUG_ABORT(), 0), 0) || .br commit_transaction () )\fR .SP 1 @@ -875,6 +875,12 @@ library. So there will be no need to disable asserts separately with NDEBUG. .SP 1 EX:\ \fCDBUG_ASSERT(\ a\ >\ 0\ );\fR .SP 1 +.LI DBUG_ABORT\ +This macro could be used instead of abort(). It flushes DBUG_FILE stream +to ensure that no +.I dbug +output is lost and then calls abort(). +.SP 1 .LI DBUG_EXPLAIN\ Generates control string corresponding to the current debug state. The macro takes two arguments - a buffer to store the result string @@ -910,17 +916,17 @@ via the .B DBUG_PUSH or .B DBUG_SET -macros. Control string consists of colon separate flags. Colons +macros. Control string consists of colon separated flags. Colons that are part of ':\\', ':/', or '::' are not considered flag separators. A flag may take an argument or a list of arguments. If a control string starts from a '+' sign it works .I incrementally, -that is, it can modify existing state without overriding it. In such a -string every flag may be preceded by a '+' or '-' to enable or disable -a corresponding option in the debugger state. This section summarizes -the currently available debugger options and the flag characters which -enable or disable them. Argument lists enclosed in '[' and ']' are -optional. +that is, it can modify existing state without overriding it. Every +flag may be preceded by a '+' or '-' to enable or disable a +corresponding option in the debugger state or to add or remove +arguments to the list. This section summarizes the currently available +debugger options and the flag characters which enable or disable them. +Argument lists enclosed in '[' and ']' are optional. .SP 2 .BL 22 .LI a[,file] @@ -936,6 +942,9 @@ a complete log file in case of crashes. This mode is implicit in multi-threaded environment. .LI d[,keywords] Enable output from macros with specified keywords. +Every keyword can be a +.I glob(7) +pattern. An empty list of keywords implies that all keywords are selected. .LI D[,time] Delay for specified time after each output line, to let output drain. @@ -943,7 +952,19 @@ Time is given in tenths of a second (value of 10 is one second). Default is zero. .LI f[,functions] Limit debugger actions to the specified list of functions. +Every function can be a +.I glob(7) +pattern. An empty list of functions implies that all functions are selected. +Every function in the list may optionally be followed by a '/' - +this will implicitly select all the functions down the call stack. +.SP 1 +EX: \fCf,func1,func2/:-f,func3,func4/\fR +.SP 1 +This would enable debugger in functions 'func1()', 'func2()' and all +functions called from it (directly or indirectly). But not in +functions 'func3()' or 'func4()' and all functions called from +it. .LI F Mark each debugger output line with the name of the source file containing the macro causing the output. @@ -952,6 +973,9 @@ Mark each debugger output line with the PID (or thread ID) of the current process. .LI g,[functions] Enable profiling for the specified list of functions. +Every function can be a +.I glob(7) +pattern. An empty list of functions enables profiling for all functions. See .B PROFILING\ WITH\ DBUG @@ -970,7 +994,11 @@ Like 'a[,file]' but overwrite old file, do not append. .LI O[,file] Like 'A[,file]' but overwrite old file, do not append. .LI p[,processes] -Limit debugger actions to the specified processes. An empty list +Limit debugger actions to the specified processes. +Every name can be a +.I glob(7) +pattern. +An empty list implies all processes. This is useful for processes which run child processes. Note that each debugger output line can be marked with the name of the current process via the 'P' flag. The process name must @@ -991,14 +1019,6 @@ Most useful with .B DBUG_PUSH macros used to temporarily alter the debugger state. -.LI S -When compiled with -.I safemalloc -this flag forces "sanity" memory checks (for overwrites/underwrites) -on each -.B DBUG_ENTER -and -.B DBUG_RETURN. .LI t[,N] Enable function control flow tracing. The maximum nesting depth is specified by N, and defaults to diff --git a/dep/mysqllite/extra/yassl/AUTHORS b/dep/mysqllite/extra/yassl/AUTHORS deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/dep/mysqllite/extra/yassl/COPYING b/dep/mysqllite/extra/yassl/COPYING deleted file mode 100644 index d60c31a97a544..0000000000000 --- a/dep/mysqllite/extra/yassl/COPYING +++ /dev/null @@ -1,340 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 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 - - 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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 Library General -Public License instead of this License. diff --git a/dep/mysqllite/extra/yassl/ChangeLog b/dep/mysqllite/extra/yassl/ChangeLog deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/dep/mysqllite/extra/yassl/INSTALL b/dep/mysqllite/extra/yassl/INSTALL deleted file mode 100644 index 54caf7c190f28..0000000000000 --- a/dep/mysqllite/extra/yassl/INSTALL +++ /dev/null @@ -1,229 +0,0 @@ -Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software -Foundation, Inc. - - This file is free documentation; the Free Software Foundation gives -unlimited permission to copy, distribute and modify it. - -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, and a -file `config.log' containing compiler output (useful mainly for -debugging `configure'). - - It can also use an optional file (typically called `config.cache' -and enabled with `--cache-file=config.cache' or simply `-C') that saves -the results of its tests to speed up reconfiguring. (Caching is -disabled by default to prevent problems with accidental use of stale -cache files.) - - 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 you are using the cache, and at -some point `config.cache' contains results you don't want to keep, you -may remove or edit it. - - The file `configure.ac' (or `configure.in') is used to create -`configure' by a program called `autoconf'. You only need -`configure.ac' 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. Run `./configure --help' -for details on some of the pertinent environment variables. - - You can give `configure' initial values for configuration parameters -by setting variables in the command line or in the environment. Here -is an example: - - ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix - - *Note Defining Variables::, for more details. - -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 support 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' cannot figure out -automatically, but needs to determine by the type of machine the package -will run on. Usually, assuming the package is built to be run on the -_same_ architectures, `configure' can figure that out, but if it prints -a message saying it cannot guess the machine type, give it the -`--build=TYPE' option. TYPE can either be a short name for the system -type, such as `sun4', or a canonical name which has the form: - - CPU-COMPANY-SYSTEM - -where SYSTEM can have one of these forms: - - OS KERNEL-OS - - 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 machine type. - - If you are _building_ compiler tools for cross-compiling, you should -use the `--target=TYPE' option to select the type of system they will -produce code for. - - If you want to _use_ a cross compiler, that generates code for a -platform different from the build platform, you should specify the -"host" platform (i.e., that on which the generated programs will -eventually be run) with `--host=TYPE'. - -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. - -Defining Variables -================== - - Variables not defined in a site shell script can be set in the -environment passed to `configure'. However, some packages may run -configure again during the build, and the customized values of these -variables may be lost. In order to avoid this problem, you should set -them in the `configure' command line, using `VAR=value'. For example: - - ./configure CC=/usr/local2/bin/gcc - -will cause the specified gcc to be used as the C compiler (unless it is -overridden in the site shell script). - -`configure' Invocation -====================== - - `configure' recognizes the following options to control how it -operates. - -`--help' -`-h' - Print a summary of the options to `configure', and exit. - -`--version' -`-V' - Print the version of Autoconf used to generate the `configure' - script, and exit. - -`--cache-file=FILE' - Enable the cache: use and save the results of the tests in FILE, - traditionally `config.cache'. FILE defaults to `/dev/null' to - disable caching. - -`--config-cache' -`-C' - Alias for `--cache-file=config.cache'. - -`--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. - -`configure' also accepts some other, not widely useful, options. Run -`configure --help' for more details. - diff --git a/dep/mysqllite/extra/yassl/NEWS b/dep/mysqllite/extra/yassl/NEWS deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/dep/mysqllite/extra/yassl/README b/dep/mysqllite/extra/yassl/README deleted file mode 100644 index 6c4d101efc0fa..0000000000000 --- a/dep/mysqllite/extra/yassl/README +++ /dev/null @@ -1,524 +0,0 @@ -*****************yaSSL Release notes, version 1.6.0 (2/22/07) - - This release of yaSSL contains bug fixes, portability enhancements, and - better X509 support. - -See normal build instructions below under 1.0.6. -See libcurl build instructions below under 1.3.0 and note in 1.5.8. - -*****************yaSSL Release notes, version 1.5.8 (1/10/07) - - This release of yaSSL contains bug fixes, portability enhancements, and - support for GCC 4.1.1 and vs2005 sp1. - - - - Since yaSSL now supports zlib, as does libcur, the libcurl build test can - fail if yaSSL is built with zlib support since the zlib library isn't - passed. You can do two things to fix this: - - 1) build yaSSL w/o zlib --without-zlib - 2) or add flags to curl configure LDFLAGS="-lm -lz" - - - -*****************yaSSL Release notes, version 1.5.0 (11/09/06) - - This release of yaSSL contains bug fixes, portability enhancements, - and full TLS 1.1 support. Use the functions: - - SSL_METHOD *TLSv1_1_server_method(void); - SSL_METHOD *TLSv1_1_client_method(void); - - or the SSLv23 versions (even though yaSSL doesn't support SSL 2.0 the v23 - means to pick the highest of SSL 3.0, TLS 1.0, or TLS 1.1). - - -See normal build instructions below under 1.0.6. -See libcurl build instructions below under 1.3.0. - - - -****************yaSSL Release notes, version 1.4.5 (10/15/06) - - - This release of yaSSL contains bug fixes, portability enhancements, - zlib compression support, removal of assembly instructions at runtime if - not supported, and initial TLS 1.1 support. - - - Compression Notes: yaSSL uses zlib for compression and the compression - should only be used if yaSSL is at both ends because the implementation - details aren't yet standard. If you'd like to turn compression on use - the SSL_set_compression() function on the client before calling - SSL_connect(). If both the client and server were built with zlib support - then the connection will use compression. If the client isn't built with - support then SSL_set_compression() will return an error (-1). - - To build yaSSL with zlib support on Unix simply have zlib support on your - system and configure will find it if it's in the standard locations. If - it's somewhere else use the option ./configure --with-zlib=DIR. If you'd - like to disable compression support in yaSSL use ./configure --without-zlib. - - To build yaSSL with zlib support on Windows: - - 1) download zlib from http://www.zlib.net/ - 2) follow the instructions in zlib from projects/visualc6/README.txt - for how to add the zlib project into the yaSSL workspace noting that - you'll need to add configuration support for "Win32 Debug" and - "Win32 Release" in note 3 under "To use:". - 3) define HAVE_LIBZ when building yaSSL - - -See normal build instructions below under 1.0.6. -See libcurl build instructions below under 1.3.0. - - -********************yaSSL Release notes, version 1.4.0 (08/13/06) - - - This release of yaSSL contains bug fixes, portability enhancements, - nonblocking connect and accept, better OpenSSL error mapping, and - certificate caching for session resumption. - -See normal build instructions below under 1.0.6. -See libcurl build instructions below under 1.3.0. - - -********************yaSSL Release notes, version 1.3.7 (06/26/06) - - - This release of yaSSL contains bug fixes, portability enhancements, - and libcurl 7.15.4 support (any newer versions may not build). - -See normal build instructions below under 1.0.6. -See libcurl build instructions below under 1.3.0. - - -********************yaSSL Release notes, version 1.3.5 (06/01/06) - - - This release of yaSSL contains bug fixes, portability enhancements, - better libcurl support, and improved non-blocking I/O. - -See normal build instructions below under 1.0.6. -See libcurl build instructions below under 1.3.0. - - -********************yaSSL Release notes, version 1.3.0 (04/26/06) - - - This release of yaSSL contains minor bug fixes, portability enhancements, - and libcurl support. - -See normal build instructions below under 1.0.6. - - ---To build for libcurl on Linux, Solaris, *BSD, Mac OS X, or Cygwin: - - To build for libcurl the library needs to be built without C++ globals since - the linker will be called in a C context, also libcurl configure will expect - OpenSSL library names so some symbolic links are created. - - ./configure --enable-pure-c - make - make openssl-links - - (then go to your libcurl home and tell libcurl about yaSSL build dir) - ./configure --with-ssl=/yaSSL-BuildDir LDFLAGS=-lm - make - - ---To build for libcurl on Win32: - - Simply add the yaSSL project as a dependency to libcurl, add - yaSSL-Home\include and yaSSL-Home\include\openssl to the include list, and - define USE_SSLEAY and USE_OPENSSL - - please email todd@yassl.com if you have any questions. - - -*******************yaSSL Release notes, version 1.2.2 (03/27/06) - - - This release of yaSSL contains minor bug fixes and portability enhancements. - -See build instructions below under 1.0.6: - - - -*******************yaSSL Release notes, version 1.2.0 - - - This release of yaSSL contains minor bug fixes, portability enhancements, - Diffie-Hellman compatibility fixes for other servers and client, - optimization improvements, and x86 ASM changes. - -See build instructions below under 1.0.6: - - - -*****************yaSSL Release notes, version 1.1.5 - - This release of yaSSL contains minor bug fixes, portability enhancements, - and user requested changes including the ability to add all certificates in - a directory, more robust socket handling, no new overloading unless - requested, and an SSL_VERIFY_NONE option. - - -See build instructions below under 1.0.6: - - - -******************yaSSL Release notes, version 1.0.6 - -This release of yaSSL contains minor bug fixes, portability enhancements, -x86 assembly for ARC4, SHA, MD5, and RIPEMD, --enable-ia32-asm configure -option, and a security patch for certificate chain processing. - ---To build on Linux, Solaris, *BSD, Mac OS X, or Cygwin: - - ./configure - make - - run testsuite from yaSSL-Home/testsuite to test the build - -to make a release build: - - ./configure --disable-debug - make - - run testsuite from yaSSL-Home/testsuite to test the build - - ---To build on Win32 - -Choose (Re)Build All from the project workspace - -run Debug\testsuite.exe from yaSSL-Home\testsuite to test the build - - - -***************** yaSSL Release notes, version 1.0.5 - -This release of yaSSL contains minor bug fixes, portability enhancements, -x86 assembly for AES, 3DES, BLOWFISH, and TWOFISH, --without-debug configure -option, and --enable-kernel-mode configure option for using TaoCrypt with -kernel modules. - ---To build on Linux, Solaris, *BSD, Mac OS X, or Cygwin: - - ./configure - make - - run testsuite from yaSSL-Home/testsuite to test the build - -to make a release build: - - ./configure --without-debug - make - - run testsuite from yaSSL-Home/testsuite to test the build - - ---To build on Win32 - -Choose (Re)Build All from the project workspace - -run Debug\testsuite.exe from yaSSL-Home\testsuite to test the build - - -******************yaSSL Release notes, version 1.0.1 - -This release of yaSSL contains minor bug fixes, portability enhancements, -GCC 3.4.4 support, MSVC 2003 support, and more documentation. - -Please see build instructions in the release notes for 0.9.6 below. - - -******************yaSSL Release notes, version 1.0 - -This release of yaSSL contains minor bug fixes, portability enhancements, -GCC 4.0 support, testsuite, improvements, and API additions. - -Please see build instructions in the release notes for 0.9.6 below. - - -******************yaSSL Release notes, version 0.9.9 - -This release of yaSSL contains minor bug fixes, portability enchancements, -MSVC 7 support, memory improvements, and API additions. - -Please see build instructions in the release notes for 0.9.6 below. - - -******************yaSSL Release notes, version 0.9.8 - -This release of yaSSL contains minor bug fixes and portability enchancements. - -Please see build instructions in the release notes for 0.9.6 below. - - -******************yaSSL Release notes, version 0.9.6 - -This release of yaSSL contains minor bug fixes, removal of STL support, and -removal of exceptions and rtti so that the library can be linked without the -std c++ library. - ---To build on Linux, Solaris, FreeBSD, Mac OS X, or Cygwin - -./configure -make - -run testsuite from yaSSL-Home/testsuite to test the build - - ---To build on Win32 - -Choose (Re)Build All from the project workspace - -run Debug\testsuite.exe from yaSSL-Home\testsuite to test the build - - - -******************yaSSL Release notes, version 0.9.2 - -This release of yaSSL contains minor bug fixes, expanded certificate -verification and chaining, and improved documentation. - -Please see build instructions in release notes 0.3.0. - - - -******************yaSSL Release notes, version 0.9.0 - -This release of yaSSL contains minor bug fixes, client verification handling, -hex and base64 encoing/decoding, and an improved test suite. - -Please see build instructions in release notes 0.3.0. - - -******************yaSSL Release notes, version 0.8.0 - -This release of yaSSL contains minor bug fixes, and initial porting effort to -64bit, BigEndian, and more UNIX systems. - -Please see build instructions in release notes 0.3.0. - - -******************yaSSL Release notes, version 0.6.0 - -This release of yaSSL contains minor bug fixes, source cleanup, and binary beta -(1) of the yaSSL libraries. - -Please see build instructions in release notes 0.3.0. - - - -******************yaSSL Release notes, version 0.5.0 - -This release of yaSSL contains minor bug fixes, full session resumption -support, and initial testing suite support. - - - -Please see build instructions in release notes 0.3.0. - - - -******************yaSSL Release notes, version 0.4.0 - -This release of yaSSL contains minor bug fixes, an optional memory tracker, -an echo client and server with input/output redirection for load testing, -and initial session caching support. - - -Please see build instructions in release notes 0.3.0. - - -******************yaSSL Release notes, version 0.3.5 - -This release of yaSSL contains minor bug fixes and extensions to the crypto -library including a full test suite. - - -*******************yaSSL Release notes, version 0.3.0 - -This release of yaSSL contains minor bug fixes and extensions to the crypto -library including AES and an improved random number generator. GNU autoconf -and automake are now used to simplify the build process on Linux. - -*** Linux Build process - -./configure -make - -*** Windows Build process - -open the yassl workspace and build the project - - -*******************yaSSL Release notes, version 0.2.9 - -This release of yaSSL contains minor bug fixes and extensions to the crypto -library. - -See the notes at the bottom of this page for build instructions. - - -*******************yaSSL Release notes, version 0.2.5 - -This release of yaSSL contains minor bug fixes and a beta binary of the yaSSL -libraries for win32 and linux. - -See the notes at the bottom of this page for build instructions. - - - -*******************yaSSL Release notes, version 0.2.0 - -This release of yaSSL contains minor bug fixes and initial alternate crypto -functionality. - -*** Complete Build *** - -See the notes in Readme.txt for build instructions. - -*** Update Build *** - -If you have already done a complete build of yaSSL as described in the release -0.0.1 - 0.1.0 notes and downloaded the update to 0.2.0, place the update file -yassl-update-0.2.0.tar.gz in the yaSSL home directory and issue the command: - -gzip -cd yassl-update-0.2.0.tar.gz | tar xvf - - -to update the previous release. - -Then issue the make command on linux or rebuild the yaSSL project on Windows. - -*******************yaSSL Release notes, version 0.1.0 - -This release of yaSSL contains minor bug fixes, full client and server TLSv1 -support including full ephemeral Diffie-Hellman support, SSL type RSA and DSS -signing and verification, and initial stunnel 4.05 build support. - - - -*********************yaSSL Release notes, version 0.0.3 - -The third release of yaSSL contains minor bug fixes, client certificate -enhancements, and initial ephemeral Diffie-Hellman integration: - - - -********************* - -yaSSL Release notes, version 0.0.2 - -The second release of yaSSL contains minor bug fixes, client certificate -enhancements, session resumption, and improved TLS support including: - -- HMAC for MD5 and SHA-1 -- PRF (pseudo random function) -- Master Secret and Key derivation routines -- Record Authentication codes -- Finish verify data check - -Once ephemeral RSA and DH are added yaSSL will be fully complaint with TLS. - - - -********************** - -yassl Release notes, version 0.0.1 - -The first release of yassl supports normal RSA mode SSLv3 connections with -support for SHA-1 and MD5 digests. Ciphers include DES, 3DES, and RC4. - -yassl uses the CryptoPP library for cryptography, the source is available at -www.cryptopp.com . - -yassl uses CML (the Certificate Management Library) for x509 support. More -features will be in future versions. The CML source is available for download -from www.digitalnet.com/knowledge/cml_home.htm . - -The next release of yassl will support the 3 lesser-used SSL connection modes; -HandShake resumption, Ephemeral RSA (or DH), and Client Authentication as well -as full support for TLS. Backwards support for SSLv2 is not planned at this -time. - - -********************** - -Building yassl on linux: - -use the ./buildall script to build everything. - -buildall will configure and build CML, CryptoPP, and yassl. Testing was -preformed with gcc version 3.3.2 on kernel 2.4.22. - - -********************** - -Building yassl on Windows: - -Testing was preformed on Windows 2000 with Visual C++ 6 sp5. - -1) decompress esnacc_r16.tgz in place, see buildall for syntax if unsure - -2) decompress smp_r23.tgz in place - -3) unzip cryptopp51/crypto51.zip in place - -4) Build SNACC (part of CML) using snacc_builds.dsw in the SNACC directory - -5) Build SMP (part of CMP) using smp.dsw in the smp directory - -6) Build yassl using yassl.dsw - - -********************** - -examples, server and client: - -Please see the server and client examples in both versions to see how to link -to yassl and the support libraries. On linux do 'make server' and 'make -client' to build them. On Windows you will find the example projects in the -main workspace, yassl.dsw. - -The example server and client are compatible with openssl. - - -********************** - -Building yassl into mysql on linux: - -Testing was done using mysql version 4.0.17. - -alter openssl_libs in the configure file, line 21056. Change '-lssl -lcrypto' -to '-lyassl -lcryptopp -lcmapi -lcmlasn -lctil -lc++asn1'. - -see build/config_command for the configure command used to configure mysql -please change /home/touska/ to the relevant directory of course. - -add yassl/lib to the LD_LIBRARY_PATH because libmysql/conf_to_src does not -use the ssl lib directory though it does use the ssl libraries. - -make - -make install - - -********************* - -License: yassl is currently under the GPL, please see license information -in the source and include files. - - -********************* - -Contact: please send comments or questions to Todd A Ouska at todd@yassl.com -and/or Larry Stefonic at larry@yassl.com or 425-741-6858. - - - diff --git a/dep/mysqllite/extra/yassl/include/buffer.hpp b/dep/mysqllite/extra/yassl/include/buffer.hpp deleted file mode 100644 index a51bca9a63021..0000000000000 --- a/dep/mysqllite/extra/yassl/include/buffer.hpp +++ /dev/null @@ -1,207 +0,0 @@ -/* - 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/dep/mysqllite/extra/yassl/include/cert_wrapper.hpp b/dep/mysqllite/extra/yassl/include/cert_wrapper.hpp deleted file mode 100644 index 572b9f8729359..0000000000000 --- a/dep/mysqllite/extra/yassl/include/cert_wrapper.hpp +++ /dev/null @@ -1,132 +0,0 @@ -/* - 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/dep/mysqllite/extra/yassl/include/crypto_wrapper.hpp b/dep/mysqllite/extra/yassl/include/crypto_wrapper.hpp deleted file mode 100644 index 07b5925265a95..0000000000000 --- a/dep/mysqllite/extra/yassl/include/crypto_wrapper.hpp +++ /dev/null @@ -1,427 +0,0 @@ -/* - 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/dep/mysqllite/extra/yassl/include/factory.hpp b/dep/mysqllite/extra/yassl/include/factory.hpp deleted file mode 100644 index e66e32dcdf68d..0000000000000 --- a/dep/mysqllite/extra/yassl/include/factory.hpp +++ /dev/null @@ -1,101 +0,0 @@ -/* - 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/dep/mysqllite/extra/yassl/include/handshake.hpp b/dep/mysqllite/extra/yassl/include/handshake.hpp deleted file mode 100644 index 549a31bf3e9ed..0000000000000 --- a/dep/mysqllite/extra/yassl/include/handshake.hpp +++ /dev/null @@ -1,69 +0,0 @@ -/* - 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/dep/mysqllite/extra/yassl/include/lock.hpp b/dep/mysqllite/extra/yassl/include/lock.hpp deleted file mode 100644 index 99829b0b6dea9..0000000000000 --- a/dep/mysqllite/extra/yassl/include/lock.hpp +++ /dev/null @@ -1,95 +0,0 @@ -/* - 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 - -/* - Visual Studio Source Annotations header (sourceannotations.h) fails - to compile if outside of the global namespace. -*/ -#ifdef YASSL_THREAD_SAFE -#ifdef _WIN32 -#include -#endif -#endif - -namespace yaSSL { - - -#ifdef YASSL_THREAD_SAFE - #ifdef _WIN32 - - 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 // YASSL_THREAD_SAFE (WE'RE SINGLE) - - class Mutex { - public: - class Lock { - public: - explicit Lock(Mutex&) {} - }; - }; - -#endif // YASSL_THREAD_SAFE - - - -} // namespace -#endif // yaSSL_LOCK_HPP diff --git a/dep/mysqllite/extra/yassl/include/log.hpp b/dep/mysqllite/extra/yassl/include/log.hpp deleted file mode 100644 index fb480eeefb62f..0000000000000 --- a/dep/mysqllite/extra/yassl/include/log.hpp +++ /dev/null @@ -1,55 +0,0 @@ -/* - 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/dep/mysqllite/extra/yassl/include/openssl/crypto.h b/dep/mysqllite/extra/yassl/include/openssl/crypto.h deleted file mode 100644 index f53e5231027d9..0000000000000 --- a/dep/mysqllite/extra/yassl/include/openssl/crypto.h +++ /dev/null @@ -1,18 +0,0 @@ -/* 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/dep/mysqllite/extra/yassl/include/openssl/des.h b/dep/mysqllite/extra/yassl/include/openssl/des.h deleted file mode 100644 index 67be7eecfb988..0000000000000 --- a/dep/mysqllite/extra/yassl/include/openssl/des.h +++ /dev/null @@ -1 +0,0 @@ -/* des.h for openssl */ diff --git a/dep/mysqllite/extra/yassl/include/openssl/des_old.h b/dep/mysqllite/extra/yassl/include/openssl/des_old.h deleted file mode 100644 index 40e8fbc02af87..0000000000000 --- a/dep/mysqllite/extra/yassl/include/openssl/des_old.h +++ /dev/null @@ -1 +0,0 @@ -/* des_old.h for openvn */ diff --git a/dep/mysqllite/extra/yassl/include/openssl/engine.h b/dep/mysqllite/extra/yassl/include/openssl/engine.h deleted file mode 100644 index 39952fcae8435..0000000000000 --- a/dep/mysqllite/extra/yassl/include/openssl/engine.h +++ /dev/null @@ -1,5 +0,0 @@ -/* engine.h for libcurl */ - -#undef HAVE_OPENSSL_ENGINE_H - - diff --git a/dep/mysqllite/extra/yassl/include/openssl/err.h b/dep/mysqllite/extra/yassl/include/openssl/err.h deleted file mode 100644 index 45ac1ca2469b1..0000000000000 --- a/dep/mysqllite/extra/yassl/include/openssl/err.h +++ /dev/null @@ -1,8 +0,0 @@ -/* err.h for openssl */ - -#ifndef yaSSL_err_h__ -#define yaSSL_err_h__ - - - -#endif /* yaSSL_err_h__ */ diff --git a/dep/mysqllite/extra/yassl/include/openssl/evp.h b/dep/mysqllite/extra/yassl/include/openssl/evp.h deleted file mode 100644 index 1d66b08df46bd..0000000000000 --- a/dep/mysqllite/extra/yassl/include/openssl/evp.h +++ /dev/null @@ -1,10 +0,0 @@ -/* 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/dep/mysqllite/extra/yassl/include/openssl/hmac.h b/dep/mysqllite/extra/yassl/include/openssl/hmac.h deleted file mode 100644 index a2eae4c08c1de..0000000000000 --- a/dep/mysqllite/extra/yassl/include/openssl/hmac.h +++ /dev/null @@ -1 +0,0 @@ -/* hmac.h for openvpn */ diff --git a/dep/mysqllite/extra/yassl/include/openssl/lhash.h b/dep/mysqllite/extra/yassl/include/openssl/lhash.h deleted file mode 100644 index 01f8535f869fe..0000000000000 --- a/dep/mysqllite/extra/yassl/include/openssl/lhash.h +++ /dev/null @@ -1,2 +0,0 @@ -/* lhash.h for openSSL */ - diff --git a/dep/mysqllite/extra/yassl/include/openssl/md4.h b/dep/mysqllite/extra/yassl/include/openssl/md4.h deleted file mode 100644 index 2e99f977fca68..0000000000000 --- a/dep/mysqllite/extra/yassl/include/openssl/md4.h +++ /dev/null @@ -1 +0,0 @@ -/* md4.h for libcurl */ diff --git a/dep/mysqllite/extra/yassl/include/openssl/md5.h b/dep/mysqllite/extra/yassl/include/openssl/md5.h deleted file mode 100644 index dfaf9799c443d..0000000000000 --- a/dep/mysqllite/extra/yassl/include/openssl/md5.h +++ /dev/null @@ -1,4 +0,0 @@ -/* md5.h for openssl */ - -#include "ssl.h" /* in there for now */ - diff --git a/dep/mysqllite/extra/yassl/include/openssl/objects.h b/dep/mysqllite/extra/yassl/include/openssl/objects.h deleted file mode 100644 index 99f2326e51b42..0000000000000 --- a/dep/mysqllite/extra/yassl/include/openssl/objects.h +++ /dev/null @@ -1 +0,0 @@ -/* objects.h for openvpn */ diff --git a/dep/mysqllite/extra/yassl/include/openssl/opensslv.h b/dep/mysqllite/extra/yassl/include/openssl/opensslv.h deleted file mode 100644 index d932130684fc1..0000000000000 --- a/dep/mysqllite/extra/yassl/include/openssl/opensslv.h +++ /dev/null @@ -1,12 +0,0 @@ -/* 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/dep/mysqllite/extra/yassl/include/openssl/pem.h b/dep/mysqllite/extra/yassl/include/openssl/pem.h deleted file mode 100644 index b4c63d56a4d77..0000000000000 --- a/dep/mysqllite/extra/yassl/include/openssl/pem.h +++ /dev/null @@ -1 +0,0 @@ -/* pem.h for libcurl */ diff --git a/dep/mysqllite/extra/yassl/include/openssl/pkcs12.h b/dep/mysqllite/extra/yassl/include/openssl/pkcs12.h deleted file mode 100644 index e452fc879c4dc..0000000000000 --- a/dep/mysqllite/extra/yassl/include/openssl/pkcs12.h +++ /dev/null @@ -1,5 +0,0 @@ -/* pkcs12.h for libcurl */ - - -#undef HAVE_OPENSSL_PKCS12_H - diff --git a/dep/mysqllite/extra/yassl/include/openssl/prefix_crypto.h b/dep/mysqllite/extra/yassl/include/openssl/prefix_crypto.h deleted file mode 100644 index 3fa5f32c62749..0000000000000 --- a/dep/mysqllite/extra/yassl/include/openssl/prefix_crypto.h +++ /dev/null @@ -1 +0,0 @@ -#define SSLeay_version yaSSLeay_version diff --git a/dep/mysqllite/extra/yassl/include/openssl/prefix_ssl.h b/dep/mysqllite/extra/yassl/include/openssl/prefix_ssl.h deleted file mode 100644 index 138d9fb88217d..0000000000000 --- a/dep/mysqllite/extra/yassl/include/openssl/prefix_ssl.h +++ /dev/null @@ -1,169 +0,0 @@ -#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/dep/mysqllite/extra/yassl/include/openssl/rand.h b/dep/mysqllite/extra/yassl/include/openssl/rand.h deleted file mode 100644 index df9c902034692..0000000000000 --- a/dep/mysqllite/extra/yassl/include/openssl/rand.h +++ /dev/null @@ -1,2 +0,0 @@ -/* rand.h for openSSL */ - diff --git a/dep/mysqllite/extra/yassl/include/openssl/rsa.h b/dep/mysqllite/extra/yassl/include/openssl/rsa.h deleted file mode 100644 index fe64e655bdcbc..0000000000000 --- a/dep/mysqllite/extra/yassl/include/openssl/rsa.h +++ /dev/null @@ -1,10 +0,0 @@ -/* rsa.h for openSSL */ - - -#ifndef yaSSL_rsa_h__ -#define yaSSL_rsa_h__ - -enum { RSA_F4 = 1 }; - - -#endif /* yaSSL_rsa_h__ */ diff --git a/dep/mysqllite/extra/yassl/include/openssl/sha.h b/dep/mysqllite/extra/yassl/include/openssl/sha.h deleted file mode 100644 index bb487c05c2e70..0000000000000 --- a/dep/mysqllite/extra/yassl/include/openssl/sha.h +++ /dev/null @@ -1 +0,0 @@ -/* sha.h for openvpn */ diff --git a/dep/mysqllite/extra/yassl/include/openssl/ssl.h b/dep/mysqllite/extra/yassl/include/openssl/ssl.h deleted file mode 100644 index 05b34a0dc452e..0000000000000 --- a/dep/mysqllite/extra/yassl/include/openssl/ssl.h +++ /dev/null @@ -1,554 +0,0 @@ -/* - 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/dep/mysqllite/extra/yassl/include/openssl/x509.h b/dep/mysqllite/extra/yassl/include/openssl/x509.h deleted file mode 100644 index dcd847c03374d..0000000000000 --- a/dep/mysqllite/extra/yassl/include/openssl/x509.h +++ /dev/null @@ -1 +0,0 @@ -/* x509.h for libcurl */ diff --git a/dep/mysqllite/extra/yassl/include/openssl/x509v3.h b/dep/mysqllite/extra/yassl/include/openssl/x509v3.h deleted file mode 100644 index adf94af8f4846..0000000000000 --- a/dep/mysqllite/extra/yassl/include/openssl/x509v3.h +++ /dev/null @@ -1 +0,0 @@ -/* x509v3.h for libcurl */ diff --git a/dep/mysqllite/extra/yassl/include/socket_wrapper.hpp b/dep/mysqllite/extra/yassl/include/socket_wrapper.hpp deleted file mode 100644 index 308704c2af036..0000000000000 --- a/dep/mysqllite/extra/yassl/include/socket_wrapper.hpp +++ /dev/null @@ -1,96 +0,0 @@ -/* - 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/dep/mysqllite/extra/yassl/include/timer.hpp b/dep/mysqllite/extra/yassl/include/timer.hpp deleted file mode 100644 index 725e73cf45383..0000000000000 --- a/dep/mysqllite/extra/yassl/include/timer.hpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - 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/dep/mysqllite/extra/yassl/include/yassl.hpp b/dep/mysqllite/extra/yassl/include/yassl.hpp deleted file mode 100644 index 29e0a5d94ecb7..0000000000000 --- a/dep/mysqllite/extra/yassl/include/yassl.hpp +++ /dev/null @@ -1,85 +0,0 @@ -/* - 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/dep/mysqllite/extra/yassl/include/yassl_error.hpp b/dep/mysqllite/extra/yassl/include/yassl_error.hpp deleted file mode 100644 index d2473fb3e2b0b..0000000000000 --- a/dep/mysqllite/extra/yassl/include/yassl_error.hpp +++ /dev/null @@ -1,86 +0,0 @@ -/* - 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(unsigned long, 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/dep/mysqllite/extra/yassl/include/yassl_imp.hpp b/dep/mysqllite/extra/yassl/include/yassl_imp.hpp deleted file mode 100644 index 8893ba8a8baf4..0000000000000 --- a/dep/mysqllite/extra/yassl/include/yassl_imp.hpp +++ /dev/null @@ -1,748 +0,0 @@ -/* - 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/dep/mysqllite/extra/yassl/include/yassl_int.hpp b/dep/mysqllite/extra/yassl/include/yassl_int.hpp deleted file mode 100644 index 1e761f559e251..0000000000000 --- a/dep/mysqllite/extra/yassl/include/yassl_int.hpp +++ /dev/null @@ -1,693 +0,0 @@ -/* - 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; - 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/dep/mysqllite/extra/yassl/include/yassl_types.hpp b/dep/mysqllite/extra/yassl/include/yassl_types.hpp deleted file mode 100644 index 285357928286d..0000000000000 --- a/dep/mysqllite/extra/yassl/include/yassl_types.hpp +++ /dev/null @@ -1,530 +0,0 @@ -/* - 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 - - -#ifdef min - #undef min -#endif - -template -T min(T a, T b) -{ - return a < b ? a : b; -} - - - -// 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/dep/mysqllite/extra/yassl/src/buffer.cpp b/dep/mysqllite/extra/yassl/src/buffer.cpp deleted file mode 100644 index 66107dbe0a943..0000000000000 --- a/dep/mysqllite/extra/yassl/src/buffer.cpp +++ /dev/null @@ -1,279 +0,0 @@ -/* - 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 (uint) (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 (uint) (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/dep/mysqllite/extra/yassl/src/cert_wrapper.cpp b/dep/mysqllite/extra/yassl/src/cert_wrapper.cpp deleted file mode 100644 index ebec088226529..0000000000000 --- a/dep/mysqllite/extra/yassl/src/cert_wrapper.cpp +++ /dev/null @@ -1,370 +0,0 @@ -/* - 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/dep/mysqllite/extra/yassl/src/crypto_wrapper.cpp b/dep/mysqllite/extra/yassl/src/crypto_wrapper.cpp deleted file mode 100644 index b968ec1e6c391..0000000000000 --- a/dep/mysqllite/extra/yassl/src/crypto_wrapper.cpp +++ /dev/null @@ -1,1014 +0,0 @@ -/* - 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; - } - } - // get blank line - if (fgets(line, sizeof(line), file)) - 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/dep/mysqllite/extra/yassl/src/handshake.cpp b/dep/mysqllite/extra/yassl/src/handshake.cpp deleted file mode 100644 index b4d9005af15e3..0000000000000 --- a/dep/mysqllite/extra/yassl/src/handshake.cpp +++ /dev/null @@ -1,1121 +0,0 @@ -/* - 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/dep/mysqllite/extra/yassl/src/lock.cpp b/dep/mysqllite/extra/yassl/src/lock.cpp deleted file mode 100644 index 6e85fefa14d6c..0000000000000 --- a/dep/mysqllite/extra/yassl/src/lock.cpp +++ /dev/null @@ -1,87 +0,0 @@ -/* - 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 YASSL_THREAD_SAFE - #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 // YASSL_THREAD_SAFE - - - -} // namespace yaSSL - diff --git a/dep/mysqllite/extra/yassl/src/log.cpp b/dep/mysqllite/extra/yassl/src/log.cpp deleted file mode 100644 index 35db4136a54c6..0000000000000 --- a/dep/mysqllite/extra/yassl/src/log.cpp +++ /dev/null @@ -1,146 +0,0 @@ -/* - 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/dep/mysqllite/extra/yassl/src/socket_wrapper.cpp b/dep/mysqllite/extra/yassl/src/socket_wrapper.cpp deleted file mode 100644 index eee5d47377f85..0000000000000 --- a/dep/mysqllite/extra/yassl/src/socket_wrapper.cpp +++ /dev/null @@ -1,199 +0,0 @@ -/* - 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/dep/mysqllite/extra/yassl/src/ssl.cpp b/dep/mysqllite/extra/yassl/src/ssl.cpp deleted file mode 100644 index 4d8b6ac69b8f0..0000000000000 --- a/dep/mysqllite/extra/yassl/src/ssl.cpp +++ /dev/null @@ -1,1672 +0,0 @@ -/* - 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(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/dep/mysqllite/extra/yassl/src/timer.cpp b/dep/mysqllite/extra/yassl/src/timer.cpp deleted file mode 100644 index c1286b0724c92..0000000000000 --- a/dep/mysqllite/extra/yassl/src/timer.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/* - 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/dep/mysqllite/extra/yassl/src/yassl_error.cpp b/dep/mysqllite/extra/yassl/src/yassl_error.cpp deleted file mode 100644 index dd30348cd9318..0000000000000 --- a/dep/mysqllite/extra/yassl/src/yassl_error.cpp +++ /dev/null @@ -1,275 +0,0 @@ -/* - 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(unsigned long 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/dep/mysqllite/extra/yassl/src/yassl_imp.cpp b/dep/mysqllite/extra/yassl/src/yassl_imp.cpp deleted file mode 100644 index 86799f961ae00..0000000000000 --- a/dep/mysqllite/extra/yassl/src/yassl_imp.cpp +++ /dev/null @@ -1,2281 +0,0 @@ -/* - 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 skip 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; - - if (ssl.isTLSv1_1()) - ivExtra = ssl.getCrypto().get_cipher().get_blockSize(); - int padSz = ssl.getSecurity().get_parms().encrypt_size_ - ivExtra - - aSz - digestSz; - input.set_current(input.get_current() + padSz); - } - - // 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, padSz = 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); - padSz = 1; - } - int digestSz = ssl.getCrypto().get_digest().get_digestSize(); - int dataSz = msgSz - ivExtra - digestSz - pad - padSz; - 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 skip fill - opaque mac[SHA_LEN]; - input.read(mac, digestSz); - input.set_current(input.get_current() + pad + padSz); - - // 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(); - - int padSz = ssl.getSecurity().get_parms().encrypt_size_ - ivExtra - - HANDSHAKE_HEADER - finishedSz - digestSz; - input.set_current(input.get_current() + padSz); - - // 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/dep/mysqllite/extra/yassl/src/yassl_int.cpp b/dep/mysqllite/extra/yassl/src/yassl_int.cpp deleted file mode 100644 index 8e4a9aa95ec55..0000000000000 --- a/dep/mysqllite/extra/yassl/src/yassl_int.cpp +++ /dev/null @@ -1,2580 +0,0 @@ -/* - 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_; -} - - -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/dep/mysqllite/extra/yassl/taocrypt/COPYING b/dep/mysqllite/extra/yassl/taocrypt/COPYING deleted file mode 100644 index d60c31a97a544..0000000000000 --- a/dep/mysqllite/extra/yassl/taocrypt/COPYING +++ /dev/null @@ -1,340 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 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 - - 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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 Library General -Public License instead of this License. diff --git a/dep/mysqllite/extra/yassl/taocrypt/INSTALL b/dep/mysqllite/extra/yassl/taocrypt/INSTALL deleted file mode 100644 index 54caf7c190f28..0000000000000 --- a/dep/mysqllite/extra/yassl/taocrypt/INSTALL +++ /dev/null @@ -1,229 +0,0 @@ -Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software -Foundation, Inc. - - This file is free documentation; the Free Software Foundation gives -unlimited permission to copy, distribute and modify it. - -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, and a -file `config.log' containing compiler output (useful mainly for -debugging `configure'). - - It can also use an optional file (typically called `config.cache' -and enabled with `--cache-file=config.cache' or simply `-C') that saves -the results of its tests to speed up reconfiguring. (Caching is -disabled by default to prevent problems with accidental use of stale -cache files.) - - 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 you are using the cache, and at -some point `config.cache' contains results you don't want to keep, you -may remove or edit it. - - The file `configure.ac' (or `configure.in') is used to create -`configure' by a program called `autoconf'. You only need -`configure.ac' 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. Run `./configure --help' -for details on some of the pertinent environment variables. - - You can give `configure' initial values for configuration parameters -by setting variables in the command line or in the environment. Here -is an example: - - ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix - - *Note Defining Variables::, for more details. - -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 support 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' cannot figure out -automatically, but needs to determine by the type of machine the package -will run on. Usually, assuming the package is built to be run on the -_same_ architectures, `configure' can figure that out, but if it prints -a message saying it cannot guess the machine type, give it the -`--build=TYPE' option. TYPE can either be a short name for the system -type, such as `sun4', or a canonical name which has the form: - - CPU-COMPANY-SYSTEM - -where SYSTEM can have one of these forms: - - OS KERNEL-OS - - 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 machine type. - - If you are _building_ compiler tools for cross-compiling, you should -use the `--target=TYPE' option to select the type of system they will -produce code for. - - If you want to _use_ a cross compiler, that generates code for a -platform different from the build platform, you should specify the -"host" platform (i.e., that on which the generated programs will -eventually be run) with `--host=TYPE'. - -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. - -Defining Variables -================== - - Variables not defined in a site shell script can be set in the -environment passed to `configure'. However, some packages may run -configure again during the build, and the customized values of these -variables may be lost. In order to avoid this problem, you should set -them in the `configure' command line, using `VAR=value'. For example: - - ./configure CC=/usr/local2/bin/gcc - -will cause the specified gcc to be used as the C compiler (unless it is -overridden in the site shell script). - -`configure' Invocation -====================== - - `configure' recognizes the following options to control how it -operates. - -`--help' -`-h' - Print a summary of the options to `configure', and exit. - -`--version' -`-V' - Print the version of Autoconf used to generate the `configure' - script, and exit. - -`--cache-file=FILE' - Enable the cache: use and save the results of the tests in FILE, - traditionally `config.cache'. FILE defaults to `/dev/null' to - disable caching. - -`--config-cache' -`-C' - Alias for `--cache-file=config.cache'. - -`--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. - -`configure' also accepts some other, not widely useful, options. Run -`configure --help' for more details. - diff --git a/dep/mysqllite/extra/yassl/taocrypt/README b/dep/mysqllite/extra/yassl/taocrypt/README deleted file mode 100644 index 0a7ff30178633..0000000000000 --- a/dep/mysqllite/extra/yassl/taocrypt/README +++ /dev/null @@ -1,48 +0,0 @@ -TaoCrypt release 0.9.2 02/5/2007 - - -This release includes bug fixes, portability enhancements, and some -optimiations. - -See 0.9.0 for build instructions. - - - - -******************TaoCrypt release 0.9.0 09/18/2006 - -This is the first release of TaoCrypt, it was previously only included with -yaSSL. TaoCrypt is highly portable and fast, its features include: - -One way hash functions: SHA-1, MD2, MD4, MD5, RIPEMD-160 -Message authentication codes: HMAC -Block Ciphers: DES, Triple-DES, AES, Blowfish, Twofish -Stream Ciphers: ARC4 -Public Key Crypto: RSA, DSA, Diffie-Hellman -Password based key derivation: PBKDF2 from PKCS #5 -Pseudo Random Number Generators -Lare Integer Support -Base 16/64 encoding/decoding -DER encoding/decoding -X.509 processing -SSE2 and ia32 asm for the right processors and compilers - - -To build on Unix - - ./configure - make - - To test the build, from the ./test directory run ./test - - -On Windows - - Open the taocrypt project workspace - Choose (Re)Build All - - To test the build, run the test executable - - -Please send any questions or comments to todd@yassl.com. - diff --git a/dep/mysqllite/extra/yassl/taocrypt/include/aes.hpp b/dep/mysqllite/extra/yassl/taocrypt/include/aes.hpp deleted file mode 100644 index dc19c98a83a89..0000000000000 --- a/dep/mysqllite/extra/yassl/taocrypt/include/aes.hpp +++ /dev/null @@ -1,98 +0,0 @@ -/* - 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/dep/mysqllite/extra/yassl/taocrypt/include/algebra.hpp b/dep/mysqllite/extra/yassl/taocrypt/include/algebra.hpp deleted file mode 100644 index 298ef115a4a2a..0000000000000 --- a/dep/mysqllite/extra/yassl/taocrypt/include/algebra.hpp +++ /dev/null @@ -1,226 +0,0 @@ -/* - 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/dep/mysqllite/extra/yassl/taocrypt/include/arc4.hpp b/dep/mysqllite/extra/yassl/taocrypt/include/arc4.hpp deleted file mode 100644 index 757e1a50d7154..0000000000000 --- a/dep/mysqllite/extra/yassl/taocrypt/include/arc4.hpp +++ /dev/null @@ -1,58 +0,0 @@ -/* - 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/dep/mysqllite/extra/yassl/taocrypt/include/asn.hpp b/dep/mysqllite/extra/yassl/taocrypt/include/asn.hpp deleted file mode 100644 index 168b8a8c75500..0000000000000 --- a/dep/mysqllite/extra/yassl/taocrypt/include/asn.hpp +++ /dev/null @@ -1,373 +0,0 @@ -/* - 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(); - char* AddTag(char*, const char*, const char*, word32, word32); - 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/dep/mysqllite/extra/yassl/taocrypt/include/block.hpp b/dep/mysqllite/extra/yassl/taocrypt/include/block.hpp deleted file mode 100644 index bb34db5e07fcd..0000000000000 --- a/dep/mysqllite/extra/yassl/taocrypt/include/block.hpp +++ /dev/null @@ -1,206 +0,0 @@ -/* - 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((word32) oldSize, (word32) 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/dep/mysqllite/extra/yassl/taocrypt/include/blowfish.hpp b/dep/mysqllite/extra/yassl/taocrypt/include/blowfish.hpp deleted file mode 100644 index 94bbab7aea823..0000000000000 --- a/dep/mysqllite/extra/yassl/taocrypt/include/blowfish.hpp +++ /dev/null @@ -1,88 +0,0 @@ -/* - 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), sbox_(pbox_ + ROUNDS + 2) {} - -#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 + 4 * 256]; - word32* sbox_; - - 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/dep/mysqllite/extra/yassl/taocrypt/include/coding.hpp b/dep/mysqllite/extra/yassl/taocrypt/include/coding.hpp deleted file mode 100644 index 3b1c06876045f..0000000000000 --- a/dep/mysqllite/extra/yassl/taocrypt/include/coding.hpp +++ /dev/null @@ -1,91 +0,0 @@ -/* - 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/dep/mysqllite/extra/yassl/taocrypt/include/des.hpp b/dep/mysqllite/extra/yassl/taocrypt/include/des.hpp deleted file mode 100644 index f99a289392fdf..0000000000000 --- a/dep/mysqllite/extra/yassl/taocrypt/include/des.hpp +++ /dev/null @@ -1,130 +0,0 @@ -/* - 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/dep/mysqllite/extra/yassl/taocrypt/include/dh.hpp b/dep/mysqllite/extra/yassl/taocrypt/include/dh.hpp deleted file mode 100644 index b7724cbd80d27..0000000000000 --- a/dep/mysqllite/extra/yassl/taocrypt/include/dh.hpp +++ /dev/null @@ -1,86 +0,0 @@ -/* - 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/dep/mysqllite/extra/yassl/taocrypt/include/dsa.hpp b/dep/mysqllite/extra/yassl/taocrypt/include/dsa.hpp deleted file mode 100644 index f185b852cdc54..0000000000000 --- a/dep/mysqllite/extra/yassl/taocrypt/include/dsa.hpp +++ /dev/null @@ -1,126 +0,0 @@ -/* - 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/dep/mysqllite/extra/yassl/taocrypt/include/error.hpp b/dep/mysqllite/extra/yassl/taocrypt/include/error.hpp deleted file mode 100644 index ef8b065d2f198..0000000000000 --- a/dep/mysqllite/extra/yassl/taocrypt/include/error.hpp +++ /dev/null @@ -1,88 +0,0 @@ -/* - 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/dep/mysqllite/extra/yassl/taocrypt/include/file.hpp b/dep/mysqllite/extra/yassl/taocrypt/include/file.hpp deleted file mode 100644 index 0f85b46fdb2c6..0000000000000 --- a/dep/mysqllite/extra/yassl/taocrypt/include/file.hpp +++ /dev/null @@ -1,123 +0,0 @@ -/* - 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/dep/mysqllite/extra/yassl/taocrypt/include/hash.hpp b/dep/mysqllite/extra/yassl/taocrypt/include/hash.hpp deleted file mode 100644 index fa5f6c0472018..0000000000000 --- a/dep/mysqllite/extra/yassl/taocrypt/include/hash.hpp +++ /dev/null @@ -1,110 +0,0 @@ -/* - 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/dep/mysqllite/extra/yassl/taocrypt/include/hmac.hpp b/dep/mysqllite/extra/yassl/taocrypt/include/hmac.hpp deleted file mode 100644 index 1d486514e06ab..0000000000000 --- a/dep/mysqllite/extra/yassl/taocrypt/include/hmac.hpp +++ /dev/null @@ -1,138 +0,0 @@ -/* - 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/dep/mysqllite/extra/yassl/taocrypt/include/integer.hpp b/dep/mysqllite/extra/yassl/taocrypt/include/integer.hpp deleted file mode 100644 index 186d62bb86675..0000000000000 --- a/dep/mysqllite/extra/yassl/taocrypt/include/integer.hpp +++ /dev/null @@ -1,328 +0,0 @@ -/* - 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/dep/mysqllite/extra/yassl/taocrypt/include/kernelc.hpp b/dep/mysqllite/extra/yassl/taocrypt/include/kernelc.hpp deleted file mode 100644 index daa3762d5dda3..0000000000000 --- a/dep/mysqllite/extra/yassl/taocrypt/include/kernelc.hpp +++ /dev/null @@ -1,46 +0,0 @@ -/* - 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/dep/mysqllite/extra/yassl/taocrypt/include/md2.hpp b/dep/mysqllite/extra/yassl/taocrypt/include/md2.hpp deleted file mode 100644 index cb13d86ec070e..0000000000000 --- a/dep/mysqllite/extra/yassl/taocrypt/include/md2.hpp +++ /dev/null @@ -1,64 +0,0 @@ -/* - 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/dep/mysqllite/extra/yassl/taocrypt/include/md4.hpp b/dep/mysqllite/extra/yassl/taocrypt/include/md4.hpp deleted file mode 100644 index 28c2bc7efd1a2..0000000000000 --- a/dep/mysqllite/extra/yassl/taocrypt/include/md4.hpp +++ /dev/null @@ -1,62 +0,0 @@ -/* - 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/dep/mysqllite/extra/yassl/taocrypt/include/md5.hpp b/dep/mysqllite/extra/yassl/taocrypt/include/md5.hpp deleted file mode 100644 index 9b461543675e4..0000000000000 --- a/dep/mysqllite/extra/yassl/taocrypt/include/md5.hpp +++ /dev/null @@ -1,70 +0,0 @@ -/* - 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/dep/mysqllite/extra/yassl/taocrypt/include/misc.hpp b/dep/mysqllite/extra/yassl/taocrypt/include/misc.hpp deleted file mode 100644 index 96648a39aa152..0000000000000 --- a/dep/mysqllite/extra/yassl/taocrypt/include/misc.hpp +++ /dev/null @@ -1,888 +0,0 @@ -/* - 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 - -#ifdef min -#undef min -#endif - -inline word32 min(word32 a, word32 b) -{ - return a < b ? a : b; -} - - -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/dep/mysqllite/extra/yassl/taocrypt/include/modarith.hpp b/dep/mysqllite/extra/yassl/taocrypt/include/modarith.hpp deleted file mode 100644 index 501a8129b9060..0000000000000 --- a/dep/mysqllite/extra/yassl/taocrypt/include/modarith.hpp +++ /dev/null @@ -1,165 +0,0 @@ -/* - 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/dep/mysqllite/extra/yassl/taocrypt/include/modes.hpp b/dep/mysqllite/extra/yassl/taocrypt/include/modes.hpp deleted file mode 100644 index 4575fe1414b5e..0000000000000 --- a/dep/mysqllite/extra/yassl/taocrypt/include/modes.hpp +++ /dev/null @@ -1,157 +0,0 @@ -/* - 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/dep/mysqllite/extra/yassl/taocrypt/include/pwdbased.hpp b/dep/mysqllite/extra/yassl/taocrypt/include/pwdbased.hpp deleted file mode 100644 index 5ece1a8f43be7..0000000000000 --- a/dep/mysqllite/extra/yassl/taocrypt/include/pwdbased.hpp +++ /dev/null @@ -1,90 +0,0 @@ -/* - 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/dep/mysqllite/extra/yassl/taocrypt/include/random.hpp b/dep/mysqllite/extra/yassl/taocrypt/include/random.hpp deleted file mode 100644 index 91058e8c5cf6b..0000000000000 --- a/dep/mysqllite/extra/yassl/taocrypt/include/random.hpp +++ /dev/null @@ -1,84 +0,0 @@ -/* - 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/dep/mysqllite/extra/yassl/taocrypt/include/ripemd.hpp b/dep/mysqllite/extra/yassl/taocrypt/include/ripemd.hpp deleted file mode 100644 index a63f92ceadd5d..0000000000000 --- a/dep/mysqllite/extra/yassl/taocrypt/include/ripemd.hpp +++ /dev/null @@ -1,69 +0,0 @@ -/* - 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/dep/mysqllite/extra/yassl/taocrypt/include/rsa.hpp b/dep/mysqllite/extra/yassl/taocrypt/include/rsa.hpp deleted file mode 100644 index c895ab6fd34aa..0000000000000 --- a/dep/mysqllite/extra/yassl/taocrypt/include/rsa.hpp +++ /dev/null @@ -1,250 +0,0 @@ -/* - 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/dep/mysqllite/extra/yassl/taocrypt/include/runtime.hpp b/dep/mysqllite/extra/yassl/taocrypt/include/runtime.hpp deleted file mode 100644 index 9d12b253dd619..0000000000000 --- a/dep/mysqllite/extra/yassl/taocrypt/include/runtime.hpp +++ /dev/null @@ -1,60 +0,0 @@ -/* - 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 { - void pure_error(void); -} // 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 - int __cxa_pure_virtual () __attribute__ ((weak)); -} // extern "C" - -#endif // __GNUC__ > 2 -#endif // compiler check -#endif // yaSSL_NEW_HPP - diff --git a/dep/mysqllite/extra/yassl/taocrypt/include/sha.hpp b/dep/mysqllite/extra/yassl/taocrypt/include/sha.hpp deleted file mode 100644 index c0b4368121b1f..0000000000000 --- a/dep/mysqllite/extra/yassl/taocrypt/include/sha.hpp +++ /dev/null @@ -1,168 +0,0 @@ -/* - 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/dep/mysqllite/extra/yassl/taocrypt/include/twofish.hpp b/dep/mysqllite/extra/yassl/taocrypt/include/twofish.hpp deleted file mode 100644 index bc6f89a9f39f8..0000000000000 --- a/dep/mysqllite/extra/yassl/taocrypt/include/twofish.hpp +++ /dev/null @@ -1,94 +0,0 @@ -/* - 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/dep/mysqllite/extra/yassl/taocrypt/include/type_traits.hpp b/dep/mysqllite/extra/yassl/taocrypt/include/type_traits.hpp deleted file mode 100644 index 0dd5e4e5c507a..0000000000000 --- a/dep/mysqllite/extra/yassl/taocrypt/include/type_traits.hpp +++ /dev/null @@ -1,77 +0,0 @@ -/* - 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) - -MK_FUNDAMENTAL_TYPE(bool) -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/dep/mysqllite/extra/yassl/taocrypt/include/types.hpp b/dep/mysqllite/extra/yassl/taocrypt/include/types.hpp deleted file mode 100644 index 3efdcdfbccbce..0000000000000 --- a/dep/mysqllite/extra/yassl/taocrypt/include/types.hpp +++ /dev/null @@ -1,99 +0,0 @@ -/* - 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/dep/mysqllite/extra/yassl/taocrypt/mySTL/algorithm.hpp b/dep/mysqllite/extra/yassl/taocrypt/mySTL/algorithm.hpp deleted file mode 100644 index d8bc29a0bb965..0000000000000 --- a/dep/mysqllite/extra/yassl/taocrypt/mySTL/algorithm.hpp +++ /dev/null @@ -1,108 +0,0 @@ -/* - 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/dep/mysqllite/extra/yassl/taocrypt/mySTL/helpers.hpp b/dep/mysqllite/extra/yassl/taocrypt/mySTL/helpers.hpp deleted file mode 100644 index c0495a71d8400..0000000000000 --- a/dep/mysqllite/extra/yassl/taocrypt/mySTL/helpers.hpp +++ /dev/null @@ -1,153 +0,0 @@ -/* - 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/dep/mysqllite/extra/yassl/taocrypt/mySTL/list.hpp b/dep/mysqllite/extra/yassl/taocrypt/mySTL/list.hpp deleted file mode 100644 index 6a081cba5ad25..0000000000000 --- a/dep/mysqllite/extra/yassl/taocrypt/mySTL/list.hpp +++ /dev/null @@ -1,367 +0,0 @@ -/* - 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/dep/mysqllite/extra/yassl/taocrypt/mySTL/memory.hpp b/dep/mysqllite/extra/yassl/taocrypt/mySTL/memory.hpp deleted file mode 100644 index b239aa6f907b6..0000000000000 --- a/dep/mysqllite/extra/yassl/taocrypt/mySTL/memory.hpp +++ /dev/null @@ -1,136 +0,0 @@ -/* - 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/dep/mysqllite/extra/yassl/taocrypt/mySTL/memory_array.hpp b/dep/mysqllite/extra/yassl/taocrypt/mySTL/memory_array.hpp deleted file mode 100644 index a044498cd9864..0000000000000 --- a/dep/mysqllite/extra/yassl/taocrypt/mySTL/memory_array.hpp +++ /dev/null @@ -1,135 +0,0 @@ -/* - 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/dep/mysqllite/extra/yassl/taocrypt/mySTL/pair.hpp b/dep/mysqllite/extra/yassl/taocrypt/mySTL/pair.hpp deleted file mode 100644 index be2dbb14b8895..0000000000000 --- a/dep/mysqllite/extra/yassl/taocrypt/mySTL/pair.hpp +++ /dev/null @@ -1,58 +0,0 @@ -/* - 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/dep/mysqllite/extra/yassl/taocrypt/mySTL/stdexcept.hpp b/dep/mysqllite/extra/yassl/taocrypt/mySTL/stdexcept.hpp deleted file mode 100644 index 9696995248d0c..0000000000000 --- a/dep/mysqllite/extra/yassl/taocrypt/mySTL/stdexcept.hpp +++ /dev/null @@ -1,77 +0,0 @@ -/* - 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/dep/mysqllite/extra/yassl/taocrypt/mySTL/vector.hpp b/dep/mysqllite/extra/yassl/taocrypt/mySTL/vector.hpp deleted file mode 100644 index 8ba8813ca70c8..0000000000000 --- a/dep/mysqllite/extra/yassl/taocrypt/mySTL/vector.hpp +++ /dev/null @@ -1,154 +0,0 @@ -/* - 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/dep/mysqllite/extra/yassl/taocrypt/src/aes.cpp b/dep/mysqllite/extra/yassl/taocrypt/src/aes.cpp deleted file mode 100644 index 63eff1d91fc08..0000000000000 --- a/dep/mysqllite/extra/yassl/taocrypt/src/aes.cpp +++ /dev/null @@ -1,1815 +0,0 @@ -/* - 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/dep/mysqllite/extra/yassl/taocrypt/src/aestables.cpp b/dep/mysqllite/extra/yassl/taocrypt/src/aestables.cpp deleted file mode 100644 index e9d6b7a80cb90..0000000000000 --- a/dep/mysqllite/extra/yassl/taocrypt/src/aestables.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/* - 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/dep/mysqllite/extra/yassl/taocrypt/src/algebra.cpp b/dep/mysqllite/extra/yassl/taocrypt/src/algebra.cpp deleted file mode 100644 index 47a660d5c9633..0000000000000 --- a/dep/mysqllite/extra/yassl/taocrypt/src/algebra.cpp +++ /dev/null @@ -1,339 +0,0 @@ -/* - 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= (unsigned int) (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/dep/mysqllite/extra/yassl/taocrypt/src/arc4.cpp b/dep/mysqllite/extra/yassl/taocrypt/src/arc4.cpp deleted file mode 100644 index 0944cc31837d2..0000000000000 --- a/dep/mysqllite/extra/yassl/taocrypt/src/arc4.cpp +++ /dev/null @@ -1,235 +0,0 @@ -/* - 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/dep/mysqllite/extra/yassl/taocrypt/src/asn.cpp b/dep/mysqllite/extra/yassl/taocrypt/src/asn.cpp deleted file mode 100644 index f87b466502e92..0000000000000 --- a/dep/mysqllite/extra/yassl/taocrypt/src/asn.cpp +++ /dev/null @@ -1,1204 +0,0 @@ -/* - 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) -{ - size_t 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_; -} - - -char *CertDecoder::AddTag(char *ptr, const char *buf_end, - const char *tag_name, word32 tag_name_length, - word32 tag_value_length) -{ - if (ptr + tag_name_length + tag_value_length > buf_end) - return 0; - - memcpy(ptr, tag_name, tag_name_length); - ptr+= tag_name_length; - - memcpy(ptr, source_.get_current(), tag_value_length); - ptr+= tag_value_length; - - return ptr; -} - - -// 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 - - if (length >= ASN_NAME_MAX) - goto err; - length += source_.get_index(); - - char *ptr, *buf_end; - - if (nt == ISSUER) { - ptr= issuer_; - buf_end= ptr + sizeof(issuer_) - 1; // 1 byte for trailing 0 - } - else { - ptr= subject_; - buf_end= ptr + sizeof(subject_) - 1; // 1 byte for trailing 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_); - - switch (id) { - case COMMON_NAME: - if (!(ptr= AddTag(ptr, buf_end, "/CN=", 4, strLen))) - goto err; - break; - case SUR_NAME: - if (!(ptr= AddTag(ptr, buf_end, "/SN=", 4, strLen))) - goto err; - break; - case COUNTRY_NAME: - if (!(ptr= AddTag(ptr, buf_end, "/C=", 3, strLen))) - goto err; - break; - case LOCALITY_NAME: - if (!(ptr= AddTag(ptr, buf_end, "/L=", 3, strLen))) - goto err; - break; - case STATE_NAME: - if (!(ptr= AddTag(ptr, buf_end, "/ST=", 4, strLen))) - goto err; - break; - case ORG_NAME: - if (!(ptr= AddTag(ptr, buf_end, "/O=", 3, strLen))) - goto err; - break; - case ORGUNIT_NAME: - if (!(ptr= AddTag(ptr, buf_end, "/OU=", 4, strLen))) - goto err; - break; - } - - 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 && !(ptr= AddTag(ptr, buf_end, "/emailAddress=", 14, length))) - goto err; - - source_.advance(length); - } - } - *ptr= 0; - - sha.Final(nt == ISSUER ? issuerHash_ : subjectHash_); - - return; - -err: - source_.SetError(CONTENT_E); -} - - -// 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/dep/mysqllite/extra/yassl/taocrypt/src/coding.cpp b/dep/mysqllite/extra/yassl/taocrypt/src/coding.cpp deleted file mode 100644 index 7fc681e1a0597..0000000000000 --- a/dep/mysqllite/extra/yassl/taocrypt/src/coding.cpp +++ /dev/null @@ -1,253 +0,0 @@ -/* - 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) / 4) + 3; - 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/dep/mysqllite/extra/yassl/taocrypt/src/des.cpp b/dep/mysqllite/extra/yassl/taocrypt/src/des.cpp deleted file mode 100644 index 5cffeaea9c91b..0000000000000 --- a/dep/mysqllite/extra/yassl/taocrypt/src/des.cpp +++ /dev/null @@ -1,776 +0,0 @@ -/* - 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/dep/mysqllite/extra/yassl/taocrypt/src/dh.cpp b/dep/mysqllite/extra/yassl/taocrypt/src/dh.cpp deleted file mode 100644 index d6a61cfb1f39f..0000000000000 --- a/dep/mysqllite/extra/yassl/taocrypt/src/dh.cpp +++ /dev/null @@ -1,103 +0,0 @@ -/* - 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/dep/mysqllite/extra/yassl/taocrypt/src/dsa.cpp b/dep/mysqllite/extra/yassl/taocrypt/src/dsa.cpp deleted file mode 100644 index 79ee91e76f92a..0000000000000 --- a/dep/mysqllite/extra/yassl/taocrypt/src/dsa.cpp +++ /dev/null @@ -1,271 +0,0 @@ -/* - 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/dep/mysqllite/extra/yassl/taocrypt/src/file.cpp b/dep/mysqllite/extra/yassl/taocrypt/src/file.cpp deleted file mode 100644 index 0498038a04ba9..0000000000000 --- a/dep/mysqllite/extra/yassl/taocrypt/src/file.cpp +++ /dev/null @@ -1,115 +0,0 @@ -/* - 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/dep/mysqllite/extra/yassl/taocrypt/src/hash.cpp b/dep/mysqllite/extra/yassl/taocrypt/src/hash.cpp deleted file mode 100644 index c51dc42a909f2..0000000000000 --- a/dep/mysqllite/extra/yassl/taocrypt/src/hash.cpp +++ /dev/null @@ -1,196 +0,0 @@ -/* - 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/dep/mysqllite/extra/yassl/taocrypt/src/integer.cpp b/dep/mysqllite/extra/yassl/taocrypt/src/integer.cpp deleted file mode 100644 index b054e98bef4c9..0000000000000 --- a/dep/mysqllite/extra/yassl/taocrypt/src/integer.cpp +++ /dev/null @@ -1,3970 +0,0 @@ -/* - 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: - struct dword_struct - { - #ifdef LITTLE_ENDIAN_ORDER - word low; - word high; - #else - word high; - word low; - #endif - }; - - union - { - #ifdef TAOCRYPT_NATIVE_DWORD_AVAILABLE - dword whole_; - #endif - struct dword_struct 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 \ - word res; \ - __asm__ __volatile__ \ - ( \ - "push %%ebx;" /* save this manually, in case of -fPIC */ \ - "mov %3, %%ebx;" \ - ".intel_syntax noprefix;" \ - "push ebp;" - #define AddEpilogue \ - "pop ebp;" \ - ".att_syntax prefix;" \ - "pop %%ebx;" \ - "mov %%eax, %0;" \ - : "=g" (res) \ - : "c" (C), "d" (A), "m" (B), "S" (N) \ - : "%edi", "memory", "cc" \ - ); \ - return res; - - #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/dep/mysqllite/extra/yassl/taocrypt/src/md4.cpp b/dep/mysqllite/extra/yassl/taocrypt/src/md4.cpp deleted file mode 100644 index cf17c21880978..0000000000000 --- a/dep/mysqllite/extra/yassl/taocrypt/src/md4.cpp +++ /dev/null @@ -1,157 +0,0 @@ -/* - 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/dep/mysqllite/extra/yassl/taocrypt/src/md5.cpp b/dep/mysqllite/extra/yassl/taocrypt/src/md5.cpp deleted file mode 100644 index f18e0290c90b3..0000000000000 --- a/dep/mysqllite/extra/yassl/taocrypt/src/md5.cpp +++ /dev/null @@ -1,498 +0,0 @@ -/* - 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/dep/mysqllite/extra/yassl/taocrypt/src/misc.cpp b/dep/mysqllite/extra/yassl/taocrypt/src/misc.cpp deleted file mode 100644 index 11dd4dc6d6664..0000000000000 --- a/dep/mysqllite/extra/yassl/taocrypt/src/misc.cpp +++ /dev/null @@ -1,299 +0,0 @@ -/* - 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 - - } - -#ifdef __sun - -// Handler for pure virtual functions -namespace __Crun { - void pure_error() { - assert(!"Aborted: pure virtual method called."); - } -} - -#endif - -#if defined(__ICC) || defined(__INTEL_COMPILER) || (__GNUC__ > 2) - -extern "C" { - - int __cxa_pure_virtual() { - assert(!"Aborted: pure virtual method called."); - 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 - - -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/dep/mysqllite/extra/yassl/taocrypt/src/random.cpp b/dep/mysqllite/extra/yassl/taocrypt/src/random.cpp deleted file mode 100644 index 2bbc0a85e8bc6..0000000000000 --- a/dep/mysqllite/extra/yassl/taocrypt/src/random.cpp +++ /dev/null @@ -1,199 +0,0 @@ -/* - 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) - #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/dep/mysqllite/extra/yassl/taocrypt/src/ripemd.cpp b/dep/mysqllite/extra/yassl/taocrypt/src/ripemd.cpp deleted file mode 100644 index a738c197bf2ad..0000000000000 --- a/dep/mysqllite/extra/yassl/taocrypt/src/ripemd.cpp +++ /dev/null @@ -1,834 +0,0 @@ -/* - 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/dep/mysqllite/extra/yassl/taocrypt/src/rsa.cpp b/dep/mysqllite/extra/yassl/taocrypt/src/rsa.cpp deleted file mode 100644 index 57d19a59c7609..0000000000000 --- a/dep/mysqllite/extra/yassl/taocrypt/src/rsa.cpp +++ /dev/null @@ -1,210 +0,0 @@ -/* - 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/dep/mysqllite/extra/yassl/taocrypt/src/sha.cpp b/dep/mysqllite/extra/yassl/taocrypt/src/sha.cpp deleted file mode 100644 index ef165a342ad09..0000000000000 --- a/dep/mysqllite/extra/yassl/taocrypt/src/sha.cpp +++ /dev/null @@ -1,1023 +0,0 @@ -/* - 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/dep/mysqllite/include/config-netware.h b/dep/mysqllite/include/config-netware.h deleted file mode 100644 index 4b9e14371704d..0000000000000 --- a/dep/mysqllite/include/config-netware.h +++ /dev/null @@ -1,162 +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 - -#define __event_h__ -#define _EVENT_H_ -/* - These two #define(s) are needed as both libc of NetWare and MySQL have - files named event.h which causes compilation errors. -*/ - - -/* required headers */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#undef _EVENT_H_ -/* - This #undef exists here because both libc of NetWare and MySQL have - files named event.h which causes compilation errors. -*/ - -#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 */ - -/* Changes made to make use of LibC-June-2005 for building purpose */ -#undef HAVE_GETPASS -#undef HAVE_GETRLIMIT -#undef HAVE_GETRUSAGE -#undef HAVE_INITGROUPS -/* Changes end - LibC-June-2005 */ - -/* 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 MYSQL_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/mysqllite/include/config-win.h b/dep/mysqllite/include/config-win.h deleted file mode 100644 index da9b1fc00c3fb..0000000000000 --- a/dep/mysqllite/include/config-win.h +++ /dev/null @@ -1,412 +0,0 @@ -/* 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 - -#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 -#include -#include - -#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 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 */ - -#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(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 -#ifndef HAVE_SIZE_T -typedef unsigned int size_t; -#endif -typedef uint rf_SetTimer; -#endif - -#define Socket_defined -#define my_socket SOCKET -#define SIGPIPE SIGINT -#define RETQSORTTYPE void -#define QSORT_TYPE_IS_VOID -#define RETSIGTYPE 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 MYSQL_CLIENT_NO_THREADS -#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 __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 - -/* 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 ULL(116444736000000000) - -#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 __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 -#ifndef CMAKE_CONFIGD -#define DEFAULT_MYSQL_HOME "c:\\mysql" -#define MYSQL_DATADIR "c:\\mysql\\data" -#define PACKAGE "mysql" -#define DEFAULT_BASEDIR "C:\\" -#define SHAREDIR "share" -#define DEFAULT_CHARSET_HOME "C:/mysql/" -#endif -#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)) -#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 - -/* - Our Windows binaries include all character sets which MySQL supports. - Any changes to the available character sets must also go into - config/ac-macros/character_sets.m4 -*/ - -#define MYSQL_DEFAULT_CHARSET_NAME "latin1" -#define MYSQL_DEFAULT_COLLATION_NAME "latin1_swedish_ci" - -#define USE_MB 1 -#define USE_MB_IDENT 1 -#define USE_STRCOLL 1 - -#define HAVE_CHARSET_armscii8 -#define HAVE_CHARSET_ascii -#define HAVE_CHARSET_big5 1 -#define HAVE_CHARSET_cp1250 1 -#define HAVE_CHARSET_cp1251 -#define HAVE_CHARSET_cp1256 -#define HAVE_CHARSET_cp1257 -#define HAVE_CHARSET_cp850 -#define HAVE_CHARSET_cp852 -#define HAVE_CHARSET_cp866 -#define HAVE_CHARSET_cp932 1 -#define HAVE_CHARSET_dec8 -#define HAVE_CHARSET_eucjpms 1 -#define HAVE_CHARSET_euckr 1 -#define HAVE_CHARSET_gb2312 1 -#define HAVE_CHARSET_gbk 1 -#define HAVE_CHARSET_geostd8 -#define HAVE_CHARSET_greek -#define HAVE_CHARSET_hebrew -#define HAVE_CHARSET_hp8 -#define HAVE_CHARSET_keybcs2 -#define HAVE_CHARSET_koi8r -#define HAVE_CHARSET_koi8u -#define HAVE_CHARSET_latin1 1 -#define HAVE_CHARSET_latin2 1 -#define HAVE_CHARSET_latin5 -#define HAVE_CHARSET_latin7 -#define HAVE_CHARSET_macce -#define HAVE_CHARSET_macroman -#define HAVE_CHARSET_sjis 1 -#define 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 -#define HAVE_BOOL 1 diff --git a/dep/mysqllite/include/config.h.in b/dep/mysqllite/include/config.h.in deleted file mode 100644 index 5e44fae23bec2..0000000000000 --- a/dep/mysqllite/include/config.h.in +++ /dev/null @@ -1,1352 +0,0 @@ -/* include/config.h.in. Generated from configure.in by autoheader. */ - -/* Define if building universal (internal helper macro) */ -#undef AC_APPLE_UNIVERSAL_BUILD - -/* Support big tables */ -#undef BIG_TABLES - -/* Whether features provided by the user community should be included */ -#undef COMMUNITY_SERVER - -/* 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 to 1 if using `alloca.c'. */ -#undef C_ALLOCA - -/* Don't use libdbug */ -#undef DBUG_OFF - -/* Use libdbug */ -#undef DBUG_ON - -/* all charsets are available */ -#undef DEFINE_ALL_CHARACTER_SETS - -/* Disables the use of --init-file, --skip-grant-tables and --bootstrap - options */ -#undef DISABLE_GRANT_OPTIONS - -/* Version of .frm files */ -#undef DOT_FRM_VERSION - -/* If Debug Sync Facility should be enabled */ -#undef ENABLED_DEBUG_SYNC - -/* If LOAD DATA LOCAL INFILE should be enabled by default */ -#undef ENABLED_LOCAL_INFILE - -/* If SHOW PROFILE should be enabled */ -#undef ENABLED_PROFILING - -/* Enable error injection in MySQL Server */ -#undef ERROR_INJECT_SUPPORT - -/* Do we have FIONREAD */ -#undef FIONREAD_IN_SYS_IOCTL - -/* READLINE: your system defines TIOCGWINSZ in sys/ioctl.h. */ -#undef GWINSZ_IN_SYS_IOCTL - -/* Define to 1 if you have the `abi::__cxa_demangle' function. */ -#undef HAVE_ABI_CXA_DEMANGLE - -/* Define to 1 if you have the header file. */ -#undef HAVE_AIO_H - -/* Define to 1 if you have the `alarm' function. */ -#undef HAVE_ALARM - -/* 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. */ -#undef HAVE_ARPA_INET_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_ASM_TERMBITS_H - -/* Define to 1 if you have the `atomic_add_long' function. */ -#undef HAVE_ATOMIC_ADD_LONG - -/* Define to 1 if you have the `atomic_cas_32' function. */ -#undef HAVE_ATOMIC_CAS_32 - -/* Define to 1 if you have the `atomic_cas_64' function. */ -#undef HAVE_ATOMIC_CAS_64 - -/* Define to 1 if you have the `atomic_cas_ulong' function. */ -#undef HAVE_ATOMIC_CAS_ULONG - -/* Define to 1 if you have the `backtrace' function. */ -#undef HAVE_BACKTRACE - -/* Define to 1 if you have the `backtrace_symbols' function. */ -#undef HAVE_BACKTRACE_SYMBOLS - -/* Define to 1 if you have the `backtrace_symbols_fd' function. */ -#undef HAVE_BACKTRACE_SYMBOLS_FD - -/* Define to 1 if you have the `bfill' function. */ -#undef HAVE_BFILL - -/* Define to 1 if you have the `bmove' function. */ -#undef HAVE_BMOVE - -/* bool is not defined by all C++ compilators */ -#undef HAVE_BOOL - -/* Define to 1 if isinf() uses 80-bit register for intermediate values */ -#undef HAVE_BROKEN_ISINF - -/* Can netinet be included */ -#undef HAVE_BROKEN_NETINET_INCLUDES - -/* BSD style signals */ -#undef HAVE_BSD_SIGNALS - -/* Define to 1 if you have the `bsearch' function. */ -#undef HAVE_BSEARCH - -/* Define to 1 if compiler defines __bss_start. */ -#undef HAVE_BSS_START - -/* Define to 1 if you have the `bzero' function. */ -#undef HAVE_BZERO - -/* Define to enable charset armscii8 */ -#undef HAVE_CHARSET_armscii8 - -/* Define to enable ascii character set */ -#undef HAVE_CHARSET_ascii - -/* Define to enable charset big5 */ -#undef HAVE_CHARSET_big5 - -/* Define to enable cp1250 */ -#undef HAVE_CHARSET_cp1250 - -/* Define to enable charset cp1251 */ -#undef HAVE_CHARSET_cp1251 - -/* Define to enable charset cp1256 */ -#undef HAVE_CHARSET_cp1256 - -/* Define to enable charset cp1257 */ -#undef HAVE_CHARSET_cp1257 - -/* Define to enable charset cp850 */ -#undef HAVE_CHARSET_cp850 - -/* Define to enable charset cp852 */ -#undef HAVE_CHARSET_cp852 - -/* Define to enable charset cp866 */ -#undef HAVE_CHARSET_cp866 - -/* Define to enable charset cp932 */ -#undef HAVE_CHARSET_cp932 - -/* Define to enable charset dec8 */ -#undef HAVE_CHARSET_dec8 - -/* Define to enable charset eucjpms */ -#undef HAVE_CHARSET_eucjpms - -/* Define to enable charset euckr */ -#undef HAVE_CHARSET_euckr - -/* Define to enable charset gb2312 */ -#undef HAVE_CHARSET_gb2312 - -/* Define to enable charset gbk */ -#undef HAVE_CHARSET_gbk - -/* Define to enable charset geostd8 */ -#undef HAVE_CHARSET_geostd8 - -/* Define to enable charset greek */ -#undef HAVE_CHARSET_greek - -/* Define to enable charset hebrew */ -#undef HAVE_CHARSET_hebrew - -/* Define to enable charset hp8 */ -#undef HAVE_CHARSET_hp8 - -/* Define to enable charset keybcs2 */ -#undef HAVE_CHARSET_keybcs2 - -/* Define to enable charset koi8r */ -#undef HAVE_CHARSET_koi8r - -/* Define to enable charset koi8u */ -#undef HAVE_CHARSET_koi8u - -/* Define to enable charset latin1 */ -#undef HAVE_CHARSET_latin1 - -/* Define to enable charset latin2 */ -#undef HAVE_CHARSET_latin2 - -/* Define to enable charset latin5 */ -#undef HAVE_CHARSET_latin5 - -/* Define to enable charset latin7 */ -#undef HAVE_CHARSET_latin7 - -/* Define to enable charset macce */ -#undef HAVE_CHARSET_macce - -/* Define to enable charset macroman */ -#undef HAVE_CHARSET_macroman - -/* Define to enable charset sjis */ -#undef HAVE_CHARSET_sjis - -/* Define to enable charset swe7 */ -#undef HAVE_CHARSET_swe7 - -/* Define to enable charset tis620 */ -#undef HAVE_CHARSET_tis620 - -/* Define to enable charset ucs2 */ -#undef HAVE_CHARSET_ucs2 - -/* Define to enable charset ujis */ -#undef HAVE_CHARSET_ujis - -/* Define to enable ut8 */ -#undef HAVE_CHARSET_utf8 - -/* Define to 1 if you have the `chsize' function. */ -#undef HAVE_CHSIZE - -/* Define to 1 if you have the `clock_gettime' function. */ -#undef HAVE_CLOCK_GETTIME - -/* Define to enable compression support */ -#undef HAVE_COMPRESS - -/* crypt */ -#undef HAVE_CRYPT - -/* Define to 1 if you have the header file. */ -#undef HAVE_CRYPT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_CURSES_H - -/* Define to 1 if you have the `cuserid' function. */ -#undef HAVE_CUSERID - -/* Define to 1 if you have the header file. */ -#undef HAVE_CXXABI_H - -/* Define to 1 if you have the declaration of `madvise', and to 0 if you - don't. */ -#undef HAVE_DECL_MADVISE - -/* Define to 1 if you have the declaration of `SHM_HUGETLB', and to 0 if you - don't. */ -#undef HAVE_DECL_SHM_HUGETLB - -/* Define to 1 if you have the declaration of `tgoto', and to 0 if you don't. - */ -#undef HAVE_DECL_TGOTO - -/* Whether we are using DEC threads */ -#undef HAVE_DEC_THREADS - -/* Define to 1 if you have the header file. */ -#undef HAVE_DIRENT_H - -/* Define to 1 if you have the `dlerror' function. */ -#undef HAVE_DLERROR - -/* Define to 1 if you have the header file. */ -#undef HAVE_DLFCN_H - -/* Define to 1 if you have the `dlopen' function. */ -#undef HAVE_DLOPEN - -/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ -#undef HAVE_DOPRNT - -/* Access checks in embedded library */ -#undef HAVE_EMBEDDED_PRIVILEGE_CONTROL - -/* Define to 1 if you have the header file. */ -#undef HAVE_EXECINFO_H - -/* Defined by configure. Use explicit template instantiation. */ -#undef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION - -/* Define to 1 if you have the `fchmod' function. */ -#undef HAVE_FCHMOD - -/* Define to 1 if you have the `fcntl' function. */ -#undef HAVE_FCNTL - -/* Define to 1 if you have the header file. */ -#undef HAVE_FCNTL_H - -/* Define to 1 if you have the `fconvert' function. */ -#undef HAVE_FCONVERT - -/* Define to 1 if you have the `fdatasync' function. */ -#undef HAVE_FDATASYNC - -/* Define to 1 if you have the header file. */ -#undef HAVE_FENV_H - -/* Define to 1 if you have the `fesetround' function. */ -#undef HAVE_FESETROUND - -/* Define to 1 if you have the `fgetln' function. */ -#undef HAVE_FGETLN - -/* Define to 1 if you have the `finite' function. */ -#undef HAVE_FINITE - -/* Define to 1 if you have the header file. */ -#undef HAVE_FLOATINGPOINT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_FLOAT_H - -/* Define to 1 if you have the `flockfile' function. */ -#undef HAVE_FLOCKFILE - -/* Define to 1 if you have the `fpresetsticky' function. */ -#undef HAVE_FPRESETSTICKY - -/* Define to 1 if you have the `fpsetmask' function. */ -#undef HAVE_FPSETMASK - -/* Define to 1 if you have the header file. */ -#undef HAVE_FPU_CONTROL_H - -/* Define to 1 if the system has the type `fp_except'. */ -#undef HAVE_FP_EXCEPT - -/* Define to 1 if you have the `fsync' function. */ -#undef HAVE_FSYNC - -/* Define to 1 if you have the `ftruncate' function. */ -#undef HAVE_FTRUNCATE - -/* Define to 1 if compiler provides atomic builtins. */ -#undef HAVE_GCC_ATOMIC_BUILTINS - -/* Define to 1 if you have the `getcwd' function. */ -#undef HAVE_GETCWD - -/* Define to 1 if you have the `gethostbyaddr_r' function. */ -#undef HAVE_GETHOSTBYADDR_R - -/* Define to 1 if you have the `gethostbyname_r' function. */ -#undef HAVE_GETHOSTBYNAME_R - -/* 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 gethostbyname_r is hostent_data * */ -#undef HAVE_GETHOSTBYNAME_R_RETURN_INT - -/* Define to 1 if you have the `gethrtime' function. */ -#undef HAVE_GETHRTIME - -/* Define to 1 if you have the `getline' function. */ -#undef HAVE_GETLINE - -/* Define to 1 if you have the `getpagesize' function. */ -#undef HAVE_GETPAGESIZE - -/* Define to 1 if you have the `getpass' function. */ -#undef HAVE_GETPASS - -/* Define to 1 if you have the `getpassphrase' function. */ -#undef HAVE_GETPASSPHRASE - -/* Define to 1 if you have the `getpwnam' function. */ -#undef HAVE_GETPWNAM - -/* Define to 1 if you have the `getpwuid' function. */ -#undef HAVE_GETPWUID - -/* getpwent() declaration present */ -#undef HAVE_GETPW_DECLS - -/* Define to 1 if you have the `getrlimit' function. */ -#undef HAVE_GETRLIMIT - -/* Define to 1 if you have the `getrusage' function. */ -#undef HAVE_GETRUSAGE - -/* Define to 1 if you have the `getwd' function. */ -#undef HAVE_GETWD - -/* Define to 1 if you have the `gmtime_r' function. */ -#undef HAVE_GMTIME_R - -/* Define to 1 if you have the header file. */ -#undef HAVE_GRP_H - -/* HIST_ENTRY is defined in the outer libeditreadline */ -#undef HAVE_HIST_ENTRY - -/* pthread_t can be used by GCC atomic builtins */ -#undef HAVE_IB_ATOMIC_PTHREAD_T_GCC - -/* pthread_t can be used by solaris atomics */ -#undef HAVE_IB_ATOMIC_PTHREAD_T_SOLARIS - -/* GCC atomic builtins are available */ -#undef HAVE_IB_GCC_ATOMIC_BUILTINS - -/* Does x86 PAUSE instruction exist */ -#undef HAVE_IB_PAUSE_INSTRUCTION - -/* Define to 1 if Solaris libc atomic functions are available */ -#undef HAVE_IB_SOLARIS_ATOMICS - -/* Define to 1 if you have the header file. */ -#undef HAVE_IEEEFP_H - -/* Define to 1 if you have the `index' function. */ -#undef HAVE_INDEX - -/* Define to 1 if you have the `initgroups' function. */ -#undef HAVE_INITGROUPS - -/* Define to 1 if the system has the type `int16'. */ -#undef HAVE_INT16 - -/* Define to 1 if the system has the type `int32'. */ -#undef HAVE_INT32 - -/* Define to 1 if the system has the type `int64'. */ -#undef HAVE_INT64 - -/* Define to 1 if the system has the type `int8'. */ -#undef HAVE_INT8 - -/* Define to 1 if you have the header file. */ -#undef HAVE_INTTYPES_H - -/* Define to 1 if the system has the type `in_addr_t'. */ -#undef HAVE_IN_ADDR_T - -/* isinf() macro or function */ -#undef HAVE_ISINF - -/* Define to 1 if you have the `isnan' function. */ -#undef HAVE_ISNAN - -/* Define to 1 if you have the `issetugid' function. */ -#undef HAVE_ISSETUGID - -/* Define to 1 if you have the `iswctype' function. */ -#undef HAVE_ISWCTYPE - -/* Define to 1 if you have the `iswlower' function. */ -#undef HAVE_ISWLOWER - -/* Define to 1 if you have the `iswupper' function. */ -#undef HAVE_ISWUPPER - -/* Define if mysql_cv_langinfo_codeset=yes */ -#undef HAVE_LANGINFO_CODESET - -/* Define to 1 if you have the header file. */ -#undef HAVE_LANGINFO_H - -/* Define if you have large pages support */ -#undef HAVE_LARGE_PAGES - -/* Define to 1 if you have the `c_r' library (-lc_r). */ -#undef HAVE_LIBC_R - -/* Define to 1 if you have the `dl' library (-ldl). */ -#undef HAVE_LIBDL - -/* Define to 1 if you have the `m' library (-lm). */ -#undef HAVE_LIBM - -/* Define to 1 if you have the `nsl' library (-lnsl). */ -#undef HAVE_LIBNSL - -/* Define to 1 if you have the `nsl_r' library (-lnsl_r). */ -#undef HAVE_LIBNSL_R - -/* Define to 1 if you have the `pthread' library (-lpthread). */ -#undef HAVE_LIBPTHREAD - -/* Define if have -lwrap */ -#undef HAVE_LIBWRAP - -/* Define to 1 if you have the header file. */ -#undef HAVE_LIMITS_H - -/* Whether we are using Xavier Leroy's LinuxThreads */ -#undef HAVE_LINUXTHREADS - -/* Define to 1 if you have the header file. */ -#undef HAVE_LINUX_CONFIG_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LOCALE_H - -/* Define to 1 if you have the `localtime_r' function. */ -#undef HAVE_LOCALTIME_R - -/* Define to 1 if you have the `locking' function. */ -#undef HAVE_LOCKING - -/* Define to 1 if you have the `longjmp' function. */ -#undef HAVE_LONGJMP - -/* Define to 1 if you have the `lrand48' function. */ -#undef HAVE_LRAND48 - -/* Define to 1 if you have the `lstat' function. */ -#undef HAVE_LSTAT - -/* Define to 1 if you have the `madvise' function. */ -#undef HAVE_MADVISE - -/* Define to 1 if you have the `mallinfo' function. */ -#undef HAVE_MALLINFO - -/* Define to 1 if you have the header file. */ -#undef HAVE_MALLOC_H - -/* Define if you have mbrlen */ -#undef HAVE_MBRLEN - -/* Define if you have mbrtowc */ -#undef HAVE_MBRTOWC - -/* Define if you have mbscmp */ -#undef HAVE_MBSCMP - -/* Define if you have mbsrtowcs */ -#undef HAVE_MBSRTOWCS - -/* Define if mysql_cv_have_mbstate_t=yes */ -#undef HAVE_MBSTATE_T - -/* Define to 1 if you have the `memcpy' function. */ -#undef HAVE_MEMCPY - -/* Define to 1 if you have the `memmove' function. */ -#undef HAVE_MEMMOVE - -/* Define to 1 if you have the header file. */ -#undef HAVE_MEMORY_H - -/* Define to 1 if you have the `mkstemp' function. */ -#undef HAVE_MKSTEMP - -/* Define to 1 if you have the `mlockall' function. */ -#undef HAVE_MLOCKALL - -/* Define to 1 if you have the `mmap' function. */ -#undef HAVE_MMAP - -/* Define to 1 if you have the `mmap64' function. */ -#undef HAVE_MMAP64 - -/* Define to 1 if you have the header file. */ -#undef HAVE_NDIR_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NETINET_IN_H - -/* For some non posix threads */ -#undef HAVE_NONPOSIX_PTHREAD_GETSPECIFIC - -/* For some non posix threads */ -#undef HAVE_NONPOSIX_PTHREAD_MUTEX_INIT - -/* sigwait with one argument */ -#undef HAVE_NONPOSIX_SIGWAIT - -/* NPTL threads implementation */ -#undef HAVE_NPTL - -/* Define to 1 if the system has the type `off_t'. */ -#undef HAVE_OFF_T - -/* OpenSSL */ -#undef HAVE_OPENSSL - -/* Define to 1 if you have the header file. */ -#undef HAVE_PATHS_H - -/* Define to 1 if you have the `perror' function. */ -#undef HAVE_PERROR - -/* Define to 1 if you have the `poll' function. */ -#undef HAVE_POLL - -/* Define to 1 if you have the `port_create' function. */ -#undef HAVE_PORT_CREATE - -/* Define to 1 if you have the header file. */ -#undef HAVE_PORT_H - -/* Define to 1 if you have the `posix_fallocate' function. */ -#undef HAVE_POSIX_FALLOCATE - -/* Signal handling is POSIX (sigset/sighold, etc) */ -#undef HAVE_POSIX_SIGNALS - -/* Define to 1 if you have the `pread' function. */ -#undef HAVE_PREAD - -/* Define to 1 if you have the `printstack' function. */ -#undef HAVE_PRINTSTACK - -/* Define to 1 if you have the `pthread_attr_create' function. */ -#undef HAVE_PTHREAD_ATTR_CREATE - -/* Define to 1 if you have the `pthread_attr_getstacksize' function. */ -#undef HAVE_PTHREAD_ATTR_GETSTACKSIZE - -/* Define to 1 if you have the `pthread_attr_setprio' function. */ -#undef HAVE_PTHREAD_ATTR_SETPRIO - -/* Define to 1 if you have the `pthread_attr_setschedparam' function. */ -#undef HAVE_PTHREAD_ATTR_SETSCHEDPARAM - -/* pthread_attr_setscope */ -#undef HAVE_PTHREAD_ATTR_SETSCOPE - -/* Define to 1 if you have the `pthread_attr_setstacksize' function. */ -#undef HAVE_PTHREAD_ATTR_SETSTACKSIZE - -/* Define to 1 if you have the `pthread_condattr_create' function. */ -#undef HAVE_PTHREAD_CONDATTR_CREATE - -/* Define to 1 if you have the `pthread_getsequence_np' function. */ -#undef HAVE_PTHREAD_GETSEQUENCE_NP - -/* Define to 1 if you have the `pthread_init' function. */ -#undef HAVE_PTHREAD_INIT - -/* Define to 1 if you have the `pthread_key_delete' function. */ -#undef HAVE_PTHREAD_KEY_DELETE - -/* Define to 1 if you have the `pthread_rwlock_rdlock' function. */ -#undef HAVE_PTHREAD_RWLOCK_RDLOCK - -/* Define to 1 if you have the `pthread_setprio' function. */ -#undef HAVE_PTHREAD_SETPRIO - -/* Define to 1 if you have the `pthread_setprio_np' function. */ -#undef HAVE_PTHREAD_SETPRIO_NP - -/* Define to 1 if you have the `pthread_setschedparam' function. */ -#undef HAVE_PTHREAD_SETSCHEDPARAM - -/* Define to 1 if you have the `pthread_setschedprio' function. */ -#undef HAVE_PTHREAD_SETSCHEDPRIO - -/* Define to 1 if you have the `pthread_sigmask' function. */ -#undef HAVE_PTHREAD_SIGMASK - -/* pthread_yield function with one argument */ -#undef HAVE_PTHREAD_YIELD_ONE_ARG - -/* pthread_yield that doesn't take any arguments */ -#undef HAVE_PTHREAD_YIELD_ZERO_ARG - -/* Define to 1 if you have the `putenv' function. */ -#undef HAVE_PUTENV - -/* Define to 1 if you have the header file. */ -#undef HAVE_PWD_H - -/* If we want to have query cache */ -#undef HAVE_QUERY_CACHE - -/* POSIX readdir_r */ -#undef HAVE_READDIR_R - -/* Define to 1 if you have the `readlink' function. */ -#undef HAVE_READLINK - -/* Define to 1 if you have the `realpath' function. */ -#undef HAVE_REALPATH - -/* Define to 1 if you have the `regcomp' function. */ -#undef HAVE_REGCOMP - -/* Define to 1 if you have the `rename' function. */ -#undef HAVE_RENAME - -/* Define to 1 if system calls automatically restart after interruption by a - signal. */ -#undef HAVE_RESTARTABLE_SYSCALLS - -/* Define to 1 if you have the `re_comp' function. */ -#undef HAVE_RE_COMP - -/* Define to 1 if you have the `rint' function. */ -#undef HAVE_RINT - -/* RTree keys */ -#undef HAVE_RTREE_KEYS - -/* Define to 1 if you have the `rwlock_init' function. */ -#undef HAVE_RWLOCK_INIT - -/* Define to 1 if you have the header file. */ -#undef HAVE_SCHED_H - -/* Define to 1 if you have the `sched_yield' function. */ -#undef HAVE_SCHED_YIELD - -/* Define to 1 if you have the `select' function. */ -#undef HAVE_SELECT - -/* Define to 1 if you have the header file. */ -#undef HAVE_SELECT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SEMAPHORE_H - -/* Define to 1 if you have the `setenv' function. */ -#undef HAVE_SETENV - -/* Define to 1 if you have the `setlocale' function. */ -#undef HAVE_SETLOCALE - -/* Define to 1 if you have the `setupterm' function. */ -#undef HAVE_SETUPTERM - -/* Define to 1 if you have the `shmat' function. */ -#undef HAVE_SHMAT - -/* Define to 1 if you have the `shmctl' function. */ -#undef HAVE_SHMCTL - -/* Define to 1 if you have the `shmdt' function. */ -#undef HAVE_SHMDT - -/* Define to 1 if you have the `shmget' function. */ -#undef HAVE_SHMGET - -/* Define to 1 if you have the `sigaction' function. */ -#undef HAVE_SIGACTION - -/* Define to 1 if you have the `sigaddset' function. */ -#undef HAVE_SIGADDSET - -/* Define to 1 if you have the `sigemptyset' function. */ -#undef HAVE_SIGEMPTYSET - -/* Define to 1 if you have the `sighold' function. */ -#undef HAVE_SIGHOLD - -/* Define to 1 if you have the `sigset' function. */ -#undef HAVE_SIGSET - -/* Define to 1 if the system has the type `sigset_t'. */ -#undef HAVE_SIGSET_T - -/* Define to 1 if you have the `sigthreadmask' function. */ -#undef HAVE_SIGTHREADMASK - -/* POSIX sigwait */ -#undef HAVE_SIGWAIT - -/* Define to 1 if the system has the type `size_t'. */ -#undef HAVE_SIZE_T - -/* Define to 1 if you have the `sleep' function. */ -#undef HAVE_SLEEP - -/* Define to 1 if you have the `snprintf' function. */ -#undef HAVE_SNPRINTF - -/* Define to 1 if you have the `socket' function. */ -#undef HAVE_SOCKET - -/* Solaris define gethostbyaddr_r with 7 arguments. glibc2 defines this with 8 - arguments */ -#undef HAVE_SOLARIS_STYLE_GETHOST - -/* Spatial extentions */ -#undef HAVE_SPATIAL - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDARG_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDDEF_H - -/* 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 `stpcpy' function. */ -#undef HAVE_STPCPY - -/* Define to 1 if you have the `strcasecmp' function. */ -#undef HAVE_STRCASECMP - -/* Define to 1 if you have the `strcoll' function. */ -#undef HAVE_STRCOLL - -/* Define to 1 if you have the `strdup' function. */ -#undef HAVE_STRDUP - -/* Define to 1 if you have the `strerror' function. */ -#undef HAVE_STRERROR - -/* 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 `strlcat' function. */ -#undef HAVE_STRLCAT - -/* Define to 1 if you have the `strlcpy' function. */ -#undef HAVE_STRLCPY - -/* Define to 1 if you have the `strnlen' function. */ -#undef HAVE_STRNLEN - -/* Define to 1 if you have the `strpbrk' function. */ -#undef HAVE_STRPBRK - -/* Define to 1 if you have the `strsignal' function. */ -#undef HAVE_STRSIGNAL - -/* Define to 1 if you have the `strstr' function. */ -#undef HAVE_STRSTR - -/* Define to 1 if you have the `strtok_r' function. */ -#undef HAVE_STRTOK_R - -/* Define to 1 if you have the `strtol' function. */ -#undef HAVE_STRTOL - -/* Define to 1 if you have the `strtoll' function. */ -#undef HAVE_STRTOLL - -/* Define to 1 if you have the `strtoul' function. */ -#undef HAVE_STRTOUL - -/* Define to 1 if you have the `strtoull' function. */ -#undef HAVE_STRTOULL - -/* Define to 1 if `st_rdev' is member of `struct stat'. */ -#undef HAVE_STRUCT_STAT_ST_RDEV - -/* Define to 1 if your `struct stat' has `st_rdev'. Deprecated, use - `HAVE_STRUCT_STAT_ST_RDEV' instead. */ -#undef HAVE_ST_RDEV - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYNCH_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_CDEFS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_DIR_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_FILE_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_IOCTL_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_IPC_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_MALLOC_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_MMAN_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_NDIR_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_PARAM_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_PRCTL_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_PTEM_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_PTE_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_RESOURCE_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_SELECT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_SHM_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_SOCKET_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_STREAM_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TIMEB_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_UN_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_UTIME_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_VADVISE_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_WAIT_H - -/* Define to 1 if you have the `tcgetattr' function. */ -#undef HAVE_TCGETATTR - -/* Define to 1 if you have the `tell' function. */ -#undef HAVE_TELL - -/* Define to 1 if you have the `tempnam' function. */ -#undef HAVE_TEMPNAM - -/* Define to 1 if you have the header file. */ -#undef HAVE_TERMBITS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_TERMCAP_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_TERMIOS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_TERMIO_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_TERM_H - -/* Define to 1 if you have the `thr_setconcurrency' function. */ -#undef HAVE_THR_SETCONCURRENCY - -/* Timespec has a ts_sec instead of tv_sev */ -#undef HAVE_TIMESPEC_TS_SEC - -/* Define to 1 if you have the `towlower' function. */ -#undef HAVE_TOWLOWER - -/* Define to 1 if you have the `towupper' function. */ -#undef HAVE_TOWUPPER - -/* Have the tzname variable */ -#undef HAVE_TZNAME - -/* national Unicode collations */ -#undef HAVE_UCA_COLLATIONS - -/* Define to 1 if the system has the type `uchar'. */ -#undef HAVE_UCHAR - -/* Define to 1 if the system has the type `uint'. */ -#undef HAVE_UINT - -/* Define to 1 if the system has the type `uint16'. */ -#undef HAVE_UINT16 - -/* Define to 1 if the system has the type `uint32'. */ -#undef HAVE_UINT32 - -/* Define to 1 if the system has the type `uint64'. */ -#undef HAVE_UINT64 - -/* Define to 1 if the system has the type `uint8'. */ -#undef HAVE_UINT8 - -/* Define to 1 if the system has the type `ulong'. */ -#undef HAVE_ULONG - -/* Define to 1 if you have the header file. */ -#undef HAVE_UNISTD_H - -/* Have UnixWare 7 (or similar) almost-POSIX threading library */ -#undef HAVE_UNIXWARE7_THREADS - -/* sighold() is present and usable */ -#undef HAVE_USG_SIGHOLD - -/* certain Japanese customer */ -#undef HAVE_UTF8_GENERAL_CS - -/* Define to 1 if you have the header file. */ -#undef HAVE_UTIME_H - -/* Define to 1 if `utime(file, NULL)' sets file's timestamp to the present. */ -#undef HAVE_UTIME_NULL - -/* Define to 1 if the system has the type `u_int32_t'. */ -#undef HAVE_U_INT32_T - -/* Define for Valgrind support */ -#undef HAVE_VALGRIND - -/* Define to 1 if you have the header file. */ -#undef HAVE_VALGRIND_MEMCHECK_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_VALGRIND_VALGRIND_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_VARARGS_H - -/* Define to 1 if you have the `vidattr' function. */ -#undef HAVE_VIDATTR - -/* Define to enable buffered read. This works only if syscalls read/recv - return as soon as there is some data in the kernel buffer, no matter how - big the given buffer is. */ -#undef HAVE_VIO_READ_BUFF - -/* Found vis.h and the strvis() function */ -#undef HAVE_VIS_H - -/* Define to 1 if you have the `vprintf' function. */ -#undef HAVE_VPRINTF - -/* Define to 1 if you have the header file. */ -#undef HAVE_WCHAR_H - -/* systems should define this type here */ -#undef HAVE_WCHAR_T - -/* Define if you have wcrtomb */ -#undef HAVE_WCRTOMB - -/* Define if you have wcscoll */ -#undef HAVE_WCSCOLL - -/* Define if you have wcsdup */ -#undef HAVE_WCSDUP - -/* Define if you have wctype */ -#undef HAVE_WCTYPE - -/* Define to 1 if you have the header file. */ -#undef HAVE_WCTYPE_H - -/* systems should define this type here */ -#undef HAVE_WCTYPE_T - -/* Define if you have wcwidth */ -#undef HAVE_WCWIDTH - -/* Define to 1 if compiler supports weak symbol attribute. */ -#undef HAVE_WEAK_SYMBOL - -/* systems should define this type here */ -#undef HAVE_WINT_T - -/* Define to 1 if you have the header file. */ -#undef HAVE_XFS_XFS_H - -/* Defined by configure. Using yaSSL for SSL. */ -#undef HAVE_YASSL - -/* Define if /proc/meminfo shows the huge page size (Linux only) */ -#undef HUGETLB_USE_PROC_MEMINFO - -/* Define if you have -lwrap */ -#undef LIBWRAP - -/* Define to the sub-directory in which libtool stores uninstalled libraries. - */ -#undef LT_OBJDIR - -/* Machine type name, eg sparc */ -#undef MACHINE_TYPE - -/* Maximum number of indexes per table */ -#undef MAX_INDEXES - -/* Define the default charset name */ -#undef MYSQL_DEFAULT_CHARSET_NAME - -/* Define the default charset name */ -#undef MYSQL_DEFAULT_COLLATION_NAME - -/* Assume single-CPU mode, no concurrency */ -#undef MY_ATOMIC_MODE_DUMMY - -/* Use pthread rwlocks for atomic ops */ -#undef MY_ATOMIC_MODE_RWLOCKS - -/* Define to 1 if you want to use fast mutexes */ -#undef MY_PTHREAD_FASTMUTEX - -/* Including Ndb Cluster DB sci transporter */ -#undef NDB_SCI_TRANSPORTER - -/* Including Ndb Cluster DB shared memory transporter */ -#undef NDB_SHM_TRANSPORTER - -/* NDB build version */ -#undef NDB_VERSION_BUILD - -/* NDB major version */ -#undef NDB_VERSION_MAJOR - -/* NDB minor version */ -#undef NDB_VERSION_MINOR - -/* NDB status version */ -#undef NDB_VERSION_STATUS - -/* Name of package */ -#undef PACKAGE - -/* 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 - -/* mysql client protocol version */ -#undef PROTOCOL_VERSION - -/* qsort returns void */ -#undef QSORT_TYPE_IS_VOID - -/* The return type of qsort (int or void). */ -#undef RETQSORTTYPE - -/* Define as the return type of signal handlers (`int' or `void'). */ -#undef RETSIGTYPE - -/* The size of `char', as computed by sizeof. */ -#undef SIZEOF_CHAR - -/* The size of `char*', as computed by sizeof. */ -#undef SIZEOF_CHARP - -/* 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 long', as computed by sizeof. */ -#undef SIZEOF_LONG_LONG - -/* The size of `off_t', as computed by sizeof. */ -#undef SIZEOF_OFF_T - -/* The size of `pthread_t', as computed by sizeof. */ -#undef SIZEOF_PTHREAD_T - -/* The size of `short', as computed by sizeof. */ -#undef SIZEOF_SHORT - -/* The size of `void*', as computed by sizeof. */ -#undef SIZEOF_VOIDP - -/* The base type of the last arg to accept */ -#undef SOCKET_SIZE_TYPE - -/* Last argument to get/setsockopt */ -#undef SOCKOPT_OPTLEN_TYPE - -/* 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 the `S_IS*' macros in do not work properly. */ -#undef STAT_MACROS_BROKEN - -/* Define to 1 if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* d_ino member present in struct dirent */ -#undef STRUCT_DIRENT_HAS_D_INO - -/* d_namlen member present in struct dirent */ -#undef STRUCT_DIRENT_HAS_D_NAMLEN - -/* The struct rlimit type to use with setrlimit */ -#undef STRUCT_RLIMIT - -/* Name of system, eg sun-solaris */ -#undef SYSTEM_TYPE - -/* Whether we build for Linux */ -#undef TARGET_OS_LINUX - -/* Define if you want to have threaded code. This may be undef on client code - */ -#undef THREAD - -/* Should the client be thread safe */ -#undef THREAD_SAFE_CLIENT - -/* Define to 1 if time_t is unsigned */ -#undef TIME_T_UNSIGNED - -/* Define to 1 if you can safely include both and . */ -#undef TIME_WITH_SYS_TIME - -/* declaration of TIOCSTAT in sys/ioctl.h */ -#undef TIOCSTAT_IN_SYS_IOCTL - -/* Define to 1 if your declares `struct tm'. */ -#undef TM_IN_SYS_TIME - -/* used libedit interface (can we dereference result of - rl_completion_entry_function) */ -#undef USE_LIBEDIT_INTERFACE - -/* Use multi-byte character routines */ -#undef USE_MB - -/* */ -#undef USE_MB_IDENT - -/* Needs to use mysys_new helpers */ -#undef USE_MYSYS_NEW - -/* used new readline interface (are rl_completion_func_t and - rl_compentry_func_t defined) */ -#undef USE_NEW_READLINE_INTERFACE - -/* the pstack backtrace library */ -#undef USE_PSTACK - -/* Version number of package */ -#undef VERSION - -/* sighandler type is void (*signal ()) (); */ -#undef VOID_SIGHANDLER - -/* Include Archive Storage Engine into mysqld */ -#undef WITH_ARCHIVE_STORAGE_ENGINE - -/* Include Basic Write-only Read-never tables into mysqld */ -#undef WITH_BLACKHOLE_STORAGE_ENGINE - -/* Include Stores tables in text CSV format into mysqld */ -#undef WITH_CSV_STORAGE_ENGINE - -/* Include Example for Storage Engines for developers into mysqld */ -#undef WITH_EXAMPLE_STORAGE_ENGINE - -/* Include Connects to tables on remote MySQL servers into mysqld */ -#undef WITH_FEDERATED_STORAGE_ENGINE - -/* Include Volatile memory based tables into mysqld */ -#undef WITH_HEAP_STORAGE_ENGINE - -/* Include IBM DB2 for i Storage Engine into mysqld */ -#undef WITH_IBMDB2I_STORAGE_ENGINE - -/* Include Transactional Tables using InnoDB into mysqld */ -#undef WITH_INNOBASE_STORAGE_ENGINE - -/* Include Transactional Tables using InnoDB into mysqld */ -#undef WITH_INNODB_PLUGIN_STORAGE_ENGINE - -/* Include Merge multiple MySQL tables into one into mysqld */ -#undef WITH_MYISAMMRG_STORAGE_ENGINE - -/* Include Traditional non-transactional MySQL tables into mysqld */ -#undef WITH_MYISAM_STORAGE_ENGINE - -/* Include High Availability Clustered tables into mysqld */ -#undef WITH_NDBCLUSTER_STORAGE_ENGINE - -/* Including Ndb Cluster Binlog */ -#undef WITH_NDB_BINLOG - -/* Include MySQL Partitioning Support into mysqld */ -#undef WITH_PARTITION_STORAGE_ENGINE - -/* 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 - -/* Number of bits in a file offset, on hosts where this is settable. */ -#undef _FILE_OFFSET_BITS - -/* makes fseeko etc. visible, on some hosts. */ -#undef _LARGEFILE_SOURCE - -/* Large files support on AIX-style hosts. */ -#undef _LARGE_FILES - -/* Define to empty if `const' does not conform to ANSI C. */ -#undef const - -/* 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 -#undef inline -#endif - -/* Define to `long int' if does not define. */ -#undef off_t - -/* Define to `unsigned int' if does not define. */ -#undef size_t diff --git a/dep/mysqllite/include/errmsg.h b/dep/mysqllite/include/errmsg.h index a6d8c770de889..f1d7dd65f9781 100644 --- a/dep/mysqllite/include/errmsg.h +++ b/dep/mysqllite/include/errmsg.h @@ -1,3 +1,6 @@ +#ifndef ERRMSG_INCLUDED +#define ERRMSG_INCLUDED + /* Copyright (C) 2000 MySQL AB This program is free software; you can redistribute it and/or modify @@ -97,6 +100,9 @@ extern const char *client_errors[]; /* Error messages */ #define CR_SERVER_LOST_EXTENDED 2055 #define CR_STMT_CLOSED 2056 #define CR_NEW_STMT_METADATA 2057 -#define CR_ERROR_LAST /*Copy last error nr:*/ 2057 +#define CR_ALREADY_CONNECTED 2058 +#define CR_AUTH_PLUGIN_CANNOT_LOAD 2059 +#define CR_ERROR_LAST /*Copy last error nr:*/ 2059 /* Add error numbers before CR_ERROR_LAST and change it accordingly. */ +#endif /* ERRMSG_INCLUDED */ diff --git a/dep/mysqllite/include/ft_global.h b/dep/mysqllite/include/ft_global.h deleted file mode 100644 index 752371d6bc66d..0000000000000 --- a/dep/mysqllite/include/ft_global.h +++ /dev/null @@ -1,71 +0,0 @@ -/* 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 */ - -/* Written by Sergei A. Golubchik, who has a shared copyright to this code */ - -/* some definitions for full-text indices */ - -/* #include "myisam.h" */ - -#ifndef _ft_global_h -#define _ft_global_h -#ifdef __cplusplus -extern "C" { -#endif - -#define HA_FT_MAXBYTELEN 254 -#define HA_FT_MAXCHARLEN (HA_FT_MAXBYTELEN/3) - -typedef struct st_ft_info FT_INFO; -struct _ft_vft -{ - int (*read_next)(FT_INFO *, char *); - float (*find_relevance)(FT_INFO *, uchar *, uint); - void (*close_search)(FT_INFO *); - float (*get_relevance)(FT_INFO *); - void (*reinit_search)(FT_INFO *); -}; - -#ifndef FT_CORE -struct st_ft_info -{ - struct _ft_vft *please; /* INTERCAL style :-) */ -}; -#endif - -extern const char *ft_stopword_file; -extern const char *ft_precompiled_stopwords[]; - -extern ulong ft_min_word_len; -extern ulong ft_max_word_len; -extern ulong ft_query_expansion_limit; -extern char ft_boolean_syntax[15]; -extern struct st_mysql_ftparser ft_default_parser; - -int ft_init_stopwords(void); -void ft_free_stopwords(void); - -#define FT_NL 0 -#define FT_BOOL 1 -#define FT_SORTED 2 -#define FT_EXPAND 4 /* query expansion */ - -FT_INFO *ft_init_search(uint,void *, uint, uchar *, uint,CHARSET_INFO *, uchar *); -my_bool ft_boolean_check_syntax_string(const uchar *); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/dep/mysqllite/include/heap.h b/dep/mysqllite/include/heap.h deleted file mode 100644 index 4a1c7d419ed95..0000000000000 --- a/dep/mysqllite/include/heap.h +++ /dev/null @@ -1,256 +0,0 @@ -/* 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; version 2 of the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - 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 should be included when using heap_database_functions */ -/* Author: Michael Widenius */ - -#ifndef _heap_h -#define _heap_h -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef _my_base_h -#include -#endif -#ifdef THREAD -#include -#include -#endif - -#include "my_handler.h" -#include "my_tree.h" - - /* defines used by heap-funktions */ - -#define HP_MAX_LEVELS 4 /* 128^5 records is enough */ -#define HP_PTRS_IN_NOD 128 - - /* struct used with heap_funktions */ - -typedef struct st_heapinfo /* Struct from heap_info */ -{ - ulong records; /* Records in database */ - ulong deleted; /* Deleted records in database */ - ulong max_records; - ulonglong data_length; - ulonglong index_length; - uint reclength; /* Length of one record */ - int errkey; - ulonglong auto_increment; -} HEAPINFO; - - - /* Structs used by heap-database-handler */ - -typedef struct st_heap_ptrs -{ - uchar *blocks[HP_PTRS_IN_NOD]; /* pointers to HP_PTRS or records */ -} HP_PTRS; - -struct st_level_info -{ - /* Number of unused slots in *last_blocks HP_PTRS block (0 for 0th level) */ - uint free_ptrs_in_block; - - /* - Maximum number of records that can be 'contained' inside of each element - of last_blocks array. For level 0 - 1, for level 1 - HP_PTRS_IN_NOD, for - level 2 - HP_PTRS_IN_NOD^2 and so forth. - */ - ulong records_under_level; - - /* - Ptr to last allocated HP_PTRS (or records buffer for level 0) on this - level. - */ - HP_PTRS *last_blocks; -}; - - -/* - Heap table records and hash index entries are stored in HP_BLOCKs. - HP_BLOCK is used as a 'growable array' of fixed-size records. Size of record - is recbuffer bytes. - The internal representation is as follows: - HP_BLOCK is a hierarchical structure of 'blocks'. - A block at level 0 is an array records_in_block records. - A block at higher level is an HP_PTRS structure with pointers to blocks at - lower levels. - At the highest level there is one top block. It is stored in HP_BLOCK::root. - - See hp_find_block for a description of how record pointer is obtained from - its index. - See hp_get_new_block -*/ - -typedef struct st_heap_block -{ - HP_PTRS *root; /* Top-level block */ - struct st_level_info level_info[HP_MAX_LEVELS+1]; - uint levels; /* number of used levels */ - uint records_in_block; /* Records in one heap-block */ - uint recbuffer; /* Length of one saved record */ - ulong last_allocated; /* number of records there is allocated space for */ -} HP_BLOCK; - -struct st_heap_info; /* For referense */ - -typedef struct st_hp_keydef /* Key definition with open */ -{ - uint flag; /* HA_NOSAME | HA_NULL_PART_KEY */ - uint keysegs; /* Number of key-segment */ - uint length; /* Length of key (automatic) */ - uint8 algorithm; /* HASH / BTREE */ - HA_KEYSEG *seg; - HP_BLOCK block; /* Where keys are saved */ - /* - Number of buckets used in hash table. Used only to provide - #records estimates for heap key scans. - */ - ha_rows hash_buckets; - TREE rb_tree; - int (*write_key)(struct st_heap_info *info, struct st_hp_keydef *keyinfo, - const uchar *record, uchar *recpos); - int (*delete_key)(struct st_heap_info *info, struct st_hp_keydef *keyinfo, - const uchar *record, uchar *recpos, int flag); - uint (*get_key_length)(struct st_hp_keydef *keydef, const uchar *key); -} HP_KEYDEF; - -typedef struct st_heap_share -{ - HP_BLOCK block; - HP_KEYDEF *keydef; - ulong min_records,max_records; /* Params to open */ - ulonglong data_length,index_length,max_table_size; - uint key_stat_version; /* version to indicate insert/delete */ - uint records; /* records */ - uint blength; /* records rounded up to 2^n */ - uint deleted; /* Deleted records in database */ - uint reclength; /* Length of one record */ - uint changed; - uint keys,max_key_length; - uint currently_disabled_keys; /* saved value from "keys" when disabled */ - uint open_count; - uchar *del_link; /* Link to next block with del. rec */ - char * name; /* Name of "memory-file" */ -#ifdef THREAD - THR_LOCK lock; - pthread_mutex_t intern_lock; /* Locking for use with _locking */ -#endif - my_bool delete_on_close; - LIST open_list; - uint auto_key; - uint auto_key_type; /* real type of the auto key segment */ - ulonglong auto_increment; -} HP_SHARE; - -struct st_hp_hash_info; - -typedef struct st_heap_info -{ - HP_SHARE *s; - uchar *current_ptr; - struct st_hp_hash_info *current_hash_ptr; - ulong current_record,next_block; - int lastinx,errkey; - int mode; /* Mode of file (READONLY..) */ - uint opt_flag,update; - uchar *lastkey; /* Last used key with rkey */ - uchar *recbuf; /* Record buffer for rb-tree keys */ - enum ha_rkey_function last_find_flag; - TREE_ELEMENT *parents[MAX_TREE_HEIGHT+1]; - TREE_ELEMENT **last_pos; - uint lastkey_len; - my_bool implicit_emptied; -#ifdef THREAD - THR_LOCK_DATA lock; -#endif - LIST open_list; -} HP_INFO; - - -typedef struct st_heap_create_info -{ - uint auto_key; /* keynr [1 - maxkey] for auto key */ - uint auto_key_type; - ulonglong max_table_size; - ulonglong auto_increment; - my_bool with_auto_increment; - my_bool internal_table; -} HP_CREATE_INFO; - - /* Prototypes for heap-functions */ - -extern HP_INFO *heap_open(const char *name, int mode); -extern HP_INFO *heap_open_from_share(HP_SHARE *share, int mode); -extern HP_INFO *heap_open_from_share_and_register(HP_SHARE *share, int mode); -extern int heap_close(HP_INFO *info); -extern int heap_write(HP_INFO *info,const uchar *buff); -extern int heap_update(HP_INFO *info,const uchar *old,const uchar *newdata); -extern int heap_rrnd(HP_INFO *info,uchar *buf,uchar *pos); -extern int heap_scan_init(HP_INFO *info); -extern int heap_scan(register HP_INFO *info, uchar *record); -extern int heap_delete(HP_INFO *info,const uchar *buff); -extern int heap_info(HP_INFO *info,HEAPINFO *x,int flag); -extern int heap_create(const char *name, uint keys, HP_KEYDEF *keydef, - uint reclength, ulong max_records, ulong min_records, - HP_CREATE_INFO *create_info, HP_SHARE **share); -extern int heap_delete_table(const char *name); -extern void heap_drop_table(HP_INFO *info); -extern int heap_extra(HP_INFO *info,enum ha_extra_function function); -extern int heap_reset(HP_INFO *info); -extern int heap_rename(const char *old_name,const char *new_name); -extern int heap_panic(enum ha_panic_function flag); -extern int heap_rsame(HP_INFO *info,uchar *record,int inx); -extern int heap_rnext(HP_INFO *info,uchar *record); -extern int heap_rprev(HP_INFO *info,uchar *record); -extern int heap_rfirst(HP_INFO *info,uchar *record,int inx); -extern int heap_rlast(HP_INFO *info,uchar *record,int inx); -extern void heap_clear(HP_INFO *info); -extern void heap_clear_keys(HP_INFO *info); -extern int heap_disable_indexes(HP_INFO *info); -extern int heap_enable_indexes(HP_INFO *info); -extern int heap_indexes_are_disabled(HP_INFO *info); -extern void heap_update_auto_increment(HP_INFO *info, const uchar *record); -ha_rows hp_rb_records_in_range(HP_INFO *info, int inx, key_range *min_key, - key_range *max_key); -int hp_panic(enum ha_panic_function flag); -int heap_rkey(HP_INFO *info, uchar *record, int inx, const uchar *key, - key_part_map keypart_map, enum ha_rkey_function find_flag); -extern uchar * heap_find(HP_INFO *info,int inx,const uchar *key); -extern int heap_check_heap(HP_INFO *info, my_bool print_status); -extern uchar *heap_position(HP_INFO *info); - -/* The following is for programs that uses the old HEAP interface where - pointer to rows where a long instead of a (uchar*). -*/ - -#if defined(WANT_OLD_HEAP_VERSION) || defined(OLD_HEAP_VERSION) -extern int heap_rrnd_old(HP_INFO *info,uchar *buf,ulong pos); -extern ulong heap_position_old(HP_INFO *info); -#endif -#ifdef OLD_HEAP_VERSION -typedef ulong HEAP_PTR; -#define heap_position(A) heap_position_old(A) -#define heap_rrnd(A,B,C) heap_rrnd_old(A,B,C) -#else -typedef uchar *HEAP_PTR; -#endif - -#ifdef __cplusplus -} -#endif -#endif diff --git a/dep/mysqllite/include/internal/atomic/gcc_builtins.h b/dep/mysqllite/include/internal/atomic/gcc_builtins.h new file mode 100644 index 0000000000000..d03d28f572e98 --- /dev/null +++ b/dep/mysqllite/include/internal/atomic/gcc_builtins.h @@ -0,0 +1,42 @@ +#ifndef ATOMIC_GCC_BUILTINS_INCLUDED +#define ATOMIC_GCC_BUILTINS_INCLUDED + +/* 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 make_atomic_add_body(S) \ + v= __sync_fetch_and_add(a, v); +#define make_atomic_fas_body(S) \ + v= __sync_lock_test_and_set(a, v); +#define make_atomic_cas_body(S) \ + int ## S sav; \ + int ## S cmp_val= *cmp; \ + sav= __sync_val_compare_and_swap(a, cmp_val, set);\ + if (!(ret= (sav == cmp_val))) *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 + +#endif /* ATOMIC_GCC_BUILTINS_INCLUDED */ diff --git a/dep/mysqllite/include/internal/atomic/generic-msvc.h b/dep/mysqllite/include/internal/atomic/generic-msvc.h new file mode 100644 index 0000000000000..a84cde6b2c3fd --- /dev/null +++ b/dep/mysqllite/include/internal/atomic/generic-msvc.h @@ -0,0 +1,134 @@ +/* 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. +*/ +#undef MY_ATOMIC_HAS_8_16 + +#include +/* + 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 _InterlockedCompareExchange (LONG volatile *Target, LONG Value, LONG Comp); +LONGLONG _InterlockedCompareExchange64 (LONGLONG volatile *Target, + LONGLONG Value, LONGLONG Comp); +C_MODE_END + +#pragma intrinsic(_InterlockedCompareExchange) +#pragma intrinsic(_InterlockedCompareExchange64) +#endif + +#define InterlockedCompareExchange _InterlockedCompareExchange +#define InterlockedCompareExchange64 _InterlockedCompareExchange64 +/* + 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" +/* Implement using CAS on WIN32 */ +#define IL_COMP_EXCHG32(X,Y,Z) \ + InterlockedCompareExchange((volatile LONG *)(X),(Y),(Z)) +#define IL_COMP_EXCHG64(X,Y,Z) \ + InterlockedCompareExchange64((volatile LONGLONG *)(X), \ + (LONGLONG)(Y),(LONGLONG)(Z)) +#define IL_COMP_EXCHGptr InterlockedCompareExchangePointer + +#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; + +#ifndef _M_IX86 +/* Use full set of optimised functions on WIN64 */ +#define IL_EXCHG_ADD32(X,Y) \ + InterlockedExchangeAdd((volatile LONG *)(X),(Y)) +#define IL_EXCHG_ADD64(X,Y) \ + InterlockedExchangeAdd64((volatile LONGLONG *)(X),(LONGLONG)(Y)) +#define IL_EXCHG32(X,Y) \ + InterlockedExchange((volatile LONG *)(X),(Y)) +#define IL_EXCHG64(X,Y) \ + InterlockedExchange64((volatile LONGLONG *)(X),(LONGLONG)(Y)) +#define IL_EXCHGptr InterlockedExchangePointer + +#define make_atomic_add_body(S) \ + v= IL_EXCHG_ADD ## S (a, v) +#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); +#endif +/* + 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) + +#else /* SAFE_MUTEX */ + +/* + SAFE_MUTEX pollutes the compiling name space with macros + that alter pthread_mutex_t, pthread_mutex_init, etc. + Atomic operations should never use the safe mutex wrappers. + Unfortunately, there is no way to have both: + - safe mutex macros expanding pthread_mutex_lock to safe_mutex_lock + - my_atomic macros expanding to unmodified pthread_mutex_lock + inlined in the same compilation unit. + So, in case of SAFE_MUTEX, a function call is required. + Given that SAFE_MUTEX is a debugging facility, + this extra function call is not a performance concern for + production builds. +*/ +C_MODE_START +extern void plain_pthread_mutex_init(safe_mutex_t *); +extern void plain_pthread_mutex_destroy(safe_mutex_t *); +extern void plain_pthread_mutex_lock(safe_mutex_t *); +extern void plain_pthread_mutex_unlock(safe_mutex_t *); +C_MODE_END + +#define my_atomic_rwlock_destroy(name) plain_pthread_mutex_destroy(&(name)->rw) +#define my_atomic_rwlock_init(name) plain_pthread_mutex_init(&(name)->rw) +#define my_atomic_rwlock_rdlock(name) plain_pthread_mutex_lock(&(name)->rw) +#define my_atomic_rwlock_wrlock(name) plain_pthread_mutex_lock(&(name)->rw) +#define my_atomic_rwlock_rdunlock(name) plain_pthread_mutex_unlock(&(name)->rw) +#define my_atomic_rwlock_wrunlock(name) plain_pthread_mutex_unlock(&(name)->rw) + +#endif /* SAFE_MUTEX */ + +#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; + +#endif /* ATOMIC_RWLOCK_INCLUDED */ diff --git a/dep/mysqllite/include/internal/atomic/solaris.h b/dep/mysqllite/include/internal/atomic/solaris.h new file mode 100644 index 0000000000000..5643f878cd2a0 --- /dev/null +++ b/dep/mysqllite/include/internal/atomic/solaris.h @@ -0,0 +1,72 @@ +/* Copyright (C) 2008 MySQL AB, 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/solaris.h" + +#include + +#define MY_ATOMIC_MODE "solaris-atomic" + +#if defined(__GNUC__) +#define atomic_typeof(T,V) __typeof__(V) +#else +#define atomic_typeof(T,V) T +#endif + +#define uintptr_t void * +#define atomic_or_ptr_nv(X,Y) (void *)atomic_or_ulong_nv((volatile ulong_t *)X, Y) + +#define make_atomic_cas_body(S) \ + atomic_typeof(uint ## S ## _t, *cmp) sav; \ + sav = atomic_cas_ ## S( \ + (volatile uint ## S ## _t *)a, \ + (uint ## S ## _t)*cmp, \ + (uint ## S ## _t)set); \ + if (! (ret= (sav == *cmp))) \ + *cmp= sav; + +#define make_atomic_add_body(S) \ + int ## S nv; /* new value */ \ + nv= atomic_add_ ## S ## _nv((volatile uint ## S ## _t *)a, v); \ + v= nv - v + +/* ------------------------------------------------------------------------ */ + +#ifdef MY_ATOMIC_MODE_DUMMY + +#define make_atomic_load_body(S) ret= *a +#define make_atomic_store_body(S) *a= v + +#else /* MY_ATOMIC_MODE_DUMMY */ + +#define make_atomic_load_body(S) \ + ret= atomic_or_ ## S ## _nv((volatile uint ## S ## _t *)a, 0) + +#define make_atomic_store_body(S) \ + (void) atomic_swap_ ## S((volatile uint ## S ## _t *)a, (uint ## S ## _t)v) + +#endif + +#define make_atomic_fas_body(S) \ + v= atomic_swap_ ## S((volatile uint ## S ## _t *)a, (uint ## S ## _t)v) + +#else /* cleanup */ + +#undef uintptr_t +#undef atomic_or_ptr_nv + +#endif + diff --git a/dep/mysqllite/include/internal/atomic/x86-gcc.h b/dep/mysqllite/include/internal/atomic/x86-gcc.h new file mode 100644 index 0000000000000..ea3202aa9c9ba --- /dev/null +++ b/dep/mysqllite/include/internal/atomic/x86-gcc.h @@ -0,0 +1,145 @@ +#ifndef ATOMIC_X86_GCC_INCLUDED +#define ATOMIC_X86_GCC_INCLUDED + +/* 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. +*/ + +/* + No special support of 8 and 16 bit operations are implemented here + currently. +*/ +#undef MY_ATOMIC_HAS_8_AND_16 + +#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) make_atomic_add_body ## S +#define make_atomic_cas_body(S) make_atomic_cas_body ## S +#endif + +#define make_atomic_add_body32 \ + asm volatile (LOCK_prefix "; xadd %0, %1;" \ + : "+r" (v), "=m" (*a) \ + : "m" (*a) \ + : "memory") + +#define make_atomic_cas_body32 \ + __typeof__(*cmp) sav; \ + asm volatile (LOCK_prefix "; cmpxchg %3, %0; setz %2;" \ + : "=m" (*a), "=a" (sav), "=q" (ret) \ + : "r" (set), "m" (*a), "a" (*cmp) \ + : "memory"); \ + if (!ret) \ + *cmp= sav + +#ifdef __x86_64__ +#define make_atomic_add_body64 make_atomic_add_body32 +#define make_atomic_cas_body64 make_atomic_cas_body32 + +#define make_atomic_fas_body(S) \ + asm volatile ("xchg %0, %1;" \ + : "+r" (v), "=m" (*a) \ + : "m" (*a) \ + : "memory") + +/* + Actually 32/64-bit reads/writes are always atomic on x86_64, + nonetheless issue memory barriers as appropriate. +*/ +#define make_atomic_load_body(S) \ + /* Serialize prior load and store operations. */ \ + asm volatile ("mfence" ::: "memory"); \ + ret= *a; \ + /* Prevent compiler from reordering instructions. */ \ + asm volatile ("" ::: "memory") +#define make_atomic_store_body(S) \ + asm volatile ("; xchg %0, %1;" \ + : "=m" (*a), "+r" (v) \ + : "m" (*a) \ + : "memory") + +#else +/* + Use default implementations of 64-bit operations since we solved + the 64-bit problem on 32-bit platforms for CAS, no need to solve it + once more for ADD, LOAD, STORE and FAS as well. + Since we already added add32 support, we need to define add64 + here, but we haven't defined fas, load and store at all, so + we can fallback on default implementations. +*/ +#define make_atomic_add_body64 \ + int64 tmp=*a; \ + while (!my_atomic_cas64(a, &tmp, tmp+v)) ; \ + v=tmp; + +/* + On some platforms (e.g. Mac OS X and Solaris) the ebx register + is held as a pointer to the global offset table. Thus we're not + allowed to use the b-register on those platforms when compiling + PIC code, to avoid this we push ebx and pop ebx. The new value + is copied directly from memory to avoid problems with a implicit + manipulation of the stack pointer by the push. + + cmpxchg8b works on both 32-bit platforms and 64-bit platforms but + the code here is only used on 32-bit platforms, on 64-bit + platforms the much simpler make_atomic_cas_body32 will work + fine. +*/ +#define make_atomic_cas_body64 \ + asm volatile ("push %%ebx;" \ + "movl (%%ecx), %%ebx;" \ + "movl 4(%%ecx), %%ecx;" \ + LOCK_prefix "; cmpxchg8b %0;" \ + "setz %2; pop %%ebx" \ + : "=m" (*a), "+A" (*cmp), "=c" (ret) \ + : "c" (&set), "m" (*a) \ + : "memory", "esp") +#endif + +/* + The implementation of make_atomic_cas_body32 is adaptable to + the OS word size, so on 64-bit platforms it will automatically + adapt to 64-bits and so it will work also on 64-bit platforms +*/ +#define make_atomic_cas_bodyptr make_atomic_cas_body32 + +#ifdef MY_ATOMIC_MODE_DUMMY +#define make_atomic_load_body(S) ret=*a +#define make_atomic_store_body(S) *a=v +#endif +#endif /* ATOMIC_X86_GCC_INCLUDED */ diff --git a/dep/mysqllite/include/base64.h b/dep/mysqllite/include/internal/base64.h similarity index 100% rename from dep/mysqllite/include/base64.h rename to dep/mysqllite/include/internal/base64.h diff --git a/dep/mysqllite/include/hash.h b/dep/mysqllite/include/internal/hash.h similarity index 62% rename from dep/mysqllite/include/hash.h rename to dep/mysqllite/include/internal/hash.h index 629b404e8a7ef..d390cb7d4e6a5 100644 --- a/dep/mysqllite/include/hash.h +++ b/dep/mysqllite/include/internal/hash.h @@ -17,43 +17,24 @@ #ifndef _hash_h #define _hash_h -#ifdef __cplusplus -extern "C" { -#endif + +#include "my_global.h" /* uchar */ +#include "my_sys.h" /* DYNAMIC_ARRAY */ /* - There was a problem on MacOSX with a shared object ha_example.so. - It used hash_search(). During build of ha_example.so no libmysys - was specified. Since MacOSX had a hash_search() in the system - library, it built the shared object so that the dynamic linker - linked hash_search() to the system library, which caused a crash - when called. To come around this, we renamed hash_search() to - my_hash_search(), as we did long ago with hash_insert() and - hash_reset(). However, this time we made the move complete with - all names. To keep compatibility, we redefine the old names. - Since every C and C++ file, that uses HASH, needs to include - this file, the change is complete. Both names could be used - in the code, but the my_* versions are recommended now. + This forward declaration is used from C files where the real + definition is included before. Since C does not allow repeated + typedef declarations, even when identical, the definition may not be + repeated. */ -#define hash_get_key my_hash_get_key -#define hash_free_key my_hash_free_key -#define hash_init my_hash_init -#define hash_init2 my_hash_init2 -#define _hash_init _my_hash_init -#define hash_free my_hash_free -#define hash_reset my_hash_reset -#define hash_element my_hash_element -#define hash_search my_hash_search -#define hash_first my_hash_first -#define hash_next my_hash_next -#define hash_insert my_hash_insert -#define hash_delete my_hash_delete -#define hash_update my_hash_update -#define hash_replace my_hash_replace -#define hash_check my_hash_check -#define hash_clear my_hash_clear -#define hash_inited my_hash_inited -#define hash_init_opt my_hash_init_opt +#ifndef CHARSET_INFO_DEFINED +#define CHARSET_INFO_DEFINED +typedef struct charset_info_st CHARSET_INFO; +#endif /* CHARSET_INFO_DEFINED */ + +#ifdef __cplusplus +extern "C" { +#endif /* Overhead to store an element in hash @@ -64,6 +45,7 @@ extern "C" { /* flags for hash_init */ #define HASH_UNIQUE 1 /* hash_insert fails on duplicate key */ +typedef uint my_hash_value_type; typedef uchar *(*my_hash_get_key)(const uchar *,size_t*,my_bool); typedef void (*my_hash_free_key)(void *); @@ -82,20 +64,30 @@ typedef struct st_hash { 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) + _my_hash_init(A,0,B,C,D,E,F,G,H) #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_hash_init(A,B,C,D,E,F,G,H,I) 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); + uint flags); 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_search_using_hash_value(const HASH *info, + my_hash_value_type hash_value, + const uchar *key, size_t length); +my_hash_value_type my_calc_hash(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_first_from_hash_value(const HASH *info, + my_hash_value_type hash_value, + 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); @@ -108,7 +100,7 @@ my_bool my_hash_check(HASH *hash); /* Only in debug library */ #define my_hash_clear(H) bzero((char*) (H), sizeof(*(H))) #define my_hash_inited(H) ((H)->blength != 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)) + (!my_hash_inited(A) && _my_hash_init(A,0,B,C,D,E,F,G,H)) #ifdef __cplusplus } diff --git a/dep/mysqllite/include/internal/lf.h b/dep/mysqllite/include/internal/lf.h new file mode 100644 index 0000000000000..e9fb094493f03 --- /dev/null +++ b/dep/mysqllite/include/internal/lf.h @@ -0,0 +1,265 @@ +/* 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 + +C_MODE_START + +/* + 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; +} 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((ADDR)) + +lock_wrap(lf_alloc_new, void *, + (LF_PINS *pins), + (pins), + &pins->pinbox->pinarray.lock) + +C_MODE_END + +/* + extendible hash, lf_hash.c +*/ +#include + +C_MODE_START + +#define LF_HASH_UNIQUE 1 + +/* lf_hash overhead per element is sizeof(LF_SLIST). */ + +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 + +C_MODE_END + +#endif + diff --git a/dep/mysqllite/include/my_aes.h b/dep/mysqllite/include/internal/my_aes.h similarity index 96% rename from dep/mysqllite/include/my_aes.h rename to dep/mysqllite/include/internal/my_aes.h index 1bbdf5663eae9..2e2a66b496825 100644 --- a/dep/mysqllite/include/my_aes.h +++ b/dep/mysqllite/include/internal/my_aes.h @@ -1,3 +1,6 @@ +#ifndef MY_AES_INCLUDED +#define MY_AES_INCLUDED + /* Copyright (C) 2002 MySQL AB This program is free software; you can redistribute it and/or modify @@ -63,3 +66,5 @@ int my_aes_decrypt(const char *source, int source_length, char *dest, int my_aes_get_size(int source_length); C_MODE_END + +#endif /* MY_AES_INCLUDED */ diff --git a/dep/mysqllite/include/my_alarm.h b/dep/mysqllite/include/internal/my_alarm.h similarity index 86% rename from dep/mysqllite/include/my_alarm.h rename to dep/mysqllite/include/internal/my_alarm.h index c41c1d65e273d..fa396cf02f975 100644 --- a/dep/mysqllite/include/my_alarm.h +++ b/dep/mysqllite/include/internal/my_alarm.h @@ -33,15 +33,15 @@ extern ulong my_time_to_wait_for_lock; #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_END (void) signal(SIGALRM,alarm_signal); \ + (void) alarm(alarm_old); #define ALARM_TEST my_have_got_alarm #ifdef SIGNAL_HANDLER_RESET_ON_DELIVERY -#define ALARM_REINIT VOID(alarm(MY_HOW_OFTEN_TO_ALARM)); \ - VOID(signal(SIGALRM,my_set_alarm_variable));\ +#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)); \ +#define ALARM_REINIT (void) alarm((uint) MY_HOW_OFTEN_TO_ALARM); \ my_have_got_alarm=0; #endif /* SIGNAL_HANDLER_RESET_ON_DELIVERY */ #else diff --git a/dep/mysqllite/include/internal/my_atomic.h b/dep/mysqllite/include/internal/my_atomic.h new file mode 100644 index 0000000000000..c2d514012d963 --- /dev/null +++ b/dep/mysqllite/include/internal/my_atomic.h @@ -0,0 +1,287 @@ +#ifndef MY_ATOMIC_INCLUDED +#define MY_ATOMIC_INCLUDED + +/* 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) + 'Fetch and Add' + 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) + An odd variation of 'Compare And Set/Swap' + if *var is equal to *old, then store 'new' in *var, and return TRUE + otherwise store *var in *old, and return FALSE + Usually, &old should not be accessed if the operation is successful. + + my_atomic_load#(&var) + return *var + + my_atomic_store#(&var, what) + store 'what' in *var + + '#' is substituted by a size suffix - 8, 16, 32, 64, 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 * +/** + Currently we don't support 8-bit and 16-bit operations. + It can be added later if needed. +*/ +#undef MY_ATOMIC_HAS_8_16 + +#ifndef MY_ATOMIC_MODE_RWLOCKS +/* + * Attempt to do atomic ops without locks + */ +#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" +#endif + +/* 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 + +/* + 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) ||defined (_ARCH_PPC))) +/* + 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(64) +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_8 int8 +#define U_16 int16 +#define U_32 int32 +#define U_64 int64 +#define U_ptr intptr +#define Uv_8 int8 +#define Uv_16 int16 +#define Uv_32 int32 +#define Uv_64 int64 +#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 */ + +#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); \ +} + +#ifdef MY_ATOMIC_HAS_8_16 +make_atomic_cas(8) +make_atomic_cas(16) +#endif +make_atomic_cas(32) +make_atomic_cas(64) +make_atomic_cas(ptr) + +#ifdef MY_ATOMIC_HAS_8_16 +make_atomic_add(8) +make_atomic_add(16) +#endif +make_atomic_add(32) +make_atomic_add(64) + +#ifdef MY_ATOMIC_HAS_8_16 +make_atomic_load(8) +make_atomic_load(16) +#endif +make_atomic_load(32) +make_atomic_load(64) +make_atomic_load(ptr) + +#ifdef MY_ATOMIC_HAS_8_16 +make_atomic_fas(8) +make_atomic_fas(16) +#endif +make_atomic_fas(32) +make_atomic_fas(64) +make_atomic_fas(ptr) + +#ifdef MY_ATOMIC_HAS_8_16 +make_atomic_store(8) +make_atomic_store(16) +#endif +make_atomic_store(32) +make_atomic_store(64) +make_atomic_store(ptr) + +#ifdef _atomic_h_cleanup_ +#include _atomic_h_cleanup_ +#undef _atomic_h_cleanup_ +#endif + +#undef U_8 +#undef U_16 +#undef U_32 +#undef U_64 +#undef U_ptr +#undef Uv_8 +#undef Uv_16 +#undef Uv_32 +#undef Uv_64 +#undef Uv_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 + +#endif /* MY_ATOMIC_INCLUDED */ diff --git a/dep/mysqllite/include/my_base.h b/dep/mysqllite/include/internal/my_base.h similarity index 96% rename from dep/mysqllite/include/my_base.h rename to dep/mysqllite/include/internal/my_base.h index a01b2ec9b82f4..347bda01befd5 100644 --- a/dep/mysqllite/include/my_base.h +++ b/dep/mysqllite/include/internal/my_base.h @@ -1,4 +1,5 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (C) 2000, 2011, Oracle and/or its affiliates. All rights + reserved This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -30,9 +31,6 @@ #define EOVERFLOW 84 #endif -#if !defined(USE_MY_FUNC) && !defined(THREAD) -#include /* For faster code, after test */ -#endif /* USE_MY_FUNC */ #endif /* stdin */ #include @@ -191,10 +189,11 @@ enum ha_extra_function { /* Inform handler that we will do a rename */ HA_EXTRA_PREPARE_FOR_RENAME, /* - Orders MERGE handler to attach or detach its child tables. Used at - begin and end of a statement. + Special actions for MERGE tables. */ + HA_EXTRA_ADD_CHILDREN_LIST, HA_EXTRA_ATTACH_CHILDREN, + HA_EXTRA_IS_ATTACHED_CHILDREN, HA_EXTRA_DETACH_CHILDREN }; @@ -255,27 +254,27 @@ enum ha_base_keytype { HA_BINARY_PACK_KEY | HA_FULLTEXT | HA_UNIQUE_CHECK | \ HA_SPATIAL | HA_NULL_ARE_EQUAL | HA_GENERATED_KEY) -#define HA_KEY_HAS_PART_KEY_SEG 65536 /* Key contains partial segments */ +/* + Key contains partial segments. + + This flag is internal to the MySQL server by design. It is not supposed + neither to be saved in FRM-files, nor to be passed to storage engines. + It is intended to pass information into internal static sort_keys(KEY *, + KEY *) function. + + This flag can be calculated -- it's based on key lengths comparison. +*/ +#define HA_KEY_HAS_PART_KEY_SEG 65536 /* 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 */ @@ -350,7 +349,7 @@ enum ha_base_keytype { /* update the 'variable' part of the info: handler::records, deleted, data_file_length, index_file_length, - delete_length, check_time, mean_rec_length + check_time, mean_rec_length */ #define HA_STATUS_VARIABLE 16 /* @@ -363,6 +362,11 @@ enum ha_base_keytype { update handler::auto_increment_value */ #define HA_STATUS_AUTO 64 +/* + Get also delete_length when HA_STATUS_VARIABLE is called. It's ok to set it also + when only HA_STATUS_VARIABLE but it won't be used. +*/ +#define HA_STATUS_VARIABLE_EXTRA 128 /* Errorcodes given by handler functions @@ -561,6 +565,8 @@ typedef ulong ha_rows; #define HA_VARCHAR_PACKLENGTH(field_length) ((field_length) < 256 ? 1 :2) /* invalidator function reference for Query Cache */ +C_MODE_START typedef void (* invalidator_by_filename)(const char * filename); +C_MODE_END #endif /* _my_base_h */ diff --git a/dep/mysqllite/include/my_bit.h b/dep/mysqllite/include/internal/my_bit.h similarity index 79% rename from dep/mysqllite/include/my_bit.h rename to dep/mysqllite/include/internal/my_bit.h index 2e464e89049bf..b396b84b0d8b5 100644 --- a/dep/mysqllite/include/my_bit.h +++ b/dep/mysqllite/include/internal/my_bit.h @@ -1,9 +1,11 @@ +#ifndef MY_BIT_INCLUDED +#define MY_BIT_INCLUDED + /* 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]; @@ -13,14 +15,14 @@ extern const uchar _my_bits_reverse_table[256]; This can be used to divide a number with value by doing a shift instead */ -STATIC_INLINE uint my_bit_log2(ulong value) +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) +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 @@ -42,7 +44,7 @@ STATIC_INLINE uint my_count_bits(ulonglong v) #endif } -STATIC_INLINE uint my_count_bits_ushort(ushort v) +static inline uint my_count_bits_ushort(ushort v) { return _my_bits_nbits[v]; } @@ -67,7 +69,7 @@ STATIC_INLINE uint my_count_bits_ushort(ushort v) Comments shows how this works with 01100000000000000000000000001011 */ -STATIC_INLINE uint32 my_round_up_to_next_power(uint32 v) +static inline uint32 my_round_up_to_next_power(uint32 v) { v--; /* 01100000000000000000000000001010 */ v|= v >> 1; /* 01110000000000000000000000001111 */ @@ -78,7 +80,7 @@ STATIC_INLINE uint32 my_round_up_to_next_power(uint32 v) return v+1; /* 10000000000000000000000000000000 */ } -STATIC_INLINE uint32 my_clear_highest_bit(uint32 v) +static inline uint32 my_clear_highest_bit(uint32 v) { uint32 w=v >> 1; w|= w >> 1; @@ -89,7 +91,7 @@ STATIC_INLINE uint32 my_clear_highest_bit(uint32 v) return v & w; } -STATIC_INLINE uint32 my_reverse_bits(uint32 key) +static inline uint32 my_reverse_bits(uint32 key) { return (_my_bits_reverse_table[ key & 255] << 24) | @@ -98,12 +100,6 @@ STATIC_INLINE uint32 my_reverse_bits(uint32 key) _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 + +#endif /* MY_BIT_INCLUDED */ diff --git a/dep/mysqllite/include/my_bitmap.h b/dep/mysqllite/include/internal/my_bitmap.h similarity index 79% rename from dep/mysqllite/include/my_bitmap.h rename to dep/mysqllite/include/internal/my_bitmap.h index ab69b2d671de0..78b33b09a5129 100644 --- a/dep/mysqllite/include/my_bitmap.h +++ b/dep/mysqllite/include/internal/my_bitmap.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (C) 2000 MySQL AB, 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 @@ -33,9 +33,7 @@ typedef struct st_bitmap thread_safe flag in bitmap_init was set. Otherwise, we optimize by not acquiring the mutex */ -#ifdef THREAD - pthread_mutex_t *mutex; -#endif + mysql_mutex_t *mutex; } MY_BITMAP; #ifdef __cplusplus @@ -69,28 +67,6 @@ 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) diff --git a/dep/mysqllite/include/my_handler.h b/dep/mysqllite/include/internal/my_handler.h similarity index 95% rename from dep/mysqllite/include/my_handler.h rename to dep/mysqllite/include/internal/my_handler.h index a3376cb74a2a2..ba0d3fc313f50 100644 --- a/dep/mysqllite/include/my_handler.h +++ b/dep/mysqllite/include/internal/my_handler.h @@ -1,11 +1,11 @@ /* Copyright (C) 2002-2006 MySQL AB - This library is free software; you can redistribute it and/or + This program 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, + This program is distributed in the hope that 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. @@ -23,6 +23,8 @@ extern "C" { #endif +#include "m_ctype.h" /* CHARSET_INFO */ + /* There is a hard limit for the maximum number of keys as there are only 8 bits in the index file header for the number of keys in a table. @@ -53,8 +55,8 @@ typedef struct st_HA_KEYSEG /* Key-portion */ uint16 bit_pos; /* Position to bit part */ uint16 flag; uint16 length; /* Keylength */ + uint16 language; uint8 type; /* Type of key (for sort) */ - uint8 language; uint8 null_bit; /* bitmask to test for NULL */ uint8 bit_start,bit_end; /* if bit field */ uint8 bit_length; /* Length of bit part */ diff --git a/dep/mysqllite/include/my_libwrap.h b/dep/mysqllite/include/internal/my_libwrap.h similarity index 91% rename from dep/mysqllite/include/my_libwrap.h rename to dep/mysqllite/include/internal/my_libwrap.h index 9a8579475fbe5..8235c00d8f37a 100644 --- a/dep/mysqllite/include/my_libwrap.h +++ b/dep/mysqllite/include/internal/my_libwrap.h @@ -1,3 +1,6 @@ +#ifndef MY_LIBWRAP_INCLUDED +#define MY_LIBWRAP_INCLUDED + /* Copyright (C) 2000 MySQL AB This program is free software; you can redistribute it and/or modify @@ -25,3 +28,4 @@ extern int my_hosts_access(struct request_info *req); extern char *my_eval_client(struct request_info *req); #endif /* HAVE_LIBWRAP */ +#endif /* MY_LIBWRAP_INCLUDED */ diff --git a/dep/mysqllite/include/my_md5.h b/dep/mysqllite/include/internal/my_md5.h similarity index 95% rename from dep/mysqllite/include/my_md5.h rename to dep/mysqllite/include/internal/my_md5.h index 6458f27c5cccd..782bef8a27aa5 100644 --- a/dep/mysqllite/include/my_md5.h +++ b/dep/mysqllite/include/internal/my_md5.h @@ -1,3 +1,6 @@ +#ifndef MY_MD5_INCLUDED +#define MY_MD5_INCLUDED + /* Copyright (C) 2000 MySQL AB This program is free software; you can redistribute it and/or modify @@ -52,3 +55,5 @@ do { \ my_MD5Update (&ctx, buf, len); \ my_MD5Final (digest, &ctx); \ } while (0) + +#endif /* MY_MD__INCLUDED */ diff --git a/dep/mysqllite/include/my_nosys.h b/dep/mysqllite/include/internal/my_nosys.h similarity index 93% rename from dep/mysqllite/include/my_nosys.h rename to dep/mysqllite/include/internal/my_nosys.h index df5639b81e221..96ba6d4c46428 100644 --- a/dep/mysqllite/include/my_nosys.h +++ b/dep/mysqllite/include/internal/my_nosys.h @@ -30,7 +30,7 @@ extern "C" { #include #endif -#undef my_read /* Can be predefined in raid.h */ +#undef my_read #undef my_write #undef my_seek #define my_read(a,b,c,d) my_quick_read(a,b,c,d) @@ -39,7 +39,7 @@ 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) +#if defined(USE_HALLOC) #define my_malloc(a,b) halloc(a,1) #define my_no_flags_free(a) hfree(a) #endif diff --git a/dep/mysqllite/include/internal/my_rdtsc.h b/dep/mysqllite/include/internal/my_rdtsc.h new file mode 100644 index 0000000000000..81bc1aafb5846 --- /dev/null +++ b/dep/mysqllite/include/internal/my_rdtsc.h @@ -0,0 +1,129 @@ +/* Copyright (C) 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 */ + +/* + rdtsc3 -- multi-platform timer code + pgulutzan@mysql.com, 2005-08-29 + modified 2008-11-02 +*/ + +#ifndef MY_RDTSC_H +#define MY_RDTSC_H + +/** + Characteristics of a timer. +*/ +struct my_timer_unit_info +{ + /** Routine used for the timer. */ + ulonglong routine; + /** Overhead of the timer. */ + ulonglong overhead; + /** Frequency of the timer. */ + ulonglong frequency; + /** Resolution of the timer. */ + ulonglong resolution; +}; + +/** + Characteristics of all the supported timers. + @sa my_timer_init(). +*/ +struct my_timer_info +{ + /** Characteristics of the cycle timer. */ + struct my_timer_unit_info cycles; + /** Characteristics of the nanosecond timer. */ + struct my_timer_unit_info nanoseconds; + /** Characteristics of the microsecond timer. */ + struct my_timer_unit_info microseconds; + /** Characteristics of the millisecond timer. */ + struct my_timer_unit_info milliseconds; + /** Characteristics of the tick timer. */ + struct my_timer_unit_info ticks; +}; + +typedef struct my_timer_info MY_TIMER_INFO; + +C_MODE_START + +/** + A cycle timer. + @return the current timer value, in cycles. +*/ +ulonglong my_timer_cycles(void); + +/** + A namoseconds timer. + @return the current timer value, in nanoseconds. +*/ +ulonglong my_timer_nanoseconds(void); + +/** + A microseconds timer. + @return the current timer value, in microseconds. +*/ +ulonglong my_timer_microseconds(void); + +/** + A millisecond timer. + @return the current timer value, in milliseconds. +*/ +ulonglong my_timer_milliseconds(void); + +/** + A ticks timer. + @return the current timer value, in ticks. +*/ +ulonglong my_timer_ticks(void); + +/** + Timer initialization function. + @param [out] mti the timer characteristics. +*/ +void my_timer_init(MY_TIMER_INFO *mti); + +C_MODE_END + +#define MY_TIMER_ROUTINE_ASM_X86 1 +#define MY_TIMER_ROUTINE_ASM_X86_64 2 +#define MY_TIMER_ROUTINE_RDTSCLL 3 +#define MY_TIMER_ROUTINE_ASM_X86_WIN 4 +#define MY_TIMER_ROUTINE_RDTSC 5 +#define MY_TIMER_ROUTINE_ASM_IA64 6 +#define MY_TIMER_ROUTINE_ASM_PPC 7 +#define MY_TIMER_ROUTINE_SGI_CYCLE 8 +#define MY_TIMER_ROUTINE_GETHRTIME 9 +#define MY_TIMER_ROUTINE_READ_REAL_TIME 10 +#define MY_TIMER_ROUTINE_CLOCK_GETTIME 11 +#define MY_TIMER_ROUTINE_NXGETTIME 12 +#define MY_TIMER_ROUTINE_GETTIMEOFDAY 13 +#define MY_TIMER_ROUTINE_QUERYPERFORMANCECOUNTER 14 +#define MY_TIMER_ROUTINE_GETTICKCOUNT 15 +#define MY_TIMER_ROUTINE_TIME 16 +#define MY_TIMER_ROUTINE_TIMES 17 +#define MY_TIMER_ROUTINE_FTIME 18 +#define MY_TIMER_ROUTINE_ASM_PPC64 19 +#define MY_TIMER_ROUTINE_ASM_SUNPRO_SPARC64 20 +#define MY_TIMER_ROUTINE_ASM_SUNPRO_SPARC32 21 +#define MY_TIMER_ROUTINE_ASM_SUNPRO_I386 22 +#define MY_TIMER_ROUTINE_ASM_GCC_SPARC64 23 +#define MY_TIMER_ROUTINE_ASM_GCC_SPARC32 24 +#define MY_TIMER_ROUTINE_MACH_ABSOLUTE_TIME 25 +#define MY_TIMER_ROUTINE_GETSYSTEMTIMEASFILETIME 26 +#define MY_TIMER_ROUTINE_ASM_SUNPRO_X86_64 27 + +#endif + diff --git a/dep/mysqllite/include/my_stacktrace.h b/dep/mysqllite/include/internal/my_stacktrace.h similarity index 94% rename from dep/mysqllite/include/my_stacktrace.h rename to dep/mysqllite/include/internal/my_stacktrace.h index 9250fd4579e11..8c2c97c68e5db 100644 --- a/dep/mysqllite/include/my_stacktrace.h +++ b/dep/mysqllite/include/internal/my_stacktrace.h @@ -32,9 +32,7 @@ #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 && \ @@ -47,7 +45,7 @@ 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_safe_print_str(const char* val, int max_len); void my_write_core(int sig); #if BACKTRACE_DEMANGLE char *my_demangle(const char *mangled_name, int *status); diff --git a/dep/mysqllite/include/my_time.h b/dep/mysqllite/include/internal/my_time.h similarity index 96% rename from dep/mysqllite/include/my_time.h rename to dep/mysqllite/include/internal/my_time.h index 58995f1bf62ee..fdfe130c45fea 100644 --- a/dep/mysqllite/include/my_time.h +++ b/dep/mysqllite/include/internal/my_time.h @@ -35,8 +35,6 @@ extern uchar days_in_month[]; 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; @@ -74,12 +72,12 @@ typedef long my_time_t; 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); + ulonglong 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); + ulonglong flags, int *was_cut); longlong number_to_datetime(longlong nr, MYSQL_TIME *time_res, - uint flags, int *was_cut); + ulonglong 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 *); diff --git a/dep/mysqllite/include/my_tree.h b/dep/mysqllite/include/internal/my_tree.h similarity index 98% rename from dep/mysqllite/include/my_tree.h rename to dep/mysqllite/include/internal/my_tree.h index 24bbdd5401990..0958a37fb4c08 100644 --- a/dep/mysqllite/include/my_tree.h +++ b/dep/mysqllite/include/internal/my_tree.h @@ -20,6 +20,7 @@ extern "C" { #endif #include "my_base.h" /* get 'enum ha_rkey_function' */ +#include "my_alloc.h" /* MEM_ROOT */ /* Worst case tree is half full. This gives use 2^(MAX_TREE_HEIGHT/2) leafs */ #define MAX_TREE_HEIGHT 64 diff --git a/dep/mysqllite/include/my_uctype.h b/dep/mysqllite/include/internal/my_uctype.h similarity index 99% rename from dep/mysqllite/include/my_uctype.h rename to dep/mysqllite/include/internal/my_uctype.h index 9aaf478810c87..580eb646e11d6 100644 --- a/dep/mysqllite/include/my_uctype.h +++ b/dep/mysqllite/include/internal/my_uctype.h @@ -1,3 +1,6 @@ +#ifndef MY_UCTYPE_INCLUDED +#define MY_UCTYPE_INCLUDED + /* Copyright (C) 2006 MySQL AB This program is free software; you can redistribute it and/or modify @@ -1477,3 +1480,4 @@ MY_UNI_CTYPE my_uni_ctype[256]={ }; +#endif /* MY_UCTYPE_INCLUDED */ diff --git a/dep/mysqllite/include/myisampack.h b/dep/mysqllite/include/internal/myisampack.h similarity index 99% rename from dep/mysqllite/include/myisampack.h rename to dep/mysqllite/include/internal/myisampack.h index 7d4871bd1cbf3..ecf35520a88bf 100644 --- a/dep/mysqllite/include/myisampack.h +++ b/dep/mysqllite/include/internal/myisampack.h @@ -1,3 +1,6 @@ +#ifndef MYISAMPACK_INCLUDED +#define MYISAMPACK_INCLUDED + /* Copyright (C) 2000 MySQL AB This program is free software; you can redistribute it and/or modify @@ -236,3 +239,4 @@ mi_int4store(((T) + 4), A); }} #define mi_sizekorr(T) mi_uint4korr((uchar*) (T) + 4) #endif +#endif /* MYISAMPACK_INCLUDED */ diff --git a/dep/mysqllite/include/mysql_version.h.in b/dep/mysqllite/include/internal/mysql_version.h.in similarity index 100% rename from dep/mysqllite/include/mysql_version.h.in rename to dep/mysqllite/include/internal/mysql_version.h.in diff --git a/dep/mysqllite/include/mysys_err.h b/dep/mysqllite/include/internal/mysys_err.h similarity index 94% rename from dep/mysqllite/include/mysys_err.h rename to dep/mysqllite/include/internal/mysys_err.h index 6294b37f773e6..22ac74302a207 100644 --- a/dep/mysqllite/include/mysys_err.h +++ b/dep/mysqllite/include/internal/mysys_err.h @@ -15,6 +15,7 @@ #ifndef _mysys_err_h #define _mysys_err_h + #ifdef __cplusplus extern "C" { #endif @@ -22,7 +23,7 @@ extern "C" { #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 */ +extern const char *globerrs[]; /* my_error_messages is here */ /* Error message numbers in global map */ /* @@ -64,7 +65,8 @@ extern const char * NEAR globerrs[]; /* my_error_messages is here */ #define EE_FILE_NOT_CLOSED 30 #define EE_CHANGE_OWNERSHIP 31 #define EE_CHANGE_PERMISSIONS 32 -#define EE_ERROR_LAST 32 /* Copy last error nr */ +#define EE_CANT_SEEK 33 +#define EE_ERROR_LAST 33 /* Copy last error nr */ /* Add error numbers before EE_ERROR_LAST and change it accordingly. */ /* exit codes for all MySQL programs */ diff --git a/dep/mysqllite/include/internal/password.h b/dep/mysqllite/include/internal/password.h new file mode 100644 index 0000000000000..e75b09297a31f --- /dev/null +++ b/dep/mysqllite/include/internal/password.h @@ -0,0 +1,32 @@ +/* Copyright 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ + +#ifndef PASSWORD_INCLUDED +#define PASSWORD_INCLUDED + +#include "my_global.h" + +C_MODE_START + +void my_make_scrambled_password_323(char *to, const char *password, + size_t pass_len); +void my_make_scrambled_password(char *to, const char *password, + size_t pass_len); + +void hash_password(ulong *result, const char *password, uint password_len); + +C_MODE_END + +#endif /* PASSWORD_INCLUDED */ diff --git a/dep/mysqllite/include/internal/probes_mysql.h b/dep/mysqllite/include/internal/probes_mysql.h new file mode 100644 index 0000000000000..13491c661fdee --- /dev/null +++ b/dep/mysqllite/include/internal/probes_mysql.h @@ -0,0 +1,13 @@ +#ifndef PROBES_MYSQL_H + +#define PROBES_MYSQL_H + +#include + +#if defined(HAVE_DTRACE) && !defined(DISABLE_DTRACE) +#include "probes_mysql_dtrace.h" +#else +#include "probes_mysql_nodtrace.h" +#endif + +#endif /* PROBES_MYSQL_H */ diff --git a/dep/mysqllite/include/internal/probes_mysql_nodtrace.h b/dep/mysqllite/include/internal/probes_mysql_nodtrace.h new file mode 100644 index 0000000000000..bc3b65a00e5e8 --- /dev/null +++ b/dep/mysqllite/include/internal/probes_mysql_nodtrace.h @@ -0,0 +1,129 @@ +/* + * Generated by dheadgen(1). + */ + +#ifndef _PROBES_MYSQL_D +#define _PROBES_MYSQL_D + +#ifdef __cplusplus +extern "C" { +#endif + +#define MYSQL_CONNECTION_START(arg0, arg1, arg2) +#define MYSQL_CONNECTION_START_ENABLED() (0) +#define MYSQL_CONNECTION_DONE(arg0, arg1) +#define MYSQL_CONNECTION_DONE_ENABLED() (0) +#define MYSQL_COMMAND_START(arg0, arg1, arg2, arg3) +#define MYSQL_COMMAND_START_ENABLED() (0) +#define MYSQL_COMMAND_DONE(arg0) +#define MYSQL_COMMAND_DONE_ENABLED() (0) +#define MYSQL_QUERY_START(arg0, arg1, arg2, arg3, arg4) +#define MYSQL_QUERY_START_ENABLED() (0) +#define MYSQL_QUERY_DONE(arg0) +#define MYSQL_QUERY_DONE_ENABLED() (0) +#define MYSQL_QUERY_PARSE_START(arg0) +#define MYSQL_QUERY_PARSE_START_ENABLED() (0) +#define MYSQL_QUERY_PARSE_DONE(arg0) +#define MYSQL_QUERY_PARSE_DONE_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_EXEC_START(arg0, arg1, arg2, arg3, arg4, arg5) +#define MYSQL_QUERY_EXEC_START_ENABLED() (0) +#define MYSQL_QUERY_EXEC_DONE(arg0) +#define MYSQL_QUERY_EXEC_DONE_ENABLED() (0) +#define MYSQL_INSERT_ROW_START(arg0, arg1) +#define MYSQL_INSERT_ROW_START_ENABLED() (0) +#define MYSQL_INSERT_ROW_DONE(arg0) +#define MYSQL_INSERT_ROW_DONE_ENABLED() (0) +#define MYSQL_UPDATE_ROW_START(arg0, arg1) +#define MYSQL_UPDATE_ROW_START_ENABLED() (0) +#define MYSQL_UPDATE_ROW_DONE(arg0) +#define MYSQL_UPDATE_ROW_DONE_ENABLED() (0) +#define MYSQL_DELETE_ROW_START(arg0, arg1) +#define MYSQL_DELETE_ROW_START_ENABLED() (0) +#define MYSQL_DELETE_ROW_DONE(arg0) +#define MYSQL_DELETE_ROW_DONE_ENABLED() (0) +#define MYSQL_READ_ROW_START(arg0, arg1, arg2) +#define MYSQL_READ_ROW_START_ENABLED() (0) +#define MYSQL_READ_ROW_DONE(arg0) +#define MYSQL_READ_ROW_DONE_ENABLED() (0) +#define MYSQL_INDEX_READ_ROW_START(arg0, arg1) +#define MYSQL_INDEX_READ_ROW_START_ENABLED() (0) +#define MYSQL_INDEX_READ_ROW_DONE(arg0) +#define MYSQL_INDEX_READ_ROW_DONE_ENABLED() (0) +#define MYSQL_HANDLER_RDLOCK_START(arg0, arg1) +#define MYSQL_HANDLER_RDLOCK_START_ENABLED() (0) +#define MYSQL_HANDLER_WRLOCK_START(arg0, arg1) +#define MYSQL_HANDLER_WRLOCK_START_ENABLED() (0) +#define MYSQL_HANDLER_UNLOCK_START(arg0, arg1) +#define MYSQL_HANDLER_UNLOCK_START_ENABLED() (0) +#define MYSQL_HANDLER_RDLOCK_DONE(arg0) +#define MYSQL_HANDLER_RDLOCK_DONE_ENABLED() (0) +#define MYSQL_HANDLER_WRLOCK_DONE(arg0) +#define MYSQL_HANDLER_WRLOCK_DONE_ENABLED() (0) +#define MYSQL_HANDLER_UNLOCK_DONE(arg0) +#define MYSQL_HANDLER_UNLOCK_DONE_ENABLED() (0) +#define MYSQL_FILESORT_START(arg0, arg1) +#define MYSQL_FILESORT_START_ENABLED() (0) +#define MYSQL_FILESORT_DONE(arg0, arg1) +#define MYSQL_FILESORT_DONE_ENABLED() (0) +#define MYSQL_SELECT_START(arg0) +#define MYSQL_SELECT_START_ENABLED() (0) +#define MYSQL_SELECT_DONE(arg0, arg1) +#define MYSQL_SELECT_DONE_ENABLED() (0) +#define MYSQL_INSERT_START(arg0) +#define MYSQL_INSERT_START_ENABLED() (0) +#define MYSQL_INSERT_DONE(arg0, arg1) +#define MYSQL_INSERT_DONE_ENABLED() (0) +#define MYSQL_INSERT_SELECT_START(arg0) +#define MYSQL_INSERT_SELECT_START_ENABLED() (0) +#define MYSQL_INSERT_SELECT_DONE(arg0, arg1) +#define MYSQL_INSERT_SELECT_DONE_ENABLED() (0) +#define MYSQL_UPDATE_START(arg0) +#define MYSQL_UPDATE_START_ENABLED() (0) +#define MYSQL_UPDATE_DONE(arg0, arg1, arg2) +#define MYSQL_UPDATE_DONE_ENABLED() (0) +#define MYSQL_MULTI_UPDATE_START(arg0) +#define MYSQL_MULTI_UPDATE_START_ENABLED() (0) +#define MYSQL_MULTI_UPDATE_DONE(arg0, arg1, arg2) +#define MYSQL_MULTI_UPDATE_DONE_ENABLED() (0) +#define MYSQL_DELETE_START(arg0) +#define MYSQL_DELETE_START_ENABLED() (0) +#define MYSQL_DELETE_DONE(arg0, arg1) +#define MYSQL_DELETE_DONE_ENABLED() (0) +#define MYSQL_MULTI_DELETE_START(arg0) +#define MYSQL_MULTI_DELETE_START_ENABLED() (0) +#define MYSQL_MULTI_DELETE_DONE(arg0, arg1) +#define MYSQL_MULTI_DELETE_DONE_ENABLED() (0) +#define MYSQL_NET_READ_START() +#define MYSQL_NET_READ_START_ENABLED() (0) +#define MYSQL_NET_READ_DONE(arg0, arg1) +#define MYSQL_NET_READ_DONE_ENABLED() (0) +#define MYSQL_NET_WRITE_START(arg0) +#define MYSQL_NET_WRITE_START_ENABLED() (0) +#define MYSQL_NET_WRITE_DONE(arg0) +#define MYSQL_NET_WRITE_DONE_ENABLED() (0) +#define MYSQL_KEYCACHE_READ_START(arg0, arg1, arg2, arg3) +#define MYSQL_KEYCACHE_READ_START_ENABLED() (0) +#define MYSQL_KEYCACHE_READ_BLOCK(arg0) +#define MYSQL_KEYCACHE_READ_BLOCK_ENABLED() (0) +#define MYSQL_KEYCACHE_READ_HIT() +#define MYSQL_KEYCACHE_READ_HIT_ENABLED() (0) +#define MYSQL_KEYCACHE_READ_MISS() +#define MYSQL_KEYCACHE_READ_MISS_ENABLED() (0) +#define MYSQL_KEYCACHE_READ_DONE(arg0, arg1) +#define MYSQL_KEYCACHE_READ_DONE_ENABLED() (0) +#define MYSQL_KEYCACHE_WRITE_START(arg0, arg1, arg2, arg3) +#define MYSQL_KEYCACHE_WRITE_START_ENABLED() (0) +#define MYSQL_KEYCACHE_WRITE_BLOCK(arg0) +#define MYSQL_KEYCACHE_WRITE_BLOCK_ENABLED() (0) +#define MYSQL_KEYCACHE_WRITE_DONE(arg0, arg1) +#define MYSQL_KEYCACHE_WRITE_DONE_ENABLED() (0) + +#ifdef __cplusplus +} +#endif + +#endif /* _PROBES_MYSQL_D */ diff --git a/dep/mysqllite/include/queues.h b/dep/mysqllite/include/internal/queues.h similarity index 97% rename from dep/mysqllite/include/queues.h rename to dep/mysqllite/include/internal/queues.h index d01b73ba99906..07962f09201ec 100644 --- a/dep/mysqllite/include/queues.h +++ b/dep/mysqllite/include/internal/queues.h @@ -22,6 +22,9 @@ #ifndef _queues_h #define _queues_h + +#include "my_global.h" /* uchar */ + #ifdef __cplusplus extern "C" { #endif diff --git a/dep/mysqllite/include/rijndael.h b/dep/mysqllite/include/internal/rijndael.h similarity index 94% rename from dep/mysqllite/include/rijndael.h rename to dep/mysqllite/include/internal/rijndael.h index 89963a85c9959..71df1c48dbfd7 100644 --- a/dep/mysqllite/include/rijndael.h +++ b/dep/mysqllite/include/internal/rijndael.h @@ -1,3 +1,6 @@ +#ifndef RIJNDAEL_INCLUDED +#define RIJNDAEL_INCLUDED + /* Copyright (C) 2002 MySQL AB This program is free software; you can redistribute it and/or modify @@ -39,3 +42,5 @@ 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]); + +#endif /* RIJNDAEL_INCLUDED */ diff --git a/dep/mysqllite/include/sha1.h b/dep/mysqllite/include/internal/sha1.h similarity index 51% rename from dep/mysqllite/include/sha1.h rename to dep/mysqllite/include/internal/sha1.h index e476456a9bd02..d60d5e17c60eb 100644 --- a/dep/mysqllite/include/sha1.h +++ b/dep/mysqllite/include/internal/sha1.h @@ -1,3 +1,6 @@ +#ifndef SHA1_INCLUDED +#define SHA1_INCLUDED + /* Copyright (C) 2002, 2006 MySQL AB This program is free software; you can redistribute it and/or modify @@ -6,12 +9,13 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ /* This is the header file for code which implements the Secure @@ -25,6 +29,38 @@ Please read the file sha1.c for more information. Modified 2002 by Peter Zaitsev to better follow MySQL standards + + Original Source from: http://www.faqs.org/rfcs/rfc3174.html + + Copyright (C) The Internet Society (2001). All Rights Reserved. + + This document and translations of it may be copied and furnished to + others, and derivative works that comment on or otherwise explain it + or assist in its implementation may be prepared, copied, published + and distributed, in whole or in part, without restriction of any + kind, provided that the above copyright notice and this paragraph are + included on all such copies and derivative works. However, this + document itself may not be modified in any way, such as by removing + the copyright notice or references to the Internet Society or other + Internet organizations, except as needed for the purpose of + developing Internet standards in which case the procedures for + copyrights defined in the Internet Standards process must be + followed, or as required to translate it into languages other than + English. + + The limited permissions granted above are perpetual and will not be + revoked by the Internet Society or its successors or assigns. + + This document and the information contained herein is provided on an + "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING + TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING + BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION + HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF + MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + + Acknowledgement + Funding for the RFC Editor function is currently provided by the + Internet Society. */ @@ -64,3 +100,5 @@ 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 + +#endif /* SHA__INCLUDED */ diff --git a/dep/mysqllite/include/t_ctype.h b/dep/mysqllite/include/internal/t_ctype.h similarity index 100% rename from dep/mysqllite/include/t_ctype.h rename to dep/mysqllite/include/internal/t_ctype.h diff --git a/dep/mysqllite/include/thr_alarm.h b/dep/mysqllite/include/internal/thr_alarm.h similarity index 97% rename from dep/mysqllite/include/thr_alarm.h rename to dep/mysqllite/include/internal/thr_alarm.h index fb906039269bb..8c91fc0b899c0 100644 --- a/dep/mysqllite/include/thr_alarm.h +++ b/dep/mysqllite/include/internal/thr_alarm.h @@ -41,7 +41,7 @@ typedef struct st_alarm_info void thr_alarm_info(ALARM_INFO *info); -#if defined(DONT_USE_THR_ALARM) || !defined(THREAD) +#if defined(DONT_USE_THR_ALARM) #define USE_ALARM_THREAD #undef USE_ONE_SIGNAL_HAND @@ -64,7 +64,7 @@ typedef my_bool ALARM; #if defined(__WIN__) typedef struct st_thr_alarm_entry { - rf_SetTimer crono; + UINT_PTR crono; } thr_alarm_entry; #else /* System with posix threads */ diff --git a/dep/mysqllite/include/thr_lock.h b/dep/mysqllite/include/internal/thr_lock.h similarity index 83% rename from dep/mysqllite/include/thr_lock.h rename to dep/mysqllite/include/internal/thr_lock.h index fb70c57c0e7ae..91473737be37d 100644 --- a/dep/mysqllite/include/thr_lock.h +++ b/dep/mysqllite/include/internal/thr_lock.h @@ -1,4 +1,4 @@ -/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc. +/* Copyright 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 @@ -53,12 +53,6 @@ enum thr_lock_type { TL_IGNORE=-1, 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. @@ -83,7 +77,6 @@ enum enum_thr_lock_result { THR_LOCK_SUCCESS= 0, THR_LOCK_ABORTED= 1, 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; @@ -96,29 +89,18 @@ 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; + THR_LOCK_INFO *owner; struct st_thr_lock_data *next,**prev; struct st_thr_lock *lock; - pthread_cond_t *cond; + mysql_cond_t *cond; enum thr_lock_type type; void *status_param; /* Param to status functions */ void *debug_print_param; + struct PSI_table *m_psi; } THR_LOCK_DATA; struct st_lock_list { @@ -127,7 +109,7 @@ struct st_lock_list { typedef struct st_thr_lock { LIST list; - pthread_mutex_t mutex; + mysql_mutex_t mutex; struct st_lock_list read_wait; struct st_lock_list read; struct st_lock_list write_wait; @@ -144,30 +126,37 @@ typedef struct st_thr_lock { extern LIST *thr_lock_thread_list; -extern pthread_mutex_t THR_LOCK_lock; +extern mysql_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); + THR_LOCK_INFO *owner, + enum thr_lock_type lock_type, + ulong lock_wait_timeout); 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); + uint count, THR_LOCK_INFO *owner, + ulong lock_wait_timeout); 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); + enum thr_lock_type new_lock_type, + ulong lock_wait_timeout); 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); +my_bool thr_reschedule_write_lock(THR_LOCK_DATA *data, + ulong lock_wait_timeout); +void thr_set_lock_wait_callback(void (*before_wait)(void), + void (*after_wait)(void)); #ifdef __cplusplus } #endif diff --git a/dep/mysqllite/include/violite.h b/dep/mysqllite/include/internal/violite.h similarity index 84% rename from dep/mysqllite/include/violite.h rename to dep/mysqllite/include/internal/violite.h index 1eef3ef57302d..f408321689401 100644 --- a/dep/mysqllite/include/violite.h +++ b/dep/mysqllite/include/internal/violite.h @@ -30,6 +30,10 @@ extern "C" { #endif /* __cplusplus */ +#ifdef __cplusplus +typedef struct st_vio Vio; +#endif /* __cplusplus */ + enum enum_vio_type { VIO_CLOSED, VIO_TYPE_TCPIP, VIO_TYPE_SOCKET, VIO_TYPE_NAMEDPIPE, @@ -51,9 +55,6 @@ Vio* vio_new_win32shared_memory(HANDLE handle_file_map, 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__ */ @@ -84,10 +85,18 @@ 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); -/* Remotes in_addr */ -void vio_in_addr(Vio *vio, struct in_addr *in); -my_bool vio_poll_read(Vio *vio,uint timeout); +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_is_connected(Vio *vio); +ssize_t vio_pending(Vio *vio); + +my_bool vio_get_normalized_ip_string(const struct sockaddr *addr, int addr_length, + char *ip_string, size_t ip_string_size); + +int vio_getnameinfo(const struct sockaddr *sa, + char *hostname, size_t hostname_size, + char *port, size_t port_size, + int flags); #ifdef HAVE_OPENSSL #include @@ -109,6 +118,7 @@ typedef my_socket YASSL_SOCKET_T; #include #include +#ifndef EMBEDDED_LIBRARY enum enum_ssl_init_error { SSL_INITERR_NOERROR= 0, SSL_INITERR_CERT, SSL_INITERR_KEY, @@ -134,14 +144,9 @@ struct st_VioSSLFd const char *ca_file,const char *ca_path, const char *cipher, enum enum_ssl_init_error* error); 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 @@ -161,9 +166,10 @@ void vio_end(void); #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) (vio)->peer_addr(vio, buf, prt) -#define vio_in_addr(vio, in) (vio)->in_addr(vio, in) +#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) +#define vio_poll_read(vio, timeout) (vio)->poll_read(vio, timeout) +#define vio_is_connected(vio) (vio)->is_connected(vio) #endif /* !defined(DONT_MAP_VIO) */ /* This enumerator is used in parser - should be always visible */ @@ -185,8 +191,9 @@ struct st_vio HANDLE hPipe; my_bool localhost; /* Are we from localhost? */ int fcntl_mode; /* Buffered fcntl(sd,F_GETFL) */ - struct sockaddr_in local; /* Local internet address */ - struct sockaddr_in remote; /* Remote internet address */ + 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 */ @@ -202,12 +209,15 @@ struct st_vio my_bool (*is_blocking)(Vio*); int (*viokeepalive)(Vio*, my_bool); int (*fastsend)(Vio*); - my_bool (*peer_addr)(Vio*, char *, uint16*); - void (*in_addr)(Vio*, struct in_addr*); + 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); + my_bool (*poll_read)(Vio *vio, uint timeout); + my_bool (*is_connected)(Vio*); + my_bool (*has_data) (Vio*); #ifdef HAVE_OPENSSL void *ssl_arg; #endif diff --git a/dep/mysqllite/include/keycache.h b/dep/mysqllite/include/keycache.h index a6005bae87872..fefa31afd87a9 100644 --- a/dep/mysqllite/include/keycache.h +++ b/dep/mysqllite/include/keycache.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2003 MySQL AB +/* Copyright (C) 2003 MySQL AB, 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 @@ -17,6 +17,9 @@ #ifndef _keycache_h #define _keycache_h + +#include "my_sys.h" /* flush_type */ + C_MODE_START /* declare structures that is used by st_key_cache */ @@ -67,10 +70,10 @@ typedef struct st_key_cache 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 */ + uchar *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 */ + mysql_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 @@ -87,10 +90,10 @@ typedef struct st_key_cache 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 */ + ulonglong param_buff_size; /* size the memory allocated for the cache */ + ulonglong param_block_size; /* size of the blocks in the key cache */ + ulonglong param_division_limit; /* min. percentage of warm blocks */ + ulonglong 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 */ diff --git a/dep/mysqllite/include/m_ctype.h b/dep/mysqllite/include/m_ctype.h index 451c8db549b7a..bb7f5ddfb3d60 100644 --- a/dep/mysqllite/include/m_ctype.h +++ b/dep/mysqllite/include/m_ctype.h @@ -15,13 +15,13 @@ /* A better inplementation of the UNIX ctype(3) library. - Notes: my_global.h should be included before ctype.h */ #ifndef _m_ctype_h #define _m_ctype_h #include +#include "my_global.h" /* uint16, uchar */ #ifdef __cplusplus extern "C" { @@ -38,11 +38,29 @@ extern "C" { #define my_wc_t ulong +#define MY_CS_REPLACEMENT_CHARACTER 0xFFFD + +/* + On i386 we store Unicode->CS conversion tables for + some character sets using Big-endian order, + to copy two bytes at onces. + This gives some performance improvement. +*/ +#ifdef __i386__ +#define MB2(x) (((x) >> 8) + (((x) & 0xFF) << 8)) +#define MY_PUT_MB2(s, code) { *((uint16*)(s))= (code); } +#else +#define MB2(x) (x) +#define MY_PUT_MB2(s, code) { (s)[0]= code >> 8; (s)[1]= code & 0xFF; } +#endif + + + typedef struct unicase_info_st { - uint16 toupper; - uint16 tolower; - uint16 sort; + uint32 toupper; + uint32 tolower; + uint32 sort; } MY_UNICASE_INFO; @@ -81,12 +99,14 @@ extern MY_UNI_CTYPE my_uni_ctype[256]; #define MY_CS_BINSORT 16 /* if binary sort order */ #define MY_CS_PRIMARY 32 /* if primary collation */ #define MY_CS_STRNXFRM 64 /* if strnxfrm is used for sort */ -#define MY_CS_UNICODE 128 /* is a charset is full unicode */ +#define MY_CS_UNICODE 128 /* is a charset is BMP Unicode */ #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_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_CS_UNICODE_SUPPLEMENT 16384 /* Non-BMP Unicode characters */ #define MY_CHARSET_UNDEFINED 0 /* Character repertoire flags */ @@ -94,7 +114,6 @@ extern MY_UNI_CTYPE my_uni_ctype[256]; #define MY_REPERTOIRE_EXTENDED 2 /* Extended characters: U+0080..U+FFFF */ #define MY_REPERTOIRE_UNICODE30 3 /* ASCII | EXTENDED: U+0000..U+FFFF */ - typedef struct my_uni_idx_st { uint16 from; @@ -246,6 +265,12 @@ extern MY_CHARSET_HANDLER my_charset_8bit_handler; extern MY_CHARSET_HANDLER my_charset_ucs2_handler; +/* + We define this CHARSET_INFO_DEFINED here to prevent a repeat of the + typedef in hash.c, which will cause a compiler error. +*/ +#define CHARSET_INFO_DEFINED + /* See strings/CHARSET_INFO.txt about information on this structure */ typedef struct charset_info_st { @@ -286,10 +311,14 @@ typedef struct charset_info_st extern MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_bin; +extern MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_latin1; +extern MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_filename; + 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; @@ -298,7 +327,6 @@ 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 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; @@ -311,11 +339,48 @@ 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_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_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 MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_filename; +extern CHARSET_INFO my_charset_utf8mb4_bin; +extern CHARSET_INFO my_charset_utf8mb4_general_ci; +extern CHARSET_INFO my_charset_utf8mb4_unicode_ci; +#define MY_UTF8MB3 "utf8" +#define MY_UTF8MB4 "utf8mb4" + + +/* Helper functions to handle contraction */ +static inline my_bool +my_cs_have_contractions(CHARSET_INFO *cs) +{ + return cs->contractions != NULL; +} + +static inline my_bool +my_cs_can_be_contraction_head(CHARSET_INFO *cs, my_wc_t wc) +{ + return ((const char *)cs->contractions)[0x40*0x40 + (wc & 0xFF)]; +} + +static inline my_bool +my_cs_can_be_contraction_tail(CHARSET_INFO *cs, my_wc_t wc) +{ + return ((const char *)cs->contractions)[0x40*0x40 + (wc & 0xFF)]; +} + +static inline uint16* +my_cs_contraction2_weight(CHARSET_INFO *cs, my_wc_t wc1, my_wc_t wc2) +{ + return &cs->contractions[(wc1 - 0x40) * 0x40 + wc2 - 0x40]; +} + /* declarations for simple charsets */ extern size_t my_strnxfrm_simple(CHARSET_INFO *, uchar *, size_t, @@ -391,6 +456,7 @@ ulonglong my_strntoull10rnd_ucs2(CHARSET_INFO *cs, void my_fill_8bit(CHARSET_INFO *cs, char* to, size_t l, int fill); +/* For 8-bit character set */ my_bool my_like_range_simple(CHARSET_INFO *cs, const char *ptr, size_t ptr_length, pbool escape, pbool w_one, pbool w_many, @@ -398,6 +464,7 @@ my_bool my_like_range_simple(CHARSET_INFO *cs, char *min_str, char *max_str, size_t *min_length, size_t *max_length); +/* For ASCII-based multi-byte character sets with mbminlen=1 */ my_bool my_like_range_mb(CHARSET_INFO *cs, const char *ptr, size_t ptr_length, pbool escape, pbool w_one, pbool w_many, @@ -405,13 +472,13 @@ my_bool my_like_range_mb(CHARSET_INFO *cs, char *min_str, char *max_str, size_t *min_length, size_t *max_length); -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); - +/* For other character sets, with arbitrary mbminlen and mbmaxlen numbers */ +my_bool my_like_range_generic(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 *, const char *str,const char *str_end, @@ -438,6 +505,14 @@ 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 size_t my_caseup_mb_varlen(CHARSET_INFO *, char *src, size_t srclen, + char *dst, size_t dstlen); +extern size_t my_casedn_mb_varlen(CHARSET_INFO *, char *src, size_t srclen, + char *dst, size_t dstlen); +extern size_t my_caseup_ujis(CHARSET_INFO *, char *src, size_t srclen, + char *dst, size_t dstlen); +extern size_t my_casedn_ujis(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 *, @@ -454,6 +529,36 @@ uint my_instr_mb(struct charset_info_st *, 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_unicode(CHARSET_INFO *, + uchar *dst, size_t dstlen, + const uchar *src, size_t srclen); + +size_t my_strnxfrm_unicode_full_bin(CHARSET_INFO *, + uchar *dst, size_t dstlen, + const uchar *src, size_t srclen); +size_t my_strnxfrmlen_unicode_full_bin(CHARSET_INFO *, size_t); + int my_wildcmp_unicode(CHARSET_INFO *cs, const char *str, const char *str_end, const char *wildstr, const char *wildend, @@ -464,6 +569,8 @@ 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); +extern size_t my_strcspn(CHARSET_INFO *cs, const char *str, const char *end, + const char *accept); 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); @@ -474,6 +581,10 @@ 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); +my_bool my_charset_is_ascii_compatible(CHARSET_INFO *cs); + +extern size_t my_vsnprintf_ex(CHARSET_INFO *cs, char *to, size_t n, + const char* fmt, va_list ap); #define _MY_U 01 /* Upper case */ #define _MY_L 02 /* Lower case */ diff --git a/dep/mysqllite/include/m_string.h b/dep/mysqllite/include/m_string.h index 3e5cd063b7b72..d2194858589bc 100644 --- a/dep/mysqllite/include/m_string.h +++ b/dep/mysqllite/include/m_string.h @@ -20,6 +20,9 @@ #ifndef _m_string_h #define _m_string_h + +#include "my_global.h" /* HAVE_* */ + #ifndef __USE_GNU #define __USE_GNU /* We want to use stpcpy */ #endif @@ -49,8 +52,6 @@ # 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 */ @@ -73,7 +74,9 @@ extern "C" { extern void *(*my_str_malloc)(size_t); extern void (*my_str_free)(void *); -#if defined(HAVE_STPCPY) +#if defined(HAVE_STPCPY) && MY_GNUC_PREREQ(3, 4) && !defined(__INTEL_COMPILER) +#define strmov(A,B) __builtin_stpcpy((A),(B)) +#elif 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 */ @@ -81,53 +84,23 @@ extern char *stpcpy(char *, const char *); /* For AIX with gcc 2.95.3 */ #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]; +extern char _dig_vec_upper[]; +extern char _dig_vec_lower[]; #ifndef strmov #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 - -#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 strmov @@ -135,45 +108,55 @@ extern char *strmov(char *dst,const char *src); #else extern char *strmov_overlapp(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, ...)); +extern char *strnmov(char *dst, const char *src, size_t n); +extern char *strcont(const char *src, const char *set); +extern char *strxmov(char *dst, const char *src, ...); +extern char *strxnmov(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); @@ -188,7 +171,7 @@ 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 ll2str(A,B,C,D) int2str((A),(B),(C),(D)) #define longlong10_to_str(A,B,C) int10_to_str((A),(B),(C)) #undef strtoll #define strtoll(A,B,C) strtol((A),(B),(C)) @@ -201,7 +184,7 @@ longlong my_strtoll10(const char *nptr, char **endptr, int *error); #endif #else #ifdef HAVE_LONG_LONG -extern char *longlong2str(longlong val,char *dst,int radix); +extern char *ll2str(longlong val,char *dst,int radix, int upcase); 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); @@ -209,13 +192,7 @@ 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); +#define longlong2str(A,B,C) ll2str((A),(B),(C),1) #if defined(__cplusplus) } @@ -223,20 +200,96 @@ extern size_t my_snprintf(char *to, size_t n, const char *fmt, ...) /* LEX_STRING -- a pair of a C-string and its length. + (it's part of the plugin API as a MYSQL_LEX_STRING) */ -#ifndef _my_plugin_h -/* This definition must match the one given in mysql/plugin.h */ -struct st_mysql_lex_string -{ - char *str; - size_t length; -}; -#endif +#include 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)) +struct st_mysql_const_lex_string +{ + const char *str; + size_t length; +}; +typedef struct st_mysql_const_lex_string LEX_CSTRING; + +/* 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); +} + +static inline void lex_string_set(LEX_STRING *lex_str, const char *c_str) +{ + lex_str->str= (char *) c_str; + lex_str->length= strlen(c_str); +} + #endif diff --git a/dep/mysqllite/include/my_alloc.h b/dep/mysqllite/include/my_alloc.h index 93b7438a1df0c..4b1ffd3d4444d 100644 --- a/dep/mysqllite/include/my_alloc.h +++ b/dep/mysqllite/include/my_alloc.h @@ -23,6 +23,10 @@ #define ALLOC_MAX_BLOCK_TO_DROP 4096 #define ALLOC_MAX_BLOCK_USAGE_BEFORE_DROP 10 +#ifdef __cplusplus +extern "C" { +#endif + typedef struct st_used_mem { /* struct for once_alloc (block) */ struct st_used_mem *next; /* Next block in use */ @@ -48,4 +52,9 @@ typedef struct st_mem_root void (*error_handler)(void); } MEM_ROOT; + +#ifdef __cplusplus +} +#endif + #endif diff --git a/dep/mysqllite/include/my_attribute.h b/dep/mysqllite/include/my_attribute.h index 8309d85f20af4..d35b3013bdd25 100644 --- a/dep/mysqllite/include/my_attribute.h +++ b/dep/mysqllite/include/my_attribute.h @@ -21,6 +21,12 @@ #ifndef _my_attribute_h #define _my_attribute_h +#if defined(__GNUC__) +# ifndef GCC_VERSION +# define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__) +# endif +#endif + /* Disable __attribute__() on gcc < 2.7, g++ < 3.4, and non-gcc compilers. Some forms of __attribute__ are actually supported in earlier versions of diff --git a/dep/mysqllite/include/my_compiler.h b/dep/mysqllite/include/my_compiler.h index 1cd46ff4260fd..5f898621159c8 100644 --- a/dep/mysqllite/include/my_compiler.h +++ b/dep/mysqllite/include/my_compiler.h @@ -32,8 +32,15 @@ /* GNU C/C++ */ #if defined __GNUC__ +/* Convenience macro to test the minimum required GCC version. */ +# define MY_GNUC_PREREQ(maj, min) \ + ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) /* Any after 2.95... */ # define MY_ALIGN_EXT +/* Comunicate to the compiler the unreachability of the code. */ +# if MY_GNUC_PREREQ(4,5) +# define MY_ASSERT_UNREACHABLE() __builtin_unreachable() +# endif /* Microsoft Visual C++ */ #elif defined _MSC_VER @@ -67,8 +74,13 @@ #endif /** - Generic compiler-dependent features. + Generic (compiler-independent) features. */ + +#ifndef MY_GNUC_PREREQ +# define MY_GNUC_PREREQ(maj, min) (0) +#endif + #ifndef MY_ALIGNOF # ifdef __cplusplus template struct my_alignof_helper { char m1; type m2; }; @@ -79,6 +91,10 @@ # endif #endif +#ifndef MY_ASSERT_UNREACHABLE +# define MY_ASSERT_UNREACHABLE() do { assert(0); } while (0) +#endif + /** C++ Type Traits */ diff --git a/dep/mysqllite/include/my_dbug.h b/dep/mysqllite/include/my_dbug.h index 0ba72b2210d8f..7f8f5a1578d4b 100644 --- a/dep/mysqllite/include/my_dbug.h +++ b/dep/mysqllite/include/my_dbug.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -13,104 +13,77 @@ 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 - -#if defined(__cplusplus) && !defined(DBUG_OFF) -class Dbug_violation_helper -{ -public: - inline Dbug_violation_helper() : - _entered(TRUE) - { } - - inline ~Dbug_violation_helper() - { - assert(!_entered); - } - - inline void leave() - { - _entered= FALSE; - } - -private: - bool _entered; -}; -#endif /* C++ */ +#ifndef MY_DBUG_INCLUDED +#define MY_DBUG_INCLUDED -#ifdef __cplusplus +#ifndef __WIN__ +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif +#include +#endif /* not __WIN__ */ + +#ifdef __cplusplus extern "C" { #endif #if !defined(DBUG_OFF) && !defined(_lint) -struct _db_code_state_; -extern int _db_keyword_(struct _db_code_state_ *cs, const char *keyword); -extern int _db_strict_keyword_(const char *keyword); + +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 void _db_setjmp_(void); -extern void _db_longjmp_(void); +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_(struct _db_code_state_ *cs, const char *control); +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_, - 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,...)) +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_(const char *format,...) ATTRIBUTE_FORMAT(printf, 1, 2); -extern void _db_dump_(uint _line_,const char *keyword, +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); - -#ifdef __cplusplus - -#define DBUG_ENTER(a) \ - const char *_db_func_, *_db_file_; \ - uint _db_level_; \ - char **_db_framep_; \ - Dbug_violation_helper dbug_violation_helper; \ - _db_enter_ (a, __FILE__, __LINE__, &_db_func_, &_db_file_, \ - &_db_level_, &_db_framep_) -#define DBUG_VIOLATION_HELPER_LEAVE dbug_violation_helper.leave() - -#else /* C */ - -#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_VIOLATION_HELPER_LEAVE do { } while(0) - -#endif /* C++ */ - -#define DBUG_LEAVE \ - DBUG_VIOLATION_HELPER_LEAVE; \ - _db_return_ (__LINE__, &_db_func_, &_db_file_, &_db_level_) +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_(); +extern const char* _db_get_func_(void); + +#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))) { a1 }} while(0) + do {if (_db_keyword_(0, (keyword), 0)) { a1 }} while(0) #define DBUG_EXECUTE_IF(keyword,a1) \ - do {if (_db_strict_keyword_ (keyword)) { a1 } } while(0) + do {if (_db_keyword_(0, (keyword), 1)) { a1 }} while(0) #define DBUG_EVALUATE(keyword,a1,a2) \ - (_db_keyword_(0,(keyword)) ? (a1) : (a2)) + (_db_keyword_(0,(keyword), 0) ? (a1) : (a2)) #define DBUG_EVALUATE_IF(keyword,a1,a2) \ - (_db_strict_keyword_((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_ (0, (a1)) +#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_() @@ -123,37 +96,99 @@ extern FILE *_db_fp_(void); #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 IF_DBUG(A) A -#else /* No debugger */ +#define DEBUGGER_OFF do { _dbug_on_= 0; } while(0) +#define DEBUGGER_ON do { _dbug_on_= 1; } while(0) +#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 +#define DBUG_CHECK_CRASH(func, op) \ + do { char _dbuf_[255]; strxnmov(_dbuf_, sizeof(_dbuf_)-1, (func), (op)); \ + DBUG_EXECUTE_IF(_dbuf_, DBUG_ABORT()); } while(0) +#define DBUG_CRASH_ENTER(func) \ + DBUG_ENTER(func); DBUG_CHECK_CRASH(func, "_crash_enter") +#define DBUG_CRASH_RETURN(val) \ + DBUG_CHECK_CRASH(_db_get_func_(), "_crash_return") +#define DBUG_CRASH_VOID_RETURN \ + DBUG_CHECK_CRASH (_db_get_func_(), "_crash_return") + +/* + Make the program fail, without creating a core file. + abort() will send SIGABRT which (most likely) generates core. + Use SIGKILL instead, which cannot be caught. + We also pause the current thread, until the signal is actually delivered. + An alternative would be to use _exit(EXIT_FAILURE), + but then valgrind would report lots of memory leaks. + */ +#ifdef __WIN__ +#define DBUG_SUICIDE() DBUG_ABORT() +#else +extern void _db_suicide_(); +#define DBUG_SUICIDE() (_db_flush_(), _db_suicide_()) +#endif + +#else /* No debugger */ #define DBUG_ENTER(a1) #define DBUG_LEAVE -#define DBUG_VIOLATION_HELPER_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_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) -#define DBUG_SET(a1) do { } while(0) -#define DBUG_SET_INITIAL(a1) do { } while(0) -#define DBUG_POP() -#define DBUG_PROCESS(a1) +#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() -#define DBUG_ASSERT(A) do { } while(0) -#define DBUG_LOCK_FILE +#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 +#define DBUG_UNLOCK_FILE do { } while(0) #define DBUG_EXPLAIN(buf,len) #define DBUG_EXPLAIN_INITIAL(buf,len) -#define IF_DBUG(A) +#define DEBUGGER_OFF do { } while(0) +#define DEBUGGER_ON do { } while(0) +#define DBUG_ABORT() do { } while(0) +#define DBUG_CRASH_ENTER(func) +#define DBUG_CRASH_RETURN(val) do { return(val); } while(0) +#define DBUG_CRASH_VOID_RETURN do { return; } while(0) +#define DBUG_SUICIDE() do { } while(0) + #endif + +#ifdef EXTRA_DEBUG +/** + Sync points allow us to force the server to reach a certain line of code + and block there until the client tells the server it is ok to go on. + The client tells the server to block with SELECT GET_LOCK() + and unblocks it with SELECT RELEASE_LOCK(). Used for debugging difficult + concurrency problems +*/ +#define DBUG_SYNC_POINT(lock_name,lock_timeout) \ + debug_sync_point(lock_name,lock_timeout) +void debug_sync_point(const char* lock_name, uint lock_timeout); +#else +#define DBUG_SYNC_POINT(lock_name,lock_timeout) +#endif /* EXTRA_DEBUG */ + #ifdef __cplusplus } #endif -#endif + +#endif /* MY_DBUG_INCLUDED */ diff --git a/dep/mysqllite/include/my_dir.h b/dep/mysqllite/include/my_dir.h index 06509a3af19a0..de21bee73858d 100644 --- a/dep/mysqllite/include/my_dir.h +++ b/dep/mysqllite/include/my_dir.h @@ -13,17 +13,17 @@ 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 "my_global.h" + #include +#ifdef __cplusplus +extern "C" { +#endif + /* Defines for my_dir and my_stat */ #define MY_S_IFMT S_IFMT /* type of file */ @@ -69,7 +69,11 @@ typedef struct 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 */ @@ -97,9 +101,9 @@ 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 + +#endif /* MY_DIR_H */ + diff --git a/dep/mysqllite/include/my_getopt.h b/dep/mysqllite/include/my_getopt.h index d7c996302fd84..47feb21d85e4e 100644 --- a/dep/mysqllite/include/my_getopt.h +++ b/dep/mysqllite/include/my_getopt.h @@ -16,6 +16,8 @@ #ifndef _my_getopt_h #define _my_getopt_h +#include "my_sys.h" /* loglevel */ + C_MODE_START #define GET_NO_ARG 1 @@ -32,32 +34,57 @@ C_MODE_START #define GET_ENUM 12 #define GET_SET 13 #define GET_DOUBLE 14 +#define GET_FLAGSET 15 #define GET_ASK_ADDR 128 #define GET_TYPE_MASK 127 +/** + Enumeration of the my_option::arg_type attributes. + It should be noted that for historical reasons variables with the combination + arg_type=NO_ARG, my_option::var_type=GET_BOOL still accepts + arguments. This is someone counter intuitive and care should be taken + if the code is refactored. +*/ 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 */ - void *value; /* The variable value */ - void *u_max_value; /* The user def. max variable value */ - struct st_typelib *typelib; /* Pointer to possible values */ - ulong var_type; /* Must match the variable type */ - enum get_opt_arg_type arg_type; - longlong def_value; /* Default value */ - longlong min_value; /* Min allowed value */ - longlong max_value; /* Max allowed value */ - longlong sub_size; /* Subtract this from given value */ - long block_size; /* Value should be a mult. of this */ - void *app_type; /* To be used by an application */ + const char *name; /**< Name of the option. name=NULL + marks the end of the my_option[] + array. + */ + int id; /**< For 0255 no short option + is created, but a long option still + can be identified uniquely in the + my_get_one_option() callback. + If an opton needs neither special + treatment in the my_get_one_option() + nor one-letter short equivalent + use id=0 + */ + const char *comment; /**< option comment, for autom. --help. + if it's NULL the option is not + visible in --help. + */ + void *value; /**< A pointer to the variable value */ + void *u_max_value; /**< The user def. max variable value */ + struct st_typelib *typelib; /**< Pointer to possible values */ + ulong var_type; /**< GET_BOOL, GET_ULL, etc */ + enum get_opt_arg_type arg_type; /**< e.g. REQUIRED_ARG or OPT_ARG */ + longlong def_value; /**< Default value */ + longlong min_value; /**< Min allowed value (for numbers) */ + longlong max_value; /**< Max allowed value (for numbers) */ + longlong sub_size; /**< Unused */ + long block_size; /**< Value should be a mult. of this (for numbers) */ + void *app_type; /**< To be used by an application */ }; + typedef my_bool (*my_get_one_option)(int, const struct my_option *, char *); typedef void (*my_error_reporter)(enum loglevel level, const char *format, ...); /** @@ -69,6 +96,7 @@ typedef void (*my_error_reporter)(enum loglevel level, const char *format, ...); typedef void *(*my_getopt_value)(const char *, uint, const struct my_option *, int *); + extern char *disabled_my_option; extern my_bool my_getopt_print_errors; extern my_bool my_getopt_skip_unknown; @@ -85,6 +113,8 @@ ulonglong getopt_ull_limit_value(ulonglong num, const struct my_option *optp, my_bool *fix); longlong getopt_ll_limit_value(longlong, const struct my_option *, my_bool *fix); +double getopt_double_limit_value(double num, const struct my_option *optp, + my_bool *fix); my_bool getopt_compare_strings(const char *s, const char *t, uint length); C_MODE_END diff --git a/dep/mysqllite/include/my_global.h b/dep/mysqllite/include/my_global.h index ec22a57329b48..c1ae8a6d6bc84 100644 --- a/dep/mysqllite/include/my_global.h +++ b/dep/mysqllite/include/my_global.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2003 MySQL AB +/* Copyright (C) 2000-2003 MySQL AB, 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,6 +18,11 @@ #ifndef _global_h #define _global_h +/* Client library users on Windows need this macro defined here. */ +#if !defined(__WIN__) && defined(_WIN32) +#define __WIN__ +#endif + /* InnoDB depends on some MySQL internals which other plugins should not need. This is because of InnoDB's foreign key support, "safe" binlog @@ -41,15 +46,6 @@ #define HAVE_ERRNO_AS_DEFINE #endif /* __CYGWIN__ */ -#if defined(__QNXNTO__) && !defined(FD_SETSIZE) -#define FD_SETSIZE 1024 /* Max number of file descriptor bits in - fd_set, used when calling 'select' - Must be defined before including - "sys/select.h" and "sys/time.h" - */ -#endif - - /* to make command line shorter we'll define USE_PRAGMA_INTERFACE here */ #ifdef USE_PRAGMA_IMPLEMENTATION #define USE_PRAGMA_INTERFACE @@ -72,26 +68,28 @@ #define C_MODE_END #endif -#if defined(_WIN32) || defined(_WIN64) || defined(__WIN32__) || defined(WIN32) -#include -#elif defined(__NETWARE__) -#include -#include -#if defined(__cplusplus) && defined(inline) -#undef inline /* fix configure problem */ +#ifdef __cplusplus +#define CPP_UNNAMED_NS_START namespace { +#define CPP_UNNAMED_NS_END } #endif -#else + #include -#if defined(__cplusplus) && defined(inline) -#undef inline /* fix configure problem */ -#endif -#endif /* _WIN32... */ -/* Make it easier to add conditionl code for windows */ +#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE +#define HAVE_PSI_INTERFACE +#endif /* WITH_PERFSCHEMA_STORAGE_ENGINE */ + +/* Make it easier to add conditional code in _expressions_ */ #ifdef __WIN__ -#define IF_WIN(A,B) (A) +#define IF_WIN(A,B) A #else -#define IF_WIN(A,B) (B) +#define IF_WIN(A,B) B +#endif + +#ifdef HAVE_purify +#define IF_PURIFY(A,B) A +#else +#define IF_PURIFY(A,B) B #endif #ifndef EMBEDDED_LIBRARY @@ -105,12 +103,49 @@ #define HAVE_EXTERNAL_CLIENT #endif -/* Some defines to avoid ifdefs in the code */ -#ifndef NETWARE_YIELD -#define NETWARE_YIELD -#define NETWARE_SET_SCREEN_MODE(A) +#if defined (_WIN32) +/* + off_t is 32 bit long. We do not use C runtime functions + with off_t but native Win32 file IO APIs, that work with + 64 bit offsets. +*/ +#undef SIZEOF_OFF_T +#define SIZEOF_OFF_T 8 + +/* + Prevent inclusion of Windows GDI headers - they define symbol + ERROR that conflicts with mysql headers. +*/ +#ifndef NOGDI +#define NOGDI #endif +/* Include common headers.*/ +#include +#include /* SOCKET */ +#include /* access(), chmod() */ +#include /* getpid() */ + +#define sleep(a) Sleep((a)*1000) + +/* Define missing access() modes. */ +#define F_OK 0 +#define W_OK 2 + +/* Define missing file locking constants. */ +#define F_RDLCK 1 +#define F_WRLCK 2 +#define F_UNLCK 3 +#define F_TO_EOF 0x3FFFFFFF + +/* Shared memory and named pipe connections are supported. */ +#define HAVE_SMEM 1 +#define HAVE_NAMED_PIPE 1 +#define shared_memory_buffer_length 16000 +#define default_shared_memory_base_name "MYSQL" +#endif /* _WIN32*/ + + /* Workaround for _LARGE_FILES and _LARGE_FILE_API incompatibility on AIX */ #if defined(_AIX) && defined(_LARGE_FILE_API) #undef _LARGE_FILE_API @@ -163,108 +198,6 @@ #define likely(x) __builtin_expect((x),1) #define unlikely(x) __builtin_expect((x),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 */ #if defined(TARGET_OS_LINUX) || defined(__GLIBC__) #undef _GNU_SOURCE @@ -279,13 +212,6 @@ #include #endif -/* The client defines this to avoid all thread code */ -#if defined(MYSQL_CLIENT_NO_THREADS) || defined(UNDEF_THREADS_HACK) -#undef THREAD -#undef HAVE_LINUXTHREADS -#undef HAVE_NPTL -#endif - #ifdef HAVE_THREADS_WITHOUT_SOCKETS /* MIT pthreads does not work with unix sockets */ #undef HAVE_SYS_UN_H @@ -328,7 +254,7 @@ #endif #endif -#if defined(THREAD) && !defined(__WIN__) +#if !defined(__WIN__) #ifndef _POSIX_PTHREAD_SEMANTICS #define _POSIX_PTHREAD_SEMANTICS /* We want posix threads */ #endif @@ -349,7 +275,7 @@ C_MODE_END #if !defined(SCO) && !defined(_REENTRANT) #define _REENTRANT 1 /* Threads requires reentrant code */ #endif -#endif /* THREAD */ +#endif /* !defined(__WIN__) */ /* Go around some bugs in different OS and compilers */ #ifdef _AIX /* By soren@t.dk */ @@ -374,10 +300,6 @@ C_MODE_END #undef HAVE_PREAD #undef HAVE_PWRITE #endif -#if defined(HAVE_BROKEN_INLINE) && !defined(__cplusplus) -#undef inline -#define inline -#endif #ifdef UNDEF_HAVE_GETHOSTBYNAME_R /* For OSF4.x */ #undef HAVE_GETHOSTBYNAME_R @@ -392,18 +314,6 @@ C_MODE_END #error "Please add -fno-exceptions to CXXFLAGS and reconfigure/recompile" #endif - -/* Fix a bug in gcc 2.8.0 on IRIX 6.2 */ -#if SIZEOF_LONG == 4 && defined(__LONG_MAX__) && (__GNUC__ == 2 && __GNUC_MINOR__ == 8) -#undef __LONG_MAX__ /* Is a longlong value in gcc 2.8.0 ??? */ -#define __LONG_MAX__ 2147483647 -#endif - -/* egcs 1.1.2 has a problem with memcpy on Alpha */ -#if defined(__GNUC__) && defined(__alpha__) && ! (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)) -#define BAD_MEMCPY -#endif - #if defined(_lint) && !defined(lint) #define lint #endif @@ -414,6 +324,7 @@ C_MODE_END #ifndef stdin #include #endif +#include #ifdef HAVE_STDLIB_H #include #endif @@ -482,20 +393,22 @@ C_MODE_END #define compile_time_assert(X) \ do \ { \ - char compile_time_assert[(X) ? 1 : -1] \ - __attribute__ ((unused)); \ + 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) +#ifndef _LARGEFILE64_SOURCE #define _LARGEFILE64_SOURCE #endif +#endif + #if defined(_HPUX_SOURCE) && defined(HAVE_SYS_STREAM_H) #include /* HPUX 10.20 defines ulong here. UGLY !!! */ #define HAVE_ULONG #endif -#if defined(HPUX10) && defined(_LARGEFILE64_SOURCE) && defined(THREAD) +#if defined(HPUX10) && defined(_LARGEFILE64_SOURCE) /* Fix bug in setrlimit */ #undef setrlimit #define setrlimit cma_setrlimit64 @@ -505,32 +418,6 @@ C_MODE_END extern "C" int madvise(void *addr, size_t len, int behav); #endif -#ifdef __QNXNTO__ -/* This has to be after include limits.h */ -#define HAVE_ERRNO_AS_DEFINE -#define HAVE_FCNTL_LOCK -#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 */ - -#define USE_MYFUNC 1 /* Must use syscall indirection */ -#define MASTER 1 /* Compile without unireg */ -#define ENGLISH 1 /* Messages in English */ -#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 */ -#define USE_BMOVE512 1 /* Use this unless system bmove is faster */ - #define QUOTE_ARG(x) #x /* Quote argument (before cpp) */ #define STRINGIFY_ARG(x) QUOTE_ARG(x) /* Quote argument, after cpp */ @@ -545,17 +432,6 @@ extern "C" int madvise(void *addr, size_t len, int behav); #define SIGNAL_HANDLER_RESET_ON_DELIVERY #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 */ - /* Deprecated workaround for false-positive uninitialized variables warnings. Those should be silenced using tool-specific heuristics. @@ -569,6 +445,16 @@ int __void__; #define LINT_INIT(var) #endif +#ifndef SO_EXT +#ifdef _WIN32 +#define SO_EXT ".dll" +#elif defined(__APPLE__) +#define SO_EXT ".dylib" +#else +#define SO_EXT ".so" +#endif +#endif + /* Suppress uninitialized variable warning without generating code. @@ -583,12 +469,6 @@ int __void__; #define UNINIT_VAR(x) x= x #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(HAVE_UINT) #undef HAVE_UINT #define HAVE_UINT @@ -596,8 +476,6 @@ typedef unsigned int uint; typedef unsigned short ushort; #endif -#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) { t dummy; dummy= a; a= b; b= dummy; } #define test(a) ((a) ? 1 : 0) #define set_if_bigger(a,b) do { if ((a) < (b)) (a)=(b); } while(0) @@ -611,18 +489,6 @@ typedef unsigned short ushort; #define FALSE (0) /* Logical false */ #endif -#if defined(__GNUC__) -#define function_volatile volatile -#define my_reinterpret_cast(A) reinterpret_cast -#define my_const_cast(A) const_cast -# ifndef GCC_VERSION -# define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__) -# endif -#elif !defined(my_reinterpret_cast) -#define my_reinterpret_cast(A) (A) -#define my_const_cast(A) (A) -#endif - #include /* @@ -636,16 +502,6 @@ int __cxa_pure_virtual () __attribute__ ((weak)); C_MODE_END #endif -/* From old s-system.h */ - -/* - Support macros for non ansi & other old compilers. Since such - things are no longer supported we do nothing. We keep then since - some of our code may still be needed to upgrade old customers. -*/ -#define _VARARGS(X) X -#define _STATIC_VARARGS(X) X - /* The DBUG_ON flag always takes precedence over default DBUG_OFF */ #if defined(DBUG_ON) && defined(DBUG_OFF) #undef DBUG_OFF @@ -659,16 +515,12 @@ C_MODE_END # endif #endif -#include - -#define MIN_ARRAY_SIZE 0 /* Zero or One. Gcc allows zero*/ -#define ASCII_BITS_USED 8 /* Bit char used */ -#define NEAR_F /* No near function handling */ - /* Some types that is different between systems */ typedef int File; /* File descriptor */ -#ifndef Socket_defined +#ifdef _WIN32 +typedef SOCKET my_socket; +#else typedef int my_socket; /* File descriptor for sockets */ #define INVALID_SOCKET -1 #endif @@ -739,14 +591,7 @@ typedef SOCKET_SIZE_TYPE size_socket; #endif /* __WIN__ */ -/* #define USE_RECORD_LOCK */ - - /* Unsigned types supported by the compiler */ -#define UNSINT8 /* unsigned int8 (char) */ -#define UNSINT16 /* unsigned int16 */ -#define UNSINT32 /* unsigned int32 */ - - /* General constants */ +/* General constants */ #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) */ @@ -756,19 +601,59 @@ typedef SOCKET_SIZE_TYPE size_socket; #define FN_CURLIB '.' /* ./ is used as abbrev for current dir */ #define FN_PARENTDIR ".." /* Parent directory; Must be a string */ -#ifndef FN_LIBCHAR +#ifdef _WIN32 +#define FN_LIBCHAR '\\' +#define FN_LIBCHAR2 '/' +#define FN_DIRSEP "/\\" /* Valid directory separators */ +#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 */ +#else #define FN_LIBCHAR '/' +#define FN_LIBCHAR2 '/' +#define FN_DIRSEP "/" /* Valid directory separators */ #define FN_ROOTDIR "/" #endif -#define MY_NFILE 64 /* This is only used to save filenames */ + +/* + 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 + +/* + 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 UINT_MAX #endif -/* #define EXT_IN_LIBNAME */ -/* #define FN_NO_CASE_SENCE */ -/* #define FN_UPPER_CASE TRUE */ - /* Io buffer size; Must be a power of 2 and a multiple of 512. May be smaller what the disk page size. This influences the speed of the @@ -779,27 +664,22 @@ typedef SOCKET_SIZE_TYPE size_socket; How much overhead does malloc have. The code often allocates something like 1024-MALLOC_OVERHEAD bytes */ -#ifdef SAFEMALLOC -#define MALLOC_OVERHEAD (8+24+4) -#else #define MALLOC_OVERHEAD 8 -#endif + /* get memory in huncs */ #define ONCE_ALLOC_INIT (uint) (4096-MALLOC_OVERHEAD) /* Typical record cash */ #define RECORD_CACHE_SIZE (uint) (64*1024-MALLOC_OVERHEAD) /* Typical key cash */ -#define KEY_CACHE_SIZE (uint) (8*1024*1024-MALLOC_OVERHEAD) +#define KEY_CACHE_SIZE (uint) (8*1024*1024) /* Default size of a key cache block */ #define KEY_CACHE_BLOCK_SIZE (uint) 1024 /* 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 */ @@ -807,6 +687,31 @@ typedef SOCKET_SIZE_TYPE size_socket; #undef remove /* Crashes MySQL on SCO 5.0.0 */ #ifndef __WIN__ #define closesocket(A) close(A) +#endif + +#if (_MSC_VER) +#if !defined(_WIN64) +inline double my_ulonglong2double(unsigned long long value) +{ + long long nr=(long long) value; + if (nr >= 0) + return (double) nr; + return (18446744073709551616.0 + (double) nr); +} +#define ulonglong2double my_ulonglong2double +#define my_off_t2double my_ulonglong2double +#endif /* _WIN64 */ +inline unsigned long long my_double2ulonglong(double d) +{ + double t= d - (double) 0x8000000000000000ULL; + + if (t >= 0) + return ((unsigned long long) t) + 0x8000000000000000ULL; + return (unsigned long long) d; +} +#define double2ulonglong my_double2ulonglong +#endif + #ifndef ulonglong2double #define ulonglong2double(A) ((double) (ulonglong) (A)) #define my_off_t2double(A) ((double) (my_off_t) (A)) @@ -814,13 +719,11 @@ typedef SOCKET_SIZE_TYPE size_socket; #ifndef double2ulonglong #define double2ulonglong(A) ((ulonglong) (double) (A)) #endif -#endif #ifndef offsetof #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) #endif #define ulong_to_double(X) ((double) (ulong) (X)) -#define SET_STACK_SIZE(X) /* Not needed on real machines */ #ifndef STACK_DIRECTION #error "please add -DSTACK_DIRECTION=1 or -1 to your CPPFLAGS" @@ -839,7 +742,6 @@ typedef SOCKET_SIZE_TYPE size_socket; /* Some pre-ANSI-C99 systems like AIX 5.1 and Linux/GCC 2.95 define ULONGLONG_MAX, LONGLONG_MIN, LONGLONG_MAX; we use them if they're defined. - Also on Windows we define these constants by hand in config-win.h. */ #if defined(HAVE_LONG_LONG) && !defined(LONGLONG_MIN) @@ -856,6 +758,8 @@ typedef SOCKET_SIZE_TYPE size_socket; #endif #endif /* defined (HAVE_LONG_LONG) && !defined(ULONGLONG_MAX)*/ +#define INT_MIN64 (~0x7FFFFFFFFFFFFFFFLL) +#define INT_MAX64 0x7FFFFFFFFFFFFFFFLL #define INT_MIN32 (~0x7FFFFFFFL) #define INT_MAX32 0x7FFFFFFFL #define UINT_MAX32 0xFFFFFFFFL @@ -935,9 +839,6 @@ typedef long long my_ptrdiff_t; #define MY_ALIGN(A,L) (((A) + (L) - 1) & ~((L) - 1)) #define ALIGN_SIZE(A) MY_ALIGN((A),sizeof(double)) /* Size to make adressable obj. */ -#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) ((uchar*) (ptr)+size) #define PTR_BYTE_DIFF(A,B) (my_ptrdiff_t) ((uchar*) (A) - (uchar*) (B)) @@ -957,18 +858,14 @@ typedef long long my_ptrdiff_t; ((size_t)((char *)&(((TYPE *)0x10)->MEMBER) - (char*)0x10)) #define NullS (char *) 0 -/* Nowdays we do not support MessyDos */ -#ifndef NEAR -#define NEAR /* Who needs segments ? */ -#define FAR /* On a good machine */ -#ifndef HUGE_PTR -#define HUGE_PTR -#endif + +#ifdef STDCALL +#undef STDCALL #endif -#if defined(__IBMC__) || defined(__IBMCPP__) -/* This was _System _Export but caused a lot of warnings on _AIX43 */ -#define STDCALL -#elif !defined( STDCALL) + +#ifdef _WIN32 +#define STDCALL __stdcall +#else #define STDCALL #endif @@ -1052,31 +949,24 @@ typedef long long intptr; #define MY_ERRPTR ((void*)(intptr)1) -#ifdef USE_RAID -/* - The following is done with a if to not get problems with pre-processors - with late define evaluation -*/ -#if SIZEOF_OFF_T == 4 -#define SYSTEM_SIZEOF_OFF_T 4 -#else -#define SYSTEM_SIZEOF_OFF_T 8 -#endif -#undef SIZEOF_OFF_T -#define SIZEOF_OFF_T 8 +#if defined(_WIN32) +typedef unsigned long long my_off_t; +typedef unsigned long long os_off_t; #else -#define SYSTEM_SIZEOF_OFF_T SIZEOF_OFF_T -#endif /* USE_RAID */ - +typedef off_t os_off_t; #if SIZEOF_OFF_T > 4 typedef ulonglong my_off_t; #else typedef unsigned long my_off_t; #endif +#endif /*_WIN32*/ #define MY_FILEPOS_ERROR (~(my_off_t) 0) -#if !defined(__WIN__) -typedef off_t os_off_t; -#endif + +/* + TODO Convert these to use Bitmap class. + */ +typedef ulonglong table_map; /* Used for table bits in join */ +typedef ulong nesting_map; /* Used for flags of nesting constructs */ #if defined(__WIN__) #define socket_errno WSAGetLastError() @@ -1099,17 +989,10 @@ typedef off_t os_off_t; #define SOCKET_EMFILE EMFILE #endif -typedef uint8 int7; /* Most effective integer 0 <= x <= 127 */ -typedef short int15; /* Most effective integer 0 <= x <= 32767 */ typedef int myf; /* Type of MyFlags in my_funcs */ typedef char my_bool; /* Small bool */ -#if !defined(bool) && (!defined(HAVE_BOOL) || !defined(__cplusplus)) -typedef char bool; /* Ordinary boolean values 0 1 */ -#endif - /* Macros for converting *constants* to the right type */ -#define INT8(v) (int8) (v) -#define INT16(v) (int16) (v) -#define INT32(v) (int32) (v) + +/* Macros for converting *constants* to the right type */ #define MYF(v) (myf) (v) #ifndef LL @@ -1151,23 +1034,11 @@ typedef char bool; /* Ordinary boolean values 0 1 */ #define reg16 register #endif -/* - Sometimes we want to make sure that the variable is not put into - a register in debugging mode so we can see its value in the core -*/ - -#ifndef DBUG_OFF -#define dbug_volatile volatile -#else -#define dbug_volatile -#endif +#include /* 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 */ @@ -1365,8 +1236,8 @@ do { doubleget_union _tmp; \ ((uchar*) &def_temp)[7]=(M)[0];\ (V) = def_temp; } while(0) #else -#define float4get(V,M) memcpy_fixed((uchar*) &V,(uchar*) (M),sizeof(float)) -#define float4store(V,M) memcpy_fixed((uchar*) V,(uchar*) (&M),sizeof(float)) +#define float4get(V,M) memcpy(&V, (M), sizeof(float)) +#define float4store(V,M) memcpy(V, (&M), sizeof(float)) #if defined(__FLOAT_WORD_ORDER) && (__FLOAT_WORD_ORDER == __BIG_ENDIAN) #define doublestore(T,V) do { *(((char*)T)+0)=(char) ((uchar *) &V)[4];\ @@ -1436,12 +1307,12 @@ do { doubleget_union _tmp; \ *(((char*)T)+1)=(((A) >> 16));\ *(((char*)T)+0)=(((A) >> 24)); } while(0) -#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)) +#define floatget(V,M) memcpy(&V, (M), sizeof(float)) +#define floatstore(T,V) memcpy((T), (void*) (&V), sizeof(float)) +#define doubleget(V,M) memcpy(&V, (M), sizeof(double)) +#define doublestore(T,V) memcpy((T), (void *) &V, sizeof(double)) +#define longlongget(V,M) memcpy(&V, (M), sizeof(ulonglong)) +#define longlongstore(T,V) memcpy((T), &V, sizeof(ulonglong)) #else @@ -1452,29 +1323,18 @@ 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((uchar*) (T),(uchar*) (&V),sizeof(float)) -#define floatget(V,M) memcpy_fixed((uchar*) &V, (uchar*) (M), sizeof(float)) +#define floatstore(T,V) memcpy((T), (void *) (&V), sizeof(float)) +#define floatget(V,M) memcpy(&V, (M), sizeof(float)) #endif #ifndef doubleget -#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 doubleget(V,M) memcpy(&V, (M), sizeof(double)) +#define doublestore(T,V) memcpy((T), (void *) &V, sizeof(double)) #endif /* doubleget */ -#define longlongget(V,M) memcpy_fixed((uchar*) &V,(uchar*) (M),sizeof(ulonglong)) -#define longlongstore(T,V) memcpy_fixed((uchar*) (T),(uchar*) &V,sizeof(ulonglong)) +#define longlongget(V,M) memcpy(&V, (M), sizeof(ulonglong)) +#define longlongstore(T,V) memcpy((T), &V, sizeof(ulonglong)) #endif /* WORDS_BIGENDIAN */ -#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 #define MYSQL_UNIVERSAL_CLIENT_CHARSET "utf8" #else @@ -1485,45 +1345,36 @@ do { doubleget_union _tmp; \ #define NO_EMBEDDED_ACCESS_CHECKS #endif -#ifdef HAVE_DLOPEN -#if defined(__WIN__) -#define dlsym(lib, name) GetProcAddress((HMODULE)lib, name) +#if defined(_WIN32) +#define dlsym(lib, name) (void*)GetProcAddress((HMODULE)lib, name) #define dlopen(libname, unused) LoadLibraryEx(libname, NULL, 0) #define dlclose(lib) FreeLibrary((HMODULE)lib) -#elif defined(HAVE_DLFCN_H) -#include +#ifndef HAVE_DLOPEN +#define HAVE_DLOPEN #endif #endif -/* FreeBSD 2.2.2 does not define RTLD_NOW) */ -#ifndef RTLD_NOW -#define RTLD_NOW 1 +#ifdef HAVE_DLOPEN +#if defined(HAVE_DLFCN_H) +#include +#endif #endif #ifndef HAVE_DLERROR +#ifdef _WIN32 #define dlerror() "" +#else +#define dlerror() "No support for dynamic loading (static build?)" +#endif #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 @@ -1536,6 +1387,7 @@ inline void operator delete[](void*, void*) { /* Do nothing */ } #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. @@ -1548,6 +1400,25 @@ inline void operator delete[](void*, void*) { /* Do nothing */ } #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 @@ -1596,4 +1467,17 @@ static inline double rint(double x) #endif #endif +/* Defines that are unique to the embedded version of MySQL */ + +#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 */ + +#undef HAVE_OPENSSL +#undef HAVE_SMEM /* No shared memory */ +#undef HAVE_NDBCLUSTER_DB /* No NDB cluster */ + +#endif /* EMBEDDED_LIBRARY */ + #endif /* my_global_h */ diff --git a/dep/mysqllite/include/my_list.h b/dep/mysqllite/include/my_list.h index 775b56587b88c..ff086e1725b01 100644 --- a/dep/mysqllite/include/my_list.h +++ b/dep/mysqllite/include/my_list.h @@ -37,7 +37,7 @@ 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((unsigned char *) old,MYF(MY_FAE)); } +#define list_pop(A) {LIST *old=(A); (A)=list_delete(old,old); my_free(old); } #ifdef __cplusplus } diff --git a/dep/mysqllite/include/my_net.h b/dep/mysqllite/include/my_net.h index 3af79ea3db509..5762f5da06e89 100644 --- a/dep/mysqllite/include/my_net.h +++ b/dep/mysqllite/include/my_net.h @@ -14,9 +14,6 @@ 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. @@ -24,6 +21,9 @@ #ifndef _my_net_h #define _my_net_h + +#include "my_global.h" /* C_MODE_START, C_MODE_END */ + C_MODE_START #include @@ -43,7 +43,7 @@ C_MODE_START #include #endif -#if !defined(__WIN__) && !defined(HAVE_BROKEN_NETINET_INCLUDES) && !defined(__BEOS__) && !defined(__NETWARE__) +#if !defined(__WIN__) && !defined(HAVE_BROKEN_NETINET_INCLUDES) #include #include #include @@ -73,22 +73,10 @@ C_MODE_START #define in_addr_t uint32 #endif -/* On some operating systems (e.g. Solaris) INADDR_NONE is not defined */ -#ifndef INADDR_NONE -#define INADDR_NONE -1 /* Error value from inet_addr */ -#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(HPUX10) -struct hostent; -#endif /* HPUX */ #if !defined(HAVE_GETHOSTBYNAME_R) struct hostent *my_gethostbyname_r(const char *name, struct hostent *result, char *buffer, @@ -118,11 +106,5 @@ struct hostent *my_gethostbyname_r(const char *name, #define GETHOSTBYNAME_BUFF_SIZE 2048 #endif -/* On SCO you get a link error when refering to h_errno */ -#ifdef SCO -#undef h_errno -#define h_errno errno -#endif - C_MODE_END #endif diff --git a/dep/mysqllite/include/my_no_pthread.h b/dep/mysqllite/include/my_no_pthread.h deleted file mode 100644 index 511fac407d589..0000000000000 --- a/dep/mysqllite/include/my_no_pthread.h +++ /dev/null @@ -1,58 +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 */ - - -#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) - -typedef int my_pthread_once_t; -#define MY_PTHREAD_ONCE_INIT 0 -#define MY_PTHREAD_ONCE_DONE 1 - -#define my_pthread_once(C,F) do { \ - if (*(C) != MY_PTHREAD_ONCE_DONE) { F(); *(C)= MY_PTHREAD_ONCE_DONE; } \ - } while(0) - -#endif diff --git a/dep/mysqllite/include/my_pthread.h b/dep/mysqllite/include/my_pthread.h index fec7c972a7b37..f1636cad136d6 100644 --- a/dep/mysqllite/include/my_pthread.h +++ b/dep/mysqllite/include/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,6 +18,8 @@ #ifndef _my_pthread_h #define _my_pthread_h +#include "my_global.h" /* myf */ + #ifndef ETIME #define ETIME ETIMEDOUT /* For FreeBSD */ #endif @@ -31,11 +33,10 @@ extern "C" { #if defined(__WIN__) typedef CRITICAL_SECTION pthread_mutex_t; -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; @@ -47,25 +48,35 @@ typedef struct st_pthread_link { struct st_pthread_link *next; } pthread_link; -typedef struct { - uint32 waiting; - CRITICAL_SECTION lock_waiting; - - enum { - SIGNAL= 0, - BROADCAST= 1, - MAX_EVENTS= 2 - } EVENTS; - - HANDLE events[MAX_EVENTS]; - HANDLE broadcast_block_event; - +/** + Implementation of Windows condition variables. + We use native conditions on Vista and later, and fallback to own + implementation on earlier OS version. +*/ +typedef union +{ + /* Native condition (used on Vista and later) */ + CONDITION_VARIABLE native_cond; + + /* Own implementation (used on XP) */ + struct + { + uint32 waiting; + CRITICAL_SECTION lock_waiting; + enum + { + SIGNAL= 0, + BROADCAST= 1, + MAX_EVENTS= 2 + } EVENTS; + HANDLE events[MAX_EVENTS]; + HANDLE broadcast_block_event; + }; } pthread_cond_t; typedef int pthread_mutexattr_t; -#define win_pthread_self my_thread_var->pthread_self -#define pthread_self() win_pthread_self +#define pthread_self() GetCurrentThreadId() #define pthread_handler_t EXTERNC void * __cdecl typedef void * (__cdecl *pthread_handler)(void *); @@ -104,10 +115,22 @@ struct timespec { (ABSTIME).max_timeout_msec= (long)((NSEC)/1000000); \ } -void win_pthread_init(void); -int win_pthread_setspecific(void *A,void *B,uint length); +/** + Compare two timespec structs. + + @retval 1 If TS1 ends after TS2. + + @retval 0 If TS1 is equal to TS2. + + @retval -1 If TS1 ends before TS2. +*/ +#define cmp_timespec(TS1, TS2) \ + ((TS1.tv.i64 > TS2.tv.i64) ? 1 : \ + ((TS1.tv.i64 < TS2.tv.i64) ? -1 : 0)) + + int win_pthread_mutex_trylock(pthread_mutex_t *mutex); -int pthread_create(pthread_t *,pthread_attr_t *,pthread_handler,void *); +int pthread_create(pthread_t *, const pthread_attr_t *, pthread_handler, void *); int pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr); int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex); int pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex, @@ -117,69 +140,50 @@ 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); int my_pthread_once(my_pthread_once_t *once_control,void (*init_routine)(void)); 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); +int pthread_cancel(pthread_t thread); -void pthread_exit(void *a); /* was #define pthread_exit(A) ExitThread(A)*/ - +#ifndef ETIMEDOUT #define ETIMEDOUT 145 /* Win32 doesn't have this */ -#define getpid() GetCurrentThreadId() +#endif #define HAVE_LOCALTIME_R 1 #define _REENTRANT 1 #define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1 -/* - Windows has two ways to use thread local storage. The most efficient - is using __declspec(thread), but that does not work properly when - used in a .dll that is loaded at runtime, after program load. So for - libmysql.dll and libmysqld.dll we define USE_TLS in order to use the - TlsXxx() API instead, which works in all cases. -*/ -#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)) #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_destroy(A) DeleteCriticalSection(A) -#define my_pthread_setprio(A,B) SetThreadPriority(GetCurrentThread(), (B)) +#define pthread_mutex_unlock(A) (LeaveCriticalSection(A), 0) +#define pthread_mutex_destroy(A) (DeleteCriticalSection(A), 0) #define pthread_kill(A,B) pthread_dummy((A) ? 0 : ESRCH) -#define pthread_join(A,B) (WaitForSingleObject((A), INFINITE) != WAIT_OBJECT_0) /* 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 my_pthread_getprio(thread_id) pthread_dummy(0) +#define pthread_yield() SwitchToThread() +#define my_sigset(A,B) signal(A,B) #else /* Normal threads */ @@ -202,13 +206,6 @@ void pthread_exit(void *a); /* was #define pthread_exit(A) ExitThread(A)*/ #include #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)) @@ -217,7 +214,11 @@ extern int my_pthread_getprio(pthread_t thread_id); typedef void *(* pthread_handler)(void *); #define my_pthread_once_t pthread_once_t +#if defined(PTHREAD_ONCE_INITIALIZER) +#define MY_PTHREAD_ONCE_INIT PTHREAD_ONCE_INITIALIZER +#else #define MY_PTHREAD_ONCE_INIT PTHREAD_ONCE_INIT +#endif #define my_pthread_once(C,F) pthread_once(C,F) /* Test first for RTS or FSU threads */ @@ -270,14 +271,12 @@ int sigwait(sigset_t *setp, int *sigp); /* Use our implemention */ */ #if defined(HAVE_SIGACTION) && !defined(my_sigset) #define my_sigset(A,B) do { struct sigaction l_s; sigset_t l_set; \ - IF_DBUG(int l_rc); \ DBUG_ASSERT((A) != 0); \ sigemptyset(&l_set); \ l_s.sa_handler = (B); \ l_s.sa_mask = l_set; \ l_s.sa_flags = 0; \ - IF_DBUG(l_rc=) sigaction((A), &l_s, NULL); \ - DBUG_ASSERT(l_rc == 0); \ + sigaction((A), &l_s, NULL); \ } while (0) #elif defined(HAVE_SIGSET) && !defined(my_sigset) #define my_sigset(A,B) sigset((A),(B)) @@ -285,26 +284,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)) -#elif defined(HAVE_PTHREAD_SETSCHEDPRIO) -#define my_pthread_setprio(A,B) pthread_setschedprio((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 */ @@ -386,7 +365,7 @@ struct tm *gmtime_r(const time_t *clock, struct tm *res); #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 */ +#else /* HAVE_PTHREAD_ATTR_CREATE && !HAVE_SIGWAIT */ #define HAVE_PTHREAD_KILL #endif @@ -410,6 +389,17 @@ 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 @@ -451,11 +441,34 @@ int my_pthread_mutex_trylock(pthread_mutex_t *mutex); #endif /* !set_timespec_nsec */ #endif /* HAVE_TIMESPEC_TS_SEC */ - /* safe_mutex adds checking to mutex for easier debugging */ +/** + Compare two timespec structs. -#if defined(__NETWARE__) && !defined(SAFE_MUTEX_DETECT_DESTROY) -#define SAFE_MUTEX_DETECT_DESTROY -#endif + @retval 1 If TS1 ends after TS2. + + @retval 0 If TS1 is equal to TS2. + + @retval -1 If TS1 ends before TS2. +*/ +#ifdef HAVE_TIMESPEC_TS_SEC +#ifndef cmp_timespec +#define cmp_timespec(TS1, TS2) \ + ((TS1.ts_sec > TS2.ts_sec || \ + (TS1.ts_sec == TS2.ts_sec && TS1.ts_nsec > TS2.ts_nsec)) ? 1 : \ + ((TS1.ts_sec < TS2.ts_sec || \ + (TS1.ts_sec == TS2.ts_sec && TS1.ts_nsec < TS2.ts_nsec)) ? -1 : 0)) +#endif /* !cmp_timespec */ +#else +#ifndef cmp_timespec +#define cmp_timespec(TS1, TS2) \ + ((TS1.tv_sec > TS2.tv_sec || \ + (TS1.tv_sec == TS2.tv_sec && TS1.tv_nsec > TS2.tv_nsec)) ? 1 : \ + ((TS1.tv_sec < TS2.tv_sec || \ + (TS1.tv_sec == TS2.tv_sec && TS1.tv_nsec < TS2.tv_nsec)) ? -1 : 0)) +#endif /* !cmp_timespec */ +#endif /* HAVE_TIMESPEC_TS_SEC */ + + /* safe_mutex adds checking to mutex for easier debugging */ typedef struct st_safe_mutex_t { @@ -492,7 +505,8 @@ 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, uint line); int safe_cond_timedwait(pthread_cond_t *cond, safe_mutex_t *mp, - struct timespec *abstime, const char *file, uint line); + const struct timespec *abstime, + const char *file, uint line); void safe_mutex_global_init(void); void safe_mutex_end(FILE *file); @@ -594,30 +608,171 @@ int my_pthread_fastmutex_lock(my_pthread_fastmutex_t *mp); #define my_rwlock_init(A,B) rwlock_init((A),USYNC_THREAD,0) #else /* Use our own version of read/write locks */ -typedef struct _my_rw_lock_t { - pthread_mutex_t lock; /* lock for structure */ - pthread_cond_t readers; /* waiting readers */ - pthread_cond_t writers; /* waiting writers */ - int state; /* -1:writer,0:free,>0:readers */ - int waiters; /* number of waiting writers */ -} my_rw_lock_t; - +#define NEED_MY_RW_LOCK 1 #define rw_lock_t my_rw_lock_t +#define my_rwlock_init(A,B) my_rw_init((A)) #define rw_rdlock(A) my_rw_rdlock((A)) #define rw_wrlock(A) my_rw_wrlock((A)) #define rw_tryrdlock(A) my_rw_tryrdlock((A)) #define rw_trywrlock(A) my_rw_trywrlock((A)) #define rw_unlock(A) my_rw_unlock((A)) -#define rwlock_destroy(A) my_rwlock_destroy((A)) +#define rwlock_destroy(A) my_rw_destroy((A)) +#define rw_lock_assert_write_owner(A) my_rw_lock_assert_write_owner((A)) +#define rw_lock_assert_not_write_owner(A) my_rw_lock_assert_not_write_owner((A)) +#endif /* USE_MUTEX_INSTEAD_OF_RW_LOCKS */ + + +/** + Portable implementation of special type of read-write locks. + + These locks have two properties which are unusual for rwlocks: + 1) They "prefer readers" in the sense that they do not allow + situations in which rwlock is rd-locked and there is a + pending rd-lock which is blocked (e.g. due to pending + request for wr-lock). + This is a stronger guarantee than one which is provided for + PTHREAD_RWLOCK_PREFER_READER_NP rwlocks in Linux. + MDL subsystem deadlock detector relies on this property for + its correctness. + 2) They are optimized for uncontended wr-lock/unlock case. + This is scenario in which they are most oftenly used + within MDL subsystem. Optimizing for it gives significant + performance improvements in some of tests involving many + connections. + + Another important requirement imposed on this type of rwlock + by the MDL subsystem is that it should be OK to destroy rwlock + object which is in unlocked state even though some threads might + have not yet fully left unlock operation for it (of course there + is an external guarantee that no thread will try to lock rwlock + which is destroyed). + Putting it another way the unlock operation should not access + rwlock data after changing its state to unlocked. + + TODO/FIXME: We should consider alleviating this requirement as + it blocks us from doing certain performance optimizations. +*/ + +typedef struct st_rw_pr_lock_t { + /** + Lock which protects the structure. + Also held for the duration of wr-lock. + */ + pthread_mutex_t lock; + /** + Condition variable which is used to wake-up + writers waiting for readers to go away. + */ + pthread_cond_t no_active_readers; + /** Number of active readers. */ + uint active_readers; + /** Number of writers waiting for readers to go away. */ + uint writers_waiting_readers; + /** Indicates whether there is an active writer. */ + my_bool active_writer; +#ifdef SAFE_MUTEX + /** Thread holding wr-lock (for debug purposes only). */ + pthread_t writer_thread; +#endif +} rw_pr_lock_t; + +extern int rw_pr_init(rw_pr_lock_t *); +extern int rw_pr_rdlock(rw_pr_lock_t *); +extern int rw_pr_wrlock(rw_pr_lock_t *); +extern int rw_pr_unlock(rw_pr_lock_t *); +extern int rw_pr_destroy(rw_pr_lock_t *); +#ifdef SAFE_MUTEX +#define rw_pr_lock_assert_write_owner(A) \ + DBUG_ASSERT((A)->active_writer && pthread_equal(pthread_self(), \ + (A)->writer_thread)) +#define rw_pr_lock_assert_not_write_owner(A) \ + DBUG_ASSERT(! (A)->active_writer || ! pthread_equal(pthread_self(), \ + (A)->writer_thread)) +#else +#define rw_pr_lock_assert_write_owner(A) +#define rw_pr_lock_assert_not_write_owner(A) +#endif /* SAFE_MUTEX */ + + +#ifdef NEED_MY_RW_LOCK + +#ifdef _WIN32 + +/** + Implementation of Windows rwlock. + + We use native (slim) rwlocks on Win7 and later, and fallback to portable + implementation on earlier Windows. + + slim rwlock are also available on Vista/WS2008, but we do not use it + ("trylock" APIs are missing on Vista) +*/ +typedef union +{ + /* Native rwlock (is_srwlock == TRUE) */ + struct + { + SRWLOCK srwlock; /* native reader writer lock */ + BOOL have_exclusive_srwlock; /* used for unlock */ + }; + + /* + Portable implementation (is_srwlock == FALSE) + Fields are identical with Unix my_rw_lock_t fields. + */ + struct + { + pthread_mutex_t lock; /* lock for structure */ + pthread_cond_t readers; /* waiting readers */ + pthread_cond_t writers; /* waiting writers */ + int state; /* -1:writer,0:free,>0:readers */ + int waiters; /* number of waiting writers */ +#ifdef SAFE_MUTEX + pthread_t write_thread; +#endif + }; +} my_rw_lock_t; + + +#else /* _WIN32 */ -extern int my_rwlock_init(my_rw_lock_t *, void *); -extern int my_rwlock_destroy(my_rw_lock_t *); +/* + On systems which don't support native read/write locks we have + to use own implementation. +*/ +typedef struct st_my_rw_lock_t { + pthread_mutex_t lock; /* lock for structure */ + pthread_cond_t readers; /* waiting readers */ + pthread_cond_t writers; /* waiting writers */ + int state; /* -1:writer,0:free,>0:readers */ + int waiters; /* number of waiting writers */ +#ifdef SAFE_MUTEX + pthread_t write_thread; +#endif +} my_rw_lock_t; + +#endif /*! _WIN32 */ + +extern int my_rw_init(my_rw_lock_t *); +extern int my_rw_destroy(my_rw_lock_t *); extern int my_rw_rdlock(my_rw_lock_t *); extern int my_rw_wrlock(my_rw_lock_t *); extern int my_rw_unlock(my_rw_lock_t *); extern int my_rw_tryrdlock(my_rw_lock_t *); extern int my_rw_trywrlock(my_rw_lock_t *); -#endif /* USE_MUTEX_INSTEAD_OF_RW_LOCKS */ +#ifdef SAFE_MUTEX +#define my_rw_lock_assert_write_owner(A) \ + DBUG_ASSERT((A)->state == -1 && pthread_equal(pthread_self(), \ + (A)->write_thread)) +#define my_rw_lock_assert_not_write_owner(A) \ + DBUG_ASSERT((A)->state >= 0 || ! pthread_equal(pthread_self(), \ + (A)->write_thread)) +#else +#define my_rw_lock_assert_write_owner(A) +#define my_rw_lock_assert_not_write_owner(A) +#endif +#endif /* NEED_MY_RW_LOCK */ + #define GETHOSTBYADDR_BUFF_SIZE 2048 @@ -651,12 +806,13 @@ extern pthread_mutexattr_t my_errorcheck_mutexattr; typedef ulong my_thread_id; extern my_bool my_thread_global_init(void); +extern my_bool my_thread_basic_global_init(void); +extern void my_thread_basic_global_reinit(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 my_thread_id my_thread_dbug_id(void); -extern int pthread_no_free(void *); extern int pthread_dummy(int); /* All thread specific variables are in the following struct */ @@ -674,13 +830,17 @@ extern int pthread_dummy(int); #endif #endif +#include + +#define INSTRUMENT_ME 0 + struct st_my_thread_var { int thr_errno; - pthread_cond_t suspend; - pthread_mutex_t mutex; - pthread_mutex_t * volatile current_mutex; - pthread_cond_t * volatile current_cond; + mysql_cond_t suspend; + mysql_mutex_t mutex; + mysql_mutex_t * volatile current_mutex; + mysql_cond_t * volatile current_cond; pthread_t pthread_self; my_thread_id id; int cmp_length; @@ -688,6 +848,7 @@ struct st_my_thread_var my_bool init; struct st_my_thread_var *next,**prev; void *opt_info; + void *stack_ends_here; #ifndef DBUG_OFF void *dbug; char name[THREAD_NAME_SIZE+1]; @@ -695,6 +856,7 @@ struct st_my_thread_var }; extern struct st_my_thread_var *_my_thread_var(void) __attribute__ ((const)); +extern void **my_thread_var_dbug(); extern uint my_thread_end_wait_time; #define my_thread_var (_my_thread_var()) #define my_errno my_thread_var->thr_errno @@ -716,33 +878,34 @@ extern uint thd_lib_detected; 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 atomic operations instead. + 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 _WIN32 +#define thread_safe_increment(V,L) InterlockedIncrement((long*) &(V)) +#define thread_safe_decrement(V,L) InterlockedDecrement((long*) &(V)) +#else #define thread_safe_increment(V,L) \ - (pthread_mutex_lock((L)), (V)++, pthread_mutex_unlock((L))) + (mysql_mutex_lock((L)), (V)++, mysql_mutex_unlock((L))) #define thread_safe_decrement(V,L) \ - (pthread_mutex_lock((L)), (V)--, pthread_mutex_unlock((L))) + (mysql_mutex_lock((L)), (V)--, mysql_mutex_unlock((L))) +#endif #endif #ifndef thread_safe_add +#ifdef _WIN32 +#define thread_safe_add(V,C,L) InterlockedExchangeAdd((long*) &(V),(C)) +#define thread_safe_sub(V,C,L) InterlockedExchangeAdd((long*) &(V),-(long) (C)) +#else #define thread_safe_add(V,C,L) \ - (pthread_mutex_lock((L)), (V)+=(C), pthread_mutex_unlock((L))) + (mysql_mutex_lock((L)), (V)+=(C), mysql_mutex_unlock((L))) #define thread_safe_sub(V,C,L) \ - (pthread_mutex_lock((L)), (V)-=(C), pthread_mutex_unlock((L))) + (mysql_mutex_lock((L)), (V)-=(C), mysql_mutex_unlock((L))) #endif #endif + /* statistics_xxx functions are for non critical statistic, maintained in global variables. diff --git a/dep/mysqllite/include/my_sys.h b/dep/mysqllite/include/my_sys.h index 3a240cfc1188a..96b40415c564f 100644 --- a/dep/mysqllite/include/my_sys.h +++ b/dep/mysqllite/include/my_sys.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2003 MySQL AB +/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -15,6 +15,9 @@ #ifndef _my_sys_h #define _my_sys_h + +#include "my_global.h" /* C_MODE_START, C_MODE_END */ + C_MODE_START #ifdef HAVE_AIOWAIT @@ -38,20 +41,28 @@ typedef struct my_aio_result { # define MEM_CHECK_DEFINED(a,len) ((void) 0) #endif /* HAVE_VALGRIND */ -#ifndef THREAD -extern int NEAR my_errno; /* Last error in mysys */ -#else #include -#endif #include /* for CHARSET_INFO */ #include #include +#ifdef _WIN32 +#include /*for alloca*/ +#endif -#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(); } +/** + 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 */ @@ -62,8 +73,8 @@ 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_SYNC_DIR 8192 /* my_create/delete/rename: sync directory */ +#define MY_UNUSED 64 /* Unused (was 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() */ #define MY_LINK_WARNING 32 /* my_redel() gives warning if links */ @@ -86,10 +97,6 @@ extern int NEAR my_errno; /* Last error in mysys */ #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 */ @@ -103,8 +110,6 @@ extern int NEAR my_errno; /* Last error in mysys */ #define ME_COLOUR2 ((2 << ME_HIGHBYTE)) #define ME_COLOUR3 ((3 << ME_HIGHBYTE)) #define ME_FATALERROR 1024 /* Fatal statement error */ -#define ME_NO_WARNING_FOR_ERROR 2048 /* Don't push a warning for error */ -#define ME_NO_SP_HANDLER 4096 /* Don't call stored routine error handlers */ /* Bits in last argument to fn_format */ #define MY_REPLACE_DIR 1 /* replace dir in name with 'dir' */ @@ -145,46 +150,15 @@ extern int NEAR my_errno; /* Last error in mysys */ #define GETDATE_FIXEDLENGTH 16 /* defines when allocating data */ -#ifdef SAFEMALLOC -#define my_malloc(SZ,FLAG) _mymalloc((SZ), __FILE__, __LINE__, FLAG ) -#define my_malloc_ci(SZ,FLAG) _mymalloc((SZ), sFile, uLine, FLAG ) -#define my_realloc(PTR,SZ,FLAG) _myrealloc((PTR), (SZ), __FILE__, __LINE__, FLAG ) -#define my_checkmalloc() _sanity( __FILE__, __LINE__ ) -#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_strndup(A,B,C) _my_strndup((A),(B),__FILE__,__LINE__,C) -#define TRASH(A,B) do { bfill(A, B, 0x8F); MEM_UNDEFINED(A, B); } while (0) -#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; -extern ulonglong sf_malloc_mem_limit; - -#define CALLER_INFO_PROTO , const char *sFile, uint uLine -#define CALLER_INFO , __FILE__, __LINE__ -#define ORIG_CALLER_INFO , sFile, uLine -#else -#define my_checkmalloc() -#undef TERMINATE -#define TERMINATE(A,B) {} -#define QUICK_SAFEMALLOC -#define NORMAL_SAFEMALLOC extern void *my_malloc(size_t Size,myf MyFlags); -#define my_malloc_ci(SZ,FLAG) my_malloc( SZ, FLAG ) +extern void *my_multi_malloc(myf MyFlags, ...); extern void *my_realloc(void *oldpoint, size_t Size, myf MyFlags); -extern void my_no_flags_free(void *ptr); +extern void my_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_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) do{MEM_CHECK_ADDRESSABLE(A,B);MEM_UNDEFINED(A,B);} while (0) -#endif - #if defined(ENABLED_DEBUG_SYNC) extern void (*debug_sync_C_callback_ptr)(const char *, size_t); #define DEBUG_SYNC_C(_sync_point_name_) do { \ @@ -198,11 +172,11 @@ extern void (*debug_sync_C_callback_ptr)(const char *, size_t); #ifdef HAVE_LARGE_PAGES extern uint my_get_large_page_size(void); extern uchar * my_large_malloc(size_t size, myf my_flags); -extern void my_large_free(uchar * ptr, myf my_flags); +extern void my_large_free(uchar *ptr); #else #define my_get_large_page_size() (0) #define my_large_malloc(A,B) my_malloc_lock((A),(B)) -#define my_large_free(A,B) my_free_lock((A),(B)) +#define my_large_free(A) my_free_lock((A)) #endif /* HAVE_LARGE_PAGES */ #ifdef HAVE_ALLOCA @@ -219,8 +193,8 @@ extern void my_large_free(uchar * ptr, myf my_flags); #define my_alloca(SZ) alloca((size_t) (SZ)) #define my_afree(PTR) {} #else -#define my_alloca(SZ) my_malloc(SZ,MYF(0)) -#define my_afree(PTR) my_free(PTR,MYF(MY_WME)) +#define my_alloca(SZ) my_malloc(SZ,MYF(MY_FAE)) +#define my_afree(PTR) my_free(PTR) #endif /* HAVE_ALLOCA */ #ifndef errno /* did we already get it? */ @@ -232,21 +206,25 @@ extern int errno; /* declare errno */ #endif /* #ifndef errno */ extern char *home_dir; /* Home directory for user */ extern const char *my_progname; /* program-name (printed in errors) */ -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, +extern char curr_dir[]; /* Current directory for user */ +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); + #ifdef HAVE_LARGE_PAGES extern my_bool my_use_large_pages; extern uint my_large_page_size; #endif /* charsets */ +#define MY_ALL_CHARSETS_SIZE 2048 extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *default_charset_info; -extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *all_charsets[256]; +extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *all_charsets[MY_ALL_CHARSETS_SIZE]; extern CHARSET_INFO compiled_charsets[]; /* statistics */ @@ -261,33 +239,25 @@ extern void (*my_sigtstp_cleanup)(void), (*my_sigtstp_restart)(void), (*my_abort_hook)(int); /* Executed when comming from shell */ -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 size_t sf_malloc_cur_memory, sf_malloc_max_memory; +extern MYSQL_PLUGIN_IMPORT int my_umask; /* Default creation mask */ +extern int my_umask_dir, + my_recived_signals, /* Signals we have got */ + my_safe_to_handle_signal, /* Set when allowed to SIGTSTP */ + my_dont_interrupt; /* call remember_intr when set */ +extern my_bool my_use_symdir; extern ulong my_default_record_cache_size; -extern my_bool NEAR my_disable_locking,NEAR my_disable_async_io, - NEAR my_disable_flush_key_blocks, NEAR my_disable_symlinks; +extern my_bool my_disable_locking, my_disable_async_io, + my_disable_flush_key_blocks, my_disable_symlinks; extern char wild_many,wild_one,wild_prefix; extern const char *charsets_dir; /* from default.c */ -extern char *my_defaults_extra_file; +extern const char *my_defaults_extra_file; extern const char *my_defaults_group_suffix; extern const char *my_defaults_file; extern my_bool timed_mutexes; -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 */ - char * *wild; /* Pointer to wildcards */ -} WF_PACK; - enum loglevel { ERROR_LEVEL, WARNING_LEVEL, @@ -334,10 +304,14 @@ enum file_type struct st_my_file_info { - char * name; - enum file_type type; -#if defined(THREAD) && !defined(HAVE_PREAD) - pthread_mutex_t mutex; + char *name; +#ifdef _WIN32 + HANDLE fhandle; /* win32 file handle */ + int oflag; /* open flags, e.g O_APPEND */ +#endif + enum file_type type; +#if !defined(HAVE_PREAD) && !defined(_WIN32) + mysql_mutex_t mutex; #endif }; @@ -356,9 +330,7 @@ typedef struct st_my_tmpdir DYNAMIC_ARRAY full_list; char **list; uint cur, max; -#ifdef THREAD - pthread_mutex_t mutex; -#endif + mysql_mutex_t mutex; } MY_TMPDIR; typedef struct st_dynamic_string @@ -370,12 +342,11 @@ typedef struct st_dynamic_string struct st_io_cache; typedef int (*IO_CACHE_CALLBACK)(struct st_io_cache*); -#ifdef THREAD typedef struct st_io_cache_share { - pthread_mutex_t mutex; /* To sync on reads into buffer. */ - pthread_cond_t cond; /* To wait for signals. */ - pthread_cond_t cond_writer; /* For a synchronized writer. */ + mysql_mutex_t mutex; /* To sync on reads into buffer. */ + mysql_cond_t cond; /* To wait for signals. */ + mysql_cond_t cond_writer; /* For a synchronized writer. */ /* Offset in file corresponding to the first byte of buffer. */ my_off_t pos_in_file; /* If a synchronized write cache is the source of the data. */ @@ -390,7 +361,6 @@ typedef struct st_io_cache_share my_bool alloced; #endif } IO_CACHE_SHARE; -#endif typedef struct st_io_cache /* Used when cacheing files */ { @@ -431,12 +401,12 @@ typedef struct st_io_cache /* Used when cacheing files */ WRITE_CACHE, and &read_pos and &read_end respectively otherwise */ uchar **current_pos, **current_end; -#ifdef THREAD + /* The lock is for append buffer used in SEQ_READ_APPEND cache need mutex copying from append buffer to read buffer. */ - pthread_mutex_t append_buffer_lock; + mysql_mutex_t append_buffer_lock; /* The following is used when several threads are reading the same file in parallel. They are synchronized on disk @@ -445,7 +415,7 @@ typedef struct st_io_cache /* Used when cacheing files */ READ_CACHE mode is supported. */ IO_CACHE_SHARE *share; -#endif + /* A caller will use my_b_read() macro to read from the cache if the data is already in cache, it will be simply copied with @@ -478,7 +448,8 @@ typedef struct st_io_cache /* Used when cacheing files */ IO_CACHE_CALLBACK pre_close; /* Counts the number of times, when we were forced to use disk. We use it to - increase the binlog_cache_disk_use status variable. + increase the binlog_cache_disk_use and binlog_stmt_cache_disk_use status + variables. */ ulong disk_writes; void* arg; /* for use by pre/post_read */ @@ -579,7 +550,6 @@ typedef int (*Process_option_func)(void *ctx, const char *group_name, /* Prototypes for mysys and my_func functions */ 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(char * buf,size_t size,myf MyFlags); extern int my_setwd(const char *dir,myf MyFlags); @@ -595,7 +565,6 @@ extern File my_register_filename(File fd, const char *FileName, extern File my_create(const char *FileName,int CreateFlags, 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); @@ -621,77 +590,64 @@ 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 void *_mymalloc(size_t uSize,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); -#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); extern int check_if_legal_tablename(const char *path); -#if defined(__WIN__) && defined(__NT__) +#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 -#ifndef TERMINATE -extern void TERMINATE(FILE *file, uint flag); +#ifdef _WIN32 +/* Windows-only functions (CRT equivalents)*/ +extern HANDLE my_get_osfhandle(File fd); +extern void my_osmaperr(unsigned long last_error); #endif + extern void init_glob_errs(void); +extern const char** get_global_errmsgs(); 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 FILE *my_freopen(const char *path, const char *mode, FILE *stream); 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_sync(File fd, myf my_flags); 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 int my_error _VARARGS((int nr,myf MyFlags, ...)); -extern int my_printf_error _VARARGS((uint my_err, const char *format, - myf MyFlags, ...)) - ATTRIBUTE_FORMAT(printf, 2, 4); -extern int my_error_register(const char **errmsgs, int first, int last); +extern void my_error(int nr,myf MyFlags, ...); +extern void my_printf_error(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** (*get_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_stderr(uint my_err, const char *str, myf MyFlags); +extern my_bool my_basic_init(void); 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 char * my_filename(File fd); -#ifndef THREAD -extern void dont_break(void); -extern void allow_break(void); -#else -#define dont_break() -#define allow_break() -#endif - #ifdef EXTRA_DEBUG void my_print_open_files(void); #else @@ -730,9 +686,6 @@ 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(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 my_bool array_append_string_unique(const char *str, const char **array, size_t size); extern void get_date(char * to,int timeflag,time_t use_time); @@ -746,8 +699,6 @@ extern int end_record_cache(RECORD_CACHE *info); extern int write_cache_record(RECORD_CACHE *info,my_off_t filepos, 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); @@ -769,12 +720,10 @@ extern my_bool reinit_io_cache(IO_CACHE *info,enum cache_type type, pbool clear_cache); extern void setup_io_cache(IO_CACHE* info); extern int _my_b_read(IO_CACHE *info,uchar *Buffer,size_t Count); -#ifdef THREAD 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,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); @@ -803,18 +752,16 @@ 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_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); +#define my_init_dynamic_array(A,B,C,D) init_dynamic_array2(A,B,NULL,C,D) +#define my_init_dynamic_array_ci(A,B,C,D) init_dynamic_array2(A,B,NULL,C,D) +#define my_init_dynamic_array2(A,B,C,D,E) init_dynamic_array2(A,B,C,D,E) +#define my_init_dynamic_array2_ci(A,B,C,D,E) init_dynamic_array2(A,B,C,D,E) +extern my_bool init_dynamic_array2(DYNAMIC_ARRAY *array, uint element_size, + void *init_buffer, uint init_alloc, + uint alloc_increment); /* 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 init_dynamic_array(DYNAMIC_ARRAY *array, uint element_size, + uint init_alloc, uint alloc_increment); extern my_bool insert_dynamic(DYNAMIC_ARRAY *array,uchar * element); extern uchar *alloc_dynamic(DYNAMIC_ARRAY *array); extern uchar *pop_dynamic(DYNAMIC_ARRAY*); @@ -844,10 +791,10 @@ extern my_bool dynstr_trunc(DYNAMIC_STRING *str, size_t n); extern void dynstr_free(DYNAMIC_STRING *str); #ifdef HAVE_MLOCK extern void *my_malloc_lock(size_t length,myf flags); -extern void my_free_lock(void *ptr,myf flags); +extern void my_free_lock(void *ptr); #else #define my_malloc_lock(A,B) my_malloc((A),(B)) -#define my_free_lock(A,B) my_free((A),(B)) +#define my_free_lock(A) my_free((A)) #endif #define alloc_root_inited(A) ((A)->min_malloc != 0) #define ALLOC_ROOT_MIN_BLOCK_SIZE (MALLOC_OVERHEAD + sizeof(USED_MEM) + 8) @@ -861,18 +808,20 @@ extern void set_prealloc_root(MEM_ROOT *root, char *ptr); 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); +static inline char *safe_strdup_root(MEM_ROOT *root, const char *str) +{ + return str ? strdup_root(root, str) : 0; +} 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); -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, @@ -930,10 +879,7 @@ extern int my_getncpus(); #define MAP_FAILED ((void *)-1) #define MS_SYNC 0x0000 -#ifndef __NETWARE__ #define HAVE_MMAP -#endif - void *my_mmap(void *, size_t, int, int, int, my_off_t); int my_munmap(void *, size_t); #endif @@ -998,10 +944,16 @@ void my_security_attr_free(SECURITY_ATTRIBUTES *sa); char* my_cgets(char *string, size_t clen, size_t* plen); #endif -#ifdef __NETWARE__ -void netware_reg_user(const char *ip, const char *user, - const char *application); + +#include + +#ifdef HAVE_PSI_INTERFACE +extern MYSQL_PLUGIN_IMPORT struct PSI_bootstrap *PSI_hook; +void my_init_mysys_psi_keys(void); #endif +struct st_mysql_file; +extern struct st_mysql_file *mysql_stdin; + C_MODE_END #endif /* _my_sys_h */ diff --git a/dep/mysqllite/include/my_trie.h b/dep/mysqllite/include/my_trie.h deleted file mode 100644 index 72dd485af0458..0000000000000 --- a/dep/mysqllite/include/my_trie.h +++ /dev/null @@ -1,141 +0,0 @@ -/* 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/dep/mysqllite/include/my_vle.h b/dep/mysqllite/include/my_vle.h deleted file mode 100644 index c09f82229c475..0000000000000 --- a/dep/mysqllite/include/my_vle.h +++ /dev/null @@ -1,38 +0,0 @@ -/* 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/dep/mysqllite/include/myisam.h b/dep/mysqllite/include/myisam.h deleted file mode 100644 index e502daa2f1796..0000000000000 --- a/dep/mysqllite/include/myisam.h +++ /dev/null @@ -1,518 +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 */ - -/* This file should be included when using myisam_funktions */ - -#ifndef _myisam_h -#define _myisam_h -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef _my_base_h -#include -#endif -#ifndef _m_ctype_h -#include -#endif -#ifndef _keycache_h -#include "keycache.h" -#endif -#include "my_handler.h" -#include - -/* - Limit max keys according to HA_MAX_POSSIBLE_KEY -*/ - -#if MAX_INDEXES > HA_MAX_POSSIBLE_KEY -#define MI_MAX_KEY HA_MAX_POSSIBLE_KEY /* Max allowed keys */ -#else -#define MI_MAX_KEY MAX_INDEXES /* Max allowed keys */ -#endif - -#define MI_MAX_POSSIBLE_KEY_BUFF HA_MAX_POSSIBLE_KEY_BUFF -/* - The following defines can be increased if necessary. - But beware the dependency of MI_MAX_POSSIBLE_KEY_BUFF and MI_MAX_KEY_LENGTH. -*/ -#define MI_MAX_KEY_LENGTH 1000 /* Max length in bytes */ -#define MI_MAX_KEY_SEG 16 /* Max segments for key */ - -#define MI_MAX_KEY_BUFF (MI_MAX_KEY_LENGTH+MI_MAX_KEY_SEG*6+8+8) -#define MI_MAX_MSG_BUF 1024 /* used in CHECK TABLE, REPAIR TABLE */ -#define MI_NAME_IEXT ".MYI" -#define MI_NAME_DEXT ".MYD" - -/* Possible values for myisam_block_size (must be power of 2) */ -#define MI_KEY_BLOCK_LENGTH 1024 /* default key block length */ -#define MI_MIN_KEY_BLOCK_LENGTH 1024 /* Min key block length */ -#define MI_MAX_KEY_BLOCK_LENGTH 16384 - -/* - In the following macros '_keyno_' is 0 .. keys-1. - If there can be more keys than bits in the key_map, the highest bit - is for all upper keys. They cannot be switched individually. - This means that clearing of high keys is ignored, setting one high key - sets all high keys. -*/ -#define MI_KEYMAP_BITS (8 * SIZEOF_LONG_LONG) -#define MI_KEYMAP_HIGH_MASK (ULL(1) << (MI_KEYMAP_BITS - 1)) -#define mi_get_mask_all_keys_active(_keys_) \ - (((_keys_) < MI_KEYMAP_BITS) ? \ - ((ULL(1) << (_keys_)) - ULL(1)) : \ - (~ ULL(0))) - -#if MI_MAX_KEY > MI_KEYMAP_BITS - -#define mi_is_key_active(_keymap_,_keyno_) \ - (((_keyno_) < MI_KEYMAP_BITS) ? \ - test((_keymap_) & (ULL(1) << (_keyno_))) : \ - test((_keymap_) & MI_KEYMAP_HIGH_MASK)) -#define mi_set_key_active(_keymap_,_keyno_) \ - (_keymap_)|= (((_keyno_) < MI_KEYMAP_BITS) ? \ - (ULL(1) << (_keyno_)) : \ - MI_KEYMAP_HIGH_MASK) -#define mi_clear_key_active(_keymap_,_keyno_) \ - (_keymap_)&= (((_keyno_) < MI_KEYMAP_BITS) ? \ - (~ (ULL(1) << (_keyno_))) : \ - (~ (ULL(0))) /*ignore*/ ) - -#else - -#define mi_is_key_active(_keymap_,_keyno_) \ - test((_keymap_) & (ULL(1) << (_keyno_))) -#define mi_set_key_active(_keymap_,_keyno_) \ - (_keymap_)|= (ULL(1) << (_keyno_)) -#define mi_clear_key_active(_keymap_,_keyno_) \ - (_keymap_)&= (~ (ULL(1) << (_keyno_))) - -#endif - -#define mi_is_any_key_active(_keymap_) \ - test((_keymap_)) -#define mi_is_all_keys_active(_keymap_,_keys_) \ - ((_keymap_) == mi_get_mask_all_keys_active(_keys_)) -#define mi_set_all_keys_active(_keymap_,_keys_) \ - (_keymap_)= mi_get_mask_all_keys_active(_keys_) -#define mi_clear_all_keys_active(_keymap_) \ - (_keymap_)= 0 -#define mi_intersect_keys_active(_to_,_from_) \ - (_to_)&= (_from_) -#define mi_is_any_intersect_keys_active(_keymap1_,_keys_,_keymap2_) \ - ((_keymap1_) & (_keymap2_) & \ - mi_get_mask_all_keys_active(_keys_)) -#define mi_copy_keys_active(_to_,_maxkeys_,_from_) \ - (_to_)= (mi_get_mask_all_keys_active(_maxkeys_) & \ - (_from_)) - - /* Param to/from mi_info */ - -typedef struct st_mi_isaminfo /* Struct from h_info */ -{ - ha_rows records; /* Records in database */ - ha_rows deleted; /* Deleted records in database */ - my_off_t recpos; /* Pos for last used record */ - my_off_t newrecpos; /* Pos if we write new record */ - my_off_t dupp_key_pos; /* Position to record with dupp key */ - my_off_t data_file_length, /* Length of data file */ - max_data_file_length, - index_file_length, - max_index_file_length, - delete_length; - ulong reclength; /* Recordlength */ - ulong mean_reclength; /* Mean recordlength (if packed) */ - ulonglong auto_increment; - ulonglong key_map; /* Which keys are used */ - char *data_file_name, *index_file_name; - uint keys; /* Number of keys in use */ - uint options; /* HA_OPTION_... used */ - int errkey, /* With key was dupplicated on err */ - sortkey; /* clustered by this key */ - File filenr; /* (uniq) filenr for datafile */ - time_t create_time; /* When table was created */ - time_t check_time; - time_t update_time; - uint reflength; - ulong record_offset; - ulong *rec_per_key; /* for sql optimizing */ -} MI_ISAMINFO; - - -typedef struct st_mi_create_info -{ - const char *index_file_name, *data_file_name; /* If using symlinks */ - ha_rows max_rows; - ha_rows reloc_rows; - ulonglong auto_increment; - ulonglong data_file_length; - ulonglong key_file_length; - uint old_options; - uint8 language; - my_bool with_auto_increment; -} MI_CREATE_INFO; - -struct st_myisam_info; /* For referense */ -struct st_mi_isam_share; -typedef struct st_myisam_info MI_INFO; -struct st_mi_s_param; - -typedef struct st_mi_keydef /* Key definition with open & info */ -{ - struct st_mi_isam_share *share; /* Pointer to base (set in mi_open) */ - uint16 keysegs; /* Number of key-segment */ - uint16 flag; /* NOSAME, PACK_USED */ - - uint8 key_alg; /* BTREE, RTREE */ - uint16 block_length; /* Length of keyblock (auto) */ - uint16 underflow_block_length; /* When to execute underflow */ - uint16 keylength; /* Tot length of keyparts (auto) */ - uint16 minlength; /* min length of (packed) key (auto) */ - uint16 maxlength; /* max length of (packed) key (auto) */ - uint16 block_size_index; /* block_size (auto) */ - uint32 version; /* For concurrent read/write */ - uint32 ftkey_nr; /* full-text index number */ - - HA_KEYSEG *seg,*end; - struct st_mysql_ftparser *parser; /* Fulltext [pre]parser */ - int (*bin_search)(struct st_myisam_info *info,struct st_mi_keydef *keyinfo, - uchar *page,uchar *key, - uint key_len,uint comp_flag,uchar * *ret_pos, - uchar *buff, my_bool *was_last_key); - uint (*get_key)(struct st_mi_keydef *keyinfo,uint nod_flag,uchar * *page, - uchar *key); - int (*pack_key)(struct st_mi_keydef *keyinfo,uint nod_flag,uchar *next_key, - uchar *org_key, uchar *prev_key, uchar *key, - struct st_mi_s_param *s_temp); - void (*store_key)(struct st_mi_keydef *keyinfo, uchar *key_pos, - struct st_mi_s_param *s_temp); - int (*ck_insert)(struct st_myisam_info *inf, uint k_nr, uchar *k, uint klen); - int (*ck_delete)(struct st_myisam_info *inf, uint k_nr, uchar *k, uint klen); -} MI_KEYDEF; - - -#define MI_UNIQUE_HASH_LENGTH 4 - -typedef struct st_unique_def /* Segment definition of unique */ -{ - uint16 keysegs; /* Number of key-segment */ - uchar key; /* Mapped to which key */ - uint8 null_are_equal; - HA_KEYSEG *seg,*end; -} MI_UNIQUEDEF; - -typedef struct st_mi_decode_tree /* Decode huff-table */ -{ - uint16 *table; - uint quick_table_bits; - uchar *intervalls; -} MI_DECODE_TREE; - - -struct st_mi_bit_buff; - -/* - Note that null markers should always be first in a row ! - When creating a column, one should only specify: - type, length, null_bit and null_pos -*/ - -typedef struct st_columndef /* column information */ -{ - int16 type; /* en_fieldtype */ - uint16 length; /* length of field */ - uint32 offset; /* Offset to position in row */ - uint8 null_bit; /* If column may be 0 */ - uint16 null_pos; /* position for null marker */ - -#ifndef NOT_PACKED_DATABASES - void (*unpack)(struct st_columndef *rec,struct st_mi_bit_buff *buff, - uchar *start,uchar *end); - enum en_fieldtype base_type; - uint space_length_bits,pack_type; - MI_DECODE_TREE *huff_tree; -#endif -} MI_COLUMNDEF; - - -extern char * myisam_log_filename; /* Name of logfile */ -extern ulong myisam_block_size; -extern ulong myisam_concurrent_insert; -extern my_bool myisam_flush,myisam_delay_key_write,myisam_single_user; -extern my_off_t myisam_max_temp_length; -extern ulong myisam_bulk_insert_tree_size, myisam_data_pointer_size; - -/* usually used to check if a symlink points into the mysql data home */ -/* which is normally forbidden */ -extern int (*myisam_test_invalid_symlink)(const char *filename); -extern ulonglong myisam_mmap_size, myisam_mmap_used; -extern pthread_mutex_t THR_LOCK_myisam_mmap; - - /* Prototypes for myisam-functions */ - -extern int mi_close(struct st_myisam_info *file); -extern int mi_delete(struct st_myisam_info *file,const uchar *buff); -extern struct st_myisam_info *mi_open(const char *name,int mode, - uint wait_if_locked); -extern int mi_panic(enum ha_panic_function function); -extern int mi_rfirst(struct st_myisam_info *file,uchar *buf,int inx); -extern int mi_rkey(MI_INFO *info, uchar *buf, int inx, const uchar *key, - key_part_map keypart_map, enum ha_rkey_function search_flag); -extern int mi_rlast(struct st_myisam_info *file,uchar *buf,int inx); -extern int mi_rnext(struct st_myisam_info *file,uchar *buf,int inx); -extern int mi_rnext_same(struct st_myisam_info *info, uchar *buf); -extern int mi_rprev(struct st_myisam_info *file,uchar *buf,int inx); -extern int mi_rrnd(struct st_myisam_info *file,uchar *buf, my_off_t pos); -extern int mi_scan_init(struct st_myisam_info *file); -extern int mi_scan(struct st_myisam_info *file,uchar *buf); -extern int mi_rsame(struct st_myisam_info *file,uchar *record,int inx); -extern int mi_rsame_with_pos(struct st_myisam_info *file,uchar *record, - int inx, my_off_t pos); -extern int mi_update(struct st_myisam_info *file,const uchar *old, - uchar *new_record); -extern int mi_write(struct st_myisam_info *file,uchar *buff); -extern my_off_t mi_position(struct st_myisam_info *file); -extern int mi_status(struct st_myisam_info *info, MI_ISAMINFO *x, uint flag); -extern int mi_lock_database(struct st_myisam_info *file,int lock_type); -extern int mi_create(const char *name,uint keys,MI_KEYDEF *keydef, - uint columns, MI_COLUMNDEF *columndef, - uint uniques, MI_UNIQUEDEF *uniquedef, - MI_CREATE_INFO *create_info, uint flags); -extern int mi_delete_table(const char *name); -extern int mi_rename(const char *from, const char *to); -extern int mi_extra(struct st_myisam_info *file, - enum ha_extra_function function, - void *extra_arg); -extern int mi_reset(struct st_myisam_info *file); -extern ha_rows mi_records_in_range(MI_INFO *info, int inx, - key_range *min_key, key_range *max_key); -extern int mi_log(int activate_log); -extern int mi_is_changed(struct st_myisam_info *info); -extern int mi_delete_all_rows(struct st_myisam_info *info); -extern ulong _mi_calc_blob_length(uint length , const uchar *pos); -extern uint mi_get_pointer_length(ulonglong file_length, uint def); - -#define MEMMAP_EXTRA_MARGIN 7 /* Write this as a suffix for mmap file */ -/* this is used to pass to mysql_myisamchk_table */ - -#define MYISAMCHK_REPAIR 1 /* equivalent to myisamchk -r */ -#define MYISAMCHK_VERIFY 2 /* Verify, run repair if failure */ - -/* - Definitions needed for myisamchk.c - - Entries marked as "QQ to be removed" are NOT used to - pass check/repair options to mi_check.c. They are used - internally by myisamchk.c or/and ha_myisam.cc and should NOT - be stored together with other flags. They should be removed - from the following list to make addition of new flags possible. -*/ - -#define T_AUTO_INC 1 -#define T_AUTO_REPAIR 2 /* QQ to be removed */ -#define T_BACKUP_DATA 4 -#define T_CALC_CHECKSUM 8 -#define T_CHECK 16 /* QQ to be removed */ -#define T_CHECK_ONLY_CHANGED 32 /* QQ to be removed */ -#define T_CREATE_MISSING_KEYS 64 -#define T_DESCRIPT 128 -#define T_DONT_CHECK_CHECKSUM 256 -#define T_EXTEND 512 -#define T_FAST (1L << 10) /* QQ to be removed */ -#define T_FORCE_CREATE (1L << 11) /* QQ to be removed */ -#define T_FORCE_UNIQUENESS (1L << 12) -#define T_INFO (1L << 13) -#define T_MEDIUM (1L << 14) -#define T_QUICK (1L << 15) /* QQ to be removed */ -#define T_READONLY (1L << 16) /* QQ to be removed */ -#define T_REP (1L << 17) -#define T_REP_BY_SORT (1L << 18) /* QQ to be removed */ -#define T_REP_PARALLEL (1L << 19) /* QQ to be removed */ -#define T_RETRY_WITHOUT_QUICK (1L << 20) -#define T_SAFE_REPAIR (1L << 21) -#define T_SILENT (1L << 22) -#define T_SORT_INDEX (1L << 23) /* QQ to be removed */ -#define T_SORT_RECORDS (1L << 24) /* QQ to be removed */ -#define T_STATISTICS (1L << 25) -#define T_UNPACK (1L << 26) -#define T_UPDATE_STATE (1L << 27) -#define T_VERBOSE (1L << 28) -#define T_VERY_SILENT (1L << 29) -#define T_WAIT_FOREVER (1L << 30) -#define T_WRITE_LOOP ((ulong) 1L << 31) - -#define T_REP_ANY (T_REP | T_REP_BY_SORT | T_REP_PARALLEL) - -/* - Flags used by myisamchk.c or/and ha_myisam.cc that are NOT passed - to mi_check.c follows: -*/ - -#define TT_USEFRM 1 -#define TT_FOR_UPGRADE 2 - -#define O_NEW_INDEX 1 /* Bits set in out_flag */ -#define O_NEW_DATA 2 -#define O_DATA_LOST 4 - -/* these struct is used by my_check to tell it what to do */ - -typedef struct st_sort_key_blocks /* Used when sorting */ -{ - uchar *buff,*end_pos; - uchar lastkey[MI_MAX_POSSIBLE_KEY_BUFF]; - uint last_length; - int inited; -} SORT_KEY_BLOCKS; - - -/* - MyISAM supports several statistics collection methods. Currently statistics - collection method is not stored in MyISAM file and has to be specified for - each table analyze/repair operation in MI_CHECK::stats_method. -*/ - -typedef enum -{ - /* Treat NULLs as inequal when collecting statistics (default for 4.1/5.0) */ - MI_STATS_METHOD_NULLS_NOT_EQUAL, - /* Treat NULLs as equal when collecting statistics (like 4.0 did) */ - MI_STATS_METHOD_NULLS_EQUAL, - /* Ignore NULLs - count only tuples without NULLs in the index components */ - MI_STATS_METHOD_IGNORE_NULLS -} enum_mi_stats_method; - -typedef struct st_mi_check_param -{ - ulonglong auto_increment_value; - ulonglong max_data_file_length; - ulonglong keys_in_use; - ulonglong max_record_length; - my_off_t search_after_block; - my_off_t new_file_pos,key_file_blocks; - my_off_t keydata,totaldata,key_blocks,start_check_pos; - ha_rows total_records,total_deleted; - ha_checksum record_checksum,glob_crc; - ulonglong use_buffers; - ulong read_buffer_length,write_buffer_length, - sort_buffer_length,sort_key_blocks; - uint out_flag,warning_printed,error_printed,verbose; - uint opt_sort_key,total_files,max_level; - uint testflag, key_cache_block_size; - uint8 language; - my_bool using_global_keycache, opt_lock_memory, opt_follow_links; - my_bool retry_repair, force_sort; - char temp_filename[FN_REFLEN],*isam_file_name; - MY_TMPDIR *tmpdir; - int tmpfile_createflag; - myf myf_rw; - IO_CACHE read_cache; - - /* - The next two are used to collect statistics, see update_key_parts for - description. - */ - ulonglong unique_count[MI_MAX_KEY_SEG+1]; - ulonglong notnull_count[MI_MAX_KEY_SEG+1]; - - ha_checksum key_crc[HA_MAX_POSSIBLE_KEY]; - ulong rec_per_key_part[MI_MAX_KEY_SEG*HA_MAX_POSSIBLE_KEY]; - void *thd; - const char *db_name, *table_name; - const char *op_name; - enum_mi_stats_method stats_method; -#ifdef THREAD - pthread_mutex_t print_msg_mutex; - my_bool need_print_msg_lock; -#endif -} MI_CHECK; - -typedef struct st_sort_ft_buf -{ - uchar *buf, *end; - int count; - uchar lastkey[MI_MAX_KEY_BUFF]; -} SORT_FT_BUF; - -typedef struct st_sort_info -{ - my_off_t filelength,dupp,buff_length; - ha_rows max_records; - uint current_key, total_keys; - myf myf_rw; - enum data_file_type new_data_file_type; - MI_INFO *info; - MI_CHECK *param; - uchar *buff; - SORT_KEY_BLOCKS *key_block,*key_block_end; - SORT_FT_BUF *ft_buf; - /* sync things */ - uint got_error, threads_running; -#ifdef THREAD - pthread_mutex_t mutex; - pthread_cond_t cond; -#endif -} SORT_INFO; - -/* functions in mi_check */ -void myisamchk_init(MI_CHECK *param); -int chk_status(MI_CHECK *param, MI_INFO *info); -int chk_del(MI_CHECK *param, register MI_INFO *info, uint test_flag); -int chk_size(MI_CHECK *param, MI_INFO *info); -int chk_key(MI_CHECK *param, MI_INFO *info); -int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend); -int mi_repair(MI_CHECK *param, register MI_INFO *info, - char * name, int rep_quick); -int mi_sort_index(MI_CHECK *param, register MI_INFO *info, char * name); -int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info, - const char * name, int rep_quick); -int mi_repair_parallel(MI_CHECK *param, register MI_INFO *info, - const char * name, int rep_quick); -int change_to_newfile(const char * filename, const char * old_ext, - const char * new_ext, uint raid_chunks, - myf myflags); -int lock_file(MI_CHECK *param, File file, my_off_t start, int lock_type, - const char *filetype, const char *filename); -void lock_memory(MI_CHECK *param); -void update_auto_increment_key(MI_CHECK *param, MI_INFO *info, - my_bool repair); -int update_state_info(MI_CHECK *param, MI_INFO *info,uint update); -void update_key_parts(MI_KEYDEF *keyinfo, ulong *rec_per_key_part, - ulonglong *unique, ulonglong *notnull, - ulonglong records); -int filecopy(MI_CHECK *param, File to,File from,my_off_t start, - my_off_t length, const char *type); -int movepoint(MI_INFO *info,uchar *record,my_off_t oldpos, - my_off_t newpos, uint prot_key); -int write_data_suffix(SORT_INFO *sort_info, my_bool fix_datafile); -int test_if_almost_full(MI_INFO *info); -int recreate_table(MI_CHECK *param, MI_INFO **org_info, char *filename); -void mi_disable_non_unique_index(MI_INFO *info, ha_rows rows); -my_bool mi_test_if_sort_rep(MI_INFO *info, ha_rows rows, ulonglong key_map, - my_bool force); - -int mi_init_bulk_insert(MI_INFO *info, ulong cache_size, ha_rows rows); -void mi_flush_bulk_insert(MI_INFO *info, uint inx); -void mi_end_bulk_insert(MI_INFO *info); -int mi_assign_to_key_cache(MI_INFO *info, ulonglong key_map, - KEY_CACHE *key_cache); -void mi_change_key_cache(KEY_CACHE *old_key_cache, - KEY_CACHE *new_key_cache); -int mi_preload(MI_INFO *info, ulonglong key_map, my_bool ignore_leaves); - -#ifdef __cplusplus -} -#endif -#endif diff --git a/dep/mysqllite/include/myisammrg.h b/dep/mysqllite/include/myisammrg.h deleted file mode 100644 index 31ce3fa47b8cd..0000000000000 --- a/dep/mysqllite/include/myisammrg.h +++ /dev/null @@ -1,123 +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 */ - -/* This file should be included when using merge_isam_funktions */ - -#ifndef _myisammrg_h -#define _myisammrg_h -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef _my_base_h -#include -#endif -#ifndef _myisam_h -#include -#endif - -#include - -#define MYRG_NAME_EXT ".MRG" - -/* In which table to INSERT rows */ -#define MERGE_INSERT_DISABLED 0 -#define MERGE_INSERT_TO_FIRST 1 -#define MERGE_INSERT_TO_LAST 2 - -extern TYPELIB merge_insert_method; - - /* Param to/from myrg_info */ - -typedef struct st_mymerge_info /* Struct from h_info */ -{ - ulonglong records; /* Records in database */ - ulonglong deleted; /* Deleted records in database */ - ulonglong recpos; /* Pos for last used record */ - ulonglong data_file_length; - ulonglong dupp_key_pos; /* Offset of the Duplicate key in the merge table */ - uint reclength; /* Recordlength */ - int errkey; /* With key was dupplicated on err */ - uint options; /* HA_OPTION_... used */ - ulong *rec_per_key; /* for sql optimizing */ -} MYMERGE_INFO; - -typedef struct st_myrg_table_info -{ - struct st_myisam_info *table; - ulonglong file_offset; -} MYRG_TABLE; - -typedef struct st_myrg_info -{ - MYRG_TABLE *open_tables,*current_table,*end_table,*last_used_table; - ulonglong records; /* records in tables */ - ulonglong del; /* Removed records */ - ulonglong data_file_length; - ulong cache_size; - uint merge_insert_method; - uint tables,options,reclength,keys; - my_bool cache_in_use; - /* If MERGE children attached to parent. See top comment in ha_myisammrg.cc */ - my_bool children_attached; - LIST open_list; - QUEUE by_key; - ulong *rec_per_key_part; /* for sql optimizing */ - pthread_mutex_t mutex; -} MYRG_INFO; - - - /* Prototypes for merge-functions */ - -extern int myrg_close(MYRG_INFO *file); -extern int myrg_delete(MYRG_INFO *file,const uchar *buff); -extern MYRG_INFO *myrg_open(const char *name,int mode,int wait_if_locked); -extern MYRG_INFO *myrg_parent_open(const char *parent_name, - int (*callback)(void*, const char*), - void *callback_param); -extern int myrg_attach_children(MYRG_INFO *m_info, int handle_locking, - MI_INFO *(*callback)(void*), - void *callback_param, - my_bool *need_compat_check); -extern int myrg_detach_children(MYRG_INFO *m_info); -extern int myrg_panic(enum ha_panic_function function); -extern int myrg_rfirst(MYRG_INFO *file,uchar *buf,int inx); -extern int myrg_rlast(MYRG_INFO *file,uchar *buf,int inx); -extern int myrg_rnext(MYRG_INFO *file,uchar *buf,int inx); -extern int myrg_rprev(MYRG_INFO *file,uchar *buf,int inx); -extern int myrg_rnext_same(MYRG_INFO *file,uchar *buf); -extern int myrg_rkey(MYRG_INFO *info,uchar *buf,int inx, const uchar *key, - key_part_map keypart_map, enum ha_rkey_function search_flag); -extern int myrg_rrnd(MYRG_INFO *file,uchar *buf,ulonglong pos); -extern int myrg_rsame(MYRG_INFO *file,uchar *record,int inx); -extern int myrg_update(MYRG_INFO *file,const uchar *old,uchar *new_rec); -extern int myrg_write(MYRG_INFO *info,uchar *rec); -extern int myrg_status(MYRG_INFO *file,MYMERGE_INFO *x,int flag); -extern int myrg_lock_database(MYRG_INFO *file,int lock_type); -extern int myrg_create(const char *name, const char **table_names, - uint insert_method, my_bool fix_names); -extern int myrg_extra(MYRG_INFO *file,enum ha_extra_function function, - void *extra_arg); -extern int myrg_reset(MYRG_INFO *info); -extern void myrg_extrafunc(MYRG_INFO *info,invalidator_by_filename inv); -extern ha_rows myrg_records_in_range(MYRG_INFO *info, int inx, - key_range *min_key, key_range *max_key); -extern ha_rows myrg_records(MYRG_INFO *info); - -extern ulonglong myrg_position(MYRG_INFO *info); -#ifdef __cplusplus -} -#endif -#endif diff --git a/dep/mysqllite/include/mysql.h b/dep/mysqllite/include/mysql.h index dcf3e167e6a39..d3b24f0198abd 100644 --- a/dep/mysqllite/include/mysql.h +++ b/dep/mysqllite/include/mysql.h @@ -17,11 +17,10 @@ This file defines the client API to MySQL and also the ABI of the dynamically linked libmysqlclient. - The ABI should never be changed in a released product of MySQL + The ABI should never be changed in a released product of MySQL, thus you need to take great care when changing the file. In case - the file is changed so the ABI is broken, you must also - update the SHAREDLIB_MAJOR_VERSION in configure.in . - + the file is changed so the ABI is broken, you must also update + the SHARED_LIB_MAJOR_VERSION in cmake/mysql_version.cmake */ #ifndef _mysql_h @@ -81,16 +80,14 @@ 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 */ -#ifdef __NETWARE__ -#pragma pack(push, 8) /* 8 byte alignment */ -#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) <= 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) +/** + Returns true if the value is a number which does not need quotes for + the sql_lex.cc parser to parse correctly. +*/ +#define IS_NUM(t) (((t) <= MYSQL_TYPE_INT24 && (t) != MYSQL_TYPE_TIMESTAMP) || (t) == MYSQL_TYPE_YEAR || (t) == MYSQL_TYPE_NEWDECIMAL) #define IS_LONGDATA(t) ((t) >= MYSQL_TYPE_TINY_BLOB && (t) <= MYSQL_TYPE_STRING) @@ -169,9 +166,15 @@ enum mysql_option MYSQL_OPT_USE_REMOTE_CONNECTION, MYSQL_OPT_USE_EMBEDDED_CONNECTION, MYSQL_OPT_GUESS_CONNECTION, MYSQL_SET_CLIENT_IP, MYSQL_SECURE_AUTH, MYSQL_REPORT_DATA_TRUNCATION, MYSQL_OPT_RECONNECT, - MYSQL_OPT_SSL_VERIFY_SERVER_CERT + MYSQL_OPT_SSL_VERIFY_SERVER_CERT, MYSQL_PLUGIN_DIR, MYSQL_DEFAULT_AUTH }; +/** + @todo remove the "extension", move st_mysql_options completely + out of mysql.h +*/ +struct st_mysql_options_extention; + struct st_mysql_options { unsigned int connect_timeout, read_timeout, write_timeout; unsigned int port, protocol; @@ -188,24 +191,10 @@ struct st_mysql_options { unsigned long max_allowed_packet; 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 */ @@ -219,12 +208,13 @@ struct st_mysql_options { void (*local_infile_end)(void *); int (*local_infile_error)(void *, char *, unsigned int); void *local_infile_userdata; - void *extension; + struct st_mysql_options_extention *extension; }; enum mysql_status { - MYSQL_STATUS_READY,MYSQL_STATUS_GET_RESULT,MYSQL_STATUS_USE_RESULT + MYSQL_STATUS_READY, MYSQL_STATUS_GET_RESULT, MYSQL_STATUS_USE_RESULT, + MYSQL_STATUS_STATEMENT_GET_RESULT }; enum mysql_protocol_type @@ -232,15 +222,6 @@ 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 { @@ -285,21 +266,8 @@ typedef struct st_mysql /* 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; + my_bool unused1; + void *unused2, *unused3, *unused4, *unused5; LIST *stmts; /* list of all statements */ const struct st_mysql_methods *methods; @@ -333,35 +301,12 @@ typedef struct st_mysql_res { 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; - char *net_buf, *net_buf_pos, *net_data_end; - unsigned int port; - int cmd_status; - int last_errno; - int net_buf_size; - my_bool free_me; - my_bool eof; - char last_error[MAX_MYSQL_MANAGER_ERR]; - void *extension; -} MYSQL_MANAGER; - typedef struct st_mysql_parameters { unsigned long *p_max_allowed_packet; @@ -454,16 +399,6 @@ int STDCALL mysql_real_query(MYSQL *mysql, const char *q, 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); @@ -485,37 +420,6 @@ mysql_set_local_infile_handler(MYSQL *mysql, 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, enum mysql_enum_shutdown_level shutdown_level); @@ -562,18 +466,6 @@ 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); my_bool STDCALL mysql_read_query_result(MYSQL *mysql); @@ -752,38 +644,6 @@ enum enum_stmt_attr_type }; -typedef struct st_mysql_methods -{ - my_bool (*read_query_result)(MYSQL *mysql); - my_bool (*advanced_command)(MYSQL *mysql, - 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); - 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); -#if !defined(MYSQL_SERVER) || defined(EMBEDDED_LIBRARY) - MYSQL_FIELD * (*list_fields)(MYSQL *mysql); - my_bool (*read_prepare_result)(MYSQL *mysql, MYSQL_STMT *stmt); - int (*stmt_execute)(MYSQL_STMT *stmt); - int (*read_binary_rows)(MYSQL_STMT *stmt); - int (*unbuffered_fetch)(MYSQL *mysql, char **row); - void (*free_embedded_thd)(MYSQL *mysql); - const char *(*read_statistics)(MYSQL *mysql); - my_bool (*next_result)(MYSQL *mysql); - int (*read_change_user_result)(MYSQL *mysql, char *buff, const char *passwd); - int (*read_rows_from_cursor)(MYSQL_STMT *stmt); -#endif -} MYSQL_METHODS; - - MYSQL_STMT * STDCALL mysql_stmt_init(MYSQL *mysql); int STDCALL mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query, unsigned long length); @@ -828,6 +688,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); @@ -842,26 +703,9 @@ 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) #endif #define HAVE_MYSQL_REAL_CONNECT -/* - The following functions are mainly exported because of mysqlbinlog; - They are not for general usage -*/ - -#define simple_command(mysql, command, arg, length, skip_check) \ - (*(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, 0, \ - 0, arg, length, 1, stmt) - -#ifdef __NETWARE__ -#pragma pack(pop) /* restore alignment */ -#endif - #ifdef __cplusplus } #endif diff --git a/dep/mysqllite/include/mysql.h.pp b/dep/mysqllite/include/mysql.h.pp deleted file mode 100644 index 0a397863022a0..0000000000000 --- a/dep/mysqllite/include/mysql.h.pp +++ /dev/null @@ -1,673 +0,0 @@ -typedef char my_bool; -typedef int my_socket; -#include "mysql_version.h" -#include "mysql_com.h" -enum enum_server_command -{ - COM_SLEEP, COM_QUIT, COM_INIT_DB, COM_QUERY, COM_FIELD_LIST, - COM_CREATE_DB, COM_DROP_DB, COM_REFRESH, COM_SHUTDOWN, COM_STATISTICS, - COM_PROCESS_INFO, COM_CONNECT, COM_PROCESS_KILL, COM_DEBUG, COM_PING, - 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_DAEMON, - COM_END -}; -struct st_vio; -typedef struct st_vio Vio; -typedef struct st_net { - Vio *vio; - unsigned char *buff,*buff_end,*write_pos,*read_pos; - my_socket fd; - 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 unused0; - my_bool unused; - my_bool compress; - my_bool unused1; - unsigned char *query_cache_query; - unsigned int last_errno; - unsigned char error; - my_bool unused2; - my_bool return_errno; - char last_error[512]; - char sqlstate[5 +1]; - void *extension; -} NET; -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_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 -}; -enum mysql_enum_shutdown_level { - SHUTDOWN_DEFAULT = 0, - SHUTDOWN_WAIT_CONNECTIONS= (unsigned char)(1 << 0), - SHUTDOWN_WAIT_TRANSACTIONS= (unsigned char)(1 << 1), - SHUTDOWN_WAIT_UPDATES= (unsigned char)(1 << 3), - SHUTDOWN_WAIT_ALL_BUFFERS= ((unsigned char)(1 << 3) << 1), - SHUTDOWN_WAIT_CRITICAL_BUFFERS= ((unsigned char)(1 << 3) << 1) + 1, - KILL_QUERY= 254, - KILL_CONNECTION= 255 -}; -enum enum_cursor_type -{ - CURSOR_TYPE_NO_CURSOR= 0, - CURSOR_TYPE_READ_ONLY= 1, - CURSOR_TYPE_FOR_UPDATE= 2, - CURSOR_TYPE_SCROLLABLE= 4 -}; -enum enum_mysql_set_option -{ - MYSQL_OPTION_MULTI_STATEMENTS_ON, - MYSQL_OPTION_MULTI_STATEMENTS_OFF -}; -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 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 unsigned char *packet, size_t len); -my_bool net_write_command(NET *net,unsigned char command, - 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); -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; -}; -enum Item_result {STRING_RESULT=0, REAL_RESULT, INT_RESULT, ROW_RESULT, - DECIMAL_RESULT}; -typedef struct st_udf_args -{ - unsigned int arg_count; - enum Item_result *arg_type; - char **args; - unsigned long *lengths; - char *maybe_null; - char **attributes; - unsigned long *attribute_lengths; - void *extension; -} UDF_ARGS; -typedef struct st_udf_init -{ - my_bool maybe_null; - unsigned int decimals; - unsigned long max_length; - char *ptr; - my_bool const_item; - void *extension; -} UDF_INIT; -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 hash_password(unsigned long *to, const char *password, unsigned int password_len); -void make_scrambled_password_323(char *to, const char *password); -void scramble_323(char *to, const char *message, const char *password); -my_bool check_scramble_323(const char *, const char *message, - unsigned long *salt); -void get_salt_from_password_323(unsigned long *res, const char *password); -void make_password_from_salt_323(char *to, const unsigned long *salt); -void make_scrambled_password(char *to, const char *password); -void scramble(char *to, const char *message, const char *password); -my_bool check_scramble(const char *reply, const char *message, - const unsigned char *hash_stage2); -void get_salt_from_password(unsigned char *res, const char *password); -void make_password_from_salt(char *to, const unsigned char *hash_stage2); -char *octet2hex(char *to, const char *str, unsigned int len); -char *get_tty_password(const char *opt_message); -const char *mysql_errno_to_sqlstate(unsigned int mysql_errno); -my_bool my_thread_init(void); -void my_thread_end(void); -#include "mysql_time.h" -enum enum_mysql_timestamp_type -{ - MYSQL_TIMESTAMP_NONE= -2, MYSQL_TIMESTAMP_ERROR= -1, - MYSQL_TIMESTAMP_DATE= 0, MYSQL_TIMESTAMP_DATETIME= 1, MYSQL_TIMESTAMP_TIME= 2 -}; -typedef struct st_mysql_time -{ - unsigned int year, month, day, hour, minute, second; - unsigned long second_part; - my_bool neg; - enum enum_mysql_timestamp_type time_type; -} MYSQL_TIME; -#include "my_list.h" -typedef struct st_list { - struct st_list *prev,*next; - void *data; -} LIST; -typedef int (*list_walk_action)(void *,void *); -extern LIST *list_add(LIST *root,LIST *element); -extern LIST *list_delete(LIST *root,LIST *element); -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,unsigned char * argument); -extern unsigned int mysql_port; -extern char *mysql_unix_port; -typedef struct st_mysql_field { - char *name; - char *org_name; - char *table; - char *org_table; - char *db; - char *catalog; - char *def; - unsigned long length; - unsigned long max_length; - unsigned int name_length; - unsigned int org_name_length; - unsigned int table_length; - unsigned int org_table_length; - unsigned int db_length; - unsigned int catalog_length; - unsigned int def_length; - unsigned int flags; - unsigned int decimals; - unsigned int charsetnr; - enum enum_field_types type; - void *extension; -} MYSQL_FIELD; -typedef char **MYSQL_ROW; -typedef unsigned int MYSQL_FIELD_OFFSET; -typedef unsigned long long my_ulonglong; -#include "typelib.h" -#include "my_alloc.h" -typedef struct st_used_mem -{ - struct st_used_mem *next; - unsigned int left; - unsigned int size; -} USED_MEM; -typedef struct st_mem_root -{ - USED_MEM *free; - USED_MEM *used; - USED_MEM *pre_alloc; - size_t min_malloc; - size_t block_size; - unsigned int block_num; - unsigned int first_block_usage; - void (*error_handler)(void); -} MEM_ROOT; -typedef struct st_typelib { - unsigned int count; - const char *name; - const char **type_names; - unsigned int *type_lengths; -} TYPELIB; -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); -extern TYPELIB sql_protocol_typelib; -typedef struct st_mysql_rows { - struct st_mysql_rows *next; - MYSQL_ROW data; - unsigned long length; -} MYSQL_ROWS; -typedef MYSQL_ROWS *MYSQL_ROW_OFFSET; -#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; - void *extension; -} MYSQL_DATA; -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, - MYSQL_SET_CHARSET_DIR, MYSQL_SET_CHARSET_NAME, MYSQL_OPT_LOCAL_INFILE, - MYSQL_OPT_PROTOCOL, MYSQL_SHARED_MEMORY_BASE_NAME, MYSQL_OPT_READ_TIMEOUT, - MYSQL_OPT_WRITE_TIMEOUT, MYSQL_OPT_USE_RESULT, - MYSQL_OPT_USE_REMOTE_CONNECTION, MYSQL_OPT_USE_EMBEDDED_CONNECTION, - MYSQL_OPT_GUESS_CONNECTION, MYSQL_SET_CLIENT_IP, MYSQL_SECURE_AUTH, - MYSQL_REPORT_DATA_TRUNCATION, MYSQL_OPT_RECONNECT, - MYSQL_OPT_SSL_VERIFY_SERVER_CERT -}; -struct st_mysql_options { - unsigned int connect_timeout, read_timeout, write_timeout; - unsigned int port, protocol; - unsigned long client_flag; - 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; - char *ssl_cert; - char *ssl_ca; - char *ssl_capath; - char *ssl_cipher; - char *shared_memory_base_name; - unsigned long max_allowed_packet; - my_bool use_ssl; - my_bool compress,named_pipe; - my_bool rpl_probe; - my_bool rpl_parse; - my_bool no_master_reads; - my_bool separate_thread; - enum mysql_option methods_to_use; - char *client_ip; - my_bool secure_auth; - my_bool report_data_truncation; - int (*local_infile_init)(void **, const char *, void *); - int (*local_infile_read)(void *, char *, unsigned int); - void (*local_infile_end)(void *); - int (*local_infile_error)(void *, char *, unsigned int); - void *local_infile_userdata; - void *extension; -}; -enum mysql_status -{ - MYSQL_STATUS_READY,MYSQL_STATUS_GET_RESULT,MYSQL_STATUS_USE_RESULT -}; -enum mysql_protocol_type -{ - MYSQL_PROTOCOL_DEFAULT, MYSQL_PROTOCOL_TCP, MYSQL_PROTOCOL_SOCKET, - MYSQL_PROTOCOL_PIPE, MYSQL_PROTOCOL_MEMORY -}; -enum mysql_rpl_type -{ - MYSQL_RPL_MASTER, MYSQL_RPL_SLAVE, MYSQL_RPL_ADMIN -}; -typedef struct character_set -{ - unsigned int number; - unsigned int state; - const char *csname; - const char *name; - const char *comment; - const char *dir; - unsigned int mbminlen; - unsigned int mbmaxlen; -} MY_CHARSET_INFO; -struct st_mysql_methods; -struct st_mysql_stmt; -typedef struct st_mysql -{ - NET net; - unsigned char *connector_fd; - 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; - my_ulonglong affected_rows; - my_ulonglong insert_id; - my_ulonglong extra_info; - unsigned long thread_id; - unsigned long packet_length; - unsigned int port; - unsigned long client_flag,server_capabilities; - unsigned int protocol_version; - unsigned int field_count; - unsigned int server_status; - unsigned int server_language; - unsigned int warning_count; - struct st_mysql_options options; - enum mysql_status status; - my_bool free_me; - my_bool reconnect; - char scramble[20 +1]; - my_bool rpl_pivot; - struct st_mysql* master, *next_slave; - struct st_mysql* last_used_slave; - struct st_mysql* last_used_con; - LIST *stmts; - const struct st_mysql_methods *methods; - void *thd; - my_bool *unbuffered_fetch_owner; - char *info_buffer; - 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; - MYSQL *handle; - const struct st_mysql_methods *methods; - MYSQL_ROW row; - MYSQL_ROW current_row; - MEM_ROOT field_alloc; - unsigned int field_count, current_field; - my_bool eof; - my_bool unbuffered_fetch_cancelled; - void *extension; -} MYSQL_RES; -typedef struct st_mysql_manager -{ - NET net; - char *host, *user, *passwd; - char *net_buf, *net_buf_pos, *net_data_end; - unsigned int port; - int cmd_status; - int last_errno; - int net_buf_size; - my_bool free_me; - my_bool eof; - char last_error[256]; - void *extension; -} MYSQL_MANAGER; -typedef struct st_mysql_parameters -{ - unsigned long *p_max_allowed_packet; - unsigned long *p_net_buffer_length; - void *extension; -} MYSQL_PARAMETERS; -int mysql_server_init(int argc, char **argv, char **groups); -void mysql_server_end(void); -MYSQL_PARAMETERS * mysql_get_parameters(void); -my_bool mysql_thread_init(void); -void mysql_thread_end(void); -my_ulonglong mysql_num_rows(MYSQL_RES *res); -unsigned int mysql_num_fields(MYSQL_RES *res); -my_bool mysql_eof(MYSQL_RES *res); -MYSQL_FIELD * mysql_fetch_field_direct(MYSQL_RES *res, - unsigned int fieldnr); -MYSQL_FIELD * mysql_fetch_fields(MYSQL_RES *res); -MYSQL_ROW_OFFSET mysql_row_tell(MYSQL_RES *res); -MYSQL_FIELD_OFFSET mysql_field_tell(MYSQL_RES *res); -unsigned int mysql_field_count(MYSQL *mysql); -my_ulonglong mysql_affected_rows(MYSQL *mysql); -my_ulonglong mysql_insert_id(MYSQL *mysql); -unsigned int mysql_errno(MYSQL *mysql); -const char * mysql_error(MYSQL *mysql); -const char * mysql_sqlstate(MYSQL *mysql); -unsigned int mysql_warning_count(MYSQL *mysql); -const char * mysql_info(MYSQL *mysql); -unsigned long mysql_thread_id(MYSQL *mysql); -const char * mysql_character_set_name(MYSQL *mysql); -int mysql_set_character_set(MYSQL *mysql, const char *csname); -MYSQL * mysql_init(MYSQL *mysql); -my_bool mysql_ssl_set(MYSQL *mysql, const char *key, - const char *cert, const char *ca, - const char *capath, const char *cipher); -const char * mysql_get_ssl_cipher(MYSQL *mysql); -my_bool mysql_change_user(MYSQL *mysql, const char *user, - const char *passwd, const char *db); -MYSQL * 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 mysql_select_db(MYSQL *mysql, const char *db); -int mysql_query(MYSQL *mysql, const char *q); -int mysql_send_query(MYSQL *mysql, const char *q, - unsigned long length); -int mysql_real_query(MYSQL *mysql, const char *q, - unsigned long length); -MYSQL_RES * mysql_store_result(MYSQL *mysql); -MYSQL_RES * mysql_use_result(MYSQL *mysql); -my_bool mysql_master_query(MYSQL *mysql, const char *q, - unsigned long length); -my_bool mysql_master_send_query(MYSQL *mysql, const char *q, - unsigned long length); -my_bool mysql_slave_query(MYSQL *mysql, const char *q, - unsigned long length); -my_bool mysql_slave_send_query(MYSQL *mysql, const char *q, - unsigned long length); -void mysql_get_character_set_info(MYSQL *mysql, - MY_CHARSET_INFO *charset); -void -mysql_set_local_infile_handler(MYSQL *mysql, - int (*local_infile_init)(void **, const char *, - void *), - int (*local_infile_read)(void *, char *, - unsigned int), - void (*local_infile_end)(void *), - int (*local_infile_error)(void *, char*, - unsigned int), - void *); -void -mysql_set_local_infile_default(MYSQL *mysql); -void mysql_enable_rpl_parse(MYSQL* mysql); -void mysql_disable_rpl_parse(MYSQL* mysql); -int mysql_rpl_parse_enabled(MYSQL* mysql); -void mysql_enable_reads_from_master(MYSQL* mysql); -void mysql_disable_reads_from_master(MYSQL* mysql); -my_bool mysql_reads_from_master_enabled(MYSQL* mysql); -enum mysql_rpl_type mysql_rpl_query_type(const char* q, int len); -my_bool mysql_rpl_probe(MYSQL* mysql); -int mysql_set_master(MYSQL* mysql, const char* host, - unsigned int port, - const char* user, - const char* passwd); -int mysql_add_slave(MYSQL* mysql, const char* host, - unsigned int port, - const char* user, - const char* passwd); -int mysql_shutdown(MYSQL *mysql, - enum mysql_enum_shutdown_level - shutdown_level); -int mysql_dump_debug_info(MYSQL *mysql); -int mysql_refresh(MYSQL *mysql, - unsigned int refresh_options); -int mysql_kill(MYSQL *mysql,unsigned long pid); -int mysql_set_server_option(MYSQL *mysql, - enum enum_mysql_set_option - option); -int mysql_ping(MYSQL *mysql); -const char * mysql_stat(MYSQL *mysql); -const char * mysql_get_server_info(MYSQL *mysql); -const char * mysql_get_client_info(void); -unsigned long mysql_get_client_version(void); -const char * mysql_get_host_info(MYSQL *mysql); -unsigned long mysql_get_server_version(MYSQL *mysql); -unsigned int mysql_get_proto_info(MYSQL *mysql); -MYSQL_RES * mysql_list_dbs(MYSQL *mysql,const char *wild); -MYSQL_RES * mysql_list_tables(MYSQL *mysql,const char *wild); -MYSQL_RES * mysql_list_processes(MYSQL *mysql); -int mysql_options(MYSQL *mysql,enum mysql_option option, - const void *arg); -void mysql_free_result(MYSQL_RES *result); -void mysql_data_seek(MYSQL_RES *result, - my_ulonglong offset); -MYSQL_ROW_OFFSET mysql_row_seek(MYSQL_RES *result, - MYSQL_ROW_OFFSET offset); -MYSQL_FIELD_OFFSET mysql_field_seek(MYSQL_RES *result, - MYSQL_FIELD_OFFSET offset); -MYSQL_ROW mysql_fetch_row(MYSQL_RES *result); -unsigned long * mysql_fetch_lengths(MYSQL_RES *result); -MYSQL_FIELD * mysql_fetch_field(MYSQL_RES *result); -MYSQL_RES * mysql_list_fields(MYSQL *mysql, const char *table, - const char *wild); -unsigned long mysql_escape_string(char *to,const char *from, - unsigned long from_length); -unsigned long mysql_hex_string(char *to,const char *from, - unsigned long from_length); -unsigned long mysql_real_escape_string(MYSQL *mysql, - char *to,const char *from, - unsigned long length); -void mysql_debug(const char *debug); -void myodbc_remove_escape(MYSQL *mysql,char *name); -unsigned int mysql_thread_safe(void); -my_bool mysql_embedded(void); -MYSQL_MANAGER* mysql_manager_init(MYSQL_MANAGER* con); -MYSQL_MANAGER* mysql_manager_connect(MYSQL_MANAGER* con, - const char* host, - const char* user, - const char* passwd, - unsigned int port); -void mysql_manager_close(MYSQL_MANAGER* con); -int mysql_manager_command(MYSQL_MANAGER* con, - const char* cmd, int cmd_len); -int mysql_manager_fetch_line(MYSQL_MANAGER* con, - char* res_buf, - int res_buf_size); -my_bool mysql_read_query_result(MYSQL *mysql); -enum enum_mysql_stmt_state -{ - MYSQL_STMT_INIT_DONE= 1, MYSQL_STMT_PREPARE_DONE, MYSQL_STMT_EXECUTE_DONE, - MYSQL_STMT_FETCH_DONE -}; -typedef struct st_mysql_bind -{ - unsigned long *length; - my_bool *is_null; - void *buffer; - my_bool *error; - unsigned char *row_ptr; - 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 long buffer_length; - unsigned long offset; - unsigned long length_value; - unsigned int param_number; - unsigned int pack_length; - enum enum_field_types buffer_type; - my_bool error_value; - my_bool is_unsigned; - my_bool long_data_used; - my_bool is_null_value; - void *extension; -} MYSQL_BIND; -typedef struct st_mysql_stmt -{ - MEM_ROOT mem_root; - LIST list; - MYSQL *mysql; - MYSQL_BIND *params; - MYSQL_BIND *bind; - MYSQL_FIELD *fields; - MYSQL_DATA result; - MYSQL_ROWS *data_cursor; - int (*read_row_func)(struct st_mysql_stmt *stmt, - unsigned char **row); - my_ulonglong affected_rows; - my_ulonglong insert_id; - unsigned long stmt_id; - unsigned long flags; - unsigned long prefetch_rows; - unsigned int server_status; - unsigned int last_errno; - unsigned int param_count; - unsigned int field_count; - enum enum_mysql_stmt_state state; - char last_error[512]; - char sqlstate[5 +1]; - my_bool send_types_to_server; - my_bool bind_param_done; - unsigned char bind_result_done; - my_bool unbuffered_fetch_cancelled; - my_bool update_max_length; - void *extension; -} MYSQL_STMT; -enum enum_stmt_attr_type -{ - STMT_ATTR_UPDATE_MAX_LENGTH, - STMT_ATTR_CURSOR_TYPE, - STMT_ATTR_PREFETCH_ROWS -}; -typedef struct st_mysql_methods -{ - my_bool (*read_query_result)(MYSQL *mysql); - my_bool (*advanced_command)(MYSQL *mysql, - 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); - 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); - MYSQL_FIELD * (*list_fields)(MYSQL *mysql); - my_bool (*read_prepare_result)(MYSQL *mysql, MYSQL_STMT *stmt); - int (*stmt_execute)(MYSQL_STMT *stmt); - int (*read_binary_rows)(MYSQL_STMT *stmt); - int (*unbuffered_fetch)(MYSQL *mysql, char **row); - void (*free_embedded_thd)(MYSQL *mysql); - const char *(*read_statistics)(MYSQL *mysql); - my_bool (*next_result)(MYSQL *mysql); - int (*read_change_user_result)(MYSQL *mysql, char *buff, const char *passwd); - int (*read_rows_from_cursor)(MYSQL_STMT *stmt); -} MYSQL_METHODS; -MYSQL_STMT * mysql_stmt_init(MYSQL *mysql); -int mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query, - unsigned long length); -int mysql_stmt_execute(MYSQL_STMT *stmt); -int mysql_stmt_fetch(MYSQL_STMT *stmt); -int mysql_stmt_fetch_column(MYSQL_STMT *stmt, MYSQL_BIND *bind_arg, - unsigned int column, - unsigned long offset); -int mysql_stmt_store_result(MYSQL_STMT *stmt); -unsigned long mysql_stmt_param_count(MYSQL_STMT * stmt); -my_bool mysql_stmt_attr_set(MYSQL_STMT *stmt, - enum enum_stmt_attr_type attr_type, - const void *attr); -my_bool mysql_stmt_attr_get(MYSQL_STMT *stmt, - enum enum_stmt_attr_type attr_type, - void *attr); -my_bool mysql_stmt_bind_param(MYSQL_STMT * stmt, MYSQL_BIND * bnd); -my_bool mysql_stmt_bind_result(MYSQL_STMT * stmt, MYSQL_BIND * bnd); -my_bool mysql_stmt_close(MYSQL_STMT * stmt); -my_bool mysql_stmt_reset(MYSQL_STMT * stmt); -my_bool mysql_stmt_free_result(MYSQL_STMT *stmt); -my_bool mysql_stmt_send_long_data(MYSQL_STMT *stmt, - unsigned int param_number, - const char *data, - unsigned long length); -MYSQL_RES * mysql_stmt_result_metadata(MYSQL_STMT *stmt); -MYSQL_RES * mysql_stmt_param_metadata(MYSQL_STMT *stmt); -unsigned int mysql_stmt_errno(MYSQL_STMT * stmt); -const char * mysql_stmt_error(MYSQL_STMT * stmt); -const char * mysql_stmt_sqlstate(MYSQL_STMT * stmt); -MYSQL_ROW_OFFSET mysql_stmt_row_seek(MYSQL_STMT *stmt, - MYSQL_ROW_OFFSET offset); -MYSQL_ROW_OFFSET mysql_stmt_row_tell(MYSQL_STMT *stmt); -void mysql_stmt_data_seek(MYSQL_STMT *stmt, my_ulonglong offset); -my_ulonglong mysql_stmt_num_rows(MYSQL_STMT *stmt); -my_ulonglong mysql_stmt_affected_rows(MYSQL_STMT *stmt); -my_ulonglong mysql_stmt_insert_id(MYSQL_STMT *stmt); -unsigned int mysql_stmt_field_count(MYSQL_STMT *stmt); -my_bool mysql_commit(MYSQL * mysql); -my_bool mysql_rollback(MYSQL * mysql); -my_bool mysql_autocommit(MYSQL * mysql, my_bool auto_mode); -my_bool mysql_more_results(MYSQL *mysql); -int mysql_next_result(MYSQL *mysql); -void mysql_close(MYSQL *sock); diff --git a/dep/mysqllite/include/mysql/client_plugin.h b/dep/mysqllite/include/mysql/client_plugin.h new file mode 100644 index 0000000000000..cc3f468040fc7 --- /dev/null +++ b/dep/mysqllite/include/mysql/client_plugin.h @@ -0,0 +1,163 @@ +#ifndef MYSQL_CLIENT_PLUGIN_INCLUDED +/* Copyright (C) 2010 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 + + MySQL Client Plugin API + + This file defines the API for plugins that work on the client side +*/ +#define MYSQL_CLIENT_PLUGIN_INCLUDED + +#ifndef MYSQL_ABI_CHECK +#include +#include +#endif + +/* known plugin types */ +#define MYSQL_CLIENT_reserved1 0 +#define MYSQL_CLIENT_reserved2 1 +#define MYSQL_CLIENT_AUTHENTICATION_PLUGIN 2 + +#define MYSQL_CLIENT_AUTHENTICATION_PLUGIN_INTERFACE_VERSION 0x0100 + +#define MYSQL_CLIENT_MAX_PLUGINS 3 + +#define mysql_declare_client_plugin(X) \ + MYSQL_PLUGIN_EXPORT struct st_mysql_client_plugin_ ## X \ + _mysql_client_plugin_declaration_ = { \ + MYSQL_CLIENT_ ## X ## _PLUGIN, \ + MYSQL_CLIENT_ ## X ## _PLUGIN_INTERFACE_VERSION, +#define mysql_end_client_plugin } + +/* generic plugin header structure */ +#define MYSQL_CLIENT_PLUGIN_HEADER \ + int type; \ + unsigned int interface_version; \ + const char *name; \ + const char *author; \ + const char *desc; \ + unsigned int version[3]; \ + const char *license; \ + void *mysql_api; \ + int (*init)(char *, size_t, int, va_list); \ + int (*deinit)(); \ + int (*options)(const char *option, const void *); + +struct st_mysql_client_plugin +{ + MYSQL_CLIENT_PLUGIN_HEADER +}; + +struct st_mysql; + +/******** authentication plugin specific declarations *********/ +#include + +struct st_mysql_client_plugin_AUTHENTICATION +{ + MYSQL_CLIENT_PLUGIN_HEADER + int (*authenticate_user)(MYSQL_PLUGIN_VIO *vio, struct st_mysql *mysql); +}; + +/******** using plugins ************/ + +/** + loads a plugin and initializes it + + @param mysql MYSQL structure. + @param name a name of the plugin to load + @param type type of plugin that should be loaded, -1 to disable type check + @param argc number of arguments to pass to the plugin initialization + function + @param ... arguments for the plugin initialization function + + @retval + a pointer to the loaded plugin, or NULL in case of a failure +*/ +struct st_mysql_client_plugin * +mysql_load_plugin(struct st_mysql *mysql, const char *name, int type, + int argc, ...); + +/** + loads a plugin and initializes it, taking va_list as an argument + + This is the same as mysql_load_plugin, but take va_list instead of + a list of arguments. + + @param mysql MYSQL structure. + @param name a name of the plugin to load + @param type type of plugin that should be loaded, -1 to disable type check + @param argc number of arguments to pass to the plugin initialization + function + @param args arguments for the plugin initialization function + + @retval + a pointer to the loaded plugin, or NULL in case of a failure +*/ +struct st_mysql_client_plugin * +mysql_load_plugin_v(struct st_mysql *mysql, const char *name, int type, + int argc, va_list args); + +/** + finds an already loaded plugin by name, or loads it, if necessary + + @param mysql MYSQL structure. + @param name a name of the plugin to load + @param type type of plugin that should be loaded + + @retval + a pointer to the plugin, or NULL in case of a failure +*/ +struct st_mysql_client_plugin * +mysql_client_find_plugin(struct st_mysql *mysql, const char *name, int type); + +/** + adds a plugin structure to the list of loaded plugins + + This is useful if an application has the necessary functionality + (for example, a special load data handler) statically linked into + the application binary. It can use this function to register the plugin + directly, avoiding the need to factor it out into a shared object. + + @param mysql MYSQL structure. It is only used for error reporting + @param plugin an st_mysql_client_plugin structure to register + + @retval + a pointer to the plugin, or NULL in case of a failure +*/ +struct st_mysql_client_plugin * +mysql_client_register_plugin(struct st_mysql *mysql, + struct st_mysql_client_plugin *plugin); + +/** + set plugin options + + Can be used to set extra options and affect behavior for a plugin. + This function may be called multiple times to set several options + + @param plugin an st_mysql_client_plugin structure + @param option a string which specifies the option to set + @param value value for the option. + + @retval 0 on success, 1 in case of failure +**/ +int STDCALL mysql_plugin_options(struct st_mysql_client_plugin *plugin, + const char *option, + const void *value); +#endif + diff --git a/dep/mysqllite/include/mysql/innodb_priv.h b/dep/mysqllite/include/mysql/innodb_priv.h new file mode 100644 index 0000000000000..5406c292b18f0 --- /dev/null +++ b/dep/mysqllite/include/mysql/innodb_priv.h @@ -0,0 +1,36 @@ +/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public 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 INNODB_PRIV_INCLUDED +#define INNODB_PRIV_INCLUDED + +/** @file Declaring server-internal functions that are used by InnoDB. */ + +#include + +class THD; + +int get_quote_char_for_identifier(THD *thd, const char *name, uint length); +bool schema_table_store_record(THD *thd, TABLE *table); +void localtime_to_TIME(MYSQL_TIME *to, struct tm *from); +bool check_global_access(THD *thd, ulong want_access); +uint strconvert(CHARSET_INFO *from_cs, const char *from, + CHARSET_INFO *to_cs, char *to, uint to_length, + uint *errors); +void sql_print_error(const char *format, ...); + + + +#endif /* INNODB_PRIV_INCLUDED */ diff --git a/dep/mysqllite/include/mysql/plugin.h b/dep/mysqllite/include/mysql/plugin.h index 55ef6070f85e1..7ec68ff5040b6 100644 --- a/dep/mysqllite/include/mysql/plugin.h +++ b/dep/mysqllite/include/mysql/plugin.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2005 MySQL AB +/* Copyright (C) 2005 MySQL AB, 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 @@ -16,13 +16,27 @@ #ifndef _my_plugin_h #define _my_plugin_h - /* On Windows, exports from DLL need to be declared -*/ -#if (defined(_WIN32) && defined(MYSQL_DYNAMIC_PLUGIN)) -#define MYSQL_PLUGIN_EXPORT extern "C" __declspec(dllexport) -#else + Also, plugin needs to be declared as extern "C" because MSVC + unlike other compilers, uses C++ mangling for variables not only + for functions. +*/ +#if defined(_MSC_VER) +#if defined(MYSQL_DYNAMIC_PLUGIN) + #ifdef __cplusplus + #define MYSQL_PLUGIN_EXPORT extern "C" __declspec(dllexport) + #else + #define MYSQL_PLUGIN_EXPORT __declspec(dllexport) + #endif +#else /* MYSQL_DYNAMIC_PLUGIN */ + #ifdef __cplusplus + #define MYSQL_PLUGIN_EXPORT extern "C" + #else + #define MYSQL_PLUGIN_EXPORT + #endif +#endif /*MYSQL_DYNAMIC_PLUGIN */ +#else /*_MSC_VER */ #define MYSQL_PLUGIN_EXPORT #endif @@ -34,15 +48,7 @@ class Item; #define MYSQL_THD void* #endif -#ifndef _m_string_h -/* This definition must match the one given in m_string.h */ -struct st_mysql_lex_string -{ - char *str; - unsigned int length; -}; -#endif /* _m_string_h */ -typedef struct st_mysql_lex_string MYSQL_LEX_STRING; +#include #define MYSQL_XIDDATASIZE 128 /** @@ -65,7 +71,7 @@ typedef struct st_mysql_xid MYSQL_XID; Plugin API. Common for all plugin types. */ -#define MYSQL_PLUGIN_INTERFACE_VERSION 0x0100 +#define MYSQL_PLUGIN_INTERFACE_VERSION 0x0102 /* The allowable types of plugins @@ -75,7 +81,10 @@ typedef struct st_mysql_xid MYSQL_XID; #define MYSQL_FTPARSER_PLUGIN 2 /* Full-text parser plugin */ #define MYSQL_DAEMON_PLUGIN 3 /* The daemon/raw plugin type */ #define MYSQL_INFORMATION_SCHEMA_PLUGIN 4 /* The I_S plugin type */ -#define MYSQL_MAX_PLUGIN_TYPE_NUM 5 /* The number of plugin types */ +#define MYSQL_AUDIT_PLUGIN 5 /* The Audit plugin type */ +#define MYSQL_REPLICATION_PLUGIN 6 /* The replication plugin type */ +#define MYSQL_AUTHENTICATION_PLUGIN 7 /* The authentication plugin type */ +#define MYSQL_MAX_PLUGIN_TYPE_NUM 8 /* The number of plugin types */ /* We use the following strings to define licenses for plugins */ #define PLUGIN_LICENSE_PROPRIETARY 0 @@ -95,9 +104,9 @@ typedef struct st_mysql_xid MYSQL_XID; #ifndef MYSQL_DYNAMIC_PLUGIN #define __MYSQL_DECLARE_PLUGIN(NAME, VERSION, PSIZE, DECLS) \ -int VERSION= MYSQL_PLUGIN_INTERFACE_VERSION; \ -int PSIZE= sizeof(struct st_mysql_plugin); \ -struct st_mysql_plugin DECLS[]= { +MYSQL_PLUGIN_EXPORT int VERSION= MYSQL_PLUGIN_INTERFACE_VERSION; \ +MYSQL_PLUGIN_EXPORT int PSIZE= sizeof(struct st_mysql_plugin); \ +MYSQL_PLUGIN_EXPORT struct st_mysql_plugin DECLS[]= { #else #define __MYSQL_DECLARE_PLUGIN(NAME, VERSION, PSIZE, DECLS) \ MYSQL_PLUGIN_EXPORT int _mysql_plugin_interface_version_= MYSQL_PLUGIN_INTERFACE_VERSION; \ @@ -120,7 +129,8 @@ enum enum_mysql_show_type { SHOW_UNDEF, SHOW_BOOL, SHOW_INT, SHOW_LONG, SHOW_LONGLONG, SHOW_CHAR, SHOW_CHAR_PTR, - SHOW_ARRAY, SHOW_FUNC, SHOW_DOUBLE + SHOW_ARRAY, SHOW_FUNC, SHOW_DOUBLE, + SHOW_always_last }; struct st_mysql_show_var { @@ -410,205 +420,43 @@ struct st_mysql_plugin /************************************************************************* API for Full-text parser plugin. (MYSQL_FTPARSER_PLUGIN) */ +#include "plugin_ftparser.h" -#define MYSQL_FTPARSER_INTERFACE_VERSION 0x0100 - -/* Parsing modes. Set in MYSQL_FTPARSER_PARAM::mode */ -enum enum_ftparser_mode -{ -/* - Fast and simple mode. This mode is used for indexing, and natural - language queries. - - The parser is expected to return only those words that go into the - index. Stopwords or too short/long words should not be returned. The - 'boolean_info' argument of mysql_add_word() does not have to be set. -*/ - MYSQL_FTPARSER_SIMPLE_MODE= 0, - -/* - Parse with stopwords mode. This mode is used in boolean searches for - "phrase matching." - - The parser is not allowed to ignore words in this mode. Every word - should be returned, including stopwords and words that are too short - or long. The 'boolean_info' argument of mysql_add_word() does not - have to be set. +/************************************************************************* + API for Storage Engine plugin. (MYSQL_DAEMON_PLUGIN) */ - MYSQL_FTPARSER_WITH_STOPWORDS= 1, -/* - Parse in boolean mode. This mode is used to parse a boolean query string. - - The parser should provide a valid MYSQL_FTPARSER_BOOLEAN_INFO - structure in the 'boolean_info' argument to mysql_add_word(). - Usually that means that the parser should recognize boolean operators - in the parsing stream and set appropriate fields in - MYSQL_FTPARSER_BOOLEAN_INFO structure accordingly. As for - MYSQL_FTPARSER_WITH_STOPWORDS mode, no word should be ignored. - Instead, use FT_TOKEN_STOPWORD for the token type of such a word. -*/ - MYSQL_FTPARSER_FULL_BOOLEAN_INFO= 2 -}; +/* handlertons of different MySQL releases are incompatible */ +#define MYSQL_DAEMON_INTERFACE_VERSION (MYSQL_VERSION_ID << 8) /* - Token types for boolean mode searching (used for the type member of - MYSQL_FTPARSER_BOOLEAN_INFO struct) - - FT_TOKEN_EOF: End of data. - FT_TOKEN_WORD: Regular word. - FT_TOKEN_LEFT_PAREN: Left parenthesis (start of group/sub-expression). - FT_TOKEN_RIGHT_PAREN: Right parenthesis (end of group/sub-expression). - FT_TOKEN_STOPWORD: Stopword. + Here we define only the descriptor structure, that is referred from + st_mysql_plugin. */ -enum enum_ft_token_type +struct st_mysql_daemon { - FT_TOKEN_EOF= 0, - FT_TOKEN_WORD= 1, - FT_TOKEN_LEFT_PAREN= 2, - FT_TOKEN_RIGHT_PAREN= 3, - FT_TOKEN_STOPWORD= 4 + int interface_version; }; -/* - This structure is used in boolean search mode only. It conveys - boolean-mode metadata to the MySQL search engine for every word in - the search query. A valid instance of this structure must be filled - in by the plugin parser and passed as an argument in the call to - mysql_add_word (the callback function in the MYSQL_FTPARSER_PARAM - structure) when a query is parsed in boolean mode. - - type: The token type. Should be one of the enum_ft_token_type values. - - yesno: Whether the word must be present for a match to occur: - >0 Must be present - <0 Must not be present - 0 Neither; the word is optional but its presence increases the relevance - With the default settings of the ft_boolean_syntax system variable, - >0 corresponds to the '+' operator, <0 corrresponds to the '-' operator, - and 0 means neither operator was used. - - weight_adjust: A weighting factor that determines how much a match - for the word counts. Positive values increase, negative - decrease the - relative word's importance in the query. - - wasign: The sign of the word's weight in the query. If it's non-negative - the match for the word will increase document relevance, if it's - negative - decrease (the word becomes a "noise word", the less of it the - better). - - trunc: Corresponds to the '*' operator in the default setting of the - ft_boolean_syntax system variable. -*/ -typedef struct st_mysql_ftparser_boolean_info -{ - enum enum_ft_token_type type; - int yesno; - int weight_adjust; - char wasign; - char trunc; - /* These are parser state and must be removed. */ - char prev; - char *quot; -} MYSQL_FTPARSER_BOOLEAN_INFO; - -/* - The following flag means that buffer with a string (document, word) - may be overwritten by the caller before the end of the parsing (that is - before st_mysql_ftparser::deinit() call). If one needs the string - to survive between two successive calls of the parsing function, she - needs to save a copy of it. The flag may be set by MySQL before calling - st_mysql_ftparser::parse(), or it may be set by a plugin before calling - st_mysql_ftparser_param::mysql_parse() or - st_mysql_ftparser_param::mysql_add_word(). -*/ -#define MYSQL_FTFLAGS_NEED_COPY 1 - -/* - An argument of the full-text parser plugin. This structure is - filled in by MySQL server and passed to the parsing function of the - plugin as an in/out parameter. - - mysql_parse: A pointer to the built-in parser implementation of the - server. It's set by the server and can be used by the parser plugin - to invoke the MySQL default parser. If plugin's role is to extract - textual data from .doc, .pdf or .xml content, it might extract - plaintext from the content, and then pass the text to the default - MySQL parser to be parsed. - - mysql_add_word: A server callback to add a new word. When parsing - a document, the server sets this to point at a function that adds - the word to MySQL full-text index. When parsing a search query, - this function will add the new word to the list of words to search - for. The boolean_info argument can be NULL for all cases except - when mode is MYSQL_FTPARSER_FULL_BOOLEAN_INFO. - - ftparser_state: A generic pointer. The plugin can set it to point - to information to be used internally for its own purposes. - - mysql_ftparam: This is set by the server. It is used by MySQL functions - called via mysql_parse() and mysql_add_word() callback. The plugin - should not modify it. - - cs: Information about the character set of the document or query string. - - doc: A pointer to the document or query string to be parsed. - - length: Length of the document or query string, in bytes. - - flags: See MYSQL_FTFLAGS_* constants above. - - mode: The parsing mode. With boolean operators, with stopwords, or - nothing. See enum_ftparser_mode above. +/************************************************************************* + API for I_S plugin. (MYSQL_INFORMATION_SCHEMA_PLUGIN) */ -typedef struct st_mysql_ftparser_param -{ - int (*mysql_parse)(struct st_mysql_ftparser_param *, - char *doc, int doc_len); - int (*mysql_add_word)(struct st_mysql_ftparser_param *, - char *word, int word_len, - MYSQL_FTPARSER_BOOLEAN_INFO *boolean_info); - void *ftparser_state; - void *mysql_ftparam; - struct charset_info_st *cs; - char *doc; - int length; - int flags; - enum enum_ftparser_mode mode; -} MYSQL_FTPARSER_PARAM; +/* handlertons of different MySQL releases are incompatible */ +#define MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION (MYSQL_VERSION_ID << 8) /* - Full-text parser descriptor. - - interface_version is, e.g., MYSQL_FTPARSER_INTERFACE_VERSION. - The parsing, initialization, and deinitialization functions are - invoked per SQL statement for which the parser is used. + Here we define only the descriptor structure, that is referred from + st_mysql_plugin. */ -struct st_mysql_ftparser +struct st_mysql_information_schema { int interface_version; - int (*parse)(MYSQL_FTPARSER_PARAM *param); - int (*init)(MYSQL_FTPARSER_PARAM *param); - int (*deinit)(MYSQL_FTPARSER_PARAM *param); }; -/************************************************************************* - API for Storage Engine plugin. (MYSQL_DAEMON_PLUGIN) -*/ - -/* handlertons of different MySQL releases are incompatible */ -#define MYSQL_DAEMON_INTERFACE_VERSION (MYSQL_VERSION_ID << 8) - -/************************************************************************* - API for I_S plugin. (MYSQL_INFORMATION_SCHEMA_PLUGIN) -*/ - -/* handlertons of different MySQL releases are incompatible */ -#define MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION (MYSQL_VERSION_ID << 8) /************************************************************************* API for Storage Engine plugin. (MYSQL_STORAGE_ENGINE_PLUGIN) @@ -630,28 +478,20 @@ struct st_mysql_storage_engine struct handlerton; -/* - Here we define only the descriptor structure, that is referred from - st_mysql_plugin. -*/ - -struct st_mysql_daemon -{ - int interface_version; -}; /* - Here we define only the descriptor structure, that is referred from - st_mysql_plugin. + API for Replication plugin. (MYSQL_REPLICATION_PLUGIN) */ + #define MYSQL_REPLICATION_INTERFACE_VERSION 0x0100 + + /** + Replication plugin descriptor + */ + struct Mysql_replication { + int interface_version; + }; -struct st_mysql_information_schema -{ - int interface_version; -}; - - -/* +/************************************************************************* st_mysql_value struct for reading values from mysqld. Used by server variables framework to parse user-provided values. Will be used for arguments when implementing UDFs. @@ -671,6 +511,7 @@ struct st_mysql_value const char *(*val_str)(struct st_mysql_value *, char *buffer, int *length); int (*val_real)(struct st_mysql_value *, double *realbuf); int (*val_int)(struct st_mysql_value *, long long *intbuf); + int (*is_unsigned)(struct st_mysql_value *); }; @@ -688,6 +529,7 @@ long long thd_test_options(const MYSQL_THD thd, long long test_options); int thd_sql_command(const MYSQL_THD thd); const char *thd_proc_info(MYSQL_THD thd, const char *info); void **thd_ha_data(const MYSQL_THD thd, const struct handlerton *hton); +void thd_storage_lock_wait(MYSQL_THD thd, long long value); int thd_tx_isolation(const MYSQL_THD thd); char *thd_security_context(MYSQL_THD thd, char *buffer, unsigned int length, unsigned int max_query_len); @@ -733,54 +575,6 @@ int thd_killed(const MYSQL_THD thd); */ unsigned long thd_get_thread_id(const MYSQL_THD thd); - -/** - Allocate memory in the connection's local memory pool - - @details - When properly used in place of @c my_malloc(), this can significantly - improve concurrency. Don't use this or related functions to allocate - large chunks of memory. Use for temporary storage only. The memory - will be freed automatically at the end of the statement; no explicit - code is required to prevent memory leaks. - - @see alloc_root() -*/ -void *thd_alloc(MYSQL_THD thd, unsigned int size); -/** - @see thd_alloc() -*/ -void *thd_calloc(MYSQL_THD thd, unsigned int size); -/** - @see thd_alloc() -*/ -char *thd_strdup(MYSQL_THD thd, const char *str); -/** - @see thd_alloc() -*/ -char *thd_strmake(MYSQL_THD thd, const char *str, unsigned int size); -/** - @see thd_alloc() -*/ -void *thd_memdup(MYSQL_THD thd, const void* str, unsigned int size); - -/** - Create a LEX_STRING in this connection's local memory pool - - @param thd user thread connection handle - @param lex_str pointer to LEX_STRING object to be initialized - @param str initializer to be copied into lex_str - @param size length of str, in bytes - @param allocate_lex_string flag: if TRUE, allocate new LEX_STRING object, - instead of using lex_str value - @return NULL on failure, or pointer to the LEX_STRING object - - @see thd_alloc() -*/ -MYSQL_LEX_STRING *thd_make_lex_string(MYSQL_THD thd, MYSQL_LEX_STRING *lex_str, - const char *str, unsigned int size, - int allocate_lex_string); - /** Get the XID for this connection's transaction diff --git a/dep/mysqllite/include/mysql/plugin.h.pp b/dep/mysqllite/include/mysql/plugin.h.pp deleted file mode 100644 index e4906ea65479e..0000000000000 --- a/dep/mysqllite/include/mysql/plugin.h.pp +++ /dev/null @@ -1,142 +0,0 @@ -struct st_mysql_lex_string -{ - char *str; - unsigned int length; -}; -typedef struct st_mysql_lex_string MYSQL_LEX_STRING; -struct st_mysql_xid { - long formatID; - long gtrid_length; - long bqual_length; - char data[128]; -}; -typedef struct st_mysql_xid MYSQL_XID; -enum enum_mysql_show_type -{ - SHOW_UNDEF, SHOW_BOOL, SHOW_INT, SHOW_LONG, - SHOW_LONGLONG, SHOW_CHAR, SHOW_CHAR_PTR, - SHOW_ARRAY, SHOW_FUNC, SHOW_DOUBLE -}; -struct st_mysql_show_var { - const char *name; - char *value; - enum enum_mysql_show_type type; -}; -typedef int (*mysql_show_var_func)(void*, struct st_mysql_show_var*, char *); -struct st_mysql_sys_var; -struct st_mysql_value; -typedef int (*mysql_var_check_func)(void* thd, - struct st_mysql_sys_var *var, - void *save, struct st_mysql_value *value); -typedef void (*mysql_var_update_func)(void* thd, - struct st_mysql_sys_var *var, - void *var_ptr, const void *save); -struct st_mysql_plugin -{ - int type; - void *info; - const char *name; - const char *author; - const char *descr; - int license; - int (*init)(void *); - int (*deinit)(void *); - unsigned int version; - struct st_mysql_show_var *status_vars; - struct st_mysql_sys_var **system_vars; - void * __reserved1; -}; -enum enum_ftparser_mode -{ - MYSQL_FTPARSER_SIMPLE_MODE= 0, - MYSQL_FTPARSER_WITH_STOPWORDS= 1, - MYSQL_FTPARSER_FULL_BOOLEAN_INFO= 2 -}; -enum enum_ft_token_type -{ - FT_TOKEN_EOF= 0, - FT_TOKEN_WORD= 1, - FT_TOKEN_LEFT_PAREN= 2, - FT_TOKEN_RIGHT_PAREN= 3, - FT_TOKEN_STOPWORD= 4 -}; -typedef struct st_mysql_ftparser_boolean_info -{ - enum enum_ft_token_type type; - int yesno; - int weight_adjust; - char wasign; - char trunc; - char prev; - char *quot; -} MYSQL_FTPARSER_BOOLEAN_INFO; -typedef struct st_mysql_ftparser_param -{ - int (*mysql_parse)(struct st_mysql_ftparser_param *, - char *doc, int doc_len); - int (*mysql_add_word)(struct st_mysql_ftparser_param *, - char *word, int word_len, - MYSQL_FTPARSER_BOOLEAN_INFO *boolean_info); - void *ftparser_state; - void *mysql_ftparam; - struct charset_info_st *cs; - char *doc; - int length; - int flags; - enum enum_ftparser_mode mode; -} MYSQL_FTPARSER_PARAM; -struct st_mysql_ftparser -{ - int interface_version; - int (*parse)(MYSQL_FTPARSER_PARAM *param); - int (*init)(MYSQL_FTPARSER_PARAM *param); - int (*deinit)(MYSQL_FTPARSER_PARAM *param); -}; -struct st_mysql_storage_engine -{ - int interface_version; -}; -struct handlerton; -struct st_mysql_daemon -{ - int interface_version; -}; -struct st_mysql_information_schema -{ - int interface_version; -}; -struct st_mysql_value -{ - int (*value_type)(struct st_mysql_value *); - const char *(*val_str)(struct st_mysql_value *, char *buffer, int *length); - int (*val_real)(struct st_mysql_value *, double *realbuf); - int (*val_int)(struct st_mysql_value *, long long *intbuf); -}; -int thd_in_lock_tables(const void* thd); -int thd_tablespace_op(const void* thd); -long long thd_test_options(const void* thd, long long test_options); -int thd_sql_command(const void* thd); -const char *thd_proc_info(void* thd, const char *info); -void **thd_ha_data(const void* thd, const struct handlerton *hton); -int thd_tx_isolation(const void* thd); -char *thd_security_context(void* thd, char *buffer, unsigned int length, - unsigned int max_query_len); -void thd_inc_row_count(void* thd); -int mysql_tmpfile(const char *prefix); -int thd_killed(const void* thd); -unsigned long thd_get_thread_id(const void* thd); -void *thd_alloc(void* thd, unsigned int size); -void *thd_calloc(void* thd, unsigned int size); -char *thd_strdup(void* thd, const char *str); -char *thd_strmake(void* thd, const char *str, unsigned int size); -void *thd_memdup(void* thd, const void* str, unsigned int size); -MYSQL_LEX_STRING *thd_make_lex_string(void* thd, MYSQL_LEX_STRING *lex_str, - const char *str, unsigned int size, - int allocate_lex_string); -void thd_get_xid(const void* thd, MYSQL_XID *xid); -void mysql_query_cache_invalidate4(void* thd, - const char *key, unsigned int key_length, - int using_trx); -void *thd_get_ha_data(const void* thd, const struct handlerton *hton); -void thd_set_ha_data(void* thd, const struct handlerton *hton, - const void *ha_data); diff --git a/dep/mysqllite/include/mysql/plugin_audit.h b/dep/mysqllite/include/mysql/plugin_audit.h new file mode 100644 index 0000000000000..8811c832949d8 --- /dev/null +++ b/dep/mysqllite/include/mysql/plugin_audit.h @@ -0,0 +1,138 @@ +/* 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 _my_audit_h +#define _my_audit_h + +/************************************************************************* + API for Audit plugin. (MYSQL_AUDIT_PLUGIN) +*/ + +#include "plugin.h" + +#define MYSQL_AUDIT_CLASS_MASK_SIZE 1 + +#define MYSQL_AUDIT_INTERFACE_VERSION 0x0200 + +/* + The first word in every event class struct indicates the specific + class of the event. +*/ +struct mysql_event +{ + unsigned int event_class; +}; + + +/************************************************************************* + AUDIT CLASS : GENERAL + + LOG events occurs before emitting to the general query log. + ERROR events occur before transmitting errors to the user. + RESULT events occur after transmitting a resultset to the user. + STATUS events occur after transmitting a resultset or errors + to the user. +*/ + +#define MYSQL_AUDIT_GENERAL_CLASS 0 +#define MYSQL_AUDIT_GENERAL_CLASSMASK (1 << MYSQL_AUDIT_GENERAL_CLASS) +#define MYSQL_AUDIT_GENERAL_LOG 0 +#define MYSQL_AUDIT_GENERAL_ERROR 1 +#define MYSQL_AUDIT_GENERAL_RESULT 2 +#define MYSQL_AUDIT_GENERAL_STATUS 3 + +struct mysql_event_general +{ + unsigned int event_class; + unsigned int event_subclass; + int general_error_code; + unsigned long general_thread_id; + const char *general_user; + unsigned int general_user_length; + const char *general_command; + unsigned int general_command_length; + const char *general_query; + unsigned int general_query_length; + struct charset_info_st *general_charset; + unsigned long long general_time; + unsigned long long general_rows; +}; + + +/* + AUDIT CLASS : CONNECTION + + CONNECT occurs after authentication phase is completed. + DISCONNECT occurs after connection is terminated. + CHANGE_USER occurs after COM_CHANGE_USER RPC is completed. +*/ + +#define MYSQL_AUDIT_CONNECTION_CLASS 1 +#define MYSQL_AUDIT_CONNECTION_CLASSMASK (1 << MYSQL_AUDIT_CONNECTION_CLASS) +#define MYSQL_AUDIT_CONNECTION_CONNECT 0 +#define MYSQL_AUDIT_CONNECTION_DISCONNECT 1 +#define MYSQL_AUDIT_CONNECTION_CHANGE_USER 2 + +struct mysql_event_connection +{ + unsigned int event_class; + unsigned int event_subclass; + int status; + unsigned long thread_id; + const char *user; + unsigned int user_length; + const char *priv_user; + unsigned int priv_user_length; + const char *external_user; + unsigned int external_user_length; + const char *proxy_user; + unsigned int proxy_user_length; + const char *host; + unsigned int host_length; + const char *ip; + unsigned int ip_length; + const char *database; + unsigned int database_length; +}; + + +/************************************************************************* + Here we define the descriptor structure, that is referred from + st_mysql_plugin. + + release_thd() event occurs when the event class consumer is to be + disassociated from the specified THD. This would typically occur + before some operation which may require sleeping - such as when + waiting for the next query from the client. + + event_notify() is invoked whenever an event occurs which is of any + class for which the plugin has interest. The first word of the + mysql_event argument indicates the specific event class and the + remainder of the structure is as required for that class. + + class_mask is an array of bits used to indicate what event classes + that this plugin wants to receive. +*/ + +struct st_mysql_audit +{ + int interface_version; + void (*release_thd)(MYSQL_THD); + void (*event_notify)(MYSQL_THD, const struct mysql_event *); + unsigned long class_mask[MYSQL_AUDIT_CLASS_MASK_SIZE]; +}; + + +#endif diff --git a/dep/mysqllite/include/mysql/plugin_auth.h b/dep/mysqllite/include/mysql/plugin_auth.h new file mode 100644 index 0000000000000..420eb3bb80fff --- /dev/null +++ b/dep/mysqllite/include/mysql/plugin_auth.h @@ -0,0 +1,125 @@ +#ifndef MYSQL_PLUGIN_AUTH_INCLUDED +/* Copyright (C) 2010 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 + + Authentication Plugin API. + + This file defines the API for server authentication plugins. +*/ + +#define MYSQL_PLUGIN_AUTH_INCLUDED + +#include + +#define MYSQL_AUTHENTICATION_INTERFACE_VERSION 0x0100 + +#include + +/* defines for MYSQL_SERVER_AUTH_INFO.password_used */ + +#define PASSWORD_USED_NO 0 +#define PASSWORD_USED_YES 1 +#define PASSWORD_USED_NO_MENTION 2 + + +/** + Provides server plugin access to authentication information +*/ +typedef struct st_mysql_server_auth_info +{ + /** + User name as sent by the client and shown in USER(). + NULL if the client packet with the user name was not received yet. + */ + char *user_name; + + /** + Length of user_name + */ + unsigned int user_name_length; + + /** + A corresponding column value from the mysql.user table for the + matching account name + */ + const char *auth_string; + + /** + Length of auth_string + */ + unsigned long auth_string_length; + + /** + Matching account name as found in the mysql.user table. + A plugin can override it with another name that will be + used by MySQL for authorization, and shown in CURRENT_USER() + */ + char authenticated_as[MYSQL_USERNAME_LENGTH+1]; + + + /** + The unique user name that was used by the plugin to authenticate. + Plugins should put null-terminated UTF-8 here. + Available through the @@EXTERNAL_USER variable. + */ + char external_user[512]; + + /** + This only affects the "Authentication failed. Password used: %s" + error message. has the following values : + 0 : %s will be NO. + 1 : %s will be YES. + 2 : there will be no %s. + Set it as appropriate or ignore at will. + */ + int password_used; + + /** + Set to the name of the connected client host, if it can be resolved, + or to its IP address otherwise. + */ + const char *host_or_ip; + + /** + Length of host_or_ip + */ + unsigned int host_or_ip_length; + +} MYSQL_SERVER_AUTH_INFO; + +/** + Server authentication plugin descriptor +*/ +struct st_mysql_auth +{ + int interface_version; /** version plugin uses */ + /** + A plugin that a client must use for authentication with this server + plugin. Can be NULL to mean "any plugin". + */ + const char *client_auth_plugin; + /** + Function provided by the plugin which should perform authentication (using + the vio functions if necessary) and return 0 if successful. The plugin can + also fill the info.authenticated_as field if a different username should be + used for authorization. + */ + int (*authenticate_user)(MYSQL_PLUGIN_VIO *vio, MYSQL_SERVER_AUTH_INFO *info); +}; +#endif + diff --git a/dep/mysqllite/include/mysql/plugin_auth_common.h b/dep/mysqllite/include/mysql/plugin_auth_common.h new file mode 100644 index 0000000000000..4ad92d01bfb38 --- /dev/null +++ b/dep/mysqllite/include/mysql/plugin_auth_common.h @@ -0,0 +1,105 @@ +#ifndef MYSQL_PLUGIN_AUTH_COMMON_INCLUDED +/* Copyright (C) 2010 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 + + This file defines constants and data structures that are the same for + both client- and server-side authentication plugins. +*/ +#define MYSQL_PLUGIN_AUTH_COMMON_INCLUDED + +/** the max allowed length for a user name */ +#define MYSQL_USERNAME_LENGTH 48 + +/** + return values of the plugin authenticate_user() method. +*/ + +/** + Authentication failed. Additionally, all other CR_xxx values + (libmysql error code) can be used too. + + The client plugin may set the error code and the error message directly + in the MYSQL structure and return CR_ERROR. If a CR_xxx specific error + code was returned, an error message in the MYSQL structure will be + overwritten. If CR_ERROR is returned without setting the error in MYSQL, + CR_UNKNOWN_ERROR will be user. +*/ +#define CR_ERROR 0 +/** + Authentication (client part) was successful. It does not mean that the + authentication as a whole was successful, usually it only means + that the client was able to send the user name and the password to the + server. If CR_OK is returned, the libmysql reads the next packet expecting + it to be one of OK, ERROR, or CHANGE_PLUGIN packets. +*/ +#define CR_OK -1 +/** + Authentication was successful. + It means that the client has done its part successfully and also that + a plugin has read the last packet (one of OK, ERROR, CHANGE_PLUGIN). + In this case, libmysql will not read a packet from the server, + but it will use the data at mysql->net.read_pos. + + A plugin may return this value if the number of roundtrips in the + authentication protocol is not known in advance, and the client plugin + needs to read one packet more to determine if the authentication is finished + or not. +*/ +#define CR_OK_HANDSHAKE_COMPLETE -2 + +typedef struct st_plugin_vio_info +{ + enum { MYSQL_VIO_INVALID, MYSQL_VIO_TCP, MYSQL_VIO_SOCKET, + MYSQL_VIO_PIPE, MYSQL_VIO_MEMORY } protocol; + int socket; /**< it's set, if the protocol is SOCKET or TCP */ +#ifdef _WIN32 + HANDLE handle; /**< it's set, if the protocol is PIPE or MEMORY */ +#endif +} MYSQL_PLUGIN_VIO_INFO; + +/** + Provides plugin access to communication channel +*/ +typedef struct st_plugin_vio +{ + /** + Plugin provides a pointer reference and this function sets it to the + contents of any incoming packet. Returns the packet length, or -1 if + the plugin should terminate. + */ + int (*read_packet)(struct st_plugin_vio *vio, + unsigned char **buf); + + /** + Plugin provides a buffer with data and the length and this + function sends it as a packet. Returns 0 on success, 1 on failure. + */ + int (*write_packet)(struct st_plugin_vio *vio, + const unsigned char *packet, + int packet_len); + + /** + Fills in a st_plugin_vio_info structure, providing the information + about the connection. + */ + void (*info)(struct st_plugin_vio *vio, struct st_plugin_vio_info *info); + +} MYSQL_PLUGIN_VIO; + +#endif + diff --git a/dep/mysqllite/include/mysql/plugin_ftparser.h b/dep/mysqllite/include/mysql/plugin_ftparser.h new file mode 100644 index 0000000000000..7f9bde3a6a0aa --- /dev/null +++ b/dep/mysqllite/include/mysql/plugin_ftparser.h @@ -0,0 +1,211 @@ +/* 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 _my_plugin_ftparser_h +#define _my_plugin_ftparser_h +#include "plugin.h" + +/************************************************************************* + API for Full-text parser plugin. (MYSQL_FTPARSER_PLUGIN) +*/ + +#define MYSQL_FTPARSER_INTERFACE_VERSION 0x0100 + +/* Parsing modes. Set in MYSQL_FTPARSER_PARAM::mode */ +enum enum_ftparser_mode +{ +/* + Fast and simple mode. This mode is used for indexing, and natural + language queries. + + The parser is expected to return only those words that go into the + index. Stopwords or too short/long words should not be returned. The + 'boolean_info' argument of mysql_add_word() does not have to be set. +*/ + MYSQL_FTPARSER_SIMPLE_MODE= 0, + +/* + Parse with stopwords mode. This mode is used in boolean searches for + "phrase matching." + + The parser is not allowed to ignore words in this mode. Every word + should be returned, including stopwords and words that are too short + or long. The 'boolean_info' argument of mysql_add_word() does not + have to be set. +*/ + MYSQL_FTPARSER_WITH_STOPWORDS= 1, + +/* + Parse in boolean mode. This mode is used to parse a boolean query string. + + The parser should provide a valid MYSQL_FTPARSER_BOOLEAN_INFO + structure in the 'boolean_info' argument to mysql_add_word(). + Usually that means that the parser should recognize boolean operators + in the parsing stream and set appropriate fields in + MYSQL_FTPARSER_BOOLEAN_INFO structure accordingly. As for + MYSQL_FTPARSER_WITH_STOPWORDS mode, no word should be ignored. + Instead, use FT_TOKEN_STOPWORD for the token type of such a word. +*/ + MYSQL_FTPARSER_FULL_BOOLEAN_INFO= 2 +}; + +/* + Token types for boolean mode searching (used for the type member of + MYSQL_FTPARSER_BOOLEAN_INFO struct) + + FT_TOKEN_EOF: End of data. + FT_TOKEN_WORD: Regular word. + FT_TOKEN_LEFT_PAREN: Left parenthesis (start of group/sub-expression). + FT_TOKEN_RIGHT_PAREN: Right parenthesis (end of group/sub-expression). + FT_TOKEN_STOPWORD: Stopword. +*/ + +enum enum_ft_token_type +{ + FT_TOKEN_EOF= 0, + FT_TOKEN_WORD= 1, + FT_TOKEN_LEFT_PAREN= 2, + FT_TOKEN_RIGHT_PAREN= 3, + FT_TOKEN_STOPWORD= 4 +}; + +/* + This structure is used in boolean search mode only. It conveys + boolean-mode metadata to the MySQL search engine for every word in + the search query. A valid instance of this structure must be filled + in by the plugin parser and passed as an argument in the call to + mysql_add_word (the callback function in the MYSQL_FTPARSER_PARAM + structure) when a query is parsed in boolean mode. + + type: The token type. Should be one of the enum_ft_token_type values. + + yesno: Whether the word must be present for a match to occur: + >0 Must be present + <0 Must not be present + 0 Neither; the word is optional but its presence increases the relevance + With the default settings of the ft_boolean_syntax system variable, + >0 corresponds to the '+' operator, <0 corrresponds to the '-' operator, + and 0 means neither operator was used. + + weight_adjust: A weighting factor that determines how much a match + for the word counts. Positive values increase, negative - decrease the + relative word's importance in the query. + + wasign: The sign of the word's weight in the query. If it's non-negative + the match for the word will increase document relevance, if it's + negative - decrease (the word becomes a "noise word", the less of it the + better). + + trunc: Corresponds to the '*' operator in the default setting of the + ft_boolean_syntax system variable. +*/ + +typedef struct st_mysql_ftparser_boolean_info +{ + enum enum_ft_token_type type; + int yesno; + int weight_adjust; + char wasign; + char trunc; + /* These are parser state and must be removed. */ + char prev; + char *quot; +} MYSQL_FTPARSER_BOOLEAN_INFO; + +/* + The following flag means that buffer with a string (document, word) + may be overwritten by the caller before the end of the parsing (that is + before st_mysql_ftparser::deinit() call). If one needs the string + to survive between two successive calls of the parsing function, she + needs to save a copy of it. The flag may be set by MySQL before calling + st_mysql_ftparser::parse(), or it may be set by a plugin before calling + st_mysql_ftparser_param::mysql_parse() or + st_mysql_ftparser_param::mysql_add_word(). +*/ +#define MYSQL_FTFLAGS_NEED_COPY 1 + +/* + An argument of the full-text parser plugin. This structure is + filled in by MySQL server and passed to the parsing function of the + plugin as an in/out parameter. + + mysql_parse: A pointer to the built-in parser implementation of the + server. It's set by the server and can be used by the parser plugin + to invoke the MySQL default parser. If plugin's role is to extract + textual data from .doc, .pdf or .xml content, it might extract + plaintext from the content, and then pass the text to the default + MySQL parser to be parsed. + + mysql_add_word: A server callback to add a new word. When parsing + a document, the server sets this to point at a function that adds + the word to MySQL full-text index. When parsing a search query, + this function will add the new word to the list of words to search + for. The boolean_info argument can be NULL for all cases except + when mode is MYSQL_FTPARSER_FULL_BOOLEAN_INFO. + + ftparser_state: A generic pointer. The plugin can set it to point + to information to be used internally for its own purposes. + + mysql_ftparam: This is set by the server. It is used by MySQL functions + called via mysql_parse() and mysql_add_word() callback. The plugin + should not modify it. + + cs: Information about the character set of the document or query string. + + doc: A pointer to the document or query string to be parsed. + + length: Length of the document or query string, in bytes. + + flags: See MYSQL_FTFLAGS_* constants above. + + mode: The parsing mode. With boolean operators, with stopwords, or + nothing. See enum_ftparser_mode above. +*/ + +typedef struct st_mysql_ftparser_param +{ + int (*mysql_parse)(struct st_mysql_ftparser_param *, + char *doc, int doc_len); + int (*mysql_add_word)(struct st_mysql_ftparser_param *, + char *word, int word_len, + MYSQL_FTPARSER_BOOLEAN_INFO *boolean_info); + void *ftparser_state; + void *mysql_ftparam; + struct charset_info_st *cs; + char *doc; + int length; + int flags; + enum enum_ftparser_mode mode; +} MYSQL_FTPARSER_PARAM; + +/* + Full-text parser descriptor. + + interface_version is, e.g., MYSQL_FTPARSER_INTERFACE_VERSION. + The parsing, initialization, and deinitialization functions are + invoked per SQL statement for which the parser is used. +*/ + +struct st_mysql_ftparser +{ + int interface_version; + int (*parse)(MYSQL_FTPARSER_PARAM *param); + int (*init)(MYSQL_FTPARSER_PARAM *param); + int (*deinit)(MYSQL_FTPARSER_PARAM *param); +}; + + +#endif + diff --git a/dep/mysqllite/include/mysql/psi/mysql_file.h b/dep/mysqllite/include/mysql/psi/mysql_file.h new file mode 100644 index 0000000000000..6fc6689c47d7e --- /dev/null +++ b/dep/mysqllite/include/mysql/psi/mysql_file.h @@ -0,0 +1,1434 @@ +/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */ + +#ifndef MYSQL_FILE_H +#define MYSQL_FILE_H + +#include + +/* For strlen() */ +#include +/* For MY_STAT */ +#include +/* For my_chsize */ +#include + +/** + @file mysql/psi/mysql_file.h + Instrumentation helpers for mysys file io. + This header file provides the necessary declarations + to use the mysys file API with the performance schema instrumentation. + In some compilers (SunStudio), 'static inline' functions, when declared + but not used, are not optimized away (because they are unused) by default, + so that including a static inline function from a header file does + create unwanted dependencies, causing unresolved symbols at link time. + Other compilers, like gcc, optimize these dependencies by default. + + Since the instrumented APIs declared here are wrapper on top + of mysys file io APIs, including mysql/psi/mysql_file.h assumes that + the dependency on my_sys already exists. +*/ + +#include "mysql/psi/psi.h" + +/** + @defgroup File_instrumentation File Instrumentation + @ingroup Instrumentation_interface + @{ +*/ + +/** + @def mysql_file_fgets(P1, P2, F) + Instrumented fgets. + @c mysql_file_fgets is a replacement for @c fgets. +*/ +#ifdef HAVE_PSI_INTERFACE + #define mysql_file_fgets(P1, P2, F) \ + inline_mysql_file_fgets(__FILE__, __LINE__, P1, P2, F) +#else + #define mysql_file_fgets(P1, P2, F) \ + inline_mysql_file_fgets(P1, P2, F) +#endif + +/** + @def mysql_file_fgetc(F) + Instrumented fgetc. + @c mysql_file_fgetc is a replacement for @c fgetc. +*/ +#ifdef HAVE_PSI_INTERFACE + #define mysql_file_fgetc(F) inline_mysql_file_fgetc(__FILE__, __LINE__, F) +#else + #define mysql_file_fgetc(F) inline_mysql_file_fgetc(F) +#endif + +/** + @def mysql_file_fputs(P1, F) + Instrumented fputs. + @c mysql_file_fputs is a replacement for @c fputs. +*/ +#ifdef HAVE_PSI_INTERFACE + #define mysql_file_fputs(P1, F) \ + inline_mysql_file_fputs(__FILE__, __LINE__, P1, F) +#else + #define mysql_file_fputs(P1, F)\ + inline_mysql_file_fputs(P1, F) +#endif + +/** + @def mysql_file_fputc(P1, F) + Instrumented fputc. + @c mysql_file_fputc is a replacement for @c fputc. +*/ +#ifdef HAVE_PSI_INTERFACE + #define mysql_file_fputc(P1, F) \ + inline_mysql_file_fputc(__FILE__, __LINE__, P1, F) +#else + #define mysql_file_fputc(P1, F) \ + inline_mysql_file_fputc(P1, F) +#endif + +/** + @def mysql_file_fprintf + Instrumented fprintf. + @c mysql_file_fprintf is a replacement for @c fprintf. +*/ +#define mysql_file_fprintf inline_mysql_file_fprintf + +/** + @def mysql_file_vfprintf(F, P1, P2) + Instrumented vfprintf. + @c mysql_file_vfprintf is a replacement for @c vfprintf. +*/ +#ifdef HAVE_PSI_INTERFACE + #define mysql_file_vfprintf(F, P1, P2) \ + inline_mysql_file_vfprintf(__FILE__, __LINE__, F, P1, P2) +#else + #define mysql_file_vfprintf(F, P1, P2) \ + inline_mysql_file_vfprintf(F, P1, P2) +#endif + +/** + @def mysql_file_fflush(F, P1, P2) + Instrumented fflush. + @c mysql_file_fflush is a replacement for @c fflush. +*/ +#ifdef HAVE_PSI_INTERFACE + #define mysql_file_fflush(F) \ + inline_mysql_file_fflush(__FILE__, __LINE__, F) +#else + #define mysql_file_fflush(F) \ + inline_mysql_file_fflush(F) +#endif + +/** + @def mysql_file_feof(F) + Instrumented feof. + @c mysql_file_feof is a replacement for @c feof. +*/ +#define mysql_file_feof(F) inline_mysql_file_feof(F) + +/** + @def mysql_file_fstat(FN, S, FL) + Instrumented fstat. + @c mysql_file_fstat is a replacement for @c my_fstat. +*/ +#ifdef HAVE_PSI_INTERFACE + #define mysql_file_fstat(FN, S, FL) \ + inline_mysql_file_fstat(__FILE__, __LINE__, FN, S, FL) +#else + #define mysql_file_fstat(FN, S, FL) \ + inline_mysql_file_fstat(FN, S, FL) +#endif + +/** + @def mysql_file_stat(K, FN, S, FL) + Instrumented stat. + @c mysql_file_stat is a replacement for @c my_stat. +*/ +#ifdef HAVE_PSI_INTERFACE + #define mysql_file_stat(K, FN, S, FL) \ + inline_mysql_file_stat(K, __FILE__, __LINE__, FN, S, FL) +#else + #define mysql_file_stat(K, FN, S, FL) \ + inline_mysql_file_stat(FN, S, FL) +#endif + +/** + @def mysql_file_chsize(F, P1, P2, P3) + Instrumented chsize. + @c mysql_file_chsize is a replacement for @c my_chsize. +*/ +#ifdef HAVE_PSI_INTERFACE + #define mysql_file_chsize(F, P1, P2, P3) \ + inline_mysql_file_chsize(__FILE__, __LINE__, F, P1, P2, P3) +#else + #define mysql_file_chsize(F, P1, P2, P3) \ + inline_mysql_file_chsize(F, P1, P2, P3) +#endif + +/** + @def mysql_file_fopen(K, N, F1, F2) + Instrumented fopen. + @c mysql_file_fopen is a replacement for @c my_fopen. +*/ +#ifdef HAVE_PSI_INTERFACE + #define mysql_file_fopen(K, N, F1, F2) \ + inline_mysql_file_fopen(K, __FILE__, __LINE__, N, F1, F2) +#else + #define mysql_file_fopen(K, N, F1, F2) \ + inline_mysql_file_fopen(N, F1, F2) +#endif + +/** + @def mysql_file_fclose(FD, FL) + Instrumented fclose. + @c mysql_file_fclose is a replacement for @c my_fclose. + Without the instrumentation, this call will have the same behavior as the + undocumented and possibly platform specific my_fclose(NULL, ...) behavior. + With the instrumentation, mysql_fclose(NULL, ...) will safely return 0, + which is an extension compared to my_fclose and is therefore compliant. + mysql_fclose is on purpose *not* implementing + @code DBUG_ASSERT(file != NULL) @endcode, + since doing so could introduce regressions. +*/ +#ifdef HAVE_PSI_INTERFACE + #define mysql_file_fclose(FD, FL) \ + inline_mysql_file_fclose(__FILE__, __LINE__, FD, FL) +#else + #define mysql_file_fclose(FD, FL) \ + inline_mysql_file_fclose(FD, FL) +#endif + +/** + @def mysql_file_fread(FD, P1, P2, P3) + Instrumented fread. + @c mysql_file_fread is a replacement for @c my_fread. +*/ +#ifdef HAVE_PSI_INTERFACE + #define mysql_file_fread(FD, P1, P2, P3) \ + inline_mysql_file_fread(__FILE__, __LINE__, FD, P1, P2, P3) +#else + #define mysql_file_fread(FD, P1, P2, P3) \ + inline_mysql_file_fread(FD, P1, P2, P3) +#endif + +/** + @def mysql_file_fwrite(FD, P1, P2, P3) + Instrumented fwrite. + @c mysql_file_fwrite is a replacement for @c my_fwrite. +*/ +#ifdef HAVE_PSI_INTERFACE + #define mysql_file_fwrite(FD, P1, P2, P3) \ + inline_mysql_file_fwrite(__FILE__, __LINE__, FD, P1, P2, P3) +#else + #define mysql_file_fwrite(FD, P1, P2, P3) \ + inline_mysql_file_fwrite(FD, P1, P2, P3) +#endif + +/** + @def mysql_file_fseek(FD, P, W, F) + Instrumented fseek. + @c mysql_file_fseek is a replacement for @c my_fseek. +*/ +#ifdef HAVE_PSI_INTERFACE + #define mysql_file_fseek(FD, P, W, F) \ + inline_mysql_file_fseek(__FILE__, __LINE__, FD, P, W, F) +#else + #define mysql_file_fseek(FD, P, W, F) \ + inline_mysql_file_fseek(FD, P, W, F) +#endif + +/** + @def mysql_file_ftell(FD, F) + Instrumented ftell. + @c mysql_file_ftell is a replacement for @c my_ftell. +*/ +#ifdef HAVE_PSI_INTERFACE + #define mysql_file_ftell(FD, F) \ + inline_mysql_file_ftell(__FILE__, __LINE__, FD, F) +#else + #define mysql_file_ftell(FD, F) \ + inline_mysql_file_ftell(FD, F) +#endif + +/** + @def mysql_file_create(K, N, F1, F2, F3) + Instrumented create. + @c mysql_file_create is a replacement for @c my_create. +*/ +#ifdef HAVE_PSI_INTERFACE + #define mysql_file_create(K, N, F1, F2, F3) \ + inline_mysql_file_create(K, __FILE__, __LINE__, N, F1, F2, F3) +#else + #define mysql_file_create(K, N, F1, F2, F3) \ + inline_mysql_file_create(N, F1, F2, F3) +#endif + +/** + @def mysql_file_create_temp(K, T, D, P, M, F) + Instrumented create_temp_file. + @c mysql_file_create_temp is a replacement for @c create_temp_file. +*/ +#ifdef HAVE_PSI_INTERFACE + #define mysql_file_create_temp(K, T, D, P, M, F) \ + inline_mysql_file_create_temp(K, T, D, P, M, F) +#else + #define mysql_file_create_temp(K, T, D, P, M, F) \ + inline_mysql_file_create_temp(T, D, P, M, F) +#endif + +/** + @def mysql_file_open(K, N, F1, F2) + Instrumented open. + @c mysql_file_open is a replacement for @c my_open. +*/ +#ifdef HAVE_PSI_INTERFACE + #define mysql_file_open(K, N, F1, F2) \ + inline_mysql_file_open(K, __FILE__, __LINE__, N, F1, F2) +#else + #define mysql_file_open(K, N, F1, F2) \ + inline_mysql_file_open(N, F1, F2) +#endif + +/** + @def mysql_file_close(FD, F) + Instrumented close. + @c mysql_file_close is a replacement for @c my_close. +*/ +#ifdef HAVE_PSI_INTERFACE + #define mysql_file_close(FD, F) \ + inline_mysql_file_close(__FILE__, __LINE__, FD, F) +#else + #define mysql_file_close(FD, F) \ + inline_mysql_file_close(FD, F) +#endif + +/** + @def mysql_file_read(FD, B, S, F) + Instrumented read. + @c mysql_read is a replacement for @c my_read. +*/ +#ifdef HAVE_PSI_INTERFACE + #define mysql_file_read(FD, B, S, F) \ + inline_mysql_file_read(__FILE__, __LINE__, FD, B, S, F) +#else + #define mysql_file_read(FD, B, S, F) \ + inline_mysql_file_read(FD, B, S, F) +#endif + +/** + @def mysql_file_write(FD, B, S, F) + Instrumented write. + @c mysql_file_write is a replacement for @c my_write. +*/ +#ifdef HAVE_PSI_INTERFACE + #define mysql_file_write(FD, B, S, F) \ + inline_mysql_file_write(__FILE__, __LINE__, FD, B, S, F) +#else + #define mysql_file_write(FD, B, S, F) \ + inline_mysql_file_write(FD, B, S, F) +#endif + +/** + @def mysql_file_pread(FD, B, S, O, F) + Instrumented pread. + @c mysql_pread is a replacement for @c my_pread. +*/ +#ifdef HAVE_PSI_INTERFACE + #define mysql_file_pread(FD, B, S, O, F) \ + inline_mysql_file_pread(__FILE__, __LINE__, FD, B, S, O, F) +#else + #define mysql_file_pread(FD, B, S, O, F) \ + inline_mysql_file_pread(FD, B, S, O, F) +#endif + +/** + @def mysql_file_pwrite(FD, B, S, O, F) + Instrumented pwrite. + @c mysql_file_pwrite is a replacement for @c my_pwrite. +*/ +#ifdef HAVE_PSI_INTERFACE + #define mysql_file_pwrite(FD, B, S, O, F) \ + inline_mysql_file_pwrite(__FILE__, __LINE__, FD, B, S, O, F) +#else + #define mysql_file_pwrite(FD, B, S, O, F) \ + inline_mysql_file_pwrite(FD, B, S, O, F) +#endif + +/** + @def mysql_file_seek(FD, P, W, F) + Instrumented seek. + @c mysql_file_seek is a replacement for @c my_seek. +*/ +#ifdef HAVE_PSI_INTERFACE + #define mysql_file_seek(FD, P, W, F) \ + inline_mysql_file_seek(__FILE__, __LINE__, FD, P, W, F) +#else + #define mysql_file_seek(FD, P, W, F) \ + inline_mysql_file_seek(FD, P, W, F) +#endif + +/** + @def mysql_file_tell(FD, F) + Instrumented tell. + @c mysql_file_tell is a replacement for @c my_tell. +*/ +#ifdef HAVE_PSI_INTERFACE + #define mysql_file_tell(FD, F) \ + inline_mysql_file_tell(__FILE__, __LINE__, FD, F) +#else + #define mysql_file_tell(FD, F) \ + inline_mysql_file_tell(FD, F) +#endif + +/** + @def mysql_file_delete(K, P1, P2) + Instrumented delete. + @c mysql_file_delete is a replacement for @c my_delete. +*/ +#ifdef HAVE_PSI_INTERFACE + #define mysql_file_delete(K, P1, P2) \ + inline_mysql_file_delete(K, __FILE__, __LINE__, P1, P2) +#else + #define mysql_file_delete(K, P1, P2) \ + inline_mysql_file_delete(P1, P2) +#endif + +/** + @def mysql_file_rename(K, P1, P2, P3) + Instrumented rename. + @c mysql_file_rename is a replacement for @c my_rename. +*/ +#ifdef HAVE_PSI_INTERFACE + #define mysql_file_rename(K, P1, P2, P3) \ + inline_mysql_file_rename(K, __FILE__, __LINE__, P1, P2, P3) +#else + #define mysql_file_rename(K, P1, P2, P3) \ + inline_mysql_file_rename(P1, P2, P3) +#endif + +/** + @def mysql_file_create_with_symlink(K, P1, P2, P3, P4, P5) + Instrumented create with symbolic link. + @c mysql_file_create_with_symlink is a replacement + for @c my_create_with_symlink. +*/ +#ifdef HAVE_PSI_INTERFACE + #define mysql_file_create_with_symlink(K, P1, P2, P3, P4, P5) \ + inline_mysql_file_create_with_symlink(K, __FILE__, __LINE__, \ + P1, P2, P3, P4, P5) +#else + #define mysql_file_create_with_symlink(K, P1, P2, P3, P4, P5) \ + inline_mysql_file_create_with_symlink(P1, P2, P3, P4, P5) +#endif + +/** + @def mysql_file_delete_with_symlink(K, P1, P2) + Instrumented delete with symbolic link. + @c mysql_file_delete_with_symlink is a replacement + for @c my_delete_with_symlink. +*/ +#ifdef HAVE_PSI_INTERFACE + #define mysql_file_delete_with_symlink(K, P1, P2) \ + inline_mysql_file_delete_with_symlink(K, __FILE__, __LINE__, P1, P2) +#else + #define mysql_file_delete_with_symlink(K, P1, P2) \ + inline_mysql_file_delete_with_symlink(P1, P2) +#endif + +/** + @def mysql_file_rename_with_symlink(K, P1, P2, P3) + Instrumented rename with symbolic link. + @c mysql_file_rename_with_symlink is a replacement + for @c my_rename_with_symlink. +*/ +#ifdef HAVE_PSI_INTERFACE + #define mysql_file_rename_with_symlink(K, P1, P2, P3) \ + inline_mysql_file_rename_with_symlink(K, __FILE__, __LINE__, P1, P2, P3) +#else + #define mysql_file_rename_with_symlink(K, P1, P2, P3) \ + inline_mysql_file_rename_with_symlink(P1, P2, P3) +#endif + +/** + @def mysql_file_sync(P1, P2) + Instrumented file sync. + @c mysql_file_sync is a replacement for @c my_sync. +*/ +#ifdef HAVE_PSI_INTERFACE + #define mysql_file_sync(P1, P2) \ + inline_mysql_file_sync(__FILE__, __LINE__, P1, P2) +#else + #define mysql_file_sync(P1, P2) \ + inline_mysql_file_sync(P1, P2) +#endif + +/** + An instrumented FILE structure. + @sa MYSQL_FILE +*/ +struct st_mysql_file +{ + /** The real file. */ + FILE *m_file; + /** + The instrumentation hook. + Note that this hook is not conditionally defined, + for binary compatibility of the @c MYSQL_FILE interface. + */ + struct PSI_file *m_psi; +}; + +/** + Type of an instrumented file. + @c MYSQL_FILE is a drop-in replacement for @c FILE. + @sa mysql_file_open +*/ +typedef struct st_mysql_file MYSQL_FILE; + +static inline char * +inline_mysql_file_fgets( +#ifdef HAVE_PSI_INTERFACE + const char *src_file, uint src_line, +#endif + char *str, int size, MYSQL_FILE *file) +{ + char *result; +#ifdef HAVE_PSI_INTERFACE + struct PSI_file_locker *locker= NULL; + PSI_file_locker_state state; + if (likely(PSI_server && file->m_psi)) + { + locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi, + PSI_FILE_READ); + if (likely(locker != NULL)) + PSI_server->start_file_wait(locker, (size_t) size, src_file, src_line); + } +#endif + result= fgets(str, size, file->m_file); +#ifdef HAVE_PSI_INTERFACE + if (likely(locker != NULL)) + PSI_server->end_file_wait(locker, result ? strlen(result) : 0); +#endif + return result; +} + +static inline int +inline_mysql_file_fgetc( +#ifdef HAVE_PSI_INTERFACE + const char *src_file, uint src_line, +#endif + MYSQL_FILE *file) +{ + int result; +#ifdef HAVE_PSI_INTERFACE + struct PSI_file_locker *locker= NULL; + PSI_file_locker_state state; + if (likely(PSI_server && file->m_psi)) + { + locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi, + PSI_FILE_READ); + if (likely(locker != NULL)) + PSI_server->start_file_wait(locker, (size_t) 1, src_file, src_line); + } +#endif + result= fgetc(file->m_file); +#ifdef HAVE_PSI_INTERFACE + if (likely(locker != NULL)) + PSI_server->end_file_wait(locker, (size_t) 1); +#endif + return result; +} + +static inline int +inline_mysql_file_fputs( +#ifdef HAVE_PSI_INTERFACE + const char *src_file, uint src_line, +#endif + const char *str, MYSQL_FILE *file) +{ + int result; +#ifdef HAVE_PSI_INTERFACE + struct PSI_file_locker *locker= NULL; + PSI_file_locker_state state; + size_t bytes= 0; + if (likely(PSI_server && file->m_psi)) + { + locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi, + PSI_FILE_WRITE); + if (likely(locker != NULL)) + { + bytes= str ? strlen(str) : 0; + PSI_server->start_file_wait(locker, bytes, src_file, src_line); + } + } +#endif + result= fputs(str, file->m_file); +#ifdef HAVE_PSI_INTERFACE + if (likely(locker != NULL)) + PSI_server->end_file_wait(locker, bytes); +#endif + return result; +} + +static inline int +inline_mysql_file_fputc( +#ifdef HAVE_PSI_INTERFACE + const char *src_file, uint src_line, +#endif + char c, MYSQL_FILE *file) +{ + int result; +#ifdef HAVE_PSI_INTERFACE + struct PSI_file_locker *locker= NULL; + PSI_file_locker_state state; + if (likely(PSI_server && file->m_psi)) + { + locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi, + PSI_FILE_WRITE); + if (likely(locker != NULL)) + PSI_server->start_file_wait(locker, (size_t) 1, src_file, src_line); + } +#endif + result= fputc(c, file->m_file); +#ifdef HAVE_PSI_INTERFACE + if (likely(locker != NULL)) + PSI_server->end_file_wait(locker, (size_t) 1); +#endif + return result; +} + +static inline int +inline_mysql_file_fprintf(MYSQL_FILE *file, const char *format, ...) +{ + /* + TODO: figure out how to pass src_file and src_line from the caller. + */ + int result; + va_list args; +#ifdef HAVE_PSI_INTERFACE + struct PSI_file_locker *locker= NULL; + PSI_file_locker_state state; + if (likely(PSI_server && file->m_psi)) + { + locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi, + PSI_FILE_WRITE); + if (likely(locker != NULL)) + PSI_server->start_file_wait(locker, (size_t) 0, __FILE__, __LINE__); + } +#endif + va_start(args, format); + result= vfprintf(file->m_file, format, args); + va_end(args); +#ifdef HAVE_PSI_INTERFACE + if (likely(locker != NULL)) + PSI_server->end_file_wait(locker, (size_t) result); +#endif + return result; +} + +static inline int +inline_mysql_file_vfprintf( +#ifdef HAVE_PSI_INTERFACE + const char *src_file, uint src_line, +#endif + MYSQL_FILE *file, const char *format, va_list args) +{ + int result; +#ifdef HAVE_PSI_INTERFACE + struct PSI_file_locker *locker= NULL; + PSI_file_locker_state state; + if (likely(PSI_server && file->m_psi)) + { + locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi, + PSI_FILE_WRITE); + if (likely(locker != NULL)) + PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line); + } +#endif + result= vfprintf(file->m_file, format, args); +#ifdef HAVE_PSI_INTERFACE + if (likely(locker != NULL)) + PSI_server->end_file_wait(locker, (size_t) result); +#endif + return result; +} + +static inline int +inline_mysql_file_fflush( +#ifdef HAVE_PSI_INTERFACE + const char *src_file, uint src_line, +#endif + MYSQL_FILE *file) +{ + int result; +#ifdef HAVE_PSI_INTERFACE + struct PSI_file_locker *locker= NULL; + PSI_file_locker_state state; + if (likely(PSI_server && file->m_psi)) + { + locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi, + PSI_FILE_FLUSH); + if (likely(locker != NULL)) + PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line); + } +#endif + result= fflush(file->m_file); +#ifdef HAVE_PSI_INTERFACE + if (likely(locker != NULL)) + PSI_server->end_file_wait(locker, (size_t) 0); +#endif + return result; +} + +static inline int inline_mysql_file_feof(MYSQL_FILE *file) +{ + /* Not instrumented, there is no wait involved */ + return feof(file->m_file); +} + +static inline int +inline_mysql_file_fstat( +#ifdef HAVE_PSI_INTERFACE + const char *src_file, uint src_line, +#endif + int filenr, MY_STAT *stat_area, myf flags) +{ + int result; +#ifdef HAVE_PSI_INTERFACE + struct PSI_file_locker *locker= NULL; + PSI_file_locker_state state; + if (likely(PSI_server != NULL)) + { + locker= PSI_server->get_thread_file_descriptor_locker(&state, filenr, + PSI_FILE_FSTAT); + if (likely(locker != NULL)) + PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line); + } +#endif + result= my_fstat(filenr, stat_area, flags); +#ifdef HAVE_PSI_INTERFACE + if (likely(locker != NULL)) + PSI_server->end_file_wait(locker, (size_t) 0); +#endif + return result; +} + +static inline MY_STAT * +inline_mysql_file_stat( +#ifdef HAVE_PSI_INTERFACE + PSI_file_key key, const char *src_file, uint src_line, +#endif + const char *path, MY_STAT *stat_area, myf flags) +{ + MY_STAT *result; +#ifdef HAVE_PSI_INTERFACE + struct PSI_file_locker *locker= NULL; + PSI_file_locker_state state; + if (likely(PSI_server != NULL)) + { + locker= PSI_server->get_thread_file_name_locker(&state, + key, PSI_FILE_STAT, + path, &locker); + if (likely(locker != NULL)) + PSI_server->start_file_open_wait(locker, src_file, src_line); + } +#endif + result= my_stat(path, stat_area, flags); +#ifdef HAVE_PSI_INTERFACE + if (likely(locker != NULL)) + PSI_server->end_file_wait(locker, (size_t) 0); +#endif + return result; +} + +static inline int +inline_mysql_file_chsize( +#ifdef HAVE_PSI_INTERFACE + const char *src_file, uint src_line, +#endif + File file, my_off_t newlength, int filler, myf flags) +{ + int result; +#ifdef HAVE_PSI_INTERFACE + struct PSI_file_locker *locker= NULL; + PSI_file_locker_state state; + if (likely(PSI_server != NULL)) + { + locker= PSI_server->get_thread_file_descriptor_locker(&state, file, + PSI_FILE_CHSIZE); + if (likely(locker != NULL)) + PSI_server->start_file_wait(locker, (size_t) newlength, src_file, + src_line); + } +#endif + result= my_chsize(file, newlength, filler, flags); +#ifdef HAVE_PSI_INTERFACE + if (likely(locker != NULL)) + PSI_server->end_file_wait(locker, (size_t) newlength); +#endif + return result; +} + +static inline MYSQL_FILE* +inline_mysql_file_fopen( +#ifdef HAVE_PSI_INTERFACE + PSI_file_key key, const char *src_file, uint src_line, +#endif + const char *filename, int flags, myf myFlags) +{ + MYSQL_FILE *that; + that= (MYSQL_FILE*) my_malloc(sizeof(MYSQL_FILE), MYF(MY_WME)); + if (likely(that != NULL)) + { + that->m_psi= NULL; + { +#ifdef HAVE_PSI_INTERFACE + struct PSI_file_locker *locker= NULL; + PSI_file_locker_state state; + if (likely(PSI_server != NULL)) + { + locker= PSI_server->get_thread_file_name_locker + (&state, key, PSI_FILE_STREAM_OPEN, filename, that); + if (likely(locker != NULL)) + that->m_psi= PSI_server->start_file_open_wait(locker, src_file, + src_line); + } +#endif + that->m_file= my_fopen(filename, flags, myFlags); +#ifdef HAVE_PSI_INTERFACE + if (likely(locker != NULL)) + PSI_server->end_file_open_wait(locker); +#endif + if (unlikely(that->m_file == NULL)) + { + my_free(that); + return NULL; + } + } + } + return that; +} + +static inline int +inline_mysql_file_fclose( +#ifdef HAVE_PSI_INTERFACE + const char *src_file, uint src_line, +#endif + MYSQL_FILE *file, myf flags) +{ + int result= 0; + if (likely(file != NULL)) + { +#ifdef HAVE_PSI_INTERFACE + struct PSI_file_locker *locker= NULL; + PSI_file_locker_state state; + DBUG_ASSERT(file != NULL); + if (likely(PSI_server && file->m_psi)) + { + locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi, + PSI_FILE_STREAM_CLOSE); + if (likely(locker != NULL)) + PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line); + } +#endif + result= my_fclose(file->m_file, flags); +#ifdef HAVE_PSI_INTERFACE + if (likely(locker != NULL)) + PSI_server->end_file_wait(locker, (size_t) 0); +#endif + my_free(file); + } + return result; +} + +static inline size_t +inline_mysql_file_fread( +#ifdef HAVE_PSI_INTERFACE + const char *src_file, uint src_line, +#endif + MYSQL_FILE *file, uchar *buffer, size_t count, myf flags) +{ + size_t result= 0; +#ifdef HAVE_PSI_INTERFACE + struct PSI_file_locker *locker= NULL; + PSI_file_locker_state state; + if (likely(PSI_server && file->m_psi)) + { + locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi, + PSI_FILE_READ); + if (likely(locker != NULL)) + PSI_server->start_file_wait(locker, count, src_file, src_line); + } +#endif + result= my_fread(file->m_file, buffer, count, flags); +#ifdef HAVE_PSI_INTERFACE + if (likely(locker != NULL)) + { + size_t bytes_read; + if (flags & (MY_NABP | MY_FNABP)) + bytes_read= (result == 0) ? count : 0; + else + bytes_read= (result != MY_FILE_ERROR) ? result : 0; + PSI_server->end_file_wait(locker, bytes_read); + } +#endif + return result; +} + +static inline size_t +inline_mysql_file_fwrite( +#ifdef HAVE_PSI_INTERFACE + const char *src_file, uint src_line, +#endif + MYSQL_FILE *file, const uchar *buffer, size_t count, myf flags) +{ + size_t result= 0; +#ifdef HAVE_PSI_INTERFACE + struct PSI_file_locker *locker= NULL; + PSI_file_locker_state state; + if (likely(PSI_server && file->m_psi)) + { + locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi, + PSI_FILE_WRITE); + if (likely(locker != NULL)) + PSI_server->start_file_wait(locker, count, src_file, src_line); + } +#endif + result= my_fwrite(file->m_file, buffer, count, flags); +#ifdef HAVE_PSI_INTERFACE + if (likely(locker != NULL)) + { + size_t bytes_written; + if (flags & (MY_NABP | MY_FNABP)) + bytes_written= (result == 0) ? count : 0; + else + bytes_written= (result != MY_FILE_ERROR) ? result : 0; + PSI_server->end_file_wait(locker, bytes_written); + } +#endif + return result; +} + +static inline my_off_t +inline_mysql_file_fseek( +#ifdef HAVE_PSI_INTERFACE + const char *src_file, uint src_line, +#endif + MYSQL_FILE *file, my_off_t pos, int whence, myf flags) +{ + my_off_t result; +#ifdef HAVE_PSI_INTERFACE + struct PSI_file_locker *locker= NULL; + PSI_file_locker_state state; + if (likely(PSI_server && file->m_psi)) + { + locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi, + PSI_FILE_SEEK); + if (likely(locker != NULL)) + PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line); + } +#endif + result= my_fseek(file->m_file, pos, whence, flags); +#ifdef HAVE_PSI_INTERFACE + if (likely(locker != NULL)) + PSI_server->end_file_wait(locker, (size_t) 0); +#endif + return result; +} + +static inline my_off_t +inline_mysql_file_ftell( +#ifdef HAVE_PSI_INTERFACE + const char *src_file, uint src_line, +#endif + MYSQL_FILE *file, myf flags) +{ + my_off_t result; +#ifdef HAVE_PSI_INTERFACE + struct PSI_file_locker *locker= NULL; + PSI_file_locker_state state; + if (likely(PSI_server && file->m_psi)) + { + locker= PSI_server->get_thread_file_stream_locker(&state, file->m_psi, + PSI_FILE_TELL); + if (likely(locker != NULL)) + PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line); + } +#endif + result= my_ftell(file->m_file, flags); +#ifdef HAVE_PSI_INTERFACE + if (likely(locker != NULL)) + PSI_server->end_file_wait(locker, (size_t) 0); +#endif + return result; +} + +static inline File +inline_mysql_file_create( +#ifdef HAVE_PSI_INTERFACE + PSI_file_key key, const char *src_file, uint src_line, +#endif + const char *filename, int create_flags, int access_flags, myf myFlags) +{ + File file; +#ifdef HAVE_PSI_INTERFACE + struct PSI_file_locker *locker= NULL; + PSI_file_locker_state state; + if (likely(PSI_server != NULL)) + { + locker= PSI_server->get_thread_file_name_locker(&state, key, PSI_FILE_CREATE, + filename, &locker); + if (likely(locker != NULL)) + PSI_server->start_file_open_wait(locker, src_file, src_line); + } +#endif + file= my_create(filename, create_flags, access_flags, myFlags); +#ifdef HAVE_PSI_INTERFACE + if (likely(locker != NULL)) + PSI_server->end_file_open_wait_and_bind_to_descriptor(locker, file); +#endif + return file; +} + +static inline File +inline_mysql_file_create_temp( +#ifdef HAVE_PSI_INTERFACE + PSI_file_key key, +#endif + char *to, const char *dir, const char *pfx, int mode, myf myFlags) +{ + File file; + /* + TODO: This event is instrumented, but not timed. + The problem is that the file name is now known + before the create_temp_file call. + */ + file= create_temp_file(to, dir, pfx, mode, myFlags); +#ifdef HAVE_PSI_INTERFACE + if (likely(PSI_server != NULL)) + PSI_server->create_file(key, to, file); +#endif + return file; +} + +static inline File +inline_mysql_file_open( +#ifdef HAVE_PSI_INTERFACE + PSI_file_key key, const char *src_file, uint src_line, +#endif + const char *filename, int flags, myf myFlags) +{ + File file; +#ifdef HAVE_PSI_INTERFACE + struct PSI_file_locker *locker= NULL; + PSI_file_locker_state state; + if (likely(PSI_server != NULL)) + { + locker= PSI_server->get_thread_file_name_locker(&state, key, PSI_FILE_OPEN, + filename, &locker); + if (likely(locker != NULL)) + PSI_server->start_file_open_wait(locker, src_file, src_line); + } +#endif + file= my_open(filename, flags, myFlags); +#ifdef HAVE_PSI_INTERFACE + if (likely(locker != NULL)) + PSI_server->end_file_open_wait_and_bind_to_descriptor(locker, file); +#endif + return file; +} + +static inline int +inline_mysql_file_close( +#ifdef HAVE_PSI_INTERFACE + const char *src_file, uint src_line, +#endif + File file, myf flags) +{ + int result; +#ifdef HAVE_PSI_INTERFACE + struct PSI_file_locker *locker= NULL; + PSI_file_locker_state state; + if (likely(PSI_server != NULL)) + { + locker= PSI_server->get_thread_file_descriptor_locker(&state, file, + PSI_FILE_CLOSE); + if (likely(locker != NULL)) + PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line); + } +#endif + result= my_close(file, flags); +#ifdef HAVE_PSI_INTERFACE + if (likely(locker != NULL)) + PSI_server->end_file_wait(locker, (size_t) 0); +#endif + return result; +} + +static inline size_t +inline_mysql_file_read( +#ifdef HAVE_PSI_INTERFACE + const char *src_file, uint src_line, +#endif + File file, uchar *buffer, size_t count, myf flags) +{ + size_t result= 0; +#ifdef HAVE_PSI_INTERFACE + struct PSI_file_locker *locker= NULL; + PSI_file_locker_state state; + if (likely(PSI_server != NULL)) + { + locker= PSI_server->get_thread_file_descriptor_locker(&state, file, + PSI_FILE_READ); + if (likely(locker != NULL)) + PSI_server->start_file_wait(locker, count, src_file, src_line); + } +#endif + result= my_read(file, buffer, count, flags); +#ifdef HAVE_PSI_INTERFACE + if (likely(locker != NULL)) + { + size_t bytes_read; + if (flags & (MY_NABP | MY_FNABP)) + bytes_read= (result == 0) ? count : 0; + else + bytes_read= (result != MY_FILE_ERROR) ? result : 0; + PSI_server->end_file_wait(locker, bytes_read); + } +#endif + return result; +} + +static inline size_t +inline_mysql_file_write( +#ifdef HAVE_PSI_INTERFACE + const char *src_file, uint src_line, +#endif + File file, const uchar *buffer, size_t count, myf flags) +{ + size_t result; +#ifdef HAVE_PSI_INTERFACE + struct PSI_file_locker *locker= NULL; + PSI_file_locker_state state; + if (likely(PSI_server != NULL)) + { + locker= PSI_server->get_thread_file_descriptor_locker(&state, file, + PSI_FILE_WRITE); + if (likely(locker != NULL)) + PSI_server->start_file_wait(locker, count, src_file, src_line); + } +#endif + result= my_write(file, buffer, count, flags); +#ifdef HAVE_PSI_INTERFACE + if (likely(locker != NULL)) + { + size_t bytes_written; + if (flags & (MY_NABP | MY_FNABP)) + bytes_written= (result == 0) ? count : 0; + else + bytes_written= (result != MY_FILE_ERROR) ? result : 0; + PSI_server->end_file_wait(locker, bytes_written); + } +#endif + return result; +} + +static inline size_t +inline_mysql_file_pread( +#ifdef HAVE_PSI_INTERFACE + const char *src_file, uint src_line, +#endif + File file, uchar *buffer, size_t count, my_off_t offset, myf flags) +{ + size_t result; +#ifdef HAVE_PSI_INTERFACE + struct PSI_file_locker *locker= NULL; + PSI_file_locker_state state; + if (likely(PSI_server != NULL)) + { + locker= PSI_server->get_thread_file_descriptor_locker(&state, file, PSI_FILE_READ); + if (likely(locker != NULL)) + PSI_server->start_file_wait(locker, count, src_file, src_line); + } +#endif + result= my_pread(file, buffer, count, offset, flags); +#ifdef HAVE_PSI_INTERFACE + if (likely(locker != NULL)) + { + size_t bytes_read; + if (flags & (MY_NABP | MY_FNABP)) + bytes_read= (result == 0) ? count : 0; + else + bytes_read= (result != MY_FILE_ERROR) ? result : 0; + PSI_server->end_file_wait(locker, bytes_read); + } +#endif + return result; +} + +static inline size_t +inline_mysql_file_pwrite( +#ifdef HAVE_PSI_INTERFACE + const char *src_file, uint src_line, +#endif + File file, const uchar *buffer, size_t count, my_off_t offset, myf flags) +{ + size_t result; +#ifdef HAVE_PSI_INTERFACE + struct PSI_file_locker *locker= NULL; + PSI_file_locker_state state; + if (likely(PSI_server != NULL)) + { + locker= PSI_server->get_thread_file_descriptor_locker(&state, file, + PSI_FILE_WRITE); + if (likely(locker != NULL)) + PSI_server->start_file_wait(locker, count, src_file, src_line); + } +#endif + result= my_pwrite(file, buffer, count, offset, flags); +#ifdef HAVE_PSI_INTERFACE + if (likely(locker != NULL)) + { + size_t bytes_written; + if (flags & (MY_NABP | MY_FNABP)) + bytes_written= (result == 0) ? count : 0; + else + bytes_written= (result != MY_FILE_ERROR) ? result : 0; + PSI_server->end_file_wait(locker, bytes_written); + } +#endif + return result; +} + +static inline my_off_t +inline_mysql_file_seek( +#ifdef HAVE_PSI_INTERFACE + const char *src_file, uint src_line, +#endif + File file, my_off_t pos, int whence, myf flags) +{ + my_off_t result; +#ifdef HAVE_PSI_INTERFACE + struct PSI_file_locker *locker= NULL; + PSI_file_locker_state state; + if (likely(PSI_server != NULL)) + { + locker= PSI_server->get_thread_file_descriptor_locker(&state, file, PSI_FILE_SEEK); + if (likely(locker != NULL)) + PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line); + } +#endif + result= my_seek(file, pos, whence, flags); +#ifdef HAVE_PSI_INTERFACE + if (likely(locker != NULL)) + PSI_server->end_file_wait(locker, (size_t) 0); +#endif + return result; +} + +static inline my_off_t +inline_mysql_file_tell( +#ifdef HAVE_PSI_INTERFACE + const char *src_file, uint src_line, +#endif + File file, myf flags) +{ + my_off_t result; +#ifdef HAVE_PSI_INTERFACE + struct PSI_file_locker *locker= NULL; + PSI_file_locker_state state; + if (likely(PSI_server != NULL)) + { + locker= PSI_server->get_thread_file_descriptor_locker(&state, file, PSI_FILE_TELL); + if (likely(locker != NULL)) + PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line); + } +#endif + result= my_tell(file, flags); +#ifdef HAVE_PSI_INTERFACE + if (likely(locker != NULL)) + PSI_server->end_file_wait(locker, (size_t) 0); +#endif + return result; +} + +static inline int +inline_mysql_file_delete( +#ifdef HAVE_PSI_INTERFACE + PSI_file_key key, const char *src_file, uint src_line, +#endif + const char *name, myf flags) +{ + int result; +#ifdef HAVE_PSI_INTERFACE + struct PSI_file_locker *locker= NULL; + PSI_file_locker_state state; + if (likely(PSI_server != NULL)) + { + locker= PSI_server->get_thread_file_name_locker(&state, key, PSI_FILE_DELETE, + name, &locker); + if (likely(locker != NULL)) + PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line); + } +#endif + result= my_delete(name, flags); +#ifdef HAVE_PSI_INTERFACE + if (likely(locker != NULL)) + PSI_server->end_file_wait(locker, (size_t) 0); +#endif + return result; +} + +static inline int +inline_mysql_file_rename( +#ifdef HAVE_PSI_INTERFACE + PSI_file_key key, const char *src_file, uint src_line, +#endif + const char *from, const char *to, myf flags) +{ + int result; +#ifdef HAVE_PSI_INTERFACE + struct PSI_file_locker *locker= NULL; + PSI_file_locker_state state; + if (likely(PSI_server != NULL)) + { + locker= PSI_server->get_thread_file_name_locker(&state, key, PSI_FILE_RENAME, + to, &locker); + if (likely(locker != NULL)) + PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line); + } +#endif + result= my_rename(from, to, flags); +#ifdef HAVE_PSI_INTERFACE + if (likely(locker != NULL)) + PSI_server->end_file_wait(locker, (size_t) 0); +#endif + return result; +} + +static inline File +inline_mysql_file_create_with_symlink( +#ifdef HAVE_PSI_INTERFACE + PSI_file_key key, const char *src_file, uint src_line, +#endif + const char *linkname, const char *filename, int create_flags, + int access_flags, myf flags) +{ + File file; +#ifdef HAVE_PSI_INTERFACE + struct PSI_file_locker *locker= NULL; + PSI_file_locker_state state; + if (likely(PSI_server != NULL)) + { + locker= PSI_server->get_thread_file_name_locker(&state, key, PSI_FILE_CREATE, + filename, &locker); + if (likely(locker != NULL)) + PSI_server->start_file_open_wait(locker, src_file, src_line); + } +#endif + file= my_create_with_symlink(linkname, filename, create_flags, access_flags, + flags); +#ifdef HAVE_PSI_INTERFACE + if (likely(locker != NULL)) + PSI_server->end_file_open_wait_and_bind_to_descriptor(locker, file); +#endif + return file; +} + +static inline int +inline_mysql_file_delete_with_symlink( +#ifdef HAVE_PSI_INTERFACE + PSI_file_key key, const char *src_file, uint src_line, +#endif + const char *name, myf flags) +{ + int result; +#ifdef HAVE_PSI_INTERFACE + struct PSI_file_locker *locker= NULL; + PSI_file_locker_state state; + if (likely(PSI_server != NULL)) + { + locker= PSI_server->get_thread_file_name_locker(&state, key, PSI_FILE_DELETE, + name, &locker); + if (likely(locker != NULL)) + PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line); + } +#endif + result= my_delete_with_symlink(name, flags); +#ifdef HAVE_PSI_INTERFACE + if (likely(locker != NULL)) + PSI_server->end_file_wait(locker, (size_t) 0); +#endif + return result; +} + +static inline int +inline_mysql_file_rename_with_symlink( +#ifdef HAVE_PSI_INTERFACE + PSI_file_key key, const char *src_file, uint src_line, +#endif + const char *from, const char *to, myf flags) +{ + int result; +#ifdef HAVE_PSI_INTERFACE + struct PSI_file_locker *locker= NULL; + PSI_file_locker_state state; + if (likely(PSI_server != NULL)) + { + locker= PSI_server->get_thread_file_name_locker(&state, key, PSI_FILE_RENAME, + to, &locker); + if (likely(locker != NULL)) + PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line); + } +#endif + result= my_rename_with_symlink(from, to, flags); +#ifdef HAVE_PSI_INTERFACE + if (likely(locker != NULL)) + PSI_server->end_file_wait(locker, (size_t) 0); +#endif + return result; +} + +static inline int +inline_mysql_file_sync( +#ifdef HAVE_PSI_INTERFACE + const char *src_file, uint src_line, +#endif + File fd, myf flags) +{ + int result= 0; +#ifdef HAVE_PSI_INTERFACE + struct PSI_file_locker *locker= NULL; + PSI_file_locker_state state; + if (likely(PSI_server != NULL)) + { + locker= PSI_server->get_thread_file_descriptor_locker(&state, fd, PSI_FILE_SYNC); + if (likely(locker != NULL)) + PSI_server->start_file_wait(locker, (size_t) 0, src_file, src_line); + } +#endif + result= my_sync(fd, flags); +#ifdef HAVE_PSI_INTERFACE + if (likely(locker != NULL)) + PSI_server->end_file_wait(locker, (size_t) 0); +#endif + return result; +} + +/** @} (end of group File_instrumentation) */ + +#endif + diff --git a/dep/mysqllite/include/mysql/psi/mysql_thread.h b/dep/mysqllite/include/mysql/psi/mysql_thread.h new file mode 100644 index 0000000000000..5b8ea3dc5dcae --- /dev/null +++ b/dep/mysqllite/include/mysql/psi/mysql_thread.h @@ -0,0 +1,1071 @@ +/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */ + +#ifndef MYSQL_THREAD_H +#define MYSQL_THREAD_H + +/** + @file mysql/psi/mysql_thread.h + Instrumentation helpers for mysys threads, mutexes, + read write locks and conditions. + This header file provides the necessary declarations + to use the mysys thread API with the performance schema instrumentation. + In some compilers (SunStudio), 'static inline' functions, when declared + but not used, are not optimized away (because they are unused) by default, + so that including a static inline function from a header file does + create unwanted dependencies, causing unresolved symbols at link time. + Other compilers, like gcc, optimize these dependencies by default. + + Since the instrumented APIs declared here are wrapper on top + of my_pthread / safemutex / etc APIs, + including mysql/psi/mysql_thread.h assumes that + the dependency on my_pthread and safemutex already exists. +*/ +/* + Note: there are several orthogonal dimensions here. + + Dimension 1: Instrumentation + HAVE_PSI_INTERFACE is defined when the instrumentation is compiled in. + This may happen both in debug or production builds. + + Dimension 2: Debug + SAFE_MUTEX is defined when debug is compiled in. + This may happen both with and without instrumentation. + + Dimension 3: Platform + Mutexes are implemented with one of: + - the pthread library + - fast mutexes + - window apis + This is implemented by various macro definitions in my_pthread.h + + This causes complexity with '#ifdef'-ery that can't be avoided. +*/ + +#include "mysql/psi/psi.h" + +/** + @defgroup Thread_instrumentation Thread Instrumentation + @ingroup Instrumentation_interface + @{ +*/ + +/** + An instrumented mutex structure. + @sa mysql_mutex_t +*/ +struct st_mysql_mutex +{ + /** The real mutex. */ + pthread_mutex_t m_mutex; + /** + The instrumentation hook. + Note that this hook is not conditionally defined, + for binary compatibility of the @c mysql_mutex_t interface. + */ + struct PSI_mutex *m_psi; +}; + +/** + Type of an instrumented mutex. + @c mysql_mutex_t is a drop-in replacement for @c pthread_mutex_t. + @sa mysql_mutex_assert_owner + @sa mysql_mutex_assert_not_owner + @sa mysql_mutex_init + @sa mysql_mutex_lock + @sa mysql_mutex_unlock + @sa mysql_mutex_destroy +*/ +typedef struct st_mysql_mutex mysql_mutex_t; + +/** + An instrumented rwlock structure. + @sa mysql_rwlock_t +*/ +struct st_mysql_rwlock +{ + /** The real rwlock */ + rw_lock_t m_rwlock; + /** + The instrumentation hook. + Note that this hook is not conditionally defined, + for binary compatibility of the @c mysql_rwlock_t interface. + */ + struct PSI_rwlock *m_psi; +}; + +/** + An instrumented prlock structure. + @sa mysql_prlock_t +*/ +struct st_mysql_prlock +{ + /** The real prlock */ + rw_pr_lock_t m_prlock; + /** + The instrumentation hook. + Note that this hook is not conditionally defined, + for binary compatibility of the @c mysql_rwlock_t interface. + */ + struct PSI_rwlock *m_psi; +}; + +/** + Type of an instrumented rwlock. + @c mysql_rwlock_t is a drop-in replacement for @c pthread_rwlock_t. + @sa mysql_rwlock_init + @sa mysql_rwlock_rdlock + @sa mysql_rwlock_tryrdlock + @sa mysql_rwlock_wrlock + @sa mysql_rwlock_trywrlock + @sa mysql_rwlock_unlock + @sa mysql_rwlock_destroy +*/ +typedef struct st_mysql_rwlock mysql_rwlock_t; + +/** + Type of an instrumented prlock. + A prlock is a read write lock that 'prefers readers' (pr). + @c mysql_prlock_t is a drop-in replacement for @c rw_pr_lock_t. + @sa mysql_prlock_init + @sa mysql_prlock_rdlock + @sa mysql_prlock_wrlock + @sa mysql_prlock_unlock + @sa mysql_prlock_destroy +*/ +typedef struct st_mysql_prlock mysql_prlock_t; + +/** + An instrumented cond structure. + @sa mysql_cond_t +*/ +struct st_mysql_cond +{ + /** The real condition */ + pthread_cond_t m_cond; + /** + The instrumentation hook. + Note that this hook is not conditionally defined, + for binary compatibility of the @c mysql_cond_t interface. + */ + struct PSI_cond *m_psi; +}; + +/** + Type of an instrumented condition. + @c mysql_cond_t is a drop-in replacement for @c pthread_cond_t. + @sa mysql_cond_init + @sa mysql_cond_wait + @sa mysql_cond_timedwait + @sa mysql_cond_signal + @sa mysql_cond_broadcast + @sa mysql_cond_destroy +*/ +typedef struct st_mysql_cond mysql_cond_t; + +/* + Consider the following code: + static inline void foo() { bar(); } + when foo() is never called. + + With gcc, foo() is a local static function, so the dependencies + are optimized away at compile time, and there is no dependency on bar(). + With other compilers (HP, Sun Studio), the function foo() implementation + is compiled, and bar() needs to be present to link. + + Due to the existing header dependencies in MySQL code, this header file + is sometime used when it is not needed, which in turn cause link failures + on some platforms. + The proper fix would be to cut these extra dependencies in the calling code. + DISABLE_MYSQL_THREAD_H is a work around to limit dependencies. + DISABLE_MYSQL_PRLOCK_H is similar, and is used to disable specifically + the prlock wrappers. +*/ +#ifndef DISABLE_MYSQL_THREAD_H + +/** + @def mysql_mutex_assert_owner(M) + Wrapper, to use safe_mutex_assert_owner with instrumented mutexes. + @c mysql_mutex_assert_owner is a drop-in replacement + for @c safe_mutex_assert_owner. +*/ +#define mysql_mutex_assert_owner(M) \ + safe_mutex_assert_owner(&(M)->m_mutex) + +/** + @def mysql_mutex_assert_not_owner(M) + Wrapper, to use safe_mutex_assert_not_owner with instrumented mutexes. + @c mysql_mutex_assert_not_owner is a drop-in replacement + for @c safe_mutex_assert_not_owner. +*/ +#define mysql_mutex_assert_not_owner(M) \ + safe_mutex_assert_not_owner(&(M)->m_mutex) + +/** Wrappers for instrumented prlock objects. */ + +#define mysql_prlock_assert_write_owner(M) \ + rw_pr_lock_assert_write_owner(&(M)->m_prlock) + +#define mysql_prlock_assert_not_write_owner(M) \ + rw_pr_lock_assert_not_write_owner(&(M)->m_prlock) + +/** + @def mysql_mutex_init(K, M, A) + Instrumented mutex_init. + @c mysql_mutex_init is a replacement for @c pthread_mutex_init. + @param K The PSI_mutex_key for this instrumented mutex + @param M The mutex to initialize + @param A Mutex attributes +*/ + +#ifdef HAVE_PSI_INTERFACE + #ifdef SAFE_MUTEX + #define mysql_mutex_init(K, M, A) \ + inline_mysql_mutex_init(K, M, A, __FILE__, __LINE__) + #else + #define mysql_mutex_init(K, M, A) \ + inline_mysql_mutex_init(K, M, A) + #endif +#else + #ifdef SAFE_MUTEX + #define mysql_mutex_init(K, M, A) \ + inline_mysql_mutex_init(M, A, __FILE__, __LINE__) + #else + #define mysql_mutex_init(K, M, A) \ + inline_mysql_mutex_init(M, A) + #endif +#endif + +/** + @def mysql_mutex_destroy(M) + Instrumented mutex_destroy. + @c mysql_mutex_destroy is a drop-in replacement + for @c pthread_mutex_destroy. +*/ +#ifdef SAFE_MUTEX + #define mysql_mutex_destroy(M) \ + inline_mysql_mutex_destroy(M, __FILE__, __LINE__) +#else + #define mysql_mutex_destroy(M) \ + inline_mysql_mutex_destroy(M) +#endif + +/** + @def mysql_mutex_lock(M) + Instrumented mutex_lock. + @c mysql_mutex_lock is a drop-in replacement for @c pthread_mutex_lock. + @param M The mutex to lock +*/ + +#if defined(SAFE_MUTEX) || defined (HAVE_PSI_INTERFACE) + #define mysql_mutex_lock(M) \ + inline_mysql_mutex_lock(M, __FILE__, __LINE__) +#else + #define mysql_mutex_lock(M) \ + inline_mysql_mutex_lock(M) +#endif + +/** + @def mysql_mutex_trylock(M) + Instrumented mutex_lock. + @c mysql_mutex_trylock is a drop-in replacement + for @c pthread_mutex_trylock. +*/ + +#if defined(SAFE_MUTEX) || defined (HAVE_PSI_INTERFACE) + #define mysql_mutex_trylock(M) \ + inline_mysql_mutex_trylock(M, __FILE__, __LINE__) +#else + #define mysql_mutex_trylock(M) \ + inline_mysql_mutex_trylock(M) +#endif + +/** + @def mysql_mutex_unlock(M) + Instrumented mutex_unlock. + @c mysql_mutex_unlock is a drop-in replacement for @c pthread_mutex_unlock. +*/ +#ifdef SAFE_MUTEX + #define mysql_mutex_unlock(M) \ + inline_mysql_mutex_unlock(M, __FILE__, __LINE__) +#else + #define mysql_mutex_unlock(M) \ + inline_mysql_mutex_unlock(M) +#endif + +/** + @def mysql_rwlock_init(K, RW) + Instrumented rwlock_init. + @c mysql_rwlock_init is a replacement for @c pthread_rwlock_init. + Note that pthread_rwlockattr_t is not supported in MySQL. + @param K The PSI_rwlock_key for this instrumented rwlock + @param RW The rwlock to initialize +*/ +#ifdef HAVE_PSI_INTERFACE + #define mysql_rwlock_init(K, RW) inline_mysql_rwlock_init(K, RW) +#else + #define mysql_rwlock_init(K, RW) inline_mysql_rwlock_init(RW) +#endif + +/** + @def mysql_prlock_init(K, RW) + Instrumented rw_pr_init. + @c mysql_prlock_init is a replacement for @c rw_pr_init. + @param K The PSI_rwlock_key for this instrumented prlock + @param RW The prlock to initialize +*/ +#ifdef HAVE_PSI_INTERFACE + #define mysql_prlock_init(K, RW) inline_mysql_prlock_init(K, RW) +#else + #define mysql_prlock_init(K, RW) inline_mysql_prlock_init(RW) +#endif + +/** + @def mysql_rwlock_destroy(RW) + Instrumented rwlock_destroy. + @c mysql_rwlock_destroy is a drop-in replacement + for @c pthread_rwlock_destroy. +*/ +#define mysql_rwlock_destroy(RW) inline_mysql_rwlock_destroy(RW) + +/** + @def mysql_prlock_destroy(RW) + Instrumented rw_pr_destroy. + @c mysql_prlock_destroy is a drop-in replacement + for @c rw_pr_destroy. +*/ +#define mysql_prlock_destroy(RW) inline_mysql_prlock_destroy(RW) + +/** + @def mysql_rwlock_rdlock(RW) + Instrumented rwlock_rdlock. + @c mysql_rwlock_rdlock is a drop-in replacement + for @c pthread_rwlock_rdlock. +*/ +#ifdef HAVE_PSI_INTERFACE + #define mysql_rwlock_rdlock(RW) \ + inline_mysql_rwlock_rdlock(RW, __FILE__, __LINE__) +#else + #define mysql_rwlock_rdlock(RW) \ + inline_mysql_rwlock_rdlock(RW) +#endif + +/** + @def mysql_prlock_rdlock(RW) + Instrumented rw_pr_rdlock. + @c mysql_prlock_rdlock is a drop-in replacement + for @c rw_pr_rdlock. +*/ +#ifdef HAVE_PSI_INTERFACE + #define mysql_prlock_rdlock(RW) \ + inline_mysql_prlock_rdlock(RW, __FILE__, __LINE__) +#else + #define mysql_prlock_rdlock(RW) \ + inline_mysql_prlock_rdlock(RW) +#endif + +/** + @def mysql_rwlock_wrlock(RW) + Instrumented rwlock_wrlock. + @c mysql_rwlock_wrlock is a drop-in replacement + for @c pthread_rwlock_wrlock. +*/ +#ifdef HAVE_PSI_INTERFACE + #define mysql_rwlock_wrlock(RW) \ + inline_mysql_rwlock_wrlock(RW, __FILE__, __LINE__) +#else + #define mysql_rwlock_wrlock(RW) \ + inline_mysql_rwlock_wrlock(RW) +#endif + +/** + @def mysql_prlock_wrlock(RW) + Instrumented rw_pr_wrlock. + @c mysql_prlock_wrlock is a drop-in replacement + for @c rw_pr_wrlock. +*/ +#ifdef HAVE_PSI_INTERFACE + #define mysql_prlock_wrlock(RW) \ + inline_mysql_prlock_wrlock(RW, __FILE__, __LINE__) +#else + #define mysql_prlock_wrlock(RW) \ + inline_mysql_prlock_wrlock(RW) +#endif + +/** + @def mysql_rwlock_tryrdlock(RW) + Instrumented rwlock_tryrdlock. + @c mysql_rwlock_tryrdlock is a drop-in replacement + for @c pthread_rwlock_tryrdlock. +*/ +#ifdef HAVE_PSI_INTERFACE + #define mysql_rwlock_tryrdlock(RW) \ + inline_mysql_rwlock_tryrdlock(RW, __FILE__, __LINE__) +#else + #define mysql_rwlock_tryrdlock(RW) \ + inline_mysql_rwlock_tryrdlock(RW) +#endif + +/** + @def mysql_rwlock_trywrlock(RW) + Instrumented rwlock_trywrlock. + @c mysql_rwlock_trywrlock is a drop-in replacement + for @c pthread_rwlock_trywrlock. +*/ +#ifdef HAVE_PSI_INTERFACE + #define mysql_rwlock_trywrlock(RW) \ + inline_mysql_rwlock_trywrlock(RW, __FILE__, __LINE__) +#else + #define mysql_rwlock_trywrlock(RW) \ + inline_mysql_rwlock_trywrlock(RW) +#endif + +/** + @def mysql_rwlock_unlock(RW) + Instrumented rwlock_unlock. + @c mysql_rwlock_unlock is a drop-in replacement + for @c pthread_rwlock_unlock. +*/ +#define mysql_rwlock_unlock(RW) inline_mysql_rwlock_unlock(RW) + +/** + @def mysql_prlock_unlock(RW) + Instrumented rw_pr_unlock. + @c mysql_prlock_unlock is a drop-in replacement + for @c rw_pr_unlock. +*/ +#define mysql_prlock_unlock(RW) inline_mysql_prlock_unlock(RW) + +/** + @def mysql_cond_init(K, C, A) + Instrumented cond_init. + @c mysql_cond_init is a replacement for @c pthread_cond_init. + @param C The cond to initialize + @param K The PSI_cond_key for this instrumented cond + @param A Condition attributes +*/ +#ifdef HAVE_PSI_INTERFACE + #define mysql_cond_init(K, C, A) inline_mysql_cond_init(K, C, A) +#else + #define mysql_cond_init(K, C, A) inline_mysql_cond_init(C, A) +#endif + +/** + @def mysql_cond_destroy(C) + Instrumented cond_destroy. + @c mysql_cond_destroy is a drop-in replacement for @c pthread_cond_destroy. +*/ +#define mysql_cond_destroy(C) inline_mysql_cond_destroy(C) + +/** + @def mysql_cond_wait(C) + Instrumented cond_wait. + @c mysql_cond_wait is a drop-in replacement for @c pthread_cond_wait. +*/ +#ifdef HAVE_PSI_INTERFACE + #define mysql_cond_wait(C, M) \ + inline_mysql_cond_wait(C, M, __FILE__, __LINE__) +#else + #define mysql_cond_wait(C, M) \ + inline_mysql_cond_wait(C, M) +#endif + +/** + @def mysql_cond_timedwait(C, M, W) + Instrumented cond_timedwait. + @c mysql_cond_timedwait is a drop-in replacement + for @c pthread_cond_timedwait. +*/ +#ifdef HAVE_PSI_INTERFACE + #define mysql_cond_timedwait(C, M, W) \ + inline_mysql_cond_timedwait(C, M, W, __FILE__, __LINE__) +#else + #define mysql_cond_timedwait(C, M, W) \ + inline_mysql_cond_timedwait(C, M, W) +#endif + +/** + @def mysql_cond_signal(C) + Instrumented cond_signal. + @c mysql_cond_signal is a drop-in replacement for @c pthread_cond_signal. +*/ +#define mysql_cond_signal(C) inline_mysql_cond_signal(C) + +/** + @def mysql_cond_broadcast(C) + Instrumented cond_broadcast. + @c mysql_cond_broadcast is a drop-in replacement + for @c pthread_cond_broadcast. +*/ +#define mysql_cond_broadcast(C) inline_mysql_cond_broadcast(C) + + +/** + @def mysql_thread_create(K, P1, P2, P3, P4) + Instrumented pthread_create. + This function creates both the thread instrumentation and a thread. + @c mysql_thread_create is a replacement for @c pthread_create. + The parameter P4 (or, if it is NULL, P1) will be used as the + instrumented thread "indentity". + Providing a P1 / P4 parameter with a different value for each call + will on average improve performances, since this thread identity value + is used internally to randomize access to data and prevent contention. + This is optional, and the improvement is not guaranteed, only statistical. + @param K The PSI_thread_key for this instrumented thread + @param P1 pthread_create parameter 1 + @param P2 pthread_create parameter 2 + @param P3 pthread_create parameter 3 + @param P4 pthread_create parameter 4 +*/ +#ifdef HAVE_PSI_INTERFACE + #define mysql_thread_create(K, P1, P2, P3, P4) \ + inline_mysql_thread_create(K, P1, P2, P3, P4) +#else + #define mysql_thread_create(K, P1, P2, P3, P4) \ + pthread_create(P1, P2, P3, P4) +#endif + +/** + @def mysql_thread_set_psi_id(I) + Set the thread indentifier for the instrumentation. + @param I The thread identifier +*/ +#ifdef HAVE_PSI_INTERFACE + #define mysql_thread_set_psi_id(I) inline_mysql_thread_set_psi_id(I) +#else + #define mysql_thread_set_psi_id(I) do {} while (0) +#endif + +static inline int inline_mysql_mutex_init( +#ifdef HAVE_PSI_INTERFACE + PSI_mutex_key key, +#endif + mysql_mutex_t *that, + const pthread_mutexattr_t *attr +#ifdef SAFE_MUTEX + , const char *src_file, uint src_line +#endif + ) +{ +#ifdef HAVE_PSI_INTERFACE + that->m_psi= PSI_server ? PSI_server->init_mutex(key, &that->m_mutex) + : NULL; +#else + that->m_psi= NULL; +#endif +#ifdef SAFE_MUTEX + return safe_mutex_init(&that->m_mutex, attr, src_file, src_line); +#else + return pthread_mutex_init(&that->m_mutex, attr); +#endif +} + +static inline int inline_mysql_mutex_destroy( + mysql_mutex_t *that +#ifdef SAFE_MUTEX + , const char *src_file, uint src_line +#endif + ) +{ +#ifdef HAVE_PSI_INTERFACE + if (likely(PSI_server && that->m_psi)) + { + PSI_server->destroy_mutex(that->m_psi); + that->m_psi= NULL; + } +#endif +#ifdef SAFE_MUTEX + return safe_mutex_destroy(&that->m_mutex, src_file, src_line); +#else + return pthread_mutex_destroy(&that->m_mutex); +#endif +} + +static inline int inline_mysql_mutex_lock( + mysql_mutex_t *that +#if defined(SAFE_MUTEX) || defined (HAVE_PSI_INTERFACE) + , const char *src_file, uint src_line +#endif + ) +{ + int result; +#ifdef HAVE_PSI_INTERFACE + struct PSI_mutex_locker *locker= NULL; + PSI_mutex_locker_state state; + if (likely(PSI_server && that->m_psi)) + { + locker= PSI_server->get_thread_mutex_locker(&state, that->m_psi, PSI_MUTEX_LOCK); + if (likely(locker != NULL)) + PSI_server->start_mutex_wait(locker, src_file, src_line); + } +#endif +#ifdef SAFE_MUTEX + result= safe_mutex_lock(&that->m_mutex, FALSE, src_file, src_line); +#else + result= pthread_mutex_lock(&that->m_mutex); +#endif +#ifdef HAVE_PSI_INTERFACE + if (likely(locker != NULL)) + PSI_server->end_mutex_wait(locker, result); +#endif + return result; +} + +static inline int inline_mysql_mutex_trylock( + mysql_mutex_t *that +#if defined(SAFE_MUTEX) || defined (HAVE_PSI_INTERFACE) + , const char *src_file, uint src_line +#endif + ) +{ + int result; +#ifdef HAVE_PSI_INTERFACE + struct PSI_mutex_locker *locker= NULL; + PSI_mutex_locker_state state; + if (likely(PSI_server && that->m_psi)) + { + locker= PSI_server->get_thread_mutex_locker(&state, that->m_psi, PSI_MUTEX_TRYLOCK); + if (likely(locker != NULL)) + PSI_server->start_mutex_wait(locker, src_file, src_line); + } +#endif +#ifdef SAFE_MUTEX + result= safe_mutex_lock(&that->m_mutex, TRUE, src_file, src_line); +#else + result= pthread_mutex_trylock(&that->m_mutex); +#endif +#ifdef HAVE_PSI_INTERFACE + if (likely(locker != NULL)) + PSI_server->end_mutex_wait(locker, result); +#endif + return result; +} + +static inline int inline_mysql_mutex_unlock( + mysql_mutex_t *that +#ifdef SAFE_MUTEX + , const char *src_file, uint src_line +#endif + ) +{ + int result; +#ifdef HAVE_PSI_INTERFACE + if (likely(PSI_server && that->m_psi)) + PSI_server->unlock_mutex(that->m_psi); +#endif +#ifdef SAFE_MUTEX + result= safe_mutex_unlock(&that->m_mutex, src_file, src_line); +#else + result= pthread_mutex_unlock(&that->m_mutex); +#endif + return result; +} + +static inline int inline_mysql_rwlock_init( +#ifdef HAVE_PSI_INTERFACE + PSI_rwlock_key key, +#endif + mysql_rwlock_t *that) +{ +#ifdef HAVE_PSI_INTERFACE + that->m_psi= (PSI_server ? PSI_server->init_rwlock(key, &that->m_rwlock) + : NULL); +#else + that->m_psi= NULL; +#endif + /* + pthread_rwlockattr_t is not used in MySQL. + */ + return my_rwlock_init(&that->m_rwlock, NULL); +} + +#ifndef DISABLE_MYSQL_PRLOCK_H +static inline int inline_mysql_prlock_init( +#ifdef HAVE_PSI_INTERFACE + PSI_rwlock_key key, +#endif + mysql_prlock_t *that) +{ +#ifdef HAVE_PSI_INTERFACE + that->m_psi= (PSI_server ? PSI_server->init_rwlock(key, &that->m_prlock) + : NULL); +#else + that->m_psi= NULL; +#endif + return rw_pr_init(&that->m_prlock); +} +#endif + +static inline int inline_mysql_rwlock_destroy( + mysql_rwlock_t *that) +{ +#ifdef HAVE_PSI_INTERFACE + if (likely(PSI_server && that->m_psi)) + { + PSI_server->destroy_rwlock(that->m_psi); + that->m_psi= NULL; + } +#endif + return rwlock_destroy(&that->m_rwlock); +} + +#ifndef DISABLE_MYSQL_PRLOCK_H +static inline int inline_mysql_prlock_destroy( + mysql_prlock_t *that) +{ +#ifdef HAVE_PSI_INTERFACE + if (likely(PSI_server && that->m_psi)) + { + PSI_server->destroy_rwlock(that->m_psi); + that->m_psi= NULL; + } +#endif + return rw_pr_destroy(&that->m_prlock); +} +#endif + +static inline int inline_mysql_rwlock_rdlock( + mysql_rwlock_t *that +#ifdef HAVE_PSI_INTERFACE + , const char *src_file, uint src_line +#endif + ) +{ + int result; +#ifdef HAVE_PSI_INTERFACE + struct PSI_rwlock_locker *locker= NULL; + PSI_rwlock_locker_state state; + if (likely(PSI_server && that->m_psi)) + { + locker= PSI_server->get_thread_rwlock_locker(&state, that->m_psi, + PSI_RWLOCK_READLOCK); + if (likely(locker != NULL)) + PSI_server->start_rwlock_rdwait(locker, src_file, src_line); + } +#endif + result= rw_rdlock(&that->m_rwlock); +#ifdef HAVE_PSI_INTERFACE + if (likely(locker != NULL)) + PSI_server->end_rwlock_rdwait(locker, result); +#endif + return result; +} + +#ifndef DISABLE_MYSQL_PRLOCK_H +static inline int inline_mysql_prlock_rdlock( + mysql_prlock_t *that +#ifdef HAVE_PSI_INTERFACE + , const char *src_file, uint src_line +#endif + ) +{ + int result; +#ifdef HAVE_PSI_INTERFACE + struct PSI_rwlock_locker *locker= NULL; + PSI_rwlock_locker_state state; + if (likely(PSI_server && that->m_psi)) + { + locker= PSI_server->get_thread_rwlock_locker(&state, that->m_psi, + PSI_RWLOCK_READLOCK); + if (likely(locker != NULL)) + PSI_server->start_rwlock_rdwait(locker, src_file, src_line); + } +#endif + result= rw_pr_rdlock(&that->m_prlock); +#ifdef HAVE_PSI_INTERFACE + if (likely(locker != NULL)) + PSI_server->end_rwlock_rdwait(locker, result); +#endif + return result; +} +#endif + +static inline int inline_mysql_rwlock_wrlock( + mysql_rwlock_t *that +#ifdef HAVE_PSI_INTERFACE + , const char *src_file, uint src_line +#endif + ) +{ + int result; +#ifdef HAVE_PSI_INTERFACE + struct PSI_rwlock_locker *locker= NULL; + PSI_rwlock_locker_state state; + if (likely(PSI_server && that->m_psi)) + { + locker= PSI_server->get_thread_rwlock_locker(&state, that->m_psi, + PSI_RWLOCK_WRITELOCK); + if (likely(locker != NULL)) + PSI_server->start_rwlock_wrwait(locker, src_file, src_line); + } +#endif + result= rw_wrlock(&that->m_rwlock); +#ifdef HAVE_PSI_INTERFACE + if (likely(locker != NULL)) + PSI_server->end_rwlock_wrwait(locker, result); +#endif + return result; +} + +#ifndef DISABLE_MYSQL_PRLOCK_H +static inline int inline_mysql_prlock_wrlock( + mysql_prlock_t *that +#ifdef HAVE_PSI_INTERFACE + , const char *src_file, uint src_line +#endif + ) +{ + int result; +#ifdef HAVE_PSI_INTERFACE + struct PSI_rwlock_locker *locker= NULL; + PSI_rwlock_locker_state state; + if (likely(PSI_server && that->m_psi)) + { + locker= PSI_server->get_thread_rwlock_locker(&state, that->m_psi, + PSI_RWLOCK_WRITELOCK); + if (likely(locker != NULL)) + PSI_server->start_rwlock_wrwait(locker, src_file, src_line); + } +#endif + result= rw_pr_wrlock(&that->m_prlock); +#ifdef HAVE_PSI_INTERFACE + if (likely(locker != NULL)) + PSI_server->end_rwlock_wrwait(locker, result); +#endif + return result; +} +#endif + +static inline int inline_mysql_rwlock_tryrdlock( + mysql_rwlock_t *that +#ifdef HAVE_PSI_INTERFACE + , const char *src_file, uint src_line +#endif + ) +{ + int result; +#ifdef HAVE_PSI_INTERFACE + struct PSI_rwlock_locker *locker= NULL; + PSI_rwlock_locker_state state; + if (likely(PSI_server && that->m_psi)) + { + locker= PSI_server->get_thread_rwlock_locker(&state, that->m_psi, + PSI_RWLOCK_TRYREADLOCK); + if (likely(locker != NULL)) + PSI_server->start_rwlock_rdwait(locker, src_file, src_line); + } +#endif + result= rw_tryrdlock(&that->m_rwlock); +#ifdef HAVE_PSI_INTERFACE + if (likely(locker != NULL)) + PSI_server->end_rwlock_rdwait(locker, result); +#endif + return result; +} + +static inline int inline_mysql_rwlock_trywrlock( + mysql_rwlock_t *that +#ifdef HAVE_PSI_INTERFACE + , const char *src_file, uint src_line +#endif + ) +{ + int result; +#ifdef HAVE_PSI_INTERFACE + struct PSI_rwlock_locker *locker= NULL; + PSI_rwlock_locker_state state; + if (likely(PSI_server && that->m_psi)) + { + locker= PSI_server->get_thread_rwlock_locker(&state, that->m_psi, + PSI_RWLOCK_TRYWRITELOCK); + if (likely(locker != NULL)) + PSI_server->start_rwlock_wrwait(locker, src_file, src_line); + } +#endif + result= rw_trywrlock(&that->m_rwlock); +#ifdef HAVE_PSI_INTERFACE + if (likely(locker != NULL)) + PSI_server->end_rwlock_wrwait(locker, result); +#endif + return result; +} + +static inline int inline_mysql_rwlock_unlock( + mysql_rwlock_t *that) +{ + int result; +#ifdef HAVE_PSI_INTERFACE + if (likely(PSI_server && that->m_psi)) + PSI_server->unlock_rwlock(that->m_psi); +#endif + result= rw_unlock(&that->m_rwlock); + return result; +} + +#ifndef DISABLE_MYSQL_PRLOCK_H +static inline int inline_mysql_prlock_unlock( + mysql_prlock_t *that) +{ + int result; +#ifdef HAVE_PSI_INTERFACE + if (likely(PSI_server && that->m_psi)) + PSI_server->unlock_rwlock(that->m_psi); +#endif + result= rw_pr_unlock(&that->m_prlock); + return result; +} +#endif + +static inline int inline_mysql_cond_init( +#ifdef HAVE_PSI_INTERFACE + PSI_cond_key key, +#endif + mysql_cond_t *that, + const pthread_condattr_t *attr) +{ +#ifdef HAVE_PSI_INTERFACE + that->m_psi= (PSI_server ? PSI_server->init_cond(key, &that->m_cond) + : NULL); +#else + that->m_psi= NULL; +#endif + return pthread_cond_init(&that->m_cond, attr); +} + +static inline int inline_mysql_cond_destroy( + mysql_cond_t *that) +{ +#ifdef HAVE_PSI_INTERFACE + if (likely(PSI_server && that->m_psi)) + { + PSI_server->destroy_cond(that->m_psi); + that->m_psi= NULL; + } +#endif + return pthread_cond_destroy(&that->m_cond); +} + +static inline int inline_mysql_cond_wait( + mysql_cond_t *that, + mysql_mutex_t *mutex +#ifdef HAVE_PSI_INTERFACE + , const char *src_file, uint src_line +#endif + ) +{ + int result; +#ifdef HAVE_PSI_INTERFACE + struct PSI_cond_locker *locker= NULL; + PSI_cond_locker_state state; + if (likely(PSI_server && that->m_psi)) + { + locker= PSI_server->get_thread_cond_locker(&state, that->m_psi, mutex->m_psi, + PSI_COND_WAIT); + if (likely(locker != NULL)) + PSI_server->start_cond_wait(locker, src_file, src_line); + } +#endif + result= pthread_cond_wait(&that->m_cond, &mutex->m_mutex); +#ifdef HAVE_PSI_INTERFACE + if (likely(locker != NULL)) + PSI_server->end_cond_wait(locker, result); +#endif + return result; +} + +static inline int inline_mysql_cond_timedwait( + mysql_cond_t *that, + mysql_mutex_t *mutex, + struct timespec *abstime +#ifdef HAVE_PSI_INTERFACE + , const char *src_file, uint src_line +#endif + ) +{ + int result; +#ifdef HAVE_PSI_INTERFACE + struct PSI_cond_locker *locker= NULL; + PSI_cond_locker_state state; + if (likely(PSI_server && that->m_psi)) + { + locker= PSI_server->get_thread_cond_locker(&state, that->m_psi, mutex->m_psi, + PSI_COND_TIMEDWAIT); + if (likely(locker != NULL)) + PSI_server->start_cond_wait(locker, src_file, src_line); + } +#endif + result= pthread_cond_timedwait(&that->m_cond, &mutex->m_mutex, abstime); +#ifdef HAVE_PSI_INTERFACE + if (likely(locker != NULL)) + PSI_server->end_cond_wait(locker, result); +#endif + return result; +} + +static inline int inline_mysql_cond_signal( + mysql_cond_t *that) +{ + int result; +#ifdef HAVE_PSI_INTERFACE + if (likely(PSI_server && that->m_psi)) + PSI_server->signal_cond(that->m_psi); +#endif + result= pthread_cond_signal(&that->m_cond); + return result; +} + +static inline int inline_mysql_cond_broadcast( + mysql_cond_t *that) +{ + int result; +#ifdef HAVE_PSI_INTERFACE + if (likely(PSI_server && that->m_psi)) + PSI_server->broadcast_cond(that->m_psi); +#endif + result= pthread_cond_broadcast(&that->m_cond); + return result; +} + +#ifdef HAVE_PSI_INTERFACE +static inline int inline_mysql_thread_create( + PSI_thread_key key, + pthread_t *thread, const pthread_attr_t *attr, + void *(*start_routine)(void*), void *arg) +{ + int result; + if (likely(PSI_server != NULL)) + result= PSI_server->spawn_thread(key, thread, attr, start_routine, arg); + else + result= pthread_create(thread, attr, start_routine, arg); + return result; +} + +static inline void inline_mysql_thread_set_psi_id(ulong id) +{ + if (likely(PSI_server != NULL)) + { + struct PSI_thread *psi= PSI_server->get_thread(); + if (likely(psi != NULL)) + PSI_server->set_thread_id(psi, id); + } +} +#endif + +#endif /* DISABLE_MYSQL_THREAD_H */ + +/** @} (end of group Thread_instrumentation) */ + +#endif + diff --git a/dep/mysqllite/include/mysql/psi/psi.h b/dep/mysqllite/include/mysql/psi/psi.h new file mode 100644 index 0000000000000..562e4a80fd586 --- /dev/null +++ b/dep/mysqllite/include/mysql/psi/psi.h @@ -0,0 +1,1312 @@ +/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */ + +#ifndef MYSQL_PERFORMANCE_SCHEMA_INTERFACE_H +#define MYSQL_PERFORMANCE_SCHEMA_INTERFACE_H + +#ifndef _global_h +/* + Make sure a .c or .cc file contains an include to my_global.h first. + When this include is missing, all the #ifdef HAVE_XXX have no effect, + and the resulting binary won't build, or won't link, + or will crash at runtime + since various structures will have different binary definitions. +*/ +#error "You must include my_global.h in the code for the build to be correct." +#endif + +C_MODE_START + +/** + @file mysql/psi/psi.h + Performance schema instrumentation interface. + + @defgroup Instrumentation_interface Instrumentation Interface + @ingroup Performance_schema + @{ +*/ + +/** + Interface for an instrumented mutex. + This is an opaque structure. +*/ +struct PSI_mutex; + +/** + Interface for an instrumented rwlock. + This is an opaque structure. +*/ +struct PSI_rwlock; + +/** + Interface for an instrumented condition. + This is an opaque structure. +*/ +struct PSI_cond; + +/** + Interface for an instrumented table share. + This is an opaque structure. +*/ +struct PSI_table_share; + +/** + Interface for an instrumented table handle. + This is an opaque structure. +*/ +struct PSI_table; + +/** + Interface for an instrumented thread. + This is an opaque structure. +*/ +struct PSI_thread; + +/** + Interface for an instrumented file handle. + This is an opaque structure. +*/ +struct PSI_file; + +/** Entry point for the performance schema interface. */ +struct PSI_bootstrap +{ + /** + ABI interface finder. + Calling this method with an interface version number returns either + an instance of the ABI for this version, or NULL. + @param version the interface version number to find + @return a versioned interface (PSI_v1, PSI_v2 or PSI) + @sa PSI_VERSION_1 + @sa PSI_v1 + @sa PSI_VERSION_2 + @sa PSI_v2 + @sa PSI_CURRENT_VERSION + @sa PSI + */ + void* (*get_interface)(int version); +}; + +#ifdef HAVE_PSI_INTERFACE + +/** + @def PSI_VERSION_1 + Performance Schema Interface number for version 1. + This version is supported. +*/ +#define PSI_VERSION_1 1 + +/** + @def PSI_VERSION_2 + Performance Schema Interface number for version 2. + This version is not implemented, it's a placeholder. +*/ +#define PSI_VERSION_2 2 + +/** + @def PSI_CURRENT_VERSION + Performance Schema Interface number for the most recent version. + The most current version is @c PSI_VERSION_1 +*/ +#define PSI_CURRENT_VERSION 1 + +#ifndef USE_PSI_2 +#ifndef USE_PSI_1 +#define USE_PSI_1 +#endif +#endif + +/** + Interface for an instrumented mutex operation. + This is an opaque structure. +*/ +struct PSI_mutex_locker; + +/** + Interface for an instrumented rwlock operation. + This is an opaque structure. +*/ + +struct PSI_rwlock_locker; +/** + Interface for an instrumented condition operation. + This is an opaque structure. +*/ + +struct PSI_cond_locker; + +/** + Interface for an instrumented file operation. + This is an opaque structure. +*/ +struct PSI_file_locker; + +/** Operation performed on an instrumented mutex. */ +enum PSI_mutex_operation +{ + /** Lock. */ + PSI_MUTEX_LOCK= 0, + /** Lock attempt. */ + PSI_MUTEX_TRYLOCK= 1 +}; + +/** Operation performed on an instrumented rwlock. */ +enum PSI_rwlock_operation +{ + /** Read lock. */ + PSI_RWLOCK_READLOCK= 0, + /** Write lock. */ + PSI_RWLOCK_WRITELOCK= 1, + /** Read lock attempt. */ + PSI_RWLOCK_TRYREADLOCK= 2, + /** Write lock attempt. */ + PSI_RWLOCK_TRYWRITELOCK= 3 +}; + +/** Operation performed on an instrumented condition. */ +enum PSI_cond_operation +{ + /** Wait. */ + PSI_COND_WAIT= 0, + /** Wait, with timeout. */ + PSI_COND_TIMEDWAIT= 1 +}; + +/** Operation performed on an instrumented file. */ +enum PSI_file_operation +{ + /** File creation, as in @c create(). */ + PSI_FILE_CREATE= 0, + /** Temporary file creation, as in @c create_temp_file(). */ + PSI_FILE_CREATE_TMP= 1, + /** File open, as in @c open(). */ + PSI_FILE_OPEN= 2, + /** File open, as in @c fopen(). */ + PSI_FILE_STREAM_OPEN= 3, + /** File close, as in @c close(). */ + PSI_FILE_CLOSE= 4, + /** File close, as in @c fclose(). */ + PSI_FILE_STREAM_CLOSE= 5, + /** + Generic file read, such as @c fgets(), @c fgetc(), @c fread(), @c read(), + @c pread(). + */ + PSI_FILE_READ= 6, + /** + Generic file write, such as @c fputs(), @c fputc(), @c fprintf(), + @c vfprintf(), @c fwrite(), @c write(), @c pwrite(). + */ + PSI_FILE_WRITE= 7, + /** Generic file seek, such as @c fseek() or @c seek(). */ + PSI_FILE_SEEK= 8, + /** Generic file tell, such as @c ftell() or @c tell(). */ + PSI_FILE_TELL= 9, + /** File flush, as in @c fflush(). */ + PSI_FILE_FLUSH= 10, + /** File stat, as in @c stat(). */ + PSI_FILE_STAT= 11, + /** File stat, as in @c fstat(). */ + PSI_FILE_FSTAT= 12, + /** File chsize, as in @c my_chsize(). */ + PSI_FILE_CHSIZE= 13, + /** File delete, such as @c my_delete() or @c my_delete_with_symlink(). */ + PSI_FILE_DELETE= 14, + /** File rename, such as @c my_rename() or @c my_rename_with_symlink(). */ + PSI_FILE_RENAME= 15, + /** File sync, as in @c fsync() or @c my_sync(). */ + PSI_FILE_SYNC= 16 +}; + +/** + Interface for an instrumented table operation. + This is an opaque structure. +*/ +struct PSI_table_locker; + +/** + Instrumented mutex key. + To instrument a mutex, a mutex key must be obtained using @c register_mutex. + Using a zero key always disable the instrumentation. +*/ +typedef unsigned int PSI_mutex_key; + +/** + Instrumented rwlock key. + To instrument a rwlock, a rwlock key must be obtained + using @c register_rwlock. + Using a zero key always disable the instrumentation. +*/ +typedef unsigned int PSI_rwlock_key; + +/** + Instrumented cond key. + To instrument a condition, a condition key must be obtained + using @c register_cond. + Using a zero key always disable the instrumentation. +*/ +typedef unsigned int PSI_cond_key; + +/** + Instrumented thread key. + To instrument a thread, a thread key must be obtained + using @c register_thread. + Using a zero key always disable the instrumentation. +*/ +typedef unsigned int PSI_thread_key; + +/** + Instrumented file key. + To instrument a file, a file key must be obtained using @c register_file. + Using a zero key always disable the instrumentation. +*/ +typedef unsigned int PSI_file_key; + +/** + @def USE_PSI_1 + Define USE_PSI_1 to use the interface version 1. +*/ + +/** + @def USE_PSI_2 + Define USE_PSI_2 to use the interface version 2. +*/ + +/** + @def HAVE_PSI_1 + Define HAVE_PSI_1 if the interface version 1 needs to be compiled in. +*/ + +/** + @def HAVE_PSI_2 + Define HAVE_PSI_2 if the interface version 2 needs to be compiled in. +*/ + +/** + Global flag. + This flag indicate that an instrumentation point is a global variable, + or a singleton. +*/ +#define PSI_FLAG_GLOBAL (1 << 0) + +#ifdef USE_PSI_1 +#define HAVE_PSI_1 +#endif + +#ifdef HAVE_PSI_1 + +/** + @defgroup Group_PSI_v1 Application Binary Interface, version 1 + @ingroup Instrumentation_interface + @{ +*/ + +/** + Mutex information. + @since PSI_VERSION_1 + This structure is used to register an instrumented mutex. +*/ +struct PSI_mutex_info_v1 +{ + /** + Pointer to the key assigned to the registered mutex. + */ + PSI_mutex_key *m_key; + /** + The name of the mutex to register. + */ + const char *m_name; + /** + The flags of the mutex to register. + @sa PSI_FLAG_GLOBAL + */ + int m_flags; +}; + +/** + Rwlock information. + @since PSI_VERSION_1 + This structure is used to register an instrumented rwlock. +*/ +struct PSI_rwlock_info_v1 +{ + /** + Pointer to the key assigned to the registered rwlock. + */ + PSI_rwlock_key *m_key; + /** + The name of the rwlock to register. + */ + const char *m_name; + /** + The flags of the rwlock to register. + @sa PSI_FLAG_GLOBAL + */ + int m_flags; +}; + +/** + Condition information. + @since PSI_VERSION_1 + This structure is used to register an instrumented cond. +*/ +struct PSI_cond_info_v1 +{ + /** + Pointer to the key assigned to the registered cond. + */ + PSI_cond_key *m_key; + /** + The name of the cond to register. + */ + const char *m_name; + /** + The flags of the cond to register. + @sa PSI_FLAG_GLOBAL + */ + int m_flags; +}; + +/** + Thread instrument information. + @since PSI_VERSION_1 + This structure is used to register an instrumented thread. +*/ +struct PSI_thread_info_v1 +{ + /** + Pointer to the key assigned to the registered thread. + */ + PSI_thread_key *m_key; + /** + The name of the thread instrument to register. + */ + const char *m_name; + /** + The flags of the thread to register. + @sa PSI_FLAG_GLOBAL + */ + int m_flags; +}; + +/** + File instrument information. + @since PSI_VERSION_1 + This structure is used to register an instrumented file. +*/ +struct PSI_file_info_v1 +{ + /** + Pointer to the key assigned to the registered file. + */ + PSI_file_key *m_key; + /** + The name of the file instrument to register. + */ + const char *m_name; + /** + The flags of the file instrument to register. + @sa PSI_FLAG_GLOBAL + */ + int m_flags; +}; + +/** + State data storage for @c get_thread_mutex_locker_v1_t. + This structure provide temporary storage to a mutex locker. + The content of this structure is considered opaque, + the fields are only hints of what an implementation + of the psi interface can use. + This memory is provided by the instrumented code for performance reasons. + @sa get_thread_mutex_locker_v1_t +*/ +struct PSI_mutex_locker_state_v1 +{ + /** Internal state. */ + uint m_flags; + /** Current mutex. */ + struct PSI_mutex *m_mutex; + /** Current thread. */ + struct PSI_thread *m_thread; + /** Timer start. */ + ulonglong m_timer_start; + /** Timer function. */ + ulonglong (*m_timer)(void); + /** Current operation. */ + enum PSI_mutex_operation m_operation; + /** Source file. */ + const char* m_src_file; + /** Source line number. */ + int m_src_line; + /** Internal data. */ + void *m_wait; +}; + +/** + State data storage for @c get_thread_rwlock_locker_v1_t. + This structure provide temporary storage to a rwlock locker. + The content of this structure is considered opaque, + the fields are only hints of what an implementation + of the psi interface can use. + This memory is provided by the instrumented code for performance reasons. + @sa get_thread_rwlock_locker_v1_t +*/ +struct PSI_rwlock_locker_state_v1 +{ + /** Internal state. */ + uint m_flags; + /** Current rwlock. */ + struct PSI_rwlock *m_rwlock; + /** Current thread. */ + struct PSI_thread *m_thread; + /** Timer start. */ + ulonglong m_timer_start; + /** Timer function. */ + ulonglong (*m_timer)(void); + /** Current operation. */ + enum PSI_rwlock_operation m_operation; + /** Source file. */ + const char* m_src_file; + /** Source line number. */ + int m_src_line; + /** Internal data. */ + void *m_wait; +}; + +/** + State data storage for @c get_thread_cond_locker_v1_t. + This structure provide temporary storage to a condition locker. + The content of this structure is considered opaque, + the fields are only hints of what an implementation + of the psi interface can use. + This memory is provided by the instrumented code for performance reasons. + @sa get_thread_cond_locker_v1_t +*/ +struct PSI_cond_locker_state_v1 +{ + /** Internal state. */ + uint m_flags; + /** Current condition. */ + struct PSI_cond *m_cond; + /** Current mutex. */ + struct PSI_mutex *m_mutex; + /** Current thread. */ + struct PSI_thread *m_thread; + /** Timer start. */ + ulonglong m_timer_start; + /** Timer function. */ + ulonglong (*m_timer)(void); + /** Current operation. */ + enum PSI_cond_operation m_operation; + /** Source file. */ + const char* m_src_file; + /** Source line number. */ + int m_src_line; + /** Internal data. */ + void *m_wait; +}; + +/** + State data storage for @c get_thread_file_name_locker_v1_t. + This structure provide temporary storage to a file locker. + The content of this structure is considered opaque, + the fields are only hints of what an implementation + of the psi interface can use. + This memory is provided by the instrumented code for performance reasons. + @sa get_thread_file_name_locker_v1_t + @sa get_thread_file_stream_locker_v1_t + @sa get_thread_file_descriptor_locker_v1_t +*/ +struct PSI_file_locker_state_v1 +{ + /** Internal state. */ + uint m_flags; + /** Current file. */ + struct PSI_file *m_file; + /** Current thread. */ + struct PSI_thread *m_thread; + /** Operation number of bytes. */ + size_t m_number_of_bytes; + /** Timer start. */ + ulonglong m_timer_start; + /** Timer function. */ + ulonglong (*m_timer)(void); + /** Current operation. */ + enum PSI_file_operation m_operation; + /** Source file. */ + const char* m_src_file; + /** Source line number. */ + int m_src_line; + /** Internal data. */ + void *m_wait; +}; + +/** + State data storage for @c get_thread_table_locker_v1_t. + This structure provide temporary storage to a table locker. + The content of this structure is considered opaque, + the fields are only hints of what an implementation + of the psi interface can use. + This memory is provided by the instrumented code for performance reasons. + @sa get_thread_table_locker_v1_t +*/ +struct PSI_table_locker_state_v1 +{ + /** Internal state. */ + uint m_flags; + /** Current table handle. */ + struct PSI_table *m_table; + /** Current table share. */ + struct PSI_table_share *m_table_share; + /** Instrumentation class. */ + void *m_class; + /** Current thread. */ + struct PSI_thread *m_thread; + /** Timer start. */ + ulonglong m_timer_start; + /** Timer function. */ + ulonglong (*m_timer)(void); + /* Current operation (waiting for WL#4895). */ + /* enum PSI_table_operation m_operation; */ + /** Current table io index. */ + uint m_index; + /** Current table lock index. */ + uint m_lock_index; + /** Source file. */ + const char* m_src_file; + /** Source line number. */ + int m_src_line; + /** Internal data. */ + void *m_wait; +}; + +/* Using typedef to make reuse between PSI_v1 and PSI_v2 easier later. */ + +/** + Mutex registration API. + @param category a category name (typically a plugin name) + @param info an array of mutex info to register + @param count the size of the info array +*/ +typedef void (*register_mutex_v1_t) + (const char *category, struct PSI_mutex_info_v1 *info, int count); + +/** + Rwlock registration API. + @param category a category name (typically a plugin name) + @param info an array of rwlock info to register + @param count the size of the info array +*/ +typedef void (*register_rwlock_v1_t) + (const char *category, struct PSI_rwlock_info_v1 *info, int count); + +/** + Cond registration API. + @param category a category name (typically a plugin name) + @param info an array of cond info to register + @param count the size of the info array +*/ +typedef void (*register_cond_v1_t) + (const char *category, struct PSI_cond_info_v1 *info, int count); + +/** + Thread registration API. + @param category a category name (typically a plugin name) + @param info an array of thread info to register + @param count the size of the info array +*/ +typedef void (*register_thread_v1_t) + (const char *category, struct PSI_thread_info_v1 *info, int count); + +/** + File registration API. + @param category a category name (typically a plugin name) + @param info an array of file info to register + @param count the size of the info array +*/ +typedef void (*register_file_v1_t) + (const char *category, struct PSI_file_info_v1 *info, int count); + +/** + Mutex instrumentation initialisation API. + @param key the registered mutex key + @param identity the address of the mutex itself + @return an instrumented mutex +*/ +typedef struct PSI_mutex* (*init_mutex_v1_t) + (PSI_mutex_key key, const void *identity); + +/** + Mutex instrumentation destruction API. + @param mutex the mutex to destroy +*/ +typedef void (*destroy_mutex_v1_t)(struct PSI_mutex *mutex); + +/** + Rwlock instrumentation initialisation API. + @param key the registered rwlock key + @param identity the address of the rwlock itself + @return an instrumented rwlock +*/ +typedef struct PSI_rwlock* (*init_rwlock_v1_t) + (PSI_rwlock_key key, const void *identity); + +/** + Rwlock instrumentation destruction API. + @param rwlock the rwlock to destroy +*/ +typedef void (*destroy_rwlock_v1_t)(struct PSI_rwlock *rwlock); + +/** + Cond instrumentation initialisation API. + @param key the registered key + @param identity the address of the rwlock itself + @return an instrumented cond +*/ +typedef struct PSI_cond* (*init_cond_v1_t) + (PSI_cond_key key, const void *identity); + +/** + Cond instrumentation destruction API. + @param cond the rcond to destroy +*/ +typedef void (*destroy_cond_v1_t)(struct PSI_cond *cond); + +/** + Acquire a table info by name. + @param schema_name name of the table schema + @param schema_name_length length of schema_name + @param table_name name of the table + @param table_name_length length of table_name + @param identity table identity pointer, typically the table share + @return a table info, or NULL if the table is not instrumented +*/ +typedef struct PSI_table_share* (*get_table_share_v1_t) + (const char *schema_name, int schema_name_length, const char *table_name, + int table_name_length, const void *identity); + +/** + Release a table share. + @param info the table share to release +*/ +typedef void (*release_table_share_v1_t)(struct PSI_table_share *share); + +/** + Open an instrumentation table handle. + @param share the table to open + @param identity table handle identity + @return a table handle, or NULL +*/ +typedef struct PSI_table* (*open_table_v1_t) + (struct PSI_table_share *share, const void *identity); + +/** + Close an instrumentation table handle. + Note that the table handle is invalid after this call. + @param table the table handle to close +*/ +typedef void (*close_table_v1_t)(struct PSI_table *table); + +/** + Create a file instrumentation for a created file. + This method does not create the file itself, but is used to notify the + instrumentation interface that a file was just created. + @param key the file instrumentation key for this file + @param name the file name + @param file the file handle +*/ +typedef void (*create_file_v1_t)(PSI_file_key key, const char *name, + File file); + +/** + Spawn a thread. + This method creates a new thread, with instrumentation. + @param key the instrumentation key for this thread + @param thread the resulting thread + @param attr the thread attributes + @param start_routine the thread start routine + @param arg the thread start routine argument +*/ +typedef int (*spawn_thread_v1_t)(PSI_thread_key key, + pthread_t *thread, + const pthread_attr_t *attr, + void *(*start_routine)(void*), void *arg); + +/** + Create instrumentation for a thread. + @param key the registered key + @param identity an address typical of the thread + @return an instrumented thread +*/ +typedef struct PSI_thread* (*new_thread_v1_t) + (PSI_thread_key key, const void *identity, ulong thread_id); + +/** + Assign an id to an instrumented thread. + @param thread the instrumented thread + @param id the id to assign +*/ +typedef void (*set_thread_id_v1_t)(struct PSI_thread *thread, + unsigned long id); + +/** + Get the instrumentation for the running thread. + For this function to return a result, + the thread instrumentation must have been attached to the + running thread using @c set_thread() + @return the instrumentation for the running thread +*/ +typedef struct PSI_thread* (*get_thread_v1_t)(void); + +/** + Attach a thread instrumentation to the running thread. + In case of thread pools, this method should be called when + a worker thread picks a work item and runs it. + Also, this method should be called if the instrumented code does not + keep the pointer returned by @c new_thread() and relies on @c get_thread() + instead. + @param thread the thread instrumentation +*/ +typedef void (*set_thread_v1_t)(struct PSI_thread *thread); + +/** Delete the current thread instrumentation. */ +typedef void (*delete_current_thread_v1_t)(void); + +/** Delete a thread instrumentation. */ +typedef void (*delete_thread_v1_t)(struct PSI_thread *thread); + +/** + Get a mutex instrumentation locker. + @param state data storage for the locker + @param mutex the instrumented mutex to lock + @return a mutex locker, or NULL +*/ +typedef struct PSI_mutex_locker* (*get_thread_mutex_locker_v1_t) + (struct PSI_mutex_locker_state_v1 *state, + struct PSI_mutex *mutex, + enum PSI_mutex_operation op); + +/** + Get a rwlock instrumentation locker. + @param state data storage for the locker + @param rwlock the instrumented rwlock to lock + @return a rwlock locker, or NULL +*/ +typedef struct PSI_rwlock_locker* (*get_thread_rwlock_locker_v1_t) + (struct PSI_rwlock_locker_state_v1 *state, + struct PSI_rwlock *rwlock, + enum PSI_rwlock_operation op); + +/** + Get a cond instrumentation locker. + @param state data storage for the locker + @param cond the instrumented condition to wait on + @param mutex the instrumented mutex associated with the condition + @return a condition locker, or NULL +*/ +typedef struct PSI_cond_locker* (*get_thread_cond_locker_v1_t) + (struct PSI_cond_locker_state_v1 *state, + struct PSI_cond *cond, struct PSI_mutex *mutex, + enum PSI_cond_operation op); + +/** + Get a table instrumentation locker. + @param state data storage for the locker + @param table the instrumented table to lock + @return a table locker, or NULL +*/ +typedef struct PSI_table_locker* (*get_thread_table_locker_v1_t) + (struct PSI_table_locker_state_v1 *state, + struct PSI_table *table); + +/** + Get a file instrumentation locker, for opening or creating a file. + @param state data storage for the locker + @param key the file instrumentation key + @param op the operation to perform + @param name the file name + @param identity a pointer representative of this file. + @return a file locker, or NULL +*/ +typedef struct PSI_file_locker* (*get_thread_file_name_locker_v1_t) + (struct PSI_file_locker_state_v1 *state, + PSI_file_key key, enum PSI_file_operation op, const char *name, + const void *identity); + +/** + Get a file stream instrumentation locker. + @param state data storage for the locker + @param file the file stream to access + @param op the operation to perform + @return a file locker, or NULL +*/ +typedef struct PSI_file_locker* (*get_thread_file_stream_locker_v1_t) + (struct PSI_file_locker_state_v1 *state, + struct PSI_file *file, enum PSI_file_operation op); + +/** + Get a file instrumentation locker. + @param state data storage for the locker + @param file the file descriptor to access + @param op the operation to perform + @return a file locker, or NULL +*/ +typedef struct PSI_file_locker* (*get_thread_file_descriptor_locker_v1_t) + (struct PSI_file_locker_state_v1 *state, + File file, enum PSI_file_operation op); + +/** + Record a mutex instrumentation unlock event. + @param mutex the mutex instrumentation +*/ +typedef void (*unlock_mutex_v1_t) + (struct PSI_mutex *mutex); + +/** + Record a rwlock instrumentation unlock event. + @param rwlock the rwlock instrumentation +*/ +typedef void (*unlock_rwlock_v1_t) + (struct PSI_rwlock *rwlock); + +/** + Record a condition instrumentation signal event. + @param cond the cond instrumentation +*/ +typedef void (*signal_cond_v1_t) + (struct PSI_cond *cond); + +/** + Record a condition instrumentation broadcast event. + @param cond the cond instrumentation +*/ +typedef void (*broadcast_cond_v1_t) + (struct PSI_cond *cond); + +/** + Record a mutex instrumentation wait start event. + @param locker a thread locker for the running thread +*/ +typedef void (*start_mutex_wait_v1_t) + (struct PSI_mutex_locker *locker, const char *src_file, uint src_line); + +/** + Record a mutex instrumentation wait end event. + @param locker a thread locker for the running thread + @param rc the wait operation return code +*/ +typedef void (*end_mutex_wait_v1_t) + (struct PSI_mutex_locker *locker, int rc); + +/** + Record a rwlock instrumentation read wait start event. + @param locker a thread locker for the running thread + @param must must block: 1 for lock, 0 for trylock +*/ +typedef void (*start_rwlock_rdwait_v1_t) + (struct PSI_rwlock_locker *locker, const char *src_file, uint src_line); + +/** + Record a rwlock instrumentation read wait end event. + @param locker a thread locker for the running thread + @param rc the wait operation return code +*/ +typedef void (*end_rwlock_rdwait_v1_t) + (struct PSI_rwlock_locker *locker, int rc); + +/** + Record a rwlock instrumentation write wait start event. + @param locker a thread locker for the running thread + @param must must block: 1 for lock, 0 for trylock +*/ +typedef void (*start_rwlock_wrwait_v1_t) + (struct PSI_rwlock_locker *locker, const char *src_file, uint src_line); + +/** + Record a rwlock instrumentation write wait end event. + @param locker a thread locker for the running thread + @param rc the wait operation return code +*/ +typedef void (*end_rwlock_wrwait_v1_t) + (struct PSI_rwlock_locker *locker, int rc); + +/** + Record a condition instrumentation wait start event. + @param locker a thread locker for the running thread + @param must must block: 1 for wait, 0 for timedwait +*/ +typedef void (*start_cond_wait_v1_t) + (struct PSI_cond_locker *locker, const char *src_file, uint src_line); + +/** + Record a condition instrumentation wait end event. + @param locker a thread locker for the running thread + @param rc the wait operation return code +*/ +typedef void (*end_cond_wait_v1_t) + (struct PSI_cond_locker *locker, int rc); + +/** + Record a table instrumentation wait start event. + @param locker a table locker for the running thread + @param file the source file name + @param line the source line number +*/ +typedef void (*start_table_wait_v1_t) + (struct PSI_table_locker *locker, const char *src_file, uint src_line); + +/** + Record a table instrumentation wait end event. + @param locker a table locker for the running thread +*/ +typedef void (*end_table_wait_v1_t)(struct PSI_table_locker *locker); + +/** + Start a file instrumentation open operation. + @param locker the file locker + @param op the operation to perform + @param src_file the source file name + @param src_line the source line number + @return an instrumented file handle +*/ +typedef struct PSI_file* (*start_file_open_wait_v1_t) + (struct PSI_file_locker *locker, const char *src_file, uint src_line); + +/** + End a file instrumentation open operation, for file streams. + @param locker the file locker. +*/ +typedef void (*end_file_open_wait_v1_t)(struct PSI_file_locker *locker); + +/** + End a file instrumentation open operation, for non stream files. + @param locker the file locker. + @param file the file number assigned by open() or create() for this file. +*/ +typedef void (*end_file_open_wait_and_bind_to_descriptor_v1_t) + (struct PSI_file_locker *locker, File file); + +/** + Record a file instrumentation start event. + @param locker a file locker for the running thread + @param op file operation to be performed + @param count the number of bytes requested, or 0 if not applicable + @param src_file the source file name + @param src_line the source line number +*/ +typedef void (*start_file_wait_v1_t) + (struct PSI_file_locker *locker, size_t count, + const char *src_file, uint src_line); + +/** + Record a file instrumentation end event. + Note that for file close operations, the instrumented file handle + associated with the file (which was provided to obtain a locker) + is invalid after this call. + @param locker a file locker for the running thread + @param count the number of bytes actually used in the operation, + or 0 if not applicable, or -1 if the operation failed + @sa get_thread_file_name_locker + @sa get_thread_file_stream_locker + @sa get_thread_file_descriptor_locker +*/ +typedef void (*end_file_wait_v1_t) + (struct PSI_file_locker *locker, size_t count); + +/** + Performance Schema Interface, version 1. + @since PSI_VERSION_1 +*/ +struct PSI_v1 +{ + /** @sa register_mutex_v1_t. */ + register_mutex_v1_t register_mutex; + /** @sa register_rwlock_v1_t. */ + register_rwlock_v1_t register_rwlock; + /** @sa register_cond_v1_t. */ + register_cond_v1_t register_cond; + /** @sa register_thread_v1_t. */ + register_thread_v1_t register_thread; + /** @sa register_file_v1_t. */ + register_file_v1_t register_file; + /** @sa init_mutex_v1_t. */ + init_mutex_v1_t init_mutex; + /** @sa destroy_mutex_v1_t. */ + destroy_mutex_v1_t destroy_mutex; + /** @sa init_rwlock_v1_t. */ + init_rwlock_v1_t init_rwlock; + /** @sa destroy_rwlock_v1_t. */ + destroy_rwlock_v1_t destroy_rwlock; + /** @sa init_cond_v1_t. */ + init_cond_v1_t init_cond; + /** @sa destroy_cond_v1_t. */ + destroy_cond_v1_t destroy_cond; + /** @sa get_table_share_v1_t. */ + get_table_share_v1_t get_table_share; + /** @sa release_table_share_v1_t. */ + release_table_share_v1_t release_table_share; + /** @sa open_table_v1_t. */ + open_table_v1_t open_table; + /** @sa close_table_v1_t. */ + close_table_v1_t close_table; + /** @sa create_file_v1_t. */ + create_file_v1_t create_file; + /** @sa spawn_thread_v1_t. */ + spawn_thread_v1_t spawn_thread; + /** @sa new_thread_v1_t. */ + new_thread_v1_t new_thread; + /** @sa set_thread_id_v1_t. */ + set_thread_id_v1_t set_thread_id; + /** @sa get_thread_v1_t. */ + get_thread_v1_t get_thread; + /** @sa set_thread_v1_t. */ + set_thread_v1_t set_thread; + /** @sa delete_current_thread_v1_t. */ + delete_current_thread_v1_t delete_current_thread; + /** @sa delete_thread_v1_t. */ + delete_thread_v1_t delete_thread; + /** @sa get_thread_mutex_locker_v1_t. */ + get_thread_mutex_locker_v1_t get_thread_mutex_locker; + /** @sa get_thread_rwlock_locker_v1_t. */ + get_thread_rwlock_locker_v1_t get_thread_rwlock_locker; + /** @sa get_thread_cond_locker_v1_t. */ + get_thread_cond_locker_v1_t get_thread_cond_locker; + /** @sa get_thread_table_locker_v1_t. */ + get_thread_table_locker_v1_t get_thread_table_locker; + /** @sa get_thread_file_name_locker_v1_t. */ + get_thread_file_name_locker_v1_t get_thread_file_name_locker; + /** @sa get_thread_file_stream_locker_v1_t. */ + get_thread_file_stream_locker_v1_t get_thread_file_stream_locker; + /** @sa get_thread_file_descriptor_locker_v1_t. */ + get_thread_file_descriptor_locker_v1_t get_thread_file_descriptor_locker; + /** @sa unlock_mutex_v1_t. */ + unlock_mutex_v1_t unlock_mutex; + /** @sa unlock_rwlock_v1_t. */ + unlock_rwlock_v1_t unlock_rwlock; + /** @sa signal_cond_v1_t. */ + signal_cond_v1_t signal_cond; + /** @sa broadcast_cond_v1_t. */ + broadcast_cond_v1_t broadcast_cond; + /** @sa start_mutex_wait_v1_t. */ + start_mutex_wait_v1_t start_mutex_wait; + /** @sa end_mutex_wait_v1_t. */ + end_mutex_wait_v1_t end_mutex_wait; + /** @sa start_rwlock_rdwait_v1_t. */ + start_rwlock_rdwait_v1_t start_rwlock_rdwait; + /** @sa end_rwlock_rdwait_v1_t. */ + end_rwlock_rdwait_v1_t end_rwlock_rdwait; + /** @sa start_rwlock_wrwait_v1_t. */ + start_rwlock_wrwait_v1_t start_rwlock_wrwait; + /** @sa end_rwlock_wrwait_v1_t. */ + end_rwlock_wrwait_v1_t end_rwlock_wrwait; + /** @sa start_cond_wait_v1_t. */ + start_cond_wait_v1_t start_cond_wait; + /** @sa end_cond_wait_v1_t. */ + end_cond_wait_v1_t end_cond_wait; + /** @sa start_table_wait_v1_t. */ + start_table_wait_v1_t start_table_wait; + /** @sa end_table_wait_v1_t. */ + end_table_wait_v1_t end_table_wait; + /** @sa start_file_open_wait_v1_t. */ + start_file_open_wait_v1_t start_file_open_wait; + /** @sa end_file_open_wait_v1_t. */ + end_file_open_wait_v1_t end_file_open_wait; + /** @sa end_file_open_wait_and_bind_to_descriptor_v1_t. */ + end_file_open_wait_and_bind_to_descriptor_v1_t + end_file_open_wait_and_bind_to_descriptor; + /** @sa start_file_wait_v1_t. */ + start_file_wait_v1_t start_file_wait; + /** @sa end_file_wait_v1_t. */ + end_file_wait_v1_t end_file_wait; +}; + +/** @} (end of group Group_PSI_v1) */ + +#endif /* HAVE_PSI_1 */ + +#ifdef USE_PSI_2 +#define HAVE_PSI_2 +#endif + +#ifdef HAVE_PSI_2 + +/** + @defgroup Group_PSI_v2 Application Binary Interface, version 2 + @ingroup Instrumentation_interface + @{ +*/ + +/** + Performance Schema Interface, version 2. + This is a placeholder, this interface is not defined yet. + @since PSI_VERSION_2 +*/ +struct PSI_v2 +{ + /** Placeholder */ + int placeholder; + /* ... extended interface ... */ +}; + +/** Placeholder */ +struct PSI_mutex_info_v2 +{ + /** Placeholder */ + int placeholder; +}; + +/** Placeholder */ +struct PSI_rwlock_info_v2 +{ + /** Placeholder */ + int placeholder; +}; + +/** Placeholder */ +struct PSI_cond_info_v2 +{ + /** Placeholder */ + int placeholder; +}; + +/** Placeholder */ +struct PSI_thread_info_v2 +{ + /** Placeholder */ + int placeholder; +}; + +/** Placeholder */ +struct PSI_file_info_v2 +{ + /** Placeholder */ + int placeholder; +}; + +struct PSI_mutex_locker_state_v2 +{ + /** Placeholder */ + int placeholder; +}; + +struct PSI_rwlock_locker_state_v2 +{ + /** Placeholder */ + int placeholder; +}; + +struct PSI_cond_locker_state_v2 +{ + /** Placeholder */ + int placeholder; +}; + +struct PSI_file_locker_state_v2 +{ + /** Placeholder */ + int placeholder; +}; + +struct PSI_table_locker_state_v2 +{ + /** Placeholder */ + int placeholder; +}; + +/** @} (end of group Group_PSI_v2) */ + +#endif /* HAVE_PSI_2 */ + +/** + @typedef PSI + The instrumentation interface for the current version. + @sa PSI_CURRENT_VERSION +*/ + +/** + @typedef PSI_mutex_info + The mutex information structure for the current version. +*/ + +/** + @typedef PSI_rwlock_info + The rwlock information structure for the current version. +*/ + +/** + @typedef PSI_cond_info + The cond information structure for the current version. +*/ + +/** + @typedef PSI_thread_info + The thread information structure for the current version. +*/ + +/** + @typedef PSI_file_info + The file information structure for the current version. +*/ + +/* Export the required version */ +#ifdef USE_PSI_1 +typedef struct PSI_v1 PSI; +typedef struct PSI_mutex_info_v1 PSI_mutex_info; +typedef struct PSI_rwlock_info_v1 PSI_rwlock_info; +typedef struct PSI_cond_info_v1 PSI_cond_info; +typedef struct PSI_thread_info_v1 PSI_thread_info; +typedef struct PSI_file_info_v1 PSI_file_info; +typedef struct PSI_mutex_locker_state_v1 PSI_mutex_locker_state; +typedef struct PSI_rwlock_locker_state_v1 PSI_rwlock_locker_state; +typedef struct PSI_cond_locker_state_v1 PSI_cond_locker_state; +typedef struct PSI_file_locker_state_v1 PSI_file_locker_state; +typedef struct PSI_table_locker_state_v1 PSI_table_locker_state; +#endif + +#ifdef USE_PSI_2 +typedef struct PSI_v2 PSI; +typedef struct PSI_mutex_info_v2 PSI_mutex_info; +typedef struct PSI_rwlock_info_v2 PSI_rwlock_info; +typedef struct PSI_cond_info_v2 PSI_cond_info; +typedef struct PSI_thread_info_v2 PSI_thread_info; +typedef struct PSI_file_info_v2 PSI_file_info; +typedef struct PSI_mutex_locker_state_v2 PSI_mutex_locker_state; +typedef struct PSI_rwlock_locker_state_v2 PSI_rwlock_locker_state; +typedef struct PSI_cond_locker_state_v2 PSI_cond_locker_state; +typedef struct PSI_file_locker_state_v2 PSI_file_locker_state; +typedef struct PSI_table_locker_state_v2 PSI_table_locker_state; +#endif + +#else /* HAVE_PSI_INTERFACE */ + +/** + Dummy structure, used to declare PSI_server when no instrumentation + is available. + The content does not matter, since PSI_server will be NULL. +*/ +struct PSI_none +{ + int opaque; +}; +typedef struct PSI_none PSI; + +#endif /* HAVE_PSI_INTERFACE */ + +extern MYSQL_PLUGIN_IMPORT PSI *PSI_server; + +/** @} */ + +C_MODE_END +#endif /* MYSQL_PERFORMANCE_SCHEMA_INTERFACE_H */ + diff --git a/dep/mysqllite/include/mysql/psi/psi_abi_v1.h b/dep/mysqllite/include/mysql/psi/psi_abi_v1.h new file mode 100644 index 0000000000000..0f62291696ffb --- /dev/null +++ b/dep/mysqllite/include/mysql/psi/psi_abi_v1.h @@ -0,0 +1,26 @@ +/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */ + +/** + @file mysql/psi/psi_abi_v1.h + ABI check for mysql/psi/psi.h, when using PSI_VERSION_1. + This file is only used to automate detection of changes between versions. + Do not include this file, include mysql/psi/psi.h instead. +*/ +#define USE_PSI_1 +#define HAVE_PSI_INTERFACE +#define _global_h +#include "mysql/psi/psi.h" + diff --git a/dep/mysqllite/include/mysql/psi/psi_abi_v2.h b/dep/mysqllite/include/mysql/psi/psi_abi_v2.h new file mode 100644 index 0000000000000..08bca609b4197 --- /dev/null +++ b/dep/mysqllite/include/mysql/psi/psi_abi_v2.h @@ -0,0 +1,26 @@ +/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */ + +/** + @file mysql/psi/psi_abi_v1.h + ABI check for mysql/psi/psi.h, when using PSI_VERSION_2. + This file is only used to automate detection of changes between versions. + Do not include this file, include mysql/psi/psi.h instead. +*/ +#define USE_PSI_2 +#define HAVE_PSI_INTERFACE +#define _global_h +#include "mysql/psi/psi.h" + diff --git a/dep/mysqllite/include/mysql/service_my_snprintf.h b/dep/mysqllite/include/mysql/service_my_snprintf.h new file mode 100644 index 0000000000000..f6b4aa39dc533 --- /dev/null +++ b/dep/mysqllite/include/mysql/service_my_snprintf.h @@ -0,0 +1,101 @@ +#ifndef MYSQL_SERVICE_MY_SNPRINTF_INCLUDED +/* 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 */ + +/** + @file + my_snprintf service + + Portable and limited vsnprintf() implementation. + + This is a portable, limited vsnprintf() implementation, with some + extra features. "Portable" means that it'll produce identical result + on all platforms (for example, on Windows and Linux system printf %e + formats the exponent differently, on different systems %p either + prints leading 0x or not, %s may accept null pointer or crash on + it). "Limited" means that it does not support all the C89 features. + But it supports few extensions, not in any standard. + + my_vsnprintf(to, n, fmt, ap) + + @param[out] to A buffer to store the result in + @param[in] n Store up to n-1 characters, followed by an end 0 + @param[in] fmt printf-like format string + @param[in] ap Arguments + + @return a number of bytes written to a buffer *excluding* terminating '\0' + + @post + The syntax of a format string is generally the same: + % + where everithing but the format is optional. + + Three one-character flags are recognized: + '0' has the standard zero-padding semantics; + '-' is parsed, but silently ignored; + '`' (backtick) is only supported for strings (%s) and means that the + string will be quoted according to MySQL identifier quoting rules. + + Both and can be specified as numbers or '*'. + + can be 'l', 'll', or 'z'. + + Supported formats are 's' (null pointer is accepted, printed as + "(null)"), 'b' (extension, see below), 'c', 'd', 'i', 'u', 'x', 'o', + 'X', 'p' (works as 0x%x). + + Standard syntax for positional arguments $n is supported. + + Extensions: + + Flag '`' (backtick): see above. + + Format 'b': binary buffer, prints exactly bytes from the + argument, without stopping at '\0'. +*/ + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef MYSQL_ABI_CHECK +#include +#include +#endif + +extern struct my_snprintf_service_st { + size_t (*my_snprintf_type)(char*, size_t, const char*, ...); + size_t (*my_vsnprintf_type)(char *, size_t, const char*, va_list); +} *my_snprintf_service; + +#ifdef MYSQL_DYNAMIC_PLUGIN + +#define my_vsnprintf my_snprintf_service->my_vsnprintf_type +#define my_snprintf my_snprintf_service->my_snprintf_type + +#else + +size_t my_snprintf(char* to, size_t n, const char* fmt, ...); +size_t my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap); + +#endif + +#ifdef __cplusplus +} +#endif + +#define MYSQL_SERVICE_MY_SNPRINTF_INCLUDED +#endif + diff --git a/dep/mysqllite/include/mysql/service_thd_alloc.h b/dep/mysqllite/include/mysql/service_thd_alloc.h new file mode 100644 index 0000000000000..7061c2bd4d5d3 --- /dev/null +++ b/dep/mysqllite/include/mysql/service_thd_alloc.h @@ -0,0 +1,130 @@ +#ifndef MYSQL_SERVICE_THD_ALLOC_INCLUDED +/* 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 */ + +/** + @file + This service provdes functions to allocate memory in a connection local + memory pool. The memory allocated there will be automatically freed at the + end of the statement, don't use it for allocations that should live longer + than that. For short living allocations this is more efficient than + using my_malloc and friends, and automatic "garbage collection" allows not + to think about memory leaks. + + The pool is best for small to medium objects, don't use it for large + allocations - they are better served with my_malloc. +*/ + +#ifndef MYSQL_ABI_CHECK +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +struct st_mysql_lex_string +{ + char *str; + size_t length; +}; +typedef struct st_mysql_lex_string MYSQL_LEX_STRING; + +extern struct thd_alloc_service_st { + void *(*thd_alloc_func)(MYSQL_THD, unsigned int); + void *(*thd_calloc_func)(MYSQL_THD, unsigned int); + char *(*thd_strdup_func)(MYSQL_THD, const char *); + char *(*thd_strmake_func)(MYSQL_THD, const char *, unsigned int); + void *(*thd_memdup_func)(MYSQL_THD, const void*, unsigned int); + MYSQL_LEX_STRING *(*thd_make_lex_string_func)(MYSQL_THD, MYSQL_LEX_STRING *, + const char *, unsigned int, int); +} *thd_alloc_service; + +#ifdef MYSQL_DYNAMIC_PLUGIN + +#define thd_alloc(thd,size) (thd_alloc_service->thd_alloc_func((thd), (size))) + +#define thd_calloc(thd,size) (thd_alloc_service->thd_calloc_func((thd), (size))) + +#define thd_strdup(thd,str) (thd_alloc_service->thd_strdup_func((thd), (str))) + +#define thd_strmake(thd,str,size) \ + (thd_alloc_service->thd_strmake_func((thd), (str), (size))) + +#define thd_memdup(thd,str,size) \ + (thd_alloc_service->thd_memdup_func((thd), (str), (size))) + +#define thd_make_lex_string(thd, lex_str, str, size, allocate_lex_string) \ + (thd_alloc_service->thd_make_lex_string_func((thd), (lex_str), (str), \ + (size), (allocate_lex_string))) + +#else + +/** + Allocate memory in the connection's local memory pool + + @details + When properly used in place of @c my_malloc(), this can significantly + improve concurrency. Don't use this or related functions to allocate + large chunks of memory. Use for temporary storage only. The memory + will be freed automatically at the end of the statement; no explicit + code is required to prevent memory leaks. + + @see alloc_root() +*/ +void *thd_alloc(MYSQL_THD thd, unsigned int size); +/** + @see thd_alloc() +*/ +void *thd_calloc(MYSQL_THD thd, unsigned int size); +/** + @see thd_alloc() +*/ +char *thd_strdup(MYSQL_THD thd, const char *str); +/** + @see thd_alloc() +*/ +char *thd_strmake(MYSQL_THD thd, const char *str, unsigned int size); +/** + @see thd_alloc() +*/ +void *thd_memdup(MYSQL_THD thd, const void* str, unsigned int size); + +/** + Create a LEX_STRING in this connection's local memory pool + + @param thd user thread connection handle + @param lex_str pointer to LEX_STRING object to be initialized + @param str initializer to be copied into lex_str + @param size length of str, in bytes + @param allocate_lex_string flag: if TRUE, allocate new LEX_STRING object, + instead of using lex_str value + @return NULL on failure, or pointer to the LEX_STRING object + + @see thd_alloc() +*/ +MYSQL_LEX_STRING *thd_make_lex_string(MYSQL_THD thd, MYSQL_LEX_STRING *lex_str, + const char *str, unsigned int size, + int allocate_lex_string); + +#endif + +#ifdef __cplusplus +} +#endif + +#define MYSQL_SERVICE_THD_ALLOC_INCLUDED +#endif + diff --git a/dep/mysqllite/include/mysql/service_thd_wait.h b/dep/mysqllite/include/mysql/service_thd_wait.h new file mode 100644 index 0000000000000..2a8f5e610a33e --- /dev/null +++ b/dep/mysqllite/include/mysql/service_thd_wait.h @@ -0,0 +1,83 @@ +/* Copyright (C) 2010, Oracle and/or its affiliates. All rights reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public 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 MYSQL_SERVICE_THD_WAIT_INCLUDED +#define MYSQL_SERVICE_THD_WAIT_INCLUDED + +/** + @file include/mysql/service_thd_wait.h + This service provides functions for plugins and storage engines to report + when they are going to sleep/stall. + + SYNOPSIS + thd_wait_begin() - call just before a wait begins + thd Thread object + Use NULL if the thd is NOT known. + wait_type Type of wait + 1 -- short wait (e.g. for mutex) + 2 -- medium wait (e.g. for disk io) + 3 -- large wait (e.g. for locked row/table) + NOTES + This is used by the threadpool to have better knowledge of which + threads that currently are actively running on CPUs. When a thread + reports that it's going to sleep/stall, the threadpool scheduler is + free to start another thread in the pool most likely. The expected wait + time is simply an indication of how long the wait is expected to + become, the real wait time could be very different. + + thd_wait_end() called immediately after the wait is complete + + thd_wait_end() MUST be called if thd_wait_begin() was called. + + Using thd_wait_...() service is optional but recommended. Using it will + improve performance as the thread pool will be more active at managing the + thread workload. +*/ + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum _thd_wait_type_e { + THD_WAIT_MUTEX= 1, + THD_WAIT_DISKIO= 2, + THD_WAIT_ROW_TABLE_LOCK= 3, + THD_WAIT_GLOBAL_LOCK= 4 +} thd_wait_type; + +extern struct thd_wait_service_st { + void (*thd_wait_begin_func)(MYSQL_THD, thd_wait_type); + void (*thd_wait_end_func)(MYSQL_THD); +} *thd_wait_service; + +#ifdef MYSQL_DYNAMIC_PLUGIN + +#define thd_wait_begin(_THD, _WAIT_TYPE) \ + thd_wait_service->thd_wait_begin_func(_THD, _WAIT_TYPE) +#define thd_wait_end(_THD) thd_wait_service->thd_wait_end_func(_THD) + +#else + +void thd_wait_begin(MYSQL_THD thd, thd_wait_type wait_type); +void thd_wait_end(MYSQL_THD thd); + +#endif + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/dep/mysqllite/include/mysql/service_thread_scheduler.h b/dep/mysqllite/include/mysql/service_thread_scheduler.h new file mode 100644 index 0000000000000..a4396b721bdc3 --- /dev/null +++ b/dep/mysqllite/include/mysql/service_thread_scheduler.h @@ -0,0 +1,65 @@ +/* + Copyright (C) 2010, Oracle and/or its affiliates. All rights reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public 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 SERVICE_THREAD_SCHEDULER_INCLUDED +#define SERVICE_THREAD_SCHEDULER_INCLUDED + +#ifdef __cplusplus +extern "C" { +#endif + +struct scheduler_functions; + +extern struct my_thread_scheduler_service { + int (*set)(struct scheduler_functions *scheduler); + int (*reset)(); +} *my_thread_scheduler_service; + +#ifdef MYSQL_DYNAMIC_PLUGIN + +#define my_thread_scheduler_set(F) my_thread_scheduler_service->set((F)) +#define my_thread_scheduler_reset() my_thread_scheduler_service->reset() + +#else + +/** + Set the thread scheduler to use for the server. + + @param scheduler Pointer to scheduler callbacks to use. + @retval 0 Scheduler installed correctly. + @retval 1 Invalid value (NULL) used for scheduler. +*/ +int my_thread_scheduler_set(struct scheduler_functions *scheduler); + +/** + Restore the previous thread scheduler. + + @note If no thread scheduler was installed previously with + thd_set_thread_scheduler, this function will report an error. + + @retval 0 Scheduler installed correctly. + @retval 1 No scheduler installed. +*/ +int my_thread_scheduler_reset(); + +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* SERVICE_THREAD_SCHEDULER_INCLUDED */ diff --git a/dep/mysqllite/include/mysql/services.h b/dep/mysqllite/include/mysql/services.h new file mode 100644 index 0000000000000..6c67a582fb8d9 --- /dev/null +++ b/dep/mysqllite/include/mysql/services.h @@ -0,0 +1,32 @@ +#ifndef MYSQL_SERVICES_INCLUDED +/* 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 __cplusplus +extern "C" { +#endif + +#include +#include +#include +#include + +#ifdef __cplusplus +} +#endif + +#define MYSQL_SERVICES_INCLUDED +#endif + diff --git a/dep/mysqllite/include/mysql_com.h b/dep/mysqllite/include/mysql_com.h index 7d3dd3d4f34b2..f4c023721deca 100644 --- a/dep/mysqllite/include/mysql_com.h +++ b/dep/mysqllite/include/mysql_com.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -27,9 +27,19 @@ #define NAME_LEN (NAME_CHAR_LEN*SYSTEM_CHARSET_MBMAXLEN) #define USERNAME_LENGTH (USERNAME_CHAR_LENGTH*SYSTEM_CHARSET_MBMAXLEN) +#define MYSQL_AUTODETECT_CHARSET_NAME "auto" + #define SERVER_VERSION_LENGTH 60 #define SQLSTATE_LENGTH 5 +/* + Maximum length of comments +*/ +#define TABLE_COMMENT_INLINE_MAXLEN 180 /* pre 6.0: 60 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 @@ -115,6 +125,12 @@ enum enum_server_command thread */ #define REFRESH_MASTER 128 /* Remove all bin logs in the index and truncate the index */ +#define REFRESH_ERROR_LOG 256 /* Rotate only the erorr log */ +#define REFRESH_ENGINE_LOG 512 /* Flush all storage engine logs */ +#define REFRESH_BINARY_LOG 1024 /* Flush the binary log */ +#define REFRESH_RELAY_LOG 2048 /* Flush the relay log */ +#define REFRESH_GENERAL_LOG 4096 /* Flush the general log */ +#define REFRESH_SLOW_LOG 8192 /* Flush the slow query log */ /* The following can't be set with mysql_refresh() */ #define REFRESH_READ_LOCK 16384 /* Lock tables for read */ @@ -144,10 +160,19 @@ 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_PLUGIN_AUTH (1UL << 19) /* Client supports plugin authentication */ #define CLIENT_SSL_VERIFY_SERVER_CERT (1UL << 30) #define CLIENT_REMEMBER_OPTIONS (1UL << 31) +#ifdef HAVE_COMPRESS +#define CAN_CLIENT_COMPRESS CLIENT_COMPRESS +#else +#define CAN_CLIENT_COMPRESS 0 +#endif + /* Gather all possible capabilites (flags) supported by the server */ #define CLIENT_ALL_FLAGS (CLIENT_LONG_PASSWORD | \ CLIENT_FOUND_ROWS | \ @@ -167,8 +192,10 @@ enum enum_server_command CLIENT_SECURE_CONNECTION | \ CLIENT_MULTI_STATEMENTS | \ CLIENT_MULTI_RESULTS | \ + CLIENT_PS_MULTI_RESULTS | \ CLIENT_SSL_VERIFY_SERVER_CERT | \ - CLIENT_REMEMBER_OPTIONS) + CLIENT_REMEMBER_OPTIONS | \ + CLIENT_PLUGIN_AUTH) /* Switch off the flags that are optional and depending on build flags @@ -179,7 +206,14 @@ enum enum_server_command & ~CLIENT_COMPRESS) \ & ~CLIENT_SSL_VERIFY_SERVER_CERT) -#define SERVER_STATUS_IN_TRANS 1 /* Transaction has started */ +/** + Is raised when a multi-statement transaction + has been started, either explicitly, by means + of BEGIN or COMMIT AND CHAIN, or + implicitly, by the first transactional + statement, when autocommit=off. +*/ +#define SERVER_STATUS_IN_TRANS 1 #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 @@ -203,6 +237,12 @@ enum enum_server_command number of result set columns. */ #define SERVER_STATUS_METADATA_CHANGED 1024 +#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 @@ -215,7 +255,11 @@ enum enum_server_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) + SERVER_STATUS_METADATA_CHANGED |\ + SERVER_QUERY_WAS_SLOW |\ + SERVER_STATUS_DB_DROPPED |\ + SERVER_STATUS_CURSOR_EXISTS|\ + SERVER_STATUS_LAST_ROW_SENT) #define MYSQL_ERRMSG_SIZE 512 #define NET_READ_TIMEOUT 30 /* Timeout on read */ @@ -254,24 +298,23 @@ typedef struct st_net { unsigned int *return_status; unsigned char reading_or_writing; char save_char; - my_bool unused0; /* Please remove with the next incompatible ABI change. */ - my_bool unused; /* Please remove with the next incompatible ABI change */ - my_bool compress; 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 /* - '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. */ - unsigned char *query_cache_query; + unsigned char *unused; unsigned int last_errno; unsigned char error; - my_bool unused2; /* Please remove with the next incompatible ABI change. */ - my_bool return_errno; + 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. */ @@ -419,10 +462,6 @@ 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); @@ -492,14 +531,14 @@ void create_random_string(char *to, unsigned int length, struct rand_struct *ran void hash_password(unsigned long *to, const char *password, unsigned int password_len); void make_scrambled_password_323(char *to, const char *password); void scramble_323(char *to, const char *message, const char *password); -my_bool check_scramble_323(const char *, const char *message, +my_bool check_scramble_323(const unsigned char *reply, const char *message, unsigned long *salt); void get_salt_from_password_323(unsigned long *res, const char *password); void make_password_from_salt_323(char *to, const unsigned long *salt); void make_scrambled_password(char *to, const char *password); void scramble(char *to, const char *message, const char *password); -my_bool check_scramble(const char *reply, const char *message, +my_bool check_scramble(const unsigned char *reply, const char *message, const unsigned char *hash_stage2); void get_salt_from_password(unsigned char *res, const char *password); void make_password_from_salt(char *to, const unsigned char *hash_stage2); @@ -529,4 +568,5 @@ uchar *net_store_length(uchar *pkg, ulonglong length); #define MYSQL_STMT_HEADER 4 #define MYSQL_LONG_DATA_HEADER 6 +#define NOT_FIXED_DEC 31 #endif diff --git a/dep/mysqllite/include/mysql_embed.h b/dep/mysqllite/include/mysql_embed.h index 4a7fd3ef63c21..e860a4486ebce 100644 --- a/dep/mysqllite/include/mysql_embed.h +++ b/dep/mysqllite/include/mysql_embed.h @@ -1,3 +1,6 @@ +#ifndef MYSQL_EMBED_INCLUDED +#define MYSQL_EMBED_INCLUDED + /* Copyright (C) 2000 MySQL AB This program is free software; you can redistribute it and/or modify @@ -20,11 +23,9 @@ /* 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 */ -#undef HAVE_PSTACK /* No stacktrace */ -#undef HAVE_OPENSSL +#undef HAVE_DLOPEN /* No udf functions */ #undef HAVE_SMEM /* No shared memory */ #undef HAVE_NDBCLUSTER_DB /* No NDB cluster */ -#define DONT_USE_RAID - #endif /* EMBEDDED_LIBRARY */ +#endif /* MYSQL_EMBED_INCLUDED */ diff --git a/dep/mysqllite/include/mysqld_ername.h b/dep/mysqllite/include/mysqld_ername.h index cc8b36ada493a..7697b59d1eb32 100644 --- a/dep/mysqllite/include/mysqld_ername.h +++ b/dep/mysqllite/include/mysqld_ername.h @@ -1,643 +1,708 @@ /* Autogenerated file, please don't edit */ -{ "ER_HASHCHK", 1000 }, -{ "ER_NISAMCHK", 1001 }, -{ "ER_NO", 1002 }, -{ "ER_YES", 1003 }, -{ "ER_CANT_CREATE_FILE", 1004 }, -{ "ER_CANT_CREATE_TABLE", 1005 }, -{ "ER_CANT_CREATE_DB", 1006 }, -{ "ER_DB_CREATE_EXISTS", 1007 }, -{ "ER_DB_DROP_EXISTS", 1008 }, -{ "ER_DB_DROP_DELETE", 1009 }, -{ "ER_DB_DROP_RMDIR", 1010 }, -{ "ER_CANT_DELETE_FILE", 1011 }, -{ "ER_CANT_FIND_SYSTEM_REC", 1012 }, -{ "ER_CANT_GET_STAT", 1013 }, -{ "ER_CANT_GET_WD", 1014 }, -{ "ER_CANT_LOCK", 1015 }, -{ "ER_CANT_OPEN_FILE", 1016 }, -{ "ER_FILE_NOT_FOUND", 1017 }, -{ "ER_CANT_READ_DIR", 1018 }, -{ "ER_CANT_SET_WD", 1019 }, -{ "ER_CHECKREAD", 1020 }, -{ "ER_DISK_FULL", 1021 }, -{ "ER_DUP_KEY", 1022 }, -{ "ER_ERROR_ON_CLOSE", 1023 }, -{ "ER_ERROR_ON_READ", 1024 }, -{ "ER_ERROR_ON_RENAME", 1025 }, -{ "ER_ERROR_ON_WRITE", 1026 }, -{ "ER_FILE_USED", 1027 }, -{ "ER_FILSORT_ABORT", 1028 }, -{ "ER_FORM_NOT_FOUND", 1029 }, -{ "ER_GET_ERRNO", 1030 }, -{ "ER_ILLEGAL_HA", 1031 }, -{ "ER_KEY_NOT_FOUND", 1032 }, -{ "ER_NOT_FORM_FILE", 1033 }, -{ "ER_NOT_KEYFILE", 1034 }, -{ "ER_OLD_KEYFILE", 1035 }, -{ "ER_OPEN_AS_READONLY", 1036 }, -{ "ER_OUTOFMEMORY", 1037 }, -{ "ER_OUT_OF_SORTMEMORY", 1038 }, -{ "ER_UNEXPECTED_EOF", 1039 }, -{ "ER_CON_COUNT_ERROR", 1040 }, -{ "ER_OUT_OF_RESOURCES", 1041 }, -{ "ER_BAD_HOST_ERROR", 1042 }, -{ "ER_HANDSHAKE_ERROR", 1043 }, -{ "ER_DBACCESS_DENIED_ERROR", 1044 }, -{ "ER_ACCESS_DENIED_ERROR", 1045 }, -{ "ER_NO_DB_ERROR", 1046 }, -{ "ER_UNKNOWN_COM_ERROR", 1047 }, -{ "ER_BAD_NULL_ERROR", 1048 }, -{ "ER_BAD_DB_ERROR", 1049 }, -{ "ER_TABLE_EXISTS_ERROR", 1050 }, -{ "ER_BAD_TABLE_ERROR", 1051 }, -{ "ER_NON_UNIQ_ERROR", 1052 }, -{ "ER_SERVER_SHUTDOWN", 1053 }, -{ "ER_BAD_FIELD_ERROR", 1054 }, -{ "ER_WRONG_FIELD_WITH_GROUP", 1055 }, -{ "ER_WRONG_GROUP_FIELD", 1056 }, -{ "ER_WRONG_SUM_SELECT", 1057 }, -{ "ER_WRONG_VALUE_COUNT", 1058 }, -{ "ER_TOO_LONG_IDENT", 1059 }, -{ "ER_DUP_FIELDNAME", 1060 }, -{ "ER_DUP_KEYNAME", 1061 }, -{ "ER_DUP_ENTRY", 1062 }, -{ "ER_WRONG_FIELD_SPEC", 1063 }, -{ "ER_PARSE_ERROR", 1064 }, -{ "ER_EMPTY_QUERY", 1065 }, -{ "ER_NONUNIQ_TABLE", 1066 }, -{ "ER_INVALID_DEFAULT", 1067 }, -{ "ER_MULTIPLE_PRI_KEY", 1068 }, -{ "ER_TOO_MANY_KEYS", 1069 }, -{ "ER_TOO_MANY_KEY_PARTS", 1070 }, -{ "ER_TOO_LONG_KEY", 1071 }, -{ "ER_KEY_COLUMN_DOES_NOT_EXITS", 1072 }, -{ "ER_BLOB_USED_AS_KEY", 1073 }, -{ "ER_TOO_BIG_FIELDLENGTH", 1074 }, -{ "ER_WRONG_AUTO_KEY", 1075 }, -{ "ER_READY", 1076 }, -{ "ER_NORMAL_SHUTDOWN", 1077 }, -{ "ER_GOT_SIGNAL", 1078 }, -{ "ER_SHUTDOWN_COMPLETE", 1079 }, -{ "ER_FORCING_CLOSE", 1080 }, -{ "ER_IPSOCK_ERROR", 1081 }, -{ "ER_NO_SUCH_INDEX", 1082 }, -{ "ER_WRONG_FIELD_TERMINATORS", 1083 }, -{ "ER_BLOBS_AND_NO_TERMINATED", 1084 }, -{ "ER_TEXTFILE_NOT_READABLE", 1085 }, -{ "ER_FILE_EXISTS_ERROR", 1086 }, -{ "ER_LOAD_INFO", 1087 }, -{ "ER_ALTER_INFO", 1088 }, -{ "ER_WRONG_SUB_KEY", 1089 }, -{ "ER_CANT_REMOVE_ALL_FIELDS", 1090 }, -{ "ER_CANT_DROP_FIELD_OR_KEY", 1091 }, -{ "ER_INSERT_INFO", 1092 }, -{ "ER_UPDATE_TABLE_USED", 1093 }, -{ "ER_NO_SUCH_THREAD", 1094 }, -{ "ER_KILL_DENIED_ERROR", 1095 }, -{ "ER_NO_TABLES_USED", 1096 }, -{ "ER_TOO_BIG_SET", 1097 }, -{ "ER_NO_UNIQUE_LOGFILE", 1098 }, -{ "ER_TABLE_NOT_LOCKED_FOR_WRITE", 1099 }, -{ "ER_TABLE_NOT_LOCKED", 1100 }, -{ "ER_BLOB_CANT_HAVE_DEFAULT", 1101 }, -{ "ER_WRONG_DB_NAME", 1102 }, -{ "ER_WRONG_TABLE_NAME", 1103 }, -{ "ER_TOO_BIG_SELECT", 1104 }, -{ "ER_UNKNOWN_ERROR", 1105 }, -{ "ER_UNKNOWN_PROCEDURE", 1106 }, -{ "ER_WRONG_PARAMCOUNT_TO_PROCEDURE", 1107 }, -{ "ER_WRONG_PARAMETERS_TO_PROCEDURE", 1108 }, -{ "ER_UNKNOWN_TABLE", 1109 }, -{ "ER_FIELD_SPECIFIED_TWICE", 1110 }, -{ "ER_INVALID_GROUP_FUNC_USE", 1111 }, -{ "ER_UNSUPPORTED_EXTENSION", 1112 }, -{ "ER_TABLE_MUST_HAVE_COLUMNS", 1113 }, -{ "ER_RECORD_FILE_FULL", 1114 }, -{ "ER_UNKNOWN_CHARACTER_SET", 1115 }, -{ "ER_TOO_MANY_TABLES", 1116 }, -{ "ER_TOO_MANY_FIELDS", 1117 }, -{ "ER_TOO_BIG_ROWSIZE", 1118 }, -{ "ER_STACK_OVERRUN", 1119 }, -{ "ER_WRONG_OUTER_JOIN", 1120 }, -{ "ER_NULL_COLUMN_IN_INDEX", 1121 }, -{ "ER_CANT_FIND_UDF", 1122 }, -{ "ER_CANT_INITIALIZE_UDF", 1123 }, -{ "ER_UDF_NO_PATHS", 1124 }, -{ "ER_UDF_EXISTS", 1125 }, -{ "ER_CANT_OPEN_LIBRARY", 1126 }, -{ "ER_CANT_FIND_DL_ENTRY", 1127 }, -{ "ER_FUNCTION_NOT_DEFINED", 1128 }, -{ "ER_HOST_IS_BLOCKED", 1129 }, -{ "ER_HOST_NOT_PRIVILEGED", 1130 }, -{ "ER_PASSWORD_ANONYMOUS_USER", 1131 }, -{ "ER_PASSWORD_NOT_ALLOWED", 1132 }, -{ "ER_PASSWORD_NO_MATCH", 1133 }, -{ "ER_UPDATE_INFO", 1134 }, -{ "ER_CANT_CREATE_THREAD", 1135 }, -{ "ER_WRONG_VALUE_COUNT_ON_ROW", 1136 }, -{ "ER_CANT_REOPEN_TABLE", 1137 }, -{ "ER_INVALID_USE_OF_NULL", 1138 }, -{ "ER_REGEXP_ERROR", 1139 }, -{ "ER_MIX_OF_GROUP_FUNC_AND_FIELDS", 1140 }, -{ "ER_NONEXISTING_GRANT", 1141 }, -{ "ER_TABLEACCESS_DENIED_ERROR", 1142 }, -{ "ER_COLUMNACCESS_DENIED_ERROR", 1143 }, -{ "ER_ILLEGAL_GRANT_FOR_TABLE", 1144 }, -{ "ER_GRANT_WRONG_HOST_OR_USER", 1145 }, -{ "ER_NO_SUCH_TABLE", 1146 }, -{ "ER_NONEXISTING_TABLE_GRANT", 1147 }, -{ "ER_NOT_ALLOWED_COMMAND", 1148 }, -{ "ER_SYNTAX_ERROR", 1149 }, -{ "ER_DELAYED_CANT_CHANGE_LOCK", 1150 }, -{ "ER_TOO_MANY_DELAYED_THREADS", 1151 }, -{ "ER_ABORTING_CONNECTION", 1152 }, -{ "ER_NET_PACKET_TOO_LARGE", 1153 }, -{ "ER_NET_READ_ERROR_FROM_PIPE", 1154 }, -{ "ER_NET_FCNTL_ERROR", 1155 }, -{ "ER_NET_PACKETS_OUT_OF_ORDER", 1156 }, -{ "ER_NET_UNCOMPRESS_ERROR", 1157 }, -{ "ER_NET_READ_ERROR", 1158 }, -{ "ER_NET_READ_INTERRUPTED", 1159 }, -{ "ER_NET_ERROR_ON_WRITE", 1160 }, -{ "ER_NET_WRITE_INTERRUPTED", 1161 }, -{ "ER_TOO_LONG_STRING", 1162 }, -{ "ER_TABLE_CANT_HANDLE_BLOB", 1163 }, -{ "ER_TABLE_CANT_HANDLE_AUTO_INCREMENT", 1164 }, -{ "ER_DELAYED_INSERT_TABLE_LOCKED", 1165 }, -{ "ER_WRONG_COLUMN_NAME", 1166 }, -{ "ER_WRONG_KEY_COLUMN", 1167 }, -{ "ER_WRONG_MRG_TABLE", 1168 }, -{ "ER_DUP_UNIQUE", 1169 }, -{ "ER_BLOB_KEY_WITHOUT_LENGTH", 1170 }, -{ "ER_PRIMARY_CANT_HAVE_NULL", 1171 }, -{ "ER_TOO_MANY_ROWS", 1172 }, -{ "ER_REQUIRES_PRIMARY_KEY", 1173 }, -{ "ER_NO_RAID_COMPILED", 1174 }, -{ "ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE", 1175 }, -{ "ER_KEY_DOES_NOT_EXITS", 1176 }, -{ "ER_CHECK_NO_SUCH_TABLE", 1177 }, -{ "ER_CHECK_NOT_IMPLEMENTED", 1178 }, -{ "ER_CANT_DO_THIS_DURING_AN_TRANSACTION", 1179 }, -{ "ER_ERROR_DURING_COMMIT", 1180 }, -{ "ER_ERROR_DURING_ROLLBACK", 1181 }, -{ "ER_ERROR_DURING_FLUSH_LOGS", 1182 }, -{ "ER_ERROR_DURING_CHECKPOINT", 1183 }, -{ "ER_NEW_ABORTING_CONNECTION", 1184 }, -{ "ER_DUMP_NOT_IMPLEMENTED", 1185 }, -{ "ER_FLUSH_MASTER_BINLOG_CLOSED", 1186 }, -{ "ER_INDEX_REBUILD", 1187 }, -{ "ER_MASTER", 1188 }, -{ "ER_MASTER_NET_READ", 1189 }, -{ "ER_MASTER_NET_WRITE", 1190 }, -{ "ER_FT_MATCHING_KEY_NOT_FOUND", 1191 }, -{ "ER_LOCK_OR_ACTIVE_TRANSACTION", 1192 }, -{ "ER_UNKNOWN_SYSTEM_VARIABLE", 1193 }, -{ "ER_CRASHED_ON_USAGE", 1194 }, -{ "ER_CRASHED_ON_REPAIR", 1195 }, -{ "ER_WARNING_NOT_COMPLETE_ROLLBACK", 1196 }, -{ "ER_TRANS_CACHE_FULL", 1197 }, -{ "ER_SLAVE_MUST_STOP", 1198 }, -{ "ER_SLAVE_NOT_RUNNING", 1199 }, -{ "ER_BAD_SLAVE", 1200 }, -{ "ER_MASTER_INFO", 1201 }, -{ "ER_SLAVE_THREAD", 1202 }, -{ "ER_TOO_MANY_USER_CONNECTIONS", 1203 }, -{ "ER_SET_CONSTANTS_ONLY", 1204 }, -{ "ER_LOCK_WAIT_TIMEOUT", 1205 }, -{ "ER_LOCK_TABLE_FULL", 1206 }, -{ "ER_READ_ONLY_TRANSACTION", 1207 }, -{ "ER_DROP_DB_WITH_READ_LOCK", 1208 }, -{ "ER_CREATE_DB_WITH_READ_LOCK", 1209 }, -{ "ER_WRONG_ARGUMENTS", 1210 }, -{ "ER_NO_PERMISSION_TO_CREATE_USER", 1211 }, -{ "ER_UNION_TABLES_IN_DIFFERENT_DIR", 1212 }, -{ "ER_LOCK_DEADLOCK", 1213 }, -{ "ER_TABLE_CANT_HANDLE_FT", 1214 }, -{ "ER_CANNOT_ADD_FOREIGN", 1215 }, -{ "ER_NO_REFERENCED_ROW", 1216 }, -{ "ER_ROW_IS_REFERENCED", 1217 }, -{ "ER_CONNECT_TO_MASTER", 1218 }, -{ "ER_QUERY_ON_MASTER", 1219 }, -{ "ER_ERROR_WHEN_EXECUTING_COMMAND", 1220 }, -{ "ER_WRONG_USAGE", 1221 }, -{ "ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT", 1222 }, -{ "ER_CANT_UPDATE_WITH_READLOCK", 1223 }, -{ "ER_MIXING_NOT_ALLOWED", 1224 }, -{ "ER_DUP_ARGUMENT", 1225 }, -{ "ER_USER_LIMIT_REACHED", 1226 }, -{ "ER_SPECIFIC_ACCESS_DENIED_ERROR", 1227 }, -{ "ER_LOCAL_VARIABLE", 1228 }, -{ "ER_GLOBAL_VARIABLE", 1229 }, -{ "ER_NO_DEFAULT", 1230 }, -{ "ER_WRONG_VALUE_FOR_VAR", 1231 }, -{ "ER_WRONG_TYPE_FOR_VAR", 1232 }, -{ "ER_VAR_CANT_BE_READ", 1233 }, -{ "ER_CANT_USE_OPTION_HERE", 1234 }, -{ "ER_NOT_SUPPORTED_YET", 1235 }, -{ "ER_MASTER_FATAL_ERROR_READING_BINLOG", 1236 }, -{ "ER_SLAVE_IGNORED_TABLE", 1237 }, -{ "ER_INCORRECT_GLOBAL_LOCAL_VAR", 1238 }, -{ "ER_WRONG_FK_DEF", 1239 }, -{ "ER_KEY_REF_DO_NOT_MATCH_TABLE_REF", 1240 }, -{ "ER_OPERAND_COLUMNS", 1241 }, -{ "ER_SUBQUERY_NO_1_ROW", 1242 }, -{ "ER_UNKNOWN_STMT_HANDLER", 1243 }, -{ "ER_CORRUPT_HELP_DB", 1244 }, -{ "ER_CYCLIC_REFERENCE", 1245 }, -{ "ER_AUTO_CONVERT", 1246 }, -{ "ER_ILLEGAL_REFERENCE", 1247 }, -{ "ER_DERIVED_MUST_HAVE_ALIAS", 1248 }, -{ "ER_SELECT_REDUCED", 1249 }, -{ "ER_TABLENAME_NOT_ALLOWED_HERE", 1250 }, -{ "ER_NOT_SUPPORTED_AUTH_MODE", 1251 }, -{ "ER_SPATIAL_CANT_HAVE_NULL", 1252 }, -{ "ER_COLLATION_CHARSET_MISMATCH", 1253 }, -{ "ER_SLAVE_WAS_RUNNING", 1254 }, -{ "ER_SLAVE_WAS_NOT_RUNNING", 1255 }, -{ "ER_TOO_BIG_FOR_UNCOMPRESS", 1256 }, -{ "ER_ZLIB_Z_MEM_ERROR", 1257 }, -{ "ER_ZLIB_Z_BUF_ERROR", 1258 }, -{ "ER_ZLIB_Z_DATA_ERROR", 1259 }, -{ "ER_CUT_VALUE_GROUP_CONCAT", 1260 }, -{ "ER_WARN_TOO_FEW_RECORDS", 1261 }, -{ "ER_WARN_TOO_MANY_RECORDS", 1262 }, -{ "ER_WARN_NULL_TO_NOTNULL", 1263 }, -{ "ER_WARN_DATA_OUT_OF_RANGE", 1264 }, -{ "WARN_DATA_TRUNCATED", 1265 }, -{ "ER_WARN_USING_OTHER_HANDLER", 1266 }, -{ "ER_CANT_AGGREGATE_2COLLATIONS", 1267 }, -{ "ER_DROP_USER", 1268 }, -{ "ER_REVOKE_GRANTS", 1269 }, -{ "ER_CANT_AGGREGATE_3COLLATIONS", 1270 }, -{ "ER_CANT_AGGREGATE_NCOLLATIONS", 1271 }, -{ "ER_VARIABLE_IS_NOT_STRUCT", 1272 }, -{ "ER_UNKNOWN_COLLATION", 1273 }, -{ "ER_SLAVE_IGNORED_SSL_PARAMS", 1274 }, -{ "ER_SERVER_IS_IN_SECURE_AUTH_MODE", 1275 }, -{ "ER_WARN_FIELD_RESOLVED", 1276 }, -{ "ER_BAD_SLAVE_UNTIL_COND", 1277 }, -{ "ER_MISSING_SKIP_SLAVE", 1278 }, -{ "ER_UNTIL_COND_IGNORED", 1279 }, -{ "ER_WRONG_NAME_FOR_INDEX", 1280 }, -{ "ER_WRONG_NAME_FOR_CATALOG", 1281 }, -{ "ER_WARN_QC_RESIZE", 1282 }, -{ "ER_BAD_FT_COLUMN", 1283 }, -{ "ER_UNKNOWN_KEY_CACHE", 1284 }, -{ "ER_WARN_HOSTNAME_WONT_WORK", 1285 }, -{ "ER_UNKNOWN_STORAGE_ENGINE", 1286 }, -{ "ER_WARN_DEPRECATED_SYNTAX", 1287 }, -{ "ER_NON_UPDATABLE_TABLE", 1288 }, -{ "ER_FEATURE_DISABLED", 1289 }, -{ "ER_OPTION_PREVENTS_STATEMENT", 1290 }, -{ "ER_DUPLICATED_VALUE_IN_TYPE", 1291 }, -{ "ER_TRUNCATED_WRONG_VALUE", 1292 }, -{ "ER_TOO_MUCH_AUTO_TIMESTAMP_COLS", 1293 }, -{ "ER_INVALID_ON_UPDATE", 1294 }, -{ "ER_UNSUPPORTED_PS", 1295 }, -{ "ER_GET_ERRMSG", 1296 }, -{ "ER_GET_TEMPORARY_ERRMSG", 1297 }, -{ "ER_UNKNOWN_TIME_ZONE", 1298 }, -{ "ER_WARN_INVALID_TIMESTAMP", 1299 }, -{ "ER_INVALID_CHARACTER_STRING", 1300 }, -{ "ER_WARN_ALLOWED_PACKET_OVERFLOWED", 1301 }, -{ "ER_CONFLICTING_DECLARATIONS", 1302 }, -{ "ER_SP_NO_RECURSIVE_CREATE", 1303 }, -{ "ER_SP_ALREADY_EXISTS", 1304 }, -{ "ER_SP_DOES_NOT_EXIST", 1305 }, -{ "ER_SP_DROP_FAILED", 1306 }, -{ "ER_SP_STORE_FAILED", 1307 }, -{ "ER_SP_LILABEL_MISMATCH", 1308 }, -{ "ER_SP_LABEL_REDEFINE", 1309 }, -{ "ER_SP_LABEL_MISMATCH", 1310 }, -{ "ER_SP_UNINIT_VAR", 1311 }, -{ "ER_SP_BADSELECT", 1312 }, -{ "ER_SP_BADRETURN", 1313 }, -{ "ER_SP_BADSTATEMENT", 1314 }, -{ "ER_UPDATE_LOG_DEPRECATED_IGNORED", 1315 }, -{ "ER_UPDATE_LOG_DEPRECATED_TRANSLATED", 1316 }, -{ "ER_QUERY_INTERRUPTED", 1317 }, -{ "ER_SP_WRONG_NO_OF_ARGS", 1318 }, -{ "ER_SP_COND_MISMATCH", 1319 }, -{ "ER_SP_NORETURN", 1320 }, -{ "ER_SP_NORETURNEND", 1321 }, -{ "ER_SP_BAD_CURSOR_QUERY", 1322 }, -{ "ER_SP_BAD_CURSOR_SELECT", 1323 }, -{ "ER_SP_CURSOR_MISMATCH", 1324 }, -{ "ER_SP_CURSOR_ALREADY_OPEN", 1325 }, -{ "ER_SP_CURSOR_NOT_OPEN", 1326 }, -{ "ER_SP_UNDECLARED_VAR", 1327 }, -{ "ER_SP_WRONG_NO_OF_FETCH_ARGS", 1328 }, -{ "ER_SP_FETCH_NO_DATA", 1329 }, -{ "ER_SP_DUP_PARAM", 1330 }, -{ "ER_SP_DUP_VAR", 1331 }, -{ "ER_SP_DUP_COND", 1332 }, -{ "ER_SP_DUP_CURS", 1333 }, -{ "ER_SP_CANT_ALTER", 1334 }, -{ "ER_SP_SUBSELECT_NYI", 1335 }, -{ "ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG", 1336 }, -{ "ER_SP_VARCOND_AFTER_CURSHNDLR", 1337 }, -{ "ER_SP_CURSOR_AFTER_HANDLER", 1338 }, -{ "ER_SP_CASE_NOT_FOUND", 1339 }, -{ "ER_FPARSER_TOO_BIG_FILE", 1340 }, -{ "ER_FPARSER_BAD_HEADER", 1341 }, -{ "ER_FPARSER_EOF_IN_COMMENT", 1342 }, -{ "ER_FPARSER_ERROR_IN_PARAMETER", 1343 }, -{ "ER_FPARSER_EOF_IN_UNKNOWN_PARAMETER", 1344 }, -{ "ER_VIEW_NO_EXPLAIN", 1345 }, -{ "ER_FRM_UNKNOWN_TYPE", 1346 }, -{ "ER_WRONG_OBJECT", 1347 }, -{ "ER_NONUPDATEABLE_COLUMN", 1348 }, -{ "ER_VIEW_SELECT_DERIVED", 1349 }, -{ "ER_VIEW_SELECT_CLAUSE", 1350 }, -{ "ER_VIEW_SELECT_VARIABLE", 1351 }, -{ "ER_VIEW_SELECT_TMPTABLE", 1352 }, -{ "ER_VIEW_WRONG_LIST", 1353 }, -{ "ER_WARN_VIEW_MERGE", 1354 }, -{ "ER_WARN_VIEW_WITHOUT_KEY", 1355 }, -{ "ER_VIEW_INVALID", 1356 }, -{ "ER_SP_NO_DROP_SP", 1357 }, -{ "ER_SP_GOTO_IN_HNDLR", 1358 }, -{ "ER_TRG_ALREADY_EXISTS", 1359 }, -{ "ER_TRG_DOES_NOT_EXIST", 1360 }, -{ "ER_TRG_ON_VIEW_OR_TEMP_TABLE", 1361 }, -{ "ER_TRG_CANT_CHANGE_ROW", 1362 }, -{ "ER_TRG_NO_SUCH_ROW_IN_TRG", 1363 }, -{ "ER_NO_DEFAULT_FOR_FIELD", 1364 }, -{ "ER_DIVISION_BY_ZERO", 1365 }, -{ "ER_TRUNCATED_WRONG_VALUE_FOR_FIELD", 1366 }, -{ "ER_ILLEGAL_VALUE_FOR_TYPE", 1367 }, -{ "ER_VIEW_NONUPD_CHECK", 1368 }, -{ "ER_VIEW_CHECK_FAILED", 1369 }, -{ "ER_PROCACCESS_DENIED_ERROR", 1370 }, -{ "ER_RELAY_LOG_FAIL", 1371 }, -{ "ER_PASSWD_LENGTH", 1372 }, -{ "ER_UNKNOWN_TARGET_BINLOG", 1373 }, -{ "ER_IO_ERR_LOG_INDEX_READ", 1374 }, -{ "ER_BINLOG_PURGE_PROHIBITED", 1375 }, -{ "ER_FSEEK_FAIL", 1376 }, -{ "ER_BINLOG_PURGE_FATAL_ERR", 1377 }, -{ "ER_LOG_IN_USE", 1378 }, -{ "ER_LOG_PURGE_UNKNOWN_ERR", 1379 }, -{ "ER_RELAY_LOG_INIT", 1380 }, -{ "ER_NO_BINARY_LOGGING", 1381 }, -{ "ER_RESERVED_SYNTAX", 1382 }, -{ "ER_WSAS_FAILED", 1383 }, -{ "ER_DIFF_GROUPS_PROC", 1384 }, -{ "ER_NO_GROUP_FOR_PROC", 1385 }, -{ "ER_ORDER_WITH_PROC", 1386 }, -{ "ER_LOGGING_PROHIBIT_CHANGING_OF", 1387 }, -{ "ER_NO_FILE_MAPPING", 1388 }, -{ "ER_WRONG_MAGIC", 1389 }, -{ "ER_PS_MANY_PARAM", 1390 }, -{ "ER_KEY_PART_0", 1391 }, -{ "ER_VIEW_CHECKSUM", 1392 }, -{ "ER_VIEW_MULTIUPDATE", 1393 }, -{ "ER_VIEW_NO_INSERT_FIELD_LIST", 1394 }, -{ "ER_VIEW_DELETE_MERGE_VIEW", 1395 }, -{ "ER_CANNOT_USER", 1396 }, -{ "ER_XAER_NOTA", 1397 }, -{ "ER_XAER_INVAL", 1398 }, -{ "ER_XAER_RMFAIL", 1399 }, -{ "ER_XAER_OUTSIDE", 1400 }, -{ "ER_XAER_RMERR", 1401 }, -{ "ER_XA_RBROLLBACK", 1402 }, -{ "ER_NONEXISTING_PROC_GRANT", 1403 }, -{ "ER_PROC_AUTO_GRANT_FAIL", 1404 }, -{ "ER_PROC_AUTO_REVOKE_FAIL", 1405 }, -{ "ER_DATA_TOO_LONG", 1406 }, -{ "ER_SP_BAD_SQLSTATE", 1407 }, -{ "ER_STARTUP", 1408 }, -{ "ER_LOAD_FROM_FIXED_SIZE_ROWS_TO_VAR", 1409 }, -{ "ER_CANT_CREATE_USER_WITH_GRANT", 1410 }, -{ "ER_WRONG_VALUE_FOR_TYPE", 1411 }, -{ "ER_TABLE_DEF_CHANGED", 1412 }, -{ "ER_SP_DUP_HANDLER", 1413 }, -{ "ER_SP_NOT_VAR_ARG", 1414 }, -{ "ER_SP_NO_RETSET", 1415 }, -{ "ER_CANT_CREATE_GEOMETRY_OBJECT", 1416 }, -{ "ER_FAILED_ROUTINE_BREAK_BINLOG", 1417 }, -{ "ER_BINLOG_UNSAFE_ROUTINE", 1418 }, -{ "ER_BINLOG_CREATE_ROUTINE_NEED_SUPER", 1419 }, -{ "ER_EXEC_STMT_WITH_OPEN_CURSOR", 1420 }, -{ "ER_STMT_HAS_NO_OPEN_CURSOR", 1421 }, -{ "ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG", 1422 }, -{ "ER_NO_DEFAULT_FOR_VIEW_FIELD", 1423 }, -{ "ER_SP_NO_RECURSION", 1424 }, -{ "ER_TOO_BIG_SCALE", 1425 }, -{ "ER_TOO_BIG_PRECISION", 1426 }, -{ "ER_M_BIGGER_THAN_D", 1427 }, -{ "ER_WRONG_LOCK_OF_SYSTEM_TABLE", 1428 }, -{ "ER_CONNECT_TO_FOREIGN_DATA_SOURCE", 1429 }, -{ "ER_QUERY_ON_FOREIGN_DATA_SOURCE", 1430 }, -{ "ER_FOREIGN_DATA_SOURCE_DOESNT_EXIST", 1431 }, -{ "ER_FOREIGN_DATA_STRING_INVALID_CANT_CREATE", 1432 }, -{ "ER_FOREIGN_DATA_STRING_INVALID", 1433 }, -{ "ER_CANT_CREATE_FEDERATED_TABLE", 1434 }, -{ "ER_TRG_IN_WRONG_SCHEMA", 1435 }, -{ "ER_STACK_OVERRUN_NEED_MORE", 1436 }, -{ "ER_TOO_LONG_BODY", 1437 }, -{ "ER_WARN_CANT_DROP_DEFAULT_KEYCACHE", 1438 }, -{ "ER_TOO_BIG_DISPLAYWIDTH", 1439 }, -{ "ER_XAER_DUPID", 1440 }, -{ "ER_DATETIME_FUNCTION_OVERFLOW", 1441 }, -{ "ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG", 1442 }, -{ "ER_VIEW_PREVENT_UPDATE", 1443 }, -{ "ER_PS_NO_RECURSION", 1444 }, -{ "ER_SP_CANT_SET_AUTOCOMMIT", 1445 }, -{ "ER_MALFORMED_DEFINER", 1446 }, -{ "ER_VIEW_FRM_NO_USER", 1447 }, -{ "ER_VIEW_OTHER_USER", 1448 }, -{ "ER_NO_SUCH_USER", 1449 }, -{ "ER_FORBID_SCHEMA_CHANGE", 1450 }, -{ "ER_ROW_IS_REFERENCED_2", 1451 }, -{ "ER_NO_REFERENCED_ROW_2", 1452 }, -{ "ER_SP_BAD_VAR_SHADOW", 1453 }, -{ "ER_TRG_NO_DEFINER", 1454 }, -{ "ER_OLD_FILE_FORMAT", 1455 }, -{ "ER_SP_RECURSION_LIMIT", 1456 }, -{ "ER_SP_PROC_TABLE_CORRUPT", 1457 }, -{ "ER_SP_WRONG_NAME", 1458 }, -{ "ER_TABLE_NEEDS_UPGRADE", 1459 }, -{ "ER_SP_NO_AGGREGATE", 1460 }, -{ "ER_MAX_PREPARED_STMT_COUNT_REACHED", 1461 }, -{ "ER_VIEW_RECURSIVE", 1462 }, -{ "ER_NON_GROUPING_FIELD_USED", 1463 }, -{ "ER_TABLE_CANT_HANDLE_SPKEYS", 1464 }, -{ "ER_NO_TRIGGERS_ON_SYSTEM_SCHEMA", 1465 }, -{ "ER_REMOVED_SPACES", 1466 }, -{ "ER_AUTOINC_READ_FAILED", 1467 }, -{ "ER_USERNAME", 1468 }, -{ "ER_HOSTNAME", 1469 }, -{ "ER_WRONG_STRING_LENGTH", 1470 }, -{ "ER_NON_INSERTABLE_TABLE", 1471 }, -{ "ER_ADMIN_WRONG_MRG_TABLE", 1472 }, -{ "ER_TOO_HIGH_LEVEL_OF_NESTING_FOR_SELECT", 1473 }, -{ "ER_NAME_BECOMES_EMPTY", 1474 }, -{ "ER_AMBIGUOUS_FIELD_TERM", 1475 }, -{ "ER_FOREIGN_SERVER_EXISTS", 1476 }, -{ "ER_FOREIGN_SERVER_DOESNT_EXIST", 1477 }, -{ "ER_ILLEGAL_HA_CREATE_OPTION", 1478 }, -{ "ER_PARTITION_REQUIRES_VALUES_ERROR", 1479 }, -{ "ER_PARTITION_WRONG_VALUES_ERROR", 1480 }, -{ "ER_PARTITION_MAXVALUE_ERROR", 1481 }, -{ "ER_PARTITION_SUBPARTITION_ERROR", 1482 }, -{ "ER_PARTITION_SUBPART_MIX_ERROR", 1483 }, -{ "ER_PARTITION_WRONG_NO_PART_ERROR", 1484 }, -{ "ER_PARTITION_WRONG_NO_SUBPART_ERROR", 1485 }, -{ "ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR", 1486 }, -{ "ER_NO_CONST_EXPR_IN_RANGE_OR_LIST_ERROR", 1487 }, -{ "ER_FIELD_NOT_FOUND_PART_ERROR", 1488 }, -{ "ER_LIST_OF_FIELDS_ONLY_IN_HASH_ERROR", 1489 }, -{ "ER_INCONSISTENT_PARTITION_INFO_ERROR", 1490 }, -{ "ER_PARTITION_FUNC_NOT_ALLOWED_ERROR", 1491 }, -{ "ER_PARTITIONS_MUST_BE_DEFINED_ERROR", 1492 }, -{ "ER_RANGE_NOT_INCREASING_ERROR", 1493 }, -{ "ER_INCONSISTENT_TYPE_OF_FUNCTIONS_ERROR", 1494 }, -{ "ER_MULTIPLE_DEF_CONST_IN_LIST_PART_ERROR", 1495 }, -{ "ER_PARTITION_ENTRY_ERROR", 1496 }, -{ "ER_MIX_HANDLER_ERROR", 1497 }, -{ "ER_PARTITION_NOT_DEFINED_ERROR", 1498 }, -{ "ER_TOO_MANY_PARTITIONS_ERROR", 1499 }, -{ "ER_SUBPARTITION_ERROR", 1500 }, -{ "ER_CANT_CREATE_HANDLER_FILE", 1501 }, -{ "ER_BLOB_FIELD_IN_PART_FUNC_ERROR", 1502 }, -{ "ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF", 1503 }, -{ "ER_NO_PARTS_ERROR", 1504 }, -{ "ER_PARTITION_MGMT_ON_NONPARTITIONED", 1505 }, -{ "ER_FOREIGN_KEY_ON_PARTITIONED", 1506 }, -{ "ER_DROP_PARTITION_NON_EXISTENT", 1507 }, -{ "ER_DROP_LAST_PARTITION", 1508 }, -{ "ER_COALESCE_ONLY_ON_HASH_PARTITION", 1509 }, -{ "ER_REORG_HASH_ONLY_ON_SAME_NO", 1510 }, -{ "ER_REORG_NO_PARAM_ERROR", 1511 }, -{ "ER_ONLY_ON_RANGE_LIST_PARTITION", 1512 }, -{ "ER_ADD_PARTITION_SUBPART_ERROR", 1513 }, -{ "ER_ADD_PARTITION_NO_NEW_PARTITION", 1514 }, -{ "ER_COALESCE_PARTITION_NO_PARTITION", 1515 }, -{ "ER_REORG_PARTITION_NOT_EXIST", 1516 }, -{ "ER_SAME_NAME_PARTITION", 1517 }, -{ "ER_NO_BINLOG_ERROR", 1518 }, -{ "ER_CONSECUTIVE_REORG_PARTITIONS", 1519 }, -{ "ER_REORG_OUTSIDE_RANGE", 1520 }, -{ "ER_PARTITION_FUNCTION_FAILURE", 1521 }, -{ "ER_PART_STATE_ERROR", 1522 }, -{ "ER_LIMITED_PART_RANGE", 1523 }, -{ "ER_PLUGIN_IS_NOT_LOADED", 1524 }, -{ "ER_WRONG_VALUE", 1525 }, -{ "ER_NO_PARTITION_FOR_GIVEN_VALUE", 1526 }, -{ "ER_FILEGROUP_OPTION_ONLY_ONCE", 1527 }, -{ "ER_CREATE_FILEGROUP_FAILED", 1528 }, -{ "ER_DROP_FILEGROUP_FAILED", 1529 }, -{ "ER_TABLESPACE_AUTO_EXTEND_ERROR", 1530 }, -{ "ER_WRONG_SIZE_NUMBER", 1531 }, -{ "ER_SIZE_OVERFLOW_ERROR", 1532 }, -{ "ER_ALTER_FILEGROUP_FAILED", 1533 }, -{ "ER_BINLOG_ROW_LOGGING_FAILED", 1534 }, -{ "ER_BINLOG_ROW_WRONG_TABLE_DEF", 1535 }, -{ "ER_BINLOG_ROW_RBR_TO_SBR", 1536 }, -{ "ER_EVENT_ALREADY_EXISTS", 1537 }, -{ "ER_EVENT_STORE_FAILED", 1538 }, -{ "ER_EVENT_DOES_NOT_EXIST", 1539 }, -{ "ER_EVENT_CANT_ALTER", 1540 }, -{ "ER_EVENT_DROP_FAILED", 1541 }, -{ "ER_EVENT_INTERVAL_NOT_POSITIVE_OR_TOO_BIG", 1542 }, -{ "ER_EVENT_ENDS_BEFORE_STARTS", 1543 }, -{ "ER_EVENT_EXEC_TIME_IN_THE_PAST", 1544 }, -{ "ER_EVENT_OPEN_TABLE_FAILED", 1545 }, -{ "ER_EVENT_NEITHER_M_EXPR_NOR_M_AT", 1546 }, -{ "ER_COL_COUNT_DOESNT_MATCH_CORRUPTED", 1547 }, -{ "ER_CANNOT_LOAD_FROM_TABLE", 1548 }, -{ "ER_EVENT_CANNOT_DELETE", 1549 }, -{ "ER_EVENT_COMPILE_ERROR", 1550 }, -{ "ER_EVENT_SAME_NAME", 1551 }, -{ "ER_EVENT_DATA_TOO_LONG", 1552 }, -{ "ER_DROP_INDEX_FK", 1553 }, -{ "ER_WARN_DEPRECATED_SYNTAX_WITH_VER", 1554 }, -{ "ER_CANT_WRITE_LOCK_LOG_TABLE", 1555 }, -{ "ER_CANT_LOCK_LOG_TABLE", 1556 }, -{ "ER_FOREIGN_DUPLICATE_KEY", 1557 }, -{ "ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE", 1558 }, -{ "ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR", 1559 }, -{ "ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_FORMAT", 1560 }, -{ "ER_NDB_CANT_SWITCH_BINLOG_FORMAT", 1561 }, -{ "ER_PARTITION_NO_TEMPORARY", 1562 }, -{ "ER_PARTITION_CONST_DOMAIN_ERROR", 1563 }, -{ "ER_PARTITION_FUNCTION_IS_NOT_ALLOWED", 1564 }, -{ "ER_DDL_LOG_ERROR", 1565 }, -{ "ER_NULL_IN_VALUES_LESS_THAN", 1566 }, -{ "ER_WRONG_PARTITION_NAME", 1567 }, -{ "ER_CANT_CHANGE_TX_ISOLATION", 1568 }, -{ "ER_DUP_ENTRY_AUTOINCREMENT_CASE", 1569 }, -{ "ER_EVENT_MODIFY_QUEUE_ERROR", 1570 }, -{ "ER_EVENT_SET_VAR_ERROR", 1571 }, -{ "ER_PARTITION_MERGE_ERROR", 1572 }, -{ "ER_CANT_ACTIVATE_LOG", 1573 }, -{ "ER_RBR_NOT_AVAILABLE", 1574 }, -{ "ER_BASE64_DECODE_ERROR", 1575 }, -{ "ER_EVENT_RECURSION_FORBIDDEN", 1576 }, -{ "ER_EVENTS_DB_ERROR", 1577 }, -{ "ER_ONLY_INTEGERS_ALLOWED", 1578 }, -{ "ER_UNSUPORTED_LOG_ENGINE", 1579 }, -{ "ER_BAD_LOG_STATEMENT", 1580 }, -{ "ER_CANT_RENAME_LOG_TABLE", 1581 }, -{ "ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT", 1582 }, -{ "ER_WRONG_PARAMETERS_TO_NATIVE_FCT", 1583 }, -{ "ER_WRONG_PARAMETERS_TO_STORED_FCT", 1584 }, -{ "ER_NATIVE_FCT_NAME_COLLISION", 1585 }, -{ "ER_DUP_ENTRY_WITH_KEY_NAME", 1586 }, -{ "ER_BINLOG_PURGE_EMFILE", 1587 }, -{ "ER_EVENT_CANNOT_CREATE_IN_THE_PAST", 1588 }, -{ "ER_EVENT_CANNOT_ALTER_IN_THE_PAST", 1589 }, -{ "ER_SLAVE_INCIDENT", 1590 }, -{ "ER_NO_PARTITION_FOR_GIVEN_VALUE_SILENT", 1591 }, -{ "ER_BINLOG_UNSAFE_STATEMENT", 1592 }, -{ "ER_SLAVE_FATAL_ERROR", 1593 }, -{ "ER_SLAVE_RELAY_LOG_READ_FAILURE", 1594 }, -{ "ER_SLAVE_RELAY_LOG_WRITE_FAILURE", 1595 }, -{ "ER_SLAVE_CREATE_EVENT_FAILURE", 1596 }, -{ "ER_SLAVE_MASTER_COM_FAILURE", 1597 }, -{ "ER_BINLOG_LOGGING_IMPOSSIBLE", 1598 }, -{ "ER_VIEW_NO_CREATION_CTX", 1599 }, -{ "ER_VIEW_INVALID_CREATION_CTX", 1600 }, -{ "ER_SR_INVALID_CREATION_CTX", 1601 }, -{ "ER_TRG_CORRUPTED_FILE", 1602 }, -{ "ER_TRG_NO_CREATION_CTX", 1603 }, -{ "ER_TRG_INVALID_CREATION_CTX", 1604 }, -{ "ER_EVENT_INVALID_CREATION_CTX", 1605 }, -{ "ER_TRG_CANT_OPEN_TABLE", 1606 }, -{ "ER_CANT_CREATE_SROUTINE", 1607 }, -{ "ER_SLAVE_AMBIGOUS_EXEC_MODE", 1608 }, -{ "ER_NO_FORMAT_DESCRIPTION_EVENT_BEFORE_BINLOG_STATEMENT", 1609 }, -{ "ER_SLAVE_CORRUPT_EVENT", 1610 }, -{ "ER_LOAD_DATA_INVALID_COLUMN", 1611 }, -{ "ER_LOG_PURGE_NO_FILE", 1612 }, -{ "ER_XA_RBTIMEOUT", 1613 }, -{ "ER_XA_RBDEADLOCK", 1614 }, -{ "ER_NEED_REPREPARE", 1615 }, -{ "ER_DELAYED_NOT_SUPPORTED", 1616 }, -{ "WARN_NO_MASTER_INFO", 1617 }, -{ "WARN_OPTION_IGNORED", 1618 }, -{ "WARN_PLUGIN_DELETE_BUILTIN", 1619 }, -{ "WARN_PLUGIN_BUSY", 1620 }, -{ "ER_VARIABLE_IS_READONLY", 1621 }, -{ "ER_WARN_ENGINE_TRANSACTION_ROLLBACK", 1622 }, -{ "ER_SLAVE_HEARTBEAT_FAILURE", 1623 }, -{ "ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE", 1624 }, -{ "ER_NDB_REPLICATION_SCHEMA_ERROR", 1625 }, -{ "ER_CONFLICT_FN_PARSE_ERROR", 1626 }, -{ "ER_EXCEPTIONS_WRITE_ERROR", 1627 }, -{ "ER_TOO_LONG_TABLE_COMMENT", 1628 }, -{ "ER_TOO_LONG_FIELD_COMMENT", 1629 }, -{ "ER_FUNC_INEXISTENT_NAME_COLLISION", 1630 }, -{ "ER_DATABASE_NAME", 1631 }, -{ "ER_TABLE_NAME", 1632 }, -{ "ER_PARTITION_NAME", 1633 }, -{ "ER_SUBPARTITION_NAME", 1634 }, -{ "ER_TEMPORARY_NAME", 1635 }, -{ "ER_RENAMED_NAME", 1636 }, -{ "ER_TOO_MANY_CONCURRENT_TRXS", 1637 }, -{ "WARN_NON_ASCII_SEPARATOR_NOT_IMPLEMENTED", 1638 }, -{ "ER_DEBUG_SYNC_TIMEOUT", 1639 }, -{ "ER_DEBUG_SYNC_HIT_LIMIT", 1640 }, +{ "ER_HASHCHK", 1000, "hashchk" }, +{ "ER_NISAMCHK", 1001, "isamchk" }, +{ "ER_NO", 1002, "NO" }, +{ "ER_YES", 1003, "YES" }, +{ "ER_CANT_CREATE_FILE", 1004, "Can\'t create file \'%-.200s\' (errno: %d)" }, +{ "ER_CANT_CREATE_TABLE", 1005, "Can\'t create table \'%-.200s\' (errno: %d)" }, +{ "ER_CANT_CREATE_DB", 1006, "Can\'t create database \'%-.192s\' (errno: %d)" }, +{ "ER_DB_CREATE_EXISTS", 1007, "Can\'t create database \'%-.192s\'; database exists" }, +{ "ER_DB_DROP_EXISTS", 1008, "Can\'t drop database \'%-.192s\'; database doesn\'t exist" }, +{ "ER_DB_DROP_DELETE", 1009, "Error dropping database (can\'t delete \'%-.192s\', errno: %d)" }, +{ "ER_DB_DROP_RMDIR", 1010, "Error dropping database (can\'t rmdir \'%-.192s\', errno: %d)" }, +{ "ER_CANT_DELETE_FILE", 1011, "Error on delete of \'%-.192s\' (errno: %d)" }, +{ "ER_CANT_FIND_SYSTEM_REC", 1012, "Can\'t read record in system table" }, +{ "ER_CANT_GET_STAT", 1013, "Can\'t get status of \'%-.200s\' (errno: %d)" }, +{ "ER_CANT_GET_WD", 1014, "Can\'t get working directory (errno: %d)" }, +{ "ER_CANT_LOCK", 1015, "Can\'t lock file (errno: %d)" }, +{ "ER_CANT_OPEN_FILE", 1016, "Can\'t open file: \'%-.200s\' (errno: %d)" }, +{ "ER_FILE_NOT_FOUND", 1017, "Can\'t find file: \'%-.200s\' (errno: %d)" }, +{ "ER_CANT_READ_DIR", 1018, "Can\'t read dir of \'%-.192s\' (errno: %d)" }, +{ "ER_CANT_SET_WD", 1019, "Can\'t change dir to \'%-.192s\' (errno: %d)" }, +{ "ER_CHECKREAD", 1020, "Record has changed since last read in table \'%-.192s\'" }, +{ "ER_DISK_FULL", 1021, "Disk full (%s); waiting for someone to free some space..." }, +{ "ER_DUP_KEY", 1022, "Can\'t write; duplicate key in table \'%-.192s\'" }, +{ "ER_ERROR_ON_CLOSE", 1023, "Error on close of \'%-.192s\' (errno: %d)" }, +{ "ER_ERROR_ON_READ", 1024, "Error reading file \'%-.200s\' (errno: %d)" }, +{ "ER_ERROR_ON_RENAME", 1025, "Error on rename of \'%-.210s\' to \'%-.210s\' (errno: %d)" }, +{ "ER_ERROR_ON_WRITE", 1026, "Error writing file \'%-.200s\' (errno: %d)" }, +{ "ER_FILE_USED", 1027, "\'%-.192s\' is locked against change" }, +{ "ER_FILSORT_ABORT", 1028, "Sort aborted" }, +{ "ER_FORM_NOT_FOUND", 1029, "View \'%-.192s\' doesn\'t exist for \'%-.192s\'" }, +{ "ER_GET_ERRNO", 1030, "Got error %d from storage engine" }, +{ "ER_ILLEGAL_HA", 1031, "Table storage engine for \'%-.192s\' doesn\'t have this option" }, +{ "ER_KEY_NOT_FOUND", 1032, "Can\'t find record in \'%-.192s\'" }, +{ "ER_NOT_FORM_FILE", 1033, "Incorrect information in file: \'%-.200s\'" }, +{ "ER_NOT_KEYFILE", 1034, "Incorrect key file for table \'%-.200s\'; try to repair it" }, +{ "ER_OLD_KEYFILE", 1035, "Old key file for table \'%-.192s\'; repair it!" }, +{ "ER_OPEN_AS_READONLY", 1036, "Table \'%-.192s\' is read only" }, +{ "ER_OUTOFMEMORY", 1037, "Out of memory; restart server and try again (needed %d bytes)" }, +{ "ER_OUT_OF_SORTMEMORY", 1038, "Out of sort memory; increase server sort buffer size" }, +{ "ER_UNEXPECTED_EOF", 1039, "Unexpected EOF found when reading file \'%-.192s\' (errno: %d)" }, +{ "ER_CON_COUNT_ERROR", 1040, "Too many connections" }, +{ "ER_OUT_OF_RESOURCES", 1041, "Out of memory; check if mysqld or some other process uses all available memory; if not, you may have to use \'ulimit\' to allow mysqld to use more memory or you can add more swap space" }, +{ "ER_BAD_HOST_ERROR", 1042, "Can\'t get hostname for your address" }, +{ "ER_HANDSHAKE_ERROR", 1043, "Bad handshake" }, +{ "ER_DBACCESS_DENIED_ERROR", 1044, "Access denied for user \'%-.48s\'@\'%-.64s\' to database \'%-.192s\'" }, +{ "ER_ACCESS_DENIED_ERROR", 1045, "Access denied for user \'%-.48s\'@\'%-.64s\' (using password: %s)" }, +{ "ER_NO_DB_ERROR", 1046, "No database selected" }, +{ "ER_UNKNOWN_COM_ERROR", 1047, "Unknown command" }, +{ "ER_BAD_NULL_ERROR", 1048, "Column \'%-.192s\' cannot be null" }, +{ "ER_BAD_DB_ERROR", 1049, "Unknown database \'%-.192s\'" }, +{ "ER_TABLE_EXISTS_ERROR", 1050, "Table \'%-.192s\' already exists" }, +{ "ER_BAD_TABLE_ERROR", 1051, "Unknown table \'%-.100s\'" }, +{ "ER_NON_UNIQ_ERROR", 1052, "Column \'%-.192s\' in %-.192s is ambiguous" }, +{ "ER_SERVER_SHUTDOWN", 1053, "Server shutdown in progress" }, +{ "ER_BAD_FIELD_ERROR", 1054, "Unknown column \'%-.192s\' in \'%-.192s\'" }, +{ "ER_WRONG_FIELD_WITH_GROUP", 1055, "\'%-.192s\' isn\'t in GROUP BY" }, +{ "ER_WRONG_GROUP_FIELD", 1056, "Can\'t group on \'%-.192s\'" }, +{ "ER_WRONG_SUM_SELECT", 1057, "Statement has sum functions and columns in same statement" }, +{ "ER_WRONG_VALUE_COUNT", 1058, "Column count doesn\'t match value count" }, +{ "ER_TOO_LONG_IDENT", 1059, "Identifier name \'%-.100s\' is too long" }, +{ "ER_DUP_FIELDNAME", 1060, "Duplicate column name \'%-.192s\'" }, +{ "ER_DUP_KEYNAME", 1061, "Duplicate key name \'%-.192s\'" }, +{ "ER_DUP_ENTRY", 1062, "Duplicate entry \'%-.192s\' for key %d" }, +{ "ER_WRONG_FIELD_SPEC", 1063, "Incorrect column specifier for column \'%-.192s\'" }, +{ "ER_PARSE_ERROR", 1064, "%s near \'%-.80s\' at line %d" }, +{ "ER_EMPTY_QUERY", 1065, "Query was empty" }, +{ "ER_NONUNIQ_TABLE", 1066, "Not unique table/alias: \'%-.192s\'" }, +{ "ER_INVALID_DEFAULT", 1067, "Invalid default value for \'%-.192s\'" }, +{ "ER_MULTIPLE_PRI_KEY", 1068, "Multiple primary key defined" }, +{ "ER_TOO_MANY_KEYS", 1069, "Too many keys specified; max %d keys allowed" }, +{ "ER_TOO_MANY_KEY_PARTS", 1070, "Too many key parts specified; max %d parts allowed" }, +{ "ER_TOO_LONG_KEY", 1071, "Specified key was too long; max key length is %d bytes" }, +{ "ER_KEY_COLUMN_DOES_NOT_EXITS", 1072, "Key column \'%-.192s\' doesn\'t exist in table" }, +{ "ER_BLOB_USED_AS_KEY", 1073, "BLOB column \'%-.192s\' can\'t be used in key specification with the used table type" }, +{ "ER_TOO_BIG_FIELDLENGTH", 1074, "Column length too big for column \'%-.192s\' (max = %lu); use BLOB or TEXT instead" }, +{ "ER_WRONG_AUTO_KEY", 1075, "Incorrect table definition; there can be only one auto column and it must be defined as a key" }, +{ "ER_READY", 1076, "%s: ready for connections.\nVersion: \'%s\' socket: \'%s\' port: %d" }, +{ "ER_NORMAL_SHUTDOWN", 1077, "%s: Normal shutdown\n" }, +{ "ER_GOT_SIGNAL", 1078, "%s: Got signal %d. Aborting!\n" }, +{ "ER_SHUTDOWN_COMPLETE", 1079, "%s: Shutdown complete\n" }, +{ "ER_FORCING_CLOSE", 1080, "%s: Forcing close of thread %ld user: \'%-.48s\'\n" }, +{ "ER_IPSOCK_ERROR", 1081, "Can\'t create IP socket" }, +{ "ER_NO_SUCH_INDEX", 1082, "Table \'%-.192s\' has no index like the one used in CREATE INDEX; recreate the table" }, +{ "ER_WRONG_FIELD_TERMINATORS", 1083, "Field separator argument is not what is expected; check the manual" }, +{ "ER_BLOBS_AND_NO_TERMINATED", 1084, "You can\'t use fixed rowlength with BLOBs; please use \'fields terminated by\'" }, +{ "ER_TEXTFILE_NOT_READABLE", 1085, "The file \'%-.128s\' must be in the database directory or be readable by all" }, +{ "ER_FILE_EXISTS_ERROR", 1086, "File \'%-.200s\' already exists" }, +{ "ER_LOAD_INFO", 1087, "Records: %ld Deleted: %ld Skipped: %ld Warnings: %ld" }, +{ "ER_ALTER_INFO", 1088, "Records: %ld Duplicates: %ld" }, +{ "ER_WRONG_SUB_KEY", 1089, "Incorrect prefix key; the used key part isn\'t a string, the used length is longer than the key part, or the storage engine doesn\'t support unique prefix keys" }, +{ "ER_CANT_REMOVE_ALL_FIELDS", 1090, "You can\'t delete all columns with ALTER TABLE; use DROP TABLE instead" }, +{ "ER_CANT_DROP_FIELD_OR_KEY", 1091, "Can\'t DROP \'%-.192s\'; check that column/key exists" }, +{ "ER_INSERT_INFO", 1092, "Records: %ld Duplicates: %ld Warnings: %ld" }, +{ "ER_UPDATE_TABLE_USED", 1093, "You can\'t specify target table \'%-.192s\' for update in FROM clause" }, +{ "ER_NO_SUCH_THREAD", 1094, "Unknown thread id: %lu" }, +{ "ER_KILL_DENIED_ERROR", 1095, "You are not owner of thread %lu" }, +{ "ER_NO_TABLES_USED", 1096, "No tables used" }, +{ "ER_TOO_BIG_SET", 1097, "Too many strings for column %-.192s and SET" }, +{ "ER_NO_UNIQUE_LOGFILE", 1098, "Can\'t generate a unique log-filename %-.200s.(1-999)\n" }, +{ "ER_TABLE_NOT_LOCKED_FOR_WRITE", 1099, "Table \'%-.192s\' was locked with a READ lock and can\'t be updated" }, +{ "ER_TABLE_NOT_LOCKED", 1100, "Table \'%-.192s\' was not locked with LOCK TABLES" }, +{ "ER_BLOB_CANT_HAVE_DEFAULT", 1101, "BLOB/TEXT column \'%-.192s\' can\'t have a default value" }, +{ "ER_WRONG_DB_NAME", 1102, "Incorrect database name \'%-.100s\'" }, +{ "ER_WRONG_TABLE_NAME", 1103, "Incorrect table name \'%-.100s\'" }, +{ "ER_TOO_BIG_SELECT", 1104, "The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay" }, +{ "ER_UNKNOWN_ERROR", 1105, "Unknown error" }, +{ "ER_UNKNOWN_PROCEDURE", 1106, "Unknown procedure \'%-.192s\'" }, +{ "ER_WRONG_PARAMCOUNT_TO_PROCEDURE", 1107, "Incorrect parameter count to procedure \'%-.192s\'" }, +{ "ER_WRONG_PARAMETERS_TO_PROCEDURE", 1108, "Incorrect parameters to procedure \'%-.192s\'" }, +{ "ER_UNKNOWN_TABLE", 1109, "Unknown table \'%-.192s\' in %-.32s" }, +{ "ER_FIELD_SPECIFIED_TWICE", 1110, "Column \'%-.192s\' specified twice" }, +{ "ER_INVALID_GROUP_FUNC_USE", 1111, "Invalid use of group function" }, +{ "ER_UNSUPPORTED_EXTENSION", 1112, "Table \'%-.192s\' uses an extension that doesn\'t exist in this MySQL version" }, +{ "ER_TABLE_MUST_HAVE_COLUMNS", 1113, "A table must have at least 1 column" }, +{ "ER_RECORD_FILE_FULL", 1114, "The table \'%-.192s\' is full" }, +{ "ER_UNKNOWN_CHARACTER_SET", 1115, "Unknown character set: \'%-.64s\'" }, +{ "ER_TOO_MANY_TABLES", 1116, "Too many tables; MySQL can only use %d tables in a join" }, +{ "ER_TOO_MANY_FIELDS", 1117, "Too many columns" }, +{ "ER_TOO_BIG_ROWSIZE", 1118, "Row size too large. The maximum row size for the used table type, not counting BLOBs, is %ld. You have to change some columns to TEXT or BLOBs" }, +{ "ER_STACK_OVERRUN", 1119, "Thread stack overrun: Used: %ld of a %ld stack. Use \'mysqld --thread_stack=#\' to specify a bigger stack if needed" }, +{ "ER_WRONG_OUTER_JOIN", 1120, "Cross dependency found in OUTER JOIN; examine your ON conditions" }, +{ "ER_NULL_COLUMN_IN_INDEX", 1121, "Table handler doesn\'t support NULL in given index. Please change column \'%-.192s\' to be NOT NULL or use another handler" }, +{ "ER_CANT_FIND_UDF", 1122, "Can\'t load function \'%-.192s\'" }, +{ "ER_CANT_INITIALIZE_UDF", 1123, "Can\'t initialize function \'%-.192s\'; %-.80s" }, +{ "ER_UDF_NO_PATHS", 1124, "No paths allowed for shared library" }, +{ "ER_UDF_EXISTS", 1125, "Function \'%-.192s\' already exists" }, +{ "ER_CANT_OPEN_LIBRARY", 1126, "Can\'t open shared library \'%-.192s\' (errno: %d %-.128s)" }, +{ "ER_CANT_FIND_DL_ENTRY", 1127, "Can\'t find symbol \'%-.128s\' in library" }, +{ "ER_FUNCTION_NOT_DEFINED", 1128, "Function \'%-.192s\' is not defined" }, +{ "ER_HOST_IS_BLOCKED", 1129, "Host \'%-.64s\' is blocked because of many connection errors; unblock with \'mysqladmin flush-hosts\'" }, +{ "ER_HOST_NOT_PRIVILEGED", 1130, "Host \'%-.64s\' is not allowed to connect to this MySQL server" }, +{ "ER_PASSWORD_ANONYMOUS_USER", 1131, "You are using MySQL as an anonymous user and anonymous users are not allowed to change passwords" }, +{ "ER_PASSWORD_NOT_ALLOWED", 1132, "You must have privileges to update tables in the mysql database to be able to change passwords for others" }, +{ "ER_PASSWORD_NO_MATCH", 1133, "Can\'t find any matching row in the user table" }, +{ "ER_UPDATE_INFO", 1134, "Rows matched: %ld Changed: %ld Warnings: %ld" }, +{ "ER_CANT_CREATE_THREAD", 1135, "Can\'t create a new thread (errno %d); if you are not out of available memory, you can consult the manual for a possible OS-dependent bug" }, +{ "ER_WRONG_VALUE_COUNT_ON_ROW", 1136, "Column count doesn\'t match value count at row %ld" }, +{ "ER_CANT_REOPEN_TABLE", 1137, "Can\'t reopen table: \'%-.192s\'" }, +{ "ER_INVALID_USE_OF_NULL", 1138, "Invalid use of NULL value" }, +{ "ER_REGEXP_ERROR", 1139, "Got error \'%-.64s\' from regexp" }, +{ "ER_MIX_OF_GROUP_FUNC_AND_FIELDS", 1140, "Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause" }, +{ "ER_NONEXISTING_GRANT", 1141, "There is no such grant defined for user \'%-.48s\' on host \'%-.64s\'" }, +{ "ER_TABLEACCESS_DENIED_ERROR", 1142, "%-.16s command denied to user \'%-.48s\'@\'%-.64s\' for table \'%-.192s\'" }, +{ "ER_COLUMNACCESS_DENIED_ERROR", 1143, "%-.16s command denied to user \'%-.48s\'@\'%-.64s\' for column \'%-.192s\' in table \'%-.192s\'" }, +{ "ER_ILLEGAL_GRANT_FOR_TABLE", 1144, "Illegal GRANT/REVOKE command; please consult the manual to see which privileges can be used" }, +{ "ER_GRANT_WRONG_HOST_OR_USER", 1145, "The host or user argument to GRANT is too long" }, +{ "ER_NO_SUCH_TABLE", 1146, "Table \'%-.192s.%-.192s\' doesn\'t exist" }, +{ "ER_NONEXISTING_TABLE_GRANT", 1147, "There is no such grant defined for user \'%-.48s\' on host \'%-.64s\' on table \'%-.192s\'" }, +{ "ER_NOT_ALLOWED_COMMAND", 1148, "The used command is not allowed with this MySQL version" }, +{ "ER_SYNTAX_ERROR", 1149, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use" }, +{ "ER_DELAYED_CANT_CHANGE_LOCK", 1150, "Delayed insert thread couldn\'t get requested lock for table %-.192s" }, +{ "ER_TOO_MANY_DELAYED_THREADS", 1151, "Too many delayed threads in use" }, +{ "ER_ABORTING_CONNECTION", 1152, "Aborted connection %ld to db: \'%-.192s\' user: \'%-.48s\' (%-.64s)" }, +{ "ER_NET_PACKET_TOO_LARGE", 1153, "Got a packet bigger than \'max_allowed_packet\' bytes" }, +{ "ER_NET_READ_ERROR_FROM_PIPE", 1154, "Got a read error from the connection pipe" }, +{ "ER_NET_FCNTL_ERROR", 1155, "Got an error from fcntl()" }, +{ "ER_NET_PACKETS_OUT_OF_ORDER", 1156, "Got packets out of order" }, +{ "ER_NET_UNCOMPRESS_ERROR", 1157, "Couldn\'t uncompress communication packet" }, +{ "ER_NET_READ_ERROR", 1158, "Got an error reading communication packets" }, +{ "ER_NET_READ_INTERRUPTED", 1159, "Got timeout reading communication packets" }, +{ "ER_NET_ERROR_ON_WRITE", 1160, "Got an error writing communication packets" }, +{ "ER_NET_WRITE_INTERRUPTED", 1161, "Got timeout writing communication packets" }, +{ "ER_TOO_LONG_STRING", 1162, "Result string is longer than \'max_allowed_packet\' bytes" }, +{ "ER_TABLE_CANT_HANDLE_BLOB", 1163, "The used table type doesn\'t support BLOB/TEXT columns" }, +{ "ER_TABLE_CANT_HANDLE_AUTO_INCREMENT", 1164, "The used table type doesn\'t support AUTO_INCREMENT columns" }, +{ "ER_DELAYED_INSERT_TABLE_LOCKED", 1165, "INSERT DELAYED can\'t be used with table \'%-.192s\' because it is locked with LOCK TABLES" }, +{ "ER_WRONG_COLUMN_NAME", 1166, "Incorrect column name \'%-.100s\'" }, +{ "ER_WRONG_KEY_COLUMN", 1167, "The used storage engine can\'t index column \'%-.192s\'" }, +{ "ER_WRONG_MRG_TABLE", 1168, "Unable to open underlying table which is differently defined or of non-MyISAM type or doesn\'t exist" }, +{ "ER_DUP_UNIQUE", 1169, "Can\'t write, because of unique constraint, to table \'%-.192s\'" }, +{ "ER_BLOB_KEY_WITHOUT_LENGTH", 1170, "BLOB/TEXT column \'%-.192s\' used in key specification without a key length" }, +{ "ER_PRIMARY_CANT_HAVE_NULL", 1171, "All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead" }, +{ "ER_TOO_MANY_ROWS", 1172, "Result consisted of more than one row" }, +{ "ER_REQUIRES_PRIMARY_KEY", 1173, "This table type requires a primary key" }, +{ "ER_NO_RAID_COMPILED", 1174, "This version of MySQL is not compiled with RAID support" }, +{ "ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE", 1175, "You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column" }, +{ "ER_KEY_DOES_NOT_EXITS", 1176, "Key \'%-.192s\' doesn\'t exist in table \'%-.192s\'" }, +{ "ER_CHECK_NO_SUCH_TABLE", 1177, "Can\'t open table" }, +{ "ER_CHECK_NOT_IMPLEMENTED", 1178, "The storage engine for the table doesn\'t support %s" }, +{ "ER_CANT_DO_THIS_DURING_AN_TRANSACTION", 1179, "You are not allowed to execute this command in a transaction" }, +{ "ER_ERROR_DURING_COMMIT", 1180, "Got error %d during COMMIT" }, +{ "ER_ERROR_DURING_ROLLBACK", 1181, "Got error %d during ROLLBACK" }, +{ "ER_ERROR_DURING_FLUSH_LOGS", 1182, "Got error %d during FLUSH_LOGS" }, +{ "ER_ERROR_DURING_CHECKPOINT", 1183, "Got error %d during CHECKPOINT" }, +{ "ER_NEW_ABORTING_CONNECTION", 1184, "Aborted connection %ld to db: \'%-.192s\' user: \'%-.48s\' host: \'%-.64s\' (%-.64s)" }, +{ "ER_DUMP_NOT_IMPLEMENTED", 1185, "The storage engine for the table does not support binary table dump" }, +{ "ER_FLUSH_MASTER_BINLOG_CLOSED", 1186, "Binlog closed, cannot RESET MASTER" }, +{ "ER_INDEX_REBUILD", 1187, "Failed rebuilding the index of dumped table \'%-.192s\'" }, +{ "ER_MASTER", 1188, "Error from master: \'%-.64s\'" }, +{ "ER_MASTER_NET_READ", 1189, "Net error reading from master" }, +{ "ER_MASTER_NET_WRITE", 1190, "Net error writing to master" }, +{ "ER_FT_MATCHING_KEY_NOT_FOUND", 1191, "Can\'t find FULLTEXT index matching the column list" }, +{ "ER_LOCK_OR_ACTIVE_TRANSACTION", 1192, "Can\'t execute the given command because you have active locked tables or an active transaction" }, +{ "ER_UNKNOWN_SYSTEM_VARIABLE", 1193, "Unknown system variable \'%-.64s\'" }, +{ "ER_CRASHED_ON_USAGE", 1194, "Table \'%-.192s\' is marked as crashed and should be repaired" }, +{ "ER_CRASHED_ON_REPAIR", 1195, "Table \'%-.192s\' is marked as crashed and last (automatic?) repair failed" }, +{ "ER_WARNING_NOT_COMPLETE_ROLLBACK", 1196, "Some non-transactional changed tables couldn\'t be rolled back" }, +{ "ER_TRANS_CACHE_FULL", 1197, "Multi-statement transaction required more than \'max_binlog_cache_size\' bytes of storage; increase this mysqld variable and try again" }, +{ "ER_SLAVE_MUST_STOP", 1198, "This operation cannot be performed with a running slave; run STOP SLAVE first" }, +{ "ER_SLAVE_NOT_RUNNING", 1199, "This operation requires a running slave; configure slave and do START SLAVE" }, +{ "ER_BAD_SLAVE", 1200, "The server is not configured as slave; fix in config file or with CHANGE MASTER TO" }, +{ "ER_MASTER_INFO", 1201, "Could not initialize master info structure; more error messages can be found in the MySQL error log" }, +{ "ER_SLAVE_THREAD", 1202, "Could not create slave thread; check system resources" }, +{ "ER_TOO_MANY_USER_CONNECTIONS", 1203, "User %-.64s already has more than \'max_user_connections\' active connections" }, +{ "ER_SET_CONSTANTS_ONLY", 1204, "You may only use constant expressions with SET" }, +{ "ER_LOCK_WAIT_TIMEOUT", 1205, "Lock wait timeout exceeded; try restarting transaction" }, +{ "ER_LOCK_TABLE_FULL", 1206, "The total number of locks exceeds the lock table size" }, +{ "ER_READ_ONLY_TRANSACTION", 1207, "Update locks cannot be acquired during a READ UNCOMMITTED transaction" }, +{ "ER_DROP_DB_WITH_READ_LOCK", 1208, "DROP DATABASE not allowed while thread is holding global read lock" }, +{ "ER_CREATE_DB_WITH_READ_LOCK", 1209, "CREATE DATABASE not allowed while thread is holding global read lock" }, +{ "ER_WRONG_ARGUMENTS", 1210, "Incorrect arguments to %s" }, +{ "ER_NO_PERMISSION_TO_CREATE_USER", 1211, "\'%-.48s\'@\'%-.64s\' is not allowed to create new users" }, +{ "ER_UNION_TABLES_IN_DIFFERENT_DIR", 1212, "Incorrect table definition; all MERGE tables must be in the same database" }, +{ "ER_LOCK_DEADLOCK", 1213, "Deadlock found when trying to get lock; try restarting transaction" }, +{ "ER_TABLE_CANT_HANDLE_FT", 1214, "The used table type doesn\'t support FULLTEXT indexes" }, +{ "ER_CANNOT_ADD_FOREIGN", 1215, "Cannot add foreign key constraint" }, +{ "ER_NO_REFERENCED_ROW", 1216, "Cannot add or update a child row: a foreign key constraint fails" }, +{ "ER_ROW_IS_REFERENCED", 1217, "Cannot delete or update a parent row: a foreign key constraint fails" }, +{ "ER_CONNECT_TO_MASTER", 1218, "Error connecting to master: %-.128s" }, +{ "ER_QUERY_ON_MASTER", 1219, "Error running query on master: %-.128s" }, +{ "ER_ERROR_WHEN_EXECUTING_COMMAND", 1220, "Error when executing command %s: %-.128s" }, +{ "ER_WRONG_USAGE", 1221, "Incorrect usage of %s and %s" }, +{ "ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT", 1222, "The used SELECT statements have a different number of columns" }, +{ "ER_CANT_UPDATE_WITH_READLOCK", 1223, "Can\'t execute the query because you have a conflicting read lock" }, +{ "ER_MIXING_NOT_ALLOWED", 1224, "Mixing of transactional and non-transactional tables is disabled" }, +{ "ER_DUP_ARGUMENT", 1225, "Option \'%s\' used twice in statement" }, +{ "ER_USER_LIMIT_REACHED", 1226, "User \'%-.64s\' has exceeded the \'%s\' resource (current value: %ld)" }, +{ "ER_SPECIFIC_ACCESS_DENIED_ERROR", 1227, "Access denied; you need (at least one of) the %-.128s privilege(s) for this operation" }, +{ "ER_LOCAL_VARIABLE", 1228, "Variable \'%-.64s\' is a SESSION variable and can\'t be used with SET GLOBAL" }, +{ "ER_GLOBAL_VARIABLE", 1229, "Variable \'%-.64s\' is a GLOBAL variable and should be set with SET GLOBAL" }, +{ "ER_NO_DEFAULT", 1230, "Variable \'%-.64s\' doesn\'t have a default value" }, +{ "ER_WRONG_VALUE_FOR_VAR", 1231, "Variable \'%-.64s\' can\'t be set to the value of \'%-.200s\'" }, +{ "ER_WRONG_TYPE_FOR_VAR", 1232, "Incorrect argument type to variable \'%-.64s\'" }, +{ "ER_VAR_CANT_BE_READ", 1233, "Variable \'%-.64s\' can only be set, not read" }, +{ "ER_CANT_USE_OPTION_HERE", 1234, "Incorrect usage/placement of \'%s\'" }, +{ "ER_NOT_SUPPORTED_YET", 1235, "This version of MySQL doesn\'t yet support \'%s\'" }, +{ "ER_MASTER_FATAL_ERROR_READING_BINLOG", 1236, "Got fatal error %d from master when reading data from binary log: \'%-.128s\'" }, +{ "ER_SLAVE_IGNORED_TABLE", 1237, "Slave SQL thread ignored the query because of replicate-*-table rules" }, +{ "ER_INCORRECT_GLOBAL_LOCAL_VAR", 1238, "Variable \'%-.192s\' is a %s variable" }, +{ "ER_WRONG_FK_DEF", 1239, "Incorrect foreign key definition for \'%-.192s\': %s" }, +{ "ER_KEY_REF_DO_NOT_MATCH_TABLE_REF", 1240, "Key reference and table reference don\'t match" }, +{ "ER_OPERAND_COLUMNS", 1241, "Operand should contain %d column(s)" }, +{ "ER_SUBQUERY_NO_1_ROW", 1242, "Subquery returns more than 1 row" }, +{ "ER_UNKNOWN_STMT_HANDLER", 1243, "Unknown prepared statement handler (%.*s) given to %s" }, +{ "ER_CORRUPT_HELP_DB", 1244, "Help database is corrupt or does not exist" }, +{ "ER_CYCLIC_REFERENCE", 1245, "Cyclic reference on subqueries" }, +{ "ER_AUTO_CONVERT", 1246, "Converting column \'%s\' from %s to %s" }, +{ "ER_ILLEGAL_REFERENCE", 1247, "Reference \'%-.64s\' not supported (%s)" }, +{ "ER_DERIVED_MUST_HAVE_ALIAS", 1248, "Every derived table must have its own alias" }, +{ "ER_SELECT_REDUCED", 1249, "Select %u was reduced during optimization" }, +{ "ER_TABLENAME_NOT_ALLOWED_HERE", 1250, "Table \'%-.192s\' from one of the SELECTs cannot be used in %-.32s" }, +{ "ER_NOT_SUPPORTED_AUTH_MODE", 1251, "Client does not support authentication protocol requested by server; consider upgrading MySQL client" }, +{ "ER_SPATIAL_CANT_HAVE_NULL", 1252, "All parts of a SPATIAL index must be NOT NULL" }, +{ "ER_COLLATION_CHARSET_MISMATCH", 1253, "COLLATION \'%s\' is not valid for CHARACTER SET \'%s\'" }, +{ "ER_SLAVE_WAS_RUNNING", 1254, "Slave is already running" }, +{ "ER_SLAVE_WAS_NOT_RUNNING", 1255, "Slave already has been stopped" }, +{ "ER_TOO_BIG_FOR_UNCOMPRESS", 1256, "Uncompressed data size too large; the maximum size is %d (probably, length of uncompressed data was corrupted)" }, +{ "ER_ZLIB_Z_MEM_ERROR", 1257, "ZLIB: Not enough memory" }, +{ "ER_ZLIB_Z_BUF_ERROR", 1258, "ZLIB: Not enough room in the output buffer (probably, length of uncompressed data was corrupted)" }, +{ "ER_ZLIB_Z_DATA_ERROR", 1259, "ZLIB: Input data corrupted" }, +{ "ER_CUT_VALUE_GROUP_CONCAT", 1260, "Row %u was cut by GROUP_CONCAT()" }, +{ "ER_WARN_TOO_FEW_RECORDS", 1261, "Row %ld doesn\'t contain data for all columns" }, +{ "ER_WARN_TOO_MANY_RECORDS", 1262, "Row %ld was truncated; it contained more data than there were input columns" }, +{ "ER_WARN_NULL_TO_NOTNULL", 1263, "Column set to default value; NULL supplied to NOT NULL column \'%s\' at row %ld" }, +{ "ER_WARN_DATA_OUT_OF_RANGE", 1264, "Out of range value for column \'%s\' at row %ld" }, +{ "WARN_DATA_TRUNCATED", 1265, "Data truncated for column \'%s\' at row %ld" }, +{ "ER_WARN_USING_OTHER_HANDLER", 1266, "Using storage engine %s for table \'%s\'" }, +{ "ER_CANT_AGGREGATE_2COLLATIONS", 1267, "Illegal mix of collations (%s,%s) and (%s,%s) for operation \'%s\'" }, +{ "ER_DROP_USER", 1268, "Cannot drop one or more of the requested users" }, +{ "ER_REVOKE_GRANTS", 1269, "Can\'t revoke all privileges for one or more of the requested users" }, +{ "ER_CANT_AGGREGATE_3COLLATIONS", 1270, "Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation \'%s\'" }, +{ "ER_CANT_AGGREGATE_NCOLLATIONS", 1271, "Illegal mix of collations for operation \'%s\'" }, +{ "ER_VARIABLE_IS_NOT_STRUCT", 1272, "Variable \'%-.64s\' is not a variable component (can\'t be used as XXXX.variable_name)" }, +{ "ER_UNKNOWN_COLLATION", 1273, "Unknown collation: \'%-.64s\'" }, +{ "ER_SLAVE_IGNORED_SSL_PARAMS", 1274, "SSL parameters in CHANGE MASTER are ignored because this MySQL slave was compiled without SSL support; they can be used later if MySQL slave with SSL is started" }, +{ "ER_SERVER_IS_IN_SECURE_AUTH_MODE", 1275, "Server is running in --secure-auth mode, but \'%s\'@\'%s\' has a password in the old format; please change the password to the new format" }, +{ "ER_WARN_FIELD_RESOLVED", 1276, "Field or reference \'%-.192s%s%-.192s%s%-.192s\' of SELECT #%d was resolved in SELECT #%d" }, +{ "ER_BAD_SLAVE_UNTIL_COND", 1277, "Incorrect parameter or combination of parameters for START SLAVE UNTIL" }, +{ "ER_MISSING_SKIP_SLAVE", 1278, "It is recommended to use --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL; otherwise, you will get problems if you get an unexpected slave\'s mysqld restart" }, +{ "ER_UNTIL_COND_IGNORED", 1279, "SQL thread is not to be started so UNTIL options are ignored" }, +{ "ER_WRONG_NAME_FOR_INDEX", 1280, "Incorrect index name \'%-.100s\'" }, +{ "ER_WRONG_NAME_FOR_CATALOG", 1281, "Incorrect catalog name \'%-.100s\'" }, +{ "ER_WARN_QC_RESIZE", 1282, "Query cache failed to set size %lu; new query cache size is %lu" }, +{ "ER_BAD_FT_COLUMN", 1283, "Column \'%-.192s\' cannot be part of FULLTEXT index" }, +{ "ER_UNKNOWN_KEY_CACHE", 1284, "Unknown key cache \'%-.100s\'" }, +{ "ER_WARN_HOSTNAME_WONT_WORK", 1285, "MySQL is started in --skip-name-resolve mode; you must restart it without this switch for this grant to work" }, +{ "ER_UNKNOWN_STORAGE_ENGINE", 1286, "Unknown storage engine \'%s\'" }, +{ "ER_WARN_DEPRECATED_SYNTAX", 1287, "\'%s\' is deprecated and will be removed in a future release. Please use %s instead" }, +{ "ER_NON_UPDATABLE_TABLE", 1288, "The target table %-.100s of the %s is not updatable" }, +{ "ER_FEATURE_DISABLED", 1289, "The \'%s\' feature is disabled; you need MySQL built with \'%s\' to have it working" }, +{ "ER_OPTION_PREVENTS_STATEMENT", 1290, "The MySQL server is running with the %s option so it cannot execute this statement" }, +{ "ER_DUPLICATED_VALUE_IN_TYPE", 1291, "Column \'%-.100s\' has duplicated value \'%-.64s\' in %s" }, +{ "ER_TRUNCATED_WRONG_VALUE", 1292, "Truncated incorrect %-.32s value: \'%-.128s\'" }, +{ "ER_TOO_MUCH_AUTO_TIMESTAMP_COLS", 1293, "Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause" }, +{ "ER_INVALID_ON_UPDATE", 1294, "Invalid ON UPDATE clause for \'%-.192s\' column" }, +{ "ER_UNSUPPORTED_PS", 1295, "This command is not supported in the prepared statement protocol yet" }, +{ "ER_GET_ERRMSG", 1296, "Got error %d \'%-.100s\' from %s" }, +{ "ER_GET_TEMPORARY_ERRMSG", 1297, "Got temporary error %d \'%-.100s\' from %s" }, +{ "ER_UNKNOWN_TIME_ZONE", 1298, "Unknown or incorrect time zone: \'%-.64s\'" }, +{ "ER_WARN_INVALID_TIMESTAMP", 1299, "Invalid TIMESTAMP value in column \'%s\' at row %ld" }, +{ "ER_INVALID_CHARACTER_STRING", 1300, "Invalid %s character string: \'%.64s\'" }, +{ "ER_WARN_ALLOWED_PACKET_OVERFLOWED", 1301, "Result of %s() was larger than max_allowed_packet (%ld) - truncated" }, +{ "ER_CONFLICTING_DECLARATIONS", 1302, "Conflicting declarations: \'%s%s\' and \'%s%s\'" }, +{ "ER_SP_NO_RECURSIVE_CREATE", 1303, "Can\'t create a %s from within another stored routine" }, +{ "ER_SP_ALREADY_EXISTS", 1304, "%s %s already exists" }, +{ "ER_SP_DOES_NOT_EXIST", 1305, "%s %s does not exist" }, +{ "ER_SP_DROP_FAILED", 1306, "Failed to DROP %s %s" }, +{ "ER_SP_STORE_FAILED", 1307, "Failed to CREATE %s %s" }, +{ "ER_SP_LILABEL_MISMATCH", 1308, "%s with no matching label: %s" }, +{ "ER_SP_LABEL_REDEFINE", 1309, "Redefining label %s" }, +{ "ER_SP_LABEL_MISMATCH", 1310, "End-label %s without match" }, +{ "ER_SP_UNINIT_VAR", 1311, "Referring to uninitialized variable %s" }, +{ "ER_SP_BADSELECT", 1312, "PROCEDURE %s can\'t return a result set in the given context" }, +{ "ER_SP_BADRETURN", 1313, "RETURN is only allowed in a FUNCTION" }, +{ "ER_SP_BADSTATEMENT", 1314, "%s is not allowed in stored procedures" }, +{ "ER_UPDATE_LOG_DEPRECATED_IGNORED", 1315, "The update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been ignored. This option will be removed in MySQL 5.6." }, +{ "ER_UPDATE_LOG_DEPRECATED_TRANSLATED", 1316, "The update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN. This option will be removed in MySQL 5.6." }, +{ "ER_QUERY_INTERRUPTED", 1317, "Query execution was interrupted" }, +{ "ER_SP_WRONG_NO_OF_ARGS", 1318, "Incorrect number of arguments for %s %s; expected %u, got %u" }, +{ "ER_SP_COND_MISMATCH", 1319, "Undefined CONDITION: %s" }, +{ "ER_SP_NORETURN", 1320, "No RETURN found in FUNCTION %s" }, +{ "ER_SP_NORETURNEND", 1321, "FUNCTION %s ended without RETURN" }, +{ "ER_SP_BAD_CURSOR_QUERY", 1322, "Cursor statement must be a SELECT" }, +{ "ER_SP_BAD_CURSOR_SELECT", 1323, "Cursor SELECT must not have INTO" }, +{ "ER_SP_CURSOR_MISMATCH", 1324, "Undefined CURSOR: %s" }, +{ "ER_SP_CURSOR_ALREADY_OPEN", 1325, "Cursor is already open" }, +{ "ER_SP_CURSOR_NOT_OPEN", 1326, "Cursor is not open" }, +{ "ER_SP_UNDECLARED_VAR", 1327, "Undeclared variable: %s" }, +{ "ER_SP_WRONG_NO_OF_FETCH_ARGS", 1328, "Incorrect number of FETCH variables" }, +{ "ER_SP_FETCH_NO_DATA", 1329, "No data - zero rows fetched, selected, or processed" }, +{ "ER_SP_DUP_PARAM", 1330, "Duplicate parameter: %s" }, +{ "ER_SP_DUP_VAR", 1331, "Duplicate variable: %s" }, +{ "ER_SP_DUP_COND", 1332, "Duplicate condition: %s" }, +{ "ER_SP_DUP_CURS", 1333, "Duplicate cursor: %s" }, +{ "ER_SP_CANT_ALTER", 1334, "Failed to ALTER %s %s" }, +{ "ER_SP_SUBSELECT_NYI", 1335, "Subquery value not supported" }, +{ "ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG", 1336, "%s is not allowed in stored function or trigger" }, +{ "ER_SP_VARCOND_AFTER_CURSHNDLR", 1337, "Variable or condition declaration after cursor or handler declaration" }, +{ "ER_SP_CURSOR_AFTER_HANDLER", 1338, "Cursor declaration after handler declaration" }, +{ "ER_SP_CASE_NOT_FOUND", 1339, "Case not found for CASE statement" }, +{ "ER_FPARSER_TOO_BIG_FILE", 1340, "Configuration file \'%-.192s\' is too big" }, +{ "ER_FPARSER_BAD_HEADER", 1341, "Malformed file type header in file \'%-.192s\'" }, +{ "ER_FPARSER_EOF_IN_COMMENT", 1342, "Unexpected end of file while parsing comment \'%-.200s\'" }, +{ "ER_FPARSER_ERROR_IN_PARAMETER", 1343, "Error while parsing parameter \'%-.192s\' (line: \'%-.192s\')" }, +{ "ER_FPARSER_EOF_IN_UNKNOWN_PARAMETER", 1344, "Unexpected end of file while skipping unknown parameter \'%-.192s\'" }, +{ "ER_VIEW_NO_EXPLAIN", 1345, "EXPLAIN/SHOW can not be issued; lacking privileges for underlying table" }, +{ "ER_FRM_UNKNOWN_TYPE", 1346, "File \'%-.192s\' has unknown type \'%-.64s\' in its header" }, +{ "ER_WRONG_OBJECT", 1347, "\'%-.192s.%-.192s\' is not %s" }, +{ "ER_NONUPDATEABLE_COLUMN", 1348, "Column \'%-.192s\' is not updatable" }, +{ "ER_VIEW_SELECT_DERIVED", 1349, "View\'s SELECT contains a subquery in the FROM clause" }, +{ "ER_VIEW_SELECT_CLAUSE", 1350, "View\'s SELECT contains a \'%s\' clause" }, +{ "ER_VIEW_SELECT_VARIABLE", 1351, "View\'s SELECT contains a variable or parameter" }, +{ "ER_VIEW_SELECT_TMPTABLE", 1352, "View\'s SELECT refers to a temporary table \'%-.192s\'" }, +{ "ER_VIEW_WRONG_LIST", 1353, "View\'s SELECT and view\'s field list have different column counts" }, +{ "ER_WARN_VIEW_MERGE", 1354, "View merge algorithm can\'t be used here for now (assumed undefined algorithm)" }, +{ "ER_WARN_VIEW_WITHOUT_KEY", 1355, "View being updated does not have complete key of underlying table in it" }, +{ "ER_VIEW_INVALID", 1356, "View \'%-.192s.%-.192s\' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them" }, +{ "ER_SP_NO_DROP_SP", 1357, "Can\'t drop or alter a %s from within another stored routine" }, +{ "ER_SP_GOTO_IN_HNDLR", 1358, "GOTO is not allowed in a stored procedure handler" }, +{ "ER_TRG_ALREADY_EXISTS", 1359, "Trigger already exists" }, +{ "ER_TRG_DOES_NOT_EXIST", 1360, "Trigger does not exist" }, +{ "ER_TRG_ON_VIEW_OR_TEMP_TABLE", 1361, "Trigger\'s \'%-.192s\' is view or temporary table" }, +{ "ER_TRG_CANT_CHANGE_ROW", 1362, "Updating of %s row is not allowed in %strigger" }, +{ "ER_TRG_NO_SUCH_ROW_IN_TRG", 1363, "There is no %s row in %s trigger" }, +{ "ER_NO_DEFAULT_FOR_FIELD", 1364, "Field \'%-.192s\' doesn\'t have a default value" }, +{ "ER_DIVISION_BY_ZERO", 1365, "Division by 0" }, +{ "ER_TRUNCATED_WRONG_VALUE_FOR_FIELD", 1366, "Incorrect %-.32s value: \'%-.128s\' for column \'%.192s\' at row %ld" }, +{ "ER_ILLEGAL_VALUE_FOR_TYPE", 1367, "Illegal %s \'%-.192s\' value found during parsing" }, +{ "ER_VIEW_NONUPD_CHECK", 1368, "CHECK OPTION on non-updatable view \'%-.192s.%-.192s\'" }, +{ "ER_VIEW_CHECK_FAILED", 1369, "CHECK OPTION failed \'%-.192s.%-.192s\'" }, +{ "ER_PROCACCESS_DENIED_ERROR", 1370, "%-.16s command denied to user \'%-.48s\'@\'%-.64s\' for routine \'%-.192s\'" }, +{ "ER_RELAY_LOG_FAIL", 1371, "Failed purging old relay logs: %s" }, +{ "ER_PASSWD_LENGTH", 1372, "Password hash should be a %d-digit hexadecimal number" }, +{ "ER_UNKNOWN_TARGET_BINLOG", 1373, "Target log not found in binlog index" }, +{ "ER_IO_ERR_LOG_INDEX_READ", 1374, "I/O error reading log index file" }, +{ "ER_BINLOG_PURGE_PROHIBITED", 1375, "Server configuration does not permit binlog purge" }, +{ "ER_FSEEK_FAIL", 1376, "Failed on fseek()" }, +{ "ER_BINLOG_PURGE_FATAL_ERR", 1377, "Fatal error during log purge" }, +{ "ER_LOG_IN_USE", 1378, "A purgeable log is in use, will not purge" }, +{ "ER_LOG_PURGE_UNKNOWN_ERR", 1379, "Unknown error during log purge" }, +{ "ER_RELAY_LOG_INIT", 1380, "Failed initializing relay log position: %s" }, +{ "ER_NO_BINARY_LOGGING", 1381, "You are not using binary logging" }, +{ "ER_RESERVED_SYNTAX", 1382, "The \'%-.64s\' syntax is reserved for purposes internal to the MySQL server" }, +{ "ER_WSAS_FAILED", 1383, "WSAStartup Failed" }, +{ "ER_DIFF_GROUPS_PROC", 1384, "Can\'t handle procedures with different groups yet" }, +{ "ER_NO_GROUP_FOR_PROC", 1385, "Select must have a group with this procedure" }, +{ "ER_ORDER_WITH_PROC", 1386, "Can\'t use ORDER clause with this procedure" }, +{ "ER_LOGGING_PROHIBIT_CHANGING_OF", 1387, "Binary logging and replication forbid changing the global server %s" }, +{ "ER_NO_FILE_MAPPING", 1388, "Can\'t map file: %-.200s, errno: %d" }, +{ "ER_WRONG_MAGIC", 1389, "Wrong magic in %-.64s" }, +{ "ER_PS_MANY_PARAM", 1390, "Prepared statement contains too many placeholders" }, +{ "ER_KEY_PART_0", 1391, "Key part \'%-.192s\' length cannot be 0" }, +{ "ER_VIEW_CHECKSUM", 1392, "View text checksum failed" }, +{ "ER_VIEW_MULTIUPDATE", 1393, "Can not modify more than one base table through a join view \'%-.192s.%-.192s\'" }, +{ "ER_VIEW_NO_INSERT_FIELD_LIST", 1394, "Can not insert into join view \'%-.192s.%-.192s\' without fields list" }, +{ "ER_VIEW_DELETE_MERGE_VIEW", 1395, "Can not delete from join view \'%-.192s.%-.192s\'" }, +{ "ER_CANNOT_USER", 1396, "Operation %s failed for %.256s" }, +{ "ER_XAER_NOTA", 1397, "XAER_NOTA: Unknown XID" }, +{ "ER_XAER_INVAL", 1398, "XAER_INVAL: Invalid arguments (or unsupported command)" }, +{ "ER_XAER_RMFAIL", 1399, "XAER_RMFAIL: The command cannot be executed when global transaction is in the %.64s state" }, +{ "ER_XAER_OUTSIDE", 1400, "XAER_OUTSIDE: Some work is done outside global transaction" }, +{ "ER_XAER_RMERR", 1401, "XAER_RMERR: Fatal error occurred in the transaction branch - check your data for consistency" }, +{ "ER_XA_RBROLLBACK", 1402, "XA_RBROLLBACK: Transaction branch was rolled back" }, +{ "ER_NONEXISTING_PROC_GRANT", 1403, "There is no such grant defined for user \'%-.48s\' on host \'%-.64s\' on routine \'%-.192s\'" }, +{ "ER_PROC_AUTO_GRANT_FAIL", 1404, "Failed to grant EXECUTE and ALTER ROUTINE privileges" }, +{ "ER_PROC_AUTO_REVOKE_FAIL", 1405, "Failed to revoke all privileges to dropped routine" }, +{ "ER_DATA_TOO_LONG", 1406, "Data too long for column \'%s\' at row %ld" }, +{ "ER_SP_BAD_SQLSTATE", 1407, "Bad SQLSTATE: \'%s\'" }, +{ "ER_STARTUP", 1408, "%s: ready for connections.\nVersion: \'%s\' socket: \'%s\' port: %d %s" }, +{ "ER_LOAD_FROM_FIXED_SIZE_ROWS_TO_VAR", 1409, "Can\'t load value from file with fixed size rows to variable" }, +{ "ER_CANT_CREATE_USER_WITH_GRANT", 1410, "You are not allowed to create a user with GRANT" }, +{ "ER_WRONG_VALUE_FOR_TYPE", 1411, "Incorrect %-.32s value: \'%-.128s\' for function %-.32s" }, +{ "ER_TABLE_DEF_CHANGED", 1412, "Table definition has changed, please retry transaction" }, +{ "ER_SP_DUP_HANDLER", 1413, "Duplicate handler declared in the same block" }, +{ "ER_SP_NOT_VAR_ARG", 1414, "OUT or INOUT argument %d for routine %s is not a variable or NEW pseudo-variable in BEFORE trigger" }, +{ "ER_SP_NO_RETSET", 1415, "Not allowed to return a result set from a %s" }, +{ "ER_CANT_CREATE_GEOMETRY_OBJECT", 1416, "Cannot get geometry object from data you send to the GEOMETRY field" }, +{ "ER_FAILED_ROUTINE_BREAK_BINLOG", 1417, "A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes" }, +{ "ER_BINLOG_UNSAFE_ROUTINE", 1418, "This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)" }, +{ "ER_BINLOG_CREATE_ROUTINE_NEED_SUPER", 1419, "You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)" }, +{ "ER_EXEC_STMT_WITH_OPEN_CURSOR", 1420, "You can\'t execute a prepared statement which has an open cursor associated with it. Reset the statement to re-execute it." }, +{ "ER_STMT_HAS_NO_OPEN_CURSOR", 1421, "The statement (%lu) has no open cursor." }, +{ "ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG", 1422, "Explicit or implicit commit is not allowed in stored function or trigger." }, +{ "ER_NO_DEFAULT_FOR_VIEW_FIELD", 1423, "Field of view \'%-.192s.%-.192s\' underlying table doesn\'t have a default value" }, +{ "ER_SP_NO_RECURSION", 1424, "Recursive stored functions and triggers are not allowed." }, +{ "ER_TOO_BIG_SCALE", 1425, "Too big scale %d specified for column \'%-.192s\'. Maximum is %lu." }, +{ "ER_TOO_BIG_PRECISION", 1426, "Too big precision %d specified for column \'%-.192s\'. Maximum is %lu." }, +{ "ER_M_BIGGER_THAN_D", 1427, "For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column \'%-.192s\')." }, +{ "ER_WRONG_LOCK_OF_SYSTEM_TABLE", 1428, "You can\'t combine write-locking of system tables with other tables or lock types" }, +{ "ER_CONNECT_TO_FOREIGN_DATA_SOURCE", 1429, "Unable to connect to foreign data source: %.64s" }, +{ "ER_QUERY_ON_FOREIGN_DATA_SOURCE", 1430, "There was a problem processing the query on the foreign data source. Data source error: %-.64s" }, +{ "ER_FOREIGN_DATA_SOURCE_DOESNT_EXIST", 1431, "The foreign data source you are trying to reference does not exist. Data source error: %-.64s" }, +{ "ER_FOREIGN_DATA_STRING_INVALID_CANT_CREATE", 1432, "Can\'t create federated table. The data source connection string \'%-.64s\' is not in the correct format" }, +{ "ER_FOREIGN_DATA_STRING_INVALID", 1433, "The data source connection string \'%-.64s\' is not in the correct format" }, +{ "ER_CANT_CREATE_FEDERATED_TABLE", 1434, "Can\'t create federated table. Foreign data src error: %-.64s" }, +{ "ER_TRG_IN_WRONG_SCHEMA", 1435, "Trigger in wrong schema" }, +{ "ER_STACK_OVERRUN_NEED_MORE", 1436, "Thread stack overrun: %ld bytes used of a %ld byte stack, and %ld bytes needed. Use \'mysqld --thread_stack=#\' to specify a bigger stack." }, +{ "ER_TOO_LONG_BODY", 1437, "Routine body for \'%-.100s\' is too long" }, +{ "ER_WARN_CANT_DROP_DEFAULT_KEYCACHE", 1438, "Cannot drop default keycache" }, +{ "ER_TOO_BIG_DISPLAYWIDTH", 1439, "Display width out of range for column \'%-.192s\' (max = %lu)" }, +{ "ER_XAER_DUPID", 1440, "XAER_DUPID: The XID already exists" }, +{ "ER_DATETIME_FUNCTION_OVERFLOW", 1441, "Datetime function: %-.32s field overflow" }, +{ "ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG", 1442, "Can\'t update table \'%-.192s\' in stored function/trigger because it is already used by statement which invoked this stored function/trigger." }, +{ "ER_VIEW_PREVENT_UPDATE", 1443, "The definition of table \'%-.192s\' prevents operation %.192s on table \'%-.192s\'." }, +{ "ER_PS_NO_RECURSION", 1444, "The prepared statement contains a stored routine call that refers to that same statement. It\'s not allowed to execute a prepared statement in such a recursive manner" }, +{ "ER_SP_CANT_SET_AUTOCOMMIT", 1445, "Not allowed to set autocommit from a stored function or trigger" }, +{ "ER_MALFORMED_DEFINER", 1446, "Definer is not fully qualified" }, +{ "ER_VIEW_FRM_NO_USER", 1447, "View \'%-.192s\'.\'%-.192s\' has no definer information (old table format). Current user is used as definer. Please recreate the view!" }, +{ "ER_VIEW_OTHER_USER", 1448, "You need the SUPER privilege for creation view with \'%-.192s\'@\'%-.192s\' definer" }, +{ "ER_NO_SUCH_USER", 1449, "The user specified as a definer (\'%-.64s\'@\'%-.64s\') does not exist" }, +{ "ER_FORBID_SCHEMA_CHANGE", 1450, "Changing schema from \'%-.192s\' to \'%-.192s\' is not allowed." }, +{ "ER_ROW_IS_REFERENCED_2", 1451, "Cannot delete or update a parent row: a foreign key constraint fails (%.192s)" }, +{ "ER_NO_REFERENCED_ROW_2", 1452, "Cannot add or update a child row: a foreign key constraint fails (%.192s)" }, +{ "ER_SP_BAD_VAR_SHADOW", 1453, "Variable \'%-.64s\' must be quoted with `...`, or renamed" }, +{ "ER_TRG_NO_DEFINER", 1454, "No definer attribute for trigger \'%-.192s\'.\'%-.192s\'. The trigger will be activated under the authorization of the invoker, which may have insufficient privileges. Please recreate the trigger." }, +{ "ER_OLD_FILE_FORMAT", 1455, "\'%-.192s\' has an old format, you should re-create the \'%s\' object(s)" }, +{ "ER_SP_RECURSION_LIMIT", 1456, "Recursive limit %d (as set by the max_sp_recursion_depth variable) was exceeded for routine %.192s" }, +{ "ER_SP_PROC_TABLE_CORRUPT", 1457, "Failed to load routine %-.192s. The table mysql.proc is missing, corrupt, or contains bad data (internal code %d)" }, +{ "ER_SP_WRONG_NAME", 1458, "Incorrect routine name \'%-.192s\'" }, +{ "ER_TABLE_NEEDS_UPGRADE", 1459, "Table upgrade required. Please do \"REPAIR TABLE `%-.32s`\" or dump/reload to fix it!" }, +{ "ER_SP_NO_AGGREGATE", 1460, "AGGREGATE is not supported for stored functions" }, +{ "ER_MAX_PREPARED_STMT_COUNT_REACHED", 1461, "Can\'t create more than max_prepared_stmt_count statements (current value: %lu)" }, +{ "ER_VIEW_RECURSIVE", 1462, "`%-.192s`.`%-.192s` contains view recursion" }, +{ "ER_NON_GROUPING_FIELD_USED", 1463, "non-grouping field \'%-.192s\' is used in %-.64s clause" }, +{ "ER_TABLE_CANT_HANDLE_SPKEYS", 1464, "The used table type doesn\'t support SPATIAL indexes" }, +{ "ER_NO_TRIGGERS_ON_SYSTEM_SCHEMA", 1465, "Triggers can not be created on system tables" }, +{ "ER_REMOVED_SPACES", 1466, "Leading spaces are removed from name \'%s\'" }, +{ "ER_AUTOINC_READ_FAILED", 1467, "Failed to read auto-increment value from storage engine" }, +{ "ER_USERNAME", 1468, "user name" }, +{ "ER_HOSTNAME", 1469, "host name" }, +{ "ER_WRONG_STRING_LENGTH", 1470, "String \'%-.70s\' is too long for %s (should be no longer than %d)" }, +{ "ER_NON_INSERTABLE_TABLE", 1471, "The target table %-.100s of the %s is not insertable-into" }, +{ "ER_ADMIN_WRONG_MRG_TABLE", 1472, "Table \'%-.64s\' is differently defined or of non-MyISAM type or doesn\'t exist" }, +{ "ER_TOO_HIGH_LEVEL_OF_NESTING_FOR_SELECT", 1473, "Too high level of nesting for select" }, +{ "ER_NAME_BECOMES_EMPTY", 1474, "Name \'%-.64s\' has become \'\'" }, +{ "ER_AMBIGUOUS_FIELD_TERM", 1475, "First character of the FIELDS TERMINATED string is ambiguous; please use non-optional and non-empty FIELDS ENCLOSED BY" }, +{ "ER_FOREIGN_SERVER_EXISTS", 1476, "The foreign server, %s, you are trying to create already exists." }, +{ "ER_FOREIGN_SERVER_DOESNT_EXIST", 1477, "The foreign server name you are trying to reference does not exist. Data source error: %-.64s" }, +{ "ER_ILLEGAL_HA_CREATE_OPTION", 1478, "Table storage engine \'%-.64s\' does not support the create option \'%.64s\'" }, +{ "ER_PARTITION_REQUIRES_VALUES_ERROR", 1479, "Syntax error: %-.64s PARTITIONING requires definition of VALUES %-.64s for each partition" }, +{ "ER_PARTITION_WRONG_VALUES_ERROR", 1480, "Only %-.64s PARTITIONING can use VALUES %-.64s in partition definition" }, +{ "ER_PARTITION_MAXVALUE_ERROR", 1481, "MAXVALUE can only be used in last partition definition" }, +{ "ER_PARTITION_SUBPARTITION_ERROR", 1482, "Subpartitions can only be hash partitions and by key" }, +{ "ER_PARTITION_SUBPART_MIX_ERROR", 1483, "Must define subpartitions on all partitions if on one partition" }, +{ "ER_PARTITION_WRONG_NO_PART_ERROR", 1484, "Wrong number of partitions defined, mismatch with previous setting" }, +{ "ER_PARTITION_WRONG_NO_SUBPART_ERROR", 1485, "Wrong number of subpartitions defined, mismatch with previous setting" }, +{ "ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR", 1486, "Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed" }, +{ "ER_NO_CONST_EXPR_IN_RANGE_OR_LIST_ERROR", 1487, "Expression in RANGE/LIST VALUES must be constant" }, +{ "ER_FIELD_NOT_FOUND_PART_ERROR", 1488, "Field in list of fields for partition function not found in table" }, +{ "ER_LIST_OF_FIELDS_ONLY_IN_HASH_ERROR", 1489, "List of fields is only allowed in KEY partitions" }, +{ "ER_INCONSISTENT_PARTITION_INFO_ERROR", 1490, "The partition info in the frm file is not consistent with what can be written into the frm file" }, +{ "ER_PARTITION_FUNC_NOT_ALLOWED_ERROR", 1491, "The %-.192s function returns the wrong type" }, +{ "ER_PARTITIONS_MUST_BE_DEFINED_ERROR", 1492, "For %-.64s partitions each partition must be defined" }, +{ "ER_RANGE_NOT_INCREASING_ERROR", 1493, "VALUES LESS THAN value must be strictly increasing for each partition" }, +{ "ER_INCONSISTENT_TYPE_OF_FUNCTIONS_ERROR", 1494, "VALUES value must be of same type as partition function" }, +{ "ER_MULTIPLE_DEF_CONST_IN_LIST_PART_ERROR", 1495, "Multiple definition of same constant in list partitioning" }, +{ "ER_PARTITION_ENTRY_ERROR", 1496, "Partitioning can not be used stand-alone in query" }, +{ "ER_MIX_HANDLER_ERROR", 1497, "The mix of handlers in the partitions is not allowed in this version of MySQL" }, +{ "ER_PARTITION_NOT_DEFINED_ERROR", 1498, "For the partitioned engine it is necessary to define all %-.64s" }, +{ "ER_TOO_MANY_PARTITIONS_ERROR", 1499, "Too many partitions (including subpartitions) were defined" }, +{ "ER_SUBPARTITION_ERROR", 1500, "It is only possible to mix RANGE/LIST partitioning with HASH/KEY partitioning for subpartitioning" }, +{ "ER_CANT_CREATE_HANDLER_FILE", 1501, "Failed to create specific handler file" }, +{ "ER_BLOB_FIELD_IN_PART_FUNC_ERROR", 1502, "A BLOB field is not allowed in partition function" }, +{ "ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF", 1503, "A %-.192s must include all columns in the table\'s partitioning function" }, +{ "ER_NO_PARTS_ERROR", 1504, "Number of %-.64s = 0 is not an allowed value" }, +{ "ER_PARTITION_MGMT_ON_NONPARTITIONED", 1505, "Partition management on a not partitioned table is not possible" }, +{ "ER_FOREIGN_KEY_ON_PARTITIONED", 1506, "Foreign key clause is not yet supported in conjunction with partitioning" }, +{ "ER_DROP_PARTITION_NON_EXISTENT", 1507, "Error in list of partitions to %-.64s" }, +{ "ER_DROP_LAST_PARTITION", 1508, "Cannot remove all partitions, use DROP TABLE instead" }, +{ "ER_COALESCE_ONLY_ON_HASH_PARTITION", 1509, "COALESCE PARTITION can only be used on HASH/KEY partitions" }, +{ "ER_REORG_HASH_ONLY_ON_SAME_NO", 1510, "REORGANIZE PARTITION can only be used to reorganize partitions not to change their numbers" }, +{ "ER_REORG_NO_PARAM_ERROR", 1511, "REORGANIZE PARTITION without parameters can only be used on auto-partitioned tables using HASH PARTITIONs" }, +{ "ER_ONLY_ON_RANGE_LIST_PARTITION", 1512, "%-.64s PARTITION can only be used on RANGE/LIST partitions" }, +{ "ER_ADD_PARTITION_SUBPART_ERROR", 1513, "Trying to Add partition(s) with wrong number of subpartitions" }, +{ "ER_ADD_PARTITION_NO_NEW_PARTITION", 1514, "At least one partition must be added" }, +{ "ER_COALESCE_PARTITION_NO_PARTITION", 1515, "At least one partition must be coalesced" }, +{ "ER_REORG_PARTITION_NOT_EXIST", 1516, "More partitions to reorganize than there are partitions" }, +{ "ER_SAME_NAME_PARTITION", 1517, "Duplicate partition name %-.192s" }, +{ "ER_NO_BINLOG_ERROR", 1518, "It is not allowed to shut off binlog on this command" }, +{ "ER_CONSECUTIVE_REORG_PARTITIONS", 1519, "When reorganizing a set of partitions they must be in consecutive order" }, +{ "ER_REORG_OUTSIDE_RANGE", 1520, "Reorganize of range partitions cannot change total ranges except for last partition where it can extend the range" }, +{ "ER_PARTITION_FUNCTION_FAILURE", 1521, "Partition function not supported in this version for this handler" }, +{ "ER_PART_STATE_ERROR", 1522, "Partition state cannot be defined from CREATE/ALTER TABLE" }, +{ "ER_LIMITED_PART_RANGE", 1523, "The %-.64s handler only supports 32 bit integers in VALUES" }, +{ "ER_PLUGIN_IS_NOT_LOADED", 1524, "Plugin \'%-.192s\' is not loaded" }, +{ "ER_WRONG_VALUE", 1525, "Incorrect %-.32s value: \'%-.128s\'" }, +{ "ER_NO_PARTITION_FOR_GIVEN_VALUE", 1526, "Table has no partition for value %-.64s" }, +{ "ER_FILEGROUP_OPTION_ONLY_ONCE", 1527, "It is not allowed to specify %s more than once" }, +{ "ER_CREATE_FILEGROUP_FAILED", 1528, "Failed to create %s" }, +{ "ER_DROP_FILEGROUP_FAILED", 1529, "Failed to drop %s" }, +{ "ER_TABLESPACE_AUTO_EXTEND_ERROR", 1530, "The handler doesn\'t support autoextend of tablespaces" }, +{ "ER_WRONG_SIZE_NUMBER", 1531, "A size parameter was incorrectly specified, either number or on the form 10M" }, +{ "ER_SIZE_OVERFLOW_ERROR", 1532, "The size number was correct but we don\'t allow the digit part to be more than 2 billion" }, +{ "ER_ALTER_FILEGROUP_FAILED", 1533, "Failed to alter: %s" }, +{ "ER_BINLOG_ROW_LOGGING_FAILED", 1534, "Writing one row to the row-based binary log failed" }, +{ "ER_BINLOG_ROW_WRONG_TABLE_DEF", 1535, "Table definition on master and slave does not match: %s" }, +{ "ER_BINLOG_ROW_RBR_TO_SBR", 1536, "Slave running with --log-slave-updates must use row-based binary logging to be able to replicate row-based binary log events" }, +{ "ER_EVENT_ALREADY_EXISTS", 1537, "Event \'%-.192s\' already exists" }, +{ "ER_EVENT_STORE_FAILED", 1538, "Failed to store event %s. Error code %d from storage engine." }, +{ "ER_EVENT_DOES_NOT_EXIST", 1539, "Unknown event \'%-.192s\'" }, +{ "ER_EVENT_CANT_ALTER", 1540, "Failed to alter event \'%-.192s\'" }, +{ "ER_EVENT_DROP_FAILED", 1541, "Failed to drop %s" }, +{ "ER_EVENT_INTERVAL_NOT_POSITIVE_OR_TOO_BIG", 1542, "INTERVAL is either not positive or too big" }, +{ "ER_EVENT_ENDS_BEFORE_STARTS", 1543, "ENDS is either invalid or before STARTS" }, +{ "ER_EVENT_EXEC_TIME_IN_THE_PAST", 1544, "Event execution time is in the past. Event has been disabled" }, +{ "ER_EVENT_OPEN_TABLE_FAILED", 1545, "Failed to open mysql.event" }, +{ "ER_EVENT_NEITHER_M_EXPR_NOR_M_AT", 1546, "No datetime expression provided" }, +{ "ER_COL_COUNT_DOESNT_MATCH_CORRUPTED", 1547, "Column count of mysql.%s is wrong. Expected %d, found %d. The table is probably corrupted" }, +{ "ER_CANNOT_LOAD_FROM_TABLE", 1548, "Cannot load from mysql.%s. The table is probably corrupted" }, +{ "ER_EVENT_CANNOT_DELETE", 1549, "Failed to delete the event from mysql.event" }, +{ "ER_EVENT_COMPILE_ERROR", 1550, "Error during compilation of event\'s body" }, +{ "ER_EVENT_SAME_NAME", 1551, "Same old and new event name" }, +{ "ER_EVENT_DATA_TOO_LONG", 1552, "Data for column \'%s\' too long" }, +{ "ER_DROP_INDEX_FK", 1553, "Cannot drop index \'%-.192s\': needed in a foreign key constraint" }, +{ "ER_WARN_DEPRECATED_SYNTAX_WITH_VER", 1554, "The syntax \'%s\' is deprecated and will be removed in MySQL %s. Please use %s instead" }, +{ "ER_CANT_WRITE_LOCK_LOG_TABLE", 1555, "You can\'t write-lock a log table. Only read access is possible" }, +{ "ER_CANT_LOCK_LOG_TABLE", 1556, "You can\'t use locks with log tables." }, +{ "ER_FOREIGN_DUPLICATE_KEY", 1557, "Upholding foreign key constraints for table \'%.192s\', entry \'%-.192s\', key %d would lead to a duplicate entry" }, +{ "ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE", 1558, "Column count of mysql.%s is wrong. Expected %d, found %d. Created with MySQL %d, now running %d. Please use mysql_upgrade to fix this error." }, +{ "ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR", 1559, "Cannot switch out of the row-based binary log format when the session has open temporary tables" }, +{ "ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_FORMAT", 1560, "Cannot change the binary logging format inside a stored function or trigger" }, +{ "ER_NDB_CANT_SWITCH_BINLOG_FORMAT", 1561, "The NDB cluster engine does not support changing the binlog format on the fly yet" }, +{ "ER_PARTITION_NO_TEMPORARY", 1562, "Cannot create temporary table with partitions" }, +{ "ER_PARTITION_CONST_DOMAIN_ERROR", 1563, "Partition constant is out of partition function domain" }, +{ "ER_PARTITION_FUNCTION_IS_NOT_ALLOWED", 1564, "This partition function is not allowed" }, +{ "ER_DDL_LOG_ERROR", 1565, "Error in DDL log" }, +{ "ER_NULL_IN_VALUES_LESS_THAN", 1566, "Not allowed to use NULL value in VALUES LESS THAN" }, +{ "ER_WRONG_PARTITION_NAME", 1567, "Incorrect partition name" }, +{ "ER_CANT_CHANGE_TX_ISOLATION", 1568, "Transaction isolation level can\'t be changed while a transaction is in progress" }, +{ "ER_DUP_ENTRY_AUTOINCREMENT_CASE", 1569, "ALTER TABLE causes auto_increment resequencing, resulting in duplicate entry \'%-.192s\' for key \'%-.192s\'" }, +{ "ER_EVENT_MODIFY_QUEUE_ERROR", 1570, "Internal scheduler error %d" }, +{ "ER_EVENT_SET_VAR_ERROR", 1571, "Error during starting/stopping of the scheduler. Error code %u" }, +{ "ER_PARTITION_MERGE_ERROR", 1572, "Engine cannot be used in partitioned tables" }, +{ "ER_CANT_ACTIVATE_LOG", 1573, "Cannot activate \'%-.64s\' log" }, +{ "ER_RBR_NOT_AVAILABLE", 1574, "The server was not built with row-based replication" }, +{ "ER_BASE64_DECODE_ERROR", 1575, "Decoding of base64 string failed" }, +{ "ER_EVENT_RECURSION_FORBIDDEN", 1576, "Recursion of EVENT DDL statements is forbidden when body is present" }, +{ "ER_EVENTS_DB_ERROR", 1577, "Cannot proceed because system tables used by Event Scheduler were found damaged at server start" }, +{ "ER_ONLY_INTEGERS_ALLOWED", 1578, "Only integers allowed as number here" }, +{ "ER_UNSUPORTED_LOG_ENGINE", 1579, "This storage engine cannot be used for log tables\"" }, +{ "ER_BAD_LOG_STATEMENT", 1580, "You cannot \'%s\' a log table if logging is enabled" }, +{ "ER_CANT_RENAME_LOG_TABLE", 1581, "Cannot rename \'%s\'. When logging enabled, rename to/from log table must rename two tables: the log table to an archive table and another table back to \'%s\'" }, +{ "ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT", 1582, "Incorrect parameter count in the call to native function \'%-.192s\'" }, +{ "ER_WRONG_PARAMETERS_TO_NATIVE_FCT", 1583, "Incorrect parameters in the call to native function \'%-.192s\'" }, +{ "ER_WRONG_PARAMETERS_TO_STORED_FCT", 1584, "Incorrect parameters in the call to stored function \'%-.192s\'" }, +{ "ER_NATIVE_FCT_NAME_COLLISION", 1585, "This function \'%-.192s\' has the same name as a native function" }, +{ "ER_DUP_ENTRY_WITH_KEY_NAME", 1586, "Duplicate entry \'%-.64s\' for key \'%-.192s\'" }, +{ "ER_BINLOG_PURGE_EMFILE", 1587, "Too many files opened, please execute the command again" }, +{ "ER_EVENT_CANNOT_CREATE_IN_THE_PAST", 1588, "Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creation." }, +{ "ER_EVENT_CANNOT_ALTER_IN_THE_PAST", 1589, "Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creation." }, +{ "ER_SLAVE_INCIDENT", 1590, "The incident %s occured on the master. Message: %-.64s" }, +{ "ER_NO_PARTITION_FOR_GIVEN_VALUE_SILENT", 1591, "Table has no partition for some existing values" }, +{ "ER_BINLOG_UNSAFE_STATEMENT", 1592, "Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. %s" }, +{ "ER_SLAVE_FATAL_ERROR", 1593, "Fatal error: %s" }, +{ "ER_SLAVE_RELAY_LOG_READ_FAILURE", 1594, "Relay log read failure: %s" }, +{ "ER_SLAVE_RELAY_LOG_WRITE_FAILURE", 1595, "Relay log write failure: %s" }, +{ "ER_SLAVE_CREATE_EVENT_FAILURE", 1596, "Failed to create %s" }, +{ "ER_SLAVE_MASTER_COM_FAILURE", 1597, "Master command %s failed: %s" }, +{ "ER_BINLOG_LOGGING_IMPOSSIBLE", 1598, "Binary logging not possible. Message: %s" }, +{ "ER_VIEW_NO_CREATION_CTX", 1599, "View `%-.64s`.`%-.64s` has no creation context" }, +{ "ER_VIEW_INVALID_CREATION_CTX", 1600, "Creation context of view `%-.64s`.`%-.64s\' is invalid" }, +{ "ER_SR_INVALID_CREATION_CTX", 1601, "Creation context of stored routine `%-.64s`.`%-.64s` is invalid" }, +{ "ER_TRG_CORRUPTED_FILE", 1602, "Corrupted TRG file for table `%-.64s`.`%-.64s`" }, +{ "ER_TRG_NO_CREATION_CTX", 1603, "Triggers for table `%-.64s`.`%-.64s` have no creation context" }, +{ "ER_TRG_INVALID_CREATION_CTX", 1604, "Trigger creation context of table `%-.64s`.`%-.64s` is invalid" }, +{ "ER_EVENT_INVALID_CREATION_CTX", 1605, "Creation context of event `%-.64s`.`%-.64s` is invalid" }, +{ "ER_TRG_CANT_OPEN_TABLE", 1606, "Cannot open table for trigger `%-.64s`.`%-.64s`" }, +{ "ER_CANT_CREATE_SROUTINE", 1607, "Cannot create stored routine `%-.64s`. Check warnings" }, +{ "ER_NEVER_USED", 1608, "Ambiguous slave modes combination. %s" }, +{ "ER_NO_FORMAT_DESCRIPTION_EVENT_BEFORE_BINLOG_STATEMENT", 1609, "The BINLOG statement of type `%s` was not preceded by a format description BINLOG statement." }, +{ "ER_SLAVE_CORRUPT_EVENT", 1610, "Corrupted replication event was detected" }, +{ "ER_LOAD_DATA_INVALID_COLUMN", 1611, "Invalid column reference (%-.64s) in LOAD DATA" }, +{ "ER_LOG_PURGE_NO_FILE", 1612, "Being purged log %s was not found" }, +{ "ER_XA_RBTIMEOUT", 1613, "XA_RBTIMEOUT: Transaction branch was rolled back: took too long" }, +{ "ER_XA_RBDEADLOCK", 1614, "XA_RBDEADLOCK: Transaction branch was rolled back: deadlock was detected" }, +{ "ER_NEED_REPREPARE", 1615, "Prepared statement needs to be re-prepared" }, +{ "ER_DELAYED_NOT_SUPPORTED", 1616, "DELAYED option not supported for table \'%-.192s\'" }, +{ "WARN_NO_MASTER_INFO", 1617, "The master info structure does not exist" }, +{ "WARN_OPTION_IGNORED", 1618, "<%-.64s> option ignored" }, +{ "WARN_PLUGIN_DELETE_BUILTIN", 1619, "Built-in plugins cannot be deleted" }, +{ "WARN_PLUGIN_BUSY", 1620, "Plugin is busy and will be uninstalled on shutdown" }, +{ "ER_VARIABLE_IS_READONLY", 1621, "%s variable \'%s\' is read-only. Use SET %s to assign the value" }, +{ "ER_WARN_ENGINE_TRANSACTION_ROLLBACK", 1622, "Storage engine %s does not support rollback for this statement. Transaction rolled back and must be restarted" }, +{ "ER_SLAVE_HEARTBEAT_FAILURE", 1623, "Unexpected master\'s heartbeat data: %s" }, +{ "ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE", 1624, "The requested value for the heartbeat period is either negative or exceeds the maximum allowed (%s seconds)." }, +{ "ER_NDB_REPLICATION_SCHEMA_ERROR", 1625, "Bad schema for mysql.ndb_replication table. Message: %-.64s" }, +{ "ER_CONFLICT_FN_PARSE_ERROR", 1626, "Error in parsing conflict function. Message: %-.64s" }, +{ "ER_EXCEPTIONS_WRITE_ERROR", 1627, "Write to exceptions table failed. Message: %-.128s\"" }, +{ "ER_TOO_LONG_TABLE_COMMENT", 1628, "Comment for table \'%-.64s\' is too long (max = %lu)" }, +{ "ER_TOO_LONG_FIELD_COMMENT", 1629, "Comment for field \'%-.64s\' is too long (max = %lu)" }, +{ "ER_FUNC_INEXISTENT_NAME_COLLISION", 1630, "FUNCTION %s does not exist. Check the \'Function Name Parsing and Resolution\' section in the Reference Manual" }, +{ "ER_DATABASE_NAME", 1631, "Database" }, +{ "ER_TABLE_NAME", 1632, "Table" }, +{ "ER_PARTITION_NAME", 1633, "Partition" }, +{ "ER_SUBPARTITION_NAME", 1634, "Subpartition" }, +{ "ER_TEMPORARY_NAME", 1635, "Temporary" }, +{ "ER_RENAMED_NAME", 1636, "Renamed" }, +{ "ER_TOO_MANY_CONCURRENT_TRXS", 1637, "Too many active concurrent transactions" }, +{ "WARN_NON_ASCII_SEPARATOR_NOT_IMPLEMENTED", 1638, "Non-ASCII separator arguments are not fully supported" }, +{ "ER_DEBUG_SYNC_TIMEOUT", 1639, "debug sync point wait timed out" }, +{ "ER_DEBUG_SYNC_HIT_LIMIT", 1640, "debug sync point hit limit reached" }, +{ "ER_DUP_SIGNAL_SET", 1641, "Duplicate condition information item \'%s\'" }, +{ "ER_SIGNAL_WARN", 1642, "Unhandled user-defined warning condition" }, +{ "ER_SIGNAL_NOT_FOUND", 1643, "Unhandled user-defined not found condition" }, +{ "ER_SIGNAL_EXCEPTION", 1644, "Unhandled user-defined exception condition" }, +{ "ER_RESIGNAL_WITHOUT_ACTIVE_HANDLER", 1645, "RESIGNAL when handler not active" }, +{ "ER_SIGNAL_BAD_CONDITION_TYPE", 1646, "SIGNAL/RESIGNAL can only use a CONDITION defined with SQLSTATE" }, +{ "WARN_COND_ITEM_TRUNCATED", 1647, "Data truncated for condition item \'%s\'" }, +{ "ER_COND_ITEM_TOO_LONG", 1648, "Data too long for condition item \'%s\'" }, +{ "ER_UNKNOWN_LOCALE", 1649, "Unknown locale: \'%-.64s\'" }, +{ "ER_SLAVE_IGNORE_SERVER_IDS", 1650, "The requested server id %d clashes with the slave startup option --replicate-same-server-id" }, +{ "ER_QUERY_CACHE_DISABLED", 1651, "Query cache is disabled; restart the server with query_cache_type=1 to enable it" }, +{ "ER_SAME_NAME_PARTITION_FIELD", 1652, "Duplicate partition field name \'%-.192s\'" }, +{ "ER_PARTITION_COLUMN_LIST_ERROR", 1653, "Inconsistency in usage of column lists for partitioning" }, +{ "ER_WRONG_TYPE_COLUMN_VALUE_ERROR", 1654, "Partition column values of incorrect type" }, +{ "ER_TOO_MANY_PARTITION_FUNC_FIELDS_ERROR", 1655, "Too many fields in \'%-.192s\'" }, +{ "ER_MAXVALUE_IN_VALUES_IN", 1656, "Cannot use MAXVALUE as value in VALUES IN" }, +{ "ER_TOO_MANY_VALUES_ERROR", 1657, "Cannot have more than one value for this type of %-.64s partitioning" }, +{ "ER_ROW_SINGLE_PARTITION_FIELD_ERROR", 1658, "Row expressions in VALUES IN only allowed for multi-field column partitioning" }, +{ "ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD", 1659, "Field \'%-.192s\' is of a not allowed type for this type of partitioning" }, +{ "ER_PARTITION_FIELDS_TOO_LONG", 1660, "The total length of the partitioning fields is too large" }, +{ "ER_BINLOG_ROW_ENGINE_AND_STMT_ENGINE", 1661, "Cannot execute statement: impossible to write to binary log since both row-incapable engines and statement-incapable engines are involved." }, +{ "ER_BINLOG_ROW_MODE_AND_STMT_ENGINE", 1662, "Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = ROW and at least one table uses a storage engine limited to statement-based logging." }, +{ "ER_BINLOG_UNSAFE_AND_STMT_ENGINE", 1663, "Cannot execute statement: impossible to write to binary log since statement is unsafe, storage engine is limited to statement-based logging, and BINLOG_FORMAT = MIXED. %s" }, +{ "ER_BINLOG_ROW_INJECTION_AND_STMT_ENGINE", 1664, "Cannot execute statement: impossible to write to binary log since statement is in row format and at least one table uses a storage engine limited to statement-based logging." }, +{ "ER_BINLOG_STMT_MODE_AND_ROW_ENGINE", 1665, "Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging.%s" }, +{ "ER_BINLOG_ROW_INJECTION_AND_STMT_MODE", 1666, "Cannot execute statement: impossible to write to binary log since statement is in row format and BINLOG_FORMAT = STATEMENT." }, +{ "ER_BINLOG_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE", 1667, "Cannot execute statement: impossible to write to binary log since more than one engine is involved and at least one engine is self-logging." }, +{ "ER_BINLOG_UNSAFE_LIMIT", 1668, "The statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted." }, +{ "ER_BINLOG_UNSAFE_INSERT_DELAYED", 1669, "The statement is unsafe because it uses INSERT DELAYED. This is unsafe because the times when rows are inserted cannot be predicted." }, +{ "ER_BINLOG_UNSAFE_SYSTEM_TABLE", 1670, "The statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slaves." }, +{ "ER_BINLOG_UNSAFE_AUTOINC_COLUMNS", 1671, "Statement is unsafe because it invokes a trigger or a stored function that inserts into an AUTO_INCREMENT column. Inserted values cannot be logged correctly." }, +{ "ER_BINLOG_UNSAFE_UDF", 1672, "Statement is unsafe because it uses a UDF which may not return the same value on the slave." }, +{ "ER_BINLOG_UNSAFE_SYSTEM_VARIABLE", 1673, "Statement is unsafe because it uses a system variable that may have a different value on the slave." }, +{ "ER_BINLOG_UNSAFE_SYSTEM_FUNCTION", 1674, "Statement is unsafe because it uses a system function that may return a different value on the slave." }, +{ "ER_BINLOG_UNSAFE_NONTRANS_AFTER_TRANS", 1675, "Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction." }, +{ "ER_MESSAGE_AND_STATEMENT", 1676, "%s Statement: %s" }, +{ "ER_SLAVE_CONVERSION_FAILED", 1677, "Column %d of table \'%-.192s.%-.192s\' cannot be converted from type \'%-.32s\' to type \'%-.32s\'" }, +{ "ER_SLAVE_CANT_CREATE_CONVERSION", 1678, "Can\'t create conversion table for table \'%-.192s.%-.192s\'" }, +{ "ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_FORMAT", 1679, "Cannot modify @@session.binlog_format inside a transaction" }, +{ "ER_PATH_LENGTH", 1680, "The path specified for %.64s is too long." }, +{ "ER_WARN_DEPRECATED_SYNTAX_NO_REPLACEMENT", 1681, "The syntax \'%s\' is deprecated and will be removed in MySQL %s." }, +{ "ER_WRONG_NATIVE_TABLE_STRUCTURE", 1682, "Native table \'%-.64s\'.\'%-.64s\' has the wrong structure" }, +{ "ER_WRONG_PERFSCHEMA_USAGE", 1683, "Invalid performance_schema usage." }, +{ "ER_WARN_I_S_SKIPPED_TABLE", 1684, "Table \'%s\'.\'%s\' was skipped since its definition is being modified by concurrent DDL statement" }, +{ "ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_DIRECT", 1685, "Cannot modify @@session.binlog_direct_non_transactional_updates inside a transaction" }, +{ "ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_DIRECT", 1686, "Cannot change the binlog direct flag inside a stored function or trigger" }, +{ "ER_SPATIAL_MUST_HAVE_GEOM_COL", 1687, "A SPATIAL index may only contain a geometrical type column" }, +{ "ER_TOO_LONG_INDEX_COMMENT", 1688, "Comment for index \'%-.64s\' is too long (max = %lu)" }, +{ "ER_LOCK_ABORTED", 1689, "Wait on a lock was aborted due to a pending exclusive lock" }, +{ "ER_DATA_OUT_OF_RANGE", 1690, "%s value is out of range in \'%s\'" }, +{ "ER_WRONG_SPVAR_TYPE_IN_LIMIT", 1691, "A variable of a non-integer type in LIMIT clause" }, +{ "ER_BINLOG_UNSAFE_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE", 1692, "Mixing self-logging and non-self-logging engines in a statement is unsafe." }, +{ "ER_BINLOG_UNSAFE_MIXED_STATEMENT", 1693, "Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them." }, +{ "ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SQL_LOG_BIN", 1694, "Cannot modify @@session.sql_log_bin inside a transaction" }, +{ "ER_STORED_FUNCTION_PREVENTS_SWITCH_SQL_LOG_BIN", 1695, "Cannot change the sql_log_bin inside a stored function or trigger" }, +{ "ER_FAILED_READ_FROM_PAR_FILE", 1696, "Failed to read from the .par file" }, +{ "ER_VALUES_IS_NOT_INT_TYPE_ERROR", 1697, "VALUES value for partition \'%-.64s\' must have type INT" }, +{ "ER_ACCESS_DENIED_NO_PASSWORD_ERROR", 1698, "Access denied for user \'%-.48s\'@\'%-.64s\'" }, +{ "ER_SET_PASSWORD_AUTH_PLUGIN", 1699, "SET PASSWORD has no significance for users authenticating via plugins" }, +{ "ER_GRANT_PLUGIN_USER_EXISTS", 1700, "GRANT with IDENTIFIED WITH is illegal because the user %-.*s already exists" }, +{ "ER_TRUNCATE_ILLEGAL_FK", 1701, "Cannot truncate a table referenced in a foreign key constraint (%.192s)" }, +{ "ER_PLUGIN_IS_PERMANENT", 1702, "Plugin \'%s\' is force_plus_permanent and can not be unloaded" }, +{ "ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MIN", 1703, "The requested value for the heartbeat period is less than 1 millisecond. The value is reset to 0, meaning that heartbeating will effectively be disabled." }, +{ "ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MAX", 1704, "The requested value for the heartbeat period exceeds the value of `slave_net_timeout\' seconds. A sensible value for the period should be less than the timeout." }, +{ "ER_STMT_CACHE_FULL", 1705, "Multi-row statements required more than \'max_binlog_stmt_cache_size\' bytes of storage; increase this mysqld variable and try again" }, diff --git a/dep/mysqllite/include/mysqld_error.h b/dep/mysqllite/include/mysqld_error.h index c35c254206dfc..b886241cfb4fc 100644 --- a/dep/mysqllite/include/mysqld_error.h +++ b/dep/mysqllite/include/mysqld_error.h @@ -609,7 +609,7 @@ #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_NEVER_USED 1608 #define ER_NO_FORMAT_DESCRIPTION_EVENT_BEFORE_BINLOG_STATEMENT 1609 #define ER_SLAVE_CORRUPT_EVENT 1610 #define ER_LOAD_DATA_INVALID_COLUMN 1611 @@ -642,4 +642,69 @@ #define WARN_NON_ASCII_SEPARATOR_NOT_IMPLEMENTED 1638 #define ER_DEBUG_SYNC_TIMEOUT 1639 #define ER_DEBUG_SYNC_HIT_LIMIT 1640 -#define ER_ERROR_LAST 1640 +#define ER_DUP_SIGNAL_SET 1641 +#define ER_SIGNAL_WARN 1642 +#define ER_SIGNAL_NOT_FOUND 1643 +#define ER_SIGNAL_EXCEPTION 1644 +#define ER_RESIGNAL_WITHOUT_ACTIVE_HANDLER 1645 +#define ER_SIGNAL_BAD_CONDITION_TYPE 1646 +#define WARN_COND_ITEM_TRUNCATED 1647 +#define ER_COND_ITEM_TOO_LONG 1648 +#define ER_UNKNOWN_LOCALE 1649 +#define ER_SLAVE_IGNORE_SERVER_IDS 1650 +#define ER_QUERY_CACHE_DISABLED 1651 +#define ER_SAME_NAME_PARTITION_FIELD 1652 +#define ER_PARTITION_COLUMN_LIST_ERROR 1653 +#define ER_WRONG_TYPE_COLUMN_VALUE_ERROR 1654 +#define ER_TOO_MANY_PARTITION_FUNC_FIELDS_ERROR 1655 +#define ER_MAXVALUE_IN_VALUES_IN 1656 +#define ER_TOO_MANY_VALUES_ERROR 1657 +#define ER_ROW_SINGLE_PARTITION_FIELD_ERROR 1658 +#define ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD 1659 +#define ER_PARTITION_FIELDS_TOO_LONG 1660 +#define ER_BINLOG_ROW_ENGINE_AND_STMT_ENGINE 1661 +#define ER_BINLOG_ROW_MODE_AND_STMT_ENGINE 1662 +#define ER_BINLOG_UNSAFE_AND_STMT_ENGINE 1663 +#define ER_BINLOG_ROW_INJECTION_AND_STMT_ENGINE 1664 +#define ER_BINLOG_STMT_MODE_AND_ROW_ENGINE 1665 +#define ER_BINLOG_ROW_INJECTION_AND_STMT_MODE 1666 +#define ER_BINLOG_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE 1667 +#define ER_BINLOG_UNSAFE_LIMIT 1668 +#define ER_BINLOG_UNSAFE_INSERT_DELAYED 1669 +#define ER_BINLOG_UNSAFE_SYSTEM_TABLE 1670 +#define ER_BINLOG_UNSAFE_AUTOINC_COLUMNS 1671 +#define ER_BINLOG_UNSAFE_UDF 1672 +#define ER_BINLOG_UNSAFE_SYSTEM_VARIABLE 1673 +#define ER_BINLOG_UNSAFE_SYSTEM_FUNCTION 1674 +#define ER_BINLOG_UNSAFE_NONTRANS_AFTER_TRANS 1675 +#define ER_MESSAGE_AND_STATEMENT 1676 +#define ER_SLAVE_CONVERSION_FAILED 1677 +#define ER_SLAVE_CANT_CREATE_CONVERSION 1678 +#define ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_FORMAT 1679 +#define ER_PATH_LENGTH 1680 +#define ER_WARN_DEPRECATED_SYNTAX_NO_REPLACEMENT 1681 +#define ER_WRONG_NATIVE_TABLE_STRUCTURE 1682 +#define ER_WRONG_PERFSCHEMA_USAGE 1683 +#define ER_WARN_I_S_SKIPPED_TABLE 1684 +#define ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_DIRECT 1685 +#define ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_DIRECT 1686 +#define ER_SPATIAL_MUST_HAVE_GEOM_COL 1687 +#define ER_TOO_LONG_INDEX_COMMENT 1688 +#define ER_LOCK_ABORTED 1689 +#define ER_DATA_OUT_OF_RANGE 1690 +#define ER_WRONG_SPVAR_TYPE_IN_LIMIT 1691 +#define ER_BINLOG_UNSAFE_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE 1692 +#define ER_BINLOG_UNSAFE_MIXED_STATEMENT 1693 +#define ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SQL_LOG_BIN 1694 +#define ER_STORED_FUNCTION_PREVENTS_SWITCH_SQL_LOG_BIN 1695 +#define ER_FAILED_READ_FROM_PAR_FILE 1696 +#define ER_VALUES_IS_NOT_INT_TYPE_ERROR 1697 +#define ER_ACCESS_DENIED_NO_PASSWORD_ERROR 1698 +#define ER_SET_PASSWORD_AUTH_PLUGIN 1699 +#define ER_GRANT_PLUGIN_USER_EXISTS 1700 +#define ER_TRUNCATE_ILLEGAL_FK 1701 +#define ER_PLUGIN_IS_PERMANENT 1702 +#define ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MIN 1703 +#define ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MAX 1704 +#define ER_STMT_CACHE_FULL 1705 +#define ER_ERROR_LAST 1705 diff --git a/dep/mysqllite/include/plugin.h b/dep/mysqllite/include/plugin.h new file mode 100644 index 0000000000000..7ec68ff5040b6 --- /dev/null +++ b/dep/mysqllite/include/plugin.h @@ -0,0 +1,633 @@ +/* Copyright (C) 2005 MySQL AB, 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 _my_plugin_h +#define _my_plugin_h + +/* + On Windows, exports from DLL need to be declared + Also, plugin needs to be declared as extern "C" because MSVC + unlike other compilers, uses C++ mangling for variables not only + for functions. +*/ +#if defined(_MSC_VER) +#if defined(MYSQL_DYNAMIC_PLUGIN) + #ifdef __cplusplus + #define MYSQL_PLUGIN_EXPORT extern "C" __declspec(dllexport) + #else + #define MYSQL_PLUGIN_EXPORT __declspec(dllexport) + #endif +#else /* MYSQL_DYNAMIC_PLUGIN */ + #ifdef __cplusplus + #define MYSQL_PLUGIN_EXPORT extern "C" + #else + #define MYSQL_PLUGIN_EXPORT + #endif +#endif /*MYSQL_DYNAMIC_PLUGIN */ +#else /*_MSC_VER */ +#define MYSQL_PLUGIN_EXPORT +#endif + +#ifdef __cplusplus +class THD; +class Item; +#define MYSQL_THD THD* +#else +#define MYSQL_THD void* +#endif + +#include + +#define MYSQL_XIDDATASIZE 128 +/** + struct st_mysql_xid is binary compatible with the XID structure as + in the X/Open CAE Specification, Distributed Transaction Processing: + The XA Specification, X/Open Company Ltd., 1991. + http://www.opengroup.org/bookstore/catalog/c193.htm + + @see XID in sql/handler.h +*/ +struct st_mysql_xid { + long formatID; + long gtrid_length; + long bqual_length; + char data[MYSQL_XIDDATASIZE]; /* Not \0-terminated */ +}; +typedef struct st_mysql_xid MYSQL_XID; + +/************************************************************************* + Plugin API. Common for all plugin types. +*/ + +#define MYSQL_PLUGIN_INTERFACE_VERSION 0x0102 + +/* + The allowable types of plugins +*/ +#define MYSQL_UDF_PLUGIN 0 /* User-defined function */ +#define MYSQL_STORAGE_ENGINE_PLUGIN 1 /* Storage Engine */ +#define MYSQL_FTPARSER_PLUGIN 2 /* Full-text parser plugin */ +#define MYSQL_DAEMON_PLUGIN 3 /* The daemon/raw plugin type */ +#define MYSQL_INFORMATION_SCHEMA_PLUGIN 4 /* The I_S plugin type */ +#define MYSQL_AUDIT_PLUGIN 5 /* The Audit plugin type */ +#define MYSQL_REPLICATION_PLUGIN 6 /* The replication plugin type */ +#define MYSQL_AUTHENTICATION_PLUGIN 7 /* The authentication plugin type */ +#define MYSQL_MAX_PLUGIN_TYPE_NUM 8 /* The number of plugin types */ + +/* We use the following strings to define licenses for plugins */ +#define PLUGIN_LICENSE_PROPRIETARY 0 +#define PLUGIN_LICENSE_GPL 1 +#define PLUGIN_LICENSE_BSD 2 + +#define PLUGIN_LICENSE_PROPRIETARY_STRING "PROPRIETARY" +#define PLUGIN_LICENSE_GPL_STRING "GPL" +#define PLUGIN_LICENSE_BSD_STRING "BSD" + +/* + Macros for beginning and ending plugin declarations. Between + mysql_declare_plugin and mysql_declare_plugin_end there should + be a st_mysql_plugin struct for each plugin to be declared. +*/ + + +#ifndef MYSQL_DYNAMIC_PLUGIN +#define __MYSQL_DECLARE_PLUGIN(NAME, VERSION, PSIZE, DECLS) \ +MYSQL_PLUGIN_EXPORT int VERSION= MYSQL_PLUGIN_INTERFACE_VERSION; \ +MYSQL_PLUGIN_EXPORT int PSIZE= sizeof(struct st_mysql_plugin); \ +MYSQL_PLUGIN_EXPORT struct st_mysql_plugin DECLS[]= { +#else +#define __MYSQL_DECLARE_PLUGIN(NAME, VERSION, PSIZE, DECLS) \ +MYSQL_PLUGIN_EXPORT int _mysql_plugin_interface_version_= MYSQL_PLUGIN_INTERFACE_VERSION; \ +MYSQL_PLUGIN_EXPORT int _mysql_sizeof_struct_st_plugin_= sizeof(struct st_mysql_plugin); \ +MYSQL_PLUGIN_EXPORT struct st_mysql_plugin _mysql_plugin_declarations_[]= { +#endif + +#define mysql_declare_plugin(NAME) \ +__MYSQL_DECLARE_PLUGIN(NAME, \ + builtin_ ## NAME ## _plugin_interface_version, \ + builtin_ ## NAME ## _sizeof_struct_st_plugin, \ + builtin_ ## NAME ## _plugin) + +#define mysql_declare_plugin_end ,{0,0,0,0,0,0,0,0,0,0,0,0}} + +/* + declarations for SHOW STATUS support in plugins +*/ +enum enum_mysql_show_type +{ + SHOW_UNDEF, SHOW_BOOL, SHOW_INT, SHOW_LONG, + SHOW_LONGLONG, SHOW_CHAR, SHOW_CHAR_PTR, + SHOW_ARRAY, SHOW_FUNC, SHOW_DOUBLE, + SHOW_always_last +}; + +struct st_mysql_show_var { + const char *name; + char *value; + enum enum_mysql_show_type type; +}; + +#define SHOW_VAR_FUNC_BUFF_SIZE 1024 +typedef int (*mysql_show_var_func)(MYSQL_THD, struct st_mysql_show_var*, char *); + + +/* + declarations for server variables and command line options +*/ + + +#define PLUGIN_VAR_BOOL 0x0001 +#define PLUGIN_VAR_INT 0x0002 +#define PLUGIN_VAR_LONG 0x0003 +#define PLUGIN_VAR_LONGLONG 0x0004 +#define PLUGIN_VAR_STR 0x0005 +#define PLUGIN_VAR_ENUM 0x0006 +#define PLUGIN_VAR_SET 0x0007 +#define PLUGIN_VAR_UNSIGNED 0x0080 +#define PLUGIN_VAR_THDLOCAL 0x0100 /* Variable is per-connection */ +#define PLUGIN_VAR_READONLY 0x0200 /* Server variable is read only */ +#define PLUGIN_VAR_NOSYSVAR 0x0400 /* Not a server variable */ +#define PLUGIN_VAR_NOCMDOPT 0x0800 /* Not a command line option */ +#define PLUGIN_VAR_NOCMDARG 0x1000 /* No argument for cmd line */ +#define PLUGIN_VAR_RQCMDARG 0x0000 /* Argument required for cmd line */ +#define PLUGIN_VAR_OPCMDARG 0x2000 /* Argument optional for cmd line */ +#define PLUGIN_VAR_MEMALLOC 0x8000 /* String needs memory allocated */ + +struct st_mysql_sys_var; +struct st_mysql_value; + +/* + SYNOPSIS + (*mysql_var_check_func)() + thd thread handle + var dynamic variable being altered + save pointer to temporary storage + value user provided value + RETURN + 0 user provided value is OK and the update func may be called. + any other value indicates error. + + This function should parse the user provided value and store in the + provided temporary storage any data as required by the update func. + There is sufficient space in the temporary storage to store a double. + Note that the update func may not be called if any other error occurs + so any memory allocated should be thread-local so that it may be freed + automatically at the end of the statement. +*/ + +typedef int (*mysql_var_check_func)(MYSQL_THD thd, + struct st_mysql_sys_var *var, + void *save, struct st_mysql_value *value); + +/* + SYNOPSIS + (*mysql_var_update_func)() + thd thread handle + var dynamic variable being altered + var_ptr pointer to dynamic variable + save pointer to temporary storage + RETURN + NONE + + This function should use the validated value stored in the temporary store + and persist it in the provided pointer to the dynamic variable. + For example, strings may require memory to be allocated. +*/ +typedef void (*mysql_var_update_func)(MYSQL_THD thd, + struct st_mysql_sys_var *var, + void *var_ptr, const void *save); + + +/* the following declarations are for internal use only */ + + +#define PLUGIN_VAR_MASK \ + (PLUGIN_VAR_READONLY | PLUGIN_VAR_NOSYSVAR | \ + PLUGIN_VAR_NOCMDOPT | PLUGIN_VAR_NOCMDARG | \ + PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_MEMALLOC) + +#define MYSQL_PLUGIN_VAR_HEADER \ + int flags; \ + const char *name; \ + const char *comment; \ + mysql_var_check_func check; \ + mysql_var_update_func update + +#define MYSQL_SYSVAR_NAME(name) mysql_sysvar_ ## name +#define MYSQL_SYSVAR(name) \ + ((struct st_mysql_sys_var *)&(MYSQL_SYSVAR_NAME(name))) + +/* + for global variables, the value pointer is the first + element after the header, the default value is the second. + for thread variables, the value offset is the first + element after the header, the default value is the second. +*/ + + +#define DECLARE_MYSQL_SYSVAR_BASIC(name, type) struct { \ + MYSQL_PLUGIN_VAR_HEADER; \ + type *value; \ + const type def_val; \ +} MYSQL_SYSVAR_NAME(name) + +#define DECLARE_MYSQL_SYSVAR_SIMPLE(name, type) struct { \ + MYSQL_PLUGIN_VAR_HEADER; \ + type *value; type def_val; \ + type min_val; type max_val; \ + type blk_sz; \ +} MYSQL_SYSVAR_NAME(name) + +#define DECLARE_MYSQL_SYSVAR_TYPELIB(name, type) struct { \ + MYSQL_PLUGIN_VAR_HEADER; \ + type *value; type def_val; \ + TYPELIB *typelib; \ +} MYSQL_SYSVAR_NAME(name) + +#define DECLARE_THDVAR_FUNC(type) \ + type *(*resolve)(MYSQL_THD thd, int offset) + +#define DECLARE_MYSQL_THDVAR_BASIC(name, type) struct { \ + MYSQL_PLUGIN_VAR_HEADER; \ + int offset; \ + const type def_val; \ + DECLARE_THDVAR_FUNC(type); \ +} MYSQL_SYSVAR_NAME(name) + +#define DECLARE_MYSQL_THDVAR_SIMPLE(name, type) struct { \ + MYSQL_PLUGIN_VAR_HEADER; \ + int offset; \ + type def_val; type min_val; \ + type max_val; type blk_sz; \ + DECLARE_THDVAR_FUNC(type); \ +} MYSQL_SYSVAR_NAME(name) + +#define DECLARE_MYSQL_THDVAR_TYPELIB(name, type) struct { \ + MYSQL_PLUGIN_VAR_HEADER; \ + int offset; \ + type def_val; \ + DECLARE_THDVAR_FUNC(type); \ + TYPELIB *typelib; \ +} MYSQL_SYSVAR_NAME(name) + + +/* + the following declarations are for use by plugin implementors +*/ + +#define MYSQL_SYSVAR_BOOL(name, varname, opt, comment, check, update, def) \ +DECLARE_MYSQL_SYSVAR_BASIC(name, char) = { \ + PLUGIN_VAR_BOOL | ((opt) & PLUGIN_VAR_MASK), \ + #name, comment, check, update, &varname, def} + +#define MYSQL_SYSVAR_STR(name, varname, opt, comment, check, update, def) \ +DECLARE_MYSQL_SYSVAR_BASIC(name, char *) = { \ + PLUGIN_VAR_STR | ((opt) & PLUGIN_VAR_MASK), \ + #name, comment, check, update, &varname, def} + +#define MYSQL_SYSVAR_INT(name, varname, opt, comment, check, update, def, min, max, blk) \ +DECLARE_MYSQL_SYSVAR_SIMPLE(name, int) = { \ + PLUGIN_VAR_INT | ((opt) & PLUGIN_VAR_MASK), \ + #name, comment, check, update, &varname, def, min, max, blk } + +#define MYSQL_SYSVAR_UINT(name, varname, opt, comment, check, update, def, min, max, blk) \ +DECLARE_MYSQL_SYSVAR_SIMPLE(name, unsigned int) = { \ + PLUGIN_VAR_INT | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \ + #name, comment, check, update, &varname, def, min, max, blk } + +#define MYSQL_SYSVAR_LONG(name, varname, opt, comment, check, update, def, min, max, blk) \ +DECLARE_MYSQL_SYSVAR_SIMPLE(name, long) = { \ + PLUGIN_VAR_LONG | ((opt) & PLUGIN_VAR_MASK), \ + #name, comment, check, update, &varname, def, min, max, blk } + +#define MYSQL_SYSVAR_ULONG(name, varname, opt, comment, check, update, def, min, max, blk) \ +DECLARE_MYSQL_SYSVAR_SIMPLE(name, unsigned long) = { \ + PLUGIN_VAR_LONG | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \ + #name, comment, check, update, &varname, def, min, max, blk } + +#define MYSQL_SYSVAR_LONGLONG(name, varname, opt, comment, check, update, def, min, max, blk) \ +DECLARE_MYSQL_SYSVAR_SIMPLE(name, long long) = { \ + PLUGIN_VAR_LONGLONG | ((opt) & PLUGIN_VAR_MASK), \ + #name, comment, check, update, &varname, def, min, max, blk } + +#define MYSQL_SYSVAR_ULONGLONG(name, varname, opt, comment, check, update, def, min, max, blk) \ +DECLARE_MYSQL_SYSVAR_SIMPLE(name, unsigned long long) = { \ + PLUGIN_VAR_LONGLONG | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \ + #name, comment, check, update, &varname, def, min, max, blk } + +#define MYSQL_SYSVAR_ENUM(name, varname, opt, comment, check, update, def, typelib) \ +DECLARE_MYSQL_SYSVAR_TYPELIB(name, unsigned long) = { \ + PLUGIN_VAR_ENUM | ((opt) & PLUGIN_VAR_MASK), \ + #name, comment, check, update, &varname, def, typelib } + +#define MYSQL_SYSVAR_SET(name, varname, opt, comment, check, update, def, typelib) \ +DECLARE_MYSQL_SYSVAR_TYPELIB(name, unsigned long long) = { \ + PLUGIN_VAR_SET | ((opt) & PLUGIN_VAR_MASK), \ + #name, comment, check, update, &varname, def, typelib } + +#define MYSQL_THDVAR_BOOL(name, opt, comment, check, update, def) \ +DECLARE_MYSQL_THDVAR_BASIC(name, char) = { \ + PLUGIN_VAR_BOOL | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \ + #name, comment, check, update, -1, def, NULL} + +#define MYSQL_THDVAR_STR(name, opt, comment, check, update, def) \ +DECLARE_MYSQL_THDVAR_BASIC(name, char *) = { \ + PLUGIN_VAR_STR | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \ + #name, comment, check, update, -1, def, NULL} + +#define MYSQL_THDVAR_INT(name, opt, comment, check, update, def, min, max, blk) \ +DECLARE_MYSQL_THDVAR_SIMPLE(name, int) = { \ + PLUGIN_VAR_INT | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \ + #name, comment, check, update, -1, def, min, max, blk, NULL } + +#define MYSQL_THDVAR_UINT(name, opt, comment, check, update, def, min, max, blk) \ +DECLARE_MYSQL_THDVAR_SIMPLE(name, unsigned int) = { \ + PLUGIN_VAR_INT | PLUGIN_VAR_THDLOCAL | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \ + #name, comment, check, update, -1, def, min, max, blk, NULL } + +#define MYSQL_THDVAR_LONG(name, opt, comment, check, update, def, min, max, blk) \ +DECLARE_MYSQL_THDVAR_SIMPLE(name, long) = { \ + PLUGIN_VAR_LONG | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \ + #name, comment, check, update, -1, def, min, max, blk, NULL } + +#define MYSQL_THDVAR_ULONG(name, opt, comment, check, update, def, min, max, blk) \ +DECLARE_MYSQL_THDVAR_SIMPLE(name, unsigned long) = { \ + PLUGIN_VAR_LONG | PLUGIN_VAR_THDLOCAL | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \ + #name, comment, check, update, -1, def, min, max, blk, NULL } + +#define MYSQL_THDVAR_LONGLONG(name, opt, comment, check, update, def, min, max, blk) \ +DECLARE_MYSQL_THDVAR_SIMPLE(name, long long) = { \ + PLUGIN_VAR_LONGLONG | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \ + #name, comment, check, update, -1, def, min, max, blk, NULL } + +#define MYSQL_THDVAR_ULONGLONG(name, opt, comment, check, update, def, min, max, blk) \ +DECLARE_MYSQL_THDVAR_SIMPLE(name, unsigned long long) = { \ + PLUGIN_VAR_LONGLONG | PLUGIN_VAR_THDLOCAL | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \ + #name, comment, check, update, -1, def, min, max, blk, NULL } + +#define MYSQL_THDVAR_ENUM(name, opt, comment, check, update, def, typelib) \ +DECLARE_MYSQL_THDVAR_TYPELIB(name, unsigned long) = { \ + PLUGIN_VAR_ENUM | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \ + #name, comment, check, update, -1, def, NULL, typelib } + +#define MYSQL_THDVAR_SET(name, opt, comment, check, update, def, typelib) \ +DECLARE_MYSQL_THDVAR_TYPELIB(name, unsigned long long) = { \ + PLUGIN_VAR_SET | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \ + #name, comment, check, update, -1, def, NULL, typelib } + +/* accessor macros */ + +#define SYSVAR(name) \ + (*(MYSQL_SYSVAR_NAME(name).value)) + +/* when thd == null, result points to global value */ +#define THDVAR(thd, name) \ + (*(MYSQL_SYSVAR_NAME(name).resolve(thd, MYSQL_SYSVAR_NAME(name).offset))) + + +/* + Plugin description structure. +*/ + +struct st_mysql_plugin +{ + int type; /* the plugin type (a MYSQL_XXX_PLUGIN value) */ + void *info; /* pointer to type-specific plugin descriptor */ + const char *name; /* plugin name */ + const char *author; /* plugin author (for I_S.PLUGINS) */ + const char *descr; /* general descriptive text (for I_S.PLUGINS) */ + int license; /* the plugin license (PLUGIN_LICENSE_XXX) */ + int (*init)(void *); /* the function to invoke when plugin is loaded */ + int (*deinit)(void *);/* the function to invoke when plugin is unloaded */ + unsigned int version; /* plugin version (for I_S.PLUGINS) */ + struct st_mysql_show_var *status_vars; + struct st_mysql_sys_var **system_vars; + void * __reserved1; /* reserved for dependency checking */ +}; + +/************************************************************************* + API for Full-text parser plugin. (MYSQL_FTPARSER_PLUGIN) +*/ +#include "plugin_ftparser.h" + +/************************************************************************* + API for Storage Engine plugin. (MYSQL_DAEMON_PLUGIN) +*/ + +/* handlertons of different MySQL releases are incompatible */ +#define MYSQL_DAEMON_INTERFACE_VERSION (MYSQL_VERSION_ID << 8) + +/* + Here we define only the descriptor structure, that is referred from + st_mysql_plugin. +*/ + +struct st_mysql_daemon +{ + int interface_version; +}; + + +/************************************************************************* + API for I_S plugin. (MYSQL_INFORMATION_SCHEMA_PLUGIN) +*/ + +/* handlertons of different MySQL releases are incompatible */ +#define MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION (MYSQL_VERSION_ID << 8) + +/* + Here we define only the descriptor structure, that is referred from + st_mysql_plugin. +*/ + +struct st_mysql_information_schema +{ + int interface_version; +}; + + +/************************************************************************* + API for Storage Engine plugin. (MYSQL_STORAGE_ENGINE_PLUGIN) +*/ + +/* handlertons of different MySQL releases are incompatible */ +#define MYSQL_HANDLERTON_INTERFACE_VERSION (MYSQL_VERSION_ID << 8) + +/* + The real API is in the sql/handler.h + Here we define only the descriptor structure, that is referred from + st_mysql_plugin. +*/ + +struct st_mysql_storage_engine +{ + int interface_version; +}; + +struct handlerton; + + +/* + API for Replication plugin. (MYSQL_REPLICATION_PLUGIN) +*/ + #define MYSQL_REPLICATION_INTERFACE_VERSION 0x0100 + + /** + Replication plugin descriptor + */ + struct Mysql_replication { + int interface_version; + }; + +/************************************************************************* + st_mysql_value struct for reading values from mysqld. + Used by server variables framework to parse user-provided values. + Will be used for arguments when implementing UDFs. + + Note that val_str() returns a string in temporary memory + that will be freed at the end of statement. Copy the string + if you need it to persist. +*/ + +#define MYSQL_VALUE_TYPE_STRING 0 +#define MYSQL_VALUE_TYPE_REAL 1 +#define MYSQL_VALUE_TYPE_INT 2 + +struct st_mysql_value +{ + int (*value_type)(struct st_mysql_value *); + const char *(*val_str)(struct st_mysql_value *, char *buffer, int *length); + int (*val_real)(struct st_mysql_value *, double *realbuf); + int (*val_int)(struct st_mysql_value *, long long *intbuf); + int (*is_unsigned)(struct st_mysql_value *); +}; + + +/************************************************************************* + Miscellaneous functions for plugin implementors +*/ + +#ifdef __cplusplus +extern "C" { +#endif + +int thd_in_lock_tables(const MYSQL_THD thd); +int thd_tablespace_op(const MYSQL_THD thd); +long long thd_test_options(const MYSQL_THD thd, long long test_options); +int thd_sql_command(const MYSQL_THD thd); +const char *thd_proc_info(MYSQL_THD thd, const char *info); +void **thd_ha_data(const MYSQL_THD thd, const struct handlerton *hton); +void thd_storage_lock_wait(MYSQL_THD thd, long long value); +int thd_tx_isolation(const MYSQL_THD thd); +char *thd_security_context(MYSQL_THD thd, char *buffer, unsigned int length, + unsigned int max_query_len); +/* Increments the row counter, see THD::row_count */ +void thd_inc_row_count(MYSQL_THD thd); + +/** + Create a temporary file. + + @details + The temporary file is created in a location specified by the mysql + server configuration (--tmpdir option). The caller does not need to + delete the file, it will be deleted automatically. + + @param prefix prefix for temporary file name + @retval -1 error + @retval >= 0 a file handle that can be passed to dup or my_close +*/ +int mysql_tmpfile(const char *prefix); + +/** + Check the killed state of a connection + + @details + In MySQL support for the KILL statement is cooperative. The KILL + statement only sets a "killed" flag. This function returns the value + of that flag. A thread should check it often, especially inside + time-consuming loops, and gracefully abort the operation if it is + non-zero. + + @param thd user thread connection handle + @retval 0 the connection is active + @retval 1 the connection has been killed +*/ +int thd_killed(const MYSQL_THD thd); + + +/** + Return the thread id of a user thread + + @param thd user thread connection handle + @return thread id +*/ +unsigned long thd_get_thread_id(const MYSQL_THD thd); + +/** + Get the XID for this connection's transaction + + @param thd user thread connection handle + @param xid location where identifier is stored +*/ +void thd_get_xid(const MYSQL_THD thd, MYSQL_XID *xid); + +/** + Invalidate the query cache for a given table. + + @param thd user thread connection handle + @param key databasename\\0tablename\\0 + @param key_length length of key in bytes, including the NUL bytes + @param using_trx flag: TRUE if using transactions, FALSE otherwise +*/ +void mysql_query_cache_invalidate4(MYSQL_THD thd, + const char *key, unsigned int key_length, + int using_trx); + + +/** + Provide a handler data getter to simplify coding +*/ +void *thd_get_ha_data(const MYSQL_THD thd, const struct handlerton *hton); + + +/** + Provide a handler data setter to simplify coding + + @details + Set ha_data pointer (storage engine per-connection information). + + To avoid unclean deactivation (uninstall) of storage engine plugin + in the middle of transaction, additional storage engine plugin + lock is acquired. + + If ha_data is not null and storage engine plugin was not locked + by thd_set_ha_data() in this connection before, storage engine + plugin gets locked. + + If ha_data is null and storage engine plugin was locked by + thd_set_ha_data() in this connection before, storage engine + plugin lock gets released. + + If handlerton::close_connection() didn't reset ha_data, server does + it immediately after calling handlerton::close_connection(). +*/ +void thd_set_ha_data(MYSQL_THD thd, const struct handlerton *hton, + const void *ha_data); +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/dep/mysqllite/include/plugin_audit.h b/dep/mysqllite/include/plugin_audit.h new file mode 100644 index 0000000000000..8811c832949d8 --- /dev/null +++ b/dep/mysqllite/include/plugin_audit.h @@ -0,0 +1,138 @@ +/* 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 _my_audit_h +#define _my_audit_h + +/************************************************************************* + API for Audit plugin. (MYSQL_AUDIT_PLUGIN) +*/ + +#include "plugin.h" + +#define MYSQL_AUDIT_CLASS_MASK_SIZE 1 + +#define MYSQL_AUDIT_INTERFACE_VERSION 0x0200 + +/* + The first word in every event class struct indicates the specific + class of the event. +*/ +struct mysql_event +{ + unsigned int event_class; +}; + + +/************************************************************************* + AUDIT CLASS : GENERAL + + LOG events occurs before emitting to the general query log. + ERROR events occur before transmitting errors to the user. + RESULT events occur after transmitting a resultset to the user. + STATUS events occur after transmitting a resultset or errors + to the user. +*/ + +#define MYSQL_AUDIT_GENERAL_CLASS 0 +#define MYSQL_AUDIT_GENERAL_CLASSMASK (1 << MYSQL_AUDIT_GENERAL_CLASS) +#define MYSQL_AUDIT_GENERAL_LOG 0 +#define MYSQL_AUDIT_GENERAL_ERROR 1 +#define MYSQL_AUDIT_GENERAL_RESULT 2 +#define MYSQL_AUDIT_GENERAL_STATUS 3 + +struct mysql_event_general +{ + unsigned int event_class; + unsigned int event_subclass; + int general_error_code; + unsigned long general_thread_id; + const char *general_user; + unsigned int general_user_length; + const char *general_command; + unsigned int general_command_length; + const char *general_query; + unsigned int general_query_length; + struct charset_info_st *general_charset; + unsigned long long general_time; + unsigned long long general_rows; +}; + + +/* + AUDIT CLASS : CONNECTION + + CONNECT occurs after authentication phase is completed. + DISCONNECT occurs after connection is terminated. + CHANGE_USER occurs after COM_CHANGE_USER RPC is completed. +*/ + +#define MYSQL_AUDIT_CONNECTION_CLASS 1 +#define MYSQL_AUDIT_CONNECTION_CLASSMASK (1 << MYSQL_AUDIT_CONNECTION_CLASS) +#define MYSQL_AUDIT_CONNECTION_CONNECT 0 +#define MYSQL_AUDIT_CONNECTION_DISCONNECT 1 +#define MYSQL_AUDIT_CONNECTION_CHANGE_USER 2 + +struct mysql_event_connection +{ + unsigned int event_class; + unsigned int event_subclass; + int status; + unsigned long thread_id; + const char *user; + unsigned int user_length; + const char *priv_user; + unsigned int priv_user_length; + const char *external_user; + unsigned int external_user_length; + const char *proxy_user; + unsigned int proxy_user_length; + const char *host; + unsigned int host_length; + const char *ip; + unsigned int ip_length; + const char *database; + unsigned int database_length; +}; + + +/************************************************************************* + Here we define the descriptor structure, that is referred from + st_mysql_plugin. + + release_thd() event occurs when the event class consumer is to be + disassociated from the specified THD. This would typically occur + before some operation which may require sleeping - such as when + waiting for the next query from the client. + + event_notify() is invoked whenever an event occurs which is of any + class for which the plugin has interest. The first word of the + mysql_event argument indicates the specific event class and the + remainder of the structure is as required for that class. + + class_mask is an array of bits used to indicate what event classes + that this plugin wants to receive. +*/ + +struct st_mysql_audit +{ + int interface_version; + void (*release_thd)(MYSQL_THD); + void (*event_notify)(MYSQL_THD, const struct mysql_event *); + unsigned long class_mask[MYSQL_AUDIT_CLASS_MASK_SIZE]; +}; + + +#endif diff --git a/dep/mysqllite/include/plugin_ftparser.h b/dep/mysqllite/include/plugin_ftparser.h new file mode 100644 index 0000000000000..7f9bde3a6a0aa --- /dev/null +++ b/dep/mysqllite/include/plugin_ftparser.h @@ -0,0 +1,211 @@ +/* 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 _my_plugin_ftparser_h +#define _my_plugin_ftparser_h +#include "plugin.h" + +/************************************************************************* + API for Full-text parser plugin. (MYSQL_FTPARSER_PLUGIN) +*/ + +#define MYSQL_FTPARSER_INTERFACE_VERSION 0x0100 + +/* Parsing modes. Set in MYSQL_FTPARSER_PARAM::mode */ +enum enum_ftparser_mode +{ +/* + Fast and simple mode. This mode is used for indexing, and natural + language queries. + + The parser is expected to return only those words that go into the + index. Stopwords or too short/long words should not be returned. The + 'boolean_info' argument of mysql_add_word() does not have to be set. +*/ + MYSQL_FTPARSER_SIMPLE_MODE= 0, + +/* + Parse with stopwords mode. This mode is used in boolean searches for + "phrase matching." + + The parser is not allowed to ignore words in this mode. Every word + should be returned, including stopwords and words that are too short + or long. The 'boolean_info' argument of mysql_add_word() does not + have to be set. +*/ + MYSQL_FTPARSER_WITH_STOPWORDS= 1, + +/* + Parse in boolean mode. This mode is used to parse a boolean query string. + + The parser should provide a valid MYSQL_FTPARSER_BOOLEAN_INFO + structure in the 'boolean_info' argument to mysql_add_word(). + Usually that means that the parser should recognize boolean operators + in the parsing stream and set appropriate fields in + MYSQL_FTPARSER_BOOLEAN_INFO structure accordingly. As for + MYSQL_FTPARSER_WITH_STOPWORDS mode, no word should be ignored. + Instead, use FT_TOKEN_STOPWORD for the token type of such a word. +*/ + MYSQL_FTPARSER_FULL_BOOLEAN_INFO= 2 +}; + +/* + Token types for boolean mode searching (used for the type member of + MYSQL_FTPARSER_BOOLEAN_INFO struct) + + FT_TOKEN_EOF: End of data. + FT_TOKEN_WORD: Regular word. + FT_TOKEN_LEFT_PAREN: Left parenthesis (start of group/sub-expression). + FT_TOKEN_RIGHT_PAREN: Right parenthesis (end of group/sub-expression). + FT_TOKEN_STOPWORD: Stopword. +*/ + +enum enum_ft_token_type +{ + FT_TOKEN_EOF= 0, + FT_TOKEN_WORD= 1, + FT_TOKEN_LEFT_PAREN= 2, + FT_TOKEN_RIGHT_PAREN= 3, + FT_TOKEN_STOPWORD= 4 +}; + +/* + This structure is used in boolean search mode only. It conveys + boolean-mode metadata to the MySQL search engine for every word in + the search query. A valid instance of this structure must be filled + in by the plugin parser and passed as an argument in the call to + mysql_add_word (the callback function in the MYSQL_FTPARSER_PARAM + structure) when a query is parsed in boolean mode. + + type: The token type. Should be one of the enum_ft_token_type values. + + yesno: Whether the word must be present for a match to occur: + >0 Must be present + <0 Must not be present + 0 Neither; the word is optional but its presence increases the relevance + With the default settings of the ft_boolean_syntax system variable, + >0 corresponds to the '+' operator, <0 corrresponds to the '-' operator, + and 0 means neither operator was used. + + weight_adjust: A weighting factor that determines how much a match + for the word counts. Positive values increase, negative - decrease the + relative word's importance in the query. + + wasign: The sign of the word's weight in the query. If it's non-negative + the match for the word will increase document relevance, if it's + negative - decrease (the word becomes a "noise word", the less of it the + better). + + trunc: Corresponds to the '*' operator in the default setting of the + ft_boolean_syntax system variable. +*/ + +typedef struct st_mysql_ftparser_boolean_info +{ + enum enum_ft_token_type type; + int yesno; + int weight_adjust; + char wasign; + char trunc; + /* These are parser state and must be removed. */ + char prev; + char *quot; +} MYSQL_FTPARSER_BOOLEAN_INFO; + +/* + The following flag means that buffer with a string (document, word) + may be overwritten by the caller before the end of the parsing (that is + before st_mysql_ftparser::deinit() call). If one needs the string + to survive between two successive calls of the parsing function, she + needs to save a copy of it. The flag may be set by MySQL before calling + st_mysql_ftparser::parse(), or it may be set by a plugin before calling + st_mysql_ftparser_param::mysql_parse() or + st_mysql_ftparser_param::mysql_add_word(). +*/ +#define MYSQL_FTFLAGS_NEED_COPY 1 + +/* + An argument of the full-text parser plugin. This structure is + filled in by MySQL server and passed to the parsing function of the + plugin as an in/out parameter. + + mysql_parse: A pointer to the built-in parser implementation of the + server. It's set by the server and can be used by the parser plugin + to invoke the MySQL default parser. If plugin's role is to extract + textual data from .doc, .pdf or .xml content, it might extract + plaintext from the content, and then pass the text to the default + MySQL parser to be parsed. + + mysql_add_word: A server callback to add a new word. When parsing + a document, the server sets this to point at a function that adds + the word to MySQL full-text index. When parsing a search query, + this function will add the new word to the list of words to search + for. The boolean_info argument can be NULL for all cases except + when mode is MYSQL_FTPARSER_FULL_BOOLEAN_INFO. + + ftparser_state: A generic pointer. The plugin can set it to point + to information to be used internally for its own purposes. + + mysql_ftparam: This is set by the server. It is used by MySQL functions + called via mysql_parse() and mysql_add_word() callback. The plugin + should not modify it. + + cs: Information about the character set of the document or query string. + + doc: A pointer to the document or query string to be parsed. + + length: Length of the document or query string, in bytes. + + flags: See MYSQL_FTFLAGS_* constants above. + + mode: The parsing mode. With boolean operators, with stopwords, or + nothing. See enum_ftparser_mode above. +*/ + +typedef struct st_mysql_ftparser_param +{ + int (*mysql_parse)(struct st_mysql_ftparser_param *, + char *doc, int doc_len); + int (*mysql_add_word)(struct st_mysql_ftparser_param *, + char *word, int word_len, + MYSQL_FTPARSER_BOOLEAN_INFO *boolean_info); + void *ftparser_state; + void *mysql_ftparam; + struct charset_info_st *cs; + char *doc; + int length; + int flags; + enum enum_ftparser_mode mode; +} MYSQL_FTPARSER_PARAM; + +/* + Full-text parser descriptor. + + interface_version is, e.g., MYSQL_FTPARSER_INTERFACE_VERSION. + The parsing, initialization, and deinitialization functions are + invoked per SQL statement for which the parser is used. +*/ + +struct st_mysql_ftparser +{ + int interface_version; + int (*parse)(MYSQL_FTPARSER_PARAM *param); + int (*init)(MYSQL_FTPARSER_PARAM *param); + int (*deinit)(MYSQL_FTPARSER_PARAM *param); +}; + + +#endif + diff --git a/dep/mysqllite/include/sql_common.h b/dep/mysqllite/include/sql_common.h index 9e43d076ba933..a9a3168b69168 100644 --- a/dep/mysqllite/include/sql_common.h +++ b/dep/mysqllite/include/sql_common.h @@ -1,3 +1,6 @@ +#ifndef SQL_COMMON_INCLUDED +#define SQL_COMMON_INCLUDED + /* Copyright (C) 2003-2004, 2006 MySQL AB This program is free software; you can redistribute it and/or modify @@ -13,14 +16,60 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#define SQL_COMMON_INCLUDED + +#ifdef __cplusplus +extern "C" { +#endif + +#include extern const char *unknown_sqlstate; extern const char *cant_connect_sqlstate; extern const char *not_error_sqlstate; -#ifdef __cplusplus -extern "C" { +struct st_mysql_options_extention { + char *plugin_dir; + char *default_auth; +}; + +typedef struct st_mysql_methods +{ + my_bool (*read_query_result)(MYSQL *mysql); + my_bool (*advanced_command)(MYSQL *mysql, + 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); + 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, my_bool flush_all_results); + int (*read_change_user_result)(MYSQL *mysql); +#if !defined(MYSQL_SERVER) || defined(EMBEDDED_LIBRARY) + MYSQL_FIELD * (*list_fields)(MYSQL *mysql); + my_bool (*read_prepare_result)(MYSQL *mysql, MYSQL_STMT *stmt); + int (*stmt_execute)(MYSQL_STMT *stmt); + int (*read_binary_rows)(MYSQL_STMT *stmt); + int (*unbuffered_fetch)(MYSQL *mysql, char **row); + void (*free_embedded_thd)(MYSQL *mysql); + const char *(*read_statistics)(MYSQL *mysql); + my_bool (*next_result)(MYSQL *mysql); + int (*read_rows_from_cursor)(MYSQL_STMT *stmt); #endif +} MYSQL_METHODS; + +#define simple_command(mysql, command, arg, length, skip_check) \ + (*(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, 0, \ + 0, arg, length, 1, stmt) extern CHARSET_INFO *default_client_charset_info; MYSQL_FIELD *unpack_fields(MYSQL_DATA *data,MEM_ROOT *alloc,uint fields, @@ -42,9 +91,23 @@ 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); +void set_mysql_extended_error(MYSQL *mysql, int errcode, const char *sqlstate, + const char *format, ...); + +/* client side of the pluggable authentication */ +struct st_plugin_vio_info; +void mpvio_info(Vio *vio, struct st_plugin_vio_info *info); +int run_plugin_auth(MYSQL *mysql, char *data, uint data_len, + const char *data_plugin, const char *db); +int mysql_client_plugin_init(); +void mysql_client_plugin_deinit(); +struct st_mysql_client_plugin; +extern struct st_mysql_client_plugin *mysql_client_builtins[]; + #ifdef __cplusplus } #endif #define protocol_41(A) ((A)->server_capabilities & CLIENT_PROTOCOL_41) +#endif /* SQL_COMMON_INCLUDED */ diff --git a/dep/mysqllite/include/sql_state.h b/dep/mysqllite/include/sql_state.h index f14b1cf59c2ff..edd6f694bd96d 100644 --- a/dep/mysqllite/include/sql_state.h +++ b/dep/mysqllite/include/sql_state.h @@ -209,3 +209,12 @@ { ER_XA_RBTIMEOUT ,"XA106", "" }, { ER_XA_RBDEADLOCK ,"XA102", "" }, { ER_FUNC_INEXISTENT_NAME_COLLISION ,"42000", "" }, +{ ER_DUP_SIGNAL_SET ,"42000", "" }, +{ ER_SIGNAL_WARN ,"01000", "" }, +{ ER_SIGNAL_NOT_FOUND ,"02000", "" }, +{ ER_SIGNAL_EXCEPTION ,"HY000", "" }, +{ ER_RESIGNAL_WITHOUT_ACTIVE_HANDLER ,"0K000", "" }, +{ ER_SPATIAL_MUST_HAVE_GEOM_COL ,"42000", "" }, +{ ER_DATA_OUT_OF_RANGE ,"22003", "" }, +{ ER_ACCESS_DENIED_NO_PASSWORD_ERROR ,"28000", "" }, +{ ER_TRUNCATE_ILLEGAL_FK ,"42000", "" }, diff --git a/dep/mysqllite/include/sslopt-case.h b/dep/mysqllite/include/sslopt-case.h index adb9a28503bde..3b64a225fe209 100644 --- a/dep/mysqllite/include/sslopt-case.h +++ b/dep/mysqllite/include/sslopt-case.h @@ -1,3 +1,6 @@ +#ifndef SSLOPT_CASE_INCLUDED +#define SSLOPT_CASE_INCLUDED + /* Copyright (C) 2000 MySQL AB This program is free software; you can redistribute it and/or modify @@ -13,7 +16,7 @@ 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_OPENSSL +#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY) case OPT_SSL_KEY: case OPT_SSL_CERT: case OPT_SSL_CA: @@ -26,3 +29,4 @@ opt_use_ssl= 1; break; #endif +#endif /* SSLOPT_CASE_INCLUDED */ diff --git a/dep/mysqllite/include/sslopt-longopts.h b/dep/mysqllite/include/sslopt-longopts.h index c038ece16449d..5315b2e12b142 100644 --- a/dep/mysqllite/include/sslopt-longopts.h +++ b/dep/mysqllite/include/sslopt-longopts.h @@ -1,3 +1,6 @@ +#ifndef SSLOPT_LONGOPTS_INCLUDED +#define SSLOPT_LONGOPTS_INCLUDED + /* Copyright (C) 2000 MySQL AB This program is free software; you can redistribute it and/or modify @@ -13,12 +16,11 @@ 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_OPENSSL +#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY) {"ssl", OPT_SSL_SSL, - "Enable SSL for connection (automatically enabled with other flags)." - "Disable with --skip-ssl.", &opt_use_ssl, &opt_use_ssl, 0, GET_BOOL, - NO_ARG, 0, 0, 0, 0, 0, 0}, + "Enable SSL for connection (automatically enabled with other flags).", + &opt_use_ssl, &opt_use_ssl, 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0}, {"ssl-ca", OPT_SSL_CA, "CA file in PEM format (check OpenSSL docs, implies --ssl).", &opt_ssl_ca, &opt_ssl_ca, 0, GET_STR, REQUIRED_ARG, @@ -41,6 +43,7 @@ "Verify server's \"Common Name\" in its cert against hostname used " "when connecting. This option is disabled by default.", &opt_ssl_verify_server_cert, &opt_ssl_verify_server_cert, - 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0}, #endif #endif /* HAVE_OPENSSL */ +#endif /* SSLOPT_LONGOPTS_INCLUDED */ diff --git a/dep/mysqllite/include/sslopt-vars.h b/dep/mysqllite/include/sslopt-vars.h index 3369f870db2a2..d0eec3b6d7431 100644 --- a/dep/mysqllite/include/sslopt-vars.h +++ b/dep/mysqllite/include/sslopt-vars.h @@ -1,3 +1,6 @@ +#ifndef SSLOPT_VARS_INCLUDED +#define SSLOPT_VARS_INCLUDED + /* Copyright (C) 2000 MySQL AB This program is free software; you can redistribute it and/or modify @@ -13,7 +16,7 @@ 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_OPENSSL +#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY) #ifdef SSL_VARS_NOT_STATIC #define SSL_STATIC #else @@ -29,3 +32,4 @@ SSL_STATIC char *opt_ssl_key = 0; SSL_STATIC my_bool opt_ssl_verify_server_cert= 0; #endif #endif +#endif /* SSLOPT_VARS_INCLUDED */ diff --git a/dep/mysqllite/include/typelib.h b/dep/mysqllite/include/typelib.h index 46106d1bdab2d..3badb14c96eed 100644 --- a/dep/mysqllite/include/typelib.h +++ b/dep/mysqllite/include/typelib.h @@ -36,4 +36,9 @@ extern TYPELIB *copy_typelib(MEM_ROOT *root, TYPELIB *from); extern TYPELIB sql_protocol_typelib; +my_ulonglong find_set_from_flags(const TYPELIB *lib, unsigned int default_name, + my_ulonglong cur_set, my_ulonglong default_set, + const char *str, unsigned int length, + char **err_pos, unsigned int *err_len); + #endif /* _typelib_h */ diff --git a/dep/mysqllite/libmysql/client_settings.h b/dep/mysqllite/libmysql/client_settings.h index f87e625771f8e..c5a08ce1fcc32 100644 --- a/dep/mysqllite/libmysql/client_settings.h +++ b/dep/mysqllite/libmysql/client_settings.h @@ -13,32 +13,28 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#ifndef CLIENT_SETTINGS_INCLUDED +#define CLIENT_SETTINGS_INCLUDED +#else +#error You have already included an client_settings.h and it should not be included twice +#endif /* CLIENT_SETTINGS_INCLUDED */ + 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) +#define CLIENT_CAPABILITIES (CLIENT_LONG_PASSWORD | \ + CLIENT_LONG_FLAG | \ + CLIENT_TRANSACTIONS | \ + CLIENT_PROTOCOL_41 | \ + CLIENT_SECURE_CONNECTION | \ + CLIENT_MULTI_RESULTS | \ + CLIENT_PS_MULTI_RESULTS | \ + CLIENT_PLUGIN_AUTH) 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); @@ -57,7 +53,7 @@ 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); +int cli_read_change_user_result(MYSQL *mysql); #ifdef EMBEDDED_LIBRARY int init_embedded_server(int argc, char **argv, char **groups); diff --git a/dep/mysqllite/libmysql/dll.c b/dep/mysqllite/libmysql/dll.c deleted file mode 100644 index 8fcf41c792c07..0000000000000 --- a/dep/mysqllite/libmysql/dll.c +++ /dev/null @@ -1,125 +0,0 @@ -/* 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 */ - -/* -** Handling initialization of the dll library -*/ - -#include -#include -#include - -static my_bool libmysql_inited=0; - -void libmysql_init(void) -{ - if (libmysql_inited) - return; - libmysql_inited=1; - my_init(); - { - DBUG_ENTER("libmysql_init"); -#ifdef LOG_ALL - DBUG_PUSH("d:t:S:O,c::\\tmp\\libmysql.log"); -#else - if (getenv("LIBMYSQL_LOG") != NULL) - DBUG_PUSH(getenv("LIBMYSQL_LOG")); -#endif - DBUG_VOID_RETURN; - } -} - -#ifdef __WIN__ - -static int inited=0,threads=0; -HINSTANCE NEAR s_hModule; /* Saved module handle */ -DWORD main_thread; - -BOOL APIENTRY LibMain(HANDLE hInst,DWORD ul_reason_being_called, - LPVOID lpReserved) -{ - switch (ul_reason_being_called) { - case DLL_PROCESS_ATTACH: /* case of libentry call in win 3.x */ - if (!inited++) - { - s_hModule=hInst; - libmysql_init(); - main_thread=GetCurrentThreadId(); - } - break; - case DLL_THREAD_ATTACH: - threads++; - my_thread_init(); - break; - case DLL_PROCESS_DETACH: /* case of wep call in win 3.x */ - if (!--inited) /* Safety */ - { - /* my_thread_init() */ /* This may give extra safety */ - my_end(0); - } - break; - case DLL_THREAD_DETACH: - /* Main thread will free by my_end() */ - threads--; - if (main_thread != GetCurrentThreadId()) - my_thread_end(); - break; - default: - break; - } /* switch */ - - return TRUE; - - UNREFERENCED_PARAMETER(lpReserved); -} /* LibMain */ - - -static BOOL do_libmain; -int __stdcall DllMain(HANDLE hInst,DWORD ul_reason_being_called,LPVOID lpReserved) -{ - /* - Unless environment variable LIBMYSQL_DLLINIT is set, do nothing. - The environment variable is checked once, during the first call to DllMain() - (in DLL_PROCESS_ATTACH hook). - */ - if (ul_reason_being_called == DLL_PROCESS_ATTACH) - do_libmain = (getenv("LIBMYSQL_DLLINIT") != NULL); - if (do_libmain) - return LibMain(hInst,ul_reason_being_called,lpReserved); - return TRUE; -} - -#elif defined(WINDOWS) - -/**************************************************************************** -** This routine is called by LIBSTART.ASM at module load time. All it -** does in this sample is remember the DLL module handle. The module -** handle is needed if you want to do things like load stuff from the -** resource file (for instance string resources). -****************************************************************************/ - -int _export FAR PASCAL libmain(HANDLE hModule,short cbHeapSize, - UCHAR FAR *lszCmdLine) -{ - s_hModule = hModule; - libmysql_init(); - return TRUE; -} - -#endif diff --git a/dep/mysqllite/libmysql/errmsg.c b/dep/mysqllite/libmysql/errmsg.c index 95ee6862aa873..b99b3f2de303a 100644 --- a/dep/mysqllite/libmysql/errmsg.c +++ b/dep/mysqllite/libmysql/errmsg.c @@ -5,8 +5,7 @@ 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. + is applied to this software. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -24,137 +23,6 @@ #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", - "" -}; - -/* 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", - "" -}; - -#else /* ENGLISH */ const char *client_errors[]= { "Unknown MySQL error", @@ -215,10 +83,15 @@ const char *client_errors[]= "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.", + "Authentication plugin '%s' cannot be loaded: %s", "" }; -#endif +const char** get_client_errmsgs() +{ + return client_errors; +} /* Register client error messages for use with my_error(). @@ -232,7 +105,7 @@ const char *client_errors[]= void init_client_errs(void) { - (void) my_error_register(client_errors, CR_ERROR_FIRST, CR_ERROR_LAST); + (void) my_error_register(get_client_errmsgs, CR_ERROR_FIRST, CR_ERROR_LAST); } diff --git a/dep/mysqllite/libmysql/get_password.c b/dep/mysqllite/libmysql/get_password.c index cbe5fce694949..455b4b3c8f197 100644 --- a/dep/mysqllite/libmysql/get_password.c +++ b/dep/mysqllite/libmysql/get_password.c @@ -5,8 +5,7 @@ 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. + is applied to this software. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -36,7 +35,7 @@ #include #endif /* HAVE_PWD_H */ #else /* ! HAVE_GETPASS */ -#if !defined(__WIN__) && !defined(__NETWARE__) +#if !defined(__WIN__) #include #ifdef HAVE_TERMIOS_H /* For tty-password */ #include @@ -55,9 +54,7 @@ #include #endif #else -#ifndef __NETWARE__ #include -#endif /* __NETWARE__ */ #endif /* __WIN__ */ #endif /* HAVE_GETPASS */ @@ -65,16 +62,8 @@ #define getpass(A) getpassphrase(A) #endif -#if defined( __WIN__) || defined(__NETWARE__) +#if defined(__WIN__) /* 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]; diff --git a/dep/mysqllite/libmysql/libmysql.c b/dep/mysqllite/libmysql/libmysql.c index 362ad5de6c4fb..f802387cf9a1a 100644 --- a/dep/mysqllite/libmysql/libmysql.c +++ b/dep/mysqllite/libmysql/libmysql.c @@ -5,8 +5,7 @@ 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. + is applied to this software. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -34,7 +33,7 @@ #ifdef HAVE_PWD_H #include #endif -#if !defined(MSDOS) && !defined(__WIN__) +#if !defined(__WIN__) #include #include #include @@ -45,14 +44,14 @@ #ifdef HAVE_SYS_SELECT_H #include #endif -#endif /* !defined(MSDOS) && !defined(__WIN__) */ +#endif /* !defined(__WIN__) */ #ifdef HAVE_POLL #include #endif #ifdef HAVE_SYS_UN_H #include #endif -#if defined(THREAD) && !defined(__WIN__) +#if !defined(__WIN__) #include /* because of signal() */ #endif #ifndef INADDR_NONE @@ -74,7 +73,7 @@ ulong max_allowed_packet= 1024L*1024L*1024L; my_bool net_flush(NET *net); #endif -#if defined(MSDOS) || defined(__WIN__) +#if defined(__WIN__) /* socket_errno is defined in my_global.h for all platforms */ #define perror(A) #else @@ -126,33 +125,33 @@ int STDCALL mysql_server_init(int argc __attribute__((unused)), if (my_init()) /* Will init threads */ return 1; init_client_errs(); + if (mysql_client_plugin_init()) + return 1; if (!mysql_port) { + char *env; + struct servent *serv_ptr __attribute__((unused)); + 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 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); - } + 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); } + if (!mysql_unix_port) { char *env; @@ -165,7 +164,7 @@ int STDCALL mysql_server_init(int argc __attribute__((unused)), mysql_unix_port = env; } mysql_debug(NullS); -#if defined(SIGPIPE) && !defined(__WIN__) && !defined(__NETWARE__) +#if defined(SIGPIPE) && !defined(__WIN__) (void) signal(SIGPIPE, SIG_IGN); #endif #ifdef EMBEDDED_LIBRARY @@ -173,10 +172,8 @@ int STDCALL mysql_server_init(int argc __attribute__((unused)), result= init_embedded_server(argc, argv, groups); #endif } -#ifdef THREAD else result= (int)my_thread_init(); /* Init if new thread */ -#endif return result; } @@ -198,6 +195,8 @@ void STDCALL mysql_server_end() if (!mysql_client_init) return; + mysql_client_plugin_deinit(); + #ifdef EMBEDDED_LIBRARY end_embedded_server(); #endif @@ -216,13 +215,6 @@ void STDCALL mysql_server_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= @@ -235,30 +227,14 @@ MYSQL_PARAMETERS *STDCALL mysql_get_parameters(void) 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 } -/* - 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. -*/ -static MYSQL* spawn_init(MYSQL* parent, const char* host, - unsigned int port, - const char* user, - const char* passwd); - - /* Expand wildcard to a sql string @@ -320,7 +296,7 @@ mysql_debug(const char *debug __attribute__((unused))) /************************************************************************** - Close the server connection if we get a SIGPIPE + Ignore SIGPIPE handler ARGSUSED **************************************************************************/ @@ -333,305 +309,6 @@ my_pipe_sig_handler(int sig __attribute__((unused))) #endif } -/* perform query on master */ -my_bool STDCALL mysql_master_query(MYSQL *mysql, const char *q, - unsigned long length) -{ - DBUG_ENTER("mysql_master_query"); - if (mysql_master_send_query(mysql, q, length)) - DBUG_RETURN(1); - DBUG_RETURN((*mysql->methods->read_query_result)(mysql)); -} - -my_bool STDCALL mysql_master_send_query(MYSQL *mysql, const char *q, - unsigned long length) -{ - MYSQL *master = mysql->master; - DBUG_ENTER("mysql_master_send_query"); - if (!master->net.vio && !mysql_real_connect(master,0,0,0,0,0,0,0)) - DBUG_RETURN(1); - master->reconnect= 1; - mysql->last_used_con = master; - DBUG_RETURN(simple_command(master, COM_QUERY, (const uchar*) q, length, 1)); -} - - -/* perform query on slave */ -my_bool STDCALL mysql_slave_query(MYSQL *mysql, const char *q, - unsigned long length) -{ - DBUG_ENTER("mysql_slave_query"); - if (mysql_slave_send_query(mysql, q, length)) - DBUG_RETURN(1); - DBUG_RETURN((*mysql->methods->read_query_result)(mysql)); -} - - -my_bool STDCALL mysql_slave_send_query(MYSQL *mysql, const char *q, - unsigned long length) -{ - MYSQL* last_used_slave, *slave_to_use = 0; - DBUG_ENTER("mysql_slave_send_query"); - - if ((last_used_slave = mysql->last_used_slave)) - slave_to_use = last_used_slave->next_slave; - else - slave_to_use = mysql->next_slave; - /* - Next_slave is always safe to use - we have a circular list of slaves - if there are no slaves, mysql->next_slave == mysql - */ - mysql->last_used_con = mysql->last_used_slave = slave_to_use; - if (!slave_to_use->net.vio && !mysql_real_connect(slave_to_use, 0,0,0, - 0,0,0,0)) - DBUG_RETURN(1); - slave_to_use->reconnect= 1; - DBUG_RETURN(simple_command(slave_to_use, COM_QUERY, (const uchar*) q, - length, 1)); -} - - -/* enable/disable parsing of all queries to decide - if they go on master or slave */ -void STDCALL mysql_enable_rpl_parse(MYSQL* mysql) -{ - mysql->options.rpl_parse = 1; -} - -void STDCALL mysql_disable_rpl_parse(MYSQL* mysql) -{ - mysql->options.rpl_parse = 0; -} - -/* get the value of the parse flag */ -int STDCALL mysql_rpl_parse_enabled(MYSQL* mysql) -{ - return mysql->options.rpl_parse; -} - -/* enable/disable reads from master */ -void STDCALL mysql_enable_reads_from_master(MYSQL* mysql) -{ - mysql->options.no_master_reads = 0; -} - -void STDCALL mysql_disable_reads_from_master(MYSQL* mysql) -{ - mysql->options.no_master_reads = 1; -} - -/* get the value of the master read flag */ -my_bool STDCALL mysql_reads_from_master_enabled(MYSQL* mysql) -{ - return !(mysql->options.no_master_reads); -} - - -/* - We may get an error while doing replication internals. - In this case, we add a special explanation to the original - error -*/ - -static void expand_error(MYSQL* mysql, int error) -{ - char tmp[MYSQL_ERRMSG_SIZE]; - char *p; - uint err_length; - strmake(tmp, mysql->net.last_error, MYSQL_ERRMSG_SIZE-1); - p = strmake(mysql->net.last_error, ER(error), MYSQL_ERRMSG_SIZE-1); - err_length= (uint) (p - mysql->net.last_error); - strmake(p, tmp, MYSQL_ERRMSG_SIZE-1 - err_length); - mysql->net.last_errno = error; -} - -/* - This function assumes we have just called SHOW SLAVE STATUS and have - read the given result and row -*/ - -static my_bool get_master(MYSQL* mysql, MYSQL_RES* res, MYSQL_ROW row) -{ - MYSQL* master; - DBUG_ENTER("get_master"); - if (mysql_num_fields(res) < 3) - DBUG_RETURN(1); /* safety */ - - /* use the same username and password as the original connection */ - if (!(master = spawn_init(mysql, row[0], atoi(row[2]), 0, 0))) - DBUG_RETURN(1); - mysql->master = master; - DBUG_RETURN(0); -} - - -/* - Assuming we already know that mysql points to a master connection, - retrieve all the slaves -*/ - -static my_bool get_slaves_from_master(MYSQL* mysql) -{ - MYSQL_RES* res = 0; - MYSQL_ROW row; - my_bool error = 1; - int has_auth_info; - int port_ind; - DBUG_ENTER("get_slaves_from_master"); - - if (!mysql->net.vio && !mysql_real_connect(mysql,0,0,0,0,0,0,0)) - { - expand_error(mysql, CR_PROBE_MASTER_CONNECT); - DBUG_RETURN(1); - } - mysql->reconnect= 1; - - if (mysql_query(mysql, "SHOW SLAVE HOSTS") || - !(res = mysql_store_result(mysql))) - { - expand_error(mysql, CR_PROBE_SLAVE_HOSTS); - DBUG_RETURN(1); - } - - switch (mysql_num_fields(res)) { - case 5: - has_auth_info = 0; - port_ind=2; - break; - case 7: - has_auth_info = 1; - port_ind=4; - break; - default: - goto err; - } - - while ((row = mysql_fetch_row(res))) - { - MYSQL* slave; - const char* tmp_user, *tmp_pass; - - if (has_auth_info) - { - tmp_user = row[2]; - tmp_pass = row[3]; - } - else - { - tmp_user = mysql->user; - tmp_pass = mysql->passwd; - } - - if (!(slave = spawn_init(mysql, row[1], atoi(row[port_ind]), - tmp_user, tmp_pass))) - goto err; - - /* Now add slave into the circular linked list */ - slave->next_slave = mysql->next_slave; - mysql->next_slave = slave; - } - error = 0; -err: - if (res) - mysql_free_result(res); - DBUG_RETURN(error); -} - - -my_bool STDCALL mysql_rpl_probe(MYSQL* mysql) -{ - MYSQL_RES *res= 0; - MYSQL_ROW row; - my_bool error= 1; - DBUG_ENTER("mysql_rpl_probe"); - - /* - First determine the replication role of the server we connected to - the most reliable way to do this is to run SHOW SLAVE STATUS and see - if we have a non-empty master host. This is still not fool-proof - - it is not a sin to have a master that has a dormant slave thread with - a non-empty master host. However, it is more reliable to check - for empty master than whether the slave thread is actually running - */ - if (mysql_query(mysql, "SHOW SLAVE STATUS") || - !(res = mysql_store_result(mysql))) - { - expand_error(mysql, CR_PROBE_SLAVE_STATUS); - DBUG_RETURN(1); - } - - row= mysql_fetch_row(res); - /* - Check master host for emptiness/NULL - For MySQL 4.0 it's enough to check for row[0] - */ - if (row && row[0] && *(row[0])) - { - /* this is a slave, ask it for the master */ - if (get_master(mysql, res, row) || get_slaves_from_master(mysql)) - goto err; - } - else - { - mysql->master = mysql; - if (get_slaves_from_master(mysql)) - goto err; - } - - error = 0; -err: - if (res) - mysql_free_result(res); - DBUG_RETURN(error); -} - - -/* - Make a not so fool-proof decision on where the query should go, to - the master or the slave. Ideally the user should always make this - decision himself with mysql_master_query() or mysql_slave_query(). - However, to be able to more easily port the old code, we support the - option of an educated guess - this should work for most applications, - however, it may make the wrong decision in some particular cases. If - that happens, the user would have to change the code to call - mysql_master_query() or mysql_slave_query() explicitly in the place - where we have made the wrong decision -*/ - -enum mysql_rpl_type -STDCALL mysql_rpl_query_type(const char* q, int len) -{ - const char *q_end= q + len; - for (; q < q_end; ++q) - { - char c; - if (my_isalpha(&my_charset_latin1, (c= *q))) - { - switch (my_tolower(&my_charset_latin1,c)) { - case 'i': /* insert */ - case 'u': /* update or unlock tables */ - case 'l': /* lock tables or load data infile */ - case 'd': /* drop or delete */ - case 'a': /* alter */ - return MYSQL_RPL_MASTER; - case 'c': /* create or check */ - return my_tolower(&my_charset_latin1,q[1]) == 'h' ? MYSQL_RPL_ADMIN : - MYSQL_RPL_MASTER; - case 's': /* select or show */ - return my_tolower(&my_charset_latin1,q[1]) == 'h' ? MYSQL_RPL_ADMIN : - MYSQL_RPL_SLAVE; - case 'f': /* flush */ - case 'r': /* repair */ - case 'g': /* grant */ - return MYSQL_RPL_ADMIN; - default: - return MYSQL_RPL_SLAVE; - } - } - } - return MYSQL_RPL_MASTER; /* By default, send to master */ -} - /************************************************************************** Connect to sql server @@ -650,7 +327,7 @@ mysql_connect(MYSQL *mysql,const char *host, if (!(res=mysql_real_connect(mysql,host,user,passwd,NullS,0,NullS,0))) { if (mysql->free_me) - my_free((uchar*) mysql,MYF(0)); + my_free(mysql); } mysql->reconnect= 1; DBUG_RETURN(res); @@ -663,44 +340,14 @@ mysql_connect(MYSQL *mysql,const char *host, 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; + char *saved_user= mysql->user; + char *saved_passwd= mysql->passwd; + char *saved_db= mysql->db; DBUG_ENTER("mysql_change_user"); @@ -714,49 +361,11 @@ my_bool STDCALL mysql_change_user(MYSQL *mysql, const char *user, /* Use an empty string instead of NULL. */ - if (!user) - user=""; - if (!passwd) - passwd=""; - - /* - Store user into the buffer. - Advance position as strmake returns a pointer to the closing NUL. - */ - 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) - { - int2store(end, (ushort) mysql->charset->number); - end+= 2; - } - - /* Write authentication package */ - simple_command(mysql,COM_CHANGE_USER, (uchar*) buff, (ulong) (end-buff), 1); + mysql->user= (char*)(user ? user : ""); + mysql->passwd= (char*)(passwd ? passwd : ""); + mysql->db= 0; - rc= (*mysql->methods->read_change_user_result)(mysql, buff, passwd); + rc= run_plugin_auth(mysql, 0, 0, 0, db); /* The server will close all statements no matter was the attempt @@ -766,18 +375,21 @@ my_bool STDCALL mysql_change_user(MYSQL *mysql, const char *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)); + my_free(saved_user); + my_free(saved_passwd); + my_free(saved_db); /* 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; + mysql->user= my_strdup(mysql->user, MYF(MY_WME)); + mysql->passwd= my_strdup(mysql->passwd, MYF(MY_WME)); + mysql->db= db ? my_strdup(db, MYF(MY_WME)) : 0; } else { mysql->charset= saved_cs; + mysql->user= saved_user; + mysql->passwd= saved_passwd; + mysql->db= saved_db; } DBUG_RETURN(rc); @@ -788,15 +400,7 @@ 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__) +#if !defined(__WIN__) void read_user_name(char *name) { @@ -826,7 +430,7 @@ void read_user_name(char *name) DBUG_VOID_RETURN; } -#else /* If MSDOS || VMS */ +#else /* If Windows */ void read_user_name(char *name) { @@ -868,7 +472,7 @@ my_bool handle_local_infile(MYSQL *mysql, const char *net_filename) 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 */ + (void) my_net_write(net,(const uchar*) "",0); /* Server needs one packet */ net_flush(net); strmov(net->sqlstate, unknown_sqlstate); net->last_errno= @@ -913,7 +517,7 @@ my_bool handle_local_infile(MYSQL *mysql, const char *net_filename) err: /* free up memory allocated with _init, usually */ (*options->local_infile_end)(li_ptr); - my_free(buf, MYF(0)); + my_free(buf); DBUG_RETURN(result); } @@ -1024,7 +628,7 @@ static void default_local_infile_end(void *ptr) { if (data->fd >= 0) my_close(data->fd, MYF(MY_WME)); - my_free(ptr, MYF(MY_WME)); + my_free(ptr); } } @@ -1096,68 +700,6 @@ mysql_query(MYSQL *mysql, const char *query) } -static MYSQL* spawn_init(MYSQL* parent, const char* host, - unsigned int port, const char* user, - const char* passwd) -{ - MYSQL* child; - DBUG_ENTER("spawn_init"); - if (!(child= mysql_init(0))) - DBUG_RETURN(0); - - child->options.user= my_strdup((user) ? user : - (parent->user ? parent->user : - parent->options.user), MYF(0)); - child->options.password= my_strdup((passwd) ? passwd : - (parent->passwd ? - parent->passwd : - parent->options.password), MYF(0)); - child->options.port= port; - child->options.host= my_strdup((host) ? host : - (parent->host ? - parent->host : - parent->options.host), MYF(0)); - if (parent->db) - child->options.db= my_strdup(parent->db, MYF(0)); - else if (parent->options.db) - child->options.db= my_strdup(parent->options.db, MYF(0)); - - /* - rpl_pivot is set to 1 in mysql_init(); Reset it as we are not doing - replication here - */ - child->rpl_pivot= 0; - DBUG_RETURN(child); -} - - -int -STDCALL mysql_set_master(MYSQL* mysql, const char* host, - unsigned int port, const char* user, - const char* passwd) -{ - if (mysql->master != mysql && !mysql->master->rpl_pivot) - mysql_close(mysql->master); - if (!(mysql->master = spawn_init(mysql, host, port, user, passwd))) - return 1; - return 0; -} - - -int -STDCALL mysql_add_slave(MYSQL* mysql, const char* host, - unsigned int port, - const char* user, - const char* passwd) -{ - MYSQL* slave; - if (!(slave = spawn_init(mysql, host, port, user, passwd))) - return 1; - slave->next_slave = mysql->next_slave; - mysql->next_slave = slave; - return 0; -} - /************************************************************************** Return next field of the query results **************************************************************************/ @@ -1486,17 +1028,17 @@ MYSQL_FIELD_OFFSET STDCALL mysql_field_tell(MYSQL_RES *res) unsigned int STDCALL mysql_field_count(MYSQL *mysql) { - return mysql->last_used_con->field_count; + return mysql->field_count; } my_ulonglong STDCALL mysql_affected_rows(MYSQL *mysql) { - return mysql->last_used_con->affected_rows; + return mysql->affected_rows; } my_ulonglong STDCALL mysql_insert_id(MYSQL *mysql) { - return mysql->last_used_con->insert_id; + return mysql->insert_id; } const char *STDCALL mysql_sqlstate(MYSQL *mysql) @@ -1542,11 +1084,7 @@ void STDCALL mysql_get_character_set_info(MYSQL *mysql, MY_CHARSET_INFO *csinfo) uint STDCALL mysql_thread_safe(void) { -#ifdef THREAD return 1; -#else - return 0; -#endif } @@ -1861,7 +1399,6 @@ my_bool cli_read_prepare_result(MYSQL *mysql, MYSQL_STMT *stmt) MYSQL_DATA *fields_data; DBUG_ENTER("cli_read_prepare_result"); - mysql= mysql->last_used_con; if ((packet_length= cli_safe_read(mysql)) == packet_error) DBUG_RETURN(1); mysql->warning_count= 0; @@ -2095,7 +1632,9 @@ static void alloc_stmt_fields(MYSQL_STMT *stmt) { MYSQL_FIELD *fields, *field, *end; MEM_ROOT *alloc= &stmt->mem_root; - MYSQL *mysql= stmt->mysql->last_used_con; + MYSQL *mysql= stmt->mysql; + + DBUG_ASSERT(mysql->field_count); stmt->field_count= mysql->field_count; @@ -2118,18 +1657,21 @@ static void alloc_stmt_fields(MYSQL_STMT *stmt) field= stmt->fields; field && fields < end; fields++, field++) { - field->db = strdup_root(alloc,fields->db); - field->table = strdup_root(alloc,fields->table); - field->org_table= strdup_root(alloc,fields->org_table); - field->name = strdup_root(alloc,fields->name); - field->org_name = strdup_root(alloc,fields->org_name); - field->charsetnr= fields->charsetnr; - field->length = fields->length; - field->type = fields->type; - field->flags = fields->flags; - field->decimals = fields->decimals; - field->def = fields->def ? strdup_root(alloc,fields->def): 0; - field->max_length= 0; + *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() */ } } @@ -2482,7 +2024,6 @@ static my_bool execute(MYSQL_STMT *stmt, char *packet, ulong length) DBUG_ENTER("execute"); DBUG_DUMP("packet", (uchar *) packet, length); - mysql->last_used_con= mysql; int4store(buff, stmt->stmt_id); /* Send stmt id to server */ buff[4]= (char) stmt->flags; int4store(buff+5, 1); /* iteration count */ @@ -2503,6 +2044,8 @@ static my_bool execute(MYSQL_STMT *stmt, char *packet, ulong length) set_stmt_errmsg(stmt, net); DBUG_RETURN(1); } + else if (mysql->status == MYSQL_STATUS_GET_RESULT) + stmt->mysql->status= MYSQL_STATUS_STATEMENT_GET_RESULT; DBUG_RETURN(0); } @@ -2579,7 +2122,7 @@ int cli_stmt_execute(MYSQL_STMT *stmt) } result= execute(stmt, param_data, length); stmt->send_types_to_server=0; - my_free(param_data, MYF(MY_WME)); + my_free(param_data); DBUG_RETURN(result); } DBUG_RETURN((int) execute(stmt,0,0)); @@ -2641,7 +2184,7 @@ static int stmt_read_row_unbuffered(MYSQL_STMT *stmt, unsigned char **row) set_stmt_error(stmt, CR_SERVER_LOST, unknown_sqlstate, NULL); return 1; } - if (mysql->status != MYSQL_STATUS_GET_RESULT) + if (mysql->status != MYSQL_STATUS_STATEMENT_GET_RESULT) { set_stmt_error(stmt, stmt->unbuffered_fetch_cancelled ? CR_FETCH_CANCELED : CR_COMMANDS_OUT_OF_SYNC, @@ -2867,6 +2410,33 @@ static void reinit_result_set_metadata(MYSQL_STMT *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. @@ -2934,28 +2504,7 @@ int STDCALL mysql_stmt_execute(MYSQL_STMT *stmt) if (mysql->field_count) { reinit_result_set_metadata(stmt); - if (stmt->server_status & SERVER_STATUS_CURSOR_EXISTS) - { - 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; - } + prepare_to_fetch_result(stmt); } DBUG_RETURN(test(stmt->last_errno)); } @@ -3753,12 +3302,13 @@ static void fetch_long_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field, param output buffer descriptor field column metadata value column data - width default number of significant digits used when converting - float/double to string + 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, int width) + double value, my_gcvt_arg_type type) { char *buffer= (char *)param->buffer; double val64 = (value < 0 ? -floor(-value) : floor(value)); @@ -3842,42 +3392,24 @@ static void fetch_float_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field, floating point -> string conversion nicely, honor all typecodes and param->offset possibly set in mysql_stmt_fetch_column */ - char buff[MAX_DOUBLE_STRING_REP_LENGTH]; - char *end; - /* TODO: move this to a header shared between client and server. */ -#define NOT_FIXED_DEC 31 + char buff[FLOATING_POINT_BUFFER]; + size_t len; if (field->decimals >= NOT_FIXED_DEC) -#undef NOT_FIXED_DEC - { - /* - DBL_DIG below is to ensure that the server and client has the same - precisions. This will ensure that on the same machine you get the - same value as a string independent of the protocol you use. - */ - sprintf(buff, "%-*.*g", (int) min(sizeof(buff)-1, - param->buffer_length), - min(DBL_DIG, width), value); - end= strcend(buff, ' '); - *end= 0; - } + len= my_gcvt(value, type, + (int) min(sizeof(buff)-1, param->buffer_length), + buff, NULL); else - { - sprintf(buff, "%.*f", (int) field->decimals, value); - end= strend(buff); - } + 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) { - size_t length= end - buff; - if (field->flags & ZEROFILL_FLAG && length < field->length && - field->length < MAX_DOUBLE_STRING_REP_LENGTH - 1) - { - bmove_upp((uchar*) buff + field->length, (uchar*) buff + length, - length); - bfill((char*) buff, field->length - length, '0'); - length= field->length; - } - fetch_string_with_conversion(param, buff, length); + 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; } @@ -3922,7 +3454,7 @@ static void fetch_datetime_with_conversion(MYSQL_BIND *param, { ulonglong value= TIME_to_ulonglong(my_time); fetch_float_with_conversion(param, field, - ulonglong2double(value), DBL_DIG); + ulonglong2double(value), MY_GCVT_ARG_DOUBLE); break; } case MYSQL_TYPE_TINY: @@ -4016,7 +3548,7 @@ static void fetch_result_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field, { float value; float4get(value,*row); - fetch_float_with_conversion(param, field, value, FLT_DIG); + fetch_float_with_conversion(param, field, value, MY_GCVT_ARG_FLOAT); *row+= 4; break; } @@ -4024,7 +3556,7 @@ static void fetch_result_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field, { double value; float8get(value,*row); - fetch_float_with_conversion(param, field, value, DBL_DIG); + fetch_float_with_conversion(param, field, value, MY_GCVT_ARG_DOUBLE); *row+= 8; break; } @@ -4707,7 +4239,6 @@ int cli_read_binary_rows(MYSQL_STMT *stmt) } net = &mysql->net; - mysql= mysql->last_used_con; while ((pkt_len= cli_safe_read(mysql)) != packet_error) { @@ -4805,8 +4336,6 @@ int STDCALL mysql_stmt_store_result(MYSQL_STMT *stmt) DBUG_RETURN(1); } - mysql= mysql->last_used_con; - if (!stmt->field_count) DBUG_RETURN(0); @@ -4847,7 +4376,7 @@ int STDCALL mysql_stmt_store_result(MYSQL_STMT *stmt) DBUG_RETURN(1); } } - else if (mysql->status != MYSQL_STATUS_GET_RESULT) + else if (mysql->status != MYSQL_STATUS_STATEMENT_GET_RESULT) { set_stmt_error(stmt, CR_COMMANDS_OUT_OF_SYNC, unknown_sqlstate, NULL); DBUG_RETURN(1); @@ -5013,7 +4542,7 @@ static my_bool reset_stmt_handle(MYSQL_STMT *stmt, uint flags) 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); + (*mysql->methods->flush_use_result)(mysql, FALSE); if (mysql->unbuffered_fetch_owner) *mysql->unbuffered_fetch_owner= TRUE; mysql->status= MYSQL_STATUS_READY; @@ -5097,7 +4626,7 @@ my_bool STDCALL mysql_stmt_close(MYSQL_STMT *stmt) Flush result set of the connection. If it does not belong to this statement, set a warning. */ - (*mysql->methods->flush_use_result)(mysql); + (*mysql->methods->flush_use_result)(mysql, TRUE); if (mysql->unbuffered_fetch_owner) *mysql->unbuffered_fetch_owner= TRUE; mysql->status= MYSQL_STATUS_READY; @@ -5110,7 +4639,7 @@ my_bool STDCALL mysql_stmt_close(MYSQL_STMT *stmt) } } - my_free((uchar*) stmt, MYF(MY_WME)); + my_free(stmt); DBUG_RETURN(test(rc)); } @@ -5216,8 +4745,7 @@ my_bool STDCALL mysql_more_results(MYSQL *mysql) my_bool res; DBUG_ENTER("mysql_more_results"); - res= ((mysql->last_used_con->server_status & SERVER_MORE_RESULTS_EXISTS) ? - 1: 0); + res= ((mysql->server_status & SERVER_MORE_RESULTS_EXISTS) ? 1: 0); DBUG_PRINT("exit",("More results exists ? %d", res)); DBUG_RETURN(res); } @@ -5239,13 +4767,59 @@ int STDCALL mysql_next_result(MYSQL *mysql) net_clear_error(&mysql->net); mysql->affected_rows= ~(my_ulonglong) 0; - if (mysql->last_used_con->server_status & SERVER_MORE_RESULTS_EXISTS) + 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); + } + + if (mysql->status == MYSQL_STATUS_GET_RESULT) + mysql->status= MYSQL_STATUS_STATEMENT_GET_RESULT; + + 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); diff --git a/dep/mysqllite/libmysql/libmysql.def b/dep/mysqllite/libmysql/libmysql.def deleted file mode 100644 index 81f86dc8726be..0000000000000 --- a/dep/mysqllite/libmysql/libmysql.def +++ /dev/null @@ -1,153 +0,0 @@ -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 - mysql_affected_rows - mysql_autocommit - mysql_stmt_bind_param - mysql_stmt_bind_result - mysql_change_user - mysql_character_set_name - mysql_close - mysql_commit - mysql_data_seek - mysql_debug - mysql_dump_debug_info - mysql_eof - mysql_errno - mysql_error - mysql_escape_string - mysql_hex_string - mysql_stmt_execute - mysql_stmt_fetch - mysql_stmt_fetch_column - mysql_fetch_field - mysql_fetch_field_direct - mysql_fetch_fields - mysql_fetch_lengths - mysql_fetch_row - mysql_field_count - mysql_field_seek - mysql_field_tell - mysql_free_result - mysql_get_client_info - mysql_get_host_info - mysql_get_proto_info - mysql_get_server_info - mysql_get_client_version - mysql_get_ssl_cipher - mysql_info - mysql_init - mysql_insert_id - mysql_kill - mysql_set_server_option - mysql_list_dbs - mysql_list_fields - mysql_list_processes - mysql_list_tables - mysql_more_results - mysql_next_result - mysql_num_fields - mysql_num_rows - mysql_options - mysql_stmt_param_count - mysql_stmt_param_metadata - mysql_ping - mysql_stmt_result_metadata - mysql_query - mysql_read_query_result - mysql_real_connect - mysql_real_escape_string - mysql_real_query - mysql_refresh - mysql_rollback - mysql_row_seek - mysql_row_tell - mysql_select_db - mysql_stmt_send_long_data - mysql_send_query - mysql_shutdown - mysql_ssl_set - mysql_stat - mysql_stmt_affected_rows - mysql_stmt_close - mysql_stmt_reset - mysql_stmt_data_seek - mysql_stmt_errno - mysql_stmt_error - mysql_stmt_free_result - mysql_stmt_num_rows - mysql_stmt_row_seek - mysql_stmt_row_tell - mysql_stmt_store_result - mysql_store_result - mysql_thread_id - mysql_thread_safe - mysql_use_result - mysql_warning_count - 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 diff --git a/dep/mysqllite/libmysql/libmysql.ver.in b/dep/mysqllite/libmysql/libmysql.ver.in deleted file mode 100644 index 20eb0fd41bb3f..0000000000000 --- a/dep/mysqllite/libmysql/libmysql.ver.in +++ /dev/null @@ -1 +0,0 @@ -libmysqlclient_@SHARED_LIB_MAJOR_VERSION@ { global: *; }; diff --git a/dep/mysqllite/libmysql/libmysql_exports.def b/dep/mysqllite/libmysql/libmysql_exports.def new file mode 100644 index 0000000000000..b871320f3a38a --- /dev/null +++ b/dep/mysqllite/libmysql/libmysql_exports.def @@ -0,0 +1,107 @@ +EXPORTS + load_defaults + mysql_thread_end + mysql_thread_init + myodbc_remove_escape + mysql_affected_rows + mysql_autocommit + mysql_stmt_bind_param + mysql_stmt_bind_result + mysql_change_user + mysql_character_set_name + mysql_close + mysql_commit + mysql_data_seek + mysql_debug + mysql_dump_debug_info + mysql_eof + mysql_errno + mysql_error + mysql_escape_string + mysql_hex_string + mysql_stmt_execute + mysql_stmt_fetch + mysql_stmt_fetch_column + mysql_fetch_field + mysql_fetch_field_direct + mysql_fetch_fields + mysql_fetch_lengths + mysql_fetch_row + mysql_field_count + mysql_field_seek + mysql_field_tell + mysql_free_result + mysql_get_client_info + mysql_get_host_info + mysql_get_proto_info + mysql_get_server_info + mysql_get_client_version + mysql_get_ssl_cipher + mysql_info + mysql_init + mysql_insert_id + mysql_kill + mysql_set_server_option + mysql_list_dbs + mysql_list_fields + mysql_list_processes + mysql_list_tables + mysql_more_results + mysql_next_result + mysql_num_fields + mysql_num_rows + mysql_options + mysql_stmt_param_count + mysql_stmt_param_metadata + mysql_ping + mysql_stmt_result_metadata + mysql_query + mysql_read_query_result + mysql_real_connect + mysql_real_escape_string + mysql_real_query + mysql_refresh + mysql_rollback + mysql_row_seek + mysql_row_tell + mysql_select_db + mysql_stmt_send_long_data + mysql_send_query + mysql_shutdown + mysql_ssl_set + mysql_stat + mysql_stmt_affected_rows + mysql_stmt_close + mysql_stmt_reset + mysql_stmt_data_seek + mysql_stmt_errno + mysql_stmt_error + mysql_stmt_free_result + mysql_stmt_num_rows + mysql_stmt_row_seek + mysql_stmt_row_tell + mysql_stmt_store_result + mysql_store_result + mysql_thread_id + mysql_thread_safe + mysql_use_result + mysql_warning_count + mysql_stmt_sqlstate + mysql_sqlstate + mysql_get_server_version + mysql_stmt_prepare + mysql_stmt_init + mysql_stmt_insert_id + mysql_stmt_attr_get + mysql_stmt_attr_set + mysql_stmt_field_count + mysql_set_local_infile_default + mysql_set_local_infile_handler + mysql_embedded + mysql_server_init + mysql_server_end + mysql_set_character_set + mysql_get_character_set_info + mysql_stmt_next_result + + diff --git a/dep/mysqllite/libmysql/manager.c b/dep/mysqllite/libmysql/manager.c deleted file mode 100644 index 53ffffa55c042..0000000000000 --- a/dep/mysqllite/libmysql/manager.c +++ /dev/null @@ -1,269 +0,0 @@ -/* 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 -#if defined(THREAD) -#include /* because of signal() */ -#endif -#include "mysql.h" -#include "mysql_version.h" -#include "mysqld_error.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#if defined(__NETWARE__) -#include -#include -#include -#elif !defined( __WIN__) -#include -#ifdef HAVE_SYS_UN_H -# include -#endif -#include -#ifdef HAVE_SELECT_H -# include -#endif -#ifdef HAVE_SYS_SELECT_H -#include -#endif -#include -#endif /* __WIN__ */ - -#ifndef INADDR_NONE -#define INADDR_NONE -1 -#endif - -#define RES_BUF_SHIFT 5 -#define NET_BUF_SIZE 2048 - -MYSQL_MANAGER* STDCALL mysql_manager_init(MYSQL_MANAGER* con) -{ - int net_buf_size=NET_BUF_SIZE; - if (!con) - { - if (!(con=(MYSQL_MANAGER*)my_malloc(sizeof(*con)+net_buf_size, - MYF(MY_WME|MY_ZEROFILL)))) - return 0; - con->free_me=1; - con->net_buf=(char*)con+sizeof(*con); - } - else - { - bzero((char*)con,sizeof(*con)); - if (!(con->net_buf=my_malloc(net_buf_size,MYF(0)))) - return 0; - } - con->net_buf_pos=con->net_data_end=con->net_buf; - con->net_buf_size=net_buf_size; - return con; -} - -MYSQL_MANAGER* STDCALL mysql_manager_connect(MYSQL_MANAGER* con, - const char* host, - const char* user, - const char* passwd, - unsigned int port) -{ - my_socket sock; - struct sockaddr_in sock_addr; - in_addr_t ip_addr; - char msg_buf[MAX_MYSQL_MANAGER_MSG]; - int msg_len; - Vio* vio; - my_bool not_used; - - if (!host) - host="localhost"; - if (!user) - user="root"; - if (!passwd) - passwd=""; - - if ((sock=(my_socket)socket(AF_INET,SOCK_STREAM,0)) == INVALID_SOCKET) - { - con->last_errno=errno; - strmov(con->last_error,"Cannot create socket"); - goto err; - } - if (!(vio=vio_new(sock,VIO_TYPE_TCPIP,FALSE))) - { - con->last_errno=ENOMEM; - strmov(con->last_error,"Cannot create network I/O object"); - goto err; - } - vio_blocking(vio, TRUE, ¬_used); - my_net_init(&con->net,vio); - bzero((char*) &sock_addr,sizeof(sock_addr)); - sock_addr.sin_family = AF_INET; - if ((int) (ip_addr = inet_addr(host)) != (int) INADDR_NONE) - { - memcpy_fixed(&sock_addr.sin_addr,&ip_addr,sizeof(ip_addr)); - } - else - { - int tmp_errno; - struct hostent tmp_hostent,*hp; - char buff2[GETHOSTBYNAME_BUFF_SIZE]; - hp = my_gethostbyname_r(host,&tmp_hostent,buff2,sizeof(buff2), - &tmp_errno); - if (!hp) - { - con->last_errno=tmp_errno; - sprintf(con->last_error,"Could not resolve host '%-.64s'",host); - my_gethostbyname_r_free(); - goto err; - } - memcpy(&sock_addr.sin_addr,hp->h_addr, (size_t) hp->h_length); - my_gethostbyname_r_free(); - } - sock_addr.sin_port = (ushort) htons((ushort) port); - if (my_connect(sock,(struct sockaddr *) &sock_addr, sizeof(sock_addr), - 0)) - { - con->last_errno=errno; - sprintf(con->last_error ,"Could not connect to %-.64s", host); - goto err; - } - /* read the greating */ - if (my_net_read(&con->net) == packet_error) - { - con->last_errno=errno; - strmov(con->last_error,"Read error on socket"); - goto err; - } - sprintf(msg_buf,"%-.16s %-.16s\n",user,passwd); - msg_len=strlen(msg_buf); - if (my_net_write(&con->net,(uchar*) msg_buf,msg_len) || net_flush(&con->net)) - { - con->last_errno=con->net.last_errno; - strmov(con->last_error,"Write error on socket"); - goto err; - } - if (my_net_read(&con->net) == packet_error) - { - con->last_errno=errno; - strmov(con->last_error,"Read error on socket"); - goto err; - } - if ((con->cmd_status=atoi((char*) con->net.read_pos)) != MANAGER_OK) - { - strmov(con->last_error,"Access denied"); - goto err; - } - if (!my_multi_malloc(MYF(0), &con->host, (uint)strlen(host)+1, - &con->user, (uint)strlen(user)+1, - &con->passwd, (uint)strlen(passwd)+1, - NullS)) - { - con->last_errno=ENOMEM; - strmov(con->last_error,"Out of memory"); - goto err; - } - strmov(con->host,host); - strmov(con->user,user); - strmov(con->passwd,passwd); - return con; - -err: - { - my_bool free_me=con->free_me; - con->free_me=0; - mysql_manager_close(con); - con->free_me=free_me; - } - return 0; -} - -void STDCALL mysql_manager_close(MYSQL_MANAGER* con) -{ - /* - No need to free con->user and con->passwd, because they were - allocated in my_multimalloc() along with con->host, freeing - con->hosts frees the whole block - */ - my_free((uchar*)con->host,MYF(MY_ALLOW_ZERO_PTR)); - net_end(&con->net); - if (con->free_me) - my_free((uchar*)con,MYF(0)); -} - - -int STDCALL mysql_manager_command(MYSQL_MANAGER* con,const char* cmd, - int cmd_len) -{ - if (!cmd_len) - cmd_len=strlen(cmd); - if (my_net_write(&con->net,(const uchar*)cmd,cmd_len) || net_flush(&con->net)) - { - con->last_errno=errno; - strmov(con->last_error,"Write error on socket"); - return 1; - } - con->eof=0; - return 0; -} - - -int STDCALL mysql_manager_fetch_line(MYSQL_MANAGER* con, char* res_buf, - int res_buf_size) -{ - char* res_buf_end=res_buf+res_buf_size; - char* net_buf=(char*) con->net.read_pos, *net_buf_end; - int res_buf_shift=RES_BUF_SHIFT; - ulong num_bytes; - - if (res_buf_sizelast_errno=ENOMEM; - strmov(con->last_error,"Result buffer too small"); - return 1; - } - - if ((num_bytes=my_net_read(&con->net)) == packet_error) - { - con->last_errno=errno; - strmov(con->last_error,"socket read failed"); - return 1; - } - - net_buf_end=net_buf+num_bytes; - - if ((con->eof=(net_buf[3]==' '))) - res_buf_shift--; - net_buf+=res_buf_shift; - res_buf_end[-1]=0; - for (;net_bufbuffer= (uchar*) my_malloc_ci(element_size*init_alloc, MYF(0)))) + if (!(array->buffer= (uchar*) my_malloc(element_size*init_alloc, MYF(0)))) array->max_element=0; DBUG_RETURN(FALSE); } my_bool init_dynamic_array(DYNAMIC_ARRAY *array, uint element_size, - uint init_alloc, - uint alloc_increment CALLER_INFO_PROTO) + uint init_alloc, uint alloc_increment) { /* placeholder to preserve ABI */ return my_init_dynamic_array_ci(array, element_size, init_alloc, @@ -306,7 +305,7 @@ void delete_dynamic(DYNAMIC_ARRAY *array) else if (array->buffer) { - my_free(array->buffer,MYF(MY_WME)); + my_free(array->buffer); array->buffer=0; array->elements=array->max_element=0; } diff --git a/dep/mysqllite/mysys/base64.c b/dep/mysqllite/mysys/base64.c new file mode 100644 index 0000000000000..ab66715c929ae --- /dev/null +++ b/dep/mysqllite/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 +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 +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 base64_needed_encoded_length(). +*/ + +int +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 + base64_needed_decoded_length(). + + RETURN VALUE + Number of bytes written at 'dst' or -1 in case of failure +*/ +int +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++) diff --git a/dep/mysqllite/mysys/charset.c b/dep/mysqllite/mysys/charset.c index f15c445addea7..167d6b8ff6e57 100644 --- a/dep/mysqllite/mysys/charset.c +++ b/dep/mysqllite/mysys/charset.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (C) 2000 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 @@ -42,7 +42,7 @@ get_collation_number_internal(const char *name) { CHARSET_INFO **cs; for (cs= all_charsets; - cs < all_charsets+array_elements(all_charsets)-1 ; + cs < all_charsets + array_elements(all_charsets); cs++) { if ( cs[0] && cs[0]->name && @@ -251,12 +251,38 @@ static int add_collation(CHARSET_INFO *cs) { #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")) + else if (!strcmp(cs->csname, "utf8") || !strcmp(cs->csname, "utf8mb3")) { #if defined (HAVE_CHARSET_utf8) && defined(HAVE_UCA_COLLATIONS) copy_uca_collation(newcs, &my_charset_utf8_unicode_ci); + newcs->ctype= my_charset_utf8_unicode_ci.ctype; + if (init_state_maps(newcs)) + return MY_XML_ERROR; +#endif + } + else if (!strcmp(cs->csname, "utf8mb4")) + { +#if defined (HAVE_CHARSET_utf8mb4) && defined(HAVE_UCA_COLLATIONS) + copy_uca_collation(newcs, &my_charset_utf8mb4_unicode_ci); + newcs->ctype= my_charset_utf8mb4_unicode_ci.ctype; + 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 @@ -283,6 +309,8 @@ static int add_collation(CHARSET_INFO *cs) 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 @@ -338,10 +366,10 @@ static my_bool my_read_charset_file(const char *filename, myf myflags) !(buf= (uchar*) my_malloc(len,myflags))) return TRUE; - if ((fd=my_open(filename,O_RDONLY,myflags)) < 0) + if ((fd= mysql_file_open(key_file_charset, filename, O_RDONLY, myflags)) < 0) goto error; - tmp_len=my_read(fd, buf, len, myflags); - my_close(fd,myflags); + tmp_len= mysql_file_read(fd, buf, len, myflags); + mysql_file_close(fd, myflags); if (tmp_len != len) goto error; @@ -355,11 +383,11 @@ static my_bool my_read_charset_file(const char *filename, myf myflags) #endif } - my_free(buf, myflags); + my_free(buf); return FALSE; error: - my_free(buf, myflags); + my_free(buf); return TRUE; } @@ -386,7 +414,7 @@ char *get_charsets_dir(char *buf) DBUG_RETURN(res); } -CHARSET_INFO *all_charsets[256]={NULL}; +CHARSET_INFO *all_charsets[MY_ALL_CHARSETS_SIZE]={NULL}; CHARSET_INFO *default_charset_info = &my_charset_latin1; void add_compiled_collation(CHARSET_INFO *cs) @@ -411,7 +439,7 @@ static void init_available_charsets(void) bzero(&all_charsets,sizeof(all_charsets)); init_compiled_charsets(MYF(0)); - + /* Copy compiled charsets */ for (cs=all_charsets; cs < all_charsets+array_elements(all_charsets)-1 ; @@ -424,7 +452,7 @@ static void init_available_charsets(void) *cs= NULL; } } - + strmov(get_charsets_dir(fname), MY_CHARSET_INDEX); my_read_charset_file(fname, MYF(0)); } @@ -435,20 +463,39 @@ void free_charsets(void) charsets_initialized= charsets_template; } + +static const char* +get_collation_name_alias(const char *name, char *buf, size_t bufsize) +{ + if (!strncasecmp(name, "utf8mb3_", 8)) + { + my_snprintf(buf, bufsize, "utf8_%s", name + 8); + return buf; + } + return NULL; +} + + uint get_collation_number(const char *name) { + uint id; + char alias[64]; my_pthread_once(&charsets_initialized, init_available_charsets); - return get_collation_number_internal(name); + if ((id= get_collation_number_internal(name))) + return id; + if ((name= get_collation_name_alias(name, alias, sizeof(alias)))) + return get_collation_number_internal(name); + return 0; } -uint get_charset_number(const char *charset_name, uint cs_flags) +static uint +get_charset_number_internal(const char *charset_name, uint cs_flags) { CHARSET_INFO **cs; - my_pthread_once(&charsets_initialized, init_available_charsets); for (cs= all_charsets; - cs < all_charsets+array_elements(all_charsets)-1 ; + cs < all_charsets + array_elements(all_charsets); cs++) { if ( cs[0] && cs[0]->csname && (cs[0]->state & cs_flags) && @@ -459,6 +506,27 @@ uint get_charset_number(const char *charset_name, uint cs_flags) } +static const char* +get_charset_name_alias(const char *name) +{ + if (!my_strcasecmp(&my_charset_latin1, name, "utf8mb3")) + return "utf8"; + return NULL; +} + + +uint get_charset_number(const char *charset_name, uint cs_flags) +{ + uint id; + my_pthread_once(&charsets_initialized, init_available_charsets); + if ((id= get_charset_number_internal(charset_name, cs_flags))) + return id; + if ((charset_name= get_charset_name_alias(charset_name))) + return get_charset_number_internal(charset_name, cs_flags); + return 0; +} + + const char *get_charset_name(uint charset_number) { CHARSET_INFO *cs; @@ -486,7 +554,7 @@ static CHARSET_INFO *get_internal_charset(uint cs_number, myf flags) 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); + mysql_mutex_lock(&THR_LOCK_charset); if (!(cs->state & (MY_CS_COMPILED|MY_CS_LOADED))) /* if CS is not in memory */ { @@ -508,7 +576,7 @@ static CHARSET_INFO *get_internal_charset(uint cs_number, myf flags) else cs= NULL; - pthread_mutex_unlock(&THR_LOCK_charset); + mysql_mutex_unlock(&THR_LOCK_charset); } return cs; } @@ -522,7 +590,7 @@ CHARSET_INFO *get_charset(uint cs_number, myf flags) my_pthread_once(&charsets_initialized, init_available_charsets); - if (!cs_number || cs_number >= array_elements(all_charsets)-1) + if (!cs_number || cs_number > array_elements(all_charsets)) return NULL; cs=get_internal_charset(cs_number, flags); diff --git a/dep/mysqllite/strings/longlong2str_asm.c b/dep/mysqllite/mysys/checksum.c similarity index 63% rename from dep/mysqllite/strings/longlong2str_asm.c rename to dep/mysqllite/mysys/checksum.c index 637815e52c5cc..a96ea31ea0eae 100644 --- a/dep/mysqllite/strings/longlong2str_asm.c +++ b/dep/mysqllite/mysys/checksum.c @@ -13,20 +13,23 @@ 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" +#include +#include -extern char *longlong2str_with_dig_vector(longlong val,char *dst,int radix, - const char *dig_vector); +/* + Calculate a long checksum for a memoryblock. -char *longlong2str(longlong val,char *dst,int radix) + 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) { - return longlong2str_with_dig_vector(val, dst, radix, _dig_vec_upper); + return (ha_checksum)crc32((uint)crc, pos, (uint)length); } + diff --git a/dep/mysqllite/mysys/default.c b/dep/mysqllite/mysys/default.c index 63f9445dbdc41..75eb4709e1e21 100644 --- a/dep/mysqllite/mysys/default.c +++ b/dep/mysqllite/mysys/default.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2003 MySQL AB +/* Copyright (C) 2000-2003 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 @@ -41,9 +41,37 @@ #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; +const char *my_defaults_extra_file=0; + +static char my_defaults_file_buffer[FN_REFLEN]; +static char my_defaults_extra_file_buffer[FN_REFLEN]; + +static my_bool defaults_already_read= FALSE; /* Which directories are searched for options (and in which order) */ @@ -95,7 +123,6 @@ static int search_default_file_with_ext(Process_option_func func, - 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) @@ -117,6 +144,33 @@ static const char **init_default_directories(MEM_ROOT *alloc); static char *remove_end_comment(char *ptr); +/* + Expand a file name so that the current working directory is added if + the name is relative. + + RETURNS + 0 All OK + 2 Out of memory or path to long + 3 Not able to get working directory + */ + +static int +fn_expand(const char *filename, char *result_buf) +{ + char dir[FN_REFLEN]; + const int flags= MY_UNPACK_FILENAME | MY_SAFE_PATH | MY_RELATIVE_PATH; + DBUG_ENTER("fn_expand"); + DBUG_PRINT("enter", ("filename: %s, result_buf: 0x%lx", + filename, (unsigned long) result_buf)); + if (my_getwd(dir, sizeof(dir), MYF(0))) + DBUG_RETURN(3); + DBUG_PRINT("debug", ("dir: %s", dir)); + if (fn_format(result_buf, filename, dir, NULL, flags) == NULL) + DBUG_RETURN(2); + DBUG_PRINT("return", ("result: %s", result_buf)); + DBUG_RETURN(0); +} + /* Process config files in default directories. @@ -145,6 +199,7 @@ static char *remove_end_comment(char *ptr); 0 ok 1 given cinf_file doesn't exist 2 out of memory + 3 Can't get current working directory The global variable 'my_defaults_group_suffix' is updated with value for --defaults_group_suffix @@ -167,11 +222,23 @@ int my_search_option_files(const char *conf_file, int *argc, char ***argv, 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; + if (forced_extra_defaults && !defaults_already_read) + { + int error= fn_expand(forced_extra_defaults, my_defaults_extra_file_buffer); + if (error) + DBUG_RETURN(error); + my_defaults_extra_file= my_defaults_extra_file_buffer; + } + + if (forced_default_file && !defaults_already_read) + { + int error= fn_expand(forced_default_file, my_defaults_file_buffer); + if (error) + DBUG_RETURN(error); + my_defaults_file= my_defaults_file_buffer; + } + + defaults_already_read= TRUE; /* We can only handle 'defaults-group-suffix' if we are called from @@ -214,15 +281,15 @@ int my_search_option_files(const char *conf_file, int *argc, char ***argv, group->type_names[group->count]= 0; } - if (forced_default_file) + if (my_defaults_file) { if ((error= search_default_file_with_ext(func, func_ctx, "", "", - forced_default_file, 0)) < 0) + my_defaults_file, 0)) < 0) goto err; if (error > 0) { fprintf(stderr, "Could not open required defaults file: %s\n", - forced_default_file); + my_defaults_file); goto err; } } @@ -454,10 +521,11 @@ int my_load_defaults(const char *conf_file, const char **groups, 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-1]=argv[0][i]; - res[i-1]=0; /* End pointer */ - (*argc)--; + res[i]=argv[0][i]; + res[i]=0; /* End pointer */ *argv=res; *(MEM_ROOT*) ptr= alloc; /* Save alloc root for free */ if (default_directories) @@ -479,15 +547,19 @@ int my_load_defaults(const char *conf_file, const char **groups, ctx.args= &args; ctx.group= &group; - error= my_search_option_files(conf_file, argc, argv, &args_used, - handle_default_option, (void *) &ctx, - dirs); + if ((error= my_search_option_files(conf_file, argc, argv, &args_used, + handle_default_option, (void *) &ctx, + dirs))) + { + free_root(&alloc,MYF(0)); + DBUG_RETURN(error); + } /* 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) *sizeof(char*)))) + (args.elements + *argc + 1 + 1) *sizeof(char*)))) goto err; res= (char**) (ptr+sizeof(alloc)); @@ -508,12 +580,16 @@ int my_load_defaults(const char *conf_file, const char **groups, --*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), (char*) ((*argv)+1), + memcpy((uchar*) (res+1+args.elements+1), (char*) ((*argv)+1), (*argc-1)*sizeof(char*)); - res[args.elements+ *argc]=0; /* last null */ + res[args.elements+ *argc+1]=0; /* last null */ - (*argc)+=args.elements; + (*argc)+=args.elements+1; *argv= (char**) res; *(MEM_ROOT*) ptr= alloc; /* Save alloc root for free */ delete_dynamic(&args); @@ -523,15 +599,16 @@ int my_load_defaults(const char *conf_file, const char **groups, printf("%s would have been started with the following arguments:\n", **argv); for (i=1 ; i < *argc ; i++) - printf("%s ", (*argv)[i]); + if ((*argv)[i] != args_separator) /* skip arguments separator */ + printf("%s ", (*argv)[i]); puts(""); exit(0); } - if (error == 0 && default_directories) + if (default_directories) *default_directories= dirs; - DBUG_RETURN(error); + DBUG_RETURN(0); err: fprintf(stderr,"Fatal error in defaults handling. Program aborted\n"); @@ -543,7 +620,7 @@ int my_load_defaults(const char *conf_file, const char **groups, void free_defaults(char **argv) { MEM_ROOT ptr; - memcpy_fixed((char*) &ptr,(char *) argv - sizeof(ptr), sizeof(ptr)); + memcpy(&ptr, ((char *) argv) - sizeof(ptr), sizeof(ptr)); free_root(&ptr,MYF(0)); } @@ -654,7 +731,7 @@ static int search_default_file_with_ext(Process_option_func opt_handler, static const char includedir_keyword[]= "includedir"; static const char include_keyword[]= "include"; const int max_recursion_level= 10; - FILE *fp; + MYSQL_FILE *fp; uint line=0; my_bool found_group=0; uint i; @@ -675,7 +752,7 @@ static int search_default_file_with_ext(Process_option_func opt_handler, strmov(name,config_file); } fn_format(name,name,"","",4); -#if !defined(__WIN__) && !defined(__NETWARE__) +#if !defined(__WIN__) { MY_STAT stat_info; if (!my_stat(name,&stat_info,MYF(0))) @@ -694,10 +771,10 @@ static int search_default_file_with_ext(Process_option_func opt_handler, } } #endif - if (!(fp= my_fopen(name, O_RDONLY, MYF(0)))) + if (!(fp= mysql_file_fopen(key_file_cnf, name, O_RDONLY, MYF(0)))) return 1; /* Ignore wrong files */ - while (fgets(buff, sizeof(buff) - 1, fp)) + while (mysql_file_fgets(buff, sizeof(buff) - 1, fp)) { line++; /* Ignore comment and empty lines */ @@ -887,11 +964,11 @@ static int search_default_file_with_ext(Process_option_func opt_handler, goto err; } } - my_fclose(fp,MYF(0)); + mysql_file_fclose(fp, MYF(0)); return(0); err: - my_fclose(fp,MYF(0)); + mysql_file_fclose(fp, MYF(0)); return -1; /* Fatal error */ } @@ -921,7 +998,6 @@ static char *remove_end_comment(char *ptr) return ptr; } -#include void my_print_default_files(const char *conf_file) { @@ -1001,8 +1077,6 @@ void print_defaults(const char *conf_file, const char **groups) --defaults-extra-file=# Read this file after the global files are read."); } -#include - static int add_directory(MEM_ROOT *alloc, const char *dir, const char **dirs) { @@ -1117,10 +1191,6 @@ static const char **init_default_directories(MEM_ROOT *alloc) errors += add_directory(alloc, fname_buffer, dirs); } -#elif defined(__NETWARE__) - - errors += add_directory(alloc, "sys:/etc/", dirs); - #else errors += add_directory(alloc, "/etc/", dirs); @@ -1139,7 +1209,7 @@ static const char **init_default_directories(MEM_ROOT *alloc) /* Placeholder for --defaults-extra-file= */ errors += add_directory(alloc, "", dirs); -#if !defined(__WIN__) && !defined(__NETWARE__) +#if !defined(__WIN__) errors += add_directory(alloc, "~/", dirs); #endif diff --git a/dep/mysqllite/mysys/default_modify.c b/dep/mysqllite/mysys/default_modify.c deleted file mode 100644 index 88df0122da255..0000000000000 --- a/dep/mysqllite/mysys/default_modify.c +++ /dev/null @@ -1,252 +0,0 @@ -/* 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 __WIN__ -#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, new_opt_len, reserve_extended; - uint nr_newlines= 0, buffer_size; - my_bool in_section= FALSE, opt_applied= 0; - 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(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= (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(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/dep/mysqllite/mysys/errors.c b/dep/mysqllite/mysys/errors.c index a5ad4a956ab71..c74ed292906c7 100644 --- a/dep/mysqllite/mysys/errors.c +++ b/dep/mysqllite/mysys/errors.c @@ -18,7 +18,7 @@ #ifndef SHARED_LIBRARY -const char * NEAR globerrs[GLOBERRS]= +const char *globerrs[GLOBERRS]= { "Can't create/write to file '%s' (Errcode: %d)", "Error reading file '%s' (Errcode: %d)", @@ -52,6 +52,7 @@ const char * NEAR globerrs[GLOBERRS]= "File '%s' (fileno: %d) was not closed", "Can't change ownership of the file '%s' (Errcode: %d)", "Can't change permissions of the file '%s' (Errcode: %d)", + "Can't seek in file '%s' (Errcode: %d)" }; void init_glob_errs(void) @@ -94,6 +95,7 @@ void init_glob_errs() EE(EE_FILE_NOT_CLOSED) = "File '%s' (fileno: %d) was not closed"; EE(EE_CHANGE_OWNERSHIP) = "Can't change ownership of the file '%s' (Errcode: %d)"; EE(EE_CHANGE_PERMISSIONS) = "Can't change permissions of the file '%s' (Errcode: %d)"; + EE(EE_CANT_SEEK) = "Can't seek in file '%s' (Errcode: %d)"; } #endif @@ -108,5 +110,10 @@ void wait_for_free_space(const char *filename, int errors) 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)); + (void) sleep(MY_WAIT_FOR_USER_TO_FIX_PANIC); +} + +const char **get_global_errmsgs() +{ + return globerrs; } diff --git a/dep/mysqllite/mysys/hash.c b/dep/mysqllite/mysys/hash.c index 9c1957bf0aac7..f54ac1a4abbf6 100644 --- a/dep/mysqllite/mysys/hash.c +++ b/dep/mysqllite/mysys/hash.c @@ -33,16 +33,18 @@ typedef struct st_hash_info { uchar *data; /* data for current entry */ } HASH_LINK; -static uint my_hash_mask(size_t hashnr, size_t buffmax, size_t maxlength); +static uint my_hash_mask(my_hash_value_type 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) +static my_hash_value_type 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; + return (my_hash_value_type)nr1; } /** @@ -65,8 +67,6 @@ static uint calc_hash(const HASH *hash, const uchar *key, size_t length) @param[in] get_key get the key for the hash @param[in] free_element pointer to the function that does cleanup - @param[in] CALLER_INFO_PROTO flag that define the behaviour - of the hash @return inidicates success or failure of initialization @retval 0 success @retval 1 failure @@ -75,7 +75,7 @@ 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) + void (*free_element)(void*), uint flags) { DBUG_ENTER("my_hash_init"); DBUG_PRINT("enter",("hash: 0x%lx size: %u", (long) hash, (uint) size)); @@ -179,7 +179,8 @@ my_hash_key(const HASH *hash, const uchar *record, size_t *length, /* Calculate pos according to keys */ -static uint my_hash_mask(size_t hashnr, size_t buffmax, size_t maxlength) +static uint my_hash_mask(my_hash_value_type hashnr, size_t buffmax, + size_t maxlength) { if ((hashnr & (buffmax-1)) < maxlength) return (hashnr & (buffmax-1)); return (hashnr & ((buffmax >> 1) -1)); @@ -200,7 +201,7 @@ static #if !defined(__USLC__) && !defined(__sgi) inline #endif -unsigned int rec_hashnr(HASH *hash,const uchar *record) +my_hash_value_type rec_hashnr(HASH *hash,const uchar *record) { size_t length; uchar *key= (uchar*) my_hash_key(hash, record, &length, 0); @@ -214,6 +215,23 @@ uchar* my_hash_search(const HASH *hash, const uchar *key, size_t length) return my_hash_first(hash, key, length, &state); } +uchar* my_hash_search_using_hash_value(const HASH *hash, + my_hash_value_type hash_value, + const uchar *key, + size_t length) +{ + HASH_SEARCH_STATE state; + return my_hash_first_from_hash_value(hash, hash_value, + key, length, &state); +} + +my_hash_value_type my_calc_hash(const HASH *hash, + const uchar *key, size_t length) +{ + return calc_hash(hash, key, length ? length : hash->key_length); +} + + /* Search after a record based on a key @@ -223,15 +241,32 @@ uchar* my_hash_search(const HASH *hash, const uchar *key, size_t length) uchar* my_hash_first(const HASH *hash, const uchar *key, size_t length, HASH_SEARCH_STATE *current_record) +{ + uchar *res; + if (my_hash_inited(hash)) + res= my_hash_first_from_hash_value(hash, + calc_hash(hash, key, length ? length : hash->key_length), + key, length, current_record); + else + res= 0; + return res; +} + + +uchar* my_hash_first_from_hash_value(const HASH *hash, + my_hash_value_type hash_value, + const uchar *key, + size_t length, + HASH_SEARCH_STATE *current_record) { HASH_LINK *pos; uint flag,idx; - DBUG_ENTER("my_hash_first"); + DBUG_ENTER("my_hash_first_from_hash_value"); flag=1; if (hash->records) { - idx= my_hash_mask(calc_hash(hash, key, length ? length : hash->key_length), + idx= my_hash_mask(hash_value, hash->blength, hash->records); do { @@ -331,7 +366,8 @@ static int hashcmp(const HASH *hash, HASH_LINK *pos, const uchar *key, my_bool my_hash_insert(HASH *info, const uchar *record) { int flag; - size_t idx,halfbuff,hash_nr,first_index; + size_t idx,halfbuff,first_index; + my_hash_value_type hash_nr; uchar *UNINIT_VAR(ptr_to_rec),*UNINIT_VAR(ptr_to_rec2); HASH_LINK *data,*empty,*UNINIT_VAR(gpos),*UNINIT_VAR(gpos2),*pos; @@ -467,7 +503,8 @@ my_bool my_hash_insert(HASH *info, const uchar *record) my_bool my_hash_delete(HASH *hash, uchar *record) { - uint blength,pos2,pos_hashnr,lastpos_hashnr,idx,empty_index; + uint blength,pos2,idx,empty_index; + my_hash_value_type pos_hashnr, lastpos_hashnr; HASH_LINK *data,*lastpos,*gpos,*pos,*pos3,*empty; DBUG_ENTER("my_hash_delete"); if (!hash->records) @@ -541,7 +578,7 @@ my_bool my_hash_delete(HASH *hash, uchar *record) pos->next=empty_index; exit: - VOID(pop_dynamic(&hash->array)); + (void) pop_dynamic(&hash->array); if (hash->free) (*hash->free)((uchar*) record); DBUG_RETURN(0); diff --git a/dep/mysqllite/mysys/lf_alloc-pin.c b/dep/mysqllite/mysys/lf_alloc-pin.c new file mode 100644 index 0000000000000..4ed01ac808318 --- /dev/null +++ b/dep/mysqllite/mysys/lf_alloc-pin.c @@ -0,0 +1,527 @@ +/* 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= NULL, *last= NULL; + LF_PINBOX *pinbox= pins->pinbox; + + 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; + 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); + my_free(node); + 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)); +#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/dep/mysqllite/mysys/lf_dynarray.c b/dep/mysqllite/mysys/lf_dynarray.c new file mode 100644 index 0000000000000..0941c8762bb8f --- /dev/null +++ b/dep/mysqllite/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(alloc); + } + else + my_free(alloc[-1]); +} + +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); + } + 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); + } + 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/dep/mysqllite/mysys/lf_hash.c b/dep/mysqllite/mysys/lf_hash.c new file mode 100644 index 0000000000000..e7bf82fc6ca1f --- /dev/null +++ b/dep/mysqllite/mysys/lf_hash.c @@ -0,0 +1,503 @@ +/* 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; + +/* + 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(el); /* 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(dummy); + 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/dep/mysqllite/mysys/list.c b/dep/mysqllite/mysys/list.c index aaadd686365d9..e68fbf519d185 100644 --- a/dep/mysqllite/mysys/list.c +++ b/dep/mysqllite/mysys/list.c @@ -61,8 +61,8 @@ void list_free(LIST *root, uint free_data) { next=root->next; if (free_data) - my_free((uchar*) root->data,MYF(0)); - my_free((uchar*) root,MYF(0)); + my_free(root->data); + my_free(root); root=next; } } diff --git a/dep/mysqllite/mysys/md5.c b/dep/mysqllite/mysys/md5.c new file mode 100644 index 0000000000000..2388cebedc4d7 --- /dev/null +++ b/dep/mysqllite/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/dep/mysqllite/mysys/mf_cache.c b/dep/mysqllite/mysys/mf_cache.c index f0df0f3fa779d..691532c0d8025 100644 --- a/dep/mysqllite/mysys/mf_cache.c +++ b/dep/mysqllite/mysys/mf_cache.c @@ -71,8 +71,8 @@ my_bool open_cached_file(IO_CACHE *cache, const char* dir, const char *prefix, { DBUG_RETURN(0); } - my_free(cache->dir, MYF(MY_ALLOW_ZERO_PTR)); - my_free(cache->prefix,MYF(MY_ALLOW_ZERO_PTR)); + my_free(cache->dir); + my_free(cache->prefix); DBUG_RETURN(1); } @@ -110,12 +110,12 @@ void close_cached_file(IO_CACHE *cache) if (cache->file_name) { (void) my_delete(cache->file_name,MYF(MY_WME | ME_NOINPUT)); - my_free(cache->file_name,MYF(0)); + my_free(cache->file_name); } #endif } - my_free(cache->dir,MYF(MY_ALLOW_ZERO_PTR)); - my_free(cache->prefix,MYF(MY_ALLOW_ZERO_PTR)); + my_free(cache->dir); + my_free(cache->prefix); } DBUG_VOID_RETURN; } diff --git a/dep/mysqllite/mysys/mf_dirname.c b/dep/mysqllite/mysys/mf_dirname.c index 1b428ded751a0..5a9440483e4dc 100644 --- a/dep/mysqllite/mysys/mf_dirname.c +++ b/dep/mysqllite/mysys/mf_dirname.c @@ -40,11 +40,7 @@ size_t dirname_length(const char *name) continue; } #endif - if (*pos == FN_LIBCHAR || *pos == '/' -#ifdef FN_C_AFTER_DIR - || *pos == FN_C_AFTER_DIR || *pos == FN_C_AFTER_DIR_2 -#endif - ) + if (*pos == FN_LIBCHAR || *pos == '/') gpos=pos; } return (size_t) (gpos+1-(char*) name); @@ -88,8 +84,7 @@ size_t dirname_part(char *to, const char *name, size_t *to_res_length) from_end Pointer at end of filename (normally end \0) IMPLEMENTATION - If MSDOS converts '/' to '\' - If VMS converts '<' to '[' and '>' to ']' + If Windows converts '/' 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 @@ -118,18 +113,12 @@ char *convert_dirname(char *to, const char *from, const char *from_end) if (!from_end || (from_end - from) > FN_REFLEN-2) from_end=from+FN_REFLEN -2; -#if FN_LIBCHAR != '/' || defined(FN_C_BEFORE_DIR_2) +#if FN_LIBCHAR != '/' { 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 diff --git a/dep/mysqllite/mysys/mf_fn_ext.c b/dep/mysqllite/mysys/mf_fn_ext.c index da7fac3de73c0..c872f2993c4cd 100644 --- a/dep/mysqllite/mysys/mf_fn_ext.c +++ b/dep/mysqllite/mysys/mf_fn_ext.c @@ -39,7 +39,7 @@ char *fn_ext(const char *name) DBUG_ENTER("fn_ext"); DBUG_PRINT("mfunkt",("name: '%s'",name)); -#if defined(FN_DEVCHAR) || defined(FN_C_AFTER_DIR) || defined(BASKSLASH_MBTAIL) +#if defined(FN_DEVCHAR) || defined(BASKSLASH_MBTAIL) { char buff[FN_REFLEN]; size_t res_length; diff --git a/dep/mysqllite/mysys/mf_getdate.c b/dep/mysqllite/mysys/mf_getdate.c new file mode 100644 index 0000000000000..9475bebd107d7 --- /dev/null +++ b/dep/mysqllite/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) + gmtime_r(&skr,&tm_tmp); + else + localtime_r(&skr,&tm_tmp); + start_time= &tm_tmp; +#else + if (flag & GETDATE_GMT) + start_time= gmtime(&skr); + else + start_time= localtime(&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/dep/mysqllite/mysys/mf_iocache.c b/dep/mysqllite/mysys/mf_iocache.c index e9b947b04a647..62e51ffb629fc 100644 --- a/dep/mysqllite/mysys/mf_iocache.c +++ b/dep/mysqllite/mysys/mf_iocache.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (C) 2000 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 @@ -47,7 +47,6 @@ 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 @@ -56,15 +55,10 @@ static void my_aiowait(my_aio_result *result); #endif #include -#ifdef THREAD #define lock_append_buffer(info) \ - pthread_mutex_lock(&(info)->append_buffer_lock) + mysql_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 + mysql_mutex_unlock(&(info)->append_buffer_lock) #define IO_ROUND_UP(X) (((X)+IO_SIZE-1) & ~(IO_SIZE-1)) #define IO_ROUND_DN(X) ( (X) & ~(IO_SIZE-1)) @@ -117,11 +111,7 @@ init_functions(IO_CACHE* info) 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->read_function = info->share ? _my_b_read_r : _my_b_read; info->write_function = _my_b_write; } @@ -174,7 +164,7 @@ int init_io_cache(IO_CACHE *info, File file, size_t cachesize, if (file >= 0) { - pos= my_tell(file, MYF(0)); + pos= mysql_file_tell(file, MYF(0)); if ((pos == (my_off_t) -1) && (my_errno == ESPIPE)) { /* @@ -194,9 +184,7 @@ int init_io_cache(IO_CACHE *info, File file, size_t cachesize, } info->disk_writes= 0; -#ifdef THREAD info->share=0; -#endif if (!cachesize && !(cachesize= my_default_record_cache_size)) DBUG_RETURN(1); /* No cache requested */ @@ -206,7 +194,7 @@ int init_io_cache(IO_CACHE *info, File file, size_t cachesize, 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)); + end_of_file= mysql_file_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) @@ -264,11 +252,10 @@ int init_io_cache(IO_CACHE *info, File file, size_t cachesize, { 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 + mysql_mutex_init(key_IO_CACHE_append_buffer_lock, + &info->append_buffer_lock, MY_MUTEX_INIT_FAST); } -#if defined(SAFE_MUTEX) && defined(THREAD) +#if defined(SAFE_MUTEX) else { /* Clear mutex so that safe_mutex will notice that it's not initialized */ @@ -454,7 +441,9 @@ my_bool reinit_io_cache(IO_CACHE *info, enum cache_type type, RETURN 0 we succeeded in reading all data - 1 Error: can't read requested characters + 1 Error: couldn't read requested characters. In this case: + If info->error == -1, we got a read error. + Otherwise info->error contains the number of bytes in Buffer. */ int _my_b_read(register IO_CACHE *info, uchar *Buffer, size_t Count) @@ -463,6 +452,7 @@ int _my_b_read(register IO_CACHE *info, uchar *Buffer, size_t Count) my_off_t pos_in_file; DBUG_ENTER("_my_b_read"); + /* If the buffer is not empty yet, copy what is available. */ if ((left_length= (size_t) (info->read_end-info->read_pos))) { DBUG_ASSERT(Count >= left_length); /* User is not using my_b_read() */ @@ -474,7 +464,7 @@ int _my_b_read(register IO_CACHE *info, uchar *Buffer, size_t Count) /* 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 @@ -482,7 +472,7 @@ int _my_b_read(register IO_CACHE *info, uchar *Buffer, size_t Count) */ if (info->seek_not_done) { - if ((my_seek(info->file,pos_in_file,MY_SEEK_SET,MYF(0)) + if ((mysql_file_seek(info->file, pos_in_file, MY_SEEK_SET, MYF(0)) != MY_FILEPOS_ERROR)) { /* No error, reset seek_not_done flag. */ @@ -501,19 +491,38 @@ int _my_b_read(register IO_CACHE *info, uchar *Buffer, size_t Count) } } + /* + Calculate, how much we are within a IO_SIZE block. Ideally this + should be zero. + */ diff_length= (size_t) (pos_in_file & (IO_SIZE-1)); + + /* + If more than a block plus the rest of the current block is wanted, + we do read directly, without filling the buffer. + */ 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 */ + { + /* End of file. Return, what we did copy from the buffer. */ info->error= (int) left_length; DBUG_RETURN(1); } + /* + Crop the wanted count to a multiple of IO_SIZE and subtract, + what we did already read from a block. That way, the read will + end aligned with a block. + */ length=(Count & (size_t) ~(IO_SIZE-1))-diff_length; - if ((read_length= my_read(info->file,Buffer, length, info->myflags)) + if ((read_length= mysql_file_read(info->file,Buffer, length, info->myflags)) != length) { + /* + If we didn't get, what we wanted, we either return -1 for a read + error, or (it's end of file), how much we got in total. + */ info->error= (read_length == (size_t) -1 ? -1 : (int) (read_length+left_length)); DBUG_RETURN(1); @@ -525,30 +534,52 @@ int _my_b_read(register IO_CACHE *info, uchar *Buffer, size_t Count) diff_length=0; } + /* + At this point, we want less than one and a partial block. + We will read a full cache, minus the number of bytes, we are + within a block already. So we will reach new alignment. + */ max_length= info->read_length-diff_length; + /* We will not read past end of file. */ 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 there is nothing left to read, + we either are done, or we failed to fulfill the request. + Otherwise, we read max_length into the cache. + */ if (!max_length) { if (Count) { - info->error= left_length; /* We only got this many char */ + /* We couldn't fulfil the request. Return, how much we got. */ + info->error= left_length; DBUG_RETURN(1); } length=0; /* Didn't read any chars */ } - else if ((length= my_read(info->file,info->buffer, max_length, + else if ((length= mysql_file_read(info->file,info->buffer, max_length, info->myflags)) < Count || length == (size_t) -1) { + /* + We got an read error, or less than requested (end of file). + If not a read error, copy, what we got. + */ if (length != (size_t) -1) memcpy(Buffer, info->buffer, length); info->pos_in_file= pos_in_file; + /* For a read error, return -1, otherwise, what we got in total. */ info->error= length == (size_t) -1 ? -1 : (int) (length+left_length); info->read_pos=info->read_end=info->buffer; DBUG_RETURN(1); } + /* + Count is the remaining number of bytes requested. + length is the amount of data in the cache. + Read Count bytes from the cache. + */ info->read_pos=info->buffer+Count; info->read_end=info->buffer+length; info->pos_in_file=pos_in_file; @@ -557,7 +588,6 @@ int _my_b_read(register IO_CACHE *info, uchar *Buffer, size_t Count) } -#ifdef THREAD /* Prepare IO_CACHE for shared use. @@ -639,9 +669,10 @@ void init_io_cache_share(IO_CACHE *read_cache, IO_CACHE_SHARE *cshare, 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); + mysql_mutex_init(key_IO_CACHE_SHARE_mutex, + &cshare->mutex, MY_MUTEX_INIT_FAST); + mysql_cond_init(key_IO_CACHE_SHARE_cond, &cshare->cond, 0); + mysql_cond_init(key_IO_CACHE_SHARE_cond_writer, &cshare->cond_writer, 0); cshare->running_threads= num_threads; cshare->total_threads= num_threads; @@ -692,7 +723,7 @@ void remove_io_thread(IO_CACHE *cache) if (cache == cshare->source_cache) flush_io_cache(cache); - pthread_mutex_lock(&cshare->mutex); + mysql_mutex_lock(&cshare->mutex); DBUG_PRINT("io_cache_share", ("%s: 0x%lx", (cache == cshare->source_cache) ? "writer" : "reader", (long) cache)); @@ -715,18 +746,18 @@ void remove_io_thread(IO_CACHE *cache) 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); + mysql_cond_signal(&cshare->cond_writer); + mysql_cond_broadcast(&cshare->cond); } - pthread_mutex_unlock(&cshare->mutex); + mysql_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); + mysql_cond_destroy (&cshare->cond_writer); + mysql_cond_destroy (&cshare->cond); + mysql_mutex_destroy(&cshare->mutex); } DBUG_VOID_RETURN; @@ -767,7 +798,7 @@ static int lock_io_cache(IO_CACHE *cache, my_off_t pos) DBUG_ENTER("lock_io_cache"); /* Enter the lock. */ - pthread_mutex_lock(&cshare->mutex); + mysql_mutex_lock(&cshare->mutex); cshare->running_threads--; DBUG_PRINT("io_cache_share", ("%s: 0x%lx pos: %lu running: %u", (cache == cshare->source_cache) ? @@ -784,7 +815,7 @@ static int lock_io_cache(IO_CACHE *cache, my_off_t pos) while (cshare->running_threads) { DBUG_PRINT("io_cache_share", ("writer waits in lock")); - pthread_cond_wait(&cshare->cond_writer, &cshare->mutex); + mysql_cond_wait(&cshare->cond_writer, &cshare->mutex); } DBUG_PRINT("io_cache_share", ("writer awoke, going to copy")); @@ -796,7 +827,7 @@ static int lock_io_cache(IO_CACHE *cache, my_off_t pos) if (!cshare->running_threads) { DBUG_PRINT("io_cache_share", ("waking writer")); - pthread_cond_signal(&cshare->cond_writer); + mysql_cond_signal(&cshare->cond_writer); } /* @@ -808,7 +839,7 @@ static int lock_io_cache(IO_CACHE *cache, my_off_t pos) cshare->source_cache) { DBUG_PRINT("io_cache_share", ("reader waits in lock")); - pthread_cond_wait(&cshare->cond, &cshare->mutex); + mysql_cond_wait(&cshare->cond, &cshare->mutex); } /* @@ -850,7 +881,7 @@ static int lock_io_cache(IO_CACHE *cache, my_off_t pos) cshare->running_threads) { DBUG_PRINT("io_cache_share", ("reader waits in lock")); - pthread_cond_wait(&cshare->cond, &cshare->mutex); + mysql_cond_wait(&cshare->cond, &cshare->mutex); } /* If the block is not yet read, continue with a locked cache and read. */ @@ -872,7 +903,7 @@ static int lock_io_cache(IO_CACHE *cache, my_off_t pos) 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); + mysql_mutex_unlock(&cshare->mutex); DBUG_RETURN(0); } @@ -915,8 +946,8 @@ static void unlock_io_cache(IO_CACHE *cache) cshare->total_threads)); cshare->running_threads= cshare->total_threads; - pthread_cond_broadcast(&cshare->cond); - pthread_mutex_unlock(&cshare->mutex); + mysql_cond_broadcast(&cshare->cond); + mysql_mutex_unlock(&cshare->mutex); DBUG_VOID_RETURN; } @@ -1011,7 +1042,7 @@ int _my_b_read_r(register IO_CACHE *cache, uchar *Buffer, size_t Count) */ if (cache->seek_not_done) { - if (my_seek(cache->file, pos_in_file, MY_SEEK_SET, MYF(0)) + if (mysql_file_seek(cache->file, pos_in_file, MY_SEEK_SET, MYF(0)) == MY_FILEPOS_ERROR) { cache->error= -1; @@ -1019,7 +1050,7 @@ int _my_b_read_r(register IO_CACHE *cache, uchar *Buffer, size_t Count) DBUG_RETURN(1); } } - len= my_read(cache->file, cache->buffer, length, cache->myflags); + len= mysql_file_read(cache->file, cache->buffer, length, cache->myflags); } DBUG_PRINT("io_cache_share", ("read %lu bytes", (ulong) len)); @@ -1117,7 +1148,6 @@ static void copy_to_read_buffer(IO_CACHE *write_cache, write_length-= copy_length; } } -#endif /*THREAD*/ /* @@ -1158,7 +1188,7 @@ int _my_b_seq_read(register IO_CACHE *info, uchar *Buffer, size_t Count) 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) + if (mysql_file_seek(info->file, pos_in_file, MY_SEEK_SET, MYF(0)) == MY_FILEPOS_ERROR) { info->error= -1; unlock_append_buffer(info); @@ -1175,8 +1205,8 @@ int _my_b_seq_read(register IO_CACHE *info, uchar *Buffer, size_t Count) 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) + if ((read_length= mysql_file_read(info->file,Buffer, length, + info->myflags)) == (size_t) -1) { info->error= -1; unlock_append_buffer(info); @@ -1209,7 +1239,7 @@ int _my_b_seq_read(register IO_CACHE *info, uchar *Buffer, size_t Count) } else { - length= my_read(info->file,info->buffer, max_length, info->myflags); + length= mysql_file_read(info->file,info->buffer, max_length, info->myflags); if (length == (size_t) -1) { info->error= -1; @@ -1386,7 +1416,7 @@ int _my_b_async_read(register IO_CACHE *info, uchar *Buffer, size_t Count) return 1; } - if (my_seek(info->file,next_pos_in_file,MY_SEEK_SET,MYF(0)) + if (mysql_file_seek(info->file, next_pos_in_file, MY_SEEK_SET, MYF(0)) == MY_FILEPOS_ERROR) { info->error= -1; @@ -1396,8 +1426,8 @@ int _my_b_async_read(register IO_CACHE *info, uchar *Buffer, size_t Count) 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) + if ((read_length=mysql_file_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); @@ -1417,7 +1447,7 @@ int _my_b_async_read(register IO_CACHE *info, uchar *Buffer, size_t Count) } else { /* Big block, don't cache it */ - if ((read_length= my_read(info->file,Buffer, Count,info->myflags)) + if ((read_length= mysql_file_read(info->file, Buffer, Count,info->myflags)) != Count) { info->error= read_length == (size_t) -1 ? -1 : read_length+left_length; @@ -1524,17 +1554,16 @@ int _my_b_write(register IO_CACHE *info, const uchar *Buffer, size_t Count) "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))) + if (mysql_file_seek(info->file, info->pos_in_file, MY_SEEK_SET, MYF(0))) { info->error= -1; return (1); } info->seek_not_done=0; } - if (my_write(info->file, Buffer, length, info->myflags | MY_NABP)) + if (mysql_file_write(info->file, Buffer, length, info->myflags | MY_NABP)) return info->error= -1; -#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 @@ -1548,7 +1577,6 @@ int _my_b_write(register IO_CACHE *info, const uchar *Buffer, size_t Count) */ if (info->share) copy_to_read_buffer(info, Buffer, length); -#endif Count-=length; Buffer+=length; @@ -1570,13 +1598,11 @@ 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 lock_append_buffer(info); rest_length= (size_t) (info->write_end - info->write_pos); @@ -1594,7 +1620,7 @@ int my_b_append(register IO_CACHE *info, const uchar *Buffer, size_t Count) 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)) + if (mysql_file_write(info->file,Buffer, length, info->myflags | MY_NABP)) { unlock_append_buffer(info); return info->error= -1; @@ -1638,23 +1664,21 @@ int my_block_write(register IO_CACHE *info, const uchar *Buffer, size_t Count, 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) - return my_pwrite(info->file, Buffer, Count, pos, - info->myflags | MY_NABP); + return mysql_file_pwrite(info->file, Buffer, Count, pos, + info->myflags | MY_NABP); /* 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)) + if (mysql_file_pwrite(info->file, Buffer, length, pos, info->myflags | MY_NABP)) info->error= error= -1; Buffer+=length; pos+= length; @@ -1690,16 +1714,10 @@ int my_block_write(register IO_CACHE *info, const uchar *Buffer, size_t Count, /* 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 __attribute__((unused))) @@ -1710,10 +1728,8 @@ int my_b_flush_io_cache(IO_CACHE *info, DBUG_ENTER("my_b_flush_io_cache"); DBUG_PRINT("enter", ("cache: 0x%lx", (long) info)); -#ifdef THREAD if (!append_cache) need_append_buffer_lock= 0; -#endif if (info->type == WRITE_CACHE || append_cache) { @@ -1726,7 +1742,6 @@ int my_b_flush_io_cache(IO_CACHE *info, 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 @@ -1735,7 +1750,6 @@ int my_b_flush_io_cache(IO_CACHE *info, */ if (info->share) copy_to_read_buffer(info, info->write_buffer, length); -#endif pos_in_file=info->pos_in_file; /* @@ -1744,7 +1758,7 @@ int my_b_flush_io_cache(IO_CACHE *info, */ if (!append_cache && info->seek_not_done) { /* File touched, do seek */ - if (my_seek(info->file,pos_in_file,MY_SEEK_SET,MYF(0)) == + if (mysql_file_seek(info->file, pos_in_file, MY_SEEK_SET, MYF(0)) == MY_FILEPOS_ERROR) { UNLOCK_APPEND_BUFFER; @@ -1758,7 +1772,7 @@ int my_b_flush_io_cache(IO_CACHE *info, 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, + if (mysql_file_write(info->file,info->write_buffer,length, info->myflags | MY_NABP)) info->error= -1; else @@ -1770,7 +1784,7 @@ int my_b_flush_io_cache(IO_CACHE *info, 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->end_of_file == mysql_file_tell(info->file, MYF(0))); } info->append_read_pos=info->write_pos=info->write_buffer; @@ -1814,13 +1828,11 @@ int end_io_cache(IO_CACHE *info) DBUG_ENTER("end_io_cache"); DBUG_PRINT("enter",("cache: 0x%lx", (ulong) 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)) { @@ -1832,16 +1844,14 @@ int end_io_cache(IO_CACHE *info) 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)); + my_free(info->buffer); 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 + mysql_mutex_destroy(&info->append_buffer_lock); } DBUG_RETURN(error); } /* end_io_cache */ @@ -1918,7 +1928,7 @@ int main(int argc, char** argv) total_bytes += 4+block_size; } close_file(&sra_cache); - my_free(block,MYF(MY_WME)); + my_free(block); if (!my_stat(fname,&status,MYF(MY_WME))) die("%s failed to stat, but I had just closed it,\ wonder how that happened"); diff --git a/dep/mysqllite/mysys/mf_iocache2.c b/dep/mysqllite/mysys/mf_iocache2.c index c54c7d13548fd..8962a037da062 100644 --- a/dep/mysqllite/mysys/mf_iocache2.c +++ b/dep/mysqllite/mysys/mf_iocache2.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (C) 2000 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 @@ -17,7 +17,6 @@ More functions to be used with IO_CACHE files */ -#define MAP_TO_USE_RAID #include "mysys_priv.h" #include #include @@ -70,6 +69,16 @@ my_b_copy_to_file(IO_CACHE *cache, FILE *file) my_off_t my_b_append_tell(IO_CACHE* info) { + /* + Sometimes we want to make sure that the variable is not put into + a register in debugging mode so we can see its value in the core + */ +#ifndef DBUG_OFF +# define dbug_volatile volatile +#else +# define dbug_volatile +#endif + /* 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 @@ -81,9 +90,8 @@ my_off_t my_b_append_tell(IO_CACHE* info) 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 + mysql_mutex_lock(&info->append_buffer_lock); + #ifndef DBUG_OFF /* Make sure EOF is where we think it is. Note that we cannot just use @@ -103,9 +111,7 @@ my_off_t my_b_append_tell(IO_CACHE* info) } #endif res = info->end_of_file + (info->write_pos-info->append_read_pos); -#ifdef THREAD - pthread_mutex_unlock(&info->append_buffer_lock); -#endif + mysql_mutex_unlock(&info->append_buffer_lock); return res; } @@ -135,7 +141,7 @@ void my_b_seek(IO_CACHE *info,my_off_t pos) b) see if there is a better way to make it work */ if (info->type == SEQ_READ_APPEND) - VOID(flush_io_cache(info)); + (void) flush_io_cache(info); offset=(pos - info->pos_in_file); @@ -163,7 +169,7 @@ void my_b_seek(IO_CACHE *info,my_off_t pos) info->write_pos = info->write_buffer + offset; DBUG_VOID_RETURN; } - VOID(flush_io_cache(info)); + (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))); diff --git a/dep/mysqllite/mysys/mf_keycache.c b/dep/mysqllite/mysys/mf_keycache.c new file mode 100644 index 0000000000000..42cdea65f34d1 --- /dev/null +++ b/dep/mysqllite/mysys/mf_keycache.c @@ -0,0 +1,4523 @@ +/* Copyright (C) 2000 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 + 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 + mysql_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 + mysql_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 +#include "probes_mysql.h" + +/* + 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 mysql_cond_wait for calls of + mysql_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 mysql_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 */ +}; + +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); + +static void wait_on_queue(KEYCACHE_WQUEUE *wqueue, + mysql_mutex_t *mutex); +static void release_whole_queue(KEYCACHE_WQUEUE *wqueue); + +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(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) + +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 +#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(mysql_cond_t *cond, + mysql_mutex_t *mutex); +#else +#define keycache_pthread_cond_wait(C, M) mysql_cond_wait(C, M) +#endif + +#if defined(KEYCACHE_DEBUG) +static int keycache_pthread_mutex_lock(mysql_mutex_t *mutex); +static void keycache_pthread_mutex_unlock(mysql_mutex_t *mutex); +static int keycache_pthread_cond_signal(mysql_cond_t *cond); +#else +#define keycache_pthread_mutex_lock(M) mysql_mutex_lock(M) +#define keycache_pthread_mutex_unlock(M) mysql_mutex_unlock(M) +#define keycache_pthread_cond_signal(C) mysql_cond_signal(C) +#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; + mysql_mutex_init(key_KEY_CACHE_cache_lock, + &keycache->cache_lock, MY_MUTEX_INIT_FAST); + keycache->resize_queue.last_thread= 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); + 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: 0x%lx hash_entries: %d\ + hash_root: 0x%lx hash_links: %d hash_link_root: 0x%lx", + keycache->disk_blocks, (long) keycache->block_root, + keycache->hash_entries, (long) keycache->hash_root, + keycache->hash_links, (long) 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); + keycache->block_mem= NULL; + } + if (keycache->block_root) + { + my_free(keycache->block_root); + 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); + + /* + 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 */ + } + + /* + 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; + } + + /* + 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); + + /* + 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: 0x%lx", (long) 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); + keycache->block_mem= NULL; + my_free(keycache->block_root); + 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) + { + mysql_mutex_destroy(&keycache->cache_lock); + keycache->key_cache_inited= keycache->can_be_used= 0; + KEYCACHE_DEBUG_CLOSE; + } + DBUG_VOID_RETURN; +} /* end_key_cache */ + + +/* + 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, + mysql_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; +} + + +/* + 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); + + 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; + } + + 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); + + if (! --block->hash_link->requests && block->condvar) + keycache_pthread_cond_signal(block->condvar); +} + + +/* + 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) +{ + 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; + } +} + + +/* + 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; + + 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; + } + 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 + { + /* 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; + 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. + */ + + 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); + } + + /* + 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= my_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_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) +{ + size_t 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; + + if (MYSQL_KEYCACHE_READ_START_ENABLED()) + { + MYSQL_KEYCACHE_READ_START(my_filename(file), length, + (ulong) (keycache->blocks_used * + keycache->key_cache_block_size), + (ulong) (keycache->blocks_unused * + keycache->key_cache_block_size)); + } + + /* + 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); + + if (block_length > keycache->key_cache_block_size || offset) + return_buffer=0; + + /* Request the cache block that matches file/pos. */ + keycache->global_cache_r_requests++; + + MYSQL_KEYCACHE_READ_BLOCK(keycache->key_cache_block_size); + + 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) + { + MYSQL_KEYCACHE_READ_MISS(); + /* 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; + } + else + { + MYSQL_KEYCACHE_READ_HIT(); + } + } + + /* block status may have added BLOCK_ERROR in the above 'if'. */ + if (!(block->status & BLOCK_ERROR)) + { + { + 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 */ + 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; + } + + next_block: + buff+= read_length; + filepos+= read_length+offset; + offset= 0; + + } while ((length-= read_length)); + if (MYSQL_KEYCACHE_READ_DONE_ENABLED()) + { + MYSQL_KEYCACHE_READ_DONE((ulong) (keycache->blocks_used * + keycache->key_cache_block_size), + (ulong) (keycache->blocks_unused * + keycache->key_cache_block_size)); + } + 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 */ + 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 + + 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) +{ + 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 (my_pwrite(file, buff, length, filepos, MYF(MY_NABP | MY_WAIT_IF_FULL))) + 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; + + if (MYSQL_KEYCACHE_WRITE_START_ENABLED()) + { + MYSQL_KEYCACHE_WRITE_START(my_filename(file), length, + (ulong) (keycache->blocks_used * + keycache->key_cache_block_size), + (ulong) (keycache->blocks_unused * + keycache->key_cache_block_size)); + } + + /* + 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; + + MYSQL_KEYCACHE_WRITE_BLOCK(keycache->key_cache_block_size); + /* 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 (my_pwrite(file, (uchar*) buff, read_length, filepos + offset, + MYF(MY_NABP | MY_WAIT_IF_FULL))) + 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)) + { +#if !defined(SERIALIZED_READ_FROM_CACHE) + keycache_pthread_mutex_unlock(&keycache->cache_lock); +#endif + 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 (my_pwrite(file, (uchar*) buff, length, filepos, + MYF(MY_NABP | MY_WAIT_IF_FULL))) + 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 (MYSQL_KEYCACHE_WRITE_DONE_ENABLED()) + { + MYSQL_KEYCACHE_WRITE_DONE((ulong) (keycache->blocks_used * + keycache->key_cache_block_size), + (ulong) (keycache->blocks_unused * + keycache->key_cache_block_size)); + } + +#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= my_pwrite(file, block->buffer+block->offset, + block->length - block->offset, + block->hash_link->diskpos+ block->offset, + MYF(MY_NABP | MY_WAIT_IF_FULL)); + 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 + + 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 *UNINIT_VAR(next_hash_link); + my_off_t UNINIT_VAR(next_diskpos); + File UNINIT_VAR(next_file); + uint UNINIT_VAR(next_status); + uint UNINIT_VAR(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(cache); + 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: 0x%lx", (long) 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 + { + mysql_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(mysql_cond_t *cond, + mysql_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= mysql_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(mysql_cond_t *cond, + mysql_mutex_t *mutex) +{ + int rc; + KEYCACHE_THREAD_TRACE_END("started waiting"); + rc= mysql_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(mysql_mutex_t *mutex) +{ + int rc; + rc= mysql_mutex_lock(mutex); + KEYCACHE_THREAD_TRACE_BEGIN(""); + return rc; +} + + +static void keycache_pthread_mutex_unlock(mysql_mutex_t *mutex) +{ + KEYCACHE_THREAD_TRACE_END(""); + mysql_mutex_unlock(mutex); +} + + +static int keycache_pthread_cond_signal(mysql_cond_t *cond) +{ + int rc; + KEYCACHE_THREAD_TRACE("signal"); + rc= mysql_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/dep/mysqllite/mysys/mf_keycaches.c b/dep/mysqllite/mysys/mf_keycaches.c new file mode 100644 index 0000000000000..93b7eab4561d2 --- /dev/null +++ b/dep/mysqllite/mysys/mf_keycaches.c @@ -0,0 +1,361 @@ +/* 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 "mysys_priv.h" +#include +#include +#include + +/***************************************************************************** + 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). +*****************************************************************************/ + +/* + 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 +{ + rw_lock_t mutex; + HASH hash; + uchar *default_value; + SAFE_HASH_ENTRY *root; +} SAFE_HASH; + + +/* + Free a SAFE_HASH_ENTRY + + This function is called by the hash object on delete +*/ + +static void safe_hash_entry_free(SAFE_HASH_ENTRY *entry) +{ + DBUG_ENTER("free_assign_entry"); + my_free(entry); + DBUG_VOID_RETURN; +} + + +/* Get key and length for a SAFE_HASH_ENTRY */ + +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 +*/ + +static my_bool safe_hash_init(SAFE_HASH *hash, uint elements, + uchar *default_value) +{ + DBUG_ENTER("safe_hash"); + 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 + + NOTES + This is safe to call on any object that has been sent to safe_hash_init() +*/ + +static 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 +*/ + +static uchar *safe_hash_search(SAFE_HASH *hash, const uchar *key, uint length) +{ + 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= hash->default_value; + else + result= ((SAFE_HASH_ENTRY*) result)->data; + DBUG_PRINT("exit",("data: 0x%lx", (long) result)); + DBUG_RETURN(result); +} + + +/* + Associate a key with some data + + SYONOPSIS + 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. +*/ + +static 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(entry); + error= 1; + goto end; + } + } + +end: + rw_unlock(&hash->mutex); + DBUG_RETURN(error); +} + + +/* + Change all entres with one data value to another data value + + SYONOPSIS + 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. +*/ + +static void safe_hash_change(SAFE_HASH *hash, uchar *old_data, uchar *new_data) +{ + SAFE_HASH_ENTRY *entry, *next; + DBUG_ENTER("safe_hash_set"); + + 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; +} + + +/***************************************************************************** + 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. + + 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) +{ + if (!key_cache_hash.hash.records) + return dflt_key_cache; + return (KEY_CACHE*) safe_hash_search(&key_cache_hash, key, length); +} + + +/* + 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/dep/mysqllite/mysys/mf_loadpath.c b/dep/mysqllite/mysys/mf_loadpath.c index b329d103d944c..9350babc1768d 100644 --- a/dep/mysqllite/mysys/mf_loadpath.c +++ b/dep/mysqllite/mysys/mf_loadpath.c @@ -34,7 +34,7 @@ char * my_load_path(char * to, const char *path, if ((path[0] == FN_HOMELIB && path[1] == FN_LIBCHAR) || test_if_hard_path(path)) - VOID(strnmov(buff, path, FN_REFLEN)); + (void) strnmov(buff, path, FN_REFLEN); else if ((is_cur=(path[0] == FN_CURLIB && path[1] == FN_LIBCHAR)) || (is_prefix(path,FN_PARENTDIR)) || ! own_path_prefix) @@ -42,12 +42,12 @@ char * my_load_path(char * to, const char *path, if (is_cur) is_cur=2; /* Remove current dir */ if (! my_getwd(buff,(uint) (FN_REFLEN-strlen(path)+is_cur),MYF(0))) - VOID(strncat(buff, path+is_cur, FN_REFLEN-1)); + (void) strncat(buff, path+is_cur, FN_REFLEN-1); else - VOID(strnmov(buff, path, FN_REFLEN)); /* Return org file name */ + (void) strnmov(buff, path, FN_REFLEN); /* Return org file name */ } else - VOID(strxnmov(buff, FN_REFLEN, own_path_prefix,path, NullS)); + (void) strxnmov(buff, FN_REFLEN, own_path_prefix, path, NullS); strnmov(to, buff, FN_REFLEN); to[FN_REFLEN-1]= '\0'; DBUG_PRINT("exit",("to: %s",to)); diff --git a/dep/mysqllite/mysys/mf_pack.c b/dep/mysqllite/mysys/mf_pack.c index 86fd61537e72f..292cd8c0454a2 100644 --- a/dep/mysqllite/mysys/mf_pack.c +++ b/dep/mysqllite/mysys/mf_pack.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. This 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,13 +18,8 @@ #ifdef HAVE_PWD_H #include #endif -#ifdef VMS -#include -#include -#include -#endif /* VMS */ -static char * NEAR_F expand_tilde(char * *path); +static char * expand_tilde(char **path); /* Pack a dirname ; Changes HOME to ~/ and current dev to ./ */ /* from is a dirname (from dirname() ?) ending with FN_LIBCHAR */ @@ -197,7 +192,8 @@ size_t cleanup_dirname(register char *to, const char *from) end_parentdir=pos; while (pos >= start && *pos != FN_LIBCHAR) /* remove prev dir */ pos--; - if (pos[1] == FN_HOMELIB || memcmp(pos,parent,length) == 0) + if (pos[1] == FN_HOMELIB || + (pos > start && memcmp(pos, parent, length) == 0)) { /* Don't remove ~user/ */ pos=strmov(end_parentdir+1,parent); *pos=FN_LIBCHAR; @@ -300,8 +296,7 @@ size_t normalize_dirname(char *to, const char *from) /* 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). + format (TODO: name this properly). */ (void) intern_filename(buff, from); length= strlen(buff); /* Fix that '/' is last */ @@ -377,7 +372,7 @@ size_t unpack_dirname(char * to, const char *from) /* 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) +static char * expand_tilde(char **path) { if (path[0][0] == FN_LIBCHAR) return home_dir; /* ~/ expanded to home */ @@ -443,73 +438,10 @@ size_t unpack_filename(char * to, const char *from) /* 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) +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) */ diff --git a/dep/mysqllite/mysys/mf_path.c b/dep/mysqllite/mysys/mf_path.c index 73e73cb7f7695..92cb62e682759 100644 --- a/dep/mysqllite/mysys/mf_path.c +++ b/dep/mysqllite/mysys/mf_path.c @@ -42,7 +42,7 @@ char * my_path(char * to, const char *progname, ((prog=getenv("_")) != 0 && dirname_part(to, prog, &to_length)))) { - VOID(intern_filename(to,to)); + (void) intern_filename(to,to); if (!test_if_hard_path(to)) { if (!my_getwd(curr_dir,FN_REFLEN,MYF(0))) @@ -60,11 +60,11 @@ char * my_path(char * to, const char *progname, end= (char*) "/my/"; #endif } - VOID(intern_filename(to,end)); + (void) intern_filename(to,end); to=strend(to); if (to != start && to[-1] != FN_LIBCHAR) *to++ = FN_LIBCHAR; - VOID(strmov(to,own_pathname_part)); + (void) strmov(to,own_pathname_part); } DBUG_PRINT("exit",("to: '%s'",start)); DBUG_RETURN(start); @@ -78,9 +78,6 @@ char * my_path(char * to, const char *progname, #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 diff --git a/dep/mysqllite/include/help_end.h b/dep/mysqllite/mysys/mf_qsort2.c similarity index 71% rename from dep/mysqllite/include/help_end.h rename to dep/mysqllite/mysys/mf_qsort2.c index 4426cb80bce3a..ca2bd1a49528c 100644 --- a/dep/mysqllite/include/help_end.h +++ b/dep/mysqllite/mysys/mf_qsort2.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2004-2005 MySQL AB +/* 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 @@ -11,12 +11,9 @@ You 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 */ + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifdef __NETWARE__ -#undef printf -#undef puts -#undef fputs -#undef fputc -#undef putchar -#endif +/* qsort that sends one extra argument to the compare subrutine */ + +#define QSORT_EXTRA_CMP_ARGUMENT +#include "mf_qsort.c" diff --git a/dep/mysqllite/mysys/mf_radix.c b/dep/mysqllite/mysys/mf_radix.c new file mode 100644 index 0000000000000..582ca76b8f82a --- /dev/null +++ b/dep/mysqllite/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/dep/mysqllite/strings/strtoull.c b/dep/mysqllite/mysys/mf_same.c similarity index 53% rename from dep/mysqllite/strings/strtoull.c rename to dep/mysqllite/mysys/mf_same.c index 94bf6904f8de4..6738dc8051e81 100644 --- a/dep/mysqllite/strings/strtoull.c +++ b/dep/mysqllite/mysys/mf_same.c @@ -13,22 +13,28 @@ 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 +/* Kopierar biblioteksstrukturen och extensionen fr}n ett filnamn */ + +#include "mysys_priv.h" #include -#if !defined(HAVE_STRTOULL) && defined(HAVE_LONG_LONG) -#define USE_UNSIGNED -#define USE_LONGLONG -#include "strto.c" -#endif + /* + 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/dep/mysqllite/mysys/my_net.c b/dep/mysqllite/mysys/mf_sort.c similarity index 59% rename from dep/mysqllite/mysys/my_net.c rename to dep/mysqllite/mysys/mf_sort.c index 81d977210f82e..a3e7465ead016 100644 --- a/dep/mysqllite/mysys/my_net.c +++ b/dep/mysqllite/mysys/mf_sort.c @@ -13,30 +13,29 @@ 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 */ +/* Sort of string pointers in string-order with radix or qsort */ #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) +void my_string_ptr_sort(uchar *base, uint items, size_t size) { - char *ptr; - pthread_mutex_lock(&THR_LOCK_net); - ptr=inet_ntoa(in); - strmov(buf,ptr); - pthread_mutex_unlock(&THR_LOCK_net); +#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(ptr); + } + else +#endif + { + if (size && items) + { + my_qsort2(base,items, sizeof(uchar*), get_ptr_compare(size), + (void*) &size); + } + } } diff --git a/dep/mysqllite/mysys/mf_soundex.c b/dep/mysqllite/mysys/mf_soundex.c new file mode 100644 index 0000000000000..fe30d8c81aff3 --- /dev/null +++ b/dep/mysqllite/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/dep/mysqllite/mysys/mf_tempdir.c b/dep/mysqllite/mysys/mf_tempdir.c new file mode 100644 index 0000000000000..c84987cfc9631 --- /dev/null +++ b/dep/mysqllite/mysys/mf_tempdir.c @@ -0,0 +1,95 @@ +/* Copyright (C) 2000 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 */ + +#include "mysys_priv.h" +#include + +#if defined(__WIN__) +#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")); + + mysql_mutex_init(key_TMPDIR_mutex, &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__) + if (!pathlist) + pathlist=getenv("TEMP"); + if (!pathlist) + pathlist=getenv("TMP"); +#endif + if (!pathlist || !pathlist[0]) + pathlist=(char*) P_tmpdir; + } + do + { + size_t 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 */ + mysql_mutex_destroy(&tmpdir->mutex); + DBUG_RETURN(TRUE); +} + + +char *my_tmpdir(MY_TMPDIR *tmpdir) +{ + char *dir; + if (!tmpdir->max) + return tmpdir->list[0]; + mysql_mutex_lock(&tmpdir->mutex); + dir=tmpdir->list[tmpdir->cur]; + tmpdir->cur= (tmpdir->cur == tmpdir->max) ? 0 : tmpdir->cur+1; + mysql_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]); + delete_dynamic(&tmpdir->full_list); + mysql_mutex_destroy(&tmpdir->mutex); +} + diff --git a/dep/mysqllite/mysys/mf_tempfile.c b/dep/mysqllite/mysys/mf_tempfile.c index 40016210de4d4..e85124fb4c304 100644 --- a/dep/mysqllite/mysys/mf_tempfile.c +++ b/dep/mysqllite/mysys/mf_tempfile.c @@ -100,16 +100,7 @@ File create_temp_file(char *to, const char *dir, const char *prefix, 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__) +#elif defined(HAVE_MKSTEMP) { char prefix_buff[30]; uint pfx_len; @@ -143,9 +134,7 @@ File create_temp_file(char *to, const char *dir, const char *prefix, } #elif defined(HAVE_TEMPNAM) { -#if !defined(__NETWARE__) extern char **environ; -#endif char *res,**old_env,*temp_env[1]; if (dir && !dir[0]) @@ -154,14 +143,14 @@ File create_temp_file(char *to, const char *dir, const char *prefix, 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); @@ -176,9 +165,8 @@ File create_temp_file(char *to, const char *dir, const char *prefix, { 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 diff --git a/dep/mysqllite/mysys/mf_unixpath.c b/dep/mysqllite/mysys/mf_unixpath.c index 75f8de1487936..ee81aae458483 100644 --- a/dep/mysqllite/mysys/mf_unixpath.c +++ b/dep/mysqllite/mysys/mf_unixpath.c @@ -16,10 +16,15 @@ #include "mysys_priv.h" #include - /* convert filename to unix style filename */ - /* If MSDOS converts '\' to '/' */ +/** + Convert filename to unix style filename. -void to_unix_path(char * to __attribute__((unused))) + @remark On Windows, converts '\' to '/'. + + @param to A pathname. +*/ + +void to_unix_path(char *to __attribute__((unused))) { #if FN_LIBCHAR != '/' { diff --git a/dep/mysqllite/mysys/my_aes.c b/dep/mysqllite/mysys/my_aes.c new file mode 100644 index 0000000000000..575d4702deef3 --- /dev/null +++ b/dep/mysqllite/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/mysqllite/mysys/my_alarm.c b/dep/mysqllite/mysys/my_alarm.c new file mode 100644 index 0000000000000..d6a0da1bd13bb --- /dev/null +++ b/dep/mysqllite/mysys/my_alarm.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 */ + +/* Function to set a varible when we got a alarm */ +/* Used by my_lock samt functions in m_alarm.h */ + + +#include "mysys_priv.h" +#include "my_alarm.h" + +#ifdef HAVE_ALARM + + /* 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/dep/mysqllite/mysys/my_alloc.c b/dep/mysqllite/mysys/my_alloc.c index dd27dcda41ef2..903826dd97504 100644 --- a/dep/mysqllite/mysys/my_alloc.c +++ b/dep/mysqllite/mysys/my_alloc.c @@ -120,7 +120,7 @@ void reset_root_defaults(MEM_ROOT *mem_root, size_t block_size, { /* remove block from the list and free it */ *prev= mem->next; - my_free(mem, MYF(0)); + my_free(mem); } else prev= &mem->next; @@ -163,7 +163,7 @@ void *alloc_root(MEM_ROOT *mem_root, size_t length) }); length+=ALIGN_SIZE(sizeof(USED_MEM)); - if (!(next = (USED_MEM*) my_malloc(length,MYF(MY_WME)))) + if (!(next = (USED_MEM*) my_malloc(length,MYF(MY_WME | ME_FATALERROR)))) { if (mem_root->error_handler) (*mem_root->error_handler)(); @@ -214,7 +214,7 @@ void *alloc_root(MEM_ROOT *mem_root, size_t length) 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)))) + if (!(next = (USED_MEM*) my_malloc(get_size,MYF(MY_WME | ME_FATALERROR)))) { if (mem_root->error_handler) (*mem_root->error_handler)(); @@ -362,13 +362,13 @@ void free_root(MEM_ROOT *root, myf MyFlags) { old=next; next= next->next ; if (old != root->pre_alloc) - my_free(old,MYF(0)); + my_free(old); } for (next=root->free ; next ;) { old=next; next= next->next; if (old != root->pre_alloc) - my_free(old,MYF(0)); + my_free(old); } root->used=root->free=0; if (root->pre_alloc) diff --git a/dep/mysqllite/mysys/my_atomic.c b/dep/mysqllite/mysys/my_atomic.c new file mode 100644 index 0000000000000..7cbe15cfb74c6 --- /dev/null +++ b/dep/mysqllite/mysys/my_atomic.c @@ -0,0 +1,67 @@ +/* Copyright (C) 2006 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 */ + +#include +#include + +#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 +} + +#ifdef SAFE_MUTEX +#undef pthread_mutex_init +#undef pthread_mutex_destroy +#undef pthread_mutex_lock +#undef pthread_mutex_unlock + +void plain_pthread_mutex_init(safe_mutex_t *m) +{ + pthread_mutex_init(& m->mutex, NULL); +} + +void plain_pthread_mutex_destroy(safe_mutex_t *m) +{ + pthread_mutex_destroy(& m->mutex); +} + +void plain_pthread_mutex_lock(safe_mutex_t *m) +{ + pthread_mutex_lock(& m->mutex); +} + +void plain_pthread_mutex_unlock(safe_mutex_t *m) +{ + pthread_mutex_unlock(& m->mutex); +} + +#endif + + diff --git a/dep/mysqllite/mysys/my_bit.c b/dep/mysqllite/mysys/my_bit.c new file mode 100644 index 0000000000000..f072f24376582 --- /dev/null +++ b/dep/mysqllite/mysys/my_bit.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 + +#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/dep/mysqllite/mysys/my_bitmap.c b/dep/mysqllite/mysys/my_bitmap.c new file mode 100644 index 0000000000000..dc15014121b59 --- /dev/null +++ b/dep/mysqllite/mysys/my_bitmap.c @@ -0,0 +1,932 @@ +/* Copyright (C) 2000 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 */ + +/* + 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_* + + 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))) +{ + if (map->mutex) + mysql_mutex_lock(map->mutex); +} + +static inline void bitmap_unlock(MY_BITMAP *map __attribute__((unused))) +{ + if (map->mutex) + mysql_mutex_unlock(map->mutex); +} + + +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; + + if (thread_safe) + { + size_in_bytes= ALIGN_SIZE(size_in_bytes); + extra= sizeof(mysql_mutex_t); + } + map->mutex= 0; + + if (!(buf= (my_bitmap_map*) my_malloc(size_in_bytes+extra, MYF(MY_WME)))) + DBUG_RETURN(1); + + if (thread_safe) + { + map->mutex= (mysql_mutex_t *) ((char*) buf + size_in_bytes); + mysql_mutex_init(key_BITMAP_mutex, map->mutex, MY_MUTEX_INIT_FAST); + } + + } + + else + { + DBUG_ASSERT(thread_safe == 0); + } + + + 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) + { + if (map->mutex) + mysql_mutex_destroy(map->mutex); + + my_free(map->bitmap); + 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 MAIN + +uint get_rand_bit(uint bitsize) +{ + return (rand() % bitsize); +} + +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; +} + +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; +} + +bool test_operators(MY_BITMAP *map __attribute__((unused)), + uint bitsize __attribute__((unused))) +{ + return FALSE; +} + +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; +} + +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; +} + +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; +} + +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; +} + +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; +} + + +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/dep/mysqllite/mysys/my_chsize.c b/dep/mysqllite/mysys/my_chsize.c index b1dbb22c687a6..b9013811b3480 100644 --- a/dep/mysqllite/mysys/my_chsize.c +++ b/dep/mysqllite/mysys/my_chsize.c @@ -52,20 +52,13 @@ int my_chsize(File fd, my_off_t newlength, int filler, myf MyFlags) if (oldsize > newlength) { -#if defined(HAVE_SETFILEPOINTER) - /* This is for the moment only true on windows */ - long is_success; - HANDLE win_file= (HANDLE) _get_osfhandle(fd); - long length_low, length_high; - length_low= (long) (ulong) newlength; - length_high= (long) ((ulonglong) newlength >> 32); - is_success= SetFilePointer(win_file, length_low, &length_high, FILE_BEGIN); - if (is_success == -1 && (my_errno= GetLastError()) != NO_ERROR) +#ifdef _WIN32 + if (my_win_chsize(fd, newlength)) + { + my_errno= errno; goto err; - if (SetEndOfFile(win_file)) - DBUG_RETURN(0); - my_errno= GetLastError(); - goto err; + } + DBUG_RETURN(0); #elif defined(HAVE_FTRUNCATE) if (ftruncate(fd, (off_t) newlength)) { diff --git a/dep/mysqllite/mysys/my_compress.c b/dep/mysqllite/mysys/my_compress.c index a3d9d56915ebf..360390d376a54 100644 --- a/dep/mysqllite/mysys/my_compress.c +++ b/dep/mysqllite/mysys/my_compress.c @@ -51,7 +51,7 @@ my_bool my_compress(uchar *packet, size_t *len, size_t *complen) if (!compbuf) DBUG_RETURN(*complen ? 0 : 1); memcpy(packet,compbuf,*len); - my_free(compbuf,MYF(MY_WME)); + my_free(compbuf); } DBUG_RETURN(0); } @@ -73,14 +73,14 @@ uchar *my_compress_alloc(const uchar *packet, size_t *len, size_t *complen) if (res != Z_OK) { - my_free(compbuf, MYF(MY_WME)); + my_free(compbuf); return 0; } if (*complen >= *len) { *complen= 0; - my_free(compbuf, MYF(MY_WME)); + my_free(compbuf); DBUG_PRINT("note",("Packet got longer on compression; Not compressed")); return 0; } @@ -125,11 +125,11 @@ my_bool my_uncompress(uchar *packet, size_t len, size_t *complen) if (error != Z_OK) { /* Probably wrong packet */ DBUG_PRINT("error",("Can't uncompress packet, error: %d",error)); - my_free(compbuf, MYF(MY_WME)); + my_free(compbuf); DBUG_RETURN(1); } memcpy(packet, compbuf, *complen); - my_free(compbuf, MYF(MY_WME)); + my_free(compbuf); } else *complen= len; @@ -250,7 +250,7 @@ int unpackfrm(uchar **unpack_data, size_t *unpack_len, if (my_uncompress(data, complen, &orglen)) { - my_free(data, MYF(0)); + my_free(data); DBUG_RETURN(3); } diff --git a/dep/mysqllite/mysys/my_conio.c b/dep/mysqllite/mysys/my_conio.c new file mode 100644 index 0000000000000..5dbd31193a9d4 --- /dev/null +++ b/dep/mysqllite/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, (DWORD) 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/dep/mysqllite/mysys/my_copy.c b/dep/mysqllite/mysys/my_copy.c new file mode 100644 index 0000000000000..35324dd4cef17 --- /dev/null +++ b/dep/mysqllite/mysys/my_copy.c @@ -0,0 +1,144 @@ +/* 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 +#include "mysys_err.h" +#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) +{ + size_t 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; + } + + /* sync the destination file */ + if (MyFlags & MY_SYNC) + { + if (my_sync(to_file, MyFlags)) + 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 */ + /* Copy modes */ + if (chmod(to, stat_buff.st_mode & 07777)) + { + my_errno= errno; + if (MyFlags & (MY_FAE+MY_WME)) + my_error(EE_CHANGE_PERMISSIONS, MYF(ME_BELL+ME_WAITTANG), from, errno); + goto err; + } +#if !defined(__WIN__) + /* Copy ownership */ + if (chown(to, stat_buff.st_uid, stat_buff.st_gid)) + { + my_errno= errno; + if (MyFlags & (MY_FAE+MY_WME)) + my_error(EE_CHANGE_OWNERSHIP, MYF(ME_BELL+ME_WAITTANG), from, errno); + goto err; + } +#endif + + 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 */ + } + + 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/dep/mysqllite/mysys/my_create.c b/dep/mysqllite/mysys/my_create.c index 5c9a1e027d2d9..49529f9b7b578 100644 --- a/dep/mysqllite/mysys/my_create.c +++ b/dep/mysqllite/mysys/my_create.c @@ -18,7 +18,7 @@ #include "mysys_err.h" #include #include -#if defined(__WIN__) +#if defined(_WIN32) #include #endif @@ -39,18 +39,11 @@ File my_create(const char *FileName, int CreateFlags, int access_flags, 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(VMS) - fd = open((char *) FileName, access_flags | O_CREAT, 0, - "ctx=stm","ctx=bin"); -#elif defined(__WIN__) - fd= my_sopen((char *) FileName, access_flags | O_CREAT | O_BINARY, - SH_DENYNO, MY_S_IREAD | MY_S_IWRITE); +#if defined(_WIN32) + fd= my_win_open(FileName, access_flags | O_CREAT); #else - fd = open(FileName, access_flags); + fd= open((char *) FileName, access_flags | O_CREAT, + CreateFlags ? CreateFlags : my_umask); #endif if ((MyFlags & MY_SYNC_DIR) && (fd >=0) && @@ -71,6 +64,7 @@ File my_create(const char *FileName, int CreateFlags, int access_flags, if (unlikely(fd >= 0 && rc < 0)) { int tmp= my_errno; + my_close(fd, MyFlags); my_delete(FileName, MyFlags); my_errno= tmp; } diff --git a/dep/mysqllite/mysys/my_delete.c b/dep/mysqllite/mysys/my_delete.c index 22425ed95fd56..4a23fedb5abac 100644 --- a/dep/mysqllite/mysys/my_delete.c +++ b/dep/mysqllite/mysys/my_delete.c @@ -36,8 +36,8 @@ int my_delete(const char *name, myf MyFlags) DBUG_RETURN(err); } /* my_delete */ -#if defined(__WIN__) && defined(__NT__) -/* +#if defined(__WIN__) +/** Delete file which is possibly not closed. This function is intended to be used exclusively as a temporal solution @@ -53,6 +53,20 @@ int my_delete(const char *name, myf MyFlags) 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) { @@ -63,6 +77,7 @@ int nt_share_delete(const char *name, myf MyFlags) for (cnt= GetTickCount(); cnt; cnt--) { + errno= 0; sprintf(buf, "%s.%08X.deleted", name, cnt); if (MoveFile(name, buf)) break; @@ -79,14 +94,32 @@ int nt_share_delete(const char *name, myf MyFlags) break; } - if (DeleteFile(buf)) - DBUG_RETURN(0); + 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); + /* + The below is more complicated than necessary. For some reason, the + assignment to my_errno clears the error number, which is retrieved + by GetLastError() (VC2005EE). Assigning to errno first, allows to + retrieve the correct value. + */ + errno= GetLastError(); + if (errno == 0) + my_errno= ENOENT; // marking, that `buf' doesn't exist + else + my_errno= errno; + } + else + my_errno= errno; - my_errno= GetLastError(); if (MyFlags & (MY_FAE+MY_WME)) my_error(EE_DELETE, MYF(ME_BELL + ME_WAITTANG + (MyFlags & ME_NOINPUT)), - name, my_errno); - + name, my_errno); DBUG_RETURN(-1); } #endif diff --git a/dep/mysqllite/mysys/my_error.c b/dep/mysqllite/mysys/my_error.c index 2cf704d0089e1..fa62cc604b68f 100644 --- a/dep/mysqllite/mysys/my_error.c +++ b/dep/mysqllite/mysys/my_error.c @@ -22,7 +22,6 @@ /* 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 */ /* @@ -49,11 +48,11 @@ */ 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}; + struct my_err_head *meh_next; /* chain link */ + const char** (*get_errmsgs) (); /* returns error message format */ + int meh_first; /* error number matching array slot 0 */ + int meh_last; /* error number matching last slot */ +} my_errmsgs_globerrs = {NULL, get_global_errmsgs, EE_ERROR_FIRST, EE_ERROR_LAST}; static struct my_err_head *my_errmsgs_list= &my_errmsgs_globerrs; @@ -67,12 +66,9 @@ static struct my_err_head *my_errmsgs_list= &my_errmsgs_globerrs; MyFlags Flags ... variable list - RETURN - What (*error_handler_hook)() returns: - 0 OK */ -int my_error(int nr, myf MyFlags, ...) +void my_error(int nr, myf MyFlags, ...) { const char *format; struct my_err_head *meh_p; @@ -88,15 +84,17 @@ int my_error(int nr, myf MyFlags, ...) /* 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) + meh_p->get_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); + (void) my_vsnprintf_ex(&my_charset_utf8_general_ci, ebuff, + sizeof(ebuff), format, args); va_end(args); } - DBUG_RETURN((*error_handler_hook)(nr, ebuff, MyFlags)); + (*error_handler_hook)(nr, ebuff, MyFlags); + DBUG_VOID_RETURN; } @@ -111,7 +109,7 @@ int my_error(int nr, myf MyFlags, ...) ... variable list */ -int my_printf_error(uint error, const char *format, myf MyFlags, ...) +void my_printf_error(uint error, const char *format, myf MyFlags, ...) { va_list args; char ebuff[ERRMSGSIZE]; @@ -120,9 +118,34 @@ int my_printf_error(uint error, const char *format, myf MyFlags, ...) error, MyFlags, errno, format)); va_start(args,MyFlags); - (void) my_vsnprintf (ebuff, sizeof(ebuff), format, args); + (void) my_vsnprintf_ex(&my_charset_utf8_general_ci, ebuff, + sizeof(ebuff), format, args); va_end(args); - DBUG_RETURN((*error_handler_hook)(error, ebuff, MyFlags)); + (*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; } /* @@ -135,9 +158,9 @@ int my_printf_error(uint error, const char *format, myf MyFlags, ...) MyFlags Flags */ -int my_message(uint error, const char *str, register myf MyFlags) +void my_message(uint error, const char *str, register myf MyFlags) { - return (*error_handler_hook)(error, str, MyFlags); + (*error_handler_hook)(error, str, MyFlags); } @@ -163,7 +186,7 @@ int my_message(uint error, const char *str, register myf MyFlags) != 0 Error */ -int my_error_register(const char **errmsgs, int first, int last) +int my_error_register(const char** (*get_errmsgs) (), int first, int last) { struct my_err_head *meh_p; struct my_err_head **search_meh_pp; @@ -172,7 +195,7 @@ int my_error_register(const char **errmsgs, int first, int last) 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->get_errmsgs= get_errmsgs; meh_p->meh_first= first; meh_p->meh_last= last; @@ -188,7 +211,7 @@ int my_error_register(const char **errmsgs, int first, int last) /* 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)); + my_free(meh_p); return 1; } @@ -243,8 +266,8 @@ const char **my_error_unregister(int first, int last) *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)); + errmsgs= meh_p->get_errmsgs(); + my_free(meh_p); return errmsgs; } @@ -259,7 +282,7 @@ void my_error_unregister_all(void) /* 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_free(cursor); } my_errmsgs_globerrs.meh_next= NULL; /* Freed in first iteration above. */ diff --git a/dep/mysqllite/mysys/my_file.c b/dep/mysqllite/mysys/my_file.c index d37da975c3776..e4b7cd7779f51 100644 --- a/dep/mysqllite/mysys/my_file.c +++ b/dep/mysqllite/mysys/my_file.c @@ -97,6 +97,7 @@ uint my_set_max_open_files(uint files) 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); @@ -126,7 +127,7 @@ void my_free_open_file_info() /* 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_free(my_file_info); my_file_info= my_file_info_default; my_file_limit= MY_NFILE; } diff --git a/dep/mysqllite/mysys/my_fopen.c b/dep/mysqllite/mysys/my_fopen.c index 44156da6ae328..e184c8308fcf3 100644 --- a/dep/mysqllite/mysys/my_fopen.c +++ b/dep/mysqllite/mysys/my_fopen.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (C) 2000 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,6 +18,10 @@ #include #include "mysys_err.h" +#if defined(__FreeBSD__) +extern int getosreldate(void); +#endif + static void make_ftype(char * to,int flag); /* @@ -41,24 +45,14 @@ FILE *my_fopen(const char *filename, int flags, myf MyFlags) DBUG_ENTER("my_fopen"); DBUG_PRINT("my",("Name: '%s' flags: %d MyFlags: %d", filename, flags, MyFlags)); - /* - 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 - */ -#ifdef __WIN__ - if (check_if_legal_filename(filename)) - { - errno= EACCES; - fd= 0; - } - else + + make_ftype(type,flags); + +#ifdef _WIN32 + fd= my_win_fopen(filename, type); +#else + fd= fopen(filename, type); #endif - { - make_ftype(type,flags); - fd = fopen(filename, type); - } - if (fd != 0) { /* @@ -66,23 +60,25 @@ FILE *my_fopen(const char *filename, int flags, myf MyFlags) on some OS (SUNOS). Actually the filename save isn't that important so we can ignore if this doesn't work. */ - if ((uint) fileno(fd) >= my_file_limit) + + 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[fileno(fd)].name = (char*) + mysql_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[fileno(fd)].type = STREAM_BY_FOPEN; - pthread_mutex_unlock(&THR_LOCK_open); + my_file_info[filedesc].type= STREAM_BY_FOPEN; + mysql_mutex_unlock(&THR_LOCK_open); DBUG_PRINT("exit",("stream: 0x%lx", (long) fd)); DBUG_RETURN(fd); } - pthread_mutex_unlock(&THR_LOCK_open); + mysql_mutex_unlock(&THR_LOCK_open); (void) my_fclose(fd,MyFlags); my_errno=ENOMEM; } @@ -97,17 +93,151 @@ FILE *my_fopen(const char *filename, int flags, myf MyFlags) } /* my_fopen */ - /* Close a stream */ +#if defined(_WIN32) + +static FILE *my_win_freopen(const char *path, const char *mode, FILE *stream) +{ + int handle_fd, fd= _fileno(stream); + HANDLE osfh; + + DBUG_ASSERT(path && stream); + + /* Services don't have stdout/stderr on Windows, so _fileno returns -1. */ + if (fd < 0) + { + if (!freopen(path, mode, stream)) + return NULL; + fd= _fileno(stream); + } + + if ((osfh= CreateFile(path, GENERIC_READ | GENERIC_WRITE, + FILE_SHARE_READ | FILE_SHARE_WRITE | + FILE_SHARE_DELETE, NULL, + OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, + NULL)) == INVALID_HANDLE_VALUE) + return NULL; + + if ((handle_fd= _open_osfhandle((intptr_t)osfh, + _O_APPEND | _O_TEXT)) == -1) + { + CloseHandle(osfh); + return NULL; + } + + if (_dup2(handle_fd, fd) < 0) + { + CloseHandle(osfh); + return NULL; + } + + _close(handle_fd); + + return stream; +} + +#elif defined(__FreeBSD__) + +/* No close operation hook. */ + +static int no_close(void *cookie __attribute__((unused))) +{ + return 0; +} + +/* + A hack around a race condition in the implementation of freopen. + + The race condition steams from the fact that the current fd of + the stream is closed before its number is used to duplicate the + new file descriptor. This defeats the desired atomicity of the + close and duplicate of dup2(). + + See PR number 79887 for reference: + http://www.freebsd.org/cgi/query-pr.cgi?pr=79887 +*/ + +static FILE *my_freebsd_freopen(const char *path, const char *mode, FILE *stream) +{ + int old_fd; + FILE *result; + + flockfile(stream); + + old_fd= fileno(stream); + + /* Use a no operation close hook to avoid having the fd closed. */ + stream->_close= no_close; + + /* Relies on the implicit dup2 to close old_fd. */ + result= freopen(path, mode, stream); + + /* If successful, the _close hook was replaced. */ + + if (result == NULL) + close(old_fd); + else + funlockfile(result); + + return result; +} + +#endif + + +/** + Change the file associated with a file stream. + + @param path Path to file. + @param mode Mode of the stream. + @param stream File stream. + + @note + This function is used to redirect stdout and stderr to a file and + subsequently to close and reopen that file for log rotation. + + @retval A FILE pointer on success. Otherwise, NULL. +*/ + +FILE *my_freopen(const char *path, const char *mode, FILE *stream) +{ + FILE *result; + +#if defined(_WIN32) + result= my_win_freopen(path, mode, stream); +#elif defined(__FreeBSD__) + /* + XXX: Once the fix is ported to the stable releases, this should + be dependent upon the specific FreeBSD versions. Check at: + http://www.freebsd.org/cgi/query-pr.cgi?pr=79887 + */ + if (getosreldate() > 900027) + result= freopen(path, mode, stream); + else + result= my_freebsd_freopen(path, mode, stream); +#else + result= freopen(path, mode, stream); +#endif + + return result; +} + + +/* Close a stream */ int my_fclose(FILE *fd, myf MyFlags) { int err,file; DBUG_ENTER("my_fclose"); DBUG_PRINT("my",("stream: 0x%lx MyFlags: %d", (long) fd, MyFlags)); - pthread_mutex_lock(&THR_LOCK_open); - file=fileno(fd); - if ((err = fclose(fd)) < 0) + mysql_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)) @@ -119,9 +249,9 @@ int my_fclose(FILE *fd, myf MyFlags) 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)); + my_free(my_file_info[file].name); } - pthread_mutex_unlock(&THR_LOCK_open); + mysql_mutex_unlock(&THR_LOCK_open); DBUG_RETURN(err); } /* my_fclose */ @@ -138,7 +268,12 @@ FILE *my_fdopen(File Filedes, const char *name, int Flags, myf MyFlags) Filedes, Flags, MyFlags)); make_ftype(type,Flags); - if ((fd = fdopen(Filedes, type)) == 0) +#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)) @@ -146,7 +281,7 @@ FILE *my_fdopen(File Filedes, const char *name, int Flags, myf MyFlags) } else { - pthread_mutex_lock(&THR_LOCK_open); + mysql_mutex_lock(&THR_LOCK_open); my_stream_opened++; if ((uint) Filedes < (uint) my_file_limit) { @@ -160,7 +295,7 @@ FILE *my_fdopen(File Filedes, const char *name, int Flags, myf MyFlags) } my_file_info[Filedes].type = STREAM_BY_FDOPEN; } - pthread_mutex_unlock(&THR_LOCK_open); + mysql_mutex_unlock(&THR_LOCK_open); } DBUG_PRINT("exit",("stream: 0x%lx", (long) fd)); diff --git a/dep/mysqllite/mysys/my_fstream.c b/dep/mysqllite/mysys/my_fstream.c index f3b5418b906e8..83cb0d261c0fd 100644 --- a/dep/mysqllite/mysys/my_fstream.c +++ b/dep/mysqllite/mysys/my_fstream.c @@ -56,11 +56,11 @@ size_t my_fread(FILE *stream, uchar *Buffer, size_t Count, myf MyFlags) { if (ferror(stream)) my_error(EE_READ, MYF(ME_BELL+ME_WAITTANG), - my_filename(fileno(stream)),errno); + my_filename(my_fileno(stream)),errno); else if (MyFlags & (MY_NABP | MY_FNABP)) my_error(EE_EOFERR, MYF(ME_BELL+ME_WAITTANG), - my_filename(fileno(stream)),errno); + my_filename(my_fileno(stream)),errno); } my_errno=errno ? errno : -1; if (ferror(stream) || MyFlags & (MY_NABP | MY_FNABP)) @@ -119,21 +119,20 @@ size_t my_fwrite(FILE *stream, const uchar *Buffer, size_t Count, myf MyFlags) #ifdef EINTR if (errno == EINTR) { - VOID(my_fseek(stream,seekptr,MY_SEEK_SET,MYF(0))); + (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))); + (void) my_fseek(stream,seekptr,MY_SEEK_SET,MYF(0)); continue; } #endif @@ -142,7 +141,7 @@ size_t my_fwrite(FILE *stream, const uchar *Buffer, size_t Count, myf MyFlags) if (MyFlags & (MY_WME | MY_FAE | MY_FNABP)) { my_error(EE_WRITE, MYF(ME_BELL+ME_WAITTANG), - my_filename(fileno(stream)),errno); + my_filename(my_fileno(stream)),errno); } writtenbytes= (size_t) -1; /* Return that we got error */ break; @@ -182,3 +181,14 @@ my_off_t my_ftell(FILE *stream, myf MyFlags __attribute__((unused))) 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/dep/mysqllite/mysys/my_gethostbyname.c b/dep/mysqllite/mysys/my_gethostbyname.c index 067fdfee9db11..28ecec13ef24e 100644 --- a/dep/mysqllite/mysys/my_gethostbyname.c +++ b/dep/mysqllite/mysys/my_gethostbyname.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002, 2004 MySQL AB +/* Copyright (C) 2002, 2004 MySQL AB, 2008-2009 Sun Microsystems, Inc This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -78,9 +78,7 @@ struct hostent *my_gethostbyname_r(const char *name, #else /* !HAVE_GETHOSTBYNAME_R */ -#ifdef THREAD -extern pthread_mutex_t LOCK_gethostbyname_r; -#endif +extern mysql_mutex_t LOCK_gethostbyname_r; /* No gethostbyname_r() function exists. @@ -92,11 +90,13 @@ extern pthread_mutex_t LOCK_gethostbyname_r; */ struct hostent *my_gethostbyname_r(const char *name, - struct hostent *result, char *buffer, - int buflen, int *h_errnop) + struct hostent *res __attribute__((unused)), + char *buffer __attribute__((unused)), + int buflen __attribute__((unused)), + int *h_errnop) { struct hostent *hp; - pthread_mutex_lock(&LOCK_gethostbyname_r); + mysql_mutex_lock(&LOCK_gethostbyname_r); hp= gethostbyname(name); *h_errnop= h_errno; return hp; @@ -104,7 +104,7 @@ struct hostent *my_gethostbyname_r(const char *name, void my_gethostbyname_r_free() { - pthread_mutex_unlock(&LOCK_gethostbyname_r); + mysql_mutex_unlock(&LOCK_gethostbyname_r); } #endif /* !HAVE_GETHOSTBYNAME_R */ diff --git a/dep/mysqllite/mysys/my_gethwaddr.c b/dep/mysqllite/mysys/my_gethwaddr.c new file mode 100644 index 0000000000000..ab44bac43d370 --- /dev/null +++ b/dep/mysqllite/mysys/my_gethwaddr.c @@ -0,0 +1,226 @@ +/* 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 + +#ifdef __FreeBSD__ + +#include +#include +#include +#include +#include + +my_bool my_gethwaddr(uchar *to) +{ + size_t len; + char *buf, *next, *end; + struct if_msghdr *ifm; + struct sockaddr_dl *sdl; + int res=1, mib[6]={CTL_NET, AF_ROUTE, 0, AF_LINK, NET_RT_IFLIST, 0}; + char zero_array[ETHER_ADDR_LEN] = {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); + memcpy(to, LLADDR(sdl), ETHER_ADDR_LEN); + res= memcmp(to, zero_array, ETHER_ADDR_LEN) ? 0 : 1; + } + } + +err: + return res; +} + +#elif __linux__ + +#include +#include +#include + +my_bool my_gethwaddr(uchar *to) +{ + int fd, res= 1; + struct ifreq ifr; + char zero_array[ETHER_ADDR_LEN] = {0}; + + 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) + { + memcpy(to, &ifr.ifr_hwaddr.sa_data, ETHER_ADDR_LEN); + res= memcmp(to, zero_array, ETHER_ADDR_LEN) ? 0 : 1; + } + } while (res && (errno == 0 || errno == ENODEV) && ifr.ifr_name[3]++ < '6'); + + close(fd); +err: + return res; +} + +#elif defined(__WIN__) + +/* + Workaround for BUG#32082 (Definition of VOID in my_global.h conflicts with + windows headers) +*/ +#ifdef VOID +#undef VOID +#define VOID void +#endif + +#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); + + 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/dep/mysqllite/mysys/my_getncpus.c b/dep/mysqllite/mysys/my_getncpus.c new file mode 100644 index 0000000000000..5be961e3bc91b --- /dev/null +++ b/dep/mysqllite/mysys/my_getncpus.c @@ -0,0 +1,49 @@ +/* Copyright (C) 2006 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 */ + +/* 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/dep/mysqllite/mysys/my_getopt.c b/dep/mysqllite/mysys/my_getopt.c index b0e7175d0b92b..51c45ff130933 100644 --- a/dep/mysqllite/mysys/my_getopt.c +++ b/dep/mysqllite/mysys/my_getopt.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2006 MySQL AB +/* Copyright (C) 2002-2006 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 @@ -28,24 +28,15 @@ typedef void (*init_func_p)(const struct my_option *option, void *variable, static void default_reporter(enum loglevel level, const char *format, ...); my_error_reporter my_getopt_error_reporter= &default_reporter; -static int findopt(char *optpat, uint length, - const struct my_option **opt_res, - const char **ffname); -my_bool getopt_compare_strings(const char *s, - const char *t, - uint length); +static int findopt(char *, uint, const struct my_option **, const char **); +my_bool getopt_compare_strings(const char *, const char *, uint); static longlong getopt_ll(char *arg, const struct my_option *optp, int *err); -static ulonglong getopt_ull(char *arg, const struct my_option *optp, - int *err); +static ulonglong getopt_ull(char *, const struct my_option *, int *); static double getopt_double(char *arg, const struct my_option *optp, int *err); -static void init_variables(const struct my_option *options, - init_func_p init_one_value); -static void init_one_value(const struct my_option *option, void *variable, - longlong value); -static void fini_one_value(const struct my_option *option, void *variable, - longlong value); -static int setval(const struct my_option *opts, void *value, char *argument, - my_bool set_maximum_value); +static void init_variables(const struct my_option *, init_func_p); +static void init_one_value(const struct my_option *, void *, longlong); +static void fini_one_value(const struct my_option *, void *, longlong); +static int setval(const struct my_option *, void *, char *, my_bool); static char *check_struct_option(char *cur_arg, char *key_name); /* @@ -60,6 +51,7 @@ enum enum_special_opt { OPT_SKIP, OPT_DISABLE, OPT_ENABLE, OPT_MAXIMUM, OPT_LOOSE}; char *disabled_my_option= (char*) "0"; +char *enabled_my_option= (char*) "1"; /* This is a flag that can be set in client programs. 0 means that @@ -91,16 +83,6 @@ static void default_reporter(enum loglevel level, 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 my_getopt_value getopt_get_addr; void my_getopt_register_get_addr(my_getopt_value func_addr) @@ -108,11 +90,70 @@ void my_getopt_register_get_addr(my_getopt_value func_addr) getopt_get_addr= func_addr; } +/** + Handle command line options. + Sort options. + Put options first, until special end of options (--), + or until the end of argv. Parse options, check that the given option + matches with one of the options in struct 'my_option'. + Check that option was given an argument if it requires one + Call the optional 'get_one_option()' function once for each option. + + Note that handle_options() can be invoked multiple times to + parse a command line in several steps. + In this case, use the global flag @c my_getopt_skip_unknown to indicate + that options unknown in the current step should be preserved in the + command line for later parsing in subsequent steps. + + For 'long' options (--a_long_option), @c my_getopt_skip_unknown is + fully supported. Command line parameters such as: + - "--a_long_option" + - "--a_long_option=value" + - "--a_long_option value" + will be preserved as is when the option is not known. + + For 'short' options (-S), support for @c my_getopt_skip_unknown + comes with some limitation, because several short options + can also be specified together in the same command line argument, + as in "-XYZ". + + The first use case supported is: all short options are declared. + handle_options() will be able to interpret "-XYZ" as one of: + - an unknown X option + - "-X -Y -Z", three short options with no arguments + - "-X -YZ", where Y is a short option with argument Z + - "-XYZ", where X is a short option with argument YZ + based on the full short options specifications. + + The second use case supported is: no short option is declared. + handle_options() will reject "-XYZ" as unknown, to be parsed later. + + The use case that is explicitly not supported is to provide + only a partial list of short options to handle_options(). + This function can not be expected to extract some option Y + in the middle of the string "-XYZ" in these conditions, + without knowing if X will be declared an option later. + + Note that this limitation only impacts parsing of several + short options from the same command line argument, + as in "mysqld -anW5". + When each short option is properly separated out in the command line + argument, for example in "mysqld -a -n -w5", the code would actually + work even with partial options specs given at each stage. + + @param [in, out] argc command line options (count) + @param [in, out] argv command line options (values) + @param [in] longopts descriptor of all valid options + @param [in] get_one_option optional callback function to process each option, + can be NULL. + @return error in case of ambiguous or unknown options, + 0 on success. +*/ 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; + uint UNINIT_VAR(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, *opt_str, key_name[FN_REFLEN]; @@ -120,8 +161,8 @@ int handle_options(int *argc, char ***argv, const struct my_option *optp; void *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); @@ -129,10 +170,35 @@ int handle_options(int *argc, char ***argv, (*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; + opt_found= 0; + 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; @@ -141,78 +207,15 @@ int handle_options(int *argc, char ***argv, 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') - { - my_getopt_error_reporter(WARNING_LEVEL, - "%s: Option '-O' is deprecated. " - "Use --variable-name=value instead.", - my_progname); - 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)) - { - my_getopt_error_reporter(WARNING_LEVEL, - "%s: Option '--set-variable' is deprecated. " - "Use --variable-name=value instead.", - my_progname); - - 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; - } - } + if (*cur_arg == '-') /* check for long option, */ + { + 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); @@ -258,7 +261,7 @@ int handle_options(int *argc, char ***argv, 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], + opt_str, special_opt_prefix[i], prev_found); return EXIT_AMBIGUOUS_OPTION; } @@ -270,11 +273,11 @@ int handle_options(int *argc, char ***argv, for example: --skip-option=0 -> option = TRUE */ optend= (optend && *optend == '0' && !(*(optend + 1))) ? - (char*) "1" : disabled_my_option; + enabled_my_option : disabled_my_option; break; case OPT_ENABLE: optend= (optend && *optend == '0' && !(*(optend + 1))) ? - disabled_my_option : (char*) "1"; + disabled_my_option : enabled_my_option; break; case OPT_MAXIMUM: set_maximum_value= 1; @@ -291,12 +294,7 @@ int handle_options(int *argc, char ***argv, { 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 - */ + /* Preserve all the components of this unknown option. */ do { (*argv)[argvpos++]= *first++; } while (first <= pos); @@ -362,14 +360,6 @@ int handle_options(int *argc, char ***argv, } 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) : @@ -379,6 +369,11 @@ int handle_options(int *argc, char ***argv, if (optp->arg_type == NO_ARG) { + /* + Due to historical reasons GET_BOOL var_types still accepts arguments + despite the NO_ARG arg_type attribute. This can seems a bit unintuitive + and care should be taken when refactoring this code. + */ if (optend && (optp->var_type & GET_TYPE_MASK) != GET_BOOL) { if (my_getopt_print_errors) @@ -393,7 +388,7 @@ int handle_options(int *argc, char ***argv, 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")) @@ -404,37 +399,26 @@ int handle_options(int *argc, char ***argv, else { my_getopt_error_reporter(WARNING_LEVEL, - "%s: ignoring option '--%s' due to " - "invalid value '%s'", + "%s: ignoring option '--%s' " + "due to invalid value '%s'", my_progname, optp->name, optend); continue; } - if (get_one_option(optp->id, optp, + if (get_one_option && get_one_option(optp->id, optp, *((my_bool*) value) ? - (char*) "1" : disabled_my_option)) + enabled_my_option : 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) || - (optp->var_type & GET_TYPE_MASK) == GET_ENUM)) - { - if (optend == disabled_my_option) - init_one_value(optp, value, 0); - else - { - if (!optend) /* No argument -> enable option */ - init_one_value(optp, value, 1); - else - argument= optend; - } - } else if (optp->arg_type == REQUIRED_ARG && !optend) { - /* Check if there are more arguments after this one */ - if (!*++pos) + /* 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, @@ -453,9 +437,9 @@ int handle_options(int *argc, char ***argv, for (optend= cur_arg; *optend; optend++) { opt_found= 0; - for (optp= longopts; optp->id; optp++) + for (optp= longopts; optp->name; optp++) { - if (optp->id == (int) (uchar) *optend) + if (optp->id && optp->id == (int) (uchar) *optend) { /* Option recognized. Find next what to do with it */ opt_found= 1; @@ -471,7 +455,7 @@ int handle_options(int *argc, char ***argv, optp->arg_type == NO_ARG) { *((my_bool*) optp->value)= (my_bool) 1; - if (get_one_option(optp->id, optp, argument)) + if (get_one_option && get_one_option(optp->id, optp, argument)) return EXIT_UNSPECIFIED_ERROR; continue; } @@ -491,7 +475,7 @@ int handle_options(int *argc, char ***argv, { if (optp->var_type == GET_BOOL) *((my_bool*) optp->value)= (my_bool) 1; - if (get_one_option(optp->id, optp, argument)) + if (get_one_option && get_one_option(optp->id, optp, argument)) return EXIT_UNSPECIFIED_ERROR; continue; } @@ -511,40 +495,56 @@ int handle_options(int *argc, char ***argv, } 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)) + if (get_one_option && 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; + if (my_getopt_skip_unknown) + { + /* + We are currently parsing a single argv[] argument + of the form "-XYZ". + One or the argument found (say Y) is not an option. + Hack the string "-XYZ" to make a "-YZ" substring in it, + and push that to the output as an unrecognized parameter. + */ + DBUG_ASSERT(optend > *pos); + DBUG_ASSERT(optend >= cur_arg); + DBUG_ASSERT(optend <= *pos + strlen(*pos)); + DBUG_ASSERT(*optend); + optend--; + optend[0]= '-'; /* replace 'X' or '-' by '-' */ + (*argv)[argvpos++]= optend; + /* + Do not continue to parse at the current "-XYZ" argument, + skip to the next argv[] argument instead. + */ + optend= (char*) " "; + } + else + { + 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 */ + if (opt_found) + (*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)) + if (get_one_option && get_one_option(optp->id, optp, argument)) return EXIT_UNSPECIFIED_ERROR; - (*argc)--; /* option handled (short or long), decrease argument count */ + (*argc)--; /* option handled (long), decrease argument count */ } else /* non-option found */ (*argv)[argvpos++]= cur_arg; @@ -602,6 +602,24 @@ static char *check_struct_option(char *cur_arg, char *key_name) } } +/** + Parse a boolean command line argument + + "ON", "TRUE" and "1" will return true, + other values will return false. + + @param[in] argument The value argument + @return boolean value +*/ +static my_bool get_bool_argument(const char *argument) +{ + if (!my_strcasecmp(&my_charset_latin1, argument, "true") || + !my_strcasecmp(&my_charset_latin1, argument, "on")) + return 1; + else + return (my_bool) atoi(argument); +} + /* function: setval @@ -612,75 +630,132 @@ static char *check_struct_option(char *cur_arg, char *key_name) static int setval(const struct my_option *opts, void *value, char *argument, my_bool set_maximum_value) { - int err= 0; + int err= 0, res= 0; - if (value && argument) - { - void *result_pos= ((set_maximum_value) ? opts->u_max_value : value); + if (!argument) + argument= enabled_my_option; - if (!result_pos) + if (value) + { + if (set_maximum_value && !(value= opts->u_max_value)) + { + my_getopt_error_reporter(ERROR_LEVEL, + "%s: Maximum value of '%s' cannot be set", + my_progname, opts->name); 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; + *((my_bool*) value)= get_bool_argument(argument); break; case GET_INT: - *((int*) result_pos)= (int) getopt_ll(argument, opts, &err); + *((int*) value)= (int) getopt_ll(argument, opts, &err); break; case GET_UINT: - *((uint*) result_pos)= (uint) getopt_ull(argument, opts, &err); + *((uint*) value)= (uint) getopt_ull(argument, opts, &err); break; case GET_LONG: - *((long*) result_pos)= (long) getopt_ll(argument, opts, &err); + *((long*) value)= (long) getopt_ll(argument, opts, &err); break; case GET_ULONG: - *((long*) result_pos)= (long) getopt_ull(argument, opts, &err); + *((long*) value)= (long) getopt_ull(argument, opts, &err); break; case GET_LL: - *((longlong*) result_pos)= getopt_ll(argument, opts, &err); + *((longlong*) value)= getopt_ll(argument, opts, &err); break; case GET_ULL: - *((ulonglong*) result_pos)= getopt_ull(argument, opts, &err); + *((ulonglong*) value)= getopt_ull(argument, opts, &err); break; case GET_DOUBLE: - *((double*) result_pos)= getopt_double(argument, opts, &err); + *((double*) value)= getopt_double(argument, opts, &err); break; case GET_STR: - *((char**) result_pos)= argument; + if (argument == enabled_my_option) + break; /* string options don't use this default of "1" */ + *((char**) value)= 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; + if (argument == enabled_my_option) + break; /* string options don't use this default of "1" */ + my_free(*((char**) value)); + if (!(*((char**) value)= my_strdup(argument, MYF(MY_WME)))) + { + res= EXIT_OUT_OF_MEMORY; + goto ret; + }; break; case GET_ENUM: - if (((*(int*)result_pos)= - find_type(argument, opts->typelib, 2) - 1) < 0) { - /* - Accept an integer representation of the enumerated item. - */ - char *endptr; - unsigned int arg= (unsigned int) strtol(argument, &endptr, 10); - if (*endptr || arg >= opts->typelib->count) - return EXIT_ARGUMENT_INVALID; - *(int*)result_pos= arg; + int type= find_type(argument, opts->typelib, 2); + if (type == 0) + { + /* + Accept an integer representation of the enumerated item. + */ + char *endptr; + ulong arg= strtoul(argument, &endptr, 10); + if (*endptr || arg >= opts->typelib->count) + { + res= EXIT_ARGUMENT_INVALID; + goto ret; + } + *(ulong*)value= arg; + } + else + *(ulong*)value= type - 1; } break; case GET_SET: - *((ulonglong*)result_pos)= find_typeset(argument, opts->typelib, &err); + *((ulonglong*)value)= find_typeset(argument, opts->typelib, &err); if (err) - return EXIT_ARGUMENT_INVALID; + { + /* Accept an integer representation of the set */ + char *endptr; + ulonglong arg= (ulonglong) strtol(argument, &endptr, 10); + if (*endptr || (arg >> 1) >= (1ULL << (opts->typelib->count-1))) + { + res= EXIT_ARGUMENT_INVALID; + goto ret; + }; + *(ulonglong*)value= arg; + err= 0; + } break; - default: /* dummy default to avoid compiler warnings */ + case GET_FLAGSET: + { + char *error; + uint error_len; + + *((ulonglong*)value)= + find_set_from_flags(opts->typelib, opts->typelib->count, + *(ulonglong *)value, opts->def_value, + argument, strlen(argument), + &error, &error_len); + if (error) + { + res= EXIT_ARGUMENT_INVALID; + goto ret; + }; + } + break; + case GET_NO_ARG: /* get_one_option has taken care of the value already */ + default: /* dummy default to avoid compiler warnings */ break; } if (err) - return EXIT_UNKNOWN_SUFFIX; + { + res= EXIT_UNKNOWN_SUFFIX; + goto ret; + }; } return 0; + +ret: + my_getopt_error_reporter(ERROR_LEVEL, + "%s: Error while setting value '%s' to '%s'", + my_progname, argument, opts->name); + return res; } @@ -859,7 +934,7 @@ longlong getopt_ll_limit_value(longlong num, const struct my_option *optp, break; } - num= ((num - optp->sub_size) / block_size); + num= (num / block_size); num= (longlong) (num * block_size); if (num < optp->min_value) @@ -870,7 +945,7 @@ longlong getopt_ll_limit_value(longlong num, const struct my_option *optp, } if (fix) - *fix= adjusted; + *fix= old != num; else if (adjusted) my_getopt_error_reporter(WARNING_LEVEL, "option '%s': signed value %s adjusted to %s", @@ -942,7 +1017,7 @@ ulonglong getopt_ull_limit_value(ulonglong num, const struct my_option *optp, } if (fix) - *fix= adjusted; + *fix= old != num; else if (adjusted) my_getopt_error_reporter(WARNING_LEVEL, "option '%s': unsigned value %s adjusted to %s", @@ -951,6 +1026,29 @@ ulonglong getopt_ull_limit_value(ulonglong num, const struct my_option *optp, return num; } +double getopt_double_limit_value(double num, const struct my_option *optp, + my_bool *fix) +{ + my_bool adjusted= FALSE; + double old= num; + if (optp->max_value && num > (double) optp->max_value) + { + num= (double) optp->max_value; + adjusted= TRUE; + } + if (num < (double) optp->min_value) + { + num= (double) optp->min_value; + adjusted= TRUE; + } + if (fix) + *fix= adjusted; + else if (adjusted) + my_getopt_error_reporter(WARNING_LEVEL, + "option '%s': value %g adjusted to %g", + optp->name, old, num); + return num; +} /* Get double value withing ranges @@ -972,15 +1070,12 @@ static double getopt_double(char *arg, const struct my_option *optp, int *err) 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); + my_getopt_error_reporter(ERROR_LEVEL, + "Invalid decimal value for option '%s'\n", 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); + return getopt_double_limit_value(num, optp, NULL); } /* @@ -1004,7 +1099,7 @@ static void init_one_value(const struct my_option *option, void *variable, *((int*) variable)= (int) getopt_ll_limit_value((int) value, option, NULL); break; case GET_ENUM: - *((uint*) variable)= (uint) value; + *((ulong*) variable)= (ulong) value; break; case GET_UINT: *((uint*) variable)= (uint) getopt_ull_limit_value((uint) value, option, NULL); @@ -1022,10 +1117,11 @@ static void init_one_value(const struct my_option *option, void *variable, *((ulonglong*) variable)= (ulonglong) getopt_ull_limit_value((ulonglong) value, option, NULL); break; case GET_SET: + case GET_FLAGSET: *((ulonglong*) variable)= (ulonglong) value; break; case GET_DOUBLE: - *((double*) variable)= (double) value; + *((double*) variable)= ulonglong2double(value); break; case GET_STR: /* @@ -1046,8 +1142,9 @@ static void init_one_value(const struct my_option *option, void *variable, */ if ((char*) (intptr) value) { - my_free((*(char**) variable), MYF(MY_ALLOW_ZERO_PTR)); - *((char**) variable)= my_strdup((char*) (intptr) value, MYF(MY_WME)); + char **pstr= (char **) variable; + my_free(*pstr); + *pstr= my_strdup((char*) (intptr) value, MYF(MY_WME)); } break; default: /* dummy default to avoid compiler warnings */ @@ -1072,7 +1169,7 @@ static void fini_one_value(const struct my_option *option, void *variable, 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)); + my_free(*((char**) variable)); *((char**) variable)= NULL; break; default: /* dummy default to avoid compiler warnings */ @@ -1097,7 +1194,7 @@ void my_cleanup_options(const struct my_option *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 + If the value is of type GET_ASK_ADDR, we will ask for the address for a value and initialize. */ @@ -1107,7 +1204,7 @@ static void init_variables(const struct my_option *options, DBUG_ENTER("init_variables"); for (; options->name; options++) { - void *variable; + void *value; DBUG_PRINT("options", ("name: '%s'", options->name)); /* We must set u_max_value first as for some variables @@ -1116,15 +1213,22 @@ static void init_variables(const struct my_option *options, */ 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); + value= (options->var_type & GET_ASK_ADDR ? + (*getopt_get_addr)("", 0, options, 0) : options->value); + if (value) + init_one_value(options, value, options->def_value); } DBUG_VOID_RETURN; } +/** Prints variable or option name, replacing _ with - */ +static uint print_name(const struct my_option *optp) +{ + const char *s= optp->name; + for (;*s;s++) + putchar(*s == '_' ? '-' : *s); + return s - optp->name; +} /* function: my_print_options @@ -1132,17 +1236,15 @@ static void init_variables(const struct my_option *options, Print help for all options and variables. */ -#include - 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++) + for (optp= options; optp->name; optp++) { - if (optp->id < 256) + if (optp->id && optp->id < 256) { printf(" -%c%s", optp->id, strlen(optp->name) ? ", " : " "); col= 6; @@ -1154,21 +1256,24 @@ void my_print_help(const struct my_option *options) } 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("--"); + col+= 2 + print_name(optp); + if (optp->arg_type == NO_ARG || + (optp->var_type & GET_TYPE_MASK) == GET_BOOL) + { + putchar(' '); + col++; + } + else if ((optp->var_type & GET_TYPE_MASK) == GET_STR || + (optp->var_type & GET_TYPE_MASK) == GET_STR_ALLOC || + (optp->var_type & GET_TYPE_MASK) == GET_ENUM || + (optp->var_type & GET_TYPE_MASK) == GET_SET || + (optp->var_type & GET_TYPE_MASK) == GET_FLAGSET ) { 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 ? "[" : "", @@ -1200,6 +1305,15 @@ void my_print_help(const struct my_option *options) printf("%s", comment); } putchar('\n'); + if ((optp->var_type & GET_TYPE_MASK) == GET_BOOL) + { + if (optp->def_value != 0) + { + printf("%*s(Defaults to on; use --skip-", name_space, ""); + print_name(optp); + printf(" to disable.)\n"); + } + } } } @@ -1213,38 +1327,55 @@ void my_print_help(const struct my_option *options) void my_print_variables(const struct my_option *options) { uint name_space= 34, length, nr; - ulonglong bit, llvalue; + ulonglong llvalue; char buff[255]; const struct my_option *optp; + for (optp= options; optp->name; optp++) + { + length= strlen(optp->name)+1; + if (length > name_space) + name_space= length; + } + 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++) + printf("%-*s%s", name_space, "and boolean options {FALSE|TRUE}", + "Value (after reading options)\n"); + for (length=1; length < 75; length++) + putchar(length == name_space ? ' ' : '-'); + putchar('\n'); + + for (optp= options; optp->name; optp++) { void *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; + length= print_name(optp); 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)"); + printf("%s\n", ""); else - for (nr= 0, bit= 1; llvalue && nr < optp->typelib->count; nr++, bit<<=1) + for (nr= 0; llvalue && nr < optp->typelib->count; nr++, llvalue >>=1) { - if (!(bit & llvalue)) - continue; - llvalue&= ~bit; - printf( llvalue ? "%s," : "%s\n", get_type(optp->typelib, nr)); + if (llvalue & 1) + printf( llvalue > 1 ? "%s," : "%s\n", get_type(optp->typelib, nr)); } break; + case GET_FLAGSET: + llvalue= *(ulonglong*) value; + for (nr= 0; llvalue && nr < optp->typelib->count; nr++, llvalue >>=1) + { + printf("%s%s=", (nr ? "," : ""), get_type(optp->typelib, nr)); + printf(llvalue & 1 ? "on" : "off"); + } + printf("\n"); + break; case GET_ENUM: - printf("%s\n", get_type(optp->typelib, *(uint*) value)); + printf("%s\n", get_type(optp->typelib, *(ulong*) value)); break; case GET_STR: case GET_STR_ALLOC: /* fall through */ @@ -1276,6 +1407,9 @@ void my_print_variables(const struct my_option *options) case GET_DOUBLE: printf("%g\n", *(double*) value); break; + case GET_NO_ARG: + printf("(No default value)\n"); + break; default: printf("(Disabled)\n"); break; @@ -1283,5 +1417,3 @@ void my_print_variables(const struct my_option *options) } } } - -#include diff --git a/dep/mysqllite/include/help_start.h b/dep/mysqllite/mysys/my_getpagesize.c similarity index 60% rename from dep/mysqllite/include/help_start.h rename to dep/mysqllite/mysys/my_getpagesize.c index 3ae20eea7d724..b0560cede35fa 100644 --- a/dep/mysqllite/include/help_start.h +++ b/dep/mysqllite/mysys/my_getpagesize.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2004-2005 MySQL AB +/* 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 @@ -11,14 +11,30 @@ You 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 */ + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* Divert all help information on NetWare to logger screen. */ +#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 -#ifdef __NETWARE__ -#define printf consoleprintf -#define puts(s) consoleprintf("%s\n",s) -#define fputs(s,f) puts(s) -#define fputc(s,f) consoleprintf("%c", s) -#define putchar(s) consoleprintf("%c", s) #endif + diff --git a/dep/mysqllite/mysys/my_getsystime.c b/dep/mysqllite/mysys/my_getsystime.c index b692b18bfc770..614f49fc425ee 100644 --- a/dep/mysqllite/mysys/my_getsystime.c +++ b/dep/mysqllite/mysys/my_getsystime.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2004 MySQL AB +/* Copyright (C) 2004 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 @@ -25,10 +25,6 @@ #include "mysys_priv.h" #include "my_static.h" -#ifdef __NETWARE__ -#include -#endif - ulonglong my_getsystime() { #ifdef HAVE_CLOCK_GETTIME @@ -45,10 +41,6 @@ ulonglong my_getsystime() 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; @@ -150,7 +142,10 @@ ulonglong my_micro_time() Value in microseconds from some undefined point in time */ -#define DELTA_FOR_SECONDS LL(500000000) /* Half a second */ +#define DELTA_FOR_SECONDS 500000000LL /* Half a second */ + +/* Difference between GetSystemTimeAsFileTime() and now() */ +#define OFFSET_TO_EPOCH 116444736000000000ULL ulonglong my_micro_time_and_time(time_t *time_arg) { @@ -168,15 +163,21 @@ ulonglong my_micro_time_and_time(time_t *time_arg) static time_t cur_time= 0; hrtime_t cur_gethrtime; - pthread_mutex_lock(&THR_LOCK_time); + mysql_mutex_lock(&THR_LOCK_time); cur_gethrtime= gethrtime(); - if ((cur_gethrtime - prev_gethrtime) > DELTA_FOR_SECONDS) + /* + Due to bugs in the Solaris (x86) implementation of gethrtime(), + the time returned by it might not be monotonic. Don't use the + cached time(2) value if this is a case. + */ + if ((prev_gethrtime > cur_gethrtime) || + ((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); + mysql_mutex_unlock(&THR_LOCK_time); return cur_gethrtime/1000; #else ulonglong newtime; diff --git a/dep/mysqllite/mysys/my_getwd.c b/dep/mysqllite/mysys/my_getwd.c index e6b867e275374..ace14c8a3c909 100644 --- a/dep/mysqllite/mysys/my_getwd.c +++ b/dep/mysqllite/mysys/my_getwd.c @@ -51,20 +51,20 @@ int my_getwd(char * buf, size_t size, myf MyFlags) (long) buf, (uint) size, MyFlags)); if (size < 1) - return(-1); + DBUG_RETURN(-1); if (curr_dir[0]) /* Current pos is saved here */ - VOID(strmake(buf,&curr_dir[0],size-1)); + (void) strmake(buf,&curr_dir[0],size-1); else { #if defined(HAVE_GETCWD) if (size < 2) - return(-1); + DBUG_RETURN(-1); if (!getcwd(buf,(uint) (size-2)) && MyFlags & MY_WME) { my_errno=errno; my_error(EE_GETWD,MYF(ME_BELL+ME_WAITTANG),errno); - return(-1); + DBUG_RETURN(-1); } #elif defined(HAVE_GETWD) { @@ -72,16 +72,6 @@ int my_getwd(char * buf, size_t size, myf MyFlags) getwd(pathname); strmake(buf,pathname,size-1); } -#elif defined(VMS) - if (size < 2) - return(-1); - 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 @@ -103,27 +93,12 @@ 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; diff --git a/dep/mysqllite/mysys/my_handler.c b/dep/mysqllite/mysys/my_handler.c new file mode 100644 index 0000000000000..bd1e313d0664a --- /dev/null +++ b/dep/mysqllite/mysys/my_handler.c @@ -0,0 +1,604 @@ +/* Copyright (C) 2002-2006 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 */ + +#include +#include +#include +#include +#include + +#include "my_handler_errors.h" + +#define CMP_NUM(a,b) (((a) < (b)) ? -1 : ((a) == (b)) ? 0 : 1) + +int ha_compare_text(CHARSET_INFO *charset_info, uchar *a, uint a_length, + uchar *b, uint b_length, my_bool part_key, + my_bool skip_end_space) +{ + if (!part_key) + return charset_info->coll->strnncollsp(charset_info, a, a_length, + b, b_length, (my_bool)!skip_end_space); + return charset_info->coll->strnncoll(charset_info, a, a_length, + b, b_length, part_key); +} + + +static int compare_bin(uchar *a, uint a_length, uchar *b, uint b_length, + my_bool part_key, my_bool skip_end_space) +{ + uint length= min(a_length,b_length); + uchar *end= a+ length; + int flag; + + while (a < end) + if ((flag= (int) *a++ - (int) *b++)) + return flag; + if (part_key && b_length < a_length) + return 0; + if (skip_end_space && a_length != b_length) + { + int swap= 1; + /* + We are using space compression. We have to check if longer key + has next character < ' ', in which case it's less than the shorter + key that has an implicite space afterwards. + + This code is identical to the one in + strings/ctype-simple.c:my_strnncollsp_simple + */ + if (a_length < b_length) + { + /* put shorter key in a */ + a_length= b_length; + a= b; + swap= -1; /* swap sign of result */ + } + for (end= a + a_length-length; a < end ; a++) + { + if (*a != ' ') + return (*a < ' ') ? -swap : swap; + } + return 0; + } + return (int) (a_length-b_length); +} + + +/* + Compare two keys + + SYNOPSIS + ha_key_cmp() + keyseg Array of key segments of key to compare + a First key to compare, in format from _mi_pack_key() + This is normally key specified by user + b Second key to compare. This is always from a row + key_length Length of key to compare. This can be shorter than + a to just compare sub keys + next_flag How keys should be compared + If bit SEARCH_FIND is not set the keys includes the row + position and this should also be compared + diff_pos OUT Number of first keypart where values differ, counting + from one. + diff_pos[1] OUT (b + diff_pos[1]) points to first value in tuple b + that is different from corresponding value in tuple a. + + EXAMPLES + Example1: if the function is called for tuples + ('aaa','bbb') and ('eee','fff'), then + diff_pos[0] = 1 (as 'aaa' != 'eee') + diff_pos[1] = 0 (offset from beggining of tuple b to 'eee' keypart). + + Example2: if the index function is called for tuples + ('aaa','bbb') and ('aaa','fff'), + diff_pos[0] = 2 (as 'aaa' != 'eee') + diff_pos[1] = 3 (offset from beggining of tuple b to 'fff' keypart, + here we assume that first key part is CHAR(3) NOT NULL) + + NOTES + Number-keys can't be splited + + RETURN VALUES + <0 If a < b + 0 If a == b + >0 If a > b +*/ + +#define FCMP(A,B) ((int) (A) - (int) (B)) + +int ha_key_cmp(register HA_KEYSEG *keyseg, register uchar *a, + register uchar *b, uint key_length, uint nextflag, + uint *diff_pos) +{ + int flag; + int16 s_1,s_2; + int32 l_1,l_2; + uint32 u_1,u_2; + float f_1,f_2; + double d_1,d_2; + uint next_key_length; + uchar *orig_b= b; + + *diff_pos=0; + for ( ; (int) key_length >0 ; key_length=next_key_length, keyseg++) + { + uchar *end; + uint piks=! (keyseg->flag & HA_NO_SORT); + (*diff_pos)++; + diff_pos[1]= (uint)(b - orig_b); + + /* Handle NULL part */ + if (keyseg->null_bit) + { + key_length--; + if (*a != *b && piks) + { + flag = (int) *a - (int) *b; + return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag); + } + b++; + if (!*a++) /* If key was NULL */ + { + if (nextflag == (SEARCH_FIND | SEARCH_UPDATE)) + nextflag=SEARCH_SAME; /* Allow duplicate keys */ + else if (nextflag & SEARCH_NULL_ARE_NOT_EQUAL) + { + /* + This is only used from mi_check() to calculate cardinality. + It can't be used when searching for a key as this would cause + compare of (a,b) and (b,a) to return the same value. + */ + return -1; + } + next_key_length=key_length; + continue; /* To next key part */ + } + } + end= a+ min(keyseg->length,key_length); + next_key_length=key_length-keyseg->length; + + switch ((enum ha_base_keytype) keyseg->type) { + case HA_KEYTYPE_TEXT: /* Ascii; Key is converted */ + if (keyseg->flag & HA_SPACE_PACK) + { + int a_length,b_length,pack_length; + get_key_length(a_length,a); + get_key_pack_length(b_length,pack_length,b); + next_key_length=key_length-b_length-pack_length; + + if (piks && + (flag=ha_compare_text(keyseg->charset,a,a_length,b,b_length, + (my_bool) ((nextflag & SEARCH_PREFIX) && + next_key_length <= 0), + (my_bool)!(nextflag & SEARCH_PREFIX)))) + return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag); + a+=a_length; + b+=b_length; + break; + } + else + { + uint length=(uint) (end-a), a_length=length, b_length=length; + if (piks && + (flag= ha_compare_text(keyseg->charset, a, a_length, b, b_length, + (my_bool) ((nextflag & SEARCH_PREFIX) && + next_key_length <= 0), + (my_bool)!(nextflag & SEARCH_PREFIX)))) + return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag); + a=end; + b+=length; + } + break; + case HA_KEYTYPE_BINARY: + case HA_KEYTYPE_BIT: + if (keyseg->flag & HA_SPACE_PACK) + { + int a_length,b_length,pack_length; + get_key_length(a_length,a); + get_key_pack_length(b_length,pack_length,b); + next_key_length=key_length-b_length-pack_length; + + if (piks && + (flag=compare_bin(a,a_length,b,b_length, + (my_bool) ((nextflag & SEARCH_PREFIX) && + next_key_length <= 0),1))) + return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag); + a+=a_length; + b+=b_length; + break; + } + else + { + uint length=keyseg->length; + if (piks && + (flag=compare_bin(a,length,b,length, + (my_bool) ((nextflag & SEARCH_PREFIX) && + next_key_length <= 0),0))) + return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag); + a+=length; + b+=length; + } + break; + case HA_KEYTYPE_VARTEXT1: + case HA_KEYTYPE_VARTEXT2: + { + int a_length,b_length,pack_length; + get_key_length(a_length,a); + get_key_pack_length(b_length,pack_length,b); + next_key_length=key_length-b_length-pack_length; + + if (piks && + (flag= ha_compare_text(keyseg->charset,a,a_length,b,b_length, + (my_bool) ((nextflag & SEARCH_PREFIX) && + next_key_length <= 0), + (my_bool) ((nextflag & (SEARCH_FIND | + SEARCH_UPDATE)) == + SEARCH_FIND && + ! (keyseg->flag & + HA_END_SPACE_ARE_EQUAL))))) + return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag); + a+= a_length; + b+= b_length; + break; + } + break; + case HA_KEYTYPE_VARBINARY1: + case HA_KEYTYPE_VARBINARY2: + { + int a_length,b_length,pack_length; + get_key_length(a_length,a); + get_key_pack_length(b_length,pack_length,b); + next_key_length=key_length-b_length-pack_length; + + if (piks && + (flag=compare_bin(a,a_length,b,b_length, + (my_bool) ((nextflag & SEARCH_PREFIX) && + next_key_length <= 0), 0))) + return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag); + a+=a_length; + b+=b_length; + } + break; + case HA_KEYTYPE_INT8: + { + int i_1= (int) *((signed char*) a); + int i_2= (int) *((signed char*) b); + if (piks && (flag = CMP_NUM(i_1,i_2))) + return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag); + a= end; + b++; + break; + } + case HA_KEYTYPE_SHORT_INT: + s_1= mi_sint2korr(a); + s_2= mi_sint2korr(b); + if (piks && (flag = CMP_NUM(s_1,s_2))) + return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag); + a= end; + b+= 2; /* sizeof(short int); */ + break; + case HA_KEYTYPE_USHORT_INT: + { + uint16 us_1,us_2; + us_1= mi_sint2korr(a); + us_2= mi_sint2korr(b); + if (piks && (flag = CMP_NUM(us_1,us_2))) + return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag); + a= end; + b+=2; /* sizeof(short int); */ + break; + } + case HA_KEYTYPE_LONG_INT: + l_1= mi_sint4korr(a); + l_2= mi_sint4korr(b); + if (piks && (flag = CMP_NUM(l_1,l_2))) + return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag); + a= end; + b+= 4; /* sizeof(long int); */ + break; + case HA_KEYTYPE_ULONG_INT: + u_1= mi_sint4korr(a); + u_2= mi_sint4korr(b); + if (piks && (flag = CMP_NUM(u_1,u_2))) + return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag); + a= end; + b+= 4; /* sizeof(long int); */ + break; + case HA_KEYTYPE_INT24: + l_1=mi_sint3korr(a); + l_2=mi_sint3korr(b); + if (piks && (flag = CMP_NUM(l_1,l_2))) + return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag); + a= end; + b+= 3; + break; + case HA_KEYTYPE_UINT24: + l_1=mi_uint3korr(a); + l_2=mi_uint3korr(b); + if (piks && (flag = CMP_NUM(l_1,l_2))) + return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag); + a= end; + b+= 3; + break; + case HA_KEYTYPE_FLOAT: + mi_float4get(f_1,a); + mi_float4get(f_2,b); + /* + The following may give a compiler warning about floating point + comparison not being safe, but this is ok in this context as + we are bascily doing sorting + */ + if (piks && (flag = CMP_NUM(f_1,f_2))) + return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag); + a= end; + b+= 4; /* sizeof(float); */ + break; + case HA_KEYTYPE_DOUBLE: + mi_float8get(d_1,a); + mi_float8get(d_2,b); + /* + The following may give a compiler warning about floating point + comparison not being safe, but this is ok in this context as + we are bascily doing sorting + */ + if (piks && (flag = CMP_NUM(d_1,d_2))) + return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag); + a= end; + b+= 8; /* sizeof(double); */ + break; + case HA_KEYTYPE_NUM: /* Numeric key */ + { + int swap_flag= 0; + int alength,blength; + + if (keyseg->flag & HA_REVERSE_SORT) + { + swap_variables(uchar*, a, b); + swap_flag=1; /* Remember swap of a & b */ + end= a+ (int) (end-b); + } + if (keyseg->flag & HA_SPACE_PACK) + { + alength= *a++; blength= *b++; + end=a+alength; + next_key_length=key_length-blength-1; + } + else + { + alength= (int) (end-a); + blength=keyseg->length; + /* remove pre space from keys */ + for ( ; alength && *a == ' ' ; a++, alength--) ; + for ( ; blength && *b == ' ' ; b++, blength--) ; + } + if (piks) + { + if (*a == '-') + { + if (*b != '-') + return -1; + a++; b++; + swap_variables(uchar*, a, b); + swap_variables(int, alength, blength); + swap_flag=1-swap_flag; + alength--; blength--; + end=a+alength; + } + else if (*b == '-') + return 1; + while (alength && (*a == '+' || *a == '0')) + { + a++; alength--; + } + while (blength && (*b == '+' || *b == '0')) + { + b++; blength--; + } + if (alength != blength) + return (alength < blength) ? -1 : 1; + while (a < end) + if (*a++ != *b++) + return ((int) a[-1] - (int) b[-1]); + } + else + { + b+=(end-a); + a=end; + } + + if (swap_flag) /* Restore pointers */ + swap_variables(uchar*, a, b); + break; + } +#ifdef HAVE_LONG_LONG + case HA_KEYTYPE_LONGLONG: + { + longlong ll_a,ll_b; + ll_a= mi_sint8korr(a); + ll_b= mi_sint8korr(b); + if (piks && (flag = CMP_NUM(ll_a,ll_b))) + return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag); + a= end; + b+= 8; + break; + } + case HA_KEYTYPE_ULONGLONG: + { + ulonglong ll_a,ll_b; + ll_a= mi_uint8korr(a); + ll_b= mi_uint8korr(b); + if (piks && (flag = CMP_NUM(ll_a,ll_b))) + return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag); + a= end; + b+= 8; + break; + } +#endif + case HA_KEYTYPE_END: /* Ready */ + goto end; /* diff_pos is incremented */ + } + } + (*diff_pos)++; +end: + if (!(nextflag & SEARCH_FIND)) + { + uint i; + if (nextflag & (SEARCH_NO_FIND | SEARCH_LAST)) /* Find record after key */ + return (nextflag & (SEARCH_BIGGER | SEARCH_LAST)) ? -1 : 1; + flag=0; + for (i=keyseg->length ; i-- > 0 ; ) + { + if (*a++ != *b++) + { + flag= FCMP(a[-1],b[-1]); + break; + } + } + if (nextflag & SEARCH_SAME) + return (flag); /* read same */ + if (nextflag & SEARCH_BIGGER) + return (flag <= 0 ? -1 : 1); /* read next */ + return (flag < 0 ? -1 : 1); /* read previous */ + } + return 0; +} /* ha_key_cmp */ + + +/* + Find the first NULL value in index-suffix values tuple + + SYNOPSIS + ha_find_null() + keyseg Array of keyparts for key suffix + a Key suffix value tuple + + DESCRIPTION + Find the first NULL value in index-suffix values tuple. + + TODO + Consider optimizing this function or its use so we don't search for + NULL values in completely NOT NULL index suffixes. + + RETURN + First key part that has NULL as value in values tuple, or the last key + part (with keyseg->type==HA_TYPE_END) if values tuple doesn't contain + NULLs. +*/ + +HA_KEYSEG *ha_find_null(HA_KEYSEG *keyseg, uchar *a) +{ + for (; (enum ha_base_keytype) keyseg->type != HA_KEYTYPE_END; keyseg++) + { + uchar *end; + if (keyseg->null_bit) + { + if (!*a++) + return keyseg; + } + end= a+ keyseg->length; + + switch ((enum ha_base_keytype) keyseg->type) { + case HA_KEYTYPE_TEXT: + case HA_KEYTYPE_BINARY: + case HA_KEYTYPE_BIT: + if (keyseg->flag & HA_SPACE_PACK) + { + int a_length; + get_key_length(a_length, a); + a += a_length; + break; + } + else + a= end; + break; + case HA_KEYTYPE_VARTEXT1: + case HA_KEYTYPE_VARTEXT2: + case HA_KEYTYPE_VARBINARY1: + case HA_KEYTYPE_VARBINARY2: + { + int a_length; + get_key_length(a_length, a); + a+= a_length; + break; + } + case HA_KEYTYPE_NUM: + if (keyseg->flag & HA_SPACE_PACK) + { + int alength= *a++; + end= a+alength; + } + a= end; + break; + case HA_KEYTYPE_INT8: + case HA_KEYTYPE_SHORT_INT: + case HA_KEYTYPE_USHORT_INT: + case HA_KEYTYPE_LONG_INT: + case HA_KEYTYPE_ULONG_INT: + case HA_KEYTYPE_INT24: + case HA_KEYTYPE_UINT24: +#ifdef HAVE_LONG_LONG + case HA_KEYTYPE_LONGLONG: + case HA_KEYTYPE_ULONGLONG: +#endif + case HA_KEYTYPE_FLOAT: + case HA_KEYTYPE_DOUBLE: + a= end; + break; + case HA_KEYTYPE_END: /* purecov: inspected */ + /* keep compiler happy */ + DBUG_ASSERT(0); + break; + } + } + return keyseg; +} + + + +/* + Register handler error messages for usage with my_error() + + NOTES + This is safe to call multiple times as my_error_register() + will ignore calls to register already registered error numbers. +*/ + +static const char **get_handler_error_messages() +{ + return handler_error_messages; +} + +void my_handler_error_register(void) +{ + /* + If you got compilation error here about compile_time_assert array, check + that every HA_ERR_xxx constant has a corresponding error message in + handler_error_messages[] list (check mysys/ma_handler_errors.h and + include/my_base.h). + */ + compile_time_assert(HA_ERR_FIRST + array_elements(handler_error_messages) == + HA_ERR_LAST + 1); + my_error_register(get_handler_error_messages, HA_ERR_FIRST, + HA_ERR_FIRST+ array_elements(handler_error_messages)-1); +} + + +void my_handler_error_unregister(void) +{ + my_error_unregister(HA_ERR_FIRST, + HA_ERR_FIRST+ array_elements(handler_error_messages)-1); +} diff --git a/dep/mysqllite/mysys/my_handler_errors.h b/dep/mysqllite/mysys/my_handler_errors.h index c239cabb16803..e4e62f47fedcc 100644 --- a/dep/mysqllite/mysys/my_handler_errors.h +++ b/dep/mysqllite/mysys/my_handler_errors.h @@ -1,3 +1,5 @@ +#ifndef MYSYS_MY_HANDLER_ERRORS_INCLUDED +#define MYSYS_MY_HANDLER_ERRORS_INCLUDED /* Errors a handler can give you @@ -66,3 +68,4 @@ static const char *handler_error_messages[]= "Too many active concurrent transactions" }; +#endif /* MYSYS_MY_HANDLER_ERRORS_INCLUDED */ diff --git a/dep/mysqllite/mysys/my_init.c b/dep/mysqllite/mysys/my_init.c index a60927be6939a..9b0939c1c759e 100644 --- a/dep/mysqllite/mysys/my_init.c +++ b/dep/mysqllite/mysys/my_init.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2003 MySQL AB +/* Copyright (C) 2000-2003 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 @@ -19,14 +19,12 @@ #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); @@ -34,13 +32,13 @@ static my_bool win32_init_tcp_ip(); #else #define my_win_init() #endif -#ifdef __NETWARE__ -static void netware_init(); -#else -#define netware_init() -#endif + +#define SCALE_SEC 100 +#define SCALE_USEC 10000 my_bool my_init_done= 0; +/** True if @c my_basic_init() has been called. */ +my_bool my_basic_init_done= 0; uint mysys_usage_id= 0; /* Incremented for each my_init() */ ulong my_thread_stack_size= 65536; @@ -55,6 +53,68 @@ static ulong atoi_octal(const char *str) return (ulong) tmp; } +MYSQL_FILE *mysql_stdin= NULL; +static MYSQL_FILE instrumented_stdin; + +/** + Perform a limited initialisation of mysys. + This initialisation is sufficient to: + - allocate memory, + - read configuration files, + - parse command lines arguments. + To complete the mysys initialisation, + call my_init(). + @return 0 on success +*/ +my_bool my_basic_init(void) +{ + char * str; + + if (my_basic_init_done) + return 0; + my_basic_init_done= 1; + + mysys_usage_id++; + my_umask= 0660; /* Default umask for new files */ + my_umask_dir= 0700; /* Default umask for new directories */ + + /* 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); + + init_glob_errs(); + + instrumented_stdin.m_file= stdin; + instrumented_stdin.m_psi= NULL; /* not yet instrumented */ + mysql_stdin= & instrumented_stdin; + + if (my_thread_global_init()) + return 1; + +#if defined(SAFE_MUTEX) + safe_mutex_global_init(); /* Must be called early */ +#endif + +#if defined(MY_PTHREAD_FASTMUTEX) && !defined(SAFE_MUTEX) + fastmutex_global_init(); /* Must be called early */ +#endif + +#if defined(HAVE_PTHREAD_INIT) + pthread_init(); /* Must be called before DBUG_ENTER */ +#endif + if (my_thread_basic_global_init()) + return 1; + + /* $HOME is needed early to parse configuration files located in ~/ */ + if ((home_dir= getenv("HOME")) != 0) + home_dir= intern_filename(home_dir_buff, home_dir); + + return 0; +} + /* Init my_sys functions and my_sys variabels @@ -69,54 +129,22 @@ static ulong atoi_octal(const char *str) 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(); -#if defined(THREAD) + + my_init_done= 1; + + if (my_basic_init()) + return 1; + if (my_thread_global_init()) return 1; -# if defined(SAFE_MUTEX) - safe_mutex_global_init(); /* Must be called early */ -# endif -#endif -#if defined(THREAD) && defined(MY_PTHREAD_FASTMUTEX) && !defined(SAFE_MUTEX) - fastmutex_global_init(); /* Must be called early */ -#endif - netware_init(); -#ifdef THREAD -#if defined(HAVE_PTHREAD_INIT) - pthread_init(); /* Must be called before DBUG_ENTER */ -#endif -#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)); - } + my_win_init(); + DBUG_PRINT("exit", ("home: '%s'", home_dir)); #ifdef __WIN__ win32_init_tcp_ip(); #endif @@ -160,7 +188,7 @@ void my_end(int infoflag) char ebuff[512]; 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); + my_message_stderr(EE_OPEN_WARNING, ebuff, ME_BELL); DBUG_PRINT("error", ("%s", ebuff)); my_print_open_files(); } @@ -194,12 +222,7 @@ Voluntary context switches %ld, Involuntary context switches %ld\n", 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) - TERMINATE(stderr, (infoflag & MY_GIVE_INFO) != 0); -#elif defined(__WIN__) && defined(_MSC_VER) +#if defined(__WIN__) && defined(_MSC_VER) _CrtSetReportMode( _CRT_WARN, _CRTDBG_MODE_FILE ); _CrtSetReportFile( _CRT_WARN, _CRTDBG_FILE_STDERR ); _CrtSetReportMode( _CRT_ERROR, _CRTDBG_MODE_FILE ); @@ -210,16 +233,12 @@ Voluntary context switches %ld, Involuntary context switches %ld\n", _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) @@ -230,13 +249,14 @@ Voluntary context switches %ld, Involuntary context switches %ld\n", 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_basic_init_done= 0; } /* my_end */ @@ -288,6 +308,89 @@ int handle_rtc_failure(int err_type, const char *file, int line, #pragma runtime_checks("", restore) #endif +#define OFFSET_TO_EPOC ((__int64) 134774 * 24 * 60 * 60 * 1000 * 1000 * 10) +#define MS 10000000 + +static void win_init_time(void) +{ + /* The following is used by time functions */ + 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 +*/ +static void win_init_registry(void) +{ + 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); + } +} + static void my_win_init(void) { @@ -295,17 +398,18 @@ static void my_win_init(void) #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 + _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 +#endif + #ifdef __MSVC_RUNTIME_CHECKS /* Install handler to send RTC (Runtime Error Check) warnings @@ -316,106 +420,10 @@ static void my_win_init(void) _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); + win_init_time(); + win_init_registry(); - /* 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 ; + DBUG_VOID_RETURN; } @@ -454,7 +462,7 @@ static my_bool win32_init_tcp_ip() { if (win32_have_tcpip()) { - WORD wVersionRequested = MAKEWORD( 2, 0 ); + WORD wVersionRequested = MAKEWORD( 2, 2 ); WSADATA wsaData; /* Be a good citizen: maybe another lib has already initialised sockets, so dont clobber them unless necessary */ @@ -483,56 +491,117 @@ static my_bool win32_init_tcp_ip() } #endif /* __WIN__ */ +#ifdef HAVE_PSI_INTERFACE -#ifdef __NETWARE__ -/* - Basic initialisation for netware -*/ +#if !defined(HAVE_PREAD) && !defined(_WIN32) +PSI_mutex_key key_my_file_info_mutex; +#endif /* !defined(HAVE_PREAD) && !defined(_WIN32) */ -static void netware_init() +#if !defined(HAVE_LOCALTIME_R) || !defined(HAVE_GMTIME_R) +PSI_mutex_key key_LOCK_localtime_r; +#endif /* !defined(HAVE_LOCALTIME_R) || !defined(HAVE_GMTIME_R) */ + +#ifndef HAVE_GETHOSTBYNAME_R +PSI_mutex_key key_LOCK_gethostbyname_r; +#endif /* HAVE_GETHOSTBYNAME_R */ + +PSI_mutex_key key_BITMAP_mutex, key_IO_CACHE_append_buffer_lock, + key_IO_CACHE_SHARE_mutex, key_KEY_CACHE_cache_lock, key_LOCK_alarm, + key_my_thread_var_mutex, key_THR_LOCK_charset, key_THR_LOCK_heap, + key_THR_LOCK_isam, key_THR_LOCK_lock, key_THR_LOCK_malloc, + key_THR_LOCK_mutex, key_THR_LOCK_myisam, key_THR_LOCK_net, + key_THR_LOCK_open, key_THR_LOCK_threads, key_THR_LOCK_time, + key_TMPDIR_mutex, key_THR_LOCK_myisam_mmap; + +static PSI_mutex_info all_mysys_mutexes[]= { - char cwd[PATH_MAX], *name; +#if !defined(HAVE_PREAD) && !defined(_WIN32) + { &key_my_file_info_mutex, "st_my_file_info:mutex", 0}, +#endif /* !defined(HAVE_PREAD) && !defined(_WIN32) */ +#if !defined(HAVE_LOCALTIME_R) || !defined(HAVE_GMTIME_R) + { &key_LOCK_localtime_r, "LOCK_localtime_r", PSI_FLAG_GLOBAL}, +#endif /* !defined(HAVE_LOCALTIME_R) || !defined(HAVE_GMTIME_R) */ +#ifndef HAVE_GETHOSTBYNAME_R + { &key_LOCK_gethostbyname_r, "LOCK_gethostbyname_r", PSI_FLAG_GLOBAL}, +#endif /* HAVE_GETHOSTBYNAME_R */ + { &key_BITMAP_mutex, "BITMAP::mutex", 0}, + { &key_IO_CACHE_append_buffer_lock, "IO_CACHE::append_buffer_lock", 0}, + { &key_IO_CACHE_SHARE_mutex, "IO_CACHE::SHARE_mutex", 0}, + { &key_KEY_CACHE_cache_lock, "KEY_CACHE::cache_lock", 0}, + { &key_LOCK_alarm, "LOCK_alarm", PSI_FLAG_GLOBAL}, + { &key_my_thread_var_mutex, "my_thread_var::mutex", 0}, + { &key_THR_LOCK_charset, "THR_LOCK_charset", PSI_FLAG_GLOBAL}, + { &key_THR_LOCK_heap, "THR_LOCK_heap", PSI_FLAG_GLOBAL}, + { &key_THR_LOCK_isam, "THR_LOCK_isam", PSI_FLAG_GLOBAL}, + { &key_THR_LOCK_lock, "THR_LOCK_lock", PSI_FLAG_GLOBAL}, + { &key_THR_LOCK_malloc, "THR_LOCK_malloc", PSI_FLAG_GLOBAL}, + { &key_THR_LOCK_mutex, "THR_LOCK::mutex", 0}, + { &key_THR_LOCK_myisam, "THR_LOCK_myisam", PSI_FLAG_GLOBAL}, + { &key_THR_LOCK_net, "THR_LOCK_net", PSI_FLAG_GLOBAL}, + { &key_THR_LOCK_open, "THR_LOCK_open", PSI_FLAG_GLOBAL}, + { &key_THR_LOCK_threads, "THR_LOCK_threads", PSI_FLAG_GLOBAL}, + { &key_THR_LOCK_time, "THR_LOCK_time", PSI_FLAG_GLOBAL}, + { &key_TMPDIR_mutex, "TMPDIR_mutex", PSI_FLAG_GLOBAL}, + { &key_THR_LOCK_myisam_mmap, "THR_LOCK_myisam_mmap", PSI_FLAG_GLOBAL} +}; + +PSI_cond_key key_COND_alarm, key_IO_CACHE_SHARE_cond, + key_IO_CACHE_SHARE_cond_writer, key_my_thread_var_suspend, + key_THR_COND_threads; + +static PSI_cond_info all_mysys_conds[]= +{ + { &key_COND_alarm, "COND_alarm", PSI_FLAG_GLOBAL}, + { &key_IO_CACHE_SHARE_cond, "IO_CACHE_SHARE::cond", 0}, + { &key_IO_CACHE_SHARE_cond_writer, "IO_CACHE_SHARE::cond_writer", 0}, + { &key_my_thread_var_suspend, "my_thread_var::suspend", 0}, + { &key_THR_COND_threads, "THR_COND_threads", 0} +}; - DBUG_ENTER("netware_init"); +#ifdef USE_ALARM_THREAD +PSI_thread_key key_thread_alarm; - /* 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 */ - } +static PSI_thread_info all_mysys_threads[]= +{ + { &key_thread_alarm, "alarm", PSI_FLAG_GLOBAL} +}; +#endif /* USE_ALARM_THREAD */ - /* Parse program name and change to base format */ - name= (char*) my_progname; - for (; *name; name++) - { - if (*name == '\\') - { - *name = '/'; - } - else - { - *name = tolower(*name); - } - } - } +#ifdef HUGETLB_USE_PROC_MEMINFO +PSI_file_key key_file_proc_meminfo; +#endif /* HUGETLB_USE_PROC_MEMINFO */ +PSI_file_key key_file_charset, key_file_cnf; - DBUG_VOID_RETURN; +static PSI_file_info all_mysys_files[]= +{ +#ifdef HUGETLB_USE_PROC_MEMINFO + { &key_file_proc_meminfo, "proc_meminfo", 0}, +#endif /* HUGETLB_USE_PROC_MEMINFO */ + { &key_file_charset, "charset", 0}, + { &key_file_cnf, "cnf", 0} +}; + +void my_init_mysys_psi_keys() +{ + const char* category= "mysys"; + int count; + + if (PSI_server == NULL) + return; + + count= sizeof(all_mysys_mutexes)/sizeof(all_mysys_mutexes[0]); + PSI_server->register_mutex(category, all_mysys_mutexes, count); + + count= sizeof(all_mysys_conds)/sizeof(all_mysys_conds[0]); + PSI_server->register_cond(category, all_mysys_conds, count); + +#ifdef USE_ALARM_THREAD + count= sizeof(all_mysys_threads)/sizeof(all_mysys_threads[0]); + PSI_server->register_thread(category, all_mysys_threads, count); +#endif /* USE_ALARM_THREAD */ + + count= sizeof(all_mysys_files)/sizeof(all_mysys_files[0]); + PSI_server->register_file(category, all_mysys_files, count); } -#endif /* __NETWARE__ */ +#endif /* HAVE_PSI_INTERFACE */ + diff --git a/dep/mysqllite/mysys/my_largepage.c b/dep/mysqllite/mysys/my_largepage.c new file mode 100644 index 0000000000000..9f5ab01a2b72a --- /dev/null +++ b/dep/mysqllite/mysys/my_largepage.c @@ -0,0 +1,166 @@ +/* Copyright (C) 2004 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 */ + +#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); + +/* 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) +{ + 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_free_lock(ptr); + + 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) +{ + MYSQL_FILE *f; + uint size = 0; + char buf[256]; + DBUG_ENTER("my_get_large_page_size_int"); + + if (!(f= mysql_file_fopen(key_file_proc_meminfo, "/proc/meminfo", + O_RDONLY, MYF(MY_WME)))) + goto finish; + + while (mysql_file_fgets(buf, sizeof(buf), f)) + if (sscanf(buf, "Hugepagesize: %u kB", &size)) + break; + + mysql_file_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= MY_ALIGN(size, (size_t) 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) +{ + DBUG_ENTER("my_large_free_int"); + DBUG_RETURN(shmdt(ptr) == 0); +} +#endif /* HAVE_DECL_SHM_HUGETLB */ + +#endif /* HAVE_LARGE_PAGES */ diff --git a/dep/mysqllite/mysys/my_lib.c b/dep/mysqllite/mysys/my_lib.c index c18d14fb54989..06f9521a66473 100644 --- a/dep/mysqllite/mysys/my_lib.c +++ b/dep/mysqllite/mysys/my_lib.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (C) 2000 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 @@ -14,7 +14,6 @@ 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 @@ -35,20 +34,14 @@ # if defined(HAVE_NDIR_H) # include # endif -# if defined(__WIN__) -# include +# if defined(_WIN32) # ifdef __BORLANDC__ # include # endif # endif #endif -#ifdef VMS -#include -#include -#include -#endif -#if defined(THREAD) && defined(HAVE_READDIR_R) +#if 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))) @@ -78,7 +71,7 @@ void my_dirend(MY_DIR *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)); + my_free(buffer); } DBUG_VOID_RETURN; } /* my_dirend */ @@ -92,7 +85,7 @@ static int comp_names(struct fileinfo *a, struct fileinfo *b) } /* comp_names */ -#if !defined(__WIN__) +#if !defined(_WIN32) MY_DIR *my_dir(const char *path, myf MyFlags) { @@ -104,14 +97,13 @@ MY_DIR *my_dir(const char *path, myf MyFlags) 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); +#if !defined(HAVE_READDIR_R) + mysql_mutex_lock(&THR_LOCK_open); #endif dirp = opendir(directory_file_name(tmp_path,(char *) path)); @@ -132,7 +124,7 @@ MY_DIR *my_dir(const char *path, myf MyFlags) if (my_init_dynamic_array(dir_entries_storage, sizeof(FILEINFO), ENTRIES_START_SIZE, ENTRIES_INCREMENT)) { - my_free((uchar*) buffer,MYF(0)); + my_free(buffer); goto error; } init_alloc_root(names_storage, NAMES_START_SIZE, NAMES_START_SIZE); @@ -142,11 +134,7 @@ MY_DIR *my_dir(const char *path, myf MyFlags) tmp_file=strend(tmp_path); -#ifdef THREAD dp= (struct dirent*) dirent_tmp; -#else - dp=0; -#endif while (!(READDIR(dirp,(struct dirent*) dirent_tmp,dp))) { @@ -160,8 +148,8 @@ MY_DIR *my_dir(const char *path, myf MyFlags) goto error; bzero(finfo.mystat, sizeof(MY_STAT)); - VOID(strmov(tmp_file,dp->d_name)); - VOID(my_stat(tmp_path, finfo.mystat, MyFlags)); + (void) strmov(tmp_file,dp->d_name); + (void) my_stat(tmp_path, finfo.mystat, MyFlags); if (!(finfo.mystat->st_mode & MY_S_IREAD)) continue; } @@ -173,8 +161,8 @@ MY_DIR *my_dir(const char *path, myf MyFlags) } (void) closedir(dirp); -#if defined(THREAD) && !defined(HAVE_READDIR_R) - pthread_mutex_unlock(&THR_LOCK_open); +#if !defined(HAVE_READDIR_R) + mysql_mutex_unlock(&THR_LOCK_open); #endif result->dir_entry= (FILEINFO *)dir_entries_storage->buffer; result->number_off_files= dir_entries_storage->elements; @@ -185,8 +173,8 @@ MY_DIR *my_dir(const char *path, myf MyFlags) DBUG_RETURN(result); error: -#if defined(THREAD) && !defined(HAVE_READDIR_R) - pthread_mutex_unlock(&THR_LOCK_open); +#if !defined(HAVE_READDIR_R) + mysql_mutex_unlock(&THR_LOCK_open); #endif my_errno=errno; if (dirp) @@ -200,9 +188,6 @@ MY_DIR *my_dir(const char *path, myf MyFlags) /* * 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; @@ -210,11 +195,8 @@ MY_DIR *my_dir(const char *path, myf MyFlags) char * directory_file_name (char * dst, const char *src) { -#ifndef VMS - /* Process as Unix format: just remove test the final slash. */ - - char * end; + char *end; if (src[0] == 0) src= (char*) "."; /* Use empty as current */ @@ -225,125 +207,7 @@ char * directory_file_name (char * dst, const char *src) 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 @@ -401,7 +265,7 @@ MY_DIR *my_dir(const char *path, myf MyFlags) if (my_init_dynamic_array(dir_entries_storage, sizeof(FILEINFO), ENTRIES_START_SIZE, ENTRIES_INCREMENT)) { - my_free((uchar*) buffer,MYF(0)); + my_free(buffer); goto error; } init_alloc_root(names_storage, NAMES_START_SIZE, NAMES_START_SIZE); @@ -507,19 +371,24 @@ MY_DIR *my_dir(const char *path, myf MyFlags) DBUG_RETURN((MY_DIR *) NULL); } /* my_dir */ -#endif /* __WIN__ */ +#endif /* _WIN32 */ /**************************************************************************** ** File status ** Note that MY_STAT is assumed to be same as struct stat ****************************************************************************/ -int my_fstat(int Filedes, MY_STAT *stat_area, + +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 } @@ -531,15 +400,19 @@ MY_STAT *my_stat(const char *path, MY_STAT *stat_area, myf my_flags) (long) stat_area, my_flags)); if ((m_used= (stat_area == NULL))) - if (!(stat_area = (MY_STAT *) my_malloc(sizeof(MY_STAT), my_flags))) + if (!(stat_area= (MY_STAT *) my_malloc(sizeof(MY_STAT), my_flags))) goto error; - if (! stat((char *) path, (struct stat *) stat_area) ) - DBUG_RETURN(stat_area); - +#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)); + my_free(stat_area); error: if (my_flags & (MY_FAE+MY_WME)) diff --git a/dep/mysqllite/mysys/my_libwrap.c b/dep/mysqllite/mysys/my_libwrap.c new file mode 100644 index 0000000000000..e72334ba806ea --- /dev/null +++ b/dep/mysqllite/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/dep/mysqllite/mysys/my_lock.c b/dep/mysqllite/mysys/my_lock.c new file mode 100644 index 0000000000000..49c94ea838c82 --- /dev/null +++ b/dep/mysqllite/mysys/my_lock.c @@ -0,0 +1,223 @@ +/* Copyright (C) 2000-2003 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 */ + +#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 _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 + + DBUG_ENTER("my_lock"); + DBUG_PRINT("my",("fd: %d Op: %d start: %ld Length: %ld MyFlags: %d", + fd,locktype,(long) start,(long) length,MyFlags)); + if (my_disable_locking) + DBUG_RETURN(0); + +#if defined(_WIN32) + { + int timeout_sec; + if (MyFlags & MY_DONT_WAIT) + timeout_sec= 0; + 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_DONT_WAIT) + { + if (fcntl(fd,F_SETLK,&lock) != -1) /* Check if we can lock */ + DBUG_RETURN(0); /* Ok, file locked */ + 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 */ + + /* We got an error. We don't want EACCES errors */ + my_errno=(errno == EACCES) ? EAGAIN : errno ? errno : -1; + + 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); +} /* my_lock */ diff --git a/dep/mysqllite/mysys/my_lockmem.c b/dep/mysqllite/mysys/my_lockmem.c new file mode 100644 index 0000000000000..a37db6b2089f6 --- /dev/null +++ b/dep/mysqllite/mysys/my_lockmem.c @@ -0,0 +1,98 @@ +/* Copyright (C) 2000 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 */ + +/* 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; + +uchar *my_malloc_lock(uint 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 (!(ptr=memalign(pagesize,size))) + { + 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; + mysql_mutex_lock(&THR_LOCK_malloc); + mem_list=list_add(mem_list,&element->list); + mysql_mutex_unlock(&THR_LOCK_malloc); + } + DBUG_RETURN(ptr); +} + + +void my_free_lock(uchar *ptr) +{ + LIST *list; + struct st_mem_list *element=0; + + mysql_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; + } + } + mysql_mutex_unlock(&THR_LOCK_malloc); + my_free(element); + free(ptr); /* Free even if not locked */ +} + +#endif /* HAVE_MLOCK */ diff --git a/dep/mysqllite/mysys/my_malloc.c b/dep/mysqllite/mysys/my_malloc.c index 13d2375eb9991..fc2dc98c3c530 100644 --- a/dep/mysqllite/mysys/my_malloc.c +++ b/dep/mysqllite/mysys/my_malloc.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -11,28 +11,31 @@ You should have received a copy of the GNU General Public 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 + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "mysys_priv.h" #include "mysys_err.h" #include - /* My memory allocator */ +/** + Allocate a sized block of memory. + @param size The size of the memory block in bytes. + @param flags Failure action modifiers (bitmasks). + + @return A pointer to the allocated memory block, or NULL on failure. +*/ 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)); + /* Safety */ if (!size) - size=1; /* Safety */ + size=1; - point= (char *) malloc(size); + point= malloc(size); DBUG_EXECUTE_IF("simulate_out_of_memory", { free(point); @@ -52,33 +55,87 @@ void *my_malloc(size_t size, myf my_flags) exit(1); } else if (my_flags & MY_ZEROFILL) - bzero(point,size); - DBUG_PRINT("exit",("ptr: 0x%lx", (long) point)); - DBUG_RETURN((void*) point); -} /* my_malloc */ + bzero(point, size); + DBUG_PRINT("exit",("ptr: %p", point)); + DBUG_RETURN(point); +} + + +/** + @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); + 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= realloc(oldpoint, size)) == NULL) + { + if (my_flags & MY_FREE_ON_ERROR) + my_free(oldpoint); + 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); +} - /* Free memory allocated with my_malloc */ - /*ARGSUSED*/ +/** + Free memory allocated with my_malloc. -void my_no_flags_free(void* ptr) + @remark Relies on free being able to handle a NULL argument. + + @param ptr Pointer to the memory allocated by my_malloc. +*/ +void my_free(void *ptr) { DBUG_ENTER("my_free"); - DBUG_PRINT("my",("ptr: 0x%lx", (long) ptr)); - if (ptr) - free(ptr); + DBUG_PRINT("my",("ptr: %p", ptr)); + free(ptr); DBUG_VOID_RETURN; -} /* my_free */ - +} - /* malloc and copy */ -void* my_memdup(const void *from, size_t length, myf my_flags) +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); + return ptr; } @@ -87,18 +144,19 @@ 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); + memcpy(ptr, from, 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) + if ((ptr= (char*) my_malloc(length+1, my_flags))) { - memcpy((uchar*) ptr, (uchar*) from, length); - ptr[length]=0; + memcpy(ptr, from, length); + ptr[length]= 0; } - return((char*) ptr); + return ptr; } + diff --git a/dep/mysqllite/mysys/my_memmem.c b/dep/mysqllite/mysys/my_memmem.c new file mode 100644 index 0000000000000..c000f14bc6645 --- /dev/null +++ b/dep/mysqllite/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/dep/mysqllite/mysys/my_messnc.c b/dep/mysqllite/mysys/my_mess.c similarity index 76% rename from dep/mysqllite/mysys/my_messnc.c rename to dep/mysqllite/mysys/my_mess.c index e2431959b7abf..513afe39054b8 100644 --- a/dep/mysqllite/mysys/my_messnc.c +++ b/dep/mysqllite/mysys/my_mess.c @@ -15,18 +15,14 @@ #include "mysys_priv.h" -int my_message_no_curses(uint error __attribute__((unused)), - const char *str, myf MyFlags) +void my_message_stderr(uint error __attribute__((unused)), + const char *str, myf MyFlags) { - DBUG_ENTER("my_message_no_curses"); + DBUG_ENTER("my_message_stderr"); 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__ */ + (void) fputc('\007', stderr); if (my_progname) { (void)fputs(my_progname,stderr); (void)fputs(": ",stderr); @@ -34,5 +30,5 @@ int my_message_no_curses(uint error __attribute__((unused)), (void)fputs(str,stderr); (void)fputc('\n',stderr); (void)fflush(stderr); - DBUG_RETURN(0); + DBUG_VOID_RETURN; } diff --git a/dep/mysqllite/mysys/my_mkdir.c b/dep/mysqllite/mysys/my_mkdir.c new file mode 100644 index 0000000000000..676c6c1cd5140 --- /dev/null +++ b/dep/mysqllite/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/dep/mysqllite/mysys/my_mmap.c b/dep/mysqllite/mysys/my_mmap.c new file mode 100644 index 0000000000000..82ee1562bc262 --- /dev/null +++ b/dep/mysqllite/mysys/my_mmap.c @@ -0,0 +1,88 @@ +/* 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); + DBUG_ENTER("my_mmap"); + DBUG_PRINT("mysys", ("map fd: %d", fd)); + + if (hFile == INVALID_HANDLE_VALUE) + DBUG_RETURN(MAP_FAILED); + + hFileMap=CreateFileMapping(hFile, &mmap_security_attributes, + PAGE_READWRITE, 0, (DWORD) len, NULL); + if (hFileMap == 0) + DBUG_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) + { + DBUG_PRINT("mysys", ("mapped addr: %p", ptr)); + DBUG_RETURN(ptr); + } + + DBUG_RETURN(MAP_FAILED); +} + +int my_munmap(void *addr, size_t len) +{ + DBUG_ENTER("my_munmap"); + DBUG_PRINT("mysys", ("unmap addr: %p", addr)); + DBUG_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/dep/mysqllite/mysys/my_new.cc b/dep/mysqllite/mysys/my_new.cc new file mode 100644 index 0000000000000..7da54ffac8732 --- /dev/null +++ b/dep/mysqllite/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/dep/mysqllite/mysys/my_once.c b/dep/mysqllite/mysys/my_once.c index b6f6656fce26b..32d07802028a9 100644 --- a/dep/mysqllite/mysys/my_once.c +++ b/dep/mysqllite/mysys/my_once.c @@ -15,17 +15,14 @@ /* 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 + Alloc for things we don't nend to free run-time (that only + should be free'd on exit) SYNOPSIS my_once_alloc() @@ -100,7 +97,7 @@ void *my_once_memdup(const void *src, size_t len, myf myflags) /* - Deallocate everything used by my_once_alloc + Deallocate everything that was allocated with my_once_alloc SYNOPSIS my_once_free() diff --git a/dep/mysqllite/mysys/my_open.c b/dep/mysqllite/mysys/my_open.c index fe7f65c450b07..2aef97b3e3499 100644 --- a/dep/mysqllite/mysys/my_open.c +++ b/dep/mysqllite/mysys/my_open.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (C) 2000 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 @@ -17,9 +17,7 @@ #include "mysys_err.h" #include #include -#if defined(__WIN__) -#include -#endif + /* Open a file @@ -43,29 +41,8 @@ File my_open(const char *FileName, int Flags, myf MyFlags) DBUG_ENTER("my_open"); DBUG_PRINT("my",("Name: '%s' Flags: %d MyFlags: %d", FileName, Flags, MyFlags)); -#if defined(__WIN__) - /* - Check that we don't try to open or create a file name that may - cause problems for us in the future (like PRN) - */ - if (check_if_legal_filename(FileName)) - { - errno= EACCES; - DBUG_RETURN(my_register_filename(-1, FileName, FILE_BY_OPEN, - EE_FILENOTFOUND, MyFlags)); - } -#ifndef __WIN__ - if (Flags & O_SHARE) - fd = sopen((char *) FileName, (Flags & ~O_SHARE) | O_BINARY, SH_DENYNO, - MY_S_IREAD | MY_S_IWRITE); - else - fd = open((char *) FileName, Flags | O_BINARY, - MY_S_IREAD | MY_S_IWRITE); -#else - fd= my_sopen((char *) FileName, (Flags & ~O_SHARE) | O_BINARY, SH_DENYNO, - MY_S_IREAD | MY_S_IWRITE); -#endif - +#if defined(_WIN32) + fd= my_win_open(FileName, Flags); #elif !defined(NO_OPEN_3) fd = open(FileName, Flags, my_umask); /* Normal unix */ #else @@ -93,12 +70,15 @@ int my_close(File fd, myf MyFlags) DBUG_ENTER("my_close"); DBUG_PRINT("my",("fd: %d MyFlags: %d",fd, MyFlags)); - pthread_mutex_lock(&THR_LOCK_open); + mysql_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)); @@ -108,14 +88,14 @@ int my_close(File fd, myf MyFlags) } 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) - pthread_mutex_destroy(&my_file_info[fd].mutex); + my_free(my_file_info[fd].name); +#if !defined(HAVE_PREAD) && !defined(_WIN32) + mysql_mutex_destroy(&my_file_info[fd].mutex); #endif my_file_info[fd].type = UNOPEN; } my_file_opened--; - pthread_mutex_unlock(&THR_LOCK_open); + mysql_mutex_unlock(&THR_LOCK_open); DBUG_RETURN(err); } /* my_close */ @@ -141,11 +121,11 @@ 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 >= 0) + if ((int) fd >= MY_FILE_MIN) { if ((uint) fd >= my_file_limit) { -#if defined(THREAD) && !defined(HAVE_PREAD) +#if !defined(HAVE_PREAD) my_errno= EMFILE; #else thread_safe_increment(my_file_opened,&THR_LOCK_open); @@ -154,20 +134,21 @@ File my_register_filename(File fd, const char *FileName, enum file_type } else { - pthread_mutex_lock(&THR_LOCK_open); + mysql_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) - pthread_mutex_init(&my_file_info[fd].mutex,MY_MUTEX_INIT_FAST); +#if !defined(HAVE_PREAD) && !defined(_WIN32) + mysql_mutex_init(key_my_file_info_mutex, &my_file_info[fd].mutex, + MY_MUTEX_INIT_FAST); #endif - pthread_mutex_unlock(&THR_LOCK_open); + mysql_mutex_unlock(&THR_LOCK_open); DBUG_PRINT("exit",("fd: %d",fd)); DBUG_RETURN(fd); } - pthread_mutex_unlock(&THR_LOCK_open); + mysql_mutex_unlock(&THR_LOCK_open); my_errno= ENOMEM; } (void) my_close(fd, MyFlags); @@ -187,188 +168,7 @@ File my_register_filename(File fd, const char *FileName, enum file_type DBUG_RETURN(-1); } -#ifdef __WIN__ - -extern void __cdecl _dosmaperr(unsigned long); - -/* - Open a file with sharing. Similar to _sopen() from libc, but allows managing - share delete on win32 - - SYNOPSIS - my_sopen() - path fully qualified 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_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; - - 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; - _doserrno= 0L; /* not an OS error */ - 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; - _doserrno= 0L; /* not an OS error */ - 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; - _doserrno= 0L; - 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). - */ - _dosmaperr(GetLastError()); /* map error */ - return -1; /* return error to caller */ - } - - if ((fh= _open_osfhandle((intptr_t)osfh, - oflag & (_O_APPEND | _O_RDONLY | _O_TEXT))) == -1) - { - _dosmaperr(GetLastError()); /* map error */ - CloseHandle(osfh); - } - return fh; /* return handle */ -} -#endif /* __WIN__ */ #ifdef EXTRA_DEBUG diff --git a/dep/mysqllite/mysys/my_port.c b/dep/mysqllite/mysys/my_port.c new file mode 100644 index 0000000000000..9ad333421ca6e --- /dev/null +++ b/dep/mysqllite/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/dep/mysqllite/mysys/my_pread.c b/dep/mysqllite/mysys/my_pread.c index 3f62f150c91ba..e006360c11bbb 100644 --- a/dep/mysqllite/mysys/my_pread.c +++ b/dep/mysqllite/mysys/my_pread.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (C) 2000 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 @@ -15,11 +15,15 @@ #include "mysys_priv.h" #include "mysys_err.h" +#include "my_base.h" +#include #include -#ifdef HAVE_PREAD +#if defined (HAVE_PREAD) && !defined(_WIN32) #include #endif + + /* Read a chunk of bytes from a file from a given position @@ -46,52 +50,64 @@ size_t my_pread(File Filedes, uchar *Buffer, size_t Count, my_off_t offset, { 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: %lu Buffer: 0x%lx Count: %u MyFlags: %d", - Filedes, (ulong) offset, (long) Buffer, (uint) Count, - MyFlags)); + DBUG_PRINT("my",("fd: %d Seek: %llu Buffer: %p Count: %lu MyFlags: %d", + Filedes, (ulonglong)offset, Buffer, (ulong)Count, MyFlags)); for (;;) { -#ifndef __WIN__ - errno=0; /* Linux doesn't reset this */ -#endif -#ifndef HAVE_PREAD - pthread_mutex_lock(&my_file_info[Filedes].mutex); + errno= 0; /* Linux, Windows don't reset this on EOF/success */ +#if !defined (HAVE_PREAD) && !defined (_WIN32) + mysql_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, (uint) Count)) != Count); - pthread_mutex_unlock(&my_file_info[Filedes].mutex); + (readbytes= read(Filedes, Buffer, Count)) != Count); + save_errno= errno; + mysql_mutex_unlock(&my_file_info[Filedes].mutex); + if (error) + errno= save_errno; #else - if ((error= ((readbytes= pread(Filedes, Buffer, Count, offset)) != Count))) - my_errno= errno ? errno : -1; +#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 || readbytes != Count) + 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) + 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 */ + 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 */ + DBUG_RETURN(0); /* Read went ok; Return 0 */ + DBUG_RETURN(readbytes); /* purecov: inspected */ } } /* my_pread */ @@ -117,47 +133,50 @@ size_t my_pread(File Filedes, uchar *Buffer, size_t Count, my_off_t offset, # Number of bytes read */ -size_t my_pwrite(int Filedes, const uchar *Buffer, size_t Count, +size_t my_pwrite(File Filedes, const uchar *Buffer, size_t Count, my_off_t offset, myf MyFlags) { - size_t writenbytes, written; + size_t writtenbytes, written; uint errors; + DBUG_ENTER("my_pwrite"); - DBUG_PRINT("my",("Fd: %d Seek: %lu Buffer: 0x%lx Count: %u MyFlags: %d", - Filedes, (ulong) offset, (long) Buffer, (uint) Count, - MyFlags)); + DBUG_PRINT("my",("fd: %d Seek: %llu Buffer: %p Count: %lu MyFlags: %d", + Filedes, offset, Buffer, (ulong)Count, MyFlags)); errors= 0; written= 0; for (;;) { -#ifndef HAVE_PREAD +#if !defined (HAVE_PREAD) && !defined (_WIN32) int error; - writenbytes= (size_t) -1; - pthread_mutex_lock(&my_file_info[Filedes].mutex); + writtenbytes= (size_t) -1; + mysql_mutex_lock(&my_file_info[Filedes].mutex); error= (lseek(Filedes, offset, MY_SEEK_SET) != (my_off_t) -1 && - (writenbytes = write(Filedes, Buffer, (uint) Count)) == Count); - pthread_mutex_unlock(&my_file_info[Filedes].mutex); + (writtenbytes= write(Filedes, Buffer, Count)) == Count); + mysql_mutex_unlock(&my_file_info[Filedes].mutex); if (error) break; +#elif defined (_WIN32) + writtenbytes= my_win_pwrite(Filedes, Buffer, Count, offset); #else - if ((writenbytes= pwrite(Filedes, Buffer, Count,offset)) == Count) + writtenbytes= pwrite(Filedes, Buffer, Count, offset); +#endif + if(writtenbytes == Count) break; my_errno= errno; -#endif - if (writenbytes != (size_t) -1) - { /* Safegueard */ - written+=writenbytes; - Buffer+=writenbytes; - Count-=writenbytes; - offset+=writenbytes; + if (writtenbytes != (size_t) -1) + { + written+= writtenbytes; + Buffer+= writtenbytes; + Count-= writtenbytes; + offset+= writtenbytes; } - DBUG_PRINT("error",("Write only %u bytes", (uint) writenbytes)); + 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)) { @@ -165,15 +184,15 @@ size_t my_pwrite(int Filedes, const uchar *Buffer, size_t Count, errors++; continue; } - if ((writenbytes && writenbytes != (size_t) -1) || my_errno == EINTR) + 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); + my_error(EE_WRITE, MYF(ME_BELL | ME_WAITTANG), + my_filename(Filedes),my_errno); } DBUG_RETURN(MY_FILE_ERROR); /* Error on read */ } @@ -183,5 +202,5 @@ size_t my_pwrite(int Filedes, const uchar *Buffer, size_t Count, 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(writenbytes+written); /* purecov: inspected */ + DBUG_RETURN(writtenbytes+written); /* purecov: inspected */ } /* my_pwrite */ diff --git a/dep/mysqllite/mysys/my_pthread.c b/dep/mysqllite/mysys/my_pthread.c index aba3e47d75408..150bde3fb3335 100644 --- a/dep/mysqllite/mysys/my_pthread.c +++ b/dep/mysqllite/mysys/my_pthread.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2003 MySQL AB +/* Copyright (C) 2000-2003 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 @@ #define DONT_REMAP_PTHREAD_FUNCTIONS #include "mysys_priv.h" -#ifdef THREAD #include #include #include @@ -31,46 +30,6 @@ uint thd_lib_detected= 0; -#ifndef my_pthread_setprio -void my_pthread_setprio(pthread_t thread_id,int prior) -{ -#ifdef HAVE_PTHREAD_SETSCHEDPARAM - struct sched_param tmp_sched_param; - bzero((char*) &tmp_sched_param,sizeof(tmp_sched_param)); - tmp_sched_param.sched_priority=prior; - VOID(pthread_setschedparam(thread_id,SCHED_POLICY,&tmp_sched_param)); -#endif -} -#endif - -#ifndef my_pthread_getprio -int my_pthread_getprio(pthread_t thread_id) -{ -#ifdef HAVE_PTHREAD_SETSCHEDPARAM - struct sched_param tmp_sched_param; - int policy; - if (!pthread_getschedparam(thread_id,&policy,&tmp_sched_param)) - { - return tmp_sched_param.sched_priority; - } -#endif - return -1; -} -#endif - -#ifndef my_pthread_attr_setprio -void my_pthread_attr_setprio(pthread_attr_t *attr, int priority) -{ -#ifdef HAVE_PTHREAD_SETSCHEDPARAM - struct sched_param tmp_sched_param; - bzero((char*) &tmp_sched_param,sizeof(tmp_sched_param)); - tmp_sched_param.sched_priority=priority; - VOID(pthread_attr_setschedparam(attr,&tmp_sched_param)); -#endif -} -#endif - - /* To allow use of pthread_getspecific with two arguments */ #ifdef HAVE_NONPOSIX_PTHREAD_GETSPECIFIC @@ -85,34 +44,6 @@ void *my_pthread_getspecific_imp(pthread_key_t key) } #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) @@ -136,7 +67,7 @@ int my_sigwait(const sigset_t *set,int *sig) #if !defined(HAVE_LOCALTIME_R) || !defined(HAVE_GMTIME_R) -extern pthread_mutex_t LOCK_localtime_r; +extern mysql_mutex_t LOCK_localtime_r; #endif @@ -144,10 +75,10 @@ extern pthread_mutex_t LOCK_localtime_r; struct tm *localtime_r(const time_t *clock, struct tm *res) { struct tm *tmp; - pthread_mutex_lock(&LOCK_localtime_r); + mysql_mutex_lock(&LOCK_localtime_r); tmp=localtime(clock); *res= *tmp; - pthread_mutex_unlock(&LOCK_localtime_r); + mysql_mutex_unlock(&LOCK_localtime_r); return res; } #endif @@ -161,10 +92,10 @@ struct tm *localtime_r(const time_t *clock, struct tm *res) struct tm *gmtime_r(const time_t *clock, struct tm *res) { struct tm *tmp; - pthread_mutex_lock(&LOCK_localtime_r); + mysql_mutex_lock(&LOCK_localtime_r); tmp= gmtime(clock); *res= *tmp; - pthread_mutex_unlock(&LOCK_localtime_r); + mysql_mutex_unlock(&LOCK_localtime_r); return res; } #endif @@ -206,7 +137,7 @@ void sigwait_setup(sigset_t *set) sact.sa_flags = 0; sact.sa_handler = px_handle_sig; - memcpy_fixed(&sact.sa_mask,set,sizeof(*set)); /* handler isn't thread_safe */ + memcpy(&sact.sa_mask, set, sizeof(*set)); /* handler isn't thread_safe */ sigemptyset(&unblock_mask); pthread_sigmask(SIG_UNBLOCK,(sigset_t*) 0,&rev_sigwait_set); @@ -232,7 +163,7 @@ void sigwait_setup(sigset_t *set) } } } - memcpy_fixed(&sigwait_set,set,sizeof(*set)); + memcpy(&sigwait_set, set, sizeof(*set)); pthread_sigmask(SIG_BLOCK,(sigset_t*) set,(sigset_t*) 0); pthread_sigmask(SIG_UNBLOCK,&unblock_mask,(sigset_t*) 0); } @@ -308,7 +239,7 @@ void sigwait_handle_sig(int sig) { pthread_mutex_lock(&LOCK_sigwait); sigaddset(&pending_set, sig); - VOID(pthread_cond_signal(&COND_sigwait)); /* inform sigwait() about signal */ + pthread_cond_signal(&COND_sigwait); /* inform sigwait() about signal */ pthread_mutex_unlock(&LOCK_sigwait); } @@ -320,7 +251,7 @@ void *sigwait_thread(void *set_arg) 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 */ + memcpy(&sact.sa_mask, set, sizeof(*set)); /* handler isn't thread_safe */ sigemptyset(&pending_set); for (i = 1; i <= sizeof(pending_set)*8; i++) @@ -357,16 +288,15 @@ int sigwait(sigset_t *setp, int *sigp) 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_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); - my_pthread_attr_setprio(&thr_attr,100); /* Very high priority */ - VOID(pthread_create(&sigwait_thread_id,&thr_attr,sigwait_thread,setp)); - VOID(pthread_attr_destroy(&thr_attr)); + pthread_create(&sigwait_thread_id, &thr_attr, sigwait_thread, setp); + pthread_attr_destroy(&thr_attr); } pthread_mutex_lock(&LOCK_sigwait); @@ -392,7 +322,7 @@ int sigwait(sigset_t *setp, int *sigp) return 0; } } - VOID(pthread_cond_wait(&COND_sigwait,&LOCK_sigwait)); + pthread_cond_wait(&COND_sigwait, &LOCK_sigwait); } return 0; } @@ -533,13 +463,7 @@ int my_pthread_mutex_trylock(pthread_mutex_t *mutex) /* Some help functions */ -int pthread_no_free(void *not_used __attribute__((unused))) -{ - return 0; -} - int pthread_dummy(int ret) { return ret; } -#endif /* THREAD */ diff --git a/dep/mysqllite/mysys/my_quick.c b/dep/mysqllite/mysys/my_quick.c new file mode 100644 index 0000000000000..b93e7e17224eb --- /dev/null +++ b/dep/mysqllite/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/dep/mysqllite/mysys/my_rdtsc.c b/dep/mysqllite/mysys/my_rdtsc.c new file mode 100644 index 0000000000000..2afe3ec31ddb7 --- /dev/null +++ b/dep/mysqllite/mysys/my_rdtsc.c @@ -0,0 +1,962 @@ +/* Copyright (C) 2008-2010 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 */ + +/* + rdtsc3 -- multi-platform timer code + pgulutzan@mysql.com, 2005-08-29 + modified 2008-11-02 + + Functions: + + my_timer_cycles ulonglong cycles + my_timer_nanoseconds ulonglong nanoseconds + my_timer_microseconds ulonglong "microseconds" + my_timer_milliseconds ulonglong milliseconds + my_timer_ticks ulonglong ticks + my_timer_init initialization / test + + We'll call the first 5 functions (the ones that return + a ulonglong) "my_timer_xxx" functions. + Each my_timer_xxx function returns a 64-bit timing value + since an arbitrary 'epoch' start. Since the only purpose + is to determine elapsed times, wall-clock time-of-day + is not known and not relevant. + + The my_timer_init function is necessary for initializing. + It returns information (underlying routine name, + frequency, resolution, overhead) about all my_timer_xxx + functions. A program should call my_timer_init once, + use the information to decide what my_timer_xxx function + to use, and subsequently call that function by function + pointer. + + A typical use would be: + my_timer_init() ... once, at program start + ... + time1= my_timer_xxx() ... time before start + [code that's timed] + time2= my_timer_xxx() ... time after end + elapsed_time= (time2 - time1) - overhead +*/ + +#include "my_global.h" +#include "my_rdtsc.h" + +#if defined(_WIN32) +#include +#include "windows.h" +#else +#include +#endif + +#if !defined(_WIN32) +#if TIME_WITH_SYS_TIME +#include +#include /* for clock_gettime */ +#else +#if HAVE_SYS_TIME_H +#include +#elif defined(HAVE_TIME_H) +#include +#endif +#endif +#endif + +#if defined(HAVE_ASM_MSR_H) && defined(HAVE_RDTSCLL) +#include /* for rdtscll */ +#endif + +#if defined(HAVE_SYS_TIMEB_H) && defined(HAVE_FTIME) +#include /* for ftime */ +#endif + +#if defined(HAVE_SYS_TIMES_H) && defined(HAVE_TIMES) +#include /* for times */ +#endif + +#if defined(__INTEL_COMPILER) && defined(__ia64__) && defined(HAVE_IA64INTRIN_H) +#include /* for __GetReg */ +#endif + +#if defined(__APPLE__) && defined(__MACH__) +#include +#endif + +#if defined(__SUNPRO_CC) && defined(__sparcv9) && defined(_LP64) && !defined(__SunOS_5_7) +extern "C" ulonglong my_timer_cycles_il_sparc64(); +#elif defined(__SUNPRO_CC) && defined(_ILP32) && !defined(__SunOS_5_7) +extern "C" ulonglong my_timer_cycles_il_sparc32(); +#elif defined(__SUNPRO_CC) && defined(__i386) && defined(_ILP32) +extern "C" ulonglong my_timer_cycles_il_i386(); +#elif defined(__SUNPRO_CC) && defined(__x86_64) && defined(_LP64) +extern "C" ulonglong my_timer_cycles_il_x86_64(); +#elif defined(__SUNPRO_C) && defined(__sparcv9) && defined(_LP64) && !defined(__SunOS_5_7) +ulonglong my_timer_cycles_il_sparc64(); +#elif defined(__SUNPRO_C) && defined(_ILP32) && !defined(__SunOS_5_7) +ulonglong my_timer_cycles_il_sparc32(); +#elif defined(__SUNPRO_C) && defined(__i386) && defined(_ILP32) +ulonglong my_timer_cycles_il_i386(); +#elif defined(__SUNPRO_C) && defined(__x86_64) && defined(_LP64) +ulonglong my_timer_cycles_il_x86_64(); +#endif + +#if defined(__INTEL_COMPILER) +/* + icc warning #1011 is: + missing return statement at end of non-void function +*/ +#pragma warning (disable:1011) +#endif + +/* + For cycles, we depend on RDTSC for x86 platforms, + or on time buffer (which is not really a cycle count + but a separate counter with less than nanosecond + resolution) for most PowerPC platforms, or on + gethrtime which is okay for hpux and solaris, or on + clock_gettime(CLOCK_SGI_CYCLE) for Irix platforms, + or on read_real_time for aix platforms. There is + nothing for Alpha platforms, they would be tricky. +*/ + +ulonglong my_timer_cycles(void) +{ +#if defined(__GNUC__) && defined(__i386__) + /* This works much better if compiled with "gcc -O3". */ + ulonglong result; + __asm__ __volatile__ ("rdtsc" : "=A" (result)); + return result; +#elif defined(__SUNPRO_C) && defined(__i386) + __asm("rdtsc"); +#elif defined(__GNUC__) && defined(__x86_64__) + ulonglong result; + __asm__ __volatile__ ("rdtsc\n\t" \ + "shlq $32,%%rdx\n\t" \ + "orq %%rdx,%%rax" + : "=a" (result) :: "%edx"); + return result; +#elif defined(HAVE_ASM_MSR_H) && defined(HAVE_RDTSCLL) + { + ulonglong result; + rdtscll(result); + return result; + } +#elif defined(_WIN32) && defined(_M_IX86) + __asm {rdtsc}; +#elif defined(_WIN64) && defined(_M_X64) + /* For 64-bit Windows: unsigned __int64 __rdtsc(); */ + return __rdtsc(); +#elif defined(__INTEL_COMPILER) && defined(__ia64__) && defined(HAVE_IA64INTRIN_H) + return (ulonglong) __getReg(_IA64_REG_AR_ITC); /* (3116) */ +#elif defined(__GNUC__) && defined(__ia64__) + { + ulonglong result; + __asm __volatile__ ("mov %0=ar.itc" : "=r" (result)); + return result; + } +#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__POWERPC__) || (defined(_POWER) && defined(_AIX52))) && (defined(__64BIT__) || defined(_ARCH_PPC64)) + { + ulonglong result; + __asm __volatile__ ("mftb %0" : "=r" (result)); + return result; + } +#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__POWERPC__) || (defined(_POWER) && defined(_AIX52))) && (!defined(__64BIT__) && !defined(_ARCH_PPC64)) + { + /* + mftbu means "move from time-buffer-upper to result". + The loop is saying: x1=upper, x2=lower, x3=upper, + if x1!=x3 there was an overflow so repeat. + */ + unsigned int x1, x2, x3; + ulonglong result; + for (;;) + { + __asm __volatile__ ( "mftbu %0" : "=r"(x1) ); + __asm __volatile__ ( "mftb %0" : "=r"(x2) ); + __asm __volatile__ ( "mftbu %0" : "=r"(x3) ); + if (x1 == x3) break; + } + result = x1; + return ( result << 32 ) | x2; + } +#elif (defined(__SUNPRO_CC) || defined(__SUNPRO_C)) && defined(__sparcv9) && defined(_LP64) && !defined(__SunOS_5_7) + return (my_timer_cycles_il_sparc64()); +#elif (defined(__SUNPRO_CC) || defined(__SUNPRO_C)) && defined(_ILP32) && !defined(__SunOS_5_7) + return (my_timer_cycles_il_sparc32()); +#elif (defined(__SUNPRO_CC) || defined(__SUNPRO_C)) && defined(__i386) && defined(_ILP32) + /* This is probably redundant for __SUNPRO_C. */ + return (my_timer_cycles_il_i386()); +#elif (defined(__SUNPRO_CC) || defined(__SUNPRO_C)) && defined(__x86_64) && defined(_LP64) + return (my_timer_cycles_il_x86_64()); +#elif defined(__GNUC__) && defined(__sparcv9) && defined(_LP64) && (__GNUC__>2) + { + ulonglong result; + __asm __volatile__ ("rd %%tick,%0" : "=r" (result)); + return result; + } +#elif defined(__GNUC__) && defined(__sparc__) && !defined(_LP64) && (__GNUC__>2) + { + union { + ulonglong wholeresult; + struct { + ulong high; + ulong low; + } splitresult; + } result; + __asm __volatile__ ("rd %%tick,%1; srlx %1,32,%0" : "=r" (result.splitresult.high), "=r" (result.splitresult.low)); + return result.wholeresult; + } +#elif defined(__sgi) && defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_SGI_CYCLE) + { + struct timespec tp; + clock_gettime(CLOCK_SGI_CYCLE, &tp); + return (ulonglong) tp.tv_sec * 1000000000 + (ulonglong) tp.tv_nsec; + } +#elif defined(HAVE_SYS_TIMES_H) && defined(HAVE_GETHRTIME) + /* gethrtime may appear as either cycle or nanosecond counter */ + return (ulonglong) gethrtime(); +#else + return 0; +#endif +} + +#if defined(__INTEL_COMPILER) +/* re-enable warning#1011 which was only for my_timer_cycles() */ +/* There may be an icc bug which means we must leave disabled. */ +#pragma warning (default:1011) +#endif + +/* + For nanoseconds, most platforms have nothing available that + (a) doesn't require bringing in a 40-kb librt.so library + (b) really has nanosecond resolution. +*/ + +ulonglong my_timer_nanoseconds(void) +{ +#if defined(HAVE_READ_REAL_TIME) + { + timebasestruct_t tr; + read_real_time(&tr, TIMEBASE_SZ); + return (ulonglong) tr.tb_high * 1000000000 + (ulonglong) tr.tb_low; + } +#elif defined(HAVE_SYS_TIMES_H) && defined(HAVE_GETHRTIME) + /* SunOS 5.10+, Solaris, HP-UX: hrtime_t gethrtime(void) */ + return (ulonglong) gethrtime(); +#elif defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_REALTIME) + { + struct timespec tp; + clock_gettime(CLOCK_REALTIME, &tp); + return (ulonglong) tp.tv_sec * 1000000000 + (ulonglong) tp.tv_nsec; + } +#elif defined(__APPLE__) && defined(__MACH__) + { + ulonglong tm; + static mach_timebase_info_data_t timebase_info= {0,0}; + if (timebase_info.denom == 0) + (void) mach_timebase_info(&timebase_info); + tm= mach_absolute_time(); + return (tm * timebase_info.numer) / timebase_info.denom; + } +#else + return 0; +#endif +} + +/* + For microseconds, gettimeofday() is available on + almost all platforms. On Windows we use + QueryPerformanceCounter which will usually tick over + 3.5 million times per second, and we don't throw + away the extra precision. (On Windows Server 2003 + the frequency is same as the cycle frequency.) +*/ + +ulonglong my_timer_microseconds(void) +{ +#if defined(HAVE_GETTIMEOFDAY) + { + static ulonglong last_value= 0; + struct timeval tv; + if (gettimeofday(&tv, NULL) == 0) + last_value= (ulonglong) tv.tv_sec * 1000000 + (ulonglong) tv.tv_usec; + else + { + /* + There are reports that gettimeofday(2) can have intermittent failures + on some platform, see for example Bug#36819. + We are not trying again or looping, just returning the best value possible + under the circumstances ... + */ + last_value++; + } + return last_value; + } +#elif defined(_WIN32) + { + /* QueryPerformanceCounter usually works with about 1/3 microsecond. */ + LARGE_INTEGER t_cnt; + + QueryPerformanceCounter(&t_cnt); + return (ulonglong) t_cnt.QuadPart; + } +#else + return 0; +#endif +} + +/* + For milliseconds, we use ftime() if it's supported + or time()*1000 if it's not. With modern versions of + Windows and with HP Itanium, resolution is 10-15 + milliseconds. +*/ + +ulonglong my_timer_milliseconds(void) +{ +#if defined(HAVE_SYS_TIMEB_H) && defined(HAVE_FTIME) + /* ftime() is obsolete but maybe the platform is old */ + struct timeb ft; + ftime(&ft); + return (ulonglong)ft.time * 1000 + (ulonglong)ft.millitm; +#elif defined(HAVE_TIME) + return (ulonglong) time(NULL) * 1000; +#elif defined(_WIN32) + FILETIME ft; + GetSystemTimeAsFileTime( &ft ); + return ((ulonglong)ft.dwLowDateTime + + (((ulonglong)ft.dwHighDateTime) << 32))/10000; +#else + return 0; +#endif +} + +/* + For ticks, which we handle with times(), the frequency + is usually 100/second and the overhead is surprisingly + bad, sometimes even worse than gettimeofday's overhead. +*/ + +ulonglong my_timer_ticks(void) +{ +#if defined(HAVE_SYS_TIMES_H) && defined(HAVE_TIMES) + { + struct tms times_buf; + return (ulonglong) times(×_buf); + } +#elif defined(_WIN32) + return (ulonglong) GetTickCount(); +#else + return 0; +#endif +} + +/* + The my_timer_init() function and its sub-functions + have several loops which call timers. If there's + something wrong with a timer -- which has never + happened in tests -- we want the loop to end after + an arbitrary number of iterations, and my_timer_info + will show a discouraging result. The arbitrary + number is 1,000,000. +*/ +#define MY_TIMER_ITERATIONS 1000000 + +/* + Calculate overhead. Called from my_timer_init(). + Usually best_timer_overhead = cycles.overhead or + nanoseconds.overhead, so returned amount is in + cycles or nanoseconds. We repeat the calculation + ten times, so that we can disregard effects of + caching or interrupts. Result is quite consistent + for cycles, at least. But remember it's a minimum. +*/ + +static void my_timer_init_overhead(ulonglong *overhead, + ulonglong (*cycle_timer)(void), + ulonglong (*this_timer)(void), + ulonglong best_timer_overhead) +{ + ulonglong time1, time2; + int i; + + /* *overhead, least of 20 calculations - cycles.overhead */ + for (i= 0, *overhead= 1000000000; i < 20; ++i) + { + time1= cycle_timer(); + this_timer(); /* rather than 'time_tmp= timer();' */ + time2= cycle_timer() - time1; + if (*overhead > time2) + *overhead= time2; + } + *overhead-= best_timer_overhead; +} + +/* + Calculate Resolution. Called from my_timer_init(). + If a timer goes up by jumps, e.g. 1050, 1075, 1100, ... + then the best resolution is the minimum jump, e.g. 25. + If it's always divisible by 1000 then it's just a + result of multiplication of a lower-precision timer + result, e.g. nanoseconds are often microseconds * 1000. + If the minimum jump is less than an arbitrary passed + figure (a guess based on maximum overhead * 2), ignore. + Usually we end up with nanoseconds = 1 because it's too + hard to detect anything <= 100 nanoseconds. + Often GetTickCount() has resolution = 15. + We don't check with ticks because they take too long. +*/ +static ulonglong my_timer_init_resolution(ulonglong (*this_timer)(void), + ulonglong overhead_times_2) +{ + ulonglong time1, time2; + ulonglong best_jump; + int i, jumps, divisible_by_1000, divisible_by_1000000; + + divisible_by_1000= divisible_by_1000000= 0; + best_jump= 1000000; + for (i= jumps= 0; jumps < 3 && i < MY_TIMER_ITERATIONS * 10; ++i) + { + time1= this_timer(); + time2= this_timer(); + time2-= time1; + if (time2) + { + ++jumps; + if (!(time2 % 1000)) + { + ++divisible_by_1000; + if (!(time2 % 1000000)) + ++divisible_by_1000000; + } + if (best_jump > time2) + best_jump= time2; + /* For milliseconds, one jump is enough. */ + if (overhead_times_2 == 0) + break; + } + } + if (jumps == 3) + { + if (jumps == divisible_by_1000000) + return 1000000; + if (jumps == divisible_by_1000) + return 1000; + } + if (best_jump > overhead_times_2) + return best_jump; + return 1; +} + +/* + Calculate cycle frequency by seeing how many cycles pass + in a 200-microsecond period. I tried with 10-microsecond + periods originally, and the result was often very wrong. +*/ + +static ulonglong my_timer_init_frequency(MY_TIMER_INFO *mti) +{ + int i; + ulonglong time1, time2, time3, time4; + time1= my_timer_cycles(); + time2= my_timer_microseconds(); + time3= time2; /* Avoids a Microsoft/IBM compiler warning */ + for (i= 0; i < MY_TIMER_ITERATIONS; ++i) + { + time3= my_timer_microseconds(); + if (time3 - time2 > 200) break; + } + time4= my_timer_cycles() - mti->cycles.overhead; + time4-= mti->microseconds.overhead; + return (mti->microseconds.frequency * (time4 - time1)) / (time3 - time2); +} + +/* + Call my_timer_init before the first call to my_timer_xxx(). + If something must be initialized, it happens here. + Set: what routine is being used e.g. "asm_x86" + Set: function, overhead, actual frequency, resolution. +*/ + +void my_timer_init(MY_TIMER_INFO *mti) +{ + ulonglong (*best_timer)(void); + ulonglong best_timer_overhead; + ulonglong time1, time2; + int i; + + /* cycles */ + mti->cycles.frequency= 1000000000; +#if defined(__GNUC__) && defined(__i386__) + mti->cycles.routine= MY_TIMER_ROUTINE_ASM_X86; +#elif defined(__SUNPRO_C) && defined(__i386) + mti->cycles.routine= MY_TIMER_ROUTINE_ASM_X86; +#elif defined(__GNUC__) && defined(__x86_64__) + mti->cycles.routine= MY_TIMER_ROUTINE_ASM_X86_64; +#elif defined(HAVE_ASM_MSR_H) && defined(HAVE_RDTSCLL) + mti->cycles.routine= MY_TIMER_ROUTINE_RDTSCLL; +#elif defined(_WIN32) && defined(_M_IX86) + mti->cycles.routine= MY_TIMER_ROUTINE_ASM_X86_WIN; +#elif defined(_WIN64) && defined(_M_X64) + mti->cycles.routine= MY_TIMER_ROUTINE_RDTSC; +#elif defined(__INTEL_COMPILER) && defined(__ia64__) && defined(HAVE_IA64INTRIN_H) + mti->cycles.routine= MY_TIMER_ROUTINE_ASM_IA64; +#elif defined(__GNUC__) && defined(__ia64__) + mti->cycles.routine= MY_TIMER_ROUTINE_ASM_IA64; +#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__POWERPC__) || (defined(_POWER) && defined(_AIX52))) && (defined(__64BIT__) || defined(_ARCH_PPC64)) + mti->cycles.routine= MY_TIMER_ROUTINE_ASM_PPC64; +#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__POWERPC__) || (defined(_POWER) && defined(_AIX52))) && (!defined(__64BIT__) && !defined(_ARCH_PPC64)) + mti->cycles.routine= MY_TIMER_ROUTINE_ASM_PPC; +#elif (defined(__SUNPRO_CC) || defined(__SUNPRO_C)) && defined(__sparcv9) && defined(_LP64) && !defined(__SunOS_5_7) + mti->cycles.routine= MY_TIMER_ROUTINE_ASM_SUNPRO_SPARC64; +#elif (defined(__SUNPRO_CC) || defined(__SUNPRO_C)) && defined(_ILP32) && !defined(__SunOS_5_7) + mti->cycles.routine= MY_TIMER_ROUTINE_ASM_SUNPRO_SPARC32; +#elif (defined(__SUNPRO_CC) || defined(__SUNPRO_C)) && defined(__i386) && defined(_ILP32) + mti->cycles.routine= MY_TIMER_ROUTINE_ASM_SUNPRO_I386; +#elif (defined(__SUNPRO_CC) || defined(__SUNPRO_C)) && defined(__x86_64) && defined(_LP64) + mti->cycles.routine= MY_TIMER_ROUTINE_ASM_SUNPRO_X86_64; +#elif defined(__GNUC__) && defined(__sparcv9) && defined(_LP64) && (__GNUC__>2) + mti->cycles.routine= MY_TIMER_ROUTINE_ASM_GCC_SPARC64; +#elif defined(__GNUC__) && defined(__sparc__) && !defined(_LP64) && (__GNUC__>2) + mti->cycles.routine= MY_TIMER_ROUTINE_ASM_GCC_SPARC32; +#elif defined(__sgi) && defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_SGI_CYCLE) + mti->cycles.routine= MY_TIMER_ROUTINE_SGI_CYCLE; +#elif defined(HAVE_SYS_TIMES_H) && defined(HAVE_GETHRTIME) + mti->cycles.routine= MY_TIMER_ROUTINE_GETHRTIME; +#else + mti->cycles.routine= 0; +#endif + + if (!mti->cycles.routine || !my_timer_cycles()) + { + mti->cycles.routine= 0; + mti->cycles.resolution= 0; + mti->cycles.frequency= 0; + mti->cycles.overhead= 0; + } + + /* nanoseconds */ + mti->nanoseconds.frequency= 1000000000; /* initial assumption */ +#if defined(HAVE_READ_REAL_TIME) + mti->nanoseconds.routine= MY_TIMER_ROUTINE_READ_REAL_TIME; +#elif defined(HAVE_SYS_TIMES_H) && defined(HAVE_GETHRTIME) + mti->nanoseconds.routine= MY_TIMER_ROUTINE_GETHRTIME; +#elif defined(HAVE_CLOCK_GETTIME) + mti->nanoseconds.routine= MY_TIMER_ROUTINE_CLOCK_GETTIME; +#elif defined(__APPLE__) && defined(__MACH__) + mti->nanoseconds.routine= MY_TIMER_ROUTINE_MACH_ABSOLUTE_TIME; +#else + mti->nanoseconds.routine= 0; +#endif + if (!mti->nanoseconds.routine || !my_timer_nanoseconds()) + { + mti->nanoseconds.routine= 0; + mti->nanoseconds.resolution= 0; + mti->nanoseconds.frequency= 0; + mti->nanoseconds.overhead= 0; + } + + /* microseconds */ + mti->microseconds.frequency= 1000000; /* initial assumption */ +#if defined(HAVE_GETTIMEOFDAY) + mti->microseconds.routine= MY_TIMER_ROUTINE_GETTIMEOFDAY; +#elif defined(_WIN32) + { + LARGE_INTEGER li; + /* Windows: typical frequency = 3579545, actually 1/3 microsecond. */ + if (!QueryPerformanceFrequency(&li)) + mti->microseconds.routine= 0; + else + { + mti->microseconds.frequency= li.QuadPart; + mti->microseconds.routine= MY_TIMER_ROUTINE_QUERYPERFORMANCECOUNTER; + } + } +#else + mti->microseconds.routine= 0; +#endif + if (!mti->microseconds.routine || !my_timer_microseconds()) + { + mti->microseconds.routine= 0; + mti->microseconds.resolution= 0; + mti->microseconds.frequency= 0; + mti->microseconds.overhead= 0; + } + + /* milliseconds */ + mti->milliseconds.frequency= 1000; /* initial assumption */ +#if defined(HAVE_SYS_TIMEB_H) && defined(HAVE_FTIME) + mti->milliseconds.routine= MY_TIMER_ROUTINE_FTIME; +#elif defined(_WIN32) + mti->milliseconds.routine= MY_TIMER_ROUTINE_GETSYSTEMTIMEASFILETIME; +#elif defined(HAVE_TIME) + mti->milliseconds.routine= MY_TIMER_ROUTINE_TIME; +#else + mti->milliseconds.routine= 0; +#endif + if (!mti->milliseconds.routine || !my_timer_milliseconds()) + { + mti->milliseconds.routine= 0; + mti->milliseconds.resolution= 0; + mti->milliseconds.frequency= 0; + mti->milliseconds.overhead= 0; + } + + /* ticks */ + mti->ticks.frequency= 100; /* permanent assumption */ +#if defined(HAVE_SYS_TIMES_H) && defined(HAVE_TIMES) + mti->ticks.routine= MY_TIMER_ROUTINE_TIMES; +#elif defined(_WIN32) + mti->ticks.routine= MY_TIMER_ROUTINE_GETTICKCOUNT; +#else + mti->ticks.routine= 0; +#endif + if (!mti->ticks.routine || !my_timer_ticks()) + { + mti->ticks.routine= 0; + mti->ticks.resolution= 0; + mti->ticks.frequency= 0; + mti->ticks.overhead= 0; + } + + /* + Calculate overhead in terms of the timer that + gives the best resolution: cycles or nanoseconds. + I doubt it ever will be as bad as microseconds. + */ + if (mti->cycles.routine) + best_timer= &my_timer_cycles; + else + { + if (mti->nanoseconds.routine) + { + best_timer= &my_timer_nanoseconds; + } + else + best_timer= &my_timer_microseconds; + } + + /* best_timer_overhead = least of 20 calculations */ + for (i= 0, best_timer_overhead= 1000000000; i < 20; ++i) + { + time1= best_timer(); + time2= best_timer() - time1; + if (best_timer_overhead > time2) + best_timer_overhead= time2; + } + if (mti->cycles.routine) + my_timer_init_overhead(&mti->cycles.overhead, + best_timer, + &my_timer_cycles, + best_timer_overhead); + if (mti->nanoseconds.routine) + my_timer_init_overhead(&mti->nanoseconds.overhead, + best_timer, + &my_timer_nanoseconds, + best_timer_overhead); + if (mti->microseconds.routine) + my_timer_init_overhead(&mti->microseconds.overhead, + best_timer, + &my_timer_microseconds, + best_timer_overhead); + if (mti->milliseconds.routine) + my_timer_init_overhead(&mti->milliseconds.overhead, + best_timer, + &my_timer_milliseconds, + best_timer_overhead); + if (mti->ticks.routine) + my_timer_init_overhead(&mti->ticks.overhead, + best_timer, + &my_timer_ticks, + best_timer_overhead); + +/* + Calculate resolution for nanoseconds or microseconds + or milliseconds, by seeing if it's always divisible + by 1000, and by noticing how much jumping occurs. + For ticks, just assume the resolution is 1. +*/ + if (mti->cycles.routine) + mti->cycles.resolution= 1; + if (mti->nanoseconds.routine) + mti->nanoseconds.resolution= + my_timer_init_resolution(&my_timer_nanoseconds, 20000); + if (mti->microseconds.routine) + mti->microseconds.resolution= + my_timer_init_resolution(&my_timer_microseconds, 20); + if (mti->milliseconds.routine) + { + if (mti->milliseconds.routine == MY_TIMER_ROUTINE_TIME) + mti->milliseconds.resolution= 1000; + else + mti->milliseconds.resolution= + my_timer_init_resolution(&my_timer_milliseconds, 0); + } + if (mti->ticks.routine) + mti->ticks.resolution= 1; + +/* + Calculate cycles frequency, + if we have both a cycles routine and a microseconds routine. + In tests, this usually results in a figure within 2% of + what "cat /proc/cpuinfo" says. + If the microseconds routine is QueryPerformanceCounter + (i.e. it's Windows), and the microseconds frequency is > + 500,000,000 (i.e. it's Windows Server so it uses RDTSC) + and the microseconds resolution is > 100 (i.e. dreadful), + then calculate cycles frequency = microseconds frequency. +*/ + if (mti->cycles.routine + && mti->microseconds.routine) + { + if (mti->microseconds.routine == + MY_TIMER_ROUTINE_QUERYPERFORMANCECOUNTER + && mti->microseconds.frequency > 500000000 + && mti->microseconds.resolution > 100) + mti->cycles.frequency= mti->microseconds.frequency; + else + { + ulonglong time1, time2; + time1= my_timer_init_frequency(mti); + /* Repeat once in case there was an interruption. */ + time2= my_timer_init_frequency(mti); + if (time1 < time2) mti->cycles.frequency= time1; + else mti->cycles.frequency= time2; + } + } + +/* + Calculate milliseconds frequency = + (cycles-frequency/#-of-cycles) * #-of-milliseconds, + if we have both a milliseconds routine and a cycles + routine. + This will be inaccurate if milliseconds resolution > 1. + This is probably only useful when testing new platforms. +*/ + if (mti->milliseconds.routine + && mti->milliseconds.resolution < 1000 + && mti->microseconds.routine + && mti->cycles.routine) + { + int i; + ulonglong time1, time2, time3, time4; + time1= my_timer_cycles(); + time2= my_timer_milliseconds(); + time3= time2; /* Avoids a Microsoft/IBM compiler warning */ + for (i= 0; i < MY_TIMER_ITERATIONS * 1000; ++i) + { + time3= my_timer_milliseconds(); + if (time3 - time2 > 10) break; + } + time4= my_timer_cycles(); + mti->milliseconds.frequency= + (mti->cycles.frequency * (time3 - time2)) / (time4 - time1); + } + +/* + Calculate ticks.frequency = + (cycles-frequency/#-of-cycles * #-of-ticks, + if we have both a ticks routine and a cycles + routine, + This is probably only useful when testing new platforms. +*/ + if (mti->ticks.routine + && mti->microseconds.routine + && mti->cycles.routine) + { + int i; + ulonglong time1, time2, time3, time4; + time1= my_timer_cycles(); + time2= my_timer_ticks(); + time3= time2; /* Avoids a Microsoft/IBM compiler warning */ + for (i= 0; i < MY_TIMER_ITERATIONS * 1000; ++i) + { + time3= my_timer_ticks(); + if (time3 - time2 > 10) break; + } + time4= my_timer_cycles(); + mti->ticks.frequency= + (mti->cycles.frequency * (time3 - time2)) / (time4 - time1); + } +} + +/* + Additional Comments + ------------------- + + This is for timing, i.e. finding out how long a piece of code + takes. If you want time of day matching a wall clock, the + my_timer_xxx functions won't help you. + + The best timer is the one with highest frequency, lowest + overhead, and resolution=1. The my_timer_info() routine will tell + you at runtime which timer that is. Usually it will be + my_timer_cycles() but be aware that, although it's best, + it has possible flaws and dangers. Depending on platform: + - The frequency might change. We don't test for this. It + happens on laptops for power saving, and on blade servers + for avoiding overheating. + - The overhead that my_timer_init() returns is the minimum. + In fact it could be slightly greater because of caching or + because you call the routine by address, as recommended. + It could be hugely greater if there's an interrupt. + - The x86 cycle counter, RDTSC doesn't "serialize". That is, + if there is out-of-order execution, rdtsc might be processed + after an instruction that logically follows it. + (We could force serialization, but that would be slower.) + - It is possible to set a flag which renders RDTSC + inoperative. Somebody responsible for the kernel + of the operating system would have to make this + decision. For the platforms we've tested with, there's + no such problem. + - With a multi-processor arrangement, it's possible + to get the cycle count from one processor in + thread X, and the cycle count from another processor + in thread Y. They may not always be in synch. + - You can't depend on a cycle counter being available for + all platforms. On Alphas, the + cycle counter is only 32-bit, so it would overflow quickly, + so we don't bother with it. On platforms that we haven't + tested, there might be some if/endif combination that we + didn't expect, or some assembler routine that we didn't + supply. + + The recommended way to use the timer routines is: + 1. Somewhere near the beginning of the program, call + my_timer_init(). This should only be necessary once, + although you can call it again if you think that the + frequency has changed. + 2. Determine the best timer based on frequency, resolution, + overhead -- all things that my_timer_init() returns. + Preserve the address of the timer and the my_timer_into + results in an easily-accessible place. + 3. Instrument the code section that you're monitoring, thus: + time1= my_timer_xxx(); + Instrumented code; + time2= my_timer_xxx(); + elapsed_time= (time2 - time1) - overhead; + If the timer is always on, then overhead is always there, + so don't subtract it. + 4. Save the elapsed time, or add it to a totaller. + 5. When all timing processes are complete, transfer the + saved / totalled elapsed time to permanent storage. + Optionally you can convert cycles to microseconds at + this point. (Don't do so every time you calculate + elapsed_time! That would waste time and lose precision!) + For converting cycles to microseconds, use the frequency + that my_timer_init() returns. You'll also need to convert + if the my_timer_microseconds() function is the Windows + function QueryPerformanceCounter(), since that's sometimes + a counter with precision slightly better than microseconds. + + Since we recommend calls by function pointer, we supply + no inline functions. + + Some comments on the many candidate routines for timing ... + + clock() -- We don't use because it would overflow frequently. + + clock_gettime() -- In tests, clock_gettime often had + resolution = 1000. + + ftime() -- A "man ftime" says: "This function is obsolete. + Don't use it." On every platform that we tested, if ftime() + was available, then so was gettimeofday(), and gettimeofday() + overhead was always at least as good as ftime() overhead. + + gettimeofday() -- available on most platforms, though not + on Windows. There is a hardware timer (sometimes a Programmable + Interrupt Timer or "PIT") (sometimes a "HPET") used for + interrupt generation. When it interrupts (a "tick" or "jiffy", + typically 1 centisecond) it sets xtime. For gettimeofday, a + Linux kernel routine usually gets xtime and then gets rdtsc + to get elapsed nanoseconds since the last tick. On Red Hat + Enterprise Linux 3, there was once a bug which caused the + resolution to be 1000, i.e. one centisecond. We never check + for time-zone change. + + getnstimeofday() -- something to watch for in future Linux + + do_gettimeofday() -- exists on Linux but not for "userland" + + get_cycles() -- a multi-platform function, worth watching + in future Linux versions. But we found platform-specific + functions which were better documented in operating-system + manuals. And get_cycles() can fail or return a useless + 32-bit number. It might be available on some platforms, + such as arm, which we didn't test. Using + "include " or "include " + can lead to autoconf or compile errors, depending on system. + + rdtsc, __rdtsc, rdtscll: available for x86 with Linux BSD, + Solaris, Windows. See "possible flaws and dangers" comments. + + times(): what we use for ticks. Should just read the last + (xtime) tick count, therefore should be fast, but usually + isn't. + + GetTickCount(): we use this for my_timer_ticks() on + Windows. Actually it really is a tick counter, so resolution + >= 10 milliseconds unless you have a very old Windows version. + With Windows 95 or 98 or ME, timeGetTime() has better resolution than + GetTickCount (1ms rather than 55ms). But with Windows NT or XP or 2000, + they're both getting from a variable in the Process Environment Block + (PEB), and the variable is set by the programmable interrupt timer, so + the resolution is the same (usually 10-15 milliseconds). Also timeGetTime + is slower on old machines: + http://www.doumo.jp/aon-java/jsp/postgretips/tips.jsp?tips=74. + Also timeGetTime requires linking winmm.lib, + Therefore we use GetTickCount. + It will overflow every 49 days because the return is 32-bit. + There is also a GetTickCount64 but it requires Vista or Windows Server 2008. + (As for GetSystemTimeAsFileTime, its precision is spurious, it + just reads the tick variable like the other functions do. + However, we don't expect it to overflow every 49 days, so we + will prefer it for my_timer_milliseconds().) + + QueryPerformanceCounter() we use this for my_timer_microseconds() + on Windows. 1-PIT-tick (often 1/3-microsecond). Usually reads + the PIT so it's slow. On some Windows variants, uses RDTSC. + + GetLocalTime() this is available on Windows but we don't use it. + + getclock(): documented for Alpha, but not found during tests. + + mach_absolute_time() and UpTime() are recommended for Apple. + Inititally they weren't tried, because asm_ppc seems to do the job. + But now we use mach_absolute_time for nanoseconds. + + Any clock-based timer can be affected by NPT (ntpd program), + which means: + - full-second correction can occur for leap second + - tiny corrections can occcur approimately every 11 minutes + (but I think they only affect the RTC which isn't the PIT). + + We define "precision" as "frequency" and "high precision" is + "frequency better than 1 microsecond". We define "resolution" + as a synonym for "granularity". We define "accuracy" as + "closeness to the truth" as established by some authoritative + clock, but we can't measure accuracy. + + Do not expect any of our timers to be monotonic; we + won't guarantee that they return constantly-increasing + unique numbers. + + We tested with AIX, Solaris (x86 + Sparc), Linux (x86 + + Itanium), Windows, 64-bit Windows, QNX, FreeBSD, HPUX, + Irix, Mac. We didn't test with SCO. + +*/ + diff --git a/dep/mysqllite/mysys/my_read.c b/dep/mysqllite/mysys/my_read.c index 0c302d5b227b2..dbe9006a1d321 100644 --- a/dep/mysqllite/mysys/my_read.c +++ b/dep/mysqllite/mysys/my_read.c @@ -15,9 +15,9 @@ #include "mysys_priv.h" #include "mysys_err.h" +#include #include - /* Read a chunk of bytes from a file with retry's if needed @@ -37,27 +37,36 @@ 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: 0x%lx Count: %lu MyFlags: %d", - Filedes, (long) Buffer, (ulong) Count, MyFlags)); + DBUG_PRINT("my",("fd: %d Buffer: %p Count: %lu MyFlags: %d", + Filedes, Buffer, (ulong) Count, MyFlags)); save_count= Count; for (;;) { - errno= 0; /* Linux doesn't reset this */ - if ((readbytes= read(Filedes, Buffer, (uint) Count)) != Count) + 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 ? errno : -1; + 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) diff --git a/dep/mysqllite/mysys/my_realloc.c b/dep/mysqllite/mysys/my_realloc.c deleted file mode 100644 index a55282e03a096..0000000000000 --- a/dep/mysqllite/mysys/my_realloc.c +++ /dev/null @@ -1,75 +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 */ - -#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: 0x%lx size: %lu my_flags: %d", (long) 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: 0x%lx", (long) point)); - DBUG_RETURN(point); -} /* my_realloc */ diff --git a/dep/mysqllite/mysys/my_redel.c b/dep/mysqllite/mysys/my_redel.c new file mode 100644 index 0000000000000..92aa6e4207329 --- /dev/null +++ b/dep/mysqllite/mysys/my_redel.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 */ + +#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(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; + + /* Copy modes */ + if (chmod(to, statbuf.st_mode & 07777)) + { + my_errno= errno; + if (MyFlags & (MY_FAE+MY_WME)) + my_error(EE_CHANGE_PERMISSIONS, MYF(ME_BELL+ME_WAITTANG), from, errno); + return -1; + } + +#if !defined(__WIN__) + 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); + } + /* Copy ownership */ + if (chown(to, statbuf.st_uid, statbuf.st_gid)) + { + my_errno= errno; + if (MyFlags & (MY_FAE+MY_WME)) + my_error(EE_CHANGE_OWNERSHIP, MYF(ME_BELL+ME_WAITTANG), from, errno); + return -1; + } +#endif /* !__WIN__ */ + + 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 */ + } + + return 0; +} /* my_copystat */ diff --git a/dep/mysqllite/mysys/my_rename.c b/dep/mysqllite/mysys/my_rename.c index 39e6056a9e4a1..1a4e7b2b409ac 100644 --- a/dep/mysqllite/mysys/my_rename.c +++ b/dep/mysqllite/mysys/my_rename.c @@ -44,7 +44,7 @@ int my_rename(const char *from, const char *to, myf MyFlags) } #endif #if defined(HAVE_RENAME) -#if defined(__WIN__) || defined(__NETWARE__) +#if defined(__WIN__) /* On windows we can't rename over an existing file: Remove any conflicting files: diff --git a/dep/mysqllite/mysys/my_seek.c b/dep/mysqllite/mysys/my_seek.c index 2c661baeff7d3..ca12a2e95d100 100644 --- a/dep/mysqllite/mysys/my_seek.c +++ b/dep/mysqllite/mysys/my_seek.c @@ -14,6 +14,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "mysys_priv.h" +#include "mysys_err.h" /* Seek to a position in a file. @@ -42,39 +43,34 @@ actual error. */ -my_off_t my_seek(File fd, my_off_t pos, int whence, - myf MyFlags __attribute__((unused))) +my_off_t my_seek(File fd, my_off_t pos, int whence, myf MyFlags) { - reg1 os_off_t newpos= -1; + os_off_t newpos= -1; DBUG_ENTER("my_seek"); - DBUG_PRINT("my",("Fd: %d Hpos: %lu Pos: %lu Whence: %d MyFlags: %d", - fd, (ulong) (((ulonglong) pos) >> 32), (ulong) pos, - whence, MyFlags)); + 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(THREAD) && !defined(HAVE_PREAD) - if (MyFlags & MY_THREADSAFE) - { - pthread_mutex_lock(&my_file_info[fd].mutex); - newpos= lseek(fd, pos, whence); - pthread_mutex_unlock(&my_file_info[fd].mutex); - } - else +#if defined (_WIN32) + newpos= my_win_lseek(fd, pos, whence); +#else + newpos= lseek(fd, pos, whence); #endif - newpos= lseek(fd, pos, whence); if (newpos == (os_off_t) -1) { - my_errno=errno; - DBUG_PRINT("error",("lseek: %lu errno: %d", (ulong) newpos,errno)); + my_errno= errno; + if (MyFlags & MY_WME) + my_error(EE_CANT_SEEK, MYF(0), my_filename(fd), my_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: %lu", (ulong) newpos)); + DBUG_PRINT("exit",("pos: %llu", (ulonglong) newpos)); } DBUG_RETURN((my_off_t) newpos); } /* my_seek */ @@ -83,19 +79,24 @@ my_off_t my_seek(File fd, my_off_t pos, int whence, /* Tell current position of file */ /* ARGSUSED */ -my_off_t my_tell(File fd, myf MyFlags __attribute__((unused))) +my_off_t my_tell(File fd, myf MyFlags) { os_off_t pos; DBUG_ENTER("my_tell"); - DBUG_PRINT("my",("Fd: %d MyFlags: %d",fd, MyFlags)); + DBUG_PRINT("my",("fd: %d MyFlags: %d",fd, MyFlags)); DBUG_ASSERT(fd >= 0); -#ifdef HAVE_TELL - pos=tell(fd); +#if defined (HAVE_TELL) && !defined (_WIN32) + pos= tell(fd); #else - pos=lseek(fd, 0L, MY_SEEK_CUR); + pos= my_seek(fd, 0L, MY_SEEK_CUR,0); #endif if (pos == (os_off_t) -1) - my_errno=errno; - DBUG_PRINT("exit",("pos: %lu", (ulong) pos)); + { + my_errno= errno; + if (MyFlags & MY_WME) + my_error(EE_CANT_SEEK, MYF(0), my_filename(fd), my_errno); + DBUG_PRINT("error", ("tell: %llu errno: %d", (ulonglong) pos, my_errno)); + } + DBUG_PRINT("exit",("pos: %llu", (ulonglong) pos)); DBUG_RETURN((my_off_t) pos); } /* my_tell */ diff --git a/dep/mysqllite/mysys/my_sleep.c b/dep/mysqllite/mysys/my_sleep.c index 87170e4af41ba..6d1bdd5dc5558 100644 --- a/dep/mysqllite/mysys/my_sleep.c +++ b/dep/mysqllite/mysys/my_sleep.c @@ -20,9 +20,7 @@ void my_sleep(ulong m_seconds) { -#ifdef __NETWARE__ - delay(m_seconds/1000+1); -#elif defined(__WIN__) +#if defined(__WIN__) Sleep(m_seconds/1000+1); /* Sleep() has millisecond arg */ #elif defined(HAVE_SELECT) struct timeval t; diff --git a/dep/mysqllite/mysys/my_static.c b/dep/mysqllite/mysys/my_static.c index a21a3d11104db..ec8d66ab0cfd6 100644 --- a/dep/mysqllite/mysys/my_static.c +++ b/dep/mysqllite/mysys/my_static.c @@ -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 @@ -27,25 +27,20 @@ my_bool timed_mutexes= 0; /* from my_init */ char * home_dir=0; const char *my_progname=0; -char NEAR curr_dir[FN_REFLEN]= {0}, - NEAR home_dir_buff[FN_REFLEN]= {0}; +char curr_dir[FN_REFLEN]= {0}, + 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]= {{0,UNOPEN}}; +int my_umask=0664, my_umask_dir=0777; + +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; +int 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; @@ -65,32 +60,32 @@ my_bool my_use_large_pages= 0; uint my_large_page_size= 0; #endif - /* 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 */ +const char *globerrs[GLOBERRS]; /* my_error_messages is here */ #endif void (*my_abort_hook)(int) = (void(*)(int)) exit; -int (*error_handler_hook)(uint error,const char *str,myf MyFlags)= - my_message_no_curses; -int (*fatal_error_handler_hook)(uint error,const char *str,myf MyFlags)= - my_message_no_curses; +void (*error_handler_hook)(uint error, const char *str, myf MyFlags)= + my_message_stderr; +void (*fatal_error_handler_hook)(uint error, const char *str, myf MyFlags)= + my_message_stderr; + +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) /** @@ -106,8 +101,35 @@ 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; +my_bool my_disable_locking=0; +my_bool my_disable_async_io=0; +my_bool my_disable_flush_key_blocks=0; +my_bool my_disable_symlinks=0; + +/* + Note that PSI_hook and PSI_server are unconditionally + (no ifdef HAVE_PSI_INTERFACE) defined. + This is to ensure binary compatibility between the server and plugins, + in the case when: + - the server is not compiled with HAVE_PSI_INTERFACE + - a plugin is compiled with HAVE_PSI_INTERFACE + See the doxygen documentation for the performance schema. +*/ + +/** + Hook for the instrumentation interface. + Code implementing the instrumentation interface should register here. +*/ +struct PSI_bootstrap *PSI_hook= NULL; + +/** + Instance of the instrumentation interface for the MySQL server. + @todo This is currently a global variable, which is handy when + compiling instrumented code that is bundled with the server. + When dynamic plugin are truly supported, this variable will need + to be replaced by a macro, so that each XYZ plugin can have it's own + xyz_psi_server variable, obtained from PSI_bootstrap::get_interface() + with the version used at compile time for plugin XYZ. +*/ +PSI *PSI_server= NULL; + diff --git a/dep/mysqllite/mysys/my_static.h b/dep/mysqllite/mysys/my_static.h index 90168b099a879..7fde15ff13313 100644 --- a/dep/mysqllite/mysys/my_static.h +++ b/dep/mysqllite/mysys/my_static.h @@ -1,3 +1,6 @@ +#ifndef MYSYS_MY_STATIC_INCLUDED +#define MYSYS_MY_STATIC_INCLUDED + /* Copyright (C) 2000 MySQL AB This program is free software; you can redistribute it and/or modify @@ -22,35 +25,13 @@ 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 char curr_dir[FN_REFLEN], home_dir_buff[FN_REFLEN]; extern volatile int _my_signals; extern struct st_remember _my_sig_remember[MAX_SIGNALS]; @@ -60,15 +41,10 @@ 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 + +#endif /* MYSYS_MY_STATIC_INCLUDED */ diff --git a/dep/mysqllite/mysys/my_symlink.c b/dep/mysqllite/mysys/my_symlink.c index 258e227bb7b61..053fc887fe86b 100644 --- a/dep/mysqllite/mysys/my_symlink.c +++ b/dep/mysqllite/mysys/my_symlink.c @@ -113,14 +113,12 @@ int my_is_symlink(const char *filename __attribute__((unused))) #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))) +int my_realpath(char *to, const char *filename, myf MyFlags) { #if defined(HAVE_REALPATH) && !defined(HAVE_BROKEN_REALPATH) int result=0; @@ -146,8 +144,24 @@ int my_realpath(char *to, const char *filename, result= -1; } DBUG_RETURN(result); +#else +#ifdef _WIN32 + int ret= GetFullPathName(filename,FN_REFLEN, + to, + NULL); + if (ret == 0 || ret > FN_REFLEN) + { + if (ret > FN_REFLEN) + my_errno= ENAMETOOLONG; + else + my_errno= EACCES; + if (MyFlags & MY_WME) + my_error(EE_REALPATH, MYF(0), filename, my_errno); + return -1; + } #else my_load_path(to, filename, NullS); +#endif return 0; #endif } diff --git a/dep/mysqllite/mysys/my_sync.c b/dep/mysqllite/mysys/my_sync.c index 97540f5eb48ad..e33a9342afa87 100644 --- a/dep/mysqllite/mysys/my_sync.c +++ b/dep/mysqllite/mysys/my_sync.c @@ -58,12 +58,12 @@ int my_sync(File fd, myf my_flags) /* 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) +#if defined(HAVE_FDATASYNC) && HAVE_DECL_FDATASYNC res= fdatasync(fd); #elif defined(HAVE_FSYNC) res= fsync(fd); -#elif defined(__WIN__) - res= _commit(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) */ @@ -89,6 +89,8 @@ int my_sync(File fd, myf my_flags) static const char cur_dir_name[]= {FN_CURLIB, 0}; + + /* Force directory information to disk. @@ -100,9 +102,11 @@ static const char cur_dir_name[]= {FN_CURLIB, 0}; RETURN 0 if ok, !=0 if error */ + +#ifdef NEED_EXPLICIT_SYNC_DIR + int my_sync_dir(const char *dir_name, myf my_flags) { -#ifdef NEED_EXPLICIT_SYNC_DIR File dir_fd; int res= 0; const char *correct_dir_name; @@ -124,11 +128,18 @@ int my_sync_dir(const char *dir_name, myf my_flags) else res= 1; DBUG_RETURN(res); -#else +} + +#else /* NEED_EXPLICIT_SYNC_DIR */ + +int my_sync_dir(const char *dir_name __attribute__((unused)), + myf my_flags __attribute__((unused))) +{ return 0; -#endif } +#endif /* NEED_EXPLICIT_SYNC_DIR */ + /* Force directory information to disk. @@ -141,15 +152,24 @@ int my_sync_dir(const char *dir_name, myf my_flags) RETURN 0 if ok, !=0 if error */ + +#ifdef NEED_EXPLICIT_SYNC_DIR + 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 +} + +#else /* NEED_EXPLICIT_SYNC_DIR */ + +int my_sync_dir_by_file(const char *file_name __attribute__((unused)), + myf my_flags __attribute__((unused))) +{ return 0; -#endif } +#endif /* NEED_EXPLICIT_SYNC_DIR */ + diff --git a/dep/mysqllite/mysys/my_thr_init.c b/dep/mysqllite/mysys/my_thr_init.c index 0e62cde386ed0..c4b56cde8502d 100644 --- a/dep/mysqllite/mysys/my_thr_init.c +++ b/dep/mysqllite/mysys/my_thr_init.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (C) 2000 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 @@ -22,25 +22,20 @@ #include #include -#ifdef THREAD -#ifdef USE_TLS pthread_key(struct st_my_thread_var*, THR_KEY_mysys); -#else -pthread_key(struct st_my_thread_var, THR_KEY_mysys); -#endif /* USE_TLS */ -pthread_mutex_t THR_LOCK_malloc,THR_LOCK_open, - THR_LOCK_lock,THR_LOCK_isam,THR_LOCK_myisam,THR_LOCK_heap, - THR_LOCK_net, THR_LOCK_charset, THR_LOCK_threads, THR_LOCK_time, - THR_LOCK_myisam_mmap; - -pthread_cond_t THR_COND_threads; +mysql_mutex_t THR_LOCK_malloc, THR_LOCK_open, + THR_LOCK_lock, THR_LOCK_isam, THR_LOCK_myisam, THR_LOCK_heap, + THR_LOCK_net, THR_LOCK_charset, THR_LOCK_threads, THR_LOCK_time, + THR_LOCK_myisam_mmap; + +mysql_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; +mysql_mutex_t LOCK_localtime_r; #endif #ifndef HAVE_GETHOSTBYNAME_R -pthread_mutex_t LOCK_gethostbyname_r; +mysql_mutex_t LOCK_gethostbyname_r; #endif #ifdef PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP pthread_mutexattr_t my_fast_mutexattr; @@ -48,7 +43,9 @@ pthread_mutexattr_t my_fast_mutexattr; #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 /* @@ -69,6 +66,108 @@ nptl_pthread_exit_hack_handler(void *arg __attribute((unused))) static uint get_thread_lib(void); +/** True if @c my_thread_basic_global_init() has been called. */ +static my_bool my_thread_basic_global_init_done= 0; + +/** + Perform a minimal initialisation of mysys, when compiled with threads. + The initialisation performed is sufficient to: + - allocate memory + - perform file operations + - use charsets + - use my_errno + @sa my_basic_init + @sa my_thread_basic_global_reinit +*/ +my_bool my_thread_basic_global_init(void) +{ + int pth_ret; + + if (my_thread_basic_global_init_done) + return 0; + my_thread_basic_global_init_done= 1; + +#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); + 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 + + mysql_mutex_init(key_THR_LOCK_malloc, &THR_LOCK_malloc, MY_MUTEX_INIT_FAST); + mysql_mutex_init(key_THR_LOCK_open, &THR_LOCK_open, MY_MUTEX_INIT_FAST); + mysql_mutex_init(key_THR_LOCK_charset, &THR_LOCK_charset, MY_MUTEX_INIT_FAST); + mysql_mutex_init(key_THR_LOCK_threads, &THR_LOCK_threads, MY_MUTEX_INIT_FAST); + + if ((pth_ret= pthread_key_create(&THR_KEY_mysys, NULL)) != 0) + { + fprintf(stderr, "Can't initialize threads: error %d\n", pth_ret); + return 1; + } + + if (my_thread_init()) + return 1; + + return 0; +} + +/** + Re-initialize components initialized early with @c my_thread_basic_global_init. + Some mutexes were initialized before the instrumentation. + Destroy + create them again, now that the instrumentation + is in place. + This is safe, since this function() is called before creating new threads, + so the mutexes are not in use. +*/ +void my_thread_basic_global_reinit(void) +{ + struct st_my_thread_var *tmp; + + DBUG_ASSERT(my_thread_basic_global_init_done); + +#ifdef HAVE_PSI_INTERFACE + my_init_mysys_psi_keys(); +#endif + + mysql_mutex_destroy(&THR_LOCK_malloc); + mysql_mutex_init(key_THR_LOCK_malloc, &THR_LOCK_malloc, MY_MUTEX_INIT_FAST); + + mysql_mutex_destroy(&THR_LOCK_open); + mysql_mutex_init(key_THR_LOCK_open, &THR_LOCK_open, MY_MUTEX_INIT_FAST); + + mysql_mutex_destroy(&THR_LOCK_charset); + mysql_mutex_init(key_THR_LOCK_charset, &THR_LOCK_charset, MY_MUTEX_INIT_FAST); + + mysql_mutex_destroy(&THR_LOCK_threads); + mysql_mutex_init(key_THR_LOCK_threads, &THR_LOCK_threads, MY_MUTEX_INIT_FAST); + + tmp= my_pthread_getspecific(struct st_my_thread_var*, THR_KEY_mysys); + DBUG_ASSERT(tmp); + + mysql_mutex_destroy(&tmp->mutex); + mysql_mutex_init(key_my_thread_var_mutex, &tmp->mutex, MY_MUTEX_INIT_FAST); + + mysql_cond_destroy(&tmp->suspend); + mysql_cond_init(key_my_thread_var_suspend, &tmp->suspend, NULL); +} + /* initialize thread environment @@ -82,14 +181,10 @@ static uint get_thread_lib(void); 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); + if (my_thread_basic_global_init()) return 1; - } + + thd_lib_detected= get_thread_lib(); #ifdef TARGET_OS_LINUX /* @@ -118,50 +213,27 @@ my_bool my_thread_global_init(void) } #endif /* TARGET_OS_LINUX */ -#ifdef PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP - /* - Set mutex type to "fast" a.k.a "adaptive" + mysql_mutex_init(key_THR_LOCK_lock, &THR_LOCK_lock, MY_MUTEX_INIT_FAST); + mysql_mutex_init(key_THR_LOCK_isam, &THR_LOCK_isam, MY_MUTEX_INIT_SLOW); + mysql_mutex_init(key_THR_LOCK_myisam, &THR_LOCK_myisam, MY_MUTEX_INIT_SLOW); + mysql_mutex_init(key_THR_LOCK_myisam_mmap, &THR_LOCK_myisam_mmap, MY_MUTEX_INIT_FAST); + mysql_mutex_init(key_THR_LOCK_heap, &THR_LOCK_heap, MY_MUTEX_INIT_FAST); + mysql_mutex_init(key_THR_LOCK_net, &THR_LOCK_net, MY_MUTEX_INIT_FAST); + mysql_mutex_init(key_THR_LOCK_time, &THR_LOCK_time, MY_MUTEX_INIT_FAST); + mysql_cond_init(key_THR_COND_threads, &THR_COND_threads, NULL); - 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); - 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 - - pthread_mutex_init(&THR_LOCK_malloc,MY_MUTEX_INIT_FAST); - 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_mmap,MY_MUTEX_INIT_FAST); - 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_threads,MY_MUTEX_INIT_FAST); - pthread_mutex_init(&THR_LOCK_time,MY_MUTEX_INIT_FAST); - pthread_cond_init(&THR_COND_threads, NULL); -#if defined( __WIN__) || defined(OS2) - win_pthread_init(); -#endif #if !defined(HAVE_LOCALTIME_R) || !defined(HAVE_GMTIME_R) - pthread_mutex_init(&LOCK_localtime_r,MY_MUTEX_INIT_SLOW); + mysql_mutex_init(key_LOCK_localtime_r, &LOCK_localtime_r, MY_MUTEX_INIT_SLOW); #endif #ifndef HAVE_GETHOSTBYNAME_R - pthread_mutex_init(&LOCK_gethostbyname_r,MY_MUTEX_INIT_SLOW); + mysql_mutex_init(key_LOCK_gethostbyname_r, + &LOCK_gethostbyname_r, MY_MUTEX_INIT_SLOW); +#endif + +#ifdef _MSC_VER + install_sigabrt_handler(); #endif + if (my_thread_init()) { my_thread_global_end(); /* Clean up */ @@ -177,11 +249,11 @@ void my_thread_global_end(void) my_bool all_threads_killed= 1; set_timespec(abstime, my_thread_end_wait_time); - pthread_mutex_lock(&THR_LOCK_threads); + mysql_mutex_lock(&THR_LOCK_threads); while (THR_thread_count > 0) { - int error= pthread_cond_timedwait(&THR_COND_threads, &THR_LOCK_threads, - &abstime); + int error= mysql_cond_timedwait(&THR_COND_threads, &THR_LOCK_threads, + &abstime); if (error == ETIMEDOUT || error == ETIME) { #ifdef HAVE_PTHREAD_KILL @@ -199,7 +271,7 @@ void my_thread_global_end(void) break; } } - pthread_mutex_unlock(&THR_LOCK_threads); + mysql_mutex_unlock(&THR_LOCK_threads); pthread_key_delete(THR_KEY_mysys); #ifdef PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP @@ -208,27 +280,29 @@ void my_thread_global_end(void) #ifdef PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP pthread_mutexattr_destroy(&my_errorcheck_mutexattr); #endif - pthread_mutex_destroy(&THR_LOCK_malloc); - 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_mmap); - pthread_mutex_destroy(&THR_LOCK_heap); - pthread_mutex_destroy(&THR_LOCK_net); - pthread_mutex_destroy(&THR_LOCK_time); - pthread_mutex_destroy(&THR_LOCK_charset); + mysql_mutex_destroy(&THR_LOCK_malloc); + mysql_mutex_destroy(&THR_LOCK_open); + mysql_mutex_destroy(&THR_LOCK_lock); + mysql_mutex_destroy(&THR_LOCK_isam); + mysql_mutex_destroy(&THR_LOCK_myisam); + mysql_mutex_destroy(&THR_LOCK_myisam_mmap); + mysql_mutex_destroy(&THR_LOCK_heap); + mysql_mutex_destroy(&THR_LOCK_net); + mysql_mutex_destroy(&THR_LOCK_time); + mysql_mutex_destroy(&THR_LOCK_charset); if (all_threads_killed) { - pthread_mutex_destroy(&THR_LOCK_threads); - pthread_cond_destroy(&THR_COND_threads); + mysql_mutex_destroy(&THR_LOCK_threads); + mysql_cond_destroy(&THR_COND_threads); } #if !defined(HAVE_LOCALTIME_R) || !defined(HAVE_GMTIME_R) - pthread_mutex_destroy(&LOCK_localtime_r); + mysql_mutex_destroy(&LOCK_localtime_r); #endif #ifndef HAVE_GETHOSTBYNAME_R - pthread_mutex_destroy(&LOCK_gethostbyname_r); + mysql_mutex_destroy(&LOCK_gethostbyname_r); #endif + + my_thread_basic_global_init_done= 0; } static my_thread_id thread_id= 0; @@ -263,7 +337,6 @@ my_bool my_thread_init(void) (ulong) pthread_self()); #endif -#if !defined(__WIN__) || defined(USE_TLS) if (my_pthread_getspecific(struct st_my_thread_var *,THR_KEY_mysys)) { #ifdef EXTRA_DEBUG_THREADS @@ -272,34 +345,29 @@ my_bool my_thread_init(void) #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); - -#else /* defined(__WIN__) && !(defined(USE_TLS) */ - /* - Skip initialization if the thread specific variable is already initialized - */ - if (THR_KEY_mysys.id) - goto end; - tmp= &THR_KEY_mysys; -#endif -#if defined(__WIN__) && defined(EMBEDDED_LIBRARY) - tmp->pthread_self= (pthread_t) getpid(); -#else tmp->pthread_self= pthread_self(); -#endif - pthread_mutex_init(&tmp->mutex,MY_MUTEX_INIT_FAST); - pthread_cond_init(&tmp->suspend, NULL); - tmp->init= 1; + mysql_mutex_init(key_my_thread_var_mutex, &tmp->mutex, MY_MUTEX_INIT_FAST); + mysql_cond_init(key_my_thread_var_suspend, &tmp->suspend, NULL); - pthread_mutex_lock(&THR_LOCK_threads); + tmp->stack_ends_here= (char*)&tmp + + STACK_DIRECTION * (long)my_thread_stack_size; + + mysql_mutex_lock(&THR_LOCK_threads); tmp->id= ++thread_id; ++THR_thread_count; - pthread_mutex_unlock(&THR_LOCK_threads); + mysql_mutex_unlock(&THR_LOCK_threads); + tmp->init= 1; #ifndef DBUG_OFF /* Generate unique name for thread */ (void) my_thread_name(); @@ -331,6 +399,17 @@ void my_thread_end(void) 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 + +#ifdef HAVE_PSI_INTERFACE + /* + Remove the instrumentation for this thread. + This must be done before trashing st_my_thread_var, + because the LF_HASH depends on it. + */ + if (PSI_server) + PSI_server->delete_current_thread(); +#endif + if (tmp && tmp->init) { #if !defined(DBUG_OFF) @@ -344,14 +423,10 @@ void my_thread_end(void) #endif #if !defined(__bsdi__) && !defined(__OpenBSD__) /* bsdi and openbsd 3.5 dumps core here */ - pthread_cond_destroy(&tmp->suspend); + mysql_cond_destroy(&tmp->suspend); #endif - pthread_mutex_destroy(&tmp->mutex); -#if !defined(__WIN__) || defined(USE_TLS) + mysql_mutex_destroy(&tmp->mutex); free(tmp); -#else - tmp->init= 0; -#endif /* Decrement counter for number of running threads. We are using this @@ -359,16 +434,13 @@ void my_thread_end(void) my_thread_end and thus freed all memory they have allocated in my_thread_init() and DBUG_xxxx */ - pthread_mutex_lock(&THR_LOCK_threads); + mysql_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); + mysql_cond_signal(&THR_COND_threads); + mysql_mutex_unlock(&THR_LOCK_threads); } - /* The following free has to be done, even if my_thread_var() is 0 */ -#if !defined(__WIN__) || defined(USE_TLS) pthread_setspecific(THR_KEY_mysys,0); -#endif } struct st_my_thread_var *_my_thread_var(void) @@ -406,6 +478,15 @@ const char *my_thread_name(void) } return tmp->name; } + +/* 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 /* DBUG_OFF */ @@ -424,4 +505,29 @@ static uint get_thread_lib(void) return THD_LIB_OTHER; } -#endif /* THREAD */ +#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 + diff --git a/dep/mysqllite/mysys/my_wincond.c b/dep/mysqllite/mysys/my_wincond.c index 1134d40229a6d..58c09e332d60a 100644 --- a/dep/mysqllite/mysys/my_wincond.c +++ b/dep/mysqllite/mysys/my_wincond.c @@ -16,16 +16,116 @@ /***************************************************************************** ** The following is a simple implementation of posix conditions *****************************************************************************/ +#if defined(_WIN32) #undef SAFE_MUTEX /* Avoid safe_mutex redefinitions */ #include "mysys_priv.h" -#if defined(THREAD) && defined(__WIN__) #include -#undef getpid #include #include -int pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr) + +/* + Windows native condition variables. We use runtime loading / function + pointers, because they are not available on XP +*/ + +/* Prototypes and function pointers for condition variable functions */ +typedef VOID (WINAPI * InitializeConditionVariableProc) + (PCONDITION_VARIABLE ConditionVariable); + +typedef BOOL (WINAPI * SleepConditionVariableCSProc) + (PCONDITION_VARIABLE ConditionVariable, + PCRITICAL_SECTION CriticalSection, + DWORD dwMilliseconds); + +typedef VOID (WINAPI * WakeAllConditionVariableProc) + (PCONDITION_VARIABLE ConditionVariable); + +typedef VOID (WINAPI * WakeConditionVariableProc) + (PCONDITION_VARIABLE ConditionVariable); + +static InitializeConditionVariableProc my_InitializeConditionVariable; +static SleepConditionVariableCSProc my_SleepConditionVariableCS; +static WakeAllConditionVariableProc my_WakeAllConditionVariable; +static WakeConditionVariableProc my_WakeConditionVariable; + + +/** + Indicates if we have native condition variables, + initialized first time pthread_cond_init is called. +*/ + +static BOOL have_native_conditions= FALSE; + + +/** + Check if native conditions can be used, load function pointers +*/ + +static void check_native_cond_availability(void) +{ + HMODULE module= GetModuleHandle("kernel32"); + + my_InitializeConditionVariable= (InitializeConditionVariableProc) + GetProcAddress(module, "InitializeConditionVariable"); + my_SleepConditionVariableCS= (SleepConditionVariableCSProc) + GetProcAddress(module, "SleepConditionVariableCS"); + my_WakeAllConditionVariable= (WakeAllConditionVariableProc) + GetProcAddress(module, "WakeAllConditionVariable"); + my_WakeConditionVariable= (WakeConditionVariableProc) + GetProcAddress(module, "WakeConditionVariable"); + + if (my_InitializeConditionVariable) + have_native_conditions= TRUE; +} + + + +/** + Convert abstime to milliseconds +*/ + +static DWORD get_milliseconds(const struct timespec *abstime) +{ + long long millis; + union ft64 now; + + if (abstime == NULL) + return INFINITE; + + 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 + */ + millis= (abstime->tv.i64 - now.i64) / 10000; + + /* Don't allow the timeout to be negative */ + if (millis < 0) + return 0; + + /* + Make sure the calculated timeout does not exceed original timeout + value which could cause "wait for ever" if system time changes + */ + if (millis > abstime->max_timeout_msec) + millis= abstime->max_timeout_msec; + + if (millis > UINT_MAX) + millis= UINT_MAX; + + return (DWORD)millis; +} + + +/* + Old (pre-vista) implementation using events +*/ + +static int legacy_cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr) { cond->waiting= 0; InitializeCriticalSection(&cond->lock_waiting); @@ -54,7 +154,8 @@ int pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr) return 0; } -int pthread_cond_destroy(pthread_cond_t *cond) + +static int legacy_cond_destroy(pthread_cond_t *cond) { DeleteCriticalSection(&cond->lock_waiting); @@ -66,48 +167,13 @@ int pthread_cond_destroy(pthread_cond_t *cond) } -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, +static int legacy_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; - } + DWORD timeout; + timeout= get_milliseconds(abstime); /* Block access if previous broadcast hasn't finished. This is just for safety and should normally not @@ -143,7 +209,7 @@ int pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex, return result == WAIT_TIMEOUT ? ETIMEDOUT : 0; } -int pthread_cond_signal(pthread_cond_t *cond) +static int legacy_cond_signal(pthread_cond_t *cond) { EnterCriticalSection(&cond->lock_waiting); @@ -156,7 +222,7 @@ int pthread_cond_signal(pthread_cond_t *cond) } -int pthread_cond_broadcast(pthread_cond_t *cond) +static int legacy_cond_broadcast(pthread_cond_t *cond) { EnterCriticalSection(&cond->lock_waiting); /* @@ -178,11 +244,91 @@ int pthread_cond_broadcast(pthread_cond_t *cond) } +/* + Posix API functions. Just choose between native and legacy implementation. +*/ + +int pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr) +{ + /* + Once initialization is used here rather than in my_init(), to + 1) avoid my_init() pitfalls- undefined order in which initialization should + run + 2) be potentially useful C++ (in static constructors that run before main()) + 3) just to simplify the API. + Also, the overhead of my_pthread_once is very small. + */ + static my_pthread_once_t once_control= MY_PTHREAD_ONCE_INIT; + my_pthread_once(&once_control, check_native_cond_availability); + + if (have_native_conditions) + { + my_InitializeConditionVariable(&cond->native_cond); + return 0; + } + else + return legacy_cond_init(cond, attr); +} + + +int pthread_cond_destroy(pthread_cond_t *cond) +{ + if (have_native_conditions) + return 0; /* no destroy function */ + else + return legacy_cond_destroy(cond); +} + + +int pthread_cond_broadcast(pthread_cond_t *cond) +{ + if (have_native_conditions) + { + my_WakeAllConditionVariable(&cond->native_cond); + return 0; + } + else + return legacy_cond_broadcast(cond); +} + + +int pthread_cond_signal(pthread_cond_t *cond) +{ + if (have_native_conditions) + { + my_WakeConditionVariable(&cond->native_cond); + return 0; + } + else + return legacy_cond_signal(cond); +} + + +int pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex, + struct timespec *abstime) +{ + if (have_native_conditions) + { + DWORD timeout= get_milliseconds(abstime); + if (!my_SleepConditionVariableCS(&cond->native_cond, mutex, timeout)) + return ETIMEDOUT; + return 0; + } + else + return legacy_cond_timedwait(cond, mutex, abstime); +} + + +int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex) +{ + return pthread_cond_timedwait(cond, mutex, NULL); +} + + int pthread_attr_init(pthread_attr_t *connect_att) { connect_att->dwStackSize = 0; connect_att->dwCreatingFlag = 0; - connect_att->priority = 0; return 0; } @@ -192,12 +338,6 @@ int pthread_attr_setstacksize(pthread_attr_t *connect_att,DWORD stack) return 0; } -int pthread_attr_setprio(pthread_attr_t *connect_att,int priority) -{ - connect_att->priority=priority; - return 0; -} - int pthread_attr_destroy(pthread_attr_t *connect_att) { bzero((uchar*) connect_att,sizeof(*connect_att)); diff --git a/dep/mysqllite/mysys/my_windac.c b/dep/mysqllite/mysys/my_windac.c new file mode 100644 index 0000000000000..0c9241886232f --- /dev/null +++ b/dep/mysqllite/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(sa); + my_free(dacl); + *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(attr->dacl); + my_free(sa); + } +} + +#endif /* __WIN__ */ diff --git a/dep/mysqllite/mysys/my_winerr.c b/dep/mysqllite/mysys/my_winerr.c new file mode 100644 index 0000000000000..534078b6737a1 --- /dev/null +++ b/dep/mysqllite/mysys/my_winerr.c @@ -0,0 +1,123 @@ +/* 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). +*/ + +#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); +} diff --git a/dep/mysqllite/mysys/my_winfile.c b/dep/mysqllite/mysys/my_winfile.c new file mode 100644 index 0000000000000..4d80d774dad8a --- /dev/null +++ b/dep/mysqllite/mysys/my_winfile.c @@ -0,0 +1,681 @@ +/* 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 */ + +/* + 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"); + + mysql_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; + } + } + mysql_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_open_flags"); + 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(); + /* + 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((size_t)-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) + DBUG_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((size_t)-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: %llu, offset: %llu", + Filedes, Buffer, (ulonglong)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((size_t)-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 %llu", fd, Buffer, + (ulonglong)Count)); + + if(!Count) + DBUG_RETURN(0); + +#ifdef _WIN64 + if(Count > UINT_MAX) + Count= UINT_MAX; +#endif + + 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)) + { + my_osmaperr(GetLastError()); + DBUG_RETURN((size_t)-1); + } + DBUG_RETURN(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/dep/mysqllite/mysys/my_winthread.c b/dep/mysqllite/mysys/my_winthread.c index ef2a20c2ddcf2..49534370a2f70 100644 --- a/dep/mysqllite/mysys/my_winthread.c +++ b/dep/mysqllite/mysys/my_winthread.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (C) 2000 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 @@ -14,33 +14,23 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /***************************************************************************** -** Simulation of posix threads calls for WIN95 and NT +** 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" -#if defined(THREAD) && defined(__WIN__) -#include -#undef getpid #include +#include -static pthread_mutex_t THR_LOCK_thread; +static void install_sigabrt_handler(void); -struct pthread_map +struct thread_start_parameter { - HANDLE pthreadself; pthread_handler func; - void *param; + void *arg; }; -void win_pthread_init(void) -{ - pthread_mutex_init(&THR_LOCK_thread,MY_MUTEX_INIT_FAST); -} - - /** Adapter to @c pthread_mutex_trylock() @@ -62,81 +52,101 @@ win_pthread_mutex_trylock(pthread_mutex_t *mutex) return EBUSY; } - -/* -** We have tried to use '_beginthreadex' instead of '_beginthread' here -** but in this case the program leaks about 512 characters for each -** created thread ! -** As we want to save the created thread handler for other threads to -** use and to be returned by pthread_self() (instead of the Win32 pseudo -** handler), we have to go trough pthread_start() to catch the returned handler -** in the new thread. -*/ - -pthread_handler_t pthread_start(void *param) +static unsigned int __stdcall pthread_start(void *p) { - pthread_handler func=((struct pthread_map *) param)->func; - void *func_param=((struct pthread_map *) param)->param; - my_thread_init(); /* Will always succeed in windows */ - pthread_mutex_lock(&THR_LOCK_thread); /* Wait for beginthread to return */ - win_pthread_self=((struct pthread_map *) param)->pthreadself; - pthread_mutex_unlock(&THR_LOCK_thread); - free((char*) param); /* Free param from create */ - pthread_exit((void*) (*func)(func_param)); - return 0; /* Safety */ + 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) +int pthread_create(pthread_t *thread_id, const pthread_attr_t *attr, + pthread_handler func, void *param) { - HANDLE hThread; - struct pthread_map *map; + uintptr_t handle; + struct thread_start_parameter *par; + unsigned int stack_size; DBUG_ENTER("pthread_create"); - if (!(map=malloc(sizeof(*map)))) - DBUG_RETURN(-1); - map->func=func; - map->param=param; - pthread_mutex_lock(&THR_LOCK_thread); -#ifdef __BORLANDC__ - hThread=(HANDLE)_beginthread((void(_USERENTRY *)(void *)) pthread_start, - attr->dwStackSize ? attr->dwStackSize : - 65535, (void*) map); -#else - hThread=(HANDLE)_beginthread((void( __cdecl *)(void *)) pthread_start, - attr->dwStackSize ? attr->dwStackSize : - 65535, (void*) map); -#endif - DBUG_PRINT("info", ("hThread=%lu",(long) hThread)); - *thread_id=map->pthreadself=hThread; - pthread_mutex_unlock(&THR_LOCK_thread); + par= (struct thread_start_parameter *)malloc(sizeof(*par)); + if (!par) + goto error_return; - if (hThread == (HANDLE) -1) - { - int error=errno; - DBUG_PRINT("error", - ("Can't create thread to handle request (error %d)",error)); - DBUG_RETURN(error ? error : -1); - } - VOID(SetThreadPriority(hThread, attr->priority)) ; + 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) { - _endthread(); + _endthreadex(0); } -/* This is neaded to get the macro pthread_setspecific to work */ - -int win_pthread_setspecific(void *a,void *b,uint length) +int pthread_join(pthread_t thread, void **value_ptr) { - memcpy(a,b,length); + 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; } +int pthread_cancel(pthread_t thread) +{ + + HANDLE handle= 0; + BOOL ok= FALSE; + + handle= OpenThread(THREAD_TERMINATE, FALSE, thread); + if (handle) + { + ok= TerminateThread(handle,0); + CloseHandle(handle); + } + if (ok) + return 0; + + errno= EINVAL; + return -1; +} /* One time initialization. For simplicity, we assume initializer thread @@ -145,8 +155,19 @@ int win_pthread_setspecific(void *a,void *b,uint length) int my_pthread_once(my_pthread_once_t *once_control, void (*init_routine)(void)) { - LONG state= InterlockedCompareExchange(once_control, MY_PTHREAD_ONCE_INPROGRESS, - MY_PTHREAD_ONCE_INIT); + LONG state; + + /* + Do "dirty" read to find out if initialization is already done, to + save an interlocked operation in common case. Memory barriers are ensured by + Visual C++ volatile implementation. + */ + if (*once_control == MY_PTHREAD_ONCE_DONE) + return 0; + + state= InterlockedCompareExchange(once_control, MY_PTHREAD_ONCE_INPROGRESS, + MY_PTHREAD_ONCE_INIT); + switch(state) { case MY_PTHREAD_ONCE_INIT: @@ -168,5 +189,4 @@ int my_pthread_once(my_pthread_once_t *once_control, } return 0; } - #endif diff --git a/dep/mysqllite/mysys/my_write.c b/dep/mysqllite/mysys/my_write.c index d7eb390bdd204..64f7546620fe0 100644 --- a/dep/mysqllite/mysys/my_write.c +++ b/dep/mysqllite/mysys/my_write.c @@ -20,14 +20,14 @@ /* Write a chunk of bytes to a file */ -size_t my_write(int Filedes, const uchar *Buffer, size_t Count, myf MyFlags) +size_t my_write(File Filedes, const uchar *Buffer, size_t Count, myf MyFlags) { - size_t writenbytes, written; + size_t writtenbytes, written; uint errors; DBUG_ENTER("my_write"); - DBUG_PRINT("my",("Fd: %d Buffer: 0x%lx Count: %lu MyFlags: %d", - Filedes, (long) Buffer, (ulong) Count, MyFlags)); - errors=0; written=0; + 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)) @@ -35,22 +35,26 @@ size_t my_write(int Filedes, const uchar *Buffer, size_t Count, myf MyFlags) for (;;) { - if ((writenbytes= write(Filedes, Buffer, Count)) == Count) +#ifdef _WIN32 + writtenbytes= my_win_write(Filedes, Buffer, Count); +#else + writtenbytes= write(Filedes, Buffer, Count); +#endif + if (writtenbytes == Count) break; - if (writenbytes != (size_t) -1) + if (writtenbytes != (size_t) -1) { /* Safeguard */ - written+=writenbytes; - Buffer+=writenbytes; - Count-=writenbytes; + written+= writtenbytes; + Buffer+= writtenbytes; + Count-= writtenbytes; } - my_errno=errno; + my_errno= errno; DBUG_PRINT("error",("Write only %ld bytes, error: %d", - (long) writenbytes, my_errno)); + (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)) { @@ -59,19 +63,19 @@ size_t my_write(int Filedes, const uchar *Buffer, size_t Count, myf MyFlags) continue; } - if ((writenbytes == 0 || writenbytes == (size_t) -1)) + if ((writtenbytes == 0 || writtenbytes == (size_t) -1)) { if (my_errno == EINTR) { DBUG_PRINT("debug", ("my_write() was interrupted and returned %ld", - (long) writenbytes)); + (long) writtenbytes)); continue; /* Interrupted */ } - if (!writenbytes && !errors++) /* Retry once */ + if (!writtenbytes && !errors++) /* Retry once */ { /* We may come here if the file quota is exeeded */ - errno=EFBIG; /* Assume this is the error */ + errno= EFBIG; /* Assume this is the error */ continue; } } @@ -92,5 +96,5 @@ size_t my_write(int Filedes, const uchar *Buffer, size_t Count, myf MyFlags) } if (MyFlags & (MY_NABP | MY_FNABP)) DBUG_RETURN(0); /* Want only errors */ - DBUG_RETURN(writenbytes+written); + DBUG_RETURN(writtenbytes+written); } /* my_write */ diff --git a/dep/mysqllite/mysys/mysys_priv.h b/dep/mysqllite/mysys/mysys_priv.h index 6e0959ae08c33..4e642b7e3d337 100644 --- a/dep/mysqllite/mysys/mysys_priv.h +++ b/dep/mysqllite/mysys/mysys_priv.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (C) 2000 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 @@ -24,14 +24,52 @@ #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 + +#ifdef HAVE_PSI_INTERFACE + +#if !defined(HAVE_PREAD) && !defined(_WIN32) +extern PSI_mutex_key key_my_file_info_mutex; +#endif /* !defined(HAVE_PREAD) && !defined(_WIN32) */ + +#if !defined(HAVE_LOCALTIME_R) || !defined(HAVE_GMTIME_R) +extern PSI_mutex_key key_LOCK_localtime_r; +#endif /* !defined(HAVE_LOCALTIME_R) || !defined(HAVE_GMTIME_R) */ + +#ifndef HAVE_GETHOSTBYNAME_R +extern PSI_mutex_key key_LOCK_gethostbyname_r; +#endif /* HAVE_GETHOSTBYNAME_R */ + +extern PSI_mutex_key key_BITMAP_mutex, key_IO_CACHE_append_buffer_lock, + key_IO_CACHE_SHARE_mutex, key_KEY_CACHE_cache_lock, key_LOCK_alarm, + key_my_thread_var_mutex, key_THR_LOCK_charset, key_THR_LOCK_heap, + key_THR_LOCK_isam, key_THR_LOCK_lock, key_THR_LOCK_malloc, + key_THR_LOCK_mutex, key_THR_LOCK_myisam, key_THR_LOCK_net, + key_THR_LOCK_open, key_THR_LOCK_threads, key_THR_LOCK_time, + key_TMPDIR_mutex, key_THR_LOCK_myisam_mmap; + +extern PSI_cond_key key_COND_alarm, key_IO_CACHE_SHARE_cond, + key_IO_CACHE_SHARE_cond_writer, key_my_thread_var_suspend, + key_THR_COND_threads; + +#ifdef USE_ALARM_THREAD +extern PSI_thread_key key_thread_alarm; +#endif /* USE_ALARM_THREAD */ + +#endif /* HAVE_PSI_INTERFACE */ + +extern mysql_mutex_t THR_LOCK_malloc, THR_LOCK_open, THR_LOCK_keycache; +extern mysql_mutex_t THR_LOCK_lock, THR_LOCK_isam, THR_LOCK_net; +extern mysql_mutex_t THR_LOCK_charset, THR_LOCK_time; + +#include + +#ifdef HAVE_PSI_INTERFACE +#ifdef HUGETLB_USE_PROC_MEMINFO +extern PSI_file_key key_file_proc_meminfo; +#endif /* HUGETLB_USE_PROC_MEMINFO */ +extern PSI_file_key key_file_charset, key_file_cnf; +#endif /* HAVE_PSI_INTERFACE */ /* EDQUOT is used only in 3 C files only in mysys/. If it does not exist on @@ -42,3 +80,28 @@ extern pthread_mutex_t THR_LOCK_charset, THR_LOCK_time; #endif void my_error_unregister_all(void); + +#ifdef _WIN32 +#include +/* 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 diff --git a/dep/mysqllite/mysys/ptr_cmp.c b/dep/mysqllite/mysys/ptr_cmp.c new file mode 100644 index 0000000000000..dcafe13291d5b --- /dev/null +++ b/dep/mysqllite/mysys/ptr_cmp.c @@ -0,0 +1,223 @@ +/* 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 + +#ifdef __sun +/* + * On Solaris, memcmp() is normally faster than the unrolled ptr_compare_N + * functions, as memcmp() is usually a platform-specific implementation + * written in assembler, provided in /usr/lib/libc/libc_hwcap*.so.1. + * This implementation is also usually faster than the built-in memcmp + * supplied by GCC, so it is recommended to build with "-fno-builtin-memcmp" + * in CFLAGS if building with GCC on Solaris. + */ + +#include + +static int native_compare(size_t *length, unsigned char **a, unsigned char **b) +{ + return memcmp(*a, *b, *length); +} + +#else /* __sun */ + +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); +#endif /* __sun */ + + /* Get a pointer to a optimal byte-compare function for a given size */ + +#ifdef __sun +qsort2_cmp get_ptr_compare (size_t size __attribute__((unused))) +{ + return (qsort2_cmp) native_compare; +} +#else +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 */ +} +#endif /* __sun */ + + + /* + 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] + +#ifndef __sun + +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); +} + +#endif /* !__sun */ + +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/dep/mysqllite/mysys/queues.c b/dep/mysqllite/mysys/queues.c new file mode 100644 index 0000000000000..25a310c075248 --- /dev/null +++ b/dep/mysqllite/mysys/queues.c @@ -0,0 +1,687 @@ +/* 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"); + my_free(queue->root); + queue->root= NULL; + 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 bool max_ind= 0; +static bool fix_used= 0; +static ulonglong start_time= 0; + +static 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; +} + +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); + } +} + +bool perform_ins_del(QUEUE *queue, 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; +} + +bool do_test(uint no_parts, uint l_max_ind, bool l_fix_used) +{ + QUEUE queue; + 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/dep/mysqllite/mysys/rijndael.c b/dep/mysqllite/mysys/rijndael.c new file mode 100644 index 0000000000000..2d622efad82e1 --- /dev/null +++ b/dep/mysqllite/mysys/rijndael.c @@ -0,0 +1,1379 @@ +/* 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 "rijndael.h" + +/* + Define the following to use fastest and much larger code (~10K extra code) + #define FULL_UNROLL +*/ + +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/dep/mysqllite/mysys/safemalloc.c b/dep/mysqllite/mysys/safemalloc.c deleted file mode 100644 index 76faa33e8045a..0000000000000 --- a/dep/mysqllite/mysys/safemalloc.c +++ /dev/null @@ -1,576 +0,0 @@ -/* 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); - - if (size + sf_malloc_cur_memory > sf_malloc_mem_limit) - 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); - DBUG_EXECUTE_IF("simulate_out_of_memory", - { - free(irem); - irem= NULL; - }); - } - /* 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[256]; - my_errno=errno; - sprintf(buff,"Out of memory at line %d, '%s'", lineno, filename); - my_message(EE_OUTOFMEMORY, buff, MYF(ME_BELL+ME_WAITTANG+ME_NOREFRESH)); - sprintf(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'", - (ulong) sf_malloc_max_memory, lineno, filename)); - DBUG_EXECUTE_IF("simulate_out_of_memory", - DBUG_SET("-d,simulate_out_of_memory");); - 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); - - MEM_CHECK_ADDRESSABLE(data, size); - /* 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)); - if (!(MyFlags & MY_ZEROFILL)) - MEM_UNDEFINED(data, size); - /* 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 - MEM_NOACCESS(ptr, irem->datasize); - *((uint32*) ((char*) ptr- sizeof(uint32)))= ~MAGICKEY; - MEM_NOACCESS((char*) ptr - sizeof(uint32), sizeof(uint32)); - /* 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/dep/mysqllite/mysys/sha1.c b/dep/mysqllite/mysys/sha1.c index 3469e480c2620..e5b33a9ad1300 100644 --- a/dep/mysqllite/mysys/sha1.c +++ b/dep/mysqllite/mysys/sha1.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002, 2004, 2006 MySQL AB +/* 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 @@ -6,26 +6,57 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +*/ /* Original Source from: http://www.faqs.org/rfcs/rfc3174.html + Copyright (C) The Internet Society (2001). All Rights Reserved. + + This document and translations of it may be copied and furnished to + others, and derivative works that comment on or otherwise explain it + or assist in its implementation may be prepared, copied, published + and distributed, in whole or in part, without restriction of any + kind, provided that the above copyright notice and this paragraph are + included on all such copies and derivative works. However, this + document itself may not be modified in any way, such as by removing + the copyright notice or references to the Internet Society or other + Internet organizations, except as needed for the purpose of + developing Internet standards in which case the procedures for + copyrights defined in the Internet Standards process must be + followed, or as required to translate it into languages other than + English. + + The limited permissions granted above are perpetual and will not be + revoked by the Internet Society or its successors or assigns. + + This document and the information contained herein is provided on an + "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING + TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING + BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION + HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF + MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + + Acknowledgement + Funding for the RFC Editor function is currently provided by the + Internet Society. + 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. + 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 diff --git a/dep/mysqllite/mysys/stacktrace.c b/dep/mysqllite/mysys/stacktrace.c new file mode 100644 index 0000000000000..48cdaaa6c91b2 --- /dev/null +++ b/dep/mysqllite/mysys/stacktrace.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 */ + +#include +#include + +#ifndef __WIN__ +#include +#include +#include +#ifdef HAVE_STACKTRACE +#include +#include + +#ifdef __linux__ +#include /* isprint */ +#include /* SYS_gettid */ +#endif + +#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 +} + +#ifdef __linux__ + +static void print_buffer(char *buffer, size_t count) +{ + for (; count && *buffer; --count) + { + int c= (int) *buffer++; + fputc(isprint(c) ? c : ' ', stderr); + } +} + +/** + Access the pages of this process through /proc/self/task//mem + in order to safely print the contents of a memory address range. + + @param addr The address at the start of the memory region. + @param max_len The length of the memory region. + + @return Zero on success. +*/ +static int safe_print_str(const char *addr, int max_len) +{ + int fd; + pid_t tid; + off_t offset; + ssize_t nbytes= 0; + size_t total, count; + char buf[256]; + + tid= (pid_t) syscall(SYS_gettid); + + sprintf(buf, "/proc/self/task/%d/mem", tid); + + if ((fd= open(buf, O_RDONLY)) < 0) + return -1; + + /* Ensure that off_t can hold a pointer. */ + compile_time_assert(sizeof(off_t) >= sizeof(intptr)); + + total= max_len; + offset= (intptr) addr; + + /* Read up to the maximum number of bytes. */ + while (total) + { + count= min(sizeof(buf), total); + + if ((nbytes= pread(fd, buf, count, offset)) < 0) + { + /* Just in case... */ + if (errno == EINTR) + continue; + else + break; + } + + /* Advance offset into memory. */ + total-= nbytes; + offset+= nbytes; + addr+= nbytes; + + /* Output the printable characters. */ + print_buffer(buf, nbytes); + + /* Break if less than requested... */ + if ((count - nbytes)) + break; + } + + /* Output a new line if something was printed. */ + if (total != (size_t) max_len) + fputc('\n', stderr); + + if (nbytes == -1) + fprintf(stderr, "Can't read from address %p: %m.\n", addr); + + close(fd); + + return 0; +} + +#endif + +void my_safe_print_str(const char* val, int max_len) +{ + char *heap_end; + +#ifdef __linux__ + if (!safe_print_str(val, max_len)) + return; +#endif + + heap_end= (char*) sbrk(0); + + if (!PTR_SANE(val)) + { + fprintf(stderr, "is an invalid pointer\n"); + return; + } + + for (; max_len && PTR_SANE(val) && *val; --max_len) + fputc(*val++, stderr); + fputc('\n', stderr); +} + +#if defined(HAVE_PRINTSTACK) + +/* Use Solaris' symbolic stack trace routine. */ +#include + +void my_print_stacktrace(uchar* stack_bottom __attribute__((unused)), + ulong thread_stack __attribute__((unused))) +{ + if (printstack(fileno(stderr)) == -1) + fprintf(stderr, "Error when traversing the stack, stack appears corrupt.\n"); + else + 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"); +} + +#elif 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) +{ +#ifdef HAVE_gcov + extern void __gcov_flush(void); +#endif + 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. + */ + __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 +#if _MSC_VER +#pragma comment(lib, "dbghelp") +#endif + +static EXCEPTION_POINTERS *exception_ptrs; + +#define MODULE64_SIZE_WINXP 576 +#define STACKWALK_MAX_FRAMES 64 + +void my_init_stacktrace() +{ +} + + +void my_set_exception_pointers(EXCEPTION_POINTERS *ep) +{ + exception_ptrs = ep; +} + +/* + Appends directory to symbol path. +*/ +static void add_to_symbol_path(char *path, size_t path_buffer_size, + char *dir, size_t dir_buffer_size) +{ + strcat_s(dir, dir_buffer_size, ";"); + if (!strstr(path, dir)) + { + strcat_s(path, path_buffer_size, dir); + } +} + +/* + 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; + char *p; +#ifndef DBUG_OFF + static char pdb_debug_dir[MAX_PATH + 7]; +#endif + + path[0]= '\0'; + +#ifndef DBUG_OFF + /* + Add "debug" subdirectory of the application directory, sometimes PDB will + placed here by installation. + */ + GetModuleFileName(NULL, pdb_debug_dir, MAX_PATH); + p= strrchr(pdb_debug_dir, '\\'); + if(p) + { + *p= 0; + strcat_s(pdb_debug_dir, sizeof(pdb_debug_dir), "\\debug;"); + add_to_symbol_path(path, size, pdb_debug_dir, sizeof(pdb_debug_dir)); + } +#endif + + /* + 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; + 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]= '.'; + module_dir[1]= '\0'; + } + else + { + *p= '\0'; + } + add_to_symbol_path(path, size, module_dir,sizeof(mod.szExePath)); + } + CloseHandle(hSnap); + } + + + /* Add _NT_SYMBOL_PATH, if present. */ + envvar= getenv("_NT_SYMBOL_PATH"); + if(envvar) + { + strcat_s(path, size, envvar); + } +} + +#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) + return; + + /* Copy context, as stackwalking on original will unwind the stack */ + context = *(exception_ptrs->ContextRecord); + /*Initialize symbols.*/ + SymSetOptions(SYMOPT_LOAD_LINES|SYMOPT_NO_PROMPTS|SYMOPT_DEFERRED_LOADS|SYMOPT_DEBUG); + get_symbol_path(symbol_path, sizeof(symbol_path)); + SymInitialize(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(!StackWalk64(machine, hProcess, hThread, &frame, &context, 0, 0, 0 ,0)) + break; + addr= frame.AddrPC.Offset; + + have_module= SymGetModuleInfo64(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= SymGetModuleInfo64(hProcess, addr, &module); + } +#endif + + have_symbol= SymGetSymFromAddr64(hProcess, addr, &function_offset, + &(package.sym)); + have_source= SymGetLineFromAddr64(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) + 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 */ + if(MiniDumpWriteDump(GetCurrentProcess(), GetCurrentProcessId(), + hFile, MiniDumpNormal, &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 *val, int len) +{ + __try + { + fprintf(stderr,"=%.*s\n", len, val); + } + __except(EXCEPTION_EXECUTE_HANDLER) + { + fprintf(stderr,"is an invalid string pointer\n"); + } +} +#endif /*__WIN__*/ diff --git a/dep/mysqllite/mysys/string.c b/dep/mysqllite/mysys/string.c index 10a72b8a2958c..b1eded0664cd4 100644 --- a/dep/mysqllite/mysys/string.c +++ b/dep/mysqllite/mysys/string.c @@ -177,9 +177,6 @@ my_bool dynstr_append_os_quoted(DYNAMIC_STRING *str, const char *append, ...) void dynstr_free(DYNAMIC_STRING *str) { - if (str->str) - { - my_free(str->str,MYF(MY_WME)); - str->str=0; - } + my_free(str->str); + str->str= NULL; } diff --git a/dep/mysqllite/mysys/thr_alarm.c b/dep/mysqllite/mysys/thr_alarm.c new file mode 100644 index 0000000000000..2e427f96bdda0 --- /dev/null +++ b/dep/mysqllite/mysys/thr_alarm.c @@ -0,0 +1,972 @@ +/* Copyright (C) 2000 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 */ + +/* To avoid problems with alarms in debug code, we disable DBUG here */ +#define FORCE_DBUG_OFF +#include "mysys_priv.h" +#include + +#if !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 mysql_mutex_t LOCK_alarm; +static mysql_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() mysql_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 */ + mysql_mutex_init(key_LOCK_alarm, &LOCK_alarm, MY_MUTEX_INIT_FAST); + mysql_cond_init(key_COND_alarm, &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); + mysql_thread_create(key_thread_alarm, + &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) +{ + mysql_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); + mysql_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 + mysql_mutex_lock(&LOCK_alarm); /* Lock from threads & alarms */ + if (alarm_aborted > 0) + { /* No signal thread */ + DBUG_PRINT("info", ("alarm aborted")); + *alrm= 0; /* No alarm */ + mysql_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 */ + mysql_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 */ + mysql_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 */ + } + mysql_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 + mysql_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(alarm_data); + 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 0x%lx in queue\n", + (long) *alarmed)); + } + mysql_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 SIGNAL_HANDLER_RESET_ON_DELIVERY + 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); + mysql_mutex_lock(&LOCK_alarm); +#endif + process_alarm_part2(sig); +#ifndef USE_ALARM_THREAD +#if defined(SIGNAL_HANDLER_RESET_ON_DELIVERY) && !defined(USE_ONE_SIGNAL_HAND) + my_sigset(THR_SERVER_ALARM,process_alarm); +#endif + mysql_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 */ + { + mysql_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= mysql_cond_timedwait(&COND_alarm, &LOCK_alarm, &abstime); + if (error == ETIME || error == ETIMEDOUT) + break; /* Don't wait forever */ + } + delete_queue(&alarm_queue); + alarm_aborted= 1; + mysql_mutex_unlock(&LOCK_alarm); + if (!alarm_thread_running) /* Safety */ + { + mysql_mutex_destroy(&LOCK_alarm); + mysql_cond_destroy(&COND_alarm); + } + } + else + mysql_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; + mysql_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; + } + } + mysql_mutex_unlock(&LOCK_alarm); +} + + +void thr_alarm_info(ALARM_INFO *info) +{ + mysql_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); + } + mysql_mutex_unlock(&LOCK_alarm); +} + +/* + This is here for thread to get interruptet from read/write/fcntl + ARGSUSED +*/ + + +static sig_handler thread_alarm(int sig __attribute__((unused))) +{ +#ifdef MAIN + printf("thread_alarm\n"); fflush(stdout); +#endif +#ifdef SIGNAL_HANDLER_RESET_ON_DELIVERY + 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; + mysql_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= mysql_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= mysql_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; + mysql_cond_signal(&COND_alarm); + mysql_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 + +/**************************************************************************** + Handling of test case (when compiled with -DMAIN) +***************************************************************************/ + +#ifdef MAIN +#if !defined(DONT_USE_THR_ALARM) + +static mysql_cond_t COND_thread_count; +static mysql_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); + } + mysql_mutex_lock(&LOCK_thread_count); + thread_count--; + mysql_cond_signal(&COND_thread_count); /* Tell main we are ready */ + mysql_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 SIGNAL_HANDLER_RESET_ON_DELIVERY + 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 */ + mysql_mutex_lock(&LOCK_thread_count); /* Required by bsdi */ + mysql_cond_signal(&COND_thread_count); /* Tell main we are ready */ + mysql_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); + } + mysql_mutex_init(0, &LOCK_thread_count, MY_MUTEX_INIT_FAST); + mysql_cond_init(0, &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); + + 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 */ + mysql_mutex_lock(&LOCK_thread_count); + mysql_thread_create(0, + &tid, &thr_attr, signal_hand, NULL); + mysql_cond_wait(&COND_thread_count, &LOCK_thread_count); + mysql_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; + mysql_mutex_lock(&LOCK_thread_count); + if ((error= mysql_thread_create(0, + &tid, &thr_attr, test_thread, + (void*) param))) + { + printf("Can't create thread %d, error: %d\n",i,error); + exit(1); + } + thread_count++; + mysql_mutex_unlock(&LOCK_thread_count); + } + + pthread_attr_destroy(&thr_attr); + mysql_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) + { + mysql_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); + } + } + mysql_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 /* !defined(DONT_USE_ALARM_THREAD) */ + +int main(int argc __attribute__((unused)),char **argv __attribute__((unused))) +{ + printf("thr_alarm disabled with DONT_USE_THR_ALARM\n"); + exit(1); +} + +#endif /* !defined(DONT_USE_ALARM_THREAD) */ +#endif /* MAIN */ diff --git a/dep/mysqllite/mysys/thr_lock.c b/dep/mysqllite/mysys/thr_lock.c new file mode 100644 index 0000000000000..2ab283e068dd9 --- /dev/null +++ b/dep/mysqllite/mysys/thr_lock.c @@ -0,0 +1,1688 @@ +/* Copyright (C) 2000 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 */ + +/* +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_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_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: + Before a write lock is released, this function is called. + In MyISAM this functions updates the count and 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_CONCURRENT_INSERT or +one TL_WRITE_DELAYED lock at the same time as multiple read locks. + +*/ + +#if !defined(MAIN) && !defined(DBUG_OFF) && !defined(EXTRA_DEBUG) +#define FORCE_DBUG_OFF +#endif + +#include "mysys_priv.h" + +#include "thr_lock.h" +#include +#include + +my_bool thr_lock_inited=0; +ulong locks_immediate = 0L, locks_waited = 0L; +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 void (*before_lock_wait)(void)= 0; +static void (*after_lock_wait)(void)= 0; + +void thr_set_lock_wait_callback(void (*before_wait)(void), + void (*after_wait)(void)) +{ + before_lock_wait= before_wait; + after_lock_wait= after_wait; +} + +static inline mysql_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_INFO *rhs, THR_LOCK_INFO *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_INFO *UNINIT_VAR(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) + { + 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 ((int) data->type == (int) 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_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 + { /* Have write lock */ + 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) + { + 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)); + mysql_mutex_init(key_THR_LOCK_mutex, &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; + + mysql_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); + mysql_mutex_unlock(&THR_LOCK_lock); + DBUG_VOID_RETURN; +} + + +void thr_lock_delete(THR_LOCK *lock) +{ + DBUG_ENTER("thr_lock_delete"); + mysql_mutex_lock(&THR_LOCK_lock); + thr_lock_thread_list=list_delete(thr_lock_thread_list,&lock->list); + mysql_mutex_unlock(&THR_LOCK_lock); + mysql_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; +} + + /* 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 +has_old_lock(THR_LOCK_DATA *data, THR_LOCK_INFO *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, ulong lock_wait_timeout) +{ + struct st_my_thread_var *thread_var= my_thread_var; + mysql_cond_t *cond= &thread_var->suspend; + struct timespec wait_timeout; + enum enum_thr_lock_result result= THR_LOCK_ABORTED; + 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, "Waiting for table level lock", + __func__, __FILE__, __LINE__); + + /* + Since before_lock_wait potentially can create more threads to + scheduler work for, we don't want to call the before_lock_wait + callback unless it will really start to wait. + + For similar reasons, we do not want to call before_lock_wait and + after_lock_wait for each lap around the loop, so we restrict + ourselves to call it before_lock_wait once before starting to wait + and once after the thread has exited the wait loop. + */ + if ((!thread_var->abort || in_wait_list) && before_lock_wait) + (*before_lock_wait)(); + + set_timespec(wait_timeout, lock_wait_timeout); + while (!thread_var->abort || in_wait_list) + { + int rc= mysql_cond_timedwait(cond, &data->lock->mutex, &wait_timeout); + /* + 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 */ + } + } + + /* + We call the after_lock_wait callback once the wait loop has + finished. + */ + if (after_lock_wait) + (*after_lock_wait)(); + + 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, 0); + check_locks(data->lock,"got wait_for_lock",0); + } + mysql_mutex_unlock(&data->lock->mutex); + + /* The following must be done after unlock of lock->mutex */ + mysql_mutex_lock(&thread_var->mutex); + thread_var->current_mutex= 0; + thread_var->current_cond= 0; + mysql_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_INFO *owner, + enum thr_lock_type lock_type, ulong lock_wait_timeout) +{ + THR_LOCK *lock=data->lock; + enum enum_thr_lock_result result= THR_LOCK_SUCCESS; + struct st_lock_list *wait_queue; + DBUG_ENTER("thr_lock"); + + data->next=0; + data->cond=0; /* safety */ + data->type=lock_type; + data->owner= owner; /* Must be reset ! */ + mysql_mutex_lock(&lock->mutex); + DBUG_PRINT("lock",("data: 0x%lx thread: 0x%lx lock: 0x%lx type: %d", + (long) data, data->owner->thread_id, + (long) 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 if they are owned by the same + thread or if they satisfy the following lock + compatibility matrix: + + Request + /------- + H|++++ WRITE_ALLOW_WRITE + e|+++- WRITE_CONCURRENT_INSERT + l|++++ WRITE_DELAYED + d |||| + |||\= READ_NO_INSERT + ||\ = READ_HIGH_PRIORITY + |\ = READ_WITH_SHARED_LOCKS + \ = READ + + + + = Request can be satisified. + - = Request cannot be satisified. + + READ_NO_INSERT and WRITE_ALLOW_WRITE should in principle + be incompatible. However this will cause starvation of + LOCK TABLE READ in InnoDB under high write load. + See Bug#42147 for more information. + */ + + DBUG_PRINT("lock",("write locked 1 by thread: 0x%lx", + lock->write.data->owner->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)))) + { /* 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 || + has_old_lock(lock->read.data, data->owner)) /* Has old read lock */ + { /* No important write-locks */ + (*lock->read.last)=data; /* Add to running FIFO */ + data->prev=lock->read.last; + lock->read.last= &data->next; + if (lock->get_status) + (*lock->get_status)(data->status_param, 0); + if (lock_type == TL_READ_NO_INSERT) + lock->read_no_write_count++; + check_locks(lock,"read lock with no write locks",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 (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 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 TL_WRITE_ALLOW_WRITE type. + + Note that, since lock requests for the same table are sorted in + such way that requests with higher thr_lock_type value come first + (with one exception (*)), lock being requested usually (**) has + equal or "weaker" type than one which thread might have already + acquired. + *) The only exception to this rule is case when type of old lock + is TL_WRITE_LOW_PRIORITY and type of new lock is changed inside + of thr_lock() from TL_WRITE_CONCURRENT_INSERT to TL_WRITE since + engine turns out to be not supporting concurrent inserts. + Note that since TL_WRITE has the same compatibility rules as + TL_WRITE_LOW_PRIORITY (their only difference is priority), + it is OK to grant new lock without additional checks in such + situation. + **) The exceptions are situations when: + - when old lock type is TL_WRITE_DELAYED + But these should never happen within MySQL. + Therefore it is OK to allow acquiring write lock on the table if + this thread already holds some write lock on it. + + (INSERT INTO t1 VALUES (f1()), where f1() is stored function which + tries to update t1, is an example of statement which requests two + different types of write lock on the same table). + */ + DBUG_ASSERT(! has_old_lock(lock->write.data, data->owner) || + ((lock_type <= lock->write.data->type || + (lock_type == TL_WRITE && + lock->write.data->type == TL_WRITE_LOW_PRIORITY)) && + lock->write.data->type != TL_WRITE_DELAYED)); + + if ((lock_type == TL_WRITE_ALLOW_WRITE && + ! lock->write_wait.data && + lock->write.data->type == TL_WRITE_ALLOW_WRITE) || + has_old_lock(lock->write.data, data->owner)) + { + /* + We have already got a write lock or all locks are + TL_WRITE_ALLOW_WRITE + */ + DBUG_PRINT("info", ("write_wait.data: 0x%lx old_type: %d", + (ulong) 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 (data->lock->get_status) + (*data->lock->get_status)(data->status_param, 0); + statistic_increment(locks_immediate,&THR_LOCK_lock); + goto end; + } + DBUG_PRINT("lock",("write locked 2 by thread: 0x%lx", + lock->write.data->owner->thread_id)); + } + else + { + DBUG_PRINT("info", ("write_wait.data: 0x%lx", + (ulong) 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 (data->lock->get_status) + (*data->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->thread_id, data->type)); + } + wait_queue= &lock->write_wait; + } + /* Can't get lock yet; Wait for it */ + DBUG_RETURN(wait_for_lock(wait_queue, data, 0, lock_wait_timeout)); +end: + mysql_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 + { + mysql_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->thread_id)); + /* purecov: end */ + data->cond=0; /* Mark thread free */ + mysql_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: 0x%lx thread: 0x%lx lock: 0x%lx", + (long) data, data->owner->thread_id, (long) lock)); + mysql_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_WRITE_CONCURRENT_INSERT) + { + if (lock->update_status) + (*lock->update_status)(data->status_param); + } + else + { + if (lock->restore_status) + (*lock->restore_status)(data->status_param); + } + 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); + mysql_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->thread_id)); + /* purecov: end */ + { + mysql_cond_t *cond= data->cond; + data->cond=0; /* Mark thread free */ + mysql_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 { + mysql_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 */ + mysql_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_INFO *owner, + ulong lock_wait_timeout) +{ + THR_LOCK_DATA **pos,**end; + DBUG_ENTER("thr_multi_lock"); + DBUG_PRINT("lock",("data: 0x%lx count: %d", (long) 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, + lock_wait_timeout); + if (result != THR_LOCK_SUCCESS) + { /* Aborted */ + thr_multi_unlock(data,(uint) (pos-data)); + DBUG_RETURN(result); + } + DEBUG_SYNC_C("thr_multi_lock_after_thr_lock"); +#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: 0x%lx count: %d", (long) 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: 0x%lx thread: 0x%lx lock: 0x%lx", + (long) *pos, (*pos)->owner->thread_id, + (long) (*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"); + mysql_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. */ + mysql_cond_signal(data->cond); + data->cond=0; /* Removed from list */ + } + for (data=lock->write_wait.data; data ; data=data->next) + { + data->type=TL_UNLOCK; + mysql_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; + mysql_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"); + + mysql_mutex_lock(&lock->mutex); + for (data= lock->read_wait.data; data ; data= data->next) + { + if (data->owner->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; + mysql_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->thread_id == thread_id) /* purecov: tested */ + { + DBUG_PRINT("info",("Aborting write-wait lock")); + data->type= TL_UNLOCK; + found= TRUE; + mysql_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); + mysql_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. The normal downgrade variants are: + 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"); + + mysql_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); + + mysql_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, + ulong lock_wait_timeout) +{ + THR_LOCK *lock=data->lock; + DBUG_ENTER("thr_upgrade_write_delay_lock"); + + mysql_mutex_lock(&lock->mutex); + if (data->type == TL_UNLOCK || data->type >= TL_WRITE_LOW_PRIORITY) + { + mysql_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 (data->lock->get_status) + (*data->lock->get_status)(data->status_param, 0); + mysql_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, lock_wait_timeout)); +} + + +/* downgrade a WRITE lock to a WRITE_DELAY lock if there is pending locks */ + +my_bool thr_reschedule_write_lock(THR_LOCK_DATA *data, + ulong lock_wait_timeout) +{ + THR_LOCK *lock=data->lock; + enum thr_lock_type write_lock_type; + DBUG_ENTER("thr_reschedule_write_lock"); + + mysql_mutex_lock(&lock->mutex); + if (!lock->read_wait.data) /* No waiting read locks */ + { + mysql_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); + + mysql_mutex_unlock(&lock->mutex); + DBUG_RETURN(thr_upgrade_write_delay_lock(data, write_lock_type, + lock_wait_timeout)); +} + + +#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->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; + + mysql_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; + mysql_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); + mysql_mutex_unlock(&lock->mutex); + puts(""); + } + fflush(stdout); + mysql_mutex_unlock(&THR_LOCK_lock); +} + + +/***************************************************************************** +** Test of thread locks +****************************************************************************/ + +#ifdef MAIN + +struct st_test { + uint lock_nr; + enum thr_lock_type lock_type; +}; + +THR_LOCK locks[5]; /* 4 locks */ + +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_CONCURRENT_INSERT},{1,TL_WRITE_CONCURRENT_INSERT},{2,TL_WRITE_CONCURRENT_INSERT},{3,TL_WRITE_CONCURRENT_INSERT}}; +struct st_test test_13[] = {{0,TL_WRITE_CONCURRENT_INSERT},{1,TL_READ}}; +struct st_test test_14[] = {{0,TL_WRITE_ALLOW_WRITE},{1,TL_READ}}; +struct st_test test_15[] = {{0,TL_WRITE_ALLOW_WRITE},{1,TL_WRITE_ALLOW_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}; +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) +}; + + +static mysql_cond_t COND_thread_count; +static mysql_mutex_t LOCK_thread_count; +static uint thread_count; +static ulong sum=0; + +#define MAX_LOCK_COUNT 8 +#define TEST_TIMEOUT 100000 + +/* 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_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); + 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], &lock_info, TEST_TIMEOUT); + mysql_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; + } + } + mysql_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(); + mysql_mutex_lock(&LOCK_thread_count); + thread_count--; + mysql_cond_signal(&COND_thread_count); /* Tell main we are ready */ + mysql_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 i,*param,error; + 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= mysql_cond_init(0, &COND_thread_count, NULL))) + { + fprintf(stderr, "Got error: %d from mysql_cond_init (errno: %d)", + error,errno); + exit(1); + } + if ((error= mysql_mutex_init(0, &LOCK_thread_count, MY_MUTEX_INIT_FAST))) + { + fprintf(stderr, "Got error: %d from mysql_cond_init (errno: %d)", + error,errno); + exit(1); + } + + for (i=0 ; i < (int) 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; + } + 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 < (int) array_elements(lock_counts) ; i++) + { + param=(int*) malloc(sizeof(int)); + *param=i; + + if ((error= mysql_mutex_lock(&LOCK_thread_count))) + { + fprintf(stderr, "Got error: %d from mysql_mutex_lock (errno: %d)", + error, errno); + exit(1); + } + if ((error= mysql_thread_create(0, + &tid, &thr_attr, test_thread, + (void*) param))) + { + fprintf(stderr, "Got error: %d from mysql_thread_create (errno: %d)\n", + error, errno); + mysql_mutex_unlock(&LOCK_thread_count); + exit(1); + } + thread_count++; + mysql_mutex_unlock(&LOCK_thread_count); + } + + pthread_attr_destroy(&thr_attr); + if ((error= mysql_mutex_lock(&LOCK_thread_count))) + fprintf(stderr, "Got error: %d from mysql_mutex_lock\n", error); + while (thread_count) + { + if ((error= mysql_cond_wait(&COND_thread_count, &LOCK_thread_count))) + fprintf(stderr, "Got error: %d from mysql_cond_wait\n", error); + } + if ((error= mysql_mutex_unlock(&LOCK_thread_count))) + fprintf(stderr, "Got error: %d from mysql_mutex_unlock\n", error); + for (i=0 ; i < (int) 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; +} + +#endif /* MAIN */ diff --git a/dep/mysqllite/mysys/thr_mutex.c b/dep/mysqllite/mysys/thr_mutex.c index 8f9928026ba3d..37ced4f7633ff 100644 --- a/dep/mysqllite/mysys/thr_mutex.c +++ b/dep/mysqllite/mysys/thr_mutex.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2003 MySQL AB +/* Copyright (C) 2000-2003 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 @@ -19,7 +19,7 @@ #if defined(TARGET_OS_LINUX) && !defined (__USE_UNIX98) #define __USE_UNIX98 /* To get rw locks under Linux */ #endif -#if defined(THREAD) && defined(SAFE_MUTEX) +#if defined(SAFE_MUTEX) #undef SAFE_MUTEX /* Avoid safe_mutex redefinitions */ #include "mysys_priv.h" #include "my_static.h" @@ -39,6 +39,7 @@ #endif #endif /* DO_NOT_REMOVE_THREAD_WRAPPERS */ +/* Not instrumented */ static pthread_mutex_t THR_LOCK_mutex; static ulong safe_mutex_count= 0; /* Number of mutexes created */ #ifdef SAFE_MUTEX_DETECT_DESTROY @@ -85,7 +86,9 @@ int safe_mutex_init(safe_mutex_t *mp, pthread_mutex_unlock(&THR_LOCK_mutex); } #else - thread_safe_increment(safe_mutex_count, &THR_LOCK_mutex); + pthread_mutex_lock(&THR_LOCK_mutex); + safe_mutex_count++; + pthread_mutex_unlock(&THR_LOCK_mutex); #endif /* SAFE_MUTEX_DETECT_DESTROY */ return 0; } @@ -259,8 +262,8 @@ int safe_cond_wait(pthread_cond_t *cond, safe_mutex_t *mp, const char *file, int safe_cond_timedwait(pthread_cond_t *cond, safe_mutex_t *mp, - struct timespec *abstime, - const char *file, uint line) + const struct timespec *abstime, + const char *file, uint line) { int error; pthread_mutex_lock(&mp->global); @@ -344,7 +347,9 @@ int safe_mutex_destroy(safe_mutex_t *mp, const char *file, uint line) mp->info= NULL; /* Get crash if double free */ } #else - thread_safe_sub(safe_mutex_count, 1, &THR_LOCK_mutex); + pthread_mutex_lock(&THR_LOCK_mutex); + safe_mutex_count--; + pthread_mutex_unlock(&THR_LOCK_mutex); #endif /* SAFE_MUTEX_DETECT_DESTROY */ return error; } @@ -390,9 +395,9 @@ void safe_mutex_end(FILE *file __attribute__((unused))) #endif /* SAFE_MUTEX_DETECT_DESTROY */ } -#endif /* THREAD && SAFE_MUTEX */ +#endif /* SAFE_MUTEX */ -#if defined(THREAD) && defined(MY_PTHREAD_FASTMUTEX) && !defined(SAFE_MUTEX) +#if defined(MY_PTHREAD_FASTMUTEX) && !defined(SAFE_MUTEX) #include "mysys_priv.h" #include "my_static.h" @@ -495,4 +500,4 @@ void fastmutex_global_init(void) #endif } -#endif /* defined(THREAD) && defined(MY_PTHREAD_FASTMUTEX) && !defined(SAFE_MUTEX) */ +#endif /* defined(MY_PTHREAD_FASTMUTEX) && !defined(SAFE_MUTEX) */ diff --git a/dep/mysqllite/mysys/thr_rwlock.c b/dep/mysqllite/mysys/thr_rwlock.c new file mode 100644 index 0000000000000..bad80b43eef1b --- /dev/null +++ b/dep/mysqllite/mysys/thr_rwlock.c @@ -0,0 +1,472 @@ +/* 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(NEED_MY_RW_LOCK) +#include + +#ifdef _WIN32 + +static BOOL have_srwlock= FALSE; +/* Prototypes and function pointers for windows functions */ +typedef VOID (WINAPI* srw_func) (PSRWLOCK SRWLock); +typedef BOOL (WINAPI* srw_bool_func) (PSRWLOCK SRWLock); + +static srw_func my_InitializeSRWLock; +static srw_func my_AcquireSRWLockExclusive; +static srw_func my_ReleaseSRWLockExclusive; +static srw_func my_AcquireSRWLockShared; +static srw_func my_ReleaseSRWLockShared; + +static srw_bool_func my_TryAcquireSRWLockExclusive; +static srw_bool_func my_TryAcquireSRWLockShared; + +/** + Check for presence of Windows slim reader writer lock function. + Load function pointers. +*/ + +static void check_srwlock_availability(void) +{ + HMODULE module= GetModuleHandle("kernel32"); + + my_InitializeSRWLock= (srw_func) GetProcAddress(module, + "InitializeSRWLock"); + my_AcquireSRWLockExclusive= (srw_func) GetProcAddress(module, + "AcquireSRWLockExclusive"); + my_AcquireSRWLockShared= (srw_func) GetProcAddress(module, + "AcquireSRWLockShared"); + my_ReleaseSRWLockExclusive= (srw_func) GetProcAddress(module, + "ReleaseSRWLockExclusive"); + my_ReleaseSRWLockShared= (srw_func) GetProcAddress(module, + "ReleaseSRWLockShared"); + my_TryAcquireSRWLockExclusive= (srw_bool_func) GetProcAddress(module, + "TryAcquireSRWLockExclusive"); + my_TryAcquireSRWLockShared= (srw_bool_func) GetProcAddress(module, + "TryAcquireSRWLockShared"); + + /* + We currently require TryAcquireSRWLockExclusive. This API is missing on + Vista, this means SRWLock are only used starting with Win7. + + If "trylock" usage for rwlocks is eliminated from server codebase (it is used + in a single place currently, in query cache), then SRWLock can be enabled on + Vista too. In this case condition below needs to be changed to e.g check + for my_InitializeSRWLock. + */ + + if (my_TryAcquireSRWLockExclusive) + have_srwlock= TRUE; + +} + + +static int srw_init(my_rw_lock_t *rwp) +{ + my_InitializeSRWLock(&rwp->srwlock); + rwp->have_exclusive_srwlock = FALSE; + return 0; +} + + +static int srw_rdlock(my_rw_lock_t *rwp) +{ + my_AcquireSRWLockShared(&rwp->srwlock); + return 0; +} + + +static int srw_tryrdlock(my_rw_lock_t *rwp) +{ + + if (!my_TryAcquireSRWLockShared(&rwp->srwlock)) + return EBUSY; + return 0; +} + + +static int srw_wrlock(my_rw_lock_t *rwp) +{ + my_AcquireSRWLockExclusive(&rwp->srwlock); + rwp->have_exclusive_srwlock= TRUE; + return 0; +} + + +static int srw_trywrlock(my_rw_lock_t *rwp) +{ + if (!my_TryAcquireSRWLockExclusive(&rwp->srwlock)) + return EBUSY; + rwp->have_exclusive_srwlock= TRUE; + return 0; +} + + +static int srw_unlock(my_rw_lock_t *rwp) +{ + if (rwp->have_exclusive_srwlock) + { + rwp->have_exclusive_srwlock= FALSE; + my_ReleaseSRWLockExclusive(&rwp->srwlock); + } + else + { + my_ReleaseSRWLockShared(&rwp->srwlock); + } + return 0; +} + +#endif /*_WIN32 */ + +/* + 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_rw_init(my_rw_lock_t *rwp) +{ + pthread_condattr_t cond_attr; + +#ifdef _WIN32 + /* + Once initialization is used here rather than in my_init(), in order to + - avoid my_init() pitfalls- (undefined order in which initialization should + run) + - be potentially useful C++ (static constructors) + - just to simplify the API. + Also, the overhead is of my_pthread_once is very small. + */ + static my_pthread_once_t once_control= MY_PTHREAD_ONCE_INIT; + my_pthread_once(&once_control, check_srwlock_availability); + + if (have_srwlock) + return srw_init(rwp); +#endif + + 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; +#ifdef SAFE_MUTEX + rwp->write_thread = 0; +#endif + + return(0); +} + + +int my_rw_destroy(my_rw_lock_t *rwp) +{ +#ifdef _WIN32 + if (have_srwlock) + return 0; /* no destroy function */ +#endif + DBUG_ASSERT(rwp->state == 0); + pthread_mutex_destroy( &rwp->lock ); + pthread_cond_destroy( &rwp->readers ); + pthread_cond_destroy( &rwp->writers ); + return(0); +} + + +int my_rw_rdlock(my_rw_lock_t *rwp) +{ +#ifdef _WIN32 + if (have_srwlock) + return srw_rdlock(rwp); +#endif + + 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(my_rw_lock_t *rwp) +{ + int res; + +#ifdef _WIN32 + if (have_srwlock) + return srw_tryrdlock(rwp); +#endif + + 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(my_rw_lock_t *rwp) +{ +#ifdef _WIN32 + if (have_srwlock) + return srw_wrlock(rwp); +#endif + + pthread_mutex_lock(&rwp->lock); + rwp->waiters++; /* another writer queued */ + + my_rw_lock_assert_not_write_owner(rwp); + + while (rwp->state) + pthread_cond_wait(&rwp->writers, &rwp->lock); + rwp->state = -1; + rwp->waiters--; +#ifdef SAFE_MUTEX + rwp->write_thread= pthread_self(); +#endif + pthread_mutex_unlock(&rwp->lock); + return(0); +} + + +int my_rw_trywrlock(my_rw_lock_t *rwp) +{ + int res; + +#ifdef _WIN32 + if (have_srwlock) + return srw_trywrlock(rwp); +#endif + + pthread_mutex_lock(&rwp->lock); + if (rwp->state) + res= EBUSY; /* Can't get lock */ + else + { + res=0; + rwp->state = -1; +#ifdef SAFE_MUTEX + rwp->write_thread= pthread_self(); +#endif + } + pthread_mutex_unlock(&rwp->lock); + return(res); +} + + +int my_rw_unlock(my_rw_lock_t *rwp) +{ +#ifdef _WIN32 + if (have_srwlock) + return srw_unlock(rwp); +#endif + + DBUG_PRINT("rw_unlock", + ("state: %d waiters: %d", rwp->state, rwp->waiters)); + pthread_mutex_lock(&rwp->lock); + + DBUG_ASSERT(rwp->state != 0); + + if (rwp->state == -1) /* writer releasing */ + { + my_rw_lock_assert_write_owner(rwp); + rwp->state= 0; /* mark as available */ +#ifdef SAFE_MUTEX + rwp->write_thread= 0; +#endif + + if ( rwp->waiters ) /* writers queued */ + pthread_cond_signal( &rwp->writers ); + else + pthread_cond_broadcast( &rwp->readers ); + } + else + { + if ( --rwp->state == 0 && /* no more readers */ + rwp->waiters) + pthread_cond_signal( &rwp->writers ); + } + + pthread_mutex_unlock( &rwp->lock ); + return(0); +} + +#endif /* defined(NEED_MY_RW_LOCK) */ + + +int rw_pr_init(rw_pr_lock_t *rwlock) +{ + pthread_mutex_init(&rwlock->lock, NULL); + pthread_cond_init(&rwlock->no_active_readers, NULL); + rwlock->active_readers= 0; + rwlock->writers_waiting_readers= 0; + rwlock->active_writer= FALSE; +#ifdef SAFE_MUTEX + rwlock->writer_thread= 0; +#endif + return 0; +} + + +int rw_pr_destroy(rw_pr_lock_t *rwlock) +{ + pthread_cond_destroy(&rwlock->no_active_readers); + pthread_mutex_destroy(&rwlock->lock); + return 0; +} + + +int rw_pr_rdlock(rw_pr_lock_t *rwlock) +{ + pthread_mutex_lock(&rwlock->lock); + /* + The fact that we were able to acquire 'lock' mutex means + that there are no active writers and we can acquire rd-lock. + Increment active readers counter to prevent requests for + wr-lock from succeeding and unlock mutex. + */ + rwlock->active_readers++; + pthread_mutex_unlock(&rwlock->lock); + return 0; +} + + +int rw_pr_wrlock(rw_pr_lock_t *rwlock) +{ + pthread_mutex_lock(&rwlock->lock); + + if (rwlock->active_readers != 0) + { + /* There are active readers. We have to wait until they are gone. */ + rwlock->writers_waiting_readers++; + + while (rwlock->active_readers != 0) + pthread_cond_wait(&rwlock->no_active_readers, &rwlock->lock); + + rwlock->writers_waiting_readers--; + } + + /* + We own 'lock' mutex so there is no active writers. + Also there are no active readers. + This means that we can grant wr-lock. + Not releasing 'lock' mutex until unlock will block + both requests for rd and wr-locks. + Set 'active_writer' flag to simplify unlock. + + Thanks to the fact wr-lock/unlock in the absence of + contention from readers is essentially mutex lock/unlock + with a few simple checks make this rwlock implementation + wr-lock optimized. + */ + rwlock->active_writer= TRUE; +#ifdef SAFE_MUTEX + rwlock->writer_thread= pthread_self(); +#endif + return 0; +} + + +int rw_pr_unlock(rw_pr_lock_t *rwlock) +{ + if (rwlock->active_writer) + { + /* We are unlocking wr-lock. */ +#ifdef SAFE_MUTEX + rwlock->writer_thread= 0; +#endif + rwlock->active_writer= FALSE; + if (rwlock->writers_waiting_readers) + { + /* + Avoid expensive cond signal in case when there is no contention + or it is wr-only. + + Note that from view point of performance it would be better to + signal on the condition variable after unlocking mutex (as it + reduces number of contex switches). + + Unfortunately this would mean that such rwlock can't be safely + used by MDL subsystem, which relies on the fact that it is OK + to destroy rwlock once it is in unlocked state. + */ + pthread_cond_signal(&rwlock->no_active_readers); + } + pthread_mutex_unlock(&rwlock->lock); + } + else + { + /* We are unlocking rd-lock. */ + pthread_mutex_lock(&rwlock->lock); + rwlock->active_readers--; + if (rwlock->active_readers == 0 && + rwlock->writers_waiting_readers) + { + /* + If we are last reader and there are waiting + writers wake them up. + */ + pthread_cond_signal(&rwlock->no_active_readers); + } + pthread_mutex_unlock(&rwlock->lock); + } + return 0; +} + + diff --git a/dep/mysqllite/mysys/tree.c b/dep/mysqllite/mysys/tree.c new file mode 100644 index 0000000000000..8ea7102ed4c49 --- /dev/null +++ b/dep/mysqllite/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: 0x%lx size: %d", (long) 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: 0x%lx", (long) 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(element); + } +} + + +/* + 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(element); + 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/dep/mysqllite/mysys/typelib.c b/dep/mysqllite/mysys/typelib.c index cb72c91e20df1..7681ff581ac1e 100644 --- a/dep/mysqllite/mysys/typelib.c +++ b/dep/mysqllite/mysys/typelib.c @@ -20,7 +20,7 @@ #include -static const char field_separator=','; +#define is_field_separator(X) ((X) == ',' || (X) == '=') int find_type_or_exit(const char *x, TYPELIB *typelib, const char *option) { @@ -44,26 +44,26 @@ int find_type_or_exit(const char *x, TYPELIB *typelib, const char *option) } -/* +/** 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 + @param x String to find + @param lib TYPELIB (struct of pointer to values + count) + @param 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 + + @note + If part, uniq field is found and full_name == 0 then x is expanded + to full field. + + @retval + -1 Too many matching values + @retval + 0 No matching value + @retval >0 Offset+1 in typelib for matched string */ @@ -86,17 +86,17 @@ int find_type(char *x, const TYPELIB *typelib, uint full_name) for (pos=0 ; (j=typelib->type_names[pos]) ; pos++) { for (i=x ; - *i && (!(full_name & 8) || *i != field_separator) && + *i && (!(full_name & 8) || !is_field_separator(*i)) && 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)) + if (! *i || ((full_name & 8) && is_field_separator(*i))) DBUG_RETURN(pos+1); } - if ((!*i && (!(full_name & 8) || *i != field_separator)) && + if ((!*i && (!(full_name & 8) || !is_field_separator(*i))) && (!*j || !(full_name & 1))) { find++; @@ -122,8 +122,12 @@ int find_type(char *x, const TYPELIB *typelib, uint full_name) } /* find_type */ - /* Get name of type nr 'nr' */ - /* Warning first type is 1, 0 = empty field */ +/** + Get name of type nr + + @note + first type is 1, 0 = empty field +*/ void make_type(register char * to, register uint nr, register TYPELIB *typelib) @@ -137,8 +141,12 @@ void make_type(register char * to, register uint nr, } /* make_type */ - /* Get type */ - /* Warning first type is 0 */ +/** + Get type + + @note + first type is 0 +*/ const char *get_type(TYPELIB *typelib, uint nr) { @@ -148,18 +156,16 @@ const char *get_type(TYPELIB *typelib, uint nr) } -/* +/** 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 + @param x string to decompose + @param lib TYPELIB (struct of pointer to values + count) + @param err index (not char position) of string element which was not found or 0 if there was no error - RETURN + @retval a integer representation of the supplied string */ @@ -182,9 +188,9 @@ my_ulonglong find_typeset(char *x, TYPELIB *lib, int *err) { (*err)++; i= x; - while (*x && *x != field_separator) + while (*x && !is_field_separator(*x)) x++; - if (x[0] && x[1]) /* skip separator if found */ + if (x[0] && x[1]) /* skip separator if found */ x++; if ((find= find_type(i, lib, 2 | 8) - 1) < 0) DBUG_RETURN(0); @@ -195,16 +201,15 @@ my_ulonglong find_typeset(char *x, TYPELIB *lib, int *err) } /* 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 + @param root pointer to a MEM_ROOT object for allocations + @param from pointer to a source TYPELIB structure - RETURN - pointer to the new TYPELIB structure on successful copy, or + @retval + pointer to the new TYPELIB structure on successful copy + @retval NULL otherwise */ @@ -244,3 +249,140 @@ TYPELIB *copy_typelib(MEM_ROOT *root, TYPELIB *from) return to; } + + +static const char *on_off_default_names[]= { "off","on","default", 0}; +static TYPELIB on_off_default_typelib= {array_elements(on_off_default_names)-1, + "", on_off_default_names, 0}; + +/** + Parse a TYPELIB name from the buffer + + @param lib Set of names to scan for. + @param strpos INOUT Start of the buffer (updated to point to the next + character after the name) + @param end End of the buffer + + @note + The buffer is assumed to contain one of the names specified in the TYPELIB, + followed by comma, '=', or end of the buffer. + + @retval + 0 No matching name + @retval + >0 Offset+1 in typelib for matched name +*/ + +static uint parse_name(const TYPELIB *lib, const char **strpos, const char *end) +{ + const char *pos= *strpos; + uint find= find_type((char*)pos, lib, 8); + for (; pos != end && *pos != '=' && *pos !=',' ; pos++); + *strpos= pos; + return find; +} + +/** + Parse and apply a set of flag assingments + + @param lib Flag names + @param default_name Number of "default" in the typelib + @param cur_set Current set of flags (start from this state) + @param default_set Default set of flags (use this for assign-default + keyword and flag=default assignments) + @param str String to be parsed + @param length Length of the string + @param err_pos OUT If error, set to point to start of wrong set string + NULL on success + @param err_len OUT If error, set to the length of wrong set string + + @details + Parse a set of flag assignments, that is, parse a string in form: + + param_name1=value1,param_name2=value2,... + + where the names are specified in the TYPELIB, and each value can be + either 'on','off', or 'default'. Setting the same name twice is not + allowed. + + Besides param=val assignments, we support the "default" keyword (keyword + #default_name in the typelib). It can be used one time, if specified it + causes us to build the new set over the default_set rather than cur_set + value. + + @note + it's not charset aware + + @retval + Parsed set value if (*errpos == NULL), otherwise undefined +*/ + +my_ulonglong find_set_from_flags(const TYPELIB *lib, uint default_name, + my_ulonglong cur_set, my_ulonglong default_set, + const char *str, uint length, + char **err_pos, uint *err_len) +{ + const char *end= str + length; + my_ulonglong flags_to_set= 0, flags_to_clear= 0, res; + my_bool set_defaults= 0; + + *err_pos= 0; /* No error yet */ + if (str != end) + { + const char *start= str; + for (;;) + { + const char *pos= start; + uint flag_no, value; + + if (!(flag_no= parse_name(lib, &pos, end))) + goto err; + + if (flag_no == default_name) + { + /* Using 'default' twice isn't allowed. */ + if (set_defaults) + goto err; + set_defaults= TRUE; + } + else + { + my_ulonglong bit= (1ULL << (flag_no - 1)); + /* parse the '=on|off|default' */ + if ((flags_to_clear | flags_to_set) & bit || + pos >= end || *pos++ != '=' || + !(value= parse_name(&on_off_default_typelib, &pos, end))) + goto err; + + if (value == 1) /* this is '=off' */ + flags_to_clear|= bit; + else if (value == 2) /* this is '=on' */ + flags_to_set|= bit; + else /* this is '=default' */ + { + if (default_set & bit) + flags_to_set|= bit; + else + flags_to_clear|= bit; + } + } + if (pos >= end) + break; + + if (*pos++ != ',') + goto err; + + start=pos; + continue; + err: + *err_pos= (char*)start; + *err_len= end - start; + break; + } + } + res= set_defaults? default_set : cur_set; + res|= flags_to_set; + res&= ~flags_to_clear; + return res; +} + diff --git a/dep/mysqllite/sql-common/client.c b/dep/mysqllite/sql-common/client.c index 1b7723ce0a5df..354c04b717b45 100644 --- a/dep/mysqllite/sql-common/client.c +++ b/dep/mysqllite/sql-common/client.c @@ -24,7 +24,6 @@ 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 @@ -38,6 +37,10 @@ #include "mysql.h" +#ifndef __WIN__ +#include +#endif + /* Remove client convenience wrappers */ #undef max_allowed_packet #undef net_buffer_length @@ -66,9 +69,9 @@ my_bool net_flush(NET *net); #include "mysqld_error.h" #include "errmsg.h" #include -#if defined(THREAD) && !defined(__WIN__) +#if !defined(__WIN__) #include /* because of signal() */ -#endif /* defined(THREAD) && !defined(__WIN__) */ +#endif /* !defined(__WIN__) */ #include #include @@ -76,7 +79,7 @@ my_bool net_flush(NET *net); #ifdef HAVE_PWD_H #include #endif -#if !defined(MSDOS) && !defined(__WIN__) +#if !defined(__WIN__) #include #include #include @@ -87,12 +90,12 @@ my_bool net_flush(NET *net); #ifdef HAVE_SYS_SELECT_H #include #endif -#endif /*!defined(MSDOS) && !defined(__WIN__) */ +#endif /* !defined(__WIN__) */ #ifdef HAVE_SYS_UN_H # include #endif -#if defined(MSDOS) || defined(__WIN__) +#if defined(__WIN__) #define perror(A) #else #include @@ -107,6 +110,10 @@ my_bool net_flush(NET *net); #include "client_settings.h" #include +#include +#define native_password_plugin_name "mysql_native_password" +#define old_password_plugin_name "mysql_old_password" + uint mysql_port=0; char *mysql_unix_port= 0; @@ -122,7 +129,7 @@ static void mysql_close_free_options(MYSQL *mysql); static void mysql_close_free(MYSQL *mysql); static void mysql_prune_stmt_list(MYSQL *mysql); -#if !(defined(__WIN__) || defined(__NETWARE__)) +#if !defined(__WIN__) static int wait_for_data(my_socket fd, uint timeout); #endif @@ -144,10 +151,13 @@ char mysql_server_last_error[MYSQL_ERRMSG_SIZE]; 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); +#if defined(__WIN__) + DBUG_ENTER("my_connect"); + DBUG_RETURN(connect(fd, (struct sockaddr*) name, namelen)); #else int flags, res, s_err; + DBUG_ENTER("my_connect"); + DBUG_PRINT("enter", ("fd: %d timeout: %u", fd, timeout)); /* If they passed us a timeout of zero, we should behave @@ -155,24 +165,26 @@ int my_connect(my_socket fd, const struct sockaddr *name, uint namelen, */ if (timeout == 0) - return connect(fd, (struct sockaddr*) name, namelen); + DBUG_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 + DBUG_PRINT("info", ("connecting non-blocking")); res= connect(fd, (struct sockaddr*) name, namelen); + DBUG_PRINT("info", ("connect result: %d errno: %d", res, errno)); s_err= errno; /* Save the error... */ fcntl(fd, F_SETFL, flags); if ((res != 0) && (s_err != EINPROGRESS)) { errno= s_err; /* Restore it */ - return(-1); + DBUG_RETURN(-1); } if (res == 0) /* Connected quickly! */ - return(0); - return wait_for_data(fd, timeout); + DBUG_RETURN(0); + DBUG_RETURN(wait_for_data(fd, timeout)); #endif } @@ -184,33 +196,65 @@ int my_connect(my_socket fd, const struct sockaddr *name, uint namelen, If not, we will use select() */ -#if !(defined(__WIN__) || defined(__NETWARE__)) +#if !defined(__WIN__) static int wait_for_data(my_socket fd, uint timeout) { #ifdef HAVE_POLL struct pollfd ufds; int res; + DBUG_ENTER("wait_for_data"); + DBUG_PRINT("info", ("polling")); ufds.fd= fd; ufds.events= POLLIN | POLLPRI; if (!(res= poll(&ufds, 1, (int) timeout*1000))) { + DBUG_PRINT("info", ("poll timed out")); errno= EINTR; - return -1; + DBUG_RETURN(-1); } + DBUG_PRINT("info", + ("poll result: %d errno: %d revents: 0x%02d events: 0x%02d", + res, errno, ufds.revents, ufds.events)); if (res < 0 || !(ufds.revents & (POLLIN | POLLPRI))) - return -1; - return 0; + DBUG_RETURN(-1); + /* + At this point, we know that something happened on the socket. + But this does not means that everything is alright. + The connect might have failed. We need to retrieve the error code + from the socket layer. We must return success only if we are sure + that it was really a success. Otherwise we might prevent the caller + from trying another address to connect to. + */ + { + int s_err; + socklen_t s_len= sizeof(s_err); + + DBUG_PRINT("info", ("Get SO_ERROR from non-blocked connected socket.")); + res= getsockopt(fd, SOL_SOCKET, SO_ERROR, &s_err, &s_len); + DBUG_PRINT("info", ("getsockopt res: %d s_err: %d", res, s_err)); + if (res) + DBUG_RETURN(res); + /* getsockopt() was successful, check the retrieved status value. */ + if (s_err) + { + errno= s_err; + DBUG_RETURN(-1); + } + /* Status from connect() is zero. Socket is successfully connected. */ + } + DBUG_RETURN(0); #else SOCKOPT_OPTLEN_TYPE s_err_size = sizeof(uint); fd_set sfds; struct timeval tv; time_t start_time, now_time; int res, s_err; + DBUG_ENTER("wait_for_data"); if (fd >= FD_SETSIZE) /* Check if wrong error */ - return 0; /* Can't use timeout */ + DBUG_RETURN(0); /* Can't use timeout */ /* Our connection is "in progress." We can use the select() call to wait @@ -242,7 +286,7 @@ static int wait_for_data(my_socket fd, uint timeout) { tv.tv_sec = (long) timeout; tv.tv_usec = 0; -#if defined(HPUX10) && defined(THREAD) +#if defined(HPUX10) if ((res = select(fd+1, NULL, (int*) &sfds, NULL, &tv)) > 0) break; #else @@ -250,11 +294,11 @@ static int wait_for_data(my_socket fd, uint timeout) break; #endif if (res == 0) /* timeout */ - return -1; + DBUG_RETURN(-1); now_time= my_time(0); timeout-= (uint) (now_time - start_time); if (errno != EINTR || (int) timeout <= 0) - return -1; + DBUG_RETURN(-1); } /* @@ -265,17 +309,17 @@ static int wait_for_data(my_socket fd, uint timeout) s_err=0; if (getsockopt(fd, SOL_SOCKET, SO_ERROR, (char*) &s_err, &s_err_size) != 0) - return(-1); + DBUG_RETURN(-1); if (s_err) { /* getsockopt could succeed */ errno = s_err; - return(-1); /* but return an error... */ + DBUG_RETURN(-1); /* but return an error... */ } - return (0); /* ok */ + DBUG_RETURN(0); /* ok */ #endif /* HAVE_POLL */ } -#endif /* defined(__WIN__) || defined(__NETWARE__) */ +#endif /* !defined(__WIN__) */ /** Set the internal error message to mysql handler @@ -332,7 +376,7 @@ void net_clear_error(NET *net) @param ... variable number of arguments */ -static void set_mysql_extended_error(MYSQL *mysql, int errcode, +void set_mysql_extended_error(MYSQL *mysql, int errcode, const char *sqlstate, const char *format, ...) { @@ -647,8 +691,7 @@ HANDLE create_shared_memory(MYSQL *mysql,NET *net, uint connect_timeout) CloseHandle(handle_file_map); } err: - if (tmp) - my_free(tmp, MYF(0)); + my_free(tmp); if (error_allow) error_code = GetLastError(); if (event_connect_request) @@ -673,23 +716,23 @@ HANDLE create_shared_memory(MYSQL *mysql,NET *net, uint connect_timeout) } #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) { @@ -757,7 +800,7 @@ void free_rows(MYSQL_DATA *cur) if (cur) { free_root(&cur->alloc,MYF(0)); - my_free((uchar*) cur,MYF(0)); + my_free(cur); } } @@ -769,13 +812,9 @@ cli_advanced_command(MYSQL *mysql, enum enum_server_command command, { 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) @@ -824,7 +863,6 @@ cli_advanced_command(MYSQL *mysql, enum enum_server_command command, 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); } @@ -842,31 +880,132 @@ void free_old_query(MYSQL *mysql) 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) +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")); - for (;;) + + 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) { - ulong pkt_len; - if ((pkt_len=cli_safe_read(mysql)) == packet_error) - break; - if (pkt_len <= 8 && mysql->net.read_pos[0] == 254) + my_bool is_ok_packet; + if (opt_flush_ok_packet(mysql, &is_ok_packet)) + DBUG_VOID_RETURN; /* An error occurred. */ + if (is_ok_packet) { - 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; - } - break; /* End of data */ + /* + 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; } @@ -940,14 +1079,11 @@ void end_server(MYSQL *mysql) DBUG_ENTER("end_server"); if (mysql->net.vio != 0) { - init_sigpipe_variables DBUG_PRINT("info",("Net: %s", vio_description(mysql->net.vio))); #ifdef MYSQL_SERVER slave_io_thread_detach_vio(); #endif - set_sigpipe(mysql); vio_delete(mysql->net.vio); - reset_sigpipe(mysql); mysql->net.vio= 0; /* Marker */ mysql_prune_stmt_list(mysql); } @@ -972,7 +1108,7 @@ mysql_free_result(MYSQL_RES *result) mysql->unbuffered_fetch_owner= 0; if (mysql->status == MYSQL_STATUS_USE_RESULT) { - (*mysql->methods->flush_use_result)(mysql); + (*mysql->methods->flush_use_result)(mysql, FALSE); mysql->status=MYSQL_STATUS_READY; if (mysql->unbuffered_fetch_owner) *mysql->unbuffered_fetch_owner= TRUE; @@ -981,9 +1117,8 @@ mysql_free_result(MYSQL_RES *result) 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)); + my_free(result->row); + my_free(result); } DBUG_VOID_RETURN; } @@ -999,12 +1134,22 @@ static const char *default_options[]= "ssl-key" ,"ssl-cert" ,"ssl-ca" ,"ssl-capath", "character-sets-dir", "default-character-set", "interactive-timeout", "connect-timeout", "local-infile", "disable-local-infile", - "replication-probe", "enable-reads-from-master", "repl-parse-query", "ssl-cipher", "max-allowed-packet", "protocol", "shared-memory-base-name", "multi-results", "multi-statements", "multi-queries", "secure-auth", - "report-data-truncation", + "report-data-truncation", "plugin-dir", "default-auth", NullS }; +enum option_id { + OPT_port=1, OPT_socket, OPT_compress, OPT_password, OPT_pipe, OPT_timeout, OPT_user, + OPT_init_command, OPT_host, OPT_database, OPT_debug, OPT_return_found_rows, + OPT_ssl_key, OPT_ssl_cert, OPT_ssl_ca, OPT_ssl_capath, + OPT_character_sets_dir, OPT_default_character_set, OPT_interactive_timeout, + OPT_connect_timeout, OPT_local_infile, OPT_disable_local_infile, + OPT_replication_probe, OPT_enable_reads_from_master, OPT_repl_parse_query, + OPT_ssl_cipher, OPT_max_allowed_packet, OPT_protocol, OPT_shared_memory_base_name, + OPT_multi_results, OPT_multi_statements, OPT_multi_queries, OPT_secure_auth, + OPT_report_data_truncation, OPT_plugin_dir, OPT_default_auth, +}; static TYPELIB option_types={array_elements(default_options)-1, "options",default_options, NULL}; @@ -1022,19 +1167,28 @@ static int add_init_command(struct st_mysql_options *options, const char *cmd) { options->init_commands= (DYNAMIC_ARRAY*)my_malloc(sizeof(DYNAMIC_ARRAY), MYF(MY_WME)); - init_dynamic_array(options->init_commands,sizeof(char*),0,5 CALLER_INFO); + init_dynamic_array(options->init_commands,sizeof(char*),0,5); } if (!(tmp= my_strdup(cmd,MYF(MY_WME))) || insert_dynamic(options->init_commands, (uchar*)&tmp)) { - my_free(tmp, MYF(MY_ALLOW_ZERO_PTR)); + my_free(tmp); return 1; } return 0; } +#define EXTENSION_SET_STRING(OPTS, X, STR) \ + if ((OPTS)->extension) \ + my_free((OPTS)->extension->X); \ + else \ + (OPTS)->extension= (struct st_mysql_options_extention *) \ + my_malloc(sizeof(struct st_mysql_options_extention), \ + MYF(MY_WME | MY_ZEROFILL)); \ + (OPTS)->extension->X= my_strdup((STR), MYF(MY_WME)); + void mysql_read_default_options(struct st_mysql_options *options, const char *filename,const char *group) { @@ -1053,6 +1207,8 @@ void mysql_read_default_options(struct st_mysql_options *options, 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] == '-') { @@ -1067,134 +1223,121 @@ void mysql_read_default_options(struct st_mysql_options *options, for (end= *option ; *(end= strcend(end,'_')) ; ) *end= '-'; switch (find_type(*option+2,&option_types,2)) { - case 1: /* port */ + case OPT_port: if (opt_arg) options->port=atoi(opt_arg); break; - case 2: /* socket */ + case OPT_socket: if (opt_arg) { - my_free(options->unix_socket,MYF(MY_ALLOW_ZERO_PTR)); + my_free(options->unix_socket); options->unix_socket=my_strdup(opt_arg,MYF(MY_WME)); } break; - case 3: /* compress */ + case OPT_compress: options->compress=1; options->client_flag|= CLIENT_COMPRESS; break; - case 4: /* password */ + case OPT_password: if (opt_arg) { - my_free(options->password,MYF(MY_ALLOW_ZERO_PTR)); + my_free(options->password); options->password=my_strdup(opt_arg,MYF(MY_WME)); } break; - case 5: + case OPT_pipe: options->protocol = MYSQL_PROTOCOL_PIPE; - case 20: /* connect_timeout */ - case 6: /* timeout */ + case OPT_connect_timeout: + case OPT_timeout: if (opt_arg) options->connect_timeout=atoi(opt_arg); break; - case 7: /* user */ + case OPT_user: if (opt_arg) { - my_free(options->user,MYF(MY_ALLOW_ZERO_PTR)); + my_free(options->user); options->user=my_strdup(opt_arg,MYF(MY_WME)); } break; - case 8: /* init-command */ + case OPT_init_command: add_init_command(options,opt_arg); break; - case 9: /* host */ + case OPT_host: if (opt_arg) { - my_free(options->host,MYF(MY_ALLOW_ZERO_PTR)); + my_free(options->host); options->host=my_strdup(opt_arg,MYF(MY_WME)); } break; - case 10: /* database */ + case OPT_database: if (opt_arg) { - my_free(options->db,MYF(MY_ALLOW_ZERO_PTR)); + my_free(options->db); options->db=my_strdup(opt_arg,MYF(MY_WME)); } break; - case 11: /* debug */ + case OPT_debug: #ifdef MYSQL_CLIENT mysql_debug(opt_arg ? opt_arg : "d:t:o,/tmp/client.trace"); break; #endif - case 12: /* return-found-rows */ + case OPT_return_found_rows: options->client_flag|=CLIENT_FOUND_ROWS; break; -#ifdef HAVE_OPENSSL - case 13: /* ssl_key */ - my_free(options->ssl_key, MYF(MY_ALLOW_ZERO_PTR)); +#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY) + case OPT_ssl_key: + my_free(options->ssl_key); 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)); + case OPT_ssl_cert: + my_free(options->ssl_cert); 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)); + case OPT_ssl_ca: + my_free(options->ssl_ca); 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)); + case OPT_ssl_capath: + my_free(options->ssl_capath); options->ssl_capath = my_strdup(opt_arg, MYF(MY_WME)); break; - case 26: /* ssl_cipher */ - my_free(options->ssl_cipher, MYF(MY_ALLOW_ZERO_PTR)); + case OPT_ssl_cipher: + my_free(options->ssl_cipher); options->ssl_cipher= my_strdup(opt_arg, MYF(MY_WME)); break; #else - case 13: /* Ignore SSL options */ - case 14: - case 15: - case 16: - case 26: + case OPT_ssl_key: + case OPT_ssl_cert: + case OPT_ssl_ca: + case OPT_ssl_capath: + case OPT_ssl_cipher: break; -#endif /* HAVE_OPENSSL */ - case 17: /* charset-lib */ - my_free(options->charset_dir,MYF(MY_ALLOW_ZERO_PTR)); +#endif /* HAVE_OPENSSL && !EMBEDDED_LIBRARY */ + case OPT_character_sets_dir: + my_free(options->charset_dir); options->charset_dir = my_strdup(opt_arg, MYF(MY_WME)); break; - case 18: - my_free(options->charset_name,MYF(MY_ALLOW_ZERO_PTR)); + case OPT_default_character_set: + my_free(options->charset_name); options->charset_name = my_strdup(opt_arg, MYF(MY_WME)); break; - case 19: /* Interactive-timeout */ + case OPT_interactive_timeout: options->client_flag|= CLIENT_INTERACTIVE; break; - case 21: + case OPT_local_infile: if (!opt_arg || atoi(opt_arg) != 0) options->client_flag|= CLIENT_LOCAL_FILES; else options->client_flag&= ~CLIENT_LOCAL_FILES; break; - case 22: + case OPT_disable_local_infile: options->client_flag&= ~CLIENT_LOCAL_FILES; break; - case 23: /* replication probe */ -#ifndef TO_BE_DELETED - options->rpl_probe= 1; -#endif - break; - case 24: /* enable-reads-from-master */ - options->no_master_reads= 0; - break; - case 25: /* repl-parse-query */ -#ifndef TO_BE_DELETED - options->rpl_parse= 1; -#endif - break; - case 27: + case OPT_max_allowed_packet: if (opt_arg) options->max_allowed_packet= atoi(opt_arg); break; - case 28: /* protocol */ + case OPT_protocol: if ((options->protocol= find_type(opt_arg, &sql_protocol_typelib,0)) <= 0) { @@ -1202,26 +1345,44 @@ void mysql_read_default_options(struct st_mysql_options *options, exit(1); } break; - case 29: /* shared_memory_base_name */ + case OPT_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)); + my_free(options->shared_memory_base_name); options->shared_memory_base_name=my_strdup(opt_arg,MYF(MY_WME)); #endif break; - case 30: + case OPT_multi_results: options->client_flag|= CLIENT_MULTI_RESULTS; break; - case 31: - case 32: + case OPT_multi_statements: + case OPT_multi_queries: options->client_flag|= CLIENT_MULTI_STATEMENTS | CLIENT_MULTI_RESULTS; break; - case 33: /* secure-auth */ + case OPT_secure_auth: options->secure_auth= TRUE; break; - case 34: /* report-data-truncation */ + case OPT_report_data_truncation: options->report_data_truncation= opt_arg ? test(atoi(opt_arg)) : 1; break; + case OPT_plugin_dir: + { + char buff[FN_REFLEN], buff2[FN_REFLEN]; + if (strlen(opt_arg) >= FN_REFLEN) + opt_arg[FN_REFLEN]= '\0'; + if (my_realpath(buff, opt_arg, 0)) + { + DBUG_PRINT("warning",("failed to normalize the plugin path: %s", + opt_arg)); + break; + } + convert_dirname(buff, buff2, NULL); + EXTENSION_SET_STRING(options, plugin_dir, buff2); + } + break; + case OPT_default_auth: + EXTENSION_SET_STRING(options, default_auth, opt_arg); + break; default: DBUG_PRINT("warning",("unknown option: %s",option[0])); } @@ -1313,7 +1474,7 @@ unpack_fields(MYSQL_DATA *data,MEM_ROOT *alloc,uint fields, field->flags= uint2korr(pos+7); field->decimals= (uint) pos[9]; - if (INTERNAL_NUM_FIELD(field)) + if (IS_NUM(field->type)) field->flags|= NUM_FLAG; if (default_value && row->data[7]) { @@ -1354,7 +1515,7 @@ unpack_fields(MYSQL_DATA *data,MEM_ROOT *alloc,uint fields, field->flags= (uint) (uchar) row->data[4][0]; field->decimals=(uint) (uchar) row->data[4][1]; } - if (INTERNAL_NUM_FIELD(field)) + if (IS_NUM(field->type)) field->flags|= NUM_FLAG; if (default_value && row->data[5]) { @@ -1546,16 +1707,8 @@ mysql_init(MYSQL *mysql) else bzero((char*) (mysql), sizeof(*(mysql))); mysql->options.connect_timeout= CONNECT_TIMEOUT; - mysql->last_used_con= mysql->next_slave= mysql->master = mysql; mysql->charset=default_client_charset_info; strmov(mysql->net.sqlstate, not_error_sqlstate); - /* - By default, we are a replication pivot. The caller must reset it - after we return if this is not the case. - */ -#ifndef TO_BE_DELETED - mysql->rpl_pivot = 1; -#endif /* Only enable LOAD DATA INFILE by default if configured with @@ -1610,13 +1763,13 @@ mysql_ssl_set(MYSQL *mysql __attribute__((unused)) , const char *cipher __attribute__((unused))) { DBUG_ENTER("mysql_ssl_set"); -#ifdef HAVE_OPENSSL +#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 */ +#endif /* HAVE_OPENSSL && !EMBEDDED_LIBRARY */ DBUG_RETURN(0); } @@ -1626,7 +1779,7 @@ mysql_ssl_set(MYSQL *mysql __attribute__((unused)) , NB! Errors are not reported until you do mysql_real_connect. */ -#ifdef HAVE_OPENSSL +#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY) static void mysql_ssl_free(MYSQL *mysql __attribute__((unused))) @@ -1634,14 +1787,14 @@ 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)); + my_free(mysql->options.ssl_key); + my_free(mysql->options.ssl_cert); + my_free(mysql->options.ssl_ca); + my_free(mysql->options.ssl_capath); + my_free(mysql->options.ssl_cipher); if (ssl_fd) SSL_CTX_free(ssl_fd->ssl_context); - my_free(mysql->connector_fd,MYF(MY_ALLOW_ZERO_PTR)); + my_free(mysql->connector_fd); mysql->options.ssl_key = 0; mysql->options.ssl_cert = 0; mysql->options.ssl_ca = 0; @@ -1652,7 +1805,7 @@ mysql_ssl_free(MYSQL *mysql __attribute__((unused))) DBUG_VOID_RETURN; } -#endif /* HAVE_OPENSSL */ +#endif /* HAVE_OPENSSL && !EMBEDDED_LIBRARY */ /* Return the SSL cipher (if any) used for current @@ -1668,10 +1821,10 @@ const char * STDCALL mysql_get_ssl_cipher(MYSQL *mysql __attribute__((unused))) { DBUG_ENTER("mysql_get_ssl_cipher"); -#ifdef HAVE_OPENSSL +#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 */ +#endif /* HAVE_OPENSSL && !EMBEDDED_LIBRARY */ DBUG_RETURN(NULL); } @@ -1691,7 +1844,7 @@ mysql_get_ssl_cipher(MYSQL *mysql __attribute__((unused))) */ -#ifdef HAVE_OPENSSL +#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY) static int ssl_verify_server_cert(Vio *vio, const char* server_hostname) { @@ -1749,7 +1902,7 @@ static int ssl_verify_server_cert(Vio *vio, const char* server_hostname) DBUG_RETURN(1); } -#endif /* HAVE_OPENSSL */ +#endif /* HAVE_OPENSSL && !EMBEDDED_LIBRARY */ /* @@ -1760,6 +1913,11 @@ static int ssl_verify_server_cert(Vio *vio, const char* server_hostname) static my_bool cli_read_query_result(MYSQL *mysql); static MYSQL_RES *cli_use_result(MYSQL *mysql); +int cli_read_change_user_result(MYSQL *mysql) +{ + return cli_safe_read(mysql); +} + static MYSQL_METHODS client_methods= { cli_read_query_result, /* read_query_result */ @@ -1767,7 +1925,8 @@ static MYSQL_METHODS client_methods= cli_read_rows, /* read_rows */ cli_use_result, /* use_result */ cli_fetch_lengths, /* fetch_lengths */ - cli_flush_use_result /* flush_use_result */ + cli_flush_use_result, /* flush_use_result */ + cli_read_change_user_result /* read_change_user_result */ #ifndef MYSQL_SERVER ,cli_list_fields, /* list_fields */ cli_read_prepare_result, /* read_prepare_result */ @@ -1777,57 +1936,302 @@ static MYSQL_METHODS client_methods= 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 }; + + +typedef enum my_cs_match_type_enum +{ + /* MySQL and OS charsets are fully compatible */ + my_cs_exact, + /* MySQL charset is very close to OS charset */ + my_cs_approx, + /* + MySQL knows this charset, but it is not supported as client character set. + */ + my_cs_unsupp +} my_cs_match_type; + + +typedef struct str2str_st +{ + const char *os_name; + const char *my_name; + my_cs_match_type param; +} MY_CSET_OS_NAME; + +const MY_CSET_OS_NAME charsets[]= +{ +#ifdef __WIN__ + {"cp437", "cp850", my_cs_approx}, + {"cp850", "cp850", my_cs_exact}, + {"cp852", "cp852", my_cs_exact}, + {"cp858", "cp850", my_cs_approx}, + {"cp866", "cp866", my_cs_exact}, + {"cp874", "tis620", my_cs_approx}, + {"cp932", "cp932", my_cs_exact}, + {"cp936", "gbk", my_cs_approx}, + {"cp949", "euckr", my_cs_approx}, + {"cp950", "big5", my_cs_exact}, + {"cp1200", "utf16le", my_cs_unsupp}, + {"cp1201", "utf16", my_cs_unsupp}, + {"cp1250", "cp1250", my_cs_exact}, + {"cp1251", "cp1251", my_cs_exact}, + {"cp1252", "latin1", my_cs_exact}, + {"cp1253", "greek", my_cs_exact}, + {"cp1254", "latin5", my_cs_exact}, + {"cp1255", "hebrew", my_cs_approx}, + {"cp1256", "cp1256", my_cs_exact}, + {"cp1257", "cp1257", my_cs_exact}, + {"cp10000", "macroman", my_cs_exact}, + {"cp10001", "sjis", my_cs_approx}, + {"cp10002", "big5", my_cs_approx}, + {"cp10008", "gb2312", my_cs_approx}, + {"cp10021", "tis620", my_cs_approx}, + {"cp10029", "macce", my_cs_exact}, + {"cp12001", "utf32", my_cs_unsupp}, + {"cp20107", "swe7", my_cs_exact}, + {"cp20127", "latin1", my_cs_approx}, + {"cp20866", "koi8r", my_cs_exact}, + {"cp20932", "ujis", my_cs_exact}, + {"cp20936", "gb2312", my_cs_approx}, + {"cp20949", "euckr", my_cs_approx}, + {"cp21866", "koi8u", my_cs_exact}, + {"cp28591", "latin1", my_cs_approx}, + {"cp28592", "latin2", my_cs_exact}, + {"cp28597", "greek", my_cs_exact}, + {"cp28598", "hebrew", my_cs_exact}, + {"cp28599", "latin5", my_cs_exact}, + {"cp28603", "latin7", my_cs_exact}, +#ifdef UNCOMMENT_THIS_WHEN_WL_4579_IS_DONE + {"cp28605", "latin9", my_cs_exact}, +#endif + {"cp38598", "hebrew", my_cs_exact}, + {"cp51932", "ujis", my_cs_exact}, + {"cp51936", "gb2312", my_cs_exact}, + {"cp51949", "euckr", my_cs_exact}, + {"cp51950", "big5", my_cs_exact}, +#ifdef UNCOMMENT_THIS_WHEN_WL_WL_4024_IS_DONE + {"cp54936", "gb18030", my_cs_exact}, +#endif + {"cp65001", "utf8", my_cs_exact}, + +#else /* not Windows */ + + {"646", "latin1", my_cs_approx}, /* Default on Solaris */ + {"ANSI_X3.4-1968", "latin1", my_cs_approx}, + {"ansi1251", "cp1251", my_cs_exact}, + {"armscii8", "armscii8", my_cs_exact}, + {"armscii-8", "armscii8", my_cs_exact}, + {"ASCII", "latin1", my_cs_approx}, + {"Big5", "big5", my_cs_exact}, + {"cp1251", "cp1251", my_cs_exact}, + {"cp1255", "hebrew", my_cs_approx}, + {"CP866", "cp866", my_cs_exact}, + {"eucCN", "gb2312", my_cs_exact}, + {"euc-CN", "gb2312", my_cs_exact}, + {"eucJP", "ujis", my_cs_exact}, + {"euc-JP", "ujis", my_cs_exact}, + {"eucKR", "euckr", my_cs_exact}, + {"euc-KR", "euckr", my_cs_exact}, +#ifdef UNCOMMENT_THIS_WHEN_WL_WL_4024_IS_DONE + {"gb18030", "gb18030", my_cs_exact}, +#endif + {"gb2312", "gb2312", my_cs_exact}, + {"gbk", "gbk", my_cs_exact}, + {"georgianps", "geostd8", my_cs_exact}, + {"georgian-ps", "geostd8", my_cs_exact}, + {"IBM-1252", "cp1252", my_cs_exact}, + + {"iso88591", "latin1", my_cs_approx}, + {"ISO_8859-1", "latin1", my_cs_approx}, + {"ISO8859-1", "latin1", my_cs_approx}, + {"ISO-8859-1", "latin1", my_cs_approx}, + + {"iso885913", "latin7", my_cs_exact}, + {"ISO_8859-13", "latin7", my_cs_exact}, + {"ISO8859-13", "latin7", my_cs_exact}, + {"ISO-8859-13", "latin7", my_cs_exact}, + +#ifdef UNCOMMENT_THIS_WHEN_WL_4579_IS_DONE + {"iso885915", "latin9", my_cs_exact}, + {"ISO_8859-15", "latin9", my_cs_exact}, + {"ISO8859-15", "latin9", my_cs_exact}, + {"ISO-8859-15", "latin9", my_cs_exact}, +#endif + + {"iso88592", "latin2", my_cs_exact}, + {"ISO_8859-2", "latin2", my_cs_exact}, + {"ISO8859-2", "latin2", my_cs_exact}, + {"ISO-8859-2", "latin2", my_cs_exact}, + + {"iso88597", "greek", my_cs_exact}, + {"ISO_8859-7", "greek", my_cs_exact}, + {"ISO8859-7", "greek", my_cs_exact}, + {"ISO-8859-7", "greek", my_cs_exact}, + + {"iso88598", "hebrew", my_cs_exact}, + {"ISO_8859-8", "hebrew", my_cs_exact}, + {"ISO8859-8", "hebrew", my_cs_exact}, + {"ISO-8859-8", "hebrew", my_cs_exact}, + + {"iso88599", "latin5", my_cs_exact}, + {"ISO_8859-9", "latin5", my_cs_exact}, + {"ISO8859-9", "latin5", my_cs_exact}, + {"ISO-8859-9", "latin5", my_cs_exact}, + + {"koi8r", "koi8r", my_cs_exact}, + {"KOI8-R", "koi8r", my_cs_exact}, + {"koi8u", "koi8u", my_cs_exact}, + {"KOI8-U", "koi8u", my_cs_exact}, + + {"roman8", "hp8", my_cs_exact}, /* Default on HP UX */ + + {"Shift_JIS", "sjis", my_cs_exact}, + {"SJIS", "sjis", my_cs_exact}, + {"shiftjisx0213", "sjis", my_cs_exact}, + + {"tis620", "tis620", my_cs_exact}, + {"tis-620", "tis620", my_cs_exact}, + + {"ujis", "ujis", my_cs_exact}, + + {"US-ASCII", "latin1", my_cs_approx}, + + {"utf8", "utf8", my_cs_exact}, + {"utf-8", "utf8", my_cs_exact}, +#endif + {NULL, NULL, 0} +}; + + +static const char * +my_os_charset_to_mysql_charset(const char *csname) +{ + const MY_CSET_OS_NAME *csp; + for (csp= charsets; csp->os_name; csp++) + { + if (!my_strcasecmp(&my_charset_latin1, csp->os_name, csname)) + { + switch (csp->param) + { + case my_cs_exact: + return csp->my_name; + + case my_cs_approx: + /* + Maybe we should print a warning eventually: + character set correspondence is not exact. + */ + return csp->my_name; + + default: + my_printf_error(ER_UNKNOWN_ERROR, + "OS character set '%s'" + " is not supported by MySQL client", + MYF(0), csp->my_name); + goto def; + } + } + } + + my_printf_error(ER_UNKNOWN_ERROR, + "Unknown OS character set '%s'.", + MYF(0), csname); + +def: + csname= MYSQL_DEFAULT_CHARSET_NAME; + my_printf_error(ER_UNKNOWN_ERROR, + "Switching to the default character set '%s'.", + MYF(0), csname); + return csname; +} + + +#ifndef __WIN__ +#include /* for getenv() */ +#ifdef HAVE_LANGINFO_H +#include +#endif +#ifdef HAVE_LOCALE_H +#include +#endif +#endif /* __WIN__ */ + + +static int +mysql_autodetect_character_set(MYSQL *mysql) +{ + const char *csname= MYSQL_DEFAULT_CHARSET_NAME; + +#ifdef __WIN__ + char cpbuf[64]; + { + my_snprintf(cpbuf, sizeof(cpbuf), "cp%d", (int) GetConsoleCP()); + csname= my_os_charset_to_mysql_charset(cpbuf); + } +#elif defined(HAVE_SETLOCALE) && defined(HAVE_NL_LANGINFO) + { + if (setlocale(LC_CTYPE, "") && (csname= nl_langinfo(CODESET))) + csname= my_os_charset_to_mysql_charset(csname); + } +#endif + + if (!(mysql->options.charset_name= my_strdup(csname, MYF(MY_WME)))) + return 1; + return 0; +} + + +static void +mysql_set_character_set_with_default_collation(MYSQL *mysql) +{ + const char *save= charsets_dir; + if (mysql->options.charset_dir) + charsets_dir=mysql->options.charset_dir; + + if ((mysql->charset= get_charset_by_csname(mysql->options.charset_name, + MY_CS_PRIMARY, MYF(MY_WME)))) + { + /* Try to set compiled default collation when it's possible. */ + CHARSET_INFO *collation; + if ((collation= + get_charset_by_name(MYSQL_DEFAULT_COLLATION_NAME, MYF(MY_WME))) && + my_charset_same(mysql->charset, collation)) + { + mysql->charset= collation; + } + else + { + /* + Default compiled collation not found, or is not applicable + to the requested character set. + Continue with the default collation of the character set. + */ + } + } + charsets_dir= save; +} + + 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; + return 1; } + else if (!strcmp(mysql->options.charset_name, + MYSQL_AUTODETECT_CHARSET_NAME) && + mysql_autodetect_character_set(mysql)) + return 1; + + mysql_set_character_set_with_default_collation(mysql); if (!mysql->charset) { @@ -1851,58 +2255,710 @@ int mysql_init_character_set(MYSQL *mysql) } C_MODE_END +/*********** client side authentication support **************************/ -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) +typedef struct st_mysql_client_plugin_AUTHENTICATION auth_plugin_t; +static int client_mpvio_write_packet(struct st_plugin_vio*, const uchar*, int); +static int native_password_auth_client(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql); +static int old_password_auth_client(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql); + +static auth_plugin_t native_password_client_plugin= { - char buff[NAME_LEN+USERNAME_LENGTH+100]; - char *end,*host_info= NULL; - my_socket sock; - in_addr_t ip_addr; - struct sockaddr_in sock_addr; - 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"); + MYSQL_CLIENT_AUTHENTICATION_PLUGIN, + MYSQL_CLIENT_AUTHENTICATION_PLUGIN_INTERFACE_VERSION, + native_password_plugin_name, + "R.J.Silk, Sergei Golubchik", + "Native MySQL authentication", + {1, 0, 0}, + "GPL", + NULL, + NULL, + NULL, + NULL, + native_password_auth_client +}; - DBUG_PRINT("enter",("host: %s db: %s user: %s", - host ? host : "(Null)", - db ? db : "(Null)", - user ? user : "(Null)")); +static auth_plugin_t old_password_client_plugin= +{ + MYSQL_CLIENT_AUTHENTICATION_PLUGIN, + MYSQL_CLIENT_AUTHENTICATION_PLUGIN_INTERFACE_VERSION, + old_password_plugin_name, + "R.J.Silk, Sergei Golubchik", + "Old MySQL-3.23 authentication", + {1, 0, 0}, + "GPL", + NULL, + NULL, + NULL, + NULL, + old_password_auth_client +}; - /* 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 */ +struct st_mysql_client_plugin *mysql_client_builtins[]= +{ + (struct st_mysql_client_plugin *)&native_password_client_plugin, + (struct st_mysql_client_plugin *)&old_password_client_plugin, + 0 +}; - /* use default options */ - if (mysql->options.my_cnf_file || mysql->options.my_cnf_group) + + +/* this is a "superset" of MYSQL_PLUGIN_VIO, in C++ I use inheritance */ +typedef struct { + int (*read_packet)(struct st_plugin_vio *vio, uchar **buf); + int (*write_packet)(struct st_plugin_vio *vio, const uchar *pkt, int pkt_len); + void (*info)(struct st_plugin_vio *vio, struct st_plugin_vio_info *info); + /* -= end of MYSQL_PLUGIN_VIO =- */ + MYSQL *mysql; + auth_plugin_t *plugin; /**< what plugin we're under */ + const char *db; + struct { + uchar *pkt; /**< pointer into NET::buff */ + uint pkt_len; + } cached_server_reply; + int packets_read, packets_written; /**< counters for send/received packets */ + int mysql_change_user; /**< if it's mysql_change_user() */ + int last_read_packet_len; /**< the length of the last *read* packet */ +} MCPVIO_EXT; + +/** + sends a COM_CHANGE_USER command with a caller provided payload + + Packet format: + + Bytes Content + ----- ---- + n user name - \0-terminated string + n password + 3.23 scramble - \0-terminated string (9 bytes) + otherwise - length (1 byte) coded + n database name - \0-terminated string + 2 character set number (if the server >= 4.1.x) + n client auth plugin name - \0-terminated string, + (if the server supports plugin auth) + + @retval 0 ok + @retval 1 error +*/ +static int send_change_user_packet(MCPVIO_EXT *mpvio, + const uchar *data, int data_len) +{ + MYSQL *mysql= mpvio->mysql; + char *buff, *end; + int res= 1; + + buff= my_alloca(USERNAME_LENGTH + data_len + 1 + NAME_LEN + 2 + NAME_LEN); + + end= strmake(buff, mysql->user, USERNAME_LENGTH) + 1; + + if (!data_len) + *end++= 0; + else { - 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; + if (mysql->client_flag & CLIENT_SECURE_CONNECTION) + { + DBUG_ASSERT(data_len <= 255); + if (data_len > 255) + { + set_mysql_error(mysql, CR_MALFORMED_PACKET, unknown_sqlstate); + goto error; + } + *end++= data_len; + } + else + { + DBUG_ASSERT(data_len == SCRAMBLE_LENGTH_323 + 1); + DBUG_ASSERT(data[SCRAMBLE_LENGTH_323] == 0); + } + memcpy(end, data, data_len); + end+= data_len; } + end= strmake(end, mpvio->db ? mpvio->db : "", NAME_LEN) + 1; - /* Some empty-string-tests are done because of ODBC */ - if (!host || !host[0]) - host=mysql->options.host; + if (mysql->server_capabilities & CLIENT_PROTOCOL_41) + { + int2store(end, (ushort) mysql->charset->number); + end+= 2; + } + + if (mysql->server_capabilities & CLIENT_PLUGIN_AUTH) + end= strmake(end, mpvio->plugin->name, NAME_LEN) + 1; + + res= simple_command(mysql, COM_CHANGE_USER, + (uchar*)buff, (ulong)(end-buff), 1); + +error: + my_afree(buff); + return res; +} + +/** + sends a client authentication packet (second packet in the 3-way handshake) + + Packet format (when the server is 4.0 or earlier): + + Bytes Content + ----- ---- + 2 client capabilities + 3 max packet size + n user name, \0-terminated + 9 scramble_323, \0-terminated + + Packet format (when the server is 4.1 or newer): + + Bytes Content + ----- ---- + 4 client capabilities + 4 max packet size + 1 charset number + 23 reserved (always 0) + n user name, \0-terminated + n plugin auth data (e.g. scramble), length (1 byte) coded + n database name, \0-terminated + (if CLIENT_CONNECT_WITH_DB is set in the capabilities) + n client auth plugin name - \0-terminated string, + (if CLIENT_PLUGIN_AUTH is set in the capabilities) + + @retval 0 ok + @retval 1 error +*/ +static int send_client_reply_packet(MCPVIO_EXT *mpvio, + const uchar *data, int data_len) +{ + MYSQL *mysql= mpvio->mysql; + NET *net= &mysql->net; + char *buff, *end; + + /* see end= buff+32 below, fixed size of the packet is 32 bytes */ + buff= my_alloca(33 + USERNAME_LENGTH + data_len + NAME_LEN + NAME_LEN); + + mysql->client_flag|= mysql->options.client_flag; + mysql->client_flag|= CLIENT_CAPABILITIES; + + if (mysql->client_flag & CLIENT_MULTI_STATEMENTS) + mysql->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) + mysql->client_flag|= CLIENT_SSL; +#endif /* HAVE_OPENSSL && !EMBEDDED_LIBRARY*/ + if (mpvio->db) + mysql->client_flag|= CLIENT_CONNECT_WITH_DB; + + /* Remove options that server doesn't support */ + mysql->client_flag= mysql->client_flag & + (~(CLIENT_COMPRESS | CLIENT_SSL | CLIENT_PROTOCOL_41) + | mysql->server_capabilities); + +#ifndef HAVE_COMPRESS + mysql->client_flag&= ~CLIENT_COMPRESS; +#endif + + if (mysql->client_flag & CLIENT_PROTOCOL_41) + { + /* 4.1 server and 4.1 client has a 32 byte option flag */ + int4store(buff,mysql->client_flag); + int4store(buff+4, net->max_packet_size); + buff[8]= (char) mysql->charset->number; + bzero(buff+9, 32-9); + end= buff+32; + } + else + { + int2store(buff, mysql->client_flag); + int3store(buff+2, net->max_packet_size); + end= buff+5; + } +#ifdef HAVE_OPENSSL + if (mysql->client_flag & CLIENT_SSL) + { + /* Do the SSL layering. */ + struct st_mysql_options *options= &mysql->options; + struct st_VioSSLFd *ssl_fd; + + /* + Send mysql->client_flag, max_packet_size - unencrypted otherwise + the server does not know we want to do SSL + */ + 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 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= (unsigned char *) ssl_fd; + + /* Connect to the server */ + DBUG_PRINT("info", ("IO layer change in progress...")); + if (sslconnect(ssl_fd, 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 ((mysql->client_flag & CLIENT_SSL_VERIFY_SERVER_CERT) && + ssl_verify_server_cert(net->vio, mysql->host)) + { + set_mysql_error(mysql, CR_SSL_CONNECTION_ERROR, unknown_sqlstate); + goto error; + } + } +#endif /* HAVE_OPENSSL */ + + DBUG_PRINT("info",("Server version = '%s' capabilites: %lu status: %u client_flag: %lu", + mysql->server_version, mysql->server_capabilities, + mysql->server_status, mysql->client_flag)); + + compile_time_assert(MYSQL_USERNAME_LENGTH == USERNAME_LENGTH); + + /* This needs to be changed as it's not useful with big packets */ + if (mysql->user[0]) + strmake(end, mysql->user, USERNAME_LENGTH); + else + read_user_name(end); + + /* We have to handle different version of handshake here */ + DBUG_PRINT("info",("user: %s",end)); + end= strend(end) + 1; + if (data_len) + { + if (mysql->server_capabilities & CLIENT_SECURE_CONNECTION) + { + *end++= data_len; + memcpy(end, data, data_len); + end+= data_len; + } + else + { + DBUG_ASSERT(data_len == SCRAMBLE_LENGTH_323 + 1); /* incl. \0 at the end */ + memcpy(end, data, data_len); + end+= data_len; + } + } + else + *end++= 0; + + /* Add database if needed */ + if (mpvio->db && (mysql->server_capabilities & CLIENT_CONNECT_WITH_DB)) + { + end= strmake(end, mpvio->db, NAME_LEN) + 1; + mysql->db= my_strdup(mpvio->db, MYF(MY_WME)); + } + + if (mysql->server_capabilities & CLIENT_PLUGIN_AUTH) + end= strmake(end, mpvio->plugin->name, NAME_LEN) + 1; + + /* 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; + } + my_afree(buff); + return 0; + +error: + my_afree(buff); + return 1; +} + +/** + vio->read_packet() callback method for client authentication plugins + + This function is called by a client authentication plugin, when it wants + to read data from the server. +*/ +static int client_mpvio_read_packet(struct st_plugin_vio *mpv, uchar **buf) +{ + MCPVIO_EXT *mpvio= (MCPVIO_EXT*)mpv; + MYSQL *mysql= mpvio->mysql; + ulong pkt_len; + + /* there are cached data left, feed it to a plugin */ + if (mpvio->cached_server_reply.pkt) + { + *buf= mpvio->cached_server_reply.pkt; + mpvio->cached_server_reply.pkt= 0; + mpvio->packets_read++; + return mpvio->cached_server_reply.pkt_len; + } + + if (mpvio->packets_read == 0) + { + /* + the server handshake packet came from the wrong plugin, + or it's mysql_change_user(). Either way, there is no data + for a plugin to read. send a dummy packet to the server + to initiate a dialog. + */ + if (client_mpvio_write_packet(mpv, 0, 0)) + return (int)packet_error; + } + + /* otherwise read the data */ + pkt_len= (*mysql->methods->read_change_user_result)(mysql); + mpvio->last_read_packet_len= pkt_len; + *buf= mysql->net.read_pos; + + /* was it a request to change plugins ? */ + if (**buf == 254) + return (int)packet_error; /* if yes, this plugin shan't continue */ + + /* + the server sends \1\255 or \1\254 instead of just \255 or \254 - + for us to not confuse it with an error or "change plugin" packets. + We remove this escaping \1 here. + + See also server_mpvio_write_packet() where the escaping is done. + */ + if (pkt_len && **buf == 1) + { + (*buf)++; + pkt_len--; + } + mpvio->packets_read++; + return pkt_len; +} + +/** + vio->write_packet() callback method for client authentication plugins + + This function is called by a client authentication plugin, when it wants + to send data to the server. + + It transparently wraps the data into a change user or authentication + handshake packet, if neccessary. +*/ +static int client_mpvio_write_packet(struct st_plugin_vio *mpv, + const uchar *pkt, int pkt_len) +{ + int res; + MCPVIO_EXT *mpvio= (MCPVIO_EXT*)mpv; + + if (mpvio->packets_written == 0) + { + if (mpvio->mysql_change_user) + res= send_change_user_packet(mpvio, pkt, pkt_len); + else + res= send_client_reply_packet(mpvio, pkt, pkt_len); + } + else + { + NET *net= &mpvio->mysql->net; + if (mpvio->mysql->thd) + res= 1; /* no chit-chat in embedded */ + else + res= my_net_write(net, pkt, pkt_len) || net_flush(net); + if (res) + set_mysql_extended_error(mpvio->mysql, CR_SERVER_LOST, unknown_sqlstate, + ER(CR_SERVER_LOST_EXTENDED), + "sending authentication information", + errno); + } + mpvio->packets_written++; + return res; +} + +/** + fills MYSQL_PLUGIN_VIO_INFO structure with the information about the + connection +*/ +void mpvio_info(Vio *vio, MYSQL_PLUGIN_VIO_INFO *info) +{ + bzero(info, sizeof(*info)); + switch (vio->type) { + case VIO_TYPE_TCPIP: + info->protocol= MYSQL_VIO_TCP; + info->socket= vio->sd; + return; + case VIO_TYPE_SOCKET: + info->protocol= MYSQL_VIO_SOCKET; + info->socket= vio->sd; + return; + case VIO_TYPE_SSL: + { + struct sockaddr addr; + socklen_t addrlen= sizeof(addr); + if (getsockname(vio->sd, &addr, &addrlen)) + return; + info->protocol= addr.sa_family == AF_UNIX ? + MYSQL_VIO_SOCKET : MYSQL_VIO_TCP; + info->socket= vio->sd; + return; + } +#ifdef _WIN32 + case VIO_TYPE_NAMEDPIPE: + info->protocol= MYSQL_VIO_PIPE; + info->handle= vio->hPipe; + return; +#ifdef HAVE_SMEM + case VIO_TYPE_SHARED_MEMORY: + info->protocol= MYSQL_VIO_MEMORY; + info->handle= vio->handle_file_map; /* or what ? */ + return; +#endif +#endif + default: DBUG_ASSERT(0); + } +} + +static void client_mpvio_info(MYSQL_PLUGIN_VIO *vio, + MYSQL_PLUGIN_VIO_INFO *info) +{ + MCPVIO_EXT *mpvio= (MCPVIO_EXT*)vio; + mpvio_info(mpvio->mysql->net.vio, info); +} + +/** + Client side of the plugin driver authentication. + + @note this is used by both the mysql_real_connect and mysql_change_user + + @param mysql mysql + @param data pointer to the plugin auth data (scramble) in the + handshake packet + @param data_len the length of the data + @param data_plugin a plugin that data were prepared for + or 0 if it's mysql_change_user() + @param db initial db to use, can be 0 + + @retval 0 ok + @retval 1 error +*/ +int run_plugin_auth(MYSQL *mysql, char *data, uint data_len, + const char *data_plugin, const char *db) +{ + const char *auth_plugin_name; + auth_plugin_t *auth_plugin; + MCPVIO_EXT mpvio; + ulong pkt_length; + int res; + + DBUG_ENTER ("run_plugin_auth"); + /* determine the default/initial plugin to use */ + if (mysql->options.extension && mysql->options.extension->default_auth && + mysql->server_capabilities & CLIENT_PLUGIN_AUTH) + { + auth_plugin_name= mysql->options.extension->default_auth; + if (!(auth_plugin= (auth_plugin_t*) mysql_client_find_plugin(mysql, + auth_plugin_name, MYSQL_CLIENT_AUTHENTICATION_PLUGIN))) + DBUG_RETURN (1); /* oops, not found */ + } + else + { + auth_plugin= mysql->server_capabilities & CLIENT_PROTOCOL_41 ? + &native_password_client_plugin : &old_password_client_plugin; + auth_plugin_name= auth_plugin->name; + } + + DBUG_PRINT ("info", ("using plugin %s", auth_plugin_name)); + + mysql->net.last_errno= 0; /* just in case */ + + if (data_plugin && strcmp(data_plugin, auth_plugin_name)) + { + /* data was prepared for a different plugin, don't show it to this one */ + data= 0; + data_len= 0; + } + + mpvio.mysql_change_user= data_plugin == 0; + mpvio.cached_server_reply.pkt= (uchar*)data; + mpvio.cached_server_reply.pkt_len= data_len; + mpvio.read_packet= client_mpvio_read_packet; + mpvio.write_packet= client_mpvio_write_packet; + mpvio.info= client_mpvio_info; + mpvio.mysql= mysql; + mpvio.packets_read= mpvio.packets_written= 0; + mpvio.db= db; + mpvio.plugin= auth_plugin; + + res= auth_plugin->authenticate_user((struct st_plugin_vio *)&mpvio, mysql); + DBUG_PRINT ("info", ("authenticate_user returned %s", + res == CR_OK ? "CR_OK" : + res == CR_ERROR ? "CR_ERROR" : + res == CR_OK_HANDSHAKE_COMPLETE ? + "CR_OK_HANDSHAKE_COMPLETE" : "error")); + + compile_time_assert(CR_OK == -1); + compile_time_assert(CR_ERROR == 0); + if (res > CR_OK && mysql->net.read_pos[0] != 254) + { + /* + the plugin returned an error. write it down in mysql, + unless the error code is CR_ERROR and mysql->net.last_errno + is already set (the plugin has done it) + */ + DBUG_PRINT ("info", ("res=%d", res)); + if (res > CR_ERROR) + set_mysql_error(mysql, res, unknown_sqlstate); + else + if (!mysql->net.last_errno) + set_mysql_error(mysql, CR_UNKNOWN_ERROR, unknown_sqlstate); + DBUG_RETURN (1); + } + + /* read the OK packet (or use the cached value in mysql->net.read_pos */ + if (res == CR_OK) + pkt_length= (*mysql->methods->read_change_user_result)(mysql); + else /* res == CR_OK_HANDSHAKE_COMPLETE */ + pkt_length= mpvio.last_read_packet_len; + + DBUG_PRINT ("info", ("OK packet length=%lu", pkt_length)); + if (pkt_length == 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); + DBUG_RETURN (1); + } + + if (mysql->net.read_pos[0] == 254) + { + /* The server asked to use a different authentication plugin */ + if (pkt_length == 1) + { + /* old "use short scramble" packet */ + DBUG_PRINT ("info", ("old use short scramble packet from server")); + auth_plugin_name= old_password_plugin_name; + mpvio.cached_server_reply.pkt= (uchar*)mysql->scramble; + mpvio.cached_server_reply.pkt_len= SCRAMBLE_LENGTH + 1; + } + else + { + /* new "use different plugin" packet */ + uint len; + auth_plugin_name= (char*)mysql->net.read_pos + 1; + len= strlen(auth_plugin_name); /* safe as my_net_read always appends \0 */ + mpvio.cached_server_reply.pkt_len= pkt_length - len - 2; + mpvio.cached_server_reply.pkt= mysql->net.read_pos + len + 2; + DBUG_PRINT ("info", ("change plugin packet from server for plugin %s", + auth_plugin_name)); + } + + if (!(auth_plugin= (auth_plugin_t *) mysql_client_find_plugin(mysql, + auth_plugin_name, MYSQL_CLIENT_AUTHENTICATION_PLUGIN))) + DBUG_RETURN (1); + + mpvio.plugin= auth_plugin; + res= auth_plugin->authenticate_user((struct st_plugin_vio *)&mpvio, mysql); + + DBUG_PRINT ("info", ("second authenticate_user returned %s", + res == CR_OK ? "CR_OK" : + res == CR_ERROR ? "CR_ERROR" : + res == CR_OK_HANDSHAKE_COMPLETE ? + "CR_OK_HANDSHAKE_COMPLETE" : "error")); + if (res > CR_OK) + { + if (res > CR_ERROR) + set_mysql_error(mysql, res, unknown_sqlstate); + else + if (!mysql->net.last_errno) + set_mysql_error(mysql, CR_UNKNOWN_ERROR, unknown_sqlstate); + DBUG_RETURN (1); + } + + if (res != CR_OK_HANDSHAKE_COMPLETE) + { + /* 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); + DBUG_RETURN (1); + } + } + } + /* + net->read_pos[0] should always be 0 here if the server implements + the protocol correctly + */ + DBUG_RETURN (mysql->net.read_pos[0] != 0); +} + +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]; + int scramble_data_len, pkt_scramble_len= 0; + char *end,*host_info= 0, *server_version_end, *pkt_end; + char *scramble_data; + const char *scramble_plugin; + 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 + DBUG_ENTER("mysql_real_connect"); + + DBUG_PRINT("enter",("host: %s db: %s user: %s (client)", + 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); + } + + 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); + my_free(mysql->options.my_cnf_group); + 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; @@ -1927,6 +2983,7 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user, unix_socket=mysql->options.unix_socket; mysql->server_status=SERVER_STATUS_AUTOCOMMIT; + DBUG_PRINT("info", ("Connecting")); /* Part 0: Grab a socket and connect it to the server @@ -1936,6 +2993,7 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user, mysql->options.protocol == MYSQL_PROTOCOL_MEMORY) && (!host || !strcmp(host,LOCAL_HOST))) { + DBUG_PRINT("info", ("Using shared memory")); if ((create_shared_memory(mysql,net, mysql->options.connect_timeout)) == INVALID_HANDLE_VALUE) { @@ -1958,7 +3016,6 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user, else { mysql->options.protocol=MYSQL_PROTOCOL_MEMORY; - sock=0; unix_socket = 0; host=mysql->options.shared_memory_base_name; my_snprintf(host_info=buff, sizeof(buff)-1, @@ -1973,12 +3030,9 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user, (unix_socket || mysql_unix_port) && (!host || !strcmp(host,LOCAL_HOST))) { - 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)); - if ((sock = socket(AF_UNIX,SOCK_STREAM,0)) == SOCKET_ERROR) + my_socket sock= socket(AF_UNIX, SOCK_STREAM, 0); + DBUG_PRINT("info", ("Using socket")); + if (sock == SOCKET_ERROR) { set_mysql_extended_error(mysql, CR_SOCKET_CREATE_ERROR, unknown_sqlstate, @@ -1986,12 +3040,28 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user, socket_errno); goto error; } + net->vio= vio_new(sock, VIO_TYPE_SOCKET, VIO_LOCALHOST | VIO_BUFFERED_READ); - bzero((char*) &UNIXaddr,sizeof(UNIXaddr)); - UNIXaddr.sun_family = AF_UNIX; + 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), + + if (my_connect(sock, (struct sockaddr *) &UNIXaddr, sizeof(UNIXaddr), mysql->options.connect_timeout)) { DBUG_PRINT("error",("Got error %d on connect to local server", @@ -2000,6 +3070,8 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user, 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; @@ -2010,7 +3082,6 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user, (host && !strcmp(host,LOCAL_HOST_NAMEDPIPE)) || (! have_tcpip && (unix_socket || !host && is_NT())))) { - sock=0; if ((hPipe= create_named_pipe(mysql, mysql->options.connect_timeout, (char**) &host, (char**) &unix_socket)) == INVALID_HANDLE_VALUE) @@ -2034,93 +3105,130 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user, } } #endif + DBUG_PRINT("info", ("net->vio: %p protocol: %d", + net->vio, mysql->options.protocol)); if (!net->vio && (!mysql->options.protocol || mysql->options.protocol == MYSQL_PROTOCOL_TCP)) { - int status= -1; + struct addrinfo *res_lst, hints, *t_res; + int gai_errno; + char port_buf[NI_MAXSERV]; + my_socket sock= SOCKET_ERROR; + int saved_error= 0, status= -1; + unix_socket=0; /* This is not used */ + if (!port) - port=mysql_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)); + 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 - /* _WIN64 ; Assume that the (int) range is enough for socket() */ - sock = (my_socket) socket(AF_INET,SOCK_STREAM,0); + + DBUG_PRINT("info",("IP '%s'", "client")); + #ifdef MYSQL_SERVER thr_end_alarm(&alarmed); #endif - if (sock == SOCKET_ERROR) - { - set_mysql_extended_error(mysql, CR_IPSOCK_ERROR, unknown_sqlstate, - ER(CR_IPSOCK_ERROR), socket_errno); + + 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; } - net->vio= vio_new(sock, VIO_TYPE_TCPIP, VIO_BUFFERED_READ); - bzero((char*) &sock_addr,sizeof(sock_addr)); - sock_addr.sin_family = AF_INET; - sock_addr.sin_port = (ushort) htons((ushort) port); /* - The server name may be a host name or IP address + A hostname might map to multiple IP addresses (IPv4/IPv6). Go over the + list of IP addresses until a successful connection can be established. */ - - if ((int) (ip_addr = inet_addr(host)) != (int) INADDR_NONE) - { - memcpy_fixed(&sock_addr.sin_addr,&ip_addr,sizeof(ip_addr)); - status= my_connect(sock, (struct sockaddr *) &sock_addr, - sizeof(sock_addr), mysql->options.connect_timeout); - } - else + DBUG_PRINT("info", ("Try connect on all addresses for host.")); + for (t_res= res_lst; t_res; t_res= t_res->ai_next) { - int i, tmp_errno; - struct hostent tmp_hostent,*hp; - char buff2[GETHOSTBYNAME_BUFF_SIZE]; - hp = my_gethostbyname_r(host,&tmp_hostent,buff2,sizeof(buff2), - &tmp_errno); + DBUG_PRINT("info", ("Create socket, family: %d type: %d proto: %d", + t_res->ai_family, t_res->ai_socktype, + t_res->ai_protocol)); + sock= socket(t_res->ai_family, t_res->ai_socktype, t_res->ai_protocol); + if (sock == SOCKET_ERROR) + { + saved_error= socket_errno; + continue; + } + DBUG_PRINT("info", ("Connect socket")); + status= my_connect(sock, t_res->ai_addr, t_res->ai_addrlen, + mysql->options.connect_timeout); /* - Don't attempt to connect to non IPv4 addresses as the client could - end up sending information to a unknown server. For example, a IPv6 - address might be returned from gethostbyname depending on options - set via the RES_OPTIONS environment variable. + Here we rely on my_connect() to return success only if the + connect attempt was really successful. Otherwise we would stop + trying another address, believing we were successful. */ - if (!hp || (hp->h_addrtype != AF_INET)) - { - my_gethostbyname_r_free(); - set_mysql_extended_error(mysql, CR_UNKNOWN_HOST, unknown_sqlstate, - ER(CR_UNKNOWN_HOST), host, tmp_errno); - goto error; - } + if (!status) + break; - for (i= 0; status && hp->h_addr_list[i]; i++) - { - IF_DBUG(char ipaddr[18];) - memcpy(&sock_addr.sin_addr, hp->h_addr_list[i], - min(sizeof(sock_addr.sin_addr), (size_t) hp->h_length)); - DBUG_PRINT("info",("Trying %s...", - (my_inet_ntoa(sock_addr.sin_addr, ipaddr), ipaddr))); - status= my_connect(sock, (struct sockaddr *) &sock_addr, - sizeof(sock_addr), mysql->options.connect_timeout); - } + /* + Save value as socket errno might be overwritten due to + calling a socket function below. + */ + saved_error= socket_errno; + + DBUG_PRINT("info", ("No success, close socket, try next address.")); + closesocket(sock); + } + DBUG_PRINT("info", + ("End of connect attempts, sock: %d status: %d error: %d", + sock, status, saved_error)); - my_gethostbyname_r_free(); + freeaddrinfo(res_lst); + + if (sock == SOCKET_ERROR) + { + set_mysql_extended_error(mysql, CR_IPSOCK_ERROR, unknown_sqlstate, + ER(CR_IPSOCK_ERROR), saved_error); + goto error; } if (status) { - DBUG_PRINT("error",("Got error %d on connect to '%s'",socket_errno, - host)); + DBUG_PRINT("error",("Got error %d on connect to '%s'", saved_error, host)); set_mysql_extended_error(mysql, CR_CONN_HOST_ERROR, unknown_sqlstate, - ER(CR_CONN_HOST_ERROR), host, socket_errno); + ER(CR_CONN_HOST_ERROR), host, saved_error); + 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); goto error; } } + + DBUG_PRINT("info", ("net->vio: %p", net->vio)); if (!net->vio) { DBUG_PRINT("error",("Unknow protocol %d ",mysql->options.protocol)); @@ -2163,6 +3271,7 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user, /* Part 1: Connection established, read and parse first packet */ + DBUG_PRINT("info", ("Read first packet.")); if ((pkt_length=cli_safe_read(mysql)) == packet_error) { @@ -2173,8 +3282,8 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user, errno); goto error; } + pkt_end= (char*)net->read_pos + pkt_length; /* 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", @@ -2186,31 +3295,29 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user, PROTOCOL_VERSION); goto error; } - end=strend((char*) net->read_pos+1); + server_version_end= 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 + Scramble is split into two parts because old clients do not understand long scrambles; here goes the first part. */ - strmake(mysql->scramble, end, SCRAMBLE_LENGTH_323); - end+= SCRAMBLE_LENGTH_323+1; + scramble_data= end; + scramble_data_len= SCRAMBLE_LENGTH_323 + 1; + scramble_plugin= old_password_plugin_name; + end+= scramble_data_len; - if (pkt_length >= (uint) (end+1 - (char*) net->read_pos)) + if (pkt_end >= end + 1) mysql->server_capabilities=uint2korr(end); - if (pkt_length >= (uint) (end+18 - (char*) net->read_pos)) + if (pkt_end >= end + 18) { /* New protocol with 16 bytes to describe server characteristics */ mysql->server_language=end[2]; mysql->server_status=uint2korr(end+3); + mysql->server_capabilities|= uint2korr(end+5) << 16; + pkt_scramble_len= end[7]; } 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)) @@ -2229,7 +3336,7 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user, &mysql->unix_socket,unix_socket ? (uint) strlen(unix_socket)+1 : (uint) 1, &mysql->server_version, - (uint) (end - (char*) net->read_pos), + (uint) (server_version_end - (char*) net->read_pos + 1), NullS) || !(mysql->user=my_strdup(user,MYF(0))) || !(mysql->passwd=my_strdup(passwd,MYF(0)))) @@ -2246,198 +3353,47 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user, 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; - -#ifdef HAVE_OPENSSL - 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 */ - 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; - 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; - -#ifdef HAVE_OPENSSL - if (client_flag & CLIENT_SSL) + if (pkt_end >= end + SCRAMBLE_LENGTH - SCRAMBLE_LENGTH_323 + 1) { - /* 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 + move the first scramble part - directly in the NET buffer - + to get a full continuous scramble. We've read all the header, + and can overwrite it now. */ - 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 */ - - 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) + memmove(end - SCRAMBLE_LENGTH_323, scramble_data, + SCRAMBLE_LENGTH_323); + scramble_data= end - SCRAMBLE_LENGTH_323; + if (mysql->server_capabilities & CLIENT_PLUGIN_AUTH) { - *end++= SCRAMBLE_LENGTH; - scramble(end, mysql->scramble, passwd); - end+= SCRAMBLE_LENGTH; + scramble_data_len= pkt_scramble_len; + scramble_plugin= scramble_data + scramble_data_len; + if (scramble_data + scramble_data_len > pkt_end) + scramble_data_len= pkt_end - scramble_data; } else { - scramble_323(end, mysql->scramble, passwd); - end+= SCRAMBLE_LENGTH_323 + 1; + scramble_data_len= pkt_end - scramble_data; + scramble_plugin= native_password_plugin_name; } } else - *end++= '\0'; /* empty password */ + mysql->server_capabilities&= ~CLIENT_SECURE_CONNECTION; + + mysql->client_flag= client_flag; - /* 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. + Part 2: invoke the plugin to send the authentication data to the server */ - 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); + if (run_plugin_auth(mysql, scramble_data, scramble_data_len, + scramble_plugin, db)) 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; - } - } + /* + Part 3: authenticated, finish the initialization of the connection + */ - if (client_flag & CLIENT_COMPRESS) /* We will use compression */ + if (mysql->client_flag & CLIENT_COMPRESS) /* We will use compression */ net->compress=1; #ifdef CHECK_LICENSE @@ -2445,7 +3401,7 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user, goto error; #endif - if (db && mysql_select_db(mysql, db)) + if (db && !mysql->db && mysql_select_db(mysql, db)) { if (mysql->net.last_errno == CR_SERVER_LOST) set_mysql_extended_error(mysql, CR_SERVER_LOST, unknown_sqlstate, @@ -2492,17 +3448,10 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user, } #endif -#ifndef TO_BE_DELETED - if (mysql->options.rpl_probe && mysql_rpl_probe(mysql)) - goto error; -#endif - DBUG_PRINT("exit", ("Mysql handler: 0x%lx", (long) mysql)); - reset_sigpipe(mysql); DBUG_RETURN(mysql); error: - reset_sigpipe(mysql); DBUG_PRINT("error",("message: %u/%s (%s)", net->last_errno, net->sqlstate, @@ -2511,35 +3460,13 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user, /* Free alloced memory */ end_server(mysql); mysql_close_free(mysql); - if (!(((ulong) client_flag) & CLIENT_REMEMBER_OPTIONS)) + if (!(client_flag & CLIENT_REMEMBER_OPTIONS)) mysql_close_free_options(mysql); } DBUG_RETURN(0); } -/* needed when we move MYSQL structure to a different address */ - -#ifndef TO_BE_DELETED -static void mysql_fix_pointers(MYSQL* mysql, MYSQL* old_mysql) -{ - MYSQL *tmp, *tmp_prev; - if (mysql->master == old_mysql) - mysql->master= mysql; - if (mysql->last_used_con == old_mysql) - mysql->last_used_con= mysql; - if (mysql->last_used_slave == old_mysql) - mysql->last_used_slave= mysql; - for (tmp_prev = mysql, tmp = mysql->next_slave; - tmp != old_mysql;tmp = tmp->next_slave) - { - tmp_prev= tmp; - } - tmp_prev->next_slave= mysql; -} -#endif - - my_bool mysql_reconnect(MYSQL *mysql) { MYSQL tmp_mysql; @@ -2558,8 +3485,7 @@ my_bool mysql_reconnect(MYSQL *mysql) mysql_init(&tmp_mysql); tmp_mysql.options= mysql->options; tmp_mysql.options.my_cnf_file= tmp_mysql.options.my_cnf_group= 0; - tmp_mysql.rpl_pivot= mysql->rpl_pivot; - + 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)) @@ -2593,7 +3519,6 @@ my_bool mysql_reconnect(MYSQL *mysql) mysql->free_me=0; mysql_close(mysql); *mysql=tmp_mysql; - mysql_fix_pointers(mysql, &tmp_mysql); /* adjust connection pointers */ net_clear(&mysql->net, 1); mysql->affected_rows= ~(my_ulonglong) 0; DBUG_RETURN(0); @@ -2614,7 +3539,7 @@ mysql_select_db(MYSQL *mysql, const char *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)); + my_free(mysql->db); mysql->db=my_strdup(db,MYF(MY_WME)); DBUG_RETURN(0); } @@ -2629,33 +3554,39 @@ 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)); + my_free(mysql->options.user); + my_free(mysql->options.host); + my_free(mysql->options.password); + my_free(mysql->options.unix_socket); + my_free(mysql->options.db); + my_free(mysql->options.my_cnf_file); + my_free(mysql->options.my_cnf_group); + my_free(mysql->options.charset_dir); + my_free(mysql->options.charset_name); + my_free(mysql->options.client_ip); 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)); + my_free(mysql->options.shared_memory_base_name); #endif /* HAVE_SMEM */ + if (mysql->options.extension) + { + my_free(mysql->options.extension->plugin_dir); + my_free(mysql->options.extension->default_auth); + my_free(mysql->options.extension); + } bzero((char*) &mysql->options,sizeof(mysql->options)); DBUG_VOID_RETURN; } @@ -2663,12 +3594,12 @@ static void mysql_close_free_options(MYSQL *mysql) 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)); + my_free(mysql->host_info); + my_free(mysql->user); + my_free(mysql->passwd); + my_free(mysql->db); #if defined(EMBEDDED_LIBRARY) || MYSQL_VERSION_ID >= 50100 - my_free(mysql->info_buffer,MYF(MY_ALLOW_ZERO_PTR)); + my_free(mysql->info_buffer); mysql->info_buffer= 0; #endif /* Clear pointers for better safety */ @@ -2771,29 +3702,12 @@ void STDCALL mysql_close(MYSQL *mysql) mysql_close_free_options(mysql); mysql_close_free(mysql); mysql_detach_stmt_list(&mysql->stmts, "mysql_close"); -#ifndef TO_BE_DELETED - /* free/close slave list */ - if (mysql->rpl_pivot) - { - MYSQL* tmp; - for (tmp = mysql->next_slave; tmp != mysql; ) - { - /* trick to avoid following freed pointer */ - MYSQL* tmp1 = tmp->next_slave; - mysql_close(tmp); - tmp = tmp1; - } - mysql->rpl_pivot=0; - } -#endif - if (mysql != mysql->master) - mysql_close(mysql->master); #ifndef MYSQL_SERVER if (mysql->thd) (*mysql->methods->free_embedded_thd)(mysql); #endif if (mysql->free_me) - my_free((uchar*) mysql,MYF(0)); + my_free(mysql); } DBUG_VOID_RETURN; } @@ -2807,12 +3721,6 @@ static my_bool cli_read_query_result(MYSQL *mysql) ulong length; DBUG_ENTER("cli_read_query_result"); - /* - Read from the connection which we actually used, which - could differ from the original connection if we have slaves - */ - mysql = mysql->last_used_con; - if ((length = cli_safe_read(mysql)) == packet_error) DBUG_RETURN(1); free_old_query(mysql); /* Free old result */ @@ -2887,23 +3795,6 @@ int STDCALL mysql_send_query(MYSQL* mysql, const char* query, ulong length) { DBUG_ENTER("mysql_send_query"); - DBUG_PRINT("enter",("rpl_parse: %d rpl_pivot: %d", - mysql->options.rpl_parse, mysql->rpl_pivot)); -#ifndef TO_BE_DELETED - if (mysql->options.rpl_parse && mysql->rpl_pivot) - { - switch (mysql_rpl_query_type(query, length)) { - case MYSQL_RPL_MASTER: - DBUG_RETURN(mysql_master_send_query(mysql, query, length)); - case MYSQL_RPL_SLAVE: - DBUG_RETURN(mysql_slave_send_query(mysql, query, length)); - case MYSQL_RPL_ADMIN: - break; /* fall through */ - } - } - mysql->last_used_con = mysql; -#endif - DBUG_RETURN(simple_command(mysql, COM_QUERY, (uchar*) query, length, 1)); } @@ -2930,8 +3821,7 @@ MYSQL_RES * STDCALL mysql_store_result(MYSQL *mysql) { MYSQL_RES *result; DBUG_ENTER("mysql_store_result"); - /* read from the actually used connection */ - mysql = mysql->last_used_con; + if (!mysql->fields) DBUG_RETURN(0); if (mysql->status != MYSQL_STATUS_GET_RESULT) @@ -2954,7 +3844,7 @@ MYSQL_RES * STDCALL mysql_store_result(MYSQL *mysql) if (!(result->data= (*mysql->methods->read_rows)(mysql,mysql->fields,mysql->field_count))) { - my_free((uchar*) result,MYF(0)); + my_free(result); DBUG_RETURN(0); } mysql->affected_rows= result->row_count= result->data->rows; @@ -2986,8 +3876,6 @@ static MYSQL_RES * cli_use_result(MYSQL *mysql) MYSQL_RES *result; DBUG_ENTER("cli_use_result"); - mysql = mysql->last_used_con; - if (!mysql->fields) DBUG_RETURN(0); if (mysql->status != MYSQL_STATUS_GET_RESULT) @@ -3004,7 +3892,7 @@ static MYSQL_RES * cli_use_result(MYSQL *mysql) 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)); + my_free(result); DBUG_RETURN(0); } result->fields= mysql->fields; @@ -3125,19 +4013,19 @@ mysql_options(MYSQL *mysql,enum mysql_option option, const void *arg) add_init_command(&mysql->options,arg); break; case MYSQL_READ_DEFAULT_FILE: - my_free(mysql->options.my_cnf_file,MYF(MY_ALLOW_ZERO_PTR)); + my_free(mysql->options.my_cnf_file); 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)); + my_free(mysql->options.my_cnf_group); 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)); + my_free(mysql->options.charset_dir); 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)); + my_free(mysql->options.charset_name); mysql->options.charset_name=my_strdup(arg,MYF(MY_WME)); break; case MYSQL_OPT_PROTOCOL: @@ -3146,7 +4034,7 @@ mysql_options(MYSQL *mysql,enum mysql_option option, const void *arg) 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)); + my_free(mysql->options.shared_memory_base_name); mysql->options.shared_memory_base_name=my_strdup(arg,MYF(MY_WME)); #endif break; @@ -3173,6 +4061,12 @@ mysql_options(MYSQL *mysql,enum mysql_option option, const void *arg) else mysql->options.client_flag&= ~CLIENT_SSL_VERIFY_SERVER_CERT; break; + case MYSQL_PLUGIN_DIR: + EXTENSION_SET_STRING(&mysql->options, plugin_dir, arg); + break; + case MYSQL_DEFAULT_AUTH: + EXTENSION_SET_STRING(&mysql->options, default_auth, arg); + break; default: DBUG_RETURN(1); } @@ -3276,4 +4170,104 @@ int STDCALL mysql_set_character_set(MYSQL *mysql, const char *cs_name) return mysql->net.last_errno; } +/** + client authentication plugin that does native MySQL authentication + using a 20-byte (4.1+) scramble +*/ +static int native_password_auth_client(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql) +{ + int pkt_len; + uchar *pkt; + + DBUG_ENTER("native_password_auth_client"); + + + if (((MCPVIO_EXT *)vio)->mysql_change_user) + { + /* + in mysql_change_user() the client sends the first packet. + we use the old scramble. + */ + pkt= (uchar*)mysql->scramble; + pkt_len= SCRAMBLE_LENGTH + 1; + } + else + { + /* read the scramble */ + if ((pkt_len= vio->read_packet(vio, &pkt)) < 0) + DBUG_RETURN(CR_ERROR); + + if (pkt_len != SCRAMBLE_LENGTH + 1) + DBUG_RETURN(CR_SERVER_HANDSHAKE_ERR); + + /* save it in MYSQL */ + memcpy(mysql->scramble, pkt, SCRAMBLE_LENGTH); + mysql->scramble[SCRAMBLE_LENGTH] = 0; + } + + if (mysql->passwd[0]) + { + char scrambled[SCRAMBLE_LENGTH + 1]; + DBUG_PRINT("info", ("sending scramble")); + scramble(scrambled, (char*)pkt, mysql->passwd); + if (vio->write_packet(vio, (uchar*)scrambled, SCRAMBLE_LENGTH)) + DBUG_RETURN(CR_ERROR); + } + else + { + DBUG_PRINT("info", ("no password")); + if (vio->write_packet(vio, 0, 0)) /* no password */ + DBUG_RETURN(CR_ERROR); + } + + DBUG_RETURN(CR_OK); +} + +/** + client authentication plugin that does old MySQL authentication + using an 8-byte (4.0-) scramble +*/ +static int old_password_auth_client(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql) +{ + uchar *pkt; + int pkt_len; + + DBUG_ENTER("old_password_auth_client"); + + if (((MCPVIO_EXT *)vio)->mysql_change_user) + { + /* + in mysql_change_user() the client sends the first packet. + we use the old scramble. + */ + pkt= (uchar*)mysql->scramble; + pkt_len= SCRAMBLE_LENGTH_323 + 1; + } + else + { + /* read the scramble */ + if ((pkt_len= vio->read_packet(vio, &pkt)) < 0) + DBUG_RETURN(CR_ERROR); + + if (pkt_len != SCRAMBLE_LENGTH_323 + 1 && + pkt_len != SCRAMBLE_LENGTH + 1) + DBUG_RETURN(CR_SERVER_HANDSHAKE_ERR); + + /* save it in MYSQL */ + memcpy(mysql->scramble, pkt, pkt_len); + mysql->scramble[pkt_len] = 0; + } + + if (mysql->passwd[0]) + { + char scrambled[SCRAMBLE_LENGTH_323 + 1]; + scramble_323(scrambled, (char*)pkt, mysql->passwd); + if (vio->write_packet(vio, (uchar*)scrambled, SCRAMBLE_LENGTH_323 + 1)) + DBUG_RETURN(CR_ERROR); + } + else + if (vio->write_packet(vio, 0, 0)) /* no password */ + DBUG_RETURN(CR_ERROR); + DBUG_RETURN(CR_OK); +} diff --git a/dep/mysqllite/sql-common/client_plugin.c b/dep/mysqllite/sql-common/client_plugin.c new file mode 100644 index 0000000000000..6b4cca8aeeab8 --- /dev/null +++ b/dep/mysqllite/sql-common/client_plugin.c @@ -0,0 +1,471 @@ +/* Copyright (C) 2010 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 + + Support code for the client side (libmysql) plugins + + Client plugins are somewhat different from server plugins, they are simpler. + + They do not need to be installed or in any way explicitly loaded on the + client, they are loaded automatically on demand. + One client plugin per shared object, soname *must* match the plugin name. + + There is no reference counting and no unloading either. +*/ + +#include +#include "mysql.h" +#include +#include +#include + +#include +#include "errmsg.h" +#include + +struct st_client_plugin_int { + struct st_client_plugin_int *next; + void *dlhandle; + struct st_mysql_client_plugin *plugin; +}; + +static my_bool initialized= 0; +static MEM_ROOT mem_root; + +static const char *plugin_declarations_sym= "_mysql_client_plugin_declaration_"; +static uint plugin_version[MYSQL_CLIENT_MAX_PLUGINS]= +{ + 0, /* these two are taken by Connector/C */ + 0, /* these two are taken by Connector/C */ + MYSQL_CLIENT_AUTHENTICATION_PLUGIN_INTERFACE_VERSION +}; + +/* + Loaded plugins are stored in a linked list. + The list is append-only, the elements are added to the head (like in a stack). + The elements are added under a mutex, but the list can be read and traversed + without any mutex because once an element is added to the list, it stays + there. The main purpose of a mutex is to prevent two threads from + loading the same plugin twice in parallel. +*/ +struct st_client_plugin_int *plugin_list[MYSQL_CLIENT_MAX_PLUGINS]; +static pthread_mutex_t LOCK_load_client_plugin; + +static int is_not_initialized(MYSQL *mysql, const char *name) +{ + if (initialized) + return 0; + + set_mysql_extended_error(mysql, CR_AUTH_PLUGIN_CANNOT_LOAD, + unknown_sqlstate, ER(CR_AUTH_PLUGIN_CANNOT_LOAD), + name, "not initialized"); + return 1; +} + +/** + finds a plugin in the list + + @param name plugin name to search for + @param type plugin type + + @note this does NOT necessarily need a mutex, take care! + + @retval a pointer to a found plugin or 0 +*/ +static struct st_mysql_client_plugin * +find_plugin(const char *name, int type) +{ + struct st_client_plugin_int *p; + + DBUG_ASSERT(initialized); + DBUG_ASSERT(type >= 0 && type < MYSQL_CLIENT_MAX_PLUGINS); + if (type < 0 || type >= MYSQL_CLIENT_MAX_PLUGINS) + return 0; + + for (p= plugin_list[type]; p; p= p->next) + { + if (strcmp(p->plugin->name, name) == 0) + return p->plugin; + } + return NULL; +} + +/** + verifies the plugin and adds it to the list + + @param mysql MYSQL structure (for error reporting) + @param plugin plugin to install + @param dlhandle a handle to the shared object (returned by dlopen) + or 0 if the plugin was not dynamically loaded + @param argc number of arguments in the 'va_list args' + @param args arguments passed to the plugin initialization function + + @retval a pointer to an installed plugin or 0 +*/ +static struct st_mysql_client_plugin * +add_plugin(MYSQL *mysql, struct st_mysql_client_plugin *plugin, void *dlhandle, + int argc, va_list args) +{ + const char *errmsg; + struct st_client_plugin_int plugin_int, *p; + char errbuf[1024]; + + DBUG_ASSERT(initialized); + + plugin_int.plugin= plugin; + plugin_int.dlhandle= dlhandle; + + if (plugin->type >= MYSQL_CLIENT_MAX_PLUGINS) + { + errmsg= "Unknown client plugin type"; + goto err1; + } + + if (plugin->interface_version < plugin_version[plugin->type] || + (plugin->interface_version >> 8) > + (plugin_version[plugin->type] >> 8)) + { + errmsg= "Incompatible client plugin interface"; + goto err1; + } + + /* Call the plugin initialization function, if any */ + if (plugin->init && plugin->init(errbuf, sizeof(errbuf), argc, args)) + { + errmsg= errbuf; + goto err1; + } + + p= (struct st_client_plugin_int *) + memdup_root(&mem_root, &plugin_int, sizeof(plugin_int)); + + if (!p) + { + errmsg= "Out of memory"; + goto err2; + } + + safe_mutex_assert_owner(&LOCK_load_client_plugin); + + p->next= plugin_list[plugin->type]; + plugin_list[plugin->type]= p; + + return plugin; + +err2: + if (plugin->deinit) + plugin->deinit(); +err1: + set_mysql_extended_error(mysql, CR_AUTH_PLUGIN_CANNOT_LOAD, unknown_sqlstate, + ER(CR_AUTH_PLUGIN_CANNOT_LOAD), plugin->name, + errmsg); + if (dlhandle) + dlclose(dlhandle); + return NULL; +} + +/** + Loads plugins which are specified in the environment variable + LIBMYSQL_PLUGINS. + + Multiple plugins must be separated by semicolon. This function doesn't + return or log an error. + + The function is be called by mysql_client_plugin_init + + @todo + Support extended syntax, passing parameters to plugins, for example + LIBMYSQL_PLUGINS="plugin1(param1,param2);plugin2;..." + or + LIBMYSQL_PLUGINS="plugin1=int:param1,str:param2;plugin2;..." +*/ +static void load_env_plugins(MYSQL *mysql) +{ + char *plugs, *free_env, *s= getenv("LIBMYSQL_PLUGINS"); + + /* no plugins to load */ + if(!s) + return; + + free_env= plugs= my_strdup(s, MYF(MY_WME)); + + do { + if ((s= strchr(plugs, ';'))) + *s= '\0'; + mysql_load_plugin(mysql, plugs, -1, 0); + plugs= s + 1; + } while (s); + + my_free(free_env); +} + +/********** extern functions to be used by libmysql *********************/ + +/** + Initializes the client plugin layer. + + This function must be called before any other client plugin function. + + @retval 0 successful + @retval != 0 error occured +*/ +int mysql_client_plugin_init() +{ + MYSQL mysql; + struct st_mysql_client_plugin **builtin; + + if (initialized) + return 0; + + bzero(&mysql, sizeof(mysql)); /* dummy mysql for set_mysql_extended_error */ + + pthread_mutex_init(&LOCK_load_client_plugin, MY_MUTEX_INIT_SLOW); + init_alloc_root(&mem_root, 128, 128); + + bzero(&plugin_list, sizeof(plugin_list)); + + initialized= 1; + + pthread_mutex_lock(&LOCK_load_client_plugin); + + for (builtin= mysql_client_builtins; *builtin; builtin++) + add_plugin(&mysql, *builtin, 0, 0, 0); + + pthread_mutex_unlock(&LOCK_load_client_plugin); + + load_env_plugins(&mysql); + + return 0; +} + +/** + Deinitializes the client plugin layer. + + Unloades all client plugins and frees any associated resources. +*/ +void mysql_client_plugin_deinit() +{ + int i; + struct st_client_plugin_int *p; + + if (!initialized) + return; + + for (i=0; i < MYSQL_CLIENT_MAX_PLUGINS; i++) + for (p= plugin_list[i]; p; p= p->next) + { + if (p->plugin->deinit) + p->plugin->deinit(); + if (p->dlhandle) + dlclose(p->dlhandle); + } + + bzero(&plugin_list, sizeof(plugin_list)); + initialized= 0; + free_root(&mem_root, MYF(0)); + pthread_mutex_destroy(&LOCK_load_client_plugin); +} + +/************* public facing functions, for client consumption *********/ + +/* see for a full description */ +struct st_mysql_client_plugin * +mysql_client_register_plugin(MYSQL *mysql, + struct st_mysql_client_plugin *plugin) +{ + if (is_not_initialized(mysql, plugin->name)) + return NULL; + + pthread_mutex_lock(&LOCK_load_client_plugin); + + /* make sure the plugin wasn't loaded meanwhile */ + if (find_plugin(plugin->name, plugin->type)) + { + set_mysql_extended_error(mysql, CR_AUTH_PLUGIN_CANNOT_LOAD, + unknown_sqlstate, ER(CR_AUTH_PLUGIN_CANNOT_LOAD), + plugin->name, "it is already loaded"); + plugin= NULL; + } + else + plugin= add_plugin(mysql, plugin, 0, 0, 0); + + pthread_mutex_unlock(&LOCK_load_client_plugin); + return plugin; +} + +/* see for a full description */ +struct st_mysql_client_plugin * +mysql_load_plugin_v(MYSQL *mysql, const char *name, int type, + int argc, va_list args) +{ + const char *errmsg; + char dlpath[FN_REFLEN+1]; + void *sym, *dlhandle; + struct st_mysql_client_plugin *plugin; +#ifdef _WIN32 + char win_errormsg[2048]; +#endif + + DBUG_ENTER ("mysql_load_plugin_v"); + DBUG_PRINT ("entry", ("name=%s type=%d int argc=%d", name, type, argc)); + if (is_not_initialized(mysql, name)) + { + DBUG_PRINT ("leave", ("mysql not initialized")); + DBUG_RETURN (NULL); + } + + pthread_mutex_lock(&LOCK_load_client_plugin); + + /* make sure the plugin wasn't loaded meanwhile */ + if (type >= 0 && find_plugin(name, type)) + { + errmsg= "it is already loaded"; + goto err; + } + + /* Compile dll path */ + strxnmov(dlpath, sizeof(dlpath) - 1, + mysql->options.extension && mysql->options.extension->plugin_dir ? + mysql->options.extension->plugin_dir : PLUGINDIR, "/", + name, SO_EXT, NullS); + + DBUG_PRINT ("info", ("dlopeninig %s", dlpath)); + /* Open new dll handle */ + if (!(dlhandle= dlopen(dlpath, RTLD_NOW))) + { +#if defined(__APPLE__) + /* Apple supports plugins with .so also, so try this as well */ + strxnmov(dlpath, sizeof(dlpath) - 1, + mysql->options.extension && mysql->options.extension->plugin_dir ? + mysql->options.extension->plugin_dir : PLUGINDIR, "/", + name, ".so", NullS); + if ((dlhandle= dlopen(dlpath, RTLD_NOW))) + goto have_plugin; +#endif + + DBUG_PRINT ("info", ("failed to dlopen")); +#ifdef _WIN32 + if(FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, + 0, GetLastError(), 0, win_errormsg, 2048, NULL)) + errmsg= win_errormsg; + else + errmsg= ""; +#else + errmsg= dlerror(); +#endif + goto err; + } + +#if defined(__APPLE__) +have_plugin: +#endif + if (!(sym= dlsym(dlhandle, plugin_declarations_sym))) + { + errmsg= "not a plugin"; + dlclose(dlhandle); + goto err; + } + + plugin= (struct st_mysql_client_plugin*)sym; + + if (type >=0 && type != plugin->type) + { + errmsg= "type mismatch"; + goto err; + } + + if (strcmp(name, plugin->name)) + { + errmsg= "name mismatch"; + goto err; + } + + if (type < 0 && find_plugin(name, plugin->type)) + { + errmsg= "it is already loaded"; + goto err; + } + + plugin= add_plugin(mysql, plugin, dlhandle, argc, args); + + pthread_mutex_unlock(&LOCK_load_client_plugin); + + DBUG_PRINT ("leave", ("plugin loaded ok")); + DBUG_RETURN (plugin); + +err: + pthread_mutex_unlock(&LOCK_load_client_plugin); + DBUG_PRINT ("leave", ("plugin load error : %s", errmsg)); + set_mysql_extended_error(mysql, CR_AUTH_PLUGIN_CANNOT_LOAD, unknown_sqlstate, + ER(CR_AUTH_PLUGIN_CANNOT_LOAD), name, errmsg); + DBUG_RETURN (NULL); +} + +/* see for a full description */ +struct st_mysql_client_plugin * +mysql_load_plugin(MYSQL *mysql, const char *name, int type, int argc, ...) +{ + struct st_mysql_client_plugin *p; + va_list args; + va_start(args, argc); + p= mysql_load_plugin_v(mysql, name, type, argc, args); + va_end(args); + return p; +} + +/* see for a full description */ +struct st_mysql_client_plugin * +mysql_client_find_plugin(MYSQL *mysql, const char *name, int type) +{ + struct st_mysql_client_plugin *p; + + DBUG_ENTER ("mysql_client_find_plugin"); + DBUG_PRINT ("entry", ("name=%s, type=%d", name, type)); + if (is_not_initialized(mysql, name)) + DBUG_RETURN (NULL); + + if (type < 0 || type >= MYSQL_CLIENT_MAX_PLUGINS) + { + set_mysql_extended_error(mysql, CR_AUTH_PLUGIN_CANNOT_LOAD, unknown_sqlstate, + ER(CR_AUTH_PLUGIN_CANNOT_LOAD), name, + "invalid type"); + } + + if ((p= find_plugin(name, type))) + { + DBUG_PRINT ("leave", ("found %p", p)); + DBUG_RETURN (p); + } + + /* not found, load it */ + p= mysql_load_plugin(mysql, name, type, 0); + DBUG_PRINT ("leave", ("loaded %p", p)); + DBUG_RETURN (p); +} + + +/* see for a full description */ +int STDCALL mysql_plugin_options(struct st_mysql_client_plugin *plugin, + const char *option, + const void *value) +{ + DBUG_ENTER("mysql_plugin_options"); + /* does the plugin support options call? */ + if (!plugin || !plugin->options) + DBUG_RETURN(1); + DBUG_RETURN(plugin->options(option, value)); +} diff --git a/dep/mysqllite/sql-common/my_time.c b/dep/mysqllite/sql-common/my_time.c index c4e917801d553..38384600fc168 100644 --- a/dep/mysqllite/sql-common/my_time.c +++ b/dep/mysqllite/sql-common/my_time.c @@ -76,7 +76,7 @@ uint calc_days_in_year(uint year) */ my_bool check_date(const MYSQL_TIME *ltime, my_bool not_zero_date, - ulong flags, int *was_cut) + ulonglong flags, int *was_cut) { if (not_zero_date) { @@ -158,7 +158,7 @@ my_bool check_date(const MYSQL_TIME *ltime, my_bool not_zero_date, enum enum_mysql_timestamp_type str_to_datetime(const char *str, uint length, MYSQL_TIME *l_time, - uint flags, int *was_cut) + ulonglong flags, int *was_cut) { uint field_length, UNINIT_VAR(year_length), digits, i, number_of_fields; uint date[MAX_DATE_PARTS], date_len[MAX_DATE_PARTS]; @@ -1100,7 +1100,7 @@ int my_TIME_to_str(const MYSQL_TIME *l_time, char *to) */ longlong number_to_datetime(longlong nr, MYSQL_TIME *time_res, - uint flags, int *was_cut) + ulonglong flags, int *was_cut) { long part1,part2; @@ -1127,7 +1127,12 @@ longlong number_to_datetime(longlong nr, MYSQL_TIME *time_res, nr= (nr+19000000L)*1000000L; /* YYMMDD, year: 1970-1999 */ goto ok; } - if (nr < 10000101L) + /* + Though officially we support DATE values from 1000-01-01 only, one can + easily insert a value like 1-1-1. So, for consistency reasons such dates + are allowed when TIME_FUZZY_DATE is set. + */ + if (nr < 10000101L && !(flags & TIME_FUZZY_DATE)) goto err; if (nr <= 99991231L) { diff --git a/dep/mysqllite/sql/net_serv.cc b/dep/mysqllite/sql/net_serv.cc index 38ab3a7013612..d60e2051ccdd3 100644 --- a/dep/mysqllite/sql/net_serv.cc +++ b/dep/mysqllite/sql/net_serv.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -35,7 +35,6 @@ */ #include #include -#include #include #include #include @@ -44,9 +43,7 @@ #include #include #include -#ifdef __NETWARE__ -#include -#endif +#include "probes_mysql.h" #ifdef EMBEDDED_LIBRARY #undef MYSQL_SERVER @@ -59,15 +56,17 @@ 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. + This gives an error if a too big packet is found. + The server can change this, 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. */ +#ifndef NO_ALARM #define NO_ALARM #endif +#endif #ifndef NO_ALARM #include "my_pthread.h" @@ -81,17 +80,16 @@ void sql_print_error(const char *format,...); #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 + extern, but as it's hard to include sql_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; -extern pthread_mutex_t LOCK_bytes_sent , LOCK_bytes_received; #ifndef MYSQL_INSTANCE_MANAGER #ifdef HAVE_QUERY_CACHE #define USE_QUERY_CACHE -extern void query_cache_init_query(NET *net); -extern void query_cache_insert(NET *net, const char *packet, ulong length); +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 */ @@ -120,18 +118,14 @@ my_bool my_net_init(NET *net, Vio* vio) MYF(MY_WME)))) DBUG_RETURN(1); net->buff_end=net->buff+net->max_packet; - net->error=0; net->return_errno=0; net->return_status=0; + 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; -#ifdef USE_QUERY_CACHE - query_cache_init_query(net); -#else - net->query_cache_query= 0; -#endif + net->unused= 0; #if defined(MYSQL_SERVER) && !defined(EMBEDDED_LIBRARY) net->skip_big_packet= FALSE; #endif @@ -155,7 +149,7 @@ my_bool my_net_init(NET *net, Vio* vio) void net_end(NET *net) { DBUG_ENTER("net_end"); - my_free(net->buff,MYF(MY_ALLOW_ZERO_PTR)); + my_free(net->buff); net->buff=0; DBUG_VOID_RETURN; } @@ -369,8 +363,13 @@ my_bool my_net_write(NET *net,const uchar *packet,size_t len) { uchar buff[NET_HEADER_SIZE]; + int 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. @@ -383,7 +382,10 @@ my_net_write(NET *net,const uchar *packet,size_t len) 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; } @@ -391,11 +393,16 @@ my_net_write(NET *net,const uchar *packet,size_t len) 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 - return test(net_write_buff(net,packet,len)); + rc= test(net_write_buff(net,packet,len)); + MYSQL_NET_WRITE_DONE(rc); + return rc; } /** @@ -433,9 +440,12 @@ net_write_command(NET *net,uchar command, size_t length=len+1+head_len; /* 1 extra byte for command */ uchar buff[NET_HEADER_SIZE+1]; uint header_size=NET_HEADER_SIZE+1; + int 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) @@ -449,7 +459,10 @@ net_write_command(NET *net,uchar command, 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; @@ -460,9 +473,11 @@ net_write_command(NET *net,uchar command, } int3store(buff,length); buff[3]= (uchar) net->pkt_nr++; - DBUG_RETURN(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))); + 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); } /** @@ -563,7 +578,7 @@ net_real_write(NET *net,const uchar *packet, size_t len) DBUG_ENTER("net_real_write"); #if defined(MYSQL_SERVER) && defined(USE_QUERY_CACHE) - query_cache_insert(net, (char*) packet, len); + query_cache_insert((char*) packet, len, net->pkt_nr); #endif if (net->error == 2) @@ -678,7 +693,7 @@ net_real_write(NET *net,const uchar *packet, size_t len) #endif #ifdef HAVE_COMPRESS if (net->compress) - my_free((char*) packet,MYF(0)); + my_free((void*) packet); #endif if (thr_alarm_in_use(&alarmed)) { @@ -1004,6 +1019,8 @@ my_net_read(NET *net) { size_t len, complen; + MYSQL_NET_READ_START(); + #ifdef HAVE_COMPRESS if (!net->compress) { @@ -1027,6 +1044,7 @@ my_net_read(NET *net) 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 } @@ -1110,7 +1128,10 @@ my_net_read(NET *net) 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)) { @@ -1119,6 +1140,7 @@ my_net_read(NET *net) #ifdef MYSQL_SERVER my_error(ER_NET_UNCOMPRESS_ERROR, MYF(0)); #endif + MYSQL_NET_READ_DONE(1, 0); return packet_error; } buf_length+= complen; @@ -1133,6 +1155,7 @@ my_net_read(NET *net) net->read_pos[len]=0; /* Safeguard for mysql_use_result */ } #endif /* HAVE_COMPRESS */ + MYSQL_NET_READ_DONE(0, len); return len; } diff --git a/dep/mysqllite/sql/password.c b/dep/mysqllite/sql/password.c index 9204c660b778a..3b69705cc8754 100644 --- a/dep/mysqllite/sql/password.c +++ b/dep/mysqllite/sql/password.c @@ -58,6 +58,7 @@ *****************************************************************************/ +#include #include #include #include @@ -222,13 +223,13 @@ void scramble_323(char *to, const char *message, const char *password) */ my_bool -check_scramble_323(const char *scrambled, const char *message, +check_scramble_323(const unsigned char *scrambled, const char *message, ulong *hash_pass) { struct rand_struct rand_st; ulong hash_message[2]; - char buff[16],*to,extra; /* Big enough for check */ - const char *pos; + uchar buff[16],*to,extra; /* Big enough for check */ + const uchar *pos; hash_password(hash_message, message, SCRAMBLE_LENGTH_323); randominit(&rand_st,hash_pass[0] ^ hash_message[0], @@ -243,7 +244,7 @@ check_scramble_323(const char *scrambled, const char *message, to=buff; while (*scrambled) { - if (*scrambled++ != (char) (*to++ ^ extra)) + if (*scrambled++ != (uchar) (*to++ ^ extra)) return 1; /* Wrong password */ } return 0; @@ -509,7 +510,7 @@ scramble(char *to, const char *message, const char *password) */ my_bool -check_scramble(const char *scramble_arg, const char *message, +check_scramble(const uchar *scramble_arg, const char *message, const uint8 *hash_stage2) { SHA1_CONTEXT sha1_context; @@ -522,7 +523,7 @@ check_scramble(const char *scramble_arg, const char *message, 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); + my_crypt((char *) buf, buf, 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); diff --git a/dep/mysqllite/strings/CHARSET_INFO.txt b/dep/mysqllite/strings/CHARSET_INFO.txt index bb8e40025c7b4..6f0a810be372b 100644 --- a/dep/mysqllite/strings/CHARSET_INFO.txt +++ b/dep/mysqllite/strings/CHARSET_INFO.txt @@ -208,14 +208,11 @@ charpos() - calculates the offset of the given position in the string. Used in SQL functions LEFT(), RIGHT(), SUBSTRING(), INSERT() -well_formed_length() - - finds the length of correctly formed multi-byte beginning. - Used in INSERTs to cut a beginning of the given string - which is - a) "well formed" according to the given character set. +well_formed_len() + - returns length of a given multi-byte string in bytes + Used in INSERTs to shorten the given string so it + a) is "well formed" according to the given character set b) can fit into the given data type - Terminates the string in the good position, taking in account - multi-byte character boundaries. lengthsp() - returns the length of the given string without trailing spaces. diff --git a/dep/mysqllite/strings/ChangeLog b/dep/mysqllite/strings/ChangeLog deleted file mode 100644 index 2d31f2946a1e0..0000000000000 --- a/dep/mysqllite/strings/ChangeLog +++ /dev/null @@ -1,38 +0,0 @@ -Thu May 20 13:45:15 1993 Michael Widenius (monty at bitch) - - * changed itoa() and ltoa() to use the same interface as microsoft:s - and zortech:s libraryes. - -Sun Mar 24 00:30:34 1991 Michael Widenius (monty at LYNX) - - * Changed int2str to return BIG converted chars. - -Sun Feb 24 00:22:54 1991 Michael Widenius (monty at LYNX) - - * Added new function strcend(string,char). Its eqvialent to - if (!(a=strchr(string,char))) - a=strend(string); - -Tue Oct 16 18:53:19 1990 Michael Widenius (monty at LYNX) - - * Added define BAD_STRING_COMPILER to set define strmov() - if compiler is very bad at stringoperations. - * Changed to use cc on sun-systems instead of gcc. - -Sat Sep 29 18:42:31 1990 Michael Widenius (monty at LYNX) - - * Added my_atof for sparc system to get some speed. - -Sun Mar 11 16:35:59 1990 Monty (monty at monty) - - * strnmov() was changed to not fill to-string with null. - * strmake() changed to point at closing null. - -Wed Feb 7 20:15:34 1990 David Axmark (davida at isil) - - * Made functon strinrstr that is reverse search. - -Fri Dec 2 03:37:59 1988 Monty (monty at monty) - - * Fixed bug in strcont; It didn't return first found character in - set. diff --git a/dep/mysqllite/strings/bmove.c b/dep/mysqllite/strings/bmove.c deleted file mode 100644 index ae9641a5d5883..0000000000000 --- a/dep/mysqllite/strings/bmove.c +++ /dev/null @@ -1,80 +0,0 @@ -/* 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/dep/mysqllite/strings/bmove_upp-sparc.s b/dep/mysqllite/strings/bmove_upp-sparc.s deleted file mode 100644 index f745f0fc6136f..0000000000000 --- a/dep/mysqllite/strings/bmove_upp-sparc.s +++ /dev/null @@ -1,40 +0,0 @@ -! Copyright (C) 2000, 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_upp-sparc.s" -.section ".text" - .align 4 - .global bmove_upp - .type bmove_upp,#function - .proc 020 -bmove_upp: - subcc %o2, 1, %o2 ! o2= len - bcs .end - nop -.loop: - sub %o1, 1, %o1 - ldub [%o1], %o3 - sub %o0, 1, %o0 - subcc %o2, 1, %o2 - bcc .loop - stb %o3, [%o0] -.end: - retl - nop -.bmove_upp_end: - .size bmove_upp,.bmove_upp_end-bmove_upp - .ident "Matt Wagner & Monty" diff --git a/dep/mysqllite/strings/bmove_upp.c b/dep/mysqllite/strings/bmove_upp.c index fb47bda2d1d1b..05e786837f442 100644 --- a/dep/mysqllite/strings/bmove_upp.c +++ b/dep/mysqllite/strings/bmove_upp.c @@ -25,26 +25,8 @@ #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/dep/mysqllite/strings/ctype-big5.c b/dep/mysqllite/strings/ctype-big5.c index 2cb40c266d225..3007d76a5a48c 100644 --- a/dep/mysqllite/strings/ctype-big5.c +++ b/dep/mysqllite/strings/ctype-big5.c @@ -47,7 +47,7 @@ #define big5head(e) ((uchar)(e>>8)) #define big5tail(e) ((uchar)(e&0xff)) -static uchar NEAR ctype_big5[257] = +static uchar ctype_big5[257] = { 0, /* For standard library */ 32,32,32,32,32,32,32,32,32,40,40,40,40,40,32,32, @@ -68,7 +68,7 @@ static uchar NEAR ctype_big5[257] = 3,3,3,3,3,3,3,3,3,3,0,0,0,0,0,0, }; -static uchar NEAR to_lower_big5[]= +static uchar to_lower_big5[]= { '\000','\001','\002','\003','\004','\005','\006','\007', '\010','\011','\012','\013','\014','\015','\016','\017', @@ -104,7 +104,7 @@ static uchar NEAR to_lower_big5[]= (uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377', }; -static uchar NEAR to_upper_big5[]= +static uchar to_upper_big5[]= { '\000','\001','\002','\003','\004','\005','\006','\007', '\010','\011','\012','\013','\014','\015','\016','\017', @@ -140,7 +140,7 @@ static uchar NEAR to_upper_big5[]= (uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377', }; -static uchar NEAR sort_order_big5[]= +static uchar sort_order_big5[]= { '\000','\001','\002','\003','\004','\005','\006','\007', '\010','\011','\012','\013','\014','\015','\016','\017', @@ -176,6 +176,623 @@ static uchar NEAR sort_order_big5[]= (uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377', }; + +static MY_UNICASE_INFO cA2[256]= +{ + /* A200-A20F */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + /* A210-A21F */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + /* A220-A22F */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + /* A230-A23F */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + /* A240-A24F */ + {0xA240,0xA240,0xFFFD}, + {0xA241,0xA241,0xFF0F}, + {0xA242,0xA242,0xFF3C}, + {0xA243,0xA243,0xFF04}, + {0xA244,0xA244,0x00A5}, + {0xA245,0xA245,0x3012}, + {0xA246,0xA246,0x00A2}, + {0xA247,0xA247,0x00A3}, + {0xA248,0xA248,0xFF05}, + {0xA249,0xA249,0xFF20}, + {0xA24A,0xA24A,0x2103}, + {0xA24B,0xA24B,0x2109}, + {0xA24C,0xA24C,0xFE69}, + {0xA24D,0xA24D,0xFE6A}, + {0xA24E,0xA24E,0xFE6B}, + {0xA24F,0xA24F,0x33D5}, + /* A250-A25F */ + {0xA250,0xA250,0x339C}, + {0xA251,0xA251,0x339D}, + {0xA252,0xA252,0x339E}, + {0xA253,0xA253,0x33CE}, + {0xA254,0xA254,0x33A1}, + {0xA255,0xA255,0x338E}, + {0xA256,0xA256,0x338F}, + {0xA257,0xA257,0x33C4}, + {0xA258,0xA258,0x00B0}, + {0xA259,0xA259,0x5159}, + {0xA25A,0xA25A,0x515B}, + {0xA25B,0xA25B,0x515E}, + {0xA25C,0xA25C,0x515D}, + {0xA25D,0xA25D,0x5161}, + {0xA25E,0xA25E,0x5163}, + {0xA25F,0xA25F,0x55E7}, + /* A260-A26F */ + {0xA260,0xA260,0x74E9}, + {0xA261,0xA261,0x7CCE}, + {0xA262,0xA262,0x2581}, + {0xA263,0xA263,0x2582}, + {0xA264,0xA264,0x2583}, + {0xA265,0xA265,0x2584}, + {0xA266,0xA266,0x2585}, + {0xA267,0xA267,0x2586}, + {0xA268,0xA268,0x2587}, + {0xA269,0xA269,0x2588}, + {0xA26A,0xA26A,0x258F}, + {0xA26B,0xA26B,0x258E}, + {0xA26C,0xA26C,0x258D}, + {0xA26D,0xA26D,0x258C}, + {0xA26E,0xA26E,0x258B}, + {0xA26F,0xA26F,0x258A}, + /* A270-A27F */ + {0xA270,0xA270,0x2589}, + {0xA271,0xA271,0x253C}, + {0xA272,0xA272,0x2534}, + {0xA273,0xA273,0x252C}, + {0xA274,0xA274,0x2524}, + {0xA275,0xA275,0x251C}, + {0xA276,0xA276,0x2594}, + {0xA277,0xA277,0x2500}, + {0xA278,0xA278,0x2502}, + {0xA279,0xA279,0x2595}, + {0xA27A,0xA27A,0x250C}, + {0xA27B,0xA27B,0x2510}, + {0xA27C,0xA27C,0x2514}, + {0xA27D,0xA27D,0x2518}, + {0xA27E,0xA27E,0x256D}, + {0x0000,0x0000,0x0000}, + /* A280-A28F */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + /* A290-A29F */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + /* A2A0-A2AF */ + {0x0000,0x0000,0x0000}, + {0xA2A1,0xA2A1,0x256E}, + {0xA2A2,0xA2A2,0x2570}, + {0xA2A3,0xA2A3,0x256F}, + {0xA2A4,0xA2A4,0x2550}, + {0xA2A5,0xA2A5,0x255E}, + {0xA2A6,0xA2A6,0x256A}, + {0xA2A7,0xA2A7,0x2561}, + {0xA2A8,0xA2A8,0x25E2}, + {0xA2A9,0xA2A9,0x25E3}, + {0xA2AA,0xA2AA,0x25E5}, + {0xA2AB,0xA2AB,0x25E4}, + {0xA2AC,0xA2AC,0x2571}, + {0xA2AD,0xA2AD,0x2572}, + {0xA2AE,0xA2AE,0x2573}, + {0xA2AF,0xA2AF,0xFF10}, + /* A2B0-A2BF */ + {0xA2B0,0xA2B0,0xFF11}, + {0xA2B1,0xA2B1,0xFF12}, + {0xA2B2,0xA2B2,0xFF13}, + {0xA2B3,0xA2B3,0xFF14}, + {0xA2B4,0xA2B4,0xFF15}, + {0xA2B5,0xA2B5,0xFF16}, + {0xA2B6,0xA2B6,0xFF17}, + {0xA2B7,0xA2B7,0xFF18}, + {0xA2B8,0xA2B8,0xFF19}, + {0xA2B9,0xA2B9,0x2160}, + {0xA2BA,0xA2BA,0x2161}, + {0xA2BB,0xA2BB,0x2162}, + {0xA2BC,0xA2BC,0x2163}, + {0xA2BD,0xA2BD,0x2164}, + {0xA2BE,0xA2BE,0x2165}, + {0xA2BF,0xA2BF,0x2166}, + /* A2C0-A2CF */ + {0xA2C0,0xA2C0,0x2167}, + {0xA2C1,0xA2C1,0x2168}, + {0xA2C2,0xA2C2,0x2169}, + {0xA2C3,0xA2C3,0x3021}, + {0xA2C4,0xA2C4,0x3022}, + {0xA2C5,0xA2C5,0x3023}, + {0xA2C6,0xA2C6,0x3024}, + {0xA2C7,0xA2C7,0x3025}, + {0xA2C8,0xA2C8,0x3026}, + {0xA2C9,0xA2C9,0x3027}, + {0xA2CA,0xA2CA,0x3028}, + {0xA2CB,0xA2CB,0x3029}, + {0xA2CC,0xA2CC,0xFFFD}, + {0xA2CD,0xA2CD,0x5344}, + {0xA2CE,0xA2CE,0xFFFD}, + {0xA2CF,0xA2E9,0xFF21}, + /* A2D0-A2DF */ + {0xA2D0,0xA2EA,0xFF22}, + {0xA2D1,0xA2EB,0xFF23}, + {0xA2D2,0xA2EC,0xFF24}, + {0xA2D3,0xA2ED,0xFF25}, + {0xA2D4,0xA2EE,0xFF26}, + {0xA2D5,0xA2EF,0xFF27}, + {0xA2D6,0xA2F0,0xFF28}, + {0xA2D7,0xA2F1,0xFF29}, + {0xA2D8,0xA2F2,0xFF2A}, + {0xA2D9,0xA2F3,0xFF2B}, + {0xA2DA,0xA2F4,0xFF2C}, + {0xA2DB,0xA2F5,0xFF2D}, + {0xA2DC,0xA2F6,0xFF2E}, + {0xA2DD,0xA2F7,0xFF2F}, + {0xA2DE,0xA2F8,0xFF30}, + {0xA2DF,0xA2F9,0xFF31}, + /* A2E0-A2EF */ + {0xA2E0,0xA2FA,0xFF32}, + {0xA2E1,0xA2FB,0xFF33}, + {0xA2E2,0xA2FC,0xFF34}, + {0xA2E3,0xA2FD,0xFF35}, + {0xA2E4,0xA2FE,0xFF36}, + {0xA2E5,0xA340,0xFF37}, + {0xA2E6,0xA341,0xFF38}, + {0xA2E7,0xA342,0xFF39}, + {0xA2E8,0xA343,0xFF3A}, + {0xA2CF,0xA2E9,0xFF41}, + {0xA2D0,0xA2EA,0xFF42}, + {0xA2D1,0xA2EB,0xFF43}, + {0xA2D2,0xA2EC,0xFF44}, + {0xA2D3,0xA2ED,0xFF45}, + {0xA2D4,0xA2EE,0xFF46}, + {0xA2D5,0xA2EF,0xFF47}, + /* A2F0-A2FF */ + {0xA2D6,0xA2F0,0xFF48}, + {0xA2D7,0xA2F1,0xFF49}, + {0xA2D8,0xA2F2,0xFF4A}, + {0xA2D9,0xA2F3,0xFF4B}, + {0xA2DA,0xA2F4,0xFF4C}, + {0xA2DB,0xA2F5,0xFF4D}, + {0xA2DC,0xA2F6,0xFF4E}, + {0xA2DD,0xA2F7,0xFF4F}, + {0xA2DE,0xA2F8,0xFF50}, + {0xA2DF,0xA2F9,0xFF51}, + {0xA2E0,0xA2FA,0xFF52}, + {0xA2E1,0xA2FB,0xFF53}, + {0xA2E2,0xA2FC,0xFF54}, + {0xA2E3,0xA2FD,0xFF55}, + {0xA2E4,0xA2FE,0xFF56}, + {0x0000,0x0000,0x0000} +}; + + +static MY_UNICASE_INFO cA3[256]= +{ + /* A300-A30F */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + /* A310-A31F */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + /* A320-A32F */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + /* A330-A33F */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + /* A340-A34F */ + {0xA2E5,0xA340,0xFF57}, + {0xA2E6,0xA341,0xFF58}, + {0xA2E7,0xA342,0xFF59}, + {0xA2E8,0xA343,0xFF5A}, + {0xA344,0xA35C,0x0391}, + {0xA345,0xA35D,0x0392}, + {0xA346,0xA35E,0x0393}, + {0xA347,0xA35F,0x0394}, + {0xA348,0xA360,0x0395}, + {0xA349,0xA361,0x0396}, + {0xA34A,0xA362,0x0397}, + {0xA34B,0xA363,0x0398}, + {0xA34C,0xA364,0x0399}, + {0xA34D,0xA365,0x039A}, + {0xA34E,0xA366,0x039B}, + {0xA34F,0xA367,0x039C}, + /* A350-A35F */ + {0xA350,0xA368,0x039D}, + {0xA351,0xA369,0x039E}, + {0xA352,0xA36A,0x039F}, + {0xA353,0xA36B,0x03A0}, + {0xA354,0xA36C,0x03A1}, + {0xA355,0xA36D,0x03A3}, + {0xA356,0xA36E,0x03A4}, + {0xA357,0xA36F,0x03A5}, + {0xA358,0xA370,0x03A6}, + {0xA359,0xA371,0x03A7}, + {0xA35A,0xA372,0x03A8}, + {0xA35B,0xA373,0x03A9}, + {0xA344,0xA35C,0x03B1}, + {0xA345,0xA35D,0x03B2}, + {0xA346,0xA35E,0x03B3}, + {0xA347,0xA35F,0x03B4}, + /* A360-A36F */ + {0xA348,0xA360,0x03B5}, + {0xA349,0xA361,0x03B6}, + {0xA34A,0xA362,0x03B7}, + {0xA34B,0xA363,0x03B8}, + {0xA34C,0xA364,0x03B9}, + {0xA34D,0xA365,0x03BA}, + {0xA34E,0xA366,0x03BB}, + {0xA34F,0xA367,0x03BC}, + {0xA350,0xA368,0x03BD}, + {0xA351,0xA369,0x03BE}, + {0xA352,0xA36A,0x03BF}, + {0xA353,0xA36B,0x03C0}, + {0xA354,0xA36C,0x03C1}, + {0xA355,0xA36D,0x03C3}, + {0xA356,0xA36E,0x03C4}, + {0xA357,0xA36F,0x03C5}, + /* A370-A37F */ + {0xA358,0xA370,0x03C6}, + {0xA359,0xA371,0x03C7}, + {0xA35A,0xA372,0x03C8}, + {0xA35B,0xA373,0x03C9}, + {0xA374,0xA374,0x3105}, + {0xA375,0xA375,0x3106}, + {0xA376,0xA376,0x3107}, + {0xA377,0xA377,0x3108}, + {0xA378,0xA378,0x3109}, + {0xA379,0xA379,0x310A}, + {0xA37A,0xA37A,0x310B}, + {0xA37B,0xA37B,0x310C}, + {0xA37C,0xA37C,0x310D}, + {0xA37D,0xA37D,0x310E}, + {0xA37E,0xA37E,0x310F}, + {0x0000,0x0000,0x0000}, + /* A380-A38F */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + /* A390-A39F */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + /* A3A0-A3AF */ + {0x0000,0x0000,0x0000}, + {0xA3A1,0xA3A1,0x3110}, + {0xA3A2,0xA3A2,0x3111}, + {0xA3A3,0xA3A3,0x3112}, + {0xA3A4,0xA3A4,0x3113}, + {0xA3A5,0xA3A5,0x3114}, + {0xA3A6,0xA3A6,0x3115}, + {0xA3A7,0xA3A7,0x3116}, + {0xA3A8,0xA3A8,0x3117}, + {0xA3A9,0xA3A9,0x3118}, + {0xA3AA,0xA3AA,0x3119}, + {0xA3AB,0xA3AB,0x311A}, + {0xA3AC,0xA3AC,0x311B}, + {0xA3AD,0xA3AD,0x311C}, + {0xA3AE,0xA3AE,0x311D}, + {0xA3AF,0xA3AF,0x311E}, + /* A3B0-A3BF */ + {0xA3B0,0xA3B0,0x311F}, + {0xA3B1,0xA3B1,0x3120}, + {0xA3B2,0xA3B2,0x3121}, + {0xA3B3,0xA3B3,0x3122}, + {0xA3B4,0xA3B4,0x3123}, + {0xA3B5,0xA3B5,0x3124}, + {0xA3B6,0xA3B6,0x3125}, + {0xA3B7,0xA3B7,0x3126}, + {0xA3B8,0xA3B8,0x3127}, + {0xA3B9,0xA3B9,0x3128}, + {0xA3BA,0xA3BA,0x3129}, + {0xA3BB,0xA3BB,0x02D9}, + {0xA3BC,0xA3BC,0x02C9}, + {0xA3BD,0xA3BD,0x02CA}, + {0xA3BE,0xA3BE,0x02C7}, + {0xA3BF,0xA3BF,0x02CB}, + /* A3C0-A3CF */ + {0xA3C0,0xA3C0,0x003F}, + {0xA3C1,0xA3C1,0x003F}, + {0xA3C2,0xA3C2,0x003F}, + {0xA3C3,0xA3C3,0x003F}, + {0xA3C4,0xA3C4,0x003F}, + {0xA3C5,0xA3C5,0x003F}, + {0xA3C6,0xA3C6,0x003F}, + {0xA3C7,0xA3C7,0x003F}, + {0xA3C8,0xA3C8,0x003F}, + {0xA3C9,0xA3C9,0x003F}, + {0xA3CA,0xA3CA,0x003F}, + {0xA3CB,0xA3CB,0x003F}, + {0xA3CC,0xA3CC,0x003F}, + {0xA3CD,0xA3CD,0x003F}, + {0xA3CE,0xA3CE,0x003F}, + {0xA3CF,0xA3CF,0x003F}, + /* A3D0-A3DF */ + {0xA3D0,0xA3D0,0x003F}, + {0xA3D1,0xA3D1,0x003F}, + {0xA3D2,0xA3D2,0x003F}, + {0xA3D3,0xA3D3,0x003F}, + {0xA3D4,0xA3D4,0x003F}, + {0xA3D5,0xA3D5,0x003F}, + {0xA3D6,0xA3D6,0x003F}, + {0xA3D7,0xA3D7,0x003F}, + {0xA3D8,0xA3D8,0x003F}, + {0xA3D9,0xA3D9,0x003F}, + {0xA3DA,0xA3DA,0x003F}, + {0xA3DB,0xA3DB,0x003F}, + {0xA3DC,0xA3DC,0x003F}, + {0xA3DD,0xA3DD,0x003F}, + {0xA3DE,0xA3DE,0x003F}, + {0xA3DF,0xA3DF,0x003F}, + /* A3E0-A3EF */ + {0xA3E0,0xA3E0,0x003F}, + {0xA3E1,0xA3E1,0x003F}, + {0xA3E2,0xA3E2,0x003F}, + {0xA3E3,0xA3E3,0x003F}, + {0xA3E4,0xA3E4,0x003F}, + {0xA3E5,0xA3E5,0x003F}, + {0xA3E6,0xA3E6,0x003F}, + {0xA3E7,0xA3E7,0x003F}, + {0xA3E8,0xA3E8,0x003F}, + {0xA3E9,0xA3E9,0x003F}, + {0xA3EA,0xA3EA,0x003F}, + {0xA3EB,0xA3EB,0x003F}, + {0xA3EC,0xA3EC,0x003F}, + {0xA3ED,0xA3ED,0x003F}, + {0xA3EE,0xA3EE,0x003F}, + {0xA3EF,0xA3EF,0x003F}, + /* A3F0-A3FF */ + {0xA3F0,0xA3F0,0x003F}, + {0xA3F1,0xA3F1,0x003F}, + {0xA3F2,0xA3F2,0x003F}, + {0xA3F3,0xA3F3,0x003F}, + {0xA3F4,0xA3F4,0x003F}, + {0xA3F5,0xA3F5,0x003F}, + {0xA3F6,0xA3F6,0x003F}, + {0xA3F7,0xA3F7,0x003F}, + {0xA3F8,0xA3F8,0x003F}, + {0xA3F9,0xA3F9,0x003F}, + {0xA3FA,0xA3FA,0x003F}, + {0xA3FB,0xA3FB,0x003F}, + {0xA3FC,0xA3FC,0x003F}, + {0xA3FD,0xA3FD,0x003F}, + {0xA3FE,0xA3FE,0x003F}, + {0x0000,0x0000,0x0000} +}; + + +static MY_UNICASE_INFO cC7[256]= +{ + /* C700-C70F */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + /* C710-C71F */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + /* C720-C72F */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + /* C730-C73F */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + /* C740-C74F */ + {0xC740,0xC740,0x30A8}, + {0xC741,0xC741,0x30A9}, + {0xC742,0xC742,0x30AA}, + {0xC743,0xC743,0x30AB}, + {0xC744,0xC744,0x30AC}, + {0xC745,0xC745,0x30AD}, + {0xC746,0xC746,0x30AE}, + {0xC747,0xC747,0x30AF}, + {0xC748,0xC748,0x30B0}, + {0xC749,0xC749,0x30B1}, + {0xC74A,0xC74A,0x30B2}, + {0xC74B,0xC74B,0x30B3}, + {0xC74C,0xC74C,0x30B4}, + {0xC74D,0xC74D,0x30B5}, + {0xC74E,0xC74E,0x30B6}, + {0xC74F,0xC74F,0x30B7}, + /* C750-C75F */ + {0xC750,0xC750,0x30B8}, + {0xC751,0xC751,0x30B9}, + {0xC752,0xC752,0x30BA}, + {0xC753,0xC753,0x30BB}, + {0xC754,0xC754,0x30BC}, + {0xC755,0xC755,0x30BD}, + {0xC756,0xC756,0x30BE}, + {0xC757,0xC757,0x30BF}, + {0xC758,0xC758,0x30C0}, + {0xC759,0xC759,0x30C1}, + {0xC75A,0xC75A,0x30C2}, + {0xC75B,0xC75B,0x30C3}, + {0xC75C,0xC75C,0x30C4}, + {0xC75D,0xC75D,0x30C5}, + {0xC75E,0xC75E,0x30C6}, + {0xC75F,0xC75F,0x30C7}, + /* C760-C76F */ + {0xC760,0xC760,0x30C8}, + {0xC761,0xC761,0x30C9}, + {0xC762,0xC762,0x30CA}, + {0xC763,0xC763,0x30CB}, + {0xC764,0xC764,0x30CC}, + {0xC765,0xC765,0x30CD}, + {0xC766,0xC766,0x30CE}, + {0xC767,0xC767,0x30CF}, + {0xC768,0xC768,0x30D0}, + {0xC769,0xC769,0x30D1}, + {0xC76A,0xC76A,0x30D2}, + {0xC76B,0xC76B,0x30D3}, + {0xC76C,0xC76C,0x30D4}, + {0xC76D,0xC76D,0x30D5}, + {0xC76E,0xC76E,0x30D6}, + {0xC76F,0xC76F,0x30D7}, + /* C770-C77F */ + {0xC770,0xC770,0x30D8}, + {0xC771,0xC771,0x30D9}, + {0xC772,0xC772,0x30DA}, + {0xC773,0xC773,0x30DB}, + {0xC774,0xC774,0x30DC}, + {0xC775,0xC775,0x30DD}, + {0xC776,0xC776,0x30DE}, + {0xC777,0xC777,0x30DF}, + {0xC778,0xC778,0x30E0}, + {0xC779,0xC779,0x30E1}, + {0xC77A,0xC77A,0x30E2}, + {0xC77B,0xC77B,0x30E3}, + {0xC77C,0xC77C,0x30E4}, + {0xC77D,0xC77D,0x30E5}, + {0xC77E,0xC77E,0x30E6}, + {0x0000,0x0000,0x0000}, + /* C780-C78F */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + /* C790-C79F */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + /* C7A0-C7AF */ + {0x0000,0x0000,0x0000}, + {0xC7A1,0xC7A1,0x30E7}, + {0xC7A2,0xC7A2,0x30E8}, + {0xC7A3,0xC7A3,0x30E9}, + {0xC7A4,0xC7A4,0x30EA}, + {0xC7A5,0xC7A5,0x30EB}, + {0xC7A6,0xC7A6,0x30EC}, + {0xC7A7,0xC7A7,0x30ED}, + {0xC7A8,0xC7A8,0x30EE}, + {0xC7A9,0xC7A9,0x30EF}, + {0xC7AA,0xC7AA,0x30F0}, + {0xC7AB,0xC7AB,0x30F1}, + {0xC7AC,0xC7AC,0x30F2}, + {0xC7AD,0xC7AD,0x30F3}, + {0xC7AE,0xC7AE,0x30F4}, + {0xC7AF,0xC7AF,0x30F5}, + /* C7B0-C7BF */ + {0xC7B0,0xC7B0,0x30F6}, + {0xC7B1,0xC7CC,0x0414}, + {0xC7B2,0xC7CD,0x0415}, + {0xC7B3,0xC7CE,0x0401}, + {0xC7B4,0xC7CF,0x0416}, + {0xC7B5,0xC7D0,0x0417}, + {0xC7B6,0xC7D1,0x0418}, + {0xC7B7,0xC7D2,0x0419}, + {0xC7B8,0xC7D3,0x041A}, + {0xC7B9,0xC7D4,0x041B}, + {0xC7BA,0xC7D5,0x041C}, + {0xC7BB,0xC7DC,0x0423}, + {0xC7BC,0xC7DD,0x0424}, + {0xC7BD,0xC7DE,0x0425}, + {0xC7BE,0xC7DF,0x0426}, + {0xC7BF,0xC7E0,0x0427}, + /* C7C0-C7CF */ + {0xC7C0,0xC7E1,0x0428}, + {0xC7C1,0xC7E2,0x0429}, + {0xC7C2,0xC7E3,0x042A}, + {0xC7C3,0xC7E4,0x042B}, + {0xC7C4,0xC7E5,0x042C}, + {0xC7C5,0xC7E6,0x042D}, + {0xC7C6,0xC7E7,0x042E}, + {0xC7C7,0xC7E8,0x042F}, + {0xC7C8,0xC7C8,0x0430}, + {0xC7C9,0xC7C9,0x0431}, + {0xC7CA,0xC7CA,0x0432}, + {0xC7CB,0xC7CB,0x0433}, + {0xC7B1,0xC7CC,0x0434}, + {0xC7B2,0xC7CD,0x0435}, + {0xC7B3,0xC7CE,0x0451}, + {0xC7B4,0xC7CF,0x0436}, + /* C7D0-C7DF */ + {0xC7B5,0xC7D0,0x0437}, + {0xC7B6,0xC7D1,0x0438}, + {0xC7B7,0xC7D2,0x0439}, + {0xC7B8,0xC7D3,0x043A}, + {0xC7B9,0xC7D4,0x043B}, + {0xC7BA,0xC7D5,0x043C}, + {0xC7D6,0xC7D6,0x043D}, + {0xC7D7,0xC7D7,0x043E}, + {0xC7D8,0xC7D8,0x043F}, + {0xC7D9,0xC7D9,0x0440}, + {0xC7DA,0xC7DA,0x0441}, + {0xC7DB,0xC7DB,0x0442}, + {0xC7BB,0xC7DC,0x0443}, + {0xC7BC,0xC7DD,0x0444}, + {0xC7BD,0xC7DE,0x0445}, + {0xC7BE,0xC7DF,0x0446}, + /* C7E0-C7EF */ + {0xC7BF,0xC7E0,0x0447}, + {0xC7C0,0xC7E1,0x0448}, + {0xC7C1,0xC7E2,0x0449}, + {0xC7C2,0xC7E3,0x044A}, + {0xC7C3,0xC7E4,0x044B}, + {0xC7C4,0xC7E5,0x044C}, + {0xC7C5,0xC7E6,0x044D}, + {0xC7C6,0xC7E7,0x044E}, + {0xC7C7,0xC7E8,0x044F}, + {0xC7E9,0xC7E9,0x2460}, + {0xC7EA,0xC7EA,0x2461}, + {0xC7EB,0xC7EB,0x2462}, + {0xC7EC,0xC7EC,0x2463}, + {0xC7ED,0xC7ED,0x2464}, + {0xC7EE,0xC7EE,0x2465}, + {0xC7EF,0xC7EF,0x2466}, + /* C7F0-C7FF */ + {0xC7F0,0xC7F0,0x2467}, + {0xC7F1,0xC7F1,0x2468}, + {0xC7F2,0xC7F2,0x2469}, + {0xC7F3,0xC7F3,0x2474}, + {0xC7F4,0xC7F4,0x2475}, + {0xC7F5,0xC7F5,0x2476}, + {0xC7F6,0xC7F6,0x2477}, + {0xC7F7,0xC7F7,0x2478}, + {0xC7F8,0xC7F8,0x2479}, + {0xC7F9,0xC7F9,0x247A}, + {0xC7FA,0xC7FA,0x247B}, + {0xC7FB,0xC7FB,0x247C}, + {0xC7FC,0xC7FC,0x247D}, + {0xC7FD,0xC7FD,0x003F}, + {0xC7FE,0xC7FE,0x003F}, + {0x0000,0x0000,0x0000} +}; + + +static MY_UNICASE_INFO *my_caseinfo_big5[256]= +{ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 0 */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 1 */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 2 */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 3 */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 4 */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 5 */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 6 */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 7 */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 8 */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 9 */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, cA2, cA3, NULL, NULL, NULL, NULL, /* A */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* B */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, cC7, /* C */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* D */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* E */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* F */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, +}; + + static uint16 big5strokexfrm(uint16 i) { if ((i == 0xA440) || (i == 0xA441)) return 0xA440; @@ -6313,7 +6930,7 @@ CHARSET_INFO my_charset_big5_chinese_ci= NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - my_unicase_default, /* caseinfo */ + my_caseinfo_big5, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ @@ -6346,7 +6963,7 @@ CHARSET_INFO my_charset_big5_bin= NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - my_unicase_default, /* caseinfo */ + my_caseinfo_big5, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ diff --git a/dep/mysqllite/strings/ctype-bin.c b/dep/mysqllite/strings/ctype-bin.c index 95d97af2bfbc1..3b6a977e47c9b 100644 --- a/dep/mysqllite/strings/ctype-bin.c +++ b/dep/mysqllite/strings/ctype-bin.c @@ -278,14 +278,11 @@ void my_hash_sort_8bit_bin(CHARSET_INFO *cs __attribute__((unused)), { const uchar *pos = key; - key+= len; - /* Remove trailing spaces. We have to do this to be able to compare 'A ' and 'A' as identical */ - while (key > pos && key[-1] == ' ') - key--; + key= skip_trailing_space(key, len); for (; pos < (uchar*) key ; pos++) { diff --git a/dep/mysqllite/strings/ctype-cp932.c b/dep/mysqllite/strings/ctype-cp932.c index 238c6f61baa2d..df4083c9f8d67 100644 --- a/dep/mysqllite/strings/ctype-cp932.c +++ b/dep/mysqllite/strings/ctype-cp932.c @@ -31,7 +31,7 @@ * .configure. mbmaxlen_cp932=2 */ -static uchar NEAR ctype_cp932[257] = +static uchar ctype_cp932[257] = { 0, /* For standard library */ 0040, 0040, 0040, 0040, 0040, 0040, 0040, 0040, /* NUL ^A - ^G */ @@ -68,7 +68,7 @@ static uchar NEAR ctype_cp932[257] = 0020, 0020, 0020, 0020, 0020, 0000, 0000, 0000 }; -static uchar NEAR to_lower_cp932[]= +static uchar to_lower_cp932[]= { '\000','\001','\002','\003','\004','\005','\006','\007', '\010','\011','\012','\013','\014','\015','\016','\017', @@ -104,7 +104,7 @@ static uchar NEAR to_lower_cp932[]= (uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377' }; -static uchar NEAR to_upper_cp932[]= +static uchar to_upper_cp932[]= { '\000','\001','\002','\003','\004','\005','\006','\007', '\010','\011','\012','\013','\014','\015','\016','\017', @@ -140,7 +140,7 @@ static uchar NEAR to_upper_cp932[]= (uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377' }; -static uchar NEAR sort_order_cp932[]= +static uchar sort_order_cp932[]= { '\000','\001','\002','\003','\004','\005','\006','\007', '\010','\011','\012','\013','\014','\015','\016','\017', @@ -197,6 +197,1512 @@ static uint mbcharlen_cp932(CHARSET_INFO *cs __attribute__((unused)),uint c) #define cp932code(c,d) ((((uint) (uchar)(c)) << 8) | (uint) (uchar) (d)) +static MY_UNICASE_INFO c81[256]= +{ + /* 8100-810F */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + /* 8110-811F */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + /* 8120-812F */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + /* 8130-813F */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {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,0x8140,0x3000}, /* 8140-814F */ + {0x8141,0x8141,0x3001}, + {0x8142,0x8142,0x3002}, + {0x8143,0x8143,0xFF0C}, + {0x8144,0x8144,0xFF0E}, + {0x8145,0x8145,0x30FB}, + {0x8146,0x8146,0xFF1A}, + {0x8147,0x8147,0xFF1B}, + {0x8148,0x8148,0xFF1F}, + {0x8149,0x8149,0xFF01}, + {0x814A,0x814A,0x309B}, + {0x814B,0x814B,0x309C}, + {0x814C,0x814C,0x00B4}, + {0x814D,0x814D,0xFF40}, + {0x814E,0x814E,0x00A8}, + {0x814F,0x814F,0xFF3E}, + {0x8150,0x8150,0xFFE3}, /* 8150-815F */ + {0x8151,0x8151,0xFF3F}, + {0x8152,0x8152,0x30FD}, + {0x8153,0x8153,0x30FE}, + {0x8154,0x8154,0x309D}, + {0x8155,0x8155,0x309E}, + {0x8156,0x8156,0x3003}, + {0x8157,0x8157,0x4EDD}, + {0x8158,0x8158,0x3005}, + {0x8159,0x8159,0x3006}, + {0x815A,0x815A,0x3007}, + {0x815B,0x815B,0x30FC}, + {0x815C,0x815C,0x2015}, + {0x815D,0x815D,0x2010}, + {0x815E,0x815E,0xFF0F}, + {0x815F,0x815F,0xFF3C}, + {0x8160,0x8160,0xFF5E}, /* 8160-816F */ + {0x8161,0x8161,0x2225}, + {0x8162,0x8162,0xFF5C}, + {0x8163,0x8163,0x2026}, + {0x8164,0x8164,0x2025}, + {0x8165,0x8165,0x2018}, + {0x8166,0x8166,0x2019}, + {0x8167,0x8167,0x201C}, + {0x8168,0x8168,0x201D}, + {0x8169,0x8169,0xFF08}, + {0x816A,0x816A,0xFF09}, + {0x816B,0x816B,0x3014}, + {0x816C,0x816C,0x3015}, + {0x816D,0x816D,0xFF3B}, + {0x816E,0x816E,0xFF3D}, + {0x816F,0x816F,0xFF5B}, + {0x8170,0x8170,0xFF5D}, /* 8170-817F */ + {0x8171,0x8171,0x3008}, + {0x8172,0x8172,0x3009}, + {0x8173,0x8173,0x300A}, + {0x8174,0x8174,0x300B}, + {0x8175,0x8175,0x300C}, + {0x8176,0x8176,0x300D}, + {0x8177,0x8177,0x300E}, + {0x8178,0x8178,0x300F}, + {0x8179,0x8179,0x3010}, + {0x817A,0x817A,0x3011}, + {0x817B,0x817B,0xFF0B}, + {0x817C,0x817C,0xFF0D}, + {0x817D,0x817D,0x00B1}, + {0x817E,0x817E,0x00D7}, + {0,0,0}, + {0x8180,0x8180,0x00F7}, /* 8180-818F */ + {0x8181,0x8181,0xFF1D}, + {0x8182,0x8182,0x2260}, + {0x8183,0x8183,0xFF1C}, + {0x8184,0x8184,0xFF1E}, + {0x8185,0x8185,0x2266}, + {0x8186,0x8186,0x2267}, + {0x8187,0x8187,0x221E}, + {0x8188,0x8188,0x2234}, + {0x8189,0x8189,0x2642}, + {0x818A,0x818A,0x2640}, + {0x818B,0x818B,0x00B0}, + {0x818C,0x818C,0x2032}, + {0x818D,0x818D,0x2033}, + {0x818E,0x818E,0x2103}, + {0x818F,0x818F,0xFFE5}, + {0x8190,0x8190,0xFF04}, /* 8190-819F*/ + {0x8191,0x8191,0xFFE0}, + {0x8192,0x8192,0xFFE1}, + {0x8193,0x8193,0xFF05}, + {0x8194,0x8194,0xFF03}, + {0x8195,0x8195,0xFF06}, + {0x8196,0x8196,0xFF0A}, + {0x8197,0x8197,0xFF20}, + {0x8198,0x8198,0x00A7}, + {0x8199,0x8199,0x2606}, + {0x819A,0x819A,0x2605}, + {0x819B,0x819B,0x25CB}, + {0x819C,0x819C,0x25CF}, + {0x819D,0x819D,0x25CE}, + {0x819E,0x819E,0x25C7}, + {0x819F,0x819F,0x25C6}, + {0x81A0,0x81A0,0x25A1}, /* 81A0-81AF */ + {0x81A1,0x81A1,0x25A0}, + {0x81A2,0x81A2,0x25B3}, + {0x81A3,0x81A3,0x25B2}, + {0x81A4,0x81A4,0x25BD}, + {0x81A5,0x81A5,0x25BC}, + {0x81A6,0x81A6,0x203B}, + {0x81A7,0x81A7,0x3012}, + {0x81A8,0x81A8,0x2192}, + {0x81A9,0x81A9,0x2190}, + {0x81AA,0x81AA,0x2191}, + {0x81AB,0x81AB,0x2193}, + {0x81AC,0x81AC,0x3013}, + {0x81AD,0x81AD,0x003F}, + {0x81AE,0x81AE,0x003F}, + {0x81AF,0x81AF,0x003F}, + {0x81B0,0x81B0,0x003F}, /* 81B0-81BF */ + {0x81B1,0x81B1,0x003F}, + {0x81B2,0x81B2,0x003F}, + {0x81B3,0x81B3,0x003F}, + {0x81B4,0x81B4,0x003F}, + {0x81B5,0x81B5,0x003F}, + {0x81B6,0x81B6,0x003F}, + {0x81B7,0x81B7,0x003F}, + {0x81B8,0x81B8,0x2208}, + {0x81B9,0x81B9,0x220B}, + {0x81BA,0x81BA,0x2286}, + {0x81BB,0x81BB,0x2287}, + {0x81BC,0x81BC,0x2282}, + {0x81BD,0x81BD,0x2283}, + {0x81BE,0x81BE,0x222A}, + {0x81BF,0x81BF,0x2229}, + {0x81C0,0x81C0,0x003F}, /* 81C0-81CF */ + {0x81C1,0x81C1,0x003F}, + {0x81C2,0x81C2,0x003F}, + {0x81C3,0x81C3,0x003F}, + {0x81C4,0x81C4,0x003F}, + {0x81C5,0x81C5,0x003F}, + {0x81C6,0x81C6,0x003F}, + {0x81C7,0x81C7,0x003F}, + {0x81C8,0x81C8,0x2227}, + {0x81C9,0x81C9,0x2228}, + {0x81CA,0x81CA,0xFFE2}, + {0x81CB,0x81CB,0x21D2}, + {0x81CC,0x81CC,0x21D4}, + {0x81CD,0x81CD,0x2200}, + {0x81CE,0x81CE,0x2203}, + {0x81CF,0x81CF,0x003F}, + {0x81D0,0x81D0,0x003F}, /* 81D0-81DF */ + {0x81D1,0x81D1,0x003F}, + {0x81D2,0x81D2,0x003F}, + {0x81D3,0x81D3,0x003F}, + {0x81D4,0x81D4,0x003F}, + {0x81D5,0x81D5,0x003F}, + {0x81D6,0x81D6,0x003F}, + {0x81D7,0x81D7,0x003F}, + {0x81D8,0x81D8,0x003F}, + {0x81D9,0x81D9,0x003F}, + {0x81DA,0x81DA,0x2220}, + {0x81DB,0x81DB,0x22A5}, + {0x81DC,0x81DC,0x2312}, + {0x81DD,0x81DD,0x2202}, + {0x81DE,0x81DE,0x2207}, + {0x81DF,0x81DF,0x2261}, + {0x81E0,0x81E0,0x2252}, /* 81E0-81EF */ + {0x81E1,0x81E1,0x226A}, + {0x81E2,0x81E2,0x226B}, + {0x81E3,0x81E3,0x221A}, + {0x81E4,0x81E4,0x223D}, + {0x81E5,0x81E5,0x221D}, + {0x81E6,0x81E6,0x2235}, + {0x81E7,0x81E7,0x222B}, + {0x81E8,0x81E8,0x222C}, + {0x81E9,0x81E9,0x003F}, + {0x81EA,0x81EA,0x003F}, + {0x81EB,0x81EB,0x003F}, + {0x81EC,0x81EC,0x003F}, + {0x81ED,0x81ED,0x003F}, + {0x81EE,0x81EE,0x003F}, + {0x81EF,0x81EF,0x003F}, + {0x81F0,0x81F0,0x212B}, /* 81F0-81FF */ + {0x81F1,0x81F1,0x2030}, + {0x81F2,0x81F2,0x266F}, + {0x81F3,0x81F3,0x266D}, + {0x81F4,0x81F4,0x266A}, + {0x81F5,0x81F5,0x2020}, + {0x81F6,0x81F6,0x2021}, + {0x81F7,0x81F7,0x00B6}, + {0x81F8,0x81F8,0x003F}, + {0x81F9,0x81F9,0x003F}, + {0x81FA,0x81FA,0x003F}, + {0x81FB,0x81FB,0x003F}, + {0x81FC,0x81FC,0x25EF}, + {0,0,0}, + {0,0,0}, + {0,0,0}, +}; + + +static MY_UNICASE_INFO c82[256]= +{ + /* 8200-820F */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + /* 8210-821F */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + /* 8220-822F */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + /* 8230-823F */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + + {0x8240,0x8240,0x003F}, /* 8240-824F */ + {0x8241,0x8241,0x003F}, + {0x8242,0x8242,0x003F}, + {0x8243,0x8243,0x003F}, + {0x8244,0x8244,0x003F}, + {0x8245,0x8245,0x003F}, + {0x8246,0x8246,0x003F}, + {0x8247,0x8247,0x003F}, + {0x8248,0x8248,0x003F}, + {0x8249,0x8249,0x003F}, + {0x824A,0x824A,0x003F}, + {0x824B,0x824B,0x003F}, + {0x824C,0x824C,0x003F}, + {0x824D,0x824D,0x003F}, + {0x824E,0x824E,0x003F}, + {0x824F,0x824F,0xFF10}, + {0x8250,0x8250,0xFF11}, /* 8250-825F */ + {0x8251,0x8251,0xFF12}, + {0x8252,0x8252,0xFF13}, + {0x8253,0x8253,0xFF14}, + {0x8254,0x8254,0xFF15}, + {0x8255,0x8255,0xFF16}, + {0x8256,0x8256,0xFF17}, + {0x8257,0x8257,0xFF18}, + {0x8258,0x8258,0xFF19}, + {0x8259,0x8259,0x003F}, + {0x825A,0x825A,0x003F}, + {0x825B,0x825B,0x003F}, + {0x825C,0x825C,0x003F}, + {0x825D,0x825D,0x003F}, + {0x825E,0x825E,0x003F}, + {0x825F,0x825F,0x003F}, + {0x8260,0x8281,0xFF21}, /* 8260-826F */ + {0x8261,0x8282,0xFF22}, + {0x8262,0x8283,0xFF23}, + {0x8263,0x8284,0xFF24}, + {0x8264,0x8285,0xFF25}, + {0x8265,0x8286,0xFF26}, + {0x8266,0x8287,0xFF27}, + {0x8267,0x8288,0xFF28}, + {0x8268,0x8289,0xFF29}, + {0x8269,0x828A,0xFF2A}, + {0x826A,0x828B,0xFF2B}, + {0x826B,0x828C,0xFF2C}, + {0x826C,0x828D,0xFF2D}, + {0x826D,0x828E,0xFF2E}, + {0x826E,0x828F,0xFF2F}, + {0x826F,0x8290,0xFF30}, + {0x8270,0x8291,0xFF31}, /* 8270-827F */ + {0x8271,0x8292,0xFF32}, + {0x8272,0x8293,0xFF33}, + {0x8273,0x8294,0xFF34}, + {0x8274,0x8295,0xFF35}, + {0x8275,0x8296,0xFF36}, + {0x8276,0x8297,0xFF37}, + {0x8277,0x8298,0xFF38}, + {0x8278,0x8299,0xFF39}, + {0x8279,0x829A,0xFF3A}, + {0x827A,0x827A,0x003F}, + {0x827B,0x827B,0x003F}, + {0x827C,0x827C,0x003F}, + {0x827D,0x827D,0x003F}, + {0x827E,0x827E,0x003F}, + {0,0,0}, + {0x8280,0x8280,0x003F}, /* 8280-828F */ + {0x8260,0x8281,0xFF41}, + {0x8261,0x8282,0xFF42}, + {0x8262,0x8283,0xFF43}, + {0x8263,0x8284,0xFF44}, + {0x8264,0x8285,0xFF45}, + {0x8265,0x8286,0xFF46}, + {0x8266,0x8287,0xFF47}, + {0x8267,0x8288,0xFF48}, + {0x8268,0x8289,0xFF49}, + {0x8269,0x828A,0xFF4A}, + {0x826A,0x828B,0xFF4B}, + {0x826B,0x828C,0xFF4C}, + {0x826C,0x828D,0xFF4D}, + {0x826D,0x828E,0xFF4E}, + {0x826E,0x828F,0xFF4F}, + {0x826F,0x8290,0xFF50}, /* 8290-829F */ + {0x8270,0x8291,0xFF51}, + {0x8271,0x8292,0xFF52}, + {0x8272,0x8293,0xFF53}, + {0x8273,0x8294,0xFF54}, + {0x8274,0x8295,0xFF55}, + {0x8275,0x8296,0xFF56}, + {0x8276,0x8297,0xFF57}, + {0x8277,0x8298,0xFF58}, + {0x8278,0x8299,0xFF59}, + {0x8279,0x829A,0xFF5A}, + {0x829B,0x829B,0x003F}, + {0x829C,0x829C,0x003F}, + {0x829D,0x829D,0x003F}, + {0x829E,0x829E,0x003F}, + {0x829F,0x829F,0x3041}, + {0x82A0,0x82A0,0x3042}, /* 82A0-82AF */ + {0x82A1,0x82A1,0x3043}, + {0x82A2,0x82A2,0x3044}, + {0x82A3,0x82A3,0x3045}, + {0x82A4,0x82A4,0x3046}, + {0x82A5,0x82A5,0x3047}, + {0x82A6,0x82A6,0x3048}, + {0x82A7,0x82A7,0x3049}, + {0x82A8,0x82A8,0x304A}, + {0x82A9,0x82A9,0x304B}, + {0x82AA,0x82AA,0x304C}, + {0x82AB,0x82AB,0x304D}, + {0x82AC,0x82AC,0x304E}, + {0x82AD,0x82AD,0x304F}, + {0x82AE,0x82AE,0x3050}, + {0x82AF,0x82AF,0x3051}, + {0x82B0,0x82B0,0x3052}, /* 82B0-82BF */ + {0x82B1,0x82B1,0x3053}, + {0x82B2,0x82B2,0x3054}, + {0x82B3,0x82B3,0x3055}, + {0x82B4,0x82B4,0x3056}, + {0x82B5,0x82B5,0x3057}, + {0x82B6,0x82B6,0x3058}, + {0x82B7,0x82B7,0x3059}, + {0x82B8,0x82B8,0x305A}, + {0x82B9,0x82B9,0x305B}, + {0x82BA,0x82BA,0x305C}, + {0x82BB,0x82BB,0x305D}, + {0x82BC,0x82BC,0x305E}, + {0x82BD,0x82BD,0x305F}, + {0x82BE,0x82BE,0x3060}, + {0x82BF,0x82BF,0x3061}, + {0x82C0,0x82C0,0x3062}, /* 82C0-82CF */ + {0x82C1,0x82C1,0x3063}, + {0x82C2,0x82C2,0x3064}, + {0x82C3,0x82C3,0x3065}, + {0x82C4,0x82C4,0x3066}, + {0x82C5,0x82C5,0x3067}, + {0x82C6,0x82C6,0x3068}, + {0x82C7,0x82C7,0x3069}, + {0x82C8,0x82C8,0x306A}, + {0x82C9,0x82C9,0x306B}, + {0x82CA,0x82CA,0x306C}, + {0x82CB,0x82CB,0x306D}, + {0x82CC,0x82CC,0x306E}, + {0x82CD,0x82CD,0x306F}, + {0x82CE,0x82CE,0x3070}, + {0x82CF,0x82CF,0x3071}, + {0x82D0,0x82D0,0x3072}, /* 82D0-82DF */ + {0x82D1,0x82D1,0x3073}, + {0x82D2,0x82D2,0x3074}, + {0x82D3,0x82D3,0x3075}, + {0x82D4,0x82D4,0x3076}, + {0x82D5,0x82D5,0x3077}, + {0x82D6,0x82D6,0x3078}, + {0x82D7,0x82D7,0x3079}, + {0x82D8,0x82D8,0x307A}, + {0x82D9,0x82D9,0x307B}, + {0x82DA,0x82DA,0x307C}, + {0x82DB,0x82DB,0x307D}, + {0x82DC,0x82DC,0x307E}, + {0x82DD,0x82DD,0x307F}, + {0x82DE,0x82DE,0x3080}, + {0x82DF,0x82DF,0x3081}, + {0x82E0,0x82E0,0x3082}, /* 82E0-82EF */ + {0x82E1,0x82E1,0x3083}, + {0x82E2,0x82E2,0x3084}, + {0x82E3,0x82E3,0x3085}, + {0x82E4,0x82E4,0x3086}, + {0x82E5,0x82E5,0x3087}, + {0x82E6,0x82E6,0x3088}, + {0x82E7,0x82E7,0x3089}, + {0x82E8,0x82E8,0x308A}, + {0x82E9,0x82E9,0x308B}, + {0x82EA,0x82EA,0x308C}, + {0x82EB,0x82EB,0x308D}, + {0x82EC,0x82EC,0x308E}, + {0x82ED,0x82ED,0x308F}, + {0x82EE,0x82EE,0x3090}, + {0x82EF,0x82EF,0x3091}, + {0x82F0,0x82F0,0x3092}, /* 82F0-82FF */ + {0x82F1,0x82F1,0x3093}, + {0x82F2,0x82F2,0x003F}, + {0x82F3,0x82F3,0x003F}, + {0x82F4,0x82F4,0x003F}, + {0x82F5,0x82F5,0x003F}, + {0x82F6,0x82F6,0x003F}, + {0x82F7,0x82F7,0x003F}, + {0x82F8,0x82F8,0x003F}, + {0x82F9,0x82F9,0x003F}, + {0x82FA,0x82FA,0x003F}, + {0x82FB,0x82FB,0x003F}, + {0x82FC,0x82FC,0x003F}, + {0,0,0} +}; + + +static MY_UNICASE_INFO c83[256]= +{ + /* 8300-830F */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + /* 8310-831F */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + /* 8320-832F */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + /* 8330-833F */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + + {0x8340,0x8340,0x30A1}, /* 8340 */ + {0x8341,0x8341,0x30A2}, + {0x8342,0x8342,0x30A3}, + {0x8343,0x8343,0x30A4}, + {0x8344,0x8344,0x30A5}, + {0x8345,0x8345,0x30A6}, + {0x8346,0x8346,0x30A7}, + {0x8347,0x8347,0x30A8}, + {0x8348,0x8348,0x30A9}, + {0x8349,0x8349,0x30AA}, + {0x834A,0x834A,0x30AB}, + {0x834B,0x834B,0x30AC}, + {0x834C,0x834C,0x30AD}, + {0x834D,0x834D,0x30AE}, + {0x834E,0x834E,0x30AF}, + {0x834F,0x834F,0x30B0}, + {0x8350,0x8350,0x30B1}, /* 8350 */ + {0x8351,0x8351,0x30B2}, + {0x8352,0x8352,0x30B3}, + {0x8353,0x8353,0x30B4}, + {0x8354,0x8354,0x30B5}, + {0x8355,0x8355,0x30B6}, + {0x8356,0x8356,0x30B7}, + {0x8357,0x8357,0x30B8}, + {0x8358,0x8358,0x30B9}, + {0x8359,0x8359,0x30BA}, + {0x835A,0x835A,0x30BB}, + {0x835B,0x835B,0x30BC}, + {0x835C,0x835C,0x30BD}, + {0x835D,0x835D,0x30BE}, + {0x835E,0x835E,0x30BF}, + {0x835F,0x835F,0x30C0}, + {0x8360,0x8360,0x30C1}, /* 8360 */ + {0x8361,0x8361,0x30C2}, + {0x8362,0x8362,0x30C3}, + {0x8363,0x8363,0x30C4}, + {0x8364,0x8364,0x30C5}, + {0x8365,0x8365,0x30C6}, + {0x8366,0x8366,0x30C7}, + {0x8367,0x8367,0x30C8}, + {0x8368,0x8368,0x30C9}, + {0x8369,0x8369,0x30CA}, + {0x836A,0x836A,0x30CB}, + {0x836B,0x836B,0x30CC}, + {0x836C,0x836C,0x30CD}, + {0x836D,0x836D,0x30CE}, + {0x836E,0x836E,0x30CF}, + {0x836F,0x836F,0x30D0}, + {0x8370,0x8370,0x30D1}, /* 8370 */ + {0x8371,0x8371,0x30D2}, + {0x8372,0x8372,0x30D3}, + {0x8373,0x8373,0x30D4}, + {0x8374,0x8374,0x30D5}, + {0x8375,0x8375,0x30D6}, + {0x8376,0x8376,0x30D7}, + {0x8377,0x8377,0x30D8}, + {0x8378,0x8378,0x30D9}, + {0x8379,0x8379,0x30DA}, + {0x837A,0x837A,0x30DB}, + {0x837B,0x837B,0x30DC}, + {0x837C,0x837C,0x30DD}, + {0x837D,0x837D,0x30DE}, + {0x837E,0x837E,0x30DF}, + {0,0,0}, + {0x8380,0x8380,0x30E0}, /* 8380 */ + {0x8381,0x8381,0x30E1}, + {0x8382,0x8382,0x30E2}, + {0x8383,0x8383,0x30E3}, + {0x8384,0x8384,0x30E4}, + {0x8385,0x8385,0x30E5}, + {0x8386,0x8386,0x30E6}, + {0x8387,0x8387,0x30E7}, + {0x8388,0x8388,0x30E8}, + {0x8389,0x8389,0x30E9}, + {0x838A,0x838A,0x30EA}, + {0x838B,0x838B,0x30EB}, + {0x838C,0x838C,0x30EC}, + {0x838D,0x838D,0x30ED}, + {0x838E,0x838E,0x30EE}, + {0x838F,0x838F,0x30EF}, + {0x8390,0x8390,0x30F0}, /* 8390 */ + {0x8391,0x8391,0x30F1}, + {0x8392,0x8392,0x30F2}, + {0x8393,0x8393,0x30F3}, + {0x8394,0x8394,0x30F4}, + {0x8395,0x8395,0x30F5}, + {0x8396,0x8396,0x30F6}, + {0x8397,0x8397,0x003F}, + {0x8398,0x8398,0x003F}, + {0x8399,0x8399,0x003F}, + {0x839A,0x839A,0x003F}, + {0x839B,0x839B,0x003F}, + {0x839C,0x839C,0x003F}, + {0x839D,0x839D,0x003F}, + {0x839E,0x839E,0x003F}, + {0x839F,0x83BF,0x0391}, + {0x83A0,0x83C0,0x0392}, /* 83A0 */ + {0x83A1,0x83C1,0x0393}, + {0x83A2,0x83C2,0x0394}, + {0x83A3,0x83C3,0x0395}, + {0x83A4,0x83C4,0x0396}, + {0x83A5,0x83C5,0x0397}, + {0x83A6,0x83C6,0x0398}, + {0x83A7,0x83C7,0x0399}, + {0x83A8,0x83C8,0x039A}, + {0x83A9,0x83C9,0x039B}, + {0x83AA,0x83CA,0x039C}, + {0x83AB,0x83CB,0x039D}, + {0x83AC,0x83CC,0x039E}, + {0x83AD,0x83CD,0x039F}, + {0x83AE,0x83CE,0x03A0}, + {0x83AF,0x83CF,0x03A1}, + {0x83B0,0x83D0,0x03A3}, /* 83B0 */ + {0x83B1,0x83D1,0x03A4}, + {0x83B2,0x83D2,0x03A5}, + {0x83B3,0x83D3,0x03A6}, + {0x83B4,0x83D4,0x03A7}, + {0x83B5,0x83D5,0x03A8}, + {0x83B6,0x83D6,0x03A9}, + {0x83B7,0x83B7,0x003F}, + {0x83B8,0x83B8,0x003F}, + {0x83B9,0x83B9,0x003F}, + {0x83BA,0x83BA,0x003F}, + {0x83BB,0x83BB,0x003F}, + {0x83BC,0x83BC,0x003F}, + {0x83BD,0x83BD,0x003F}, + {0x83BE,0x83BE,0x003F}, + {0x839F,0x83BF,0x03B1}, + {0x83A0,0x83C0,0x03B2}, /* 83C0 */ + {0x83A1,0x83C1,0x03B3}, + {0x83A2,0x83C2,0x03B4}, + {0x83A3,0x83C3,0x03B5}, + {0x83A4,0x83C4,0x03B6}, + {0x83A5,0x83C5,0x03B7}, + {0x83A6,0x83C6,0x03B8}, + {0x83A7,0x83C7,0x03B9}, + {0x83A8,0x83C8,0x03BA}, + {0x83A9,0x83C9,0x03BB}, + {0x83AA,0x83CA,0x03BC}, + {0x83AB,0x83CB,0x03BD}, + {0x83AC,0x83CC,0x03BE}, + {0x83AD,0x83CD,0x03BF}, + {0x83AE,0x83CE,0x03C0}, + {0x83AF,0x83CF,0x03C1}, + {0x83B0,0x83D0,0x03C3}, /* 83D0 */ + {0x83B1,0x83D1,0x03C4}, + {0x83B2,0x83D2,0x03C5}, + {0x83B3,0x83D3,0x03C6}, + {0x83B4,0x83D4,0x03C7}, + {0x83B5,0x83D5,0x03C8}, + {0x83B6,0x83D6,0x03C9}, + {0x83D7,0x83D7,0x003F}, + {0x83D8,0x83D8,0x003F}, + {0x83D9,0x83D9,0x003F}, + {0x83DA,0x83DA,0x003F}, + {0x83DB,0x83DB,0x003F}, + {0x83DC,0x83DC,0x003F}, + {0x83DD,0x83DD,0x003F}, + {0x83DE,0x83DE,0x003F}, + {0x83DF,0x83DF,0x003F}, + {0x83E0,0x83E0,0x003F}, /* 83E0 */ + {0x83E1,0x83E1,0x003F}, + {0x83E2,0x83E2,0x003F}, + {0x83E3,0x83E3,0x003F}, + {0x83E4,0x83E4,0x003F}, + {0x83E5,0x83E5,0x003F}, + {0x83E6,0x83E6,0x003F}, + {0x83E7,0x83E7,0x003F}, + {0x83E8,0x83E8,0x003F}, + {0x83E9,0x83E9,0x003F}, + {0x83EA,0x83EA,0x003F}, + {0x83EB,0x83EB,0x003F}, + {0x83EC,0x83EC,0x003F}, + {0x83ED,0x83ED,0x003F}, + {0x83EE,0x83EE,0x003F}, + {0x83EF,0x83EF,0x003F}, + {0x83F0,0x83F0,0x003F}, /* 83F0 */ + {0x83F1,0x83F1,0x003F}, + {0x83F2,0x83F2,0x003F}, + {0x83F3,0x83F3,0x003F}, + {0x83F4,0x83F4,0x003F}, + {0x83F5,0x83F5,0x003F}, + {0x83F6,0x83F6,0x003F}, + {0x83F7,0x83F7,0x003F}, + {0x83F8,0x83F8,0x003F}, + {0x83F9,0x83F9,0x003F}, + {0x83FA,0x83FA,0x003F}, + {0x83FB,0x83FB,0x003F}, + {0x83FC,0x83FC,0x003F}, + {0,0,0}, + {0,0,0}, + {0,0,0} +}; + + +static MY_UNICASE_INFO c84[256]= +{ + /* 8400-840F */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + /* 8410-841F */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + /* 8420-842F */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + /* 8430-843F */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + + {0x8440,0x8470,0x0410}, /* 8440 */ + {0x8441,0x8471,0x0411}, + {0x8442,0x8472,0x0412}, + {0x8443,0x8473,0x0413}, + {0x8444,0x8474,0x0414}, + {0x8445,0x8475,0x0415}, + {0x8446,0x8476,0x0401}, + {0x8447,0x8477,0x0416}, + {0x8448,0x8478,0x0417}, + {0x8449,0x8479,0x0418}, + {0x844A,0x847A,0x0419}, + {0x844B,0x847B,0x041A}, + {0x844C,0x847C,0x041B}, + {0x844D,0x847D,0x041C}, + {0x844E,0x847E,0x041D}, + {0x844F,0x8480,0x041E}, + {0x8450,0x8481,0x041F}, /* 8450 */ + {0x8451,0x8482,0x0420}, + {0x8452,0x8483,0x0421}, + {0x8453,0x8484,0x0422}, + {0x8454,0x8485,0x0423}, + {0x8455,0x8486,0x0424}, + {0x8456,0x8487,0x0425}, + {0x8457,0x8488,0x0426}, + {0x8458,0x8489,0x0427}, + {0x8459,0x848A,0x0428}, + {0x845A,0x848B,0x0429}, + {0x845B,0x848C,0x042A}, + {0x845C,0x848D,0x042B}, + {0x845D,0x848E,0x042C}, + {0x845E,0x848F,0x042D}, + {0x845F,0x8490,0x042E}, + {0x8460,0x8491,0x042F}, /* 8460 */ + {0x8461,0x8461,0x003F}, + {0x8462,0x8462,0x003F}, + {0x8463,0x8463,0x003F}, + {0x8464,0x8464,0x003F}, + {0x8465,0x8465,0x003F}, + {0x8466,0x8466,0x003F}, + {0x8467,0x8467,0x003F}, + {0x8468,0x8468,0x003F}, + {0x8469,0x8469,0x003F}, + {0x846A,0x846A,0x003F}, + {0x846B,0x846B,0x003F}, + {0x846C,0x846C,0x003F}, + {0x846D,0x846D,0x003F}, + {0x846E,0x846E,0x003F}, + {0x846F,0x846F,0x003F}, + {0x8440,0x8470,0x0430}, /* 8470 */ + {0x8441,0x8471,0x0431}, + {0x8442,0x8472,0x0432}, + {0x8443,0x8473,0x0433}, + {0x8444,0x8474,0x0434}, + {0x8445,0x8475,0x0435}, + {0x8446,0x8476,0x0451}, + {0x8447,0x8477,0x0436}, + {0x8448,0x8478,0x0437}, + {0x8449,0x8479,0x0438}, + {0x844A,0x847A,0x0439}, + {0x844B,0x847B,0x043A}, + {0x844C,0x847C,0x043B}, + {0x844D,0x847D,0x043C}, + {0x844E,0x847E,0x043D}, + {0,0,0}, + {0x844F,0x8480,0x043E}, /* 8480 */ + {0x8450,0x8481,0x043F}, + {0x8451,0x8482,0x0440}, + {0x8452,0x8483,0x0441}, + {0x8453,0x8484,0x0442}, + {0x8454,0x8485,0x0443}, + {0x8455,0x8486,0x0444}, + {0x8456,0x8487,0x0445}, + {0x8457,0x8488,0x0446}, + {0x8458,0x8489,0x0447}, + {0x8459,0x848A,0x0448}, + {0x845A,0x848B,0x0449}, + {0x845B,0x848C,0x044A}, + {0x845C,0x848D,0x044B}, + {0x845D,0x848E,0x044C}, + {0x845E,0x848F,0x044D}, + {0x845F,0x8490,0x044E}, /* 8490 */ + {0x8460,0x8491,0x044F}, + {0x8492,0x8492,0x003F}, + {0x8493,0x8493,0x003F}, + {0x8494,0x8494,0x003F}, + {0x8495,0x8495,0x003F}, + {0x8496,0x8496,0x003F}, + {0x8497,0x8497,0x003F}, + {0x8498,0x8498,0x003F}, + {0x8499,0x8499,0x003F}, + {0x849A,0x849A,0x003F}, + {0x849B,0x849B,0x003F}, + {0x849C,0x849C,0x003F}, + {0x849D,0x849D,0x003F}, + {0x849E,0x849E,0x003F}, + {0x849F,0x849F,0x2500}, + {0x84A0,0x84A0,0x2502}, /* 84A0 */ + {0x84A1,0x84A1,0x250C}, + {0x84A2,0x84A2,0x2510}, + {0x84A3,0x84A3,0x2518}, + {0x84A4,0x84A4,0x2514}, + {0x84A5,0x84A5,0x251C}, + {0x84A6,0x84A6,0x252C}, + {0x84A7,0x84A7,0x2524}, + {0x84A8,0x84A8,0x2534}, + {0x84A9,0x84A9,0x253C}, + {0x84AA,0x84AA,0x2501}, + {0x84AB,0x84AB,0x2503}, + {0x84AC,0x84AC,0x250F}, + {0x84AD,0x84AD,0x2513}, + {0x84AE,0x84AE,0x251B}, + {0x84AF,0x84AF,0x2517}, + {0x84B0,0x84B0,0x2523}, /* 84B0 */ + {0x84B1,0x84B1,0x2533}, + {0x84B2,0x84B2,0x252B}, + {0x84B3,0x84B3,0x253B}, + {0x84B4,0x84B4,0x254B}, + {0x84B5,0x84B5,0x2520}, + {0x84B6,0x84B6,0x252F}, + {0x84B7,0x84B7,0x2528}, + {0x84B8,0x84B8,0x2537}, + {0x84B9,0x84B9,0x253F}, + {0x84BA,0x84BA,0x251D}, + {0x84BB,0x84BB,0x2530}, + {0x84BC,0x84BC,0x2525}, + {0x84BD,0x84BD,0x2538}, + {0x84BE,0x84BE,0x2542}, + {0x84BF,0x84BF,0x003F}, + {0x84C0,0x84C0,0x003F}, /* 84C0 */ + {0x84C1,0x84C1,0x003F}, + {0x84C2,0x84C2,0x003F}, + {0x84C3,0x84C3,0x003F}, + {0x84C4,0x84C4,0x003F}, + {0x84C5,0x84C5,0x003F}, + {0x84C6,0x84C6,0x003F}, + {0x84C7,0x84C7,0x003F}, + {0x84C8,0x84C8,0x003F}, + {0x84C9,0x84C9,0x003F}, + {0x84CA,0x84CA,0x003F}, + {0x84CB,0x84CB,0x003F}, + {0x84CC,0x84CC,0x003F}, + {0x84CD,0x84CD,0x003F}, + {0x84CE,0x84CE,0x003F}, + {0x84CF,0x84CF,0x003F}, + {0x84D0,0x84D0,0x003F}, /* 84D0 */ + {0x84D1,0x84D1,0x003F}, + {0x84D2,0x84D2,0x003F}, + {0x84D3,0x84D3,0x003F}, + {0x84D4,0x84D4,0x003F}, + {0x84D5,0x84D5,0x003F}, + {0x84D6,0x84D6,0x003F}, + {0x84D7,0x84D7,0x003F}, + {0x84D8,0x84D8,0x003F}, + {0x84D9,0x84D9,0x003F}, + {0x84DA,0x84DA,0x003F}, + {0x84DB,0x84DB,0x003F}, + {0x84DC,0x84DC,0x003F}, + {0x84DD,0x84DD,0x003F}, + {0x84DE,0x84DE,0x003F}, + {0x84DF,0x84DF,0x003F}, + {0x84E0,0x84E0,0x003F}, /* 84E0 */ + {0x84E1,0x84E1,0x003F}, + {0x84E2,0x84E2,0x003F}, + {0x84E3,0x84E3,0x003F}, + {0x84E4,0x84E4,0x003F}, + {0x84E5,0x84E5,0x003F}, + {0x84E6,0x84E6,0x003F}, + {0x84E7,0x84E7,0x003F}, + {0x84E8,0x84E8,0x003F}, + {0x84E9,0x84E9,0x003F}, + {0x84EA,0x84EA,0x003F}, + {0x84EB,0x84EB,0x003F}, + {0x84EC,0x84EC,0x003F}, + {0x84ED,0x84ED,0x003F}, + {0x84EE,0x84EE,0x003F}, + {0x84EF,0x84EF,0x003F}, + {0x84F0,0x84F0,0x003F}, /* 84F0 */ + {0x84F1,0x84F1,0x003F}, + {0x84F2,0x84F2,0x003F}, + {0x84F3,0x84F3,0x003F}, + {0x84F4,0x84F4,0x003F}, + {0x84F5,0x84F5,0x003F}, + {0x84F6,0x84F6,0x003F}, + {0x84F7,0x84F7,0x003F}, + {0x84F8,0x84F8,0x003F}, + {0x84F9,0x84F9,0x003F}, + {0x84FA,0x84FA,0x003F}, + {0x84FB,0x84FB,0x003F}, + {0x84FC,0x84FC,0x003F}, + {0,0,0}, + {0,0,0}, + {0,0,0} +}; + + +static MY_UNICASE_INFO c87[256]= +{ + /* 8700-870F */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + /* 8710-871F */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + /* 8720-872F */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + /* 8730-873F */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {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,0x8740,0x2460}, /* 8740 */ + {0x8741,0x8741,0x2461}, + {0x8742,0x8742,0x2462}, + {0x8743,0x8743,0x2463}, + {0x8744,0x8744,0x2464}, + {0x8745,0x8745,0x2465}, + {0x8746,0x8746,0x2466}, + {0x8747,0x8747,0x2467}, + {0x8748,0x8748,0x2468}, + {0x8749,0x8749,0x2469}, + {0x874A,0x874A,0x246A}, + {0x874B,0x874B,0x246B}, + {0x874C,0x874C,0x246C}, + {0x874D,0x874D,0x246D}, + {0x874E,0x874E,0x246E}, + {0x874F,0x874F,0x246F}, + {0x8750,0x8750,0x2470}, /* 8750 */ + {0x8751,0x8751,0x2471}, + {0x8752,0x8752,0x2472}, + {0x8753,0x8753,0x2473}, + {0x8754,0xEEEF,0x2160}, + {0x8755,0xEEF0,0x2161}, + {0x8756,0xEEF1,0x2162}, + {0x8757,0xEEF2,0x2163}, + {0x8758,0xEEF3,0x2164}, + {0x8759,0xEEF4,0x2165}, + {0x875A,0xEEF5,0x2166}, + {0x875B,0xEEF6,0x2167}, + {0x875C,0xEEF7,0x2168}, + {0x875D,0xEEF8,0x2169}, + {0x875E,0x875E,0x003F}, + {0x875F,0x875F,0x3349}, + {0x8760,0x8760,0x3314}, /* 8760 */ + {0x8761,0x8761,0x3322}, + {0x8762,0x8762,0x334D}, + {0x8763,0x8763,0x3318}, + {0x8764,0x8764,0x3327}, + {0x8765,0x8765,0x3303}, + {0x8766,0x8766,0x3336}, + {0x8767,0x8767,0x3351}, + {0x8768,0x8768,0x3357}, + {0x8769,0x8769,0x330D}, + {0x876A,0x876A,0x3326}, + {0x876B,0x876B,0x3323}, + {0x876C,0x876C,0x332B}, + {0x876D,0x876D,0x334A}, + {0x876E,0x876E,0x333B}, + {0x876F,0x876F,0x339C}, + {0x8770,0x8770,0x339D}, /* 8770 */ + {0x8771,0x8771,0x339E}, + {0x8772,0x8772,0x338E}, + {0x8773,0x8773,0x338F}, + {0x8774,0x8774,0x33C4}, + {0x8775,0x8775,0x33A1}, + {0x8776,0x8776,0x003F}, + {0x8777,0x8777,0x003F}, + {0x8778,0x8778,0x003F}, + {0x8779,0x8779,0x003F}, + {0x877A,0x877A,0x003F}, + {0x877B,0x877B,0x003F}, + {0x877C,0x877C,0x003F}, + {0x877D,0x877D,0x003F}, + {0x877E,0x877E,0x337B}, + {0,0,0}, + {0x8780,0x8780,0x301D}, /* 8780 */ + {0x8781,0x8781,0x301F}, + {0x8782,0x8782,0x2116}, + {0x8783,0x8783,0x33CD}, + {0x8784,0x8784,0x2121}, + {0x8785,0x8785,0x32A4}, + {0x8786,0x8786,0x32A5}, + {0x8787,0x8787,0x32A6}, + {0x8788,0x8788,0x32A7}, + {0x8789,0x8789,0x32A8}, + {0x878A,0x878A,0x3231}, + {0x878B,0x878B,0x3232}, + {0x878C,0x878C,0x3239}, + {0x878D,0x878D,0x337E}, + {0x878E,0x878E,0x337D}, + {0x878F,0x878F,0x337C}, + {0x8790,0x8790,0x2252}, /* 8790 */ + {0x8791,0x8791,0x2261}, + {0x8792,0x8792,0x222B}, + {0x8793,0x8793,0x222E}, + {0x8794,0x8794,0x2211}, + {0x8795,0x8795,0x221A}, + {0x8796,0x8796,0x22A5}, + {0x8797,0x8797,0x2220}, + {0x8798,0x8798,0x221F}, + {0x8799,0x8799,0x22BF}, + {0x879A,0x879A,0x2235}, + {0x879B,0x879B,0x2229}, + {0x879C,0x879C,0x222A}, + {0x879D,0x879D,0x003F}, + {0x879E,0x879E,0x003F}, + {0x879F,0x879F,0x003F}, + {0x87A0,0x87A0,0x003F}, /* 87A0 */ + {0x87A1,0x87A1,0x003F}, + {0x87A2,0x87A2,0x003F}, + {0x87A3,0x87A3,0x003F}, + {0x87A4,0x87A4,0x003F}, + {0x87A5,0x87A5,0x003F}, + {0x87A6,0x87A6,0x003F}, + {0x87A7,0x87A7,0x003F}, + {0x87A8,0x87A8,0x003F}, + {0x87A9,0x87A9,0x003F}, + {0x87AA,0x87AA,0x003F}, + {0x87AB,0x87AB,0x003F}, + {0x87AC,0x87AC,0x003F}, + {0x87AD,0x87AD,0x003F}, + {0x87AE,0x87AE,0x003F}, + {0x87AF,0x87AF,0x003F}, + {0x87B0,0x87B0,0x003F}, /* 87B0 */ + {0x87B1,0x87B1,0x003F}, + {0x87B2,0x87B2,0x003F}, + {0x87B3,0x87B3,0x003F}, + {0x87B4,0x87B4,0x003F}, + {0x87B5,0x87B5,0x003F}, + {0x87B6,0x87B6,0x003F}, + {0x87B7,0x87B7,0x003F}, + {0x87B8,0x87B8,0x003F}, + {0x87B9,0x87B9,0x003F}, + {0x87BA,0x87BA,0x003F}, + {0x87BB,0x87BB,0x003F}, + {0x87BC,0x87BC,0x003F}, + {0x87BD,0x87BD,0x003F}, + {0x87BE,0x87BE,0x003F}, + {0x87BF,0x87BF,0x003F}, + {0x87C0,0x87C0,0x003F}, /* 87C0 */ + {0x87C1,0x87C1,0x003F}, + {0x87C2,0x87C2,0x003F}, + {0x87C3,0x87C3,0x003F}, + {0x87C4,0x87C4,0x003F}, + {0x87C5,0x87C5,0x003F}, + {0x87C6,0x87C6,0x003F}, + {0x87C7,0x87C7,0x003F}, + {0x87C8,0x87C8,0x003F}, + {0x87C9,0x87C9,0x003F}, + {0x87CA,0x87CA,0x003F}, + {0x87CB,0x87CB,0x003F}, + {0x87CC,0x87CC,0x003F}, + {0x87CD,0x87CD,0x003F}, + {0x87CE,0x87CE,0x003F}, + {0x87CF,0x87CF,0x003F}, + {0x87D0,0x87D0,0x003F}, /* 87D0 */ + {0x87D1,0x87D1,0x003F}, + {0x87D2,0x87D2,0x003F}, + {0x87D3,0x87D3,0x003F}, + {0x87D4,0x87D4,0x003F}, + {0x87D5,0x87D5,0x003F}, + {0x87D6,0x87D6,0x003F}, + {0x87D7,0x87D7,0x003F}, + {0x87D8,0x87D8,0x003F}, + {0x87D9,0x87D9,0x003F}, + {0x87DA,0x87DA,0x003F}, + {0x87DB,0x87DB,0x003F}, + {0x87DC,0x87DC,0x003F}, + {0x87DD,0x87DD,0x003F}, + {0x87DE,0x87DE,0x003F}, + {0x87DF,0x87DF,0x003F}, + {0x87E0,0x87E0,0x003F}, /* 87E0 */ + {0x87E1,0x87E1,0x003F}, + {0x87E2,0x87E2,0x003F}, + {0x87E3,0x87E3,0x003F}, + {0x87E4,0x87E4,0x003F}, + {0x87E5,0x87E5,0x003F}, + {0x87E6,0x87E6,0x003F}, + {0x87E7,0x87E7,0x003F}, + {0x87E8,0x87E8,0x003F}, + {0x87E9,0x87E9,0x003F}, + {0x87EA,0x87EA,0x003F}, + {0x87EB,0x87EB,0x003F}, + {0x87EC,0x87EC,0x003F}, + {0x87ED,0x87ED,0x003F}, + {0x87EE,0x87EE,0x003F}, + {0x87EF,0x87EF,0x003F}, + {0x87F0,0x87F0,0x003F}, /* 87F0 */ + {0x87F1,0x87F1,0x003F}, + {0x87F2,0x87F2,0x003F}, + {0x87F3,0x87F3,0x003F}, + {0x87F4,0x87F4,0x003F}, + {0x87F5,0x87F5,0x003F}, + {0x87F6,0x87F6,0x003F}, + {0x87F7,0x87F7,0x003F}, + {0x87F8,0x87F8,0x003F}, + {0x87F9,0x87F9,0x003F}, + {0x87FA,0x87FA,0x003F}, + {0x87FB,0x87FB,0x003F}, + {0x87FC,0x87FC,0x003F}, + {0,0,0}, + {0,0,0}, + {0,0,0} +}; + + +static MY_UNICASE_INFO cEE[256]= +{ + /* EE00-EE0F */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + /* EE10-EE1F */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + /* EE20-EE2F */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + /* EE30-EE3F */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + + {0xEE40,0xEE40,0x72BE}, /* EE40 */ + {0xEE41,0xEE41,0x7324}, + {0xEE42,0xEE42,0xFA16}, + {0xEE43,0xEE43,0x7377}, + {0xEE44,0xEE44,0x73BD}, + {0xEE45,0xEE45,0x73C9}, + {0xEE46,0xEE46,0x73D6}, + {0xEE47,0xEE47,0x73E3}, + {0xEE48,0xEE48,0x73D2}, + {0xEE49,0xEE49,0x7407}, + {0xEE4A,0xEE4A,0x73F5}, + {0xEE4B,0xEE4B,0x7426}, + {0xEE4C,0xEE4C,0x742A}, + {0xEE4D,0xEE4D,0x7429}, + {0xEE4E,0xEE4E,0x742E}, + {0xEE4F,0xEE4F,0x7462}, + + {0xEE50,0xEE50,0x7489}, /* EE50 */ + {0xEE51,0xEE51,0x749F}, + {0xEE52,0xEE52,0x7501}, + {0xEE53,0xEE53,0x756F}, + {0xEE54,0xEE54,0x7682}, + {0xEE55,0xEE55,0x769C}, + {0xEE56,0xEE56,0x769E}, + {0xEE57,0xEE57,0x769B}, + {0xEE58,0xEE58,0x76A6}, + {0xEE59,0xEE59,0xFA17}, + {0xEE5A,0xEE5A,0x7746}, + {0xEE5B,0xEE5B,0x52AF}, + {0xEE5C,0xEE5C,0x7821}, + {0xEE5D,0xEE5D,0x784E}, + {0xEE5E,0xEE5E,0x7864}, + {0xEE5F,0xEE5F,0x787A}, + {0xEE60,0xEE60,0x7930}, /* EE60 */ + {0xEE61,0xEE61,0xFA18}, + {0xEE62,0xEE62,0xFA19}, + {0xEE63,0xEE63,0xFA1A}, + {0xEE64,0xEE64,0x7994}, + {0xEE65,0xEE65,0xFA1B}, + {0xEE66,0xEE66,0x799B}, + {0xEE67,0xEE67,0x7AD1}, + {0xEE68,0xEE68,0x7AE7}, + {0xEE69,0xEE69,0xFA1C}, + {0xEE6A,0xEE6A,0x7AEB}, + {0xEE6B,0xEE6B,0x7B9E}, + {0xEE6C,0xEE6C,0xFA1D}, + {0xEE6D,0xEE6D,0x7D48}, + {0xEE6E,0xEE6E,0x7D5C}, + {0xEE6F,0xEE6F,0x7DB7}, + {0xEE70,0xEE70,0x7DA0}, /* EE70 */ + {0xEE71,0xEE71,0x7DD6}, + {0xEE72,0xEE72,0x7E52}, + {0xEE73,0xEE73,0x7F47}, + {0xEE74,0xEE74,0x7FA1}, + {0xEE75,0xEE75,0xFA1E}, + {0xEE76,0xEE76,0x8301}, + {0xEE77,0xEE77,0x8362}, + {0xEE78,0xEE78,0x837F}, + {0xEE79,0xEE79,0x83C7}, + {0xEE7A,0xEE7A,0x83F6}, + {0xEE7B,0xEE7B,0x8448}, + {0xEE7C,0xEE7C,0x84B4}, + {0xEE7D,0xEE7D,0x8553}, + {0xEE7E,0xEE7E,0x8559}, + {0,0,0}, + {0xEE80,0xEE80,0x856B}, /* EE80 */ + {0xEE81,0xEE81,0xFA1F}, + {0xEE82,0xEE82,0x85B0}, + {0xEE83,0xEE83,0xFA20}, + {0xEE84,0xEE84,0xFA21}, + {0xEE85,0xEE85,0x8807}, + {0xEE86,0xEE86,0x88F5}, + {0xEE87,0xEE87,0x8A12}, + {0xEE88,0xEE88,0x8A37}, + {0xEE89,0xEE89,0x8A79}, + {0xEE8A,0xEE8A,0x8AA7}, + {0xEE8B,0xEE8B,0x8ABE}, + {0xEE8C,0xEE8C,0x8ADF}, + {0xEE8D,0xEE8D,0xFA22}, + {0xEE8E,0xEE8E,0x8AF6}, + {0xEE8F,0xEE8F,0x8B53}, + {0xEE90,0xEE90,0x8B7F}, /* EE90 */ + {0xEE91,0xEE91,0x8CF0}, + {0xEE92,0xEE92,0x8CF4}, + {0xEE93,0xEE93,0x8D12}, + {0xEE94,0xEE94,0x8D76}, + {0xEE95,0xEE95,0xFA23}, + {0xEE96,0xEE96,0x8ECF}, + {0xEE97,0xEE97,0xFA24}, + {0xEE98,0xEE98,0xFA25}, + {0xEE99,0xEE99,0x9067}, + {0xEE9A,0xEE9A,0x90DE}, + {0xEE9B,0xEE9B,0xFA26}, + {0xEE9C,0xEE9C,0x9115}, + {0xEE9D,0xEE9D,0x9127}, + {0xEE9E,0xEE9E,0x91DA}, + {0xEE9F,0xEE9F,0x91D7}, + {0xEEA0,0xEEA0,0x91DE}, /* EEA0 */ + {0xEEA1,0xEEA1,0x91ED}, + {0xEEA2,0xEEA2,0x91EE}, + {0xEEA3,0xEEA3,0x91E4}, + {0xEEA4,0xEEA4,0x91E5}, + {0xEEA5,0xEEA5,0x9206}, + {0xEEA6,0xEEA6,0x9210}, + {0xEEA7,0xEEA7,0x920A}, + {0xEEA8,0xEEA8,0x923A}, + {0xEEA9,0xEEA9,0x9240}, + {0xEEAA,0xEEAA,0x923C}, + {0xEEAB,0xEEAB,0x924E}, + {0xEEAC,0xEEAC,0x9259}, + {0xEEAD,0xEEAD,0x9251}, + {0xEEAE,0xEEAE,0x9239}, + {0xEEAF,0xEEAF,0x9267}, + {0xEEB0,0xEEB0,0x92A7}, /* EEB0 */ + {0xEEB1,0xEEB1,0x9277}, + {0xEEB2,0xEEB2,0x9278}, + {0xEEB3,0xEEB3,0x92E7}, + {0xEEB4,0xEEB4,0x92D7}, + {0xEEB5,0xEEB5,0x92D9}, + {0xEEB6,0xEEB6,0x92D0}, + {0xEEB7,0xEEB7,0xFA27}, + {0xEEB8,0xEEB8,0x92D5}, + {0xEEB9,0xEEB9,0x92E0}, + {0xEEBA,0xEEBA,0x92D3}, + {0xEEBB,0xEEBB,0x9325}, + {0xEEBC,0xEEBC,0x9321}, + {0xEEBD,0xEEBD,0x92FB}, + {0xEEBE,0xEEBE,0xFA28}, + {0xEEBF,0xEEBF,0x931E}, + {0xEEC0,0xEEC0,0x92FF}, /* EEC0 */ + {0xEEC1,0xEEC1,0x931D}, + {0xEEC2,0xEEC2,0x9302}, + {0xEEC3,0xEEC3,0x9370}, + {0xEEC4,0xEEC4,0x9357}, + {0xEEC5,0xEEC5,0x93A4}, + {0xEEC6,0xEEC6,0x93C6}, + {0xEEC7,0xEEC7,0x93DE}, + {0xEEC8,0xEEC8,0x93F8}, + {0xEEC9,0xEEC9,0x9431}, + {0xEECA,0xEECA,0x9445}, + {0xEECB,0xEECB,0x9448}, + {0xEECC,0xEECC,0x9592}, + {0xEECD,0xEECD,0xF9DC}, + {0xEECE,0xEECE,0xFA29}, + {0xEECF,0xEECF,0x969D}, + {0xEED0,0xEED0,0x96AF}, /* EED0 */ + {0xEED1,0xEED1,0x9733}, + {0xEED2,0xEED2,0x973B}, + {0xEED3,0xEED3,0x9743}, + {0xEED4,0xEED4,0x974D}, + {0xEED5,0xEED5,0x974F}, + {0xEED6,0xEED6,0x9751}, + {0xEED7,0xEED7,0x9755}, + {0xEED8,0xEED8,0x9857}, + {0xEED9,0xEED9,0x9865}, + {0xEEDA,0xEEDA,0xFA2A}, + {0xEEDB,0xEEDB,0xFA2B}, + {0xEEDC,0xEEDC,0x9927}, + {0xEEDD,0xEEDD,0xFA2C}, + {0xEEDE,0xEEDE,0x999E}, + {0xEEDF,0xEEDF,0x9A4E}, + {0xEEE0,0xEEE0,0x9AD9}, /* EEE0 */ + {0xEEE1,0xEEE1,0x9ADC}, + {0xEEE2,0xEEE2,0x9B75}, + {0xEEE3,0xEEE3,0x9B72}, + {0xEEE4,0xEEE4,0x9B8F}, + {0xEEE5,0xEEE5,0x9BB1}, + {0xEEE6,0xEEE6,0x9BBB}, + {0xEEE7,0xEEE7,0x9C00}, + {0xEEE8,0xEEE8,0x9D70}, + {0xEEE9,0xEEE9,0x9D6B}, + {0xEEEA,0xEEEA,0xFA2D}, + {0xEEEB,0xEEEB,0x9E19}, + {0xEEEC,0xEEEC,0x9ED1}, + {0xEEED,0xEEED,0x003F}, + {0xEEEE,0xEEEE,0x003F}, + {0x8754,0xEEEF,0x2170}, + {0x8755,0xEEF0,0x2171}, /* EEF0 */ + {0x8756,0xEEF1,0x2172}, + {0x8757,0xEEF2,0x2173}, + {0x8758,0xEEF3,0x2174}, + {0x8759,0xEEF4,0x2175}, + {0x875A,0xEEF5,0x2176}, + {0x875B,0xEEF6,0x2177}, + {0x875C,0xEEF7,0x2178}, + {0x875D,0xEEF8,0x2179}, + {0xEEF9,0xEEF9,0xFFE2}, + {0xEEFA,0xEEFA,0xFFE4}, + {0xEEFB,0xEEFB,0xFF07}, + {0xEEFC,0xEEFC,0xFF02}, + {0,0,0}, + {0,0,0}, + {0,0,0} +}; + + +static MY_UNICASE_INFO cFA[256]= +{ + /* FA00-FA0F */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + /* FA10-FA1F */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + /* FA20-FA2F */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + /* FA30-FA3F */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + + {0xFA4A,0xFA40,0x2170}, /* FA40 */ + {0xFA4B,0xFA41,0x2171}, + {0xFA4C,0xFA42,0x2172}, + {0xFA4D,0xFA43,0x2173}, + {0xFA4E,0xFA44,0x2174}, + {0xFA4F,0xFA45,0x2175}, + {0xFA50,0xFA46,0x2176}, + {0xFA51,0xFA47,0x2177}, + {0xFA52,0xFA48,0x2178}, + {0xFA53,0xFA49,0x2179}, + {0xFA4A,0xFA40,0x2160}, + {0xFA4B,0xFA41,0x2161}, + {0xFA4C,0xFA42,0x2162}, + {0xFA4D,0xFA43,0x2163}, + {0xFA4E,0xFA44,0x2164}, + {0xFA4F,0xFA45,0x2165}, + {0xFA50,0xFA46,0x2166}, /* FA50 */ + {0xFA51,0xFA47,0x2167}, + {0xFA52,0xFA48,0x2168}, + {0xFA53,0xFA49,0x2169}, + {0xFA54,0xFA54,0xFFE2}, + {0xFA55,0xFA55,0xFFE4}, + {0xFA56,0xFA56,0xFF07}, + {0xFA57,0xFA57,0xFF02}, + {0xFA58,0xFA58,0x3231}, + {0xFA59,0xFA59,0x2116}, + {0xFA5A,0xFA5A,0x2121}, + {0xFA5B,0xFA5B,0x2235}, + {0xFA5C,0xFA5C,0x7E8A}, + {0xFA5D,0xFA5D,0x891C}, + {0xFA5E,0xFA5E,0x9348}, + {0xFA5F,0xFA5F,0x9288}, + {0xFA60,0xFA60,0x84DC}, /* FA60 */ + {0xFA61,0xFA61,0x4FC9}, + {0xFA62,0xFA62,0x70BB}, + {0xFA63,0xFA63,0x6631}, + {0xFA64,0xFA64,0x68C8}, + {0xFA65,0xFA65,0x92F9}, + {0xFA66,0xFA66,0x66FB}, + {0xFA67,0xFA67,0x5F45}, + {0xFA68,0xFA68,0x4E28}, + {0xFA69,0xFA69,0x4EE1}, + {0xFA6A,0xFA6A,0x4EFC}, + {0xFA6B,0xFA6B,0x4F00}, + {0xFA6C,0xFA6C,0x4F03}, + {0xFA6D,0xFA6D,0x4F39}, + {0xFA6E,0xFA6E,0x4F56}, + {0xFA6F,0xFA6F,0x4F92}, + {0xFA70,0xFA70,0x4F8A}, /* FA70 */ + {0xFA71,0xFA71,0x4F9A}, + {0xFA72,0xFA72,0x4F94}, + {0xFA73,0xFA73,0x4FCD}, + {0xFA74,0xFA74,0x5040}, + {0xFA75,0xFA75,0x5022}, + {0xFA76,0xFA76,0x4FFF}, + {0xFA77,0xFA77,0x501E}, + {0xFA78,0xFA78,0x5046}, + {0xFA79,0xFA79,0x5070}, + {0xFA7A,0xFA7A,0x5042}, + {0xFA7B,0xFA7B,0x5094}, + {0xFA7C,0xFA7C,0x50F4}, + {0xFA7D,0xFA7D,0x50D8}, + {0xFA7E,0xFA7E,0x514A}, + {0,0,0}, + {0xFA80,0xFA80,0x5164}, /* FA80 */ + {0xFA81,0xFA81,0x519D}, + {0xFA82,0xFA82,0x51BE}, + {0xFA83,0xFA83,0x51EC}, + {0xFA84,0xFA84,0x5215}, + {0xFA85,0xFA85,0x529C}, + {0xFA86,0xFA86,0x52A6}, + {0xFA87,0xFA87,0x52C0}, + {0xFA88,0xFA88,0x52DB}, + {0xFA89,0xFA89,0x5300}, + {0xFA8A,0xFA8A,0x5307}, + {0xFA8B,0xFA8B,0x5324}, + {0xFA8C,0xFA8C,0x5372}, + {0xFA8D,0xFA8D,0x5393}, + {0xFA8E,0xFA8E,0x53B2}, + {0xFA8F,0xFA8F,0x53DD}, + {0xFA90,0xFA90,0xFA0E}, /* FA90 */ + {0xFA91,0xFA91,0x549C}, + {0xFA92,0xFA92,0x548A}, + {0xFA93,0xFA93,0x54A9}, + {0xFA94,0xFA94,0x54FF}, + {0xFA95,0xFA95,0x5586}, + {0xFA96,0xFA96,0x5759}, + {0xFA97,0xFA97,0x5765}, + {0xFA98,0xFA98,0x57AC}, + {0xFA99,0xFA99,0x57C8}, + {0xFA9A,0xFA9A,0x57C7}, + {0xFA9B,0xFA9B,0xFA0F}, + {0xFA9C,0xFA9C,0xFA10}, + {0xFA9D,0xFA9D,0x589E}, + {0xFA9E,0xFA9E,0x58B2}, + {0xFA9F,0xFA9F,0x590B}, + {0xFAA0,0xFAA0,0x5953}, /* FAA0 */ + {0xFAA1,0xFAA1,0x595B}, + {0xFAA2,0xFAA2,0x595D}, + {0xFAA3,0xFAA3,0x5963}, + {0xFAA4,0xFAA4,0x59A4}, + {0xFAA5,0xFAA5,0x59BA}, + {0xFAA6,0xFAA6,0x5B56}, + {0xFAA7,0xFAA7,0x5BC0}, + {0xFAA8,0xFAA8,0x752F}, + {0xFAA9,0xFAA9,0x5BD8}, + {0xFAAA,0xFAAA,0x5BEC}, + {0xFAAB,0xFAAB,0x5C1E}, + {0xFAAC,0xFAAC,0x5CA6}, + {0xFAAD,0xFAAD,0x5CBA}, + {0xFAAE,0xFAAE,0x5CF5}, + {0xFAAF,0xFAAF,0x5D27}, + {0xFAB0,0xFAB0,0x5D53}, /* FAB0 */ + {0xFAB1,0xFAB1,0xFA11}, + {0xFAB2,0xFAB2,0x5D42}, + {0xFAB3,0xFAB3,0x5D6D}, + {0xFAB4,0xFAB4,0x5DB8}, + {0xFAB5,0xFAB5,0x5DB9}, + {0xFAB6,0xFAB6,0x5DD0}, + {0xFAB7,0xFAB7,0x5F21}, + {0xFAB8,0xFAB8,0x5F34}, + {0xFAB9,0xFAB9,0x5F67}, + {0xFABA,0xFABA,0x5FB7}, + {0xFABB,0xFABB,0x5FDE}, + {0xFABC,0xFABC,0x605D}, + {0xFABD,0xFABD,0x6085}, + {0xFABE,0xFABE,0x608A}, + {0xFABF,0xFABF,0x60DE}, + {0xFAC0,0xFAC0,0x60D5}, /* FAC0 */ + {0xFAC1,0xFAC1,0x6120}, + {0xFAC2,0xFAC2,0x60F2}, + {0xFAC3,0xFAC3,0x6111}, + {0xFAC4,0xFAC4,0x6137}, + {0xFAC5,0xFAC5,0x6130}, + {0xFAC6,0xFAC6,0x6198}, + {0xFAC7,0xFAC7,0x6213}, + {0xFAC8,0xFAC8,0x62A6}, + {0xFAC9,0xFAC9,0x63F5}, + {0xFACA,0xFACA,0x6460}, + {0xFACB,0xFACB,0x649D}, + {0xFACC,0xFACC,0x64CE}, + {0xFACD,0xFACD,0x654E}, + {0xFACE,0xFACE,0x6600}, + {0xFACF,0xFACF,0x6615}, + {0xFAD0,0xFAD0,0x663B}, /* FAD0 */ + {0xFAD1,0xFAD1,0x6609}, + {0xFAD2,0xFAD2,0x662E}, + {0xFAD3,0xFAD3,0x661E}, + {0xFAD4,0xFAD4,0x6624}, + {0xFAD5,0xFAD5,0x6665}, + {0xFAD6,0xFAD6,0x6657}, + {0xFAD7,0xFAD7,0x6659}, + {0xFAD8,0xFAD8,0xFA12}, + {0xFAD9,0xFAD9,0x6673}, + {0xFADA,0xFADA,0x6699}, + {0xFADB,0xFADB,0x66A0}, + {0xFADC,0xFADC,0x66B2}, + {0xFADD,0xFADD,0x66BF}, + {0xFADE,0xFADE,0x66FA}, + {0xFADF,0xFADF,0x670E}, + {0xFAE0,0xFAE0,0xF929}, /* FAE0 */ + {0xFAE1,0xFAE1,0x6766}, + {0xFAE2,0xFAE2,0x67BB}, + {0xFAE3,0xFAE3,0x6852}, + {0xFAE4,0xFAE4,0x67C0}, + {0xFAE5,0xFAE5,0x6801}, + {0xFAE6,0xFAE6,0x6844}, + {0xFAE7,0xFAE7,0x68CF}, + {0xFAE8,0xFAE8,0xFA13}, + {0xFAE9,0xFAE9,0x6968}, + {0xFAEA,0xFAEA,0xFA14}, + {0xFAEB,0xFAEB,0x6998}, + {0xFAEC,0xFAEC,0x69E2}, + {0xFAED,0xFAED,0x6A30}, + {0xFAEE,0xFAEE,0x6A6B}, + {0xFAEF,0xFAEF,0x6A46}, + {0xFAF0,0xFAF0,0x6A73}, /* FAF0 */ + {0xFAF1,0xFAF1,0x6A7E}, + {0xFAF2,0xFAF2,0x6AE2}, + {0xFAF3,0xFAF3,0x6AE4}, + {0xFAF4,0xFAF4,0x6BD6}, + {0xFAF5,0xFAF5,0x6C3F}, + {0xFAF6,0xFAF6,0x6C5C}, + {0xFAF7,0xFAF7,0x6C86}, + {0xFAF8,0xFAF8,0x6C6F}, + {0xFAF9,0xFAF9,0x6CDA}, + {0xFAFA,0xFAFA,0x6D04}, + {0xFAFB,0xFAFB,0x6D87}, + {0xFAFC,0xFAFC,0x6D6F}, + {0,0,0}, + {0,0,0}, + {0,0,0} +}; + + +static MY_UNICASE_INFO *my_caseinfo_cp932[256]= +{ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 0 */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 1 */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 2 */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 3 */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 4 */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 5 */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 6 */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 7 */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, c81, c82, c83, c84, NULL, NULL, c87, /* 8 */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 9 */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* A */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* B */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* C */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* D */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* E */ + NULL, NULL, NULL, NULL, NULL, NULL, cEE, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* F */ + NULL, NULL, cFA, NULL, NULL, NULL, NULL, NULL +}; + + 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) @@ -306,5015 +1812,32893 @@ static size_t my_strnxfrm_cp932(CHARSET_INFO *cs __attribute__((unused)), } -/* 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}; +static uint16 cp932_to_unicode[65536]= +{ + 0x0000, 0x0001, 0x0002, 0x0003, /* 0000 */ + 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, /* 0020 */ + 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, /* 0040 */ + 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, /* 0060 */ + 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, /* 0080 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0xFF61, 0xFF62, 0xFF63, /* 00A0 */ + 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, /* 00C0 */ + 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, + 0x0000, 0x0000, 0x0000, 0x0000, /* 00E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0100 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0120 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0140 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0160 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0180 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 01A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 01C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 01E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0200 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0220 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0240 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0260 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0280 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 02A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 02C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 02E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0300 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0320 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0340 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0360 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0380 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 03A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 03C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 03E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0400 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0420 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0440 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0460 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0480 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 04A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 04C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 04E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0500 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0520 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0540 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0560 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0580 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 05A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 05C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 05E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0600 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0620 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0640 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0660 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0680 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 06A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 06C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 06E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0700 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0720 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0740 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0760 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0780 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 07A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 07C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 07E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0800 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0820 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0840 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0860 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0880 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 08A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 08C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 08E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0900 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0920 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0940 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0960 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0980 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 09A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 09C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 09E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0A00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0A20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0A40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0A60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0A80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0AA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0AC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0AE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0B00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0B20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0B40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0B60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0B80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0BA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0BC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0BE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0C00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0C20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0C40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0C60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0C80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0CA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0CC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0CE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0D00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0D20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0D40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0D60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0D80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0DA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0DC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0DE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0E00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0E20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0E40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0E60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0E80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0EA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0EC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0EE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0F00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0F20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0F40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0F60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0F80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0FA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0FC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0FE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1000 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1020 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1040 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1060 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1080 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 10A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 10C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 10E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1100 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1120 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1140 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1160 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1180 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 11A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 11C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 11E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1200 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1220 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1240 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1260 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1280 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 12A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 12C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 12E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1300 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1320 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1340 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1360 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1380 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 13A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 13C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 13E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1400 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1420 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1440 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1460 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1480 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 14A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 14C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 14E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1500 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1520 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1540 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1560 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1580 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 15A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 15C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 15E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1600 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1620 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1640 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1660 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1680 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 16A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 16C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 16E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1700 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1720 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1740 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1760 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1780 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 17A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 17C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 17E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1800 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1820 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1840 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1860 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1880 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 18A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 18C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 18E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1900 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1920 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1940 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1960 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1980 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 19A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 19C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 19E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1A00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1A20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1A40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1A60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1A80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1AA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1AC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1AE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1B00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1B20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1B40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1B60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1B80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1BA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1BC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1BE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1C00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1C20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1C40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1C60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1C80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1CA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1CC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1CE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1D00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1D20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1D40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1D60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1D80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1DA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1DC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1DE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 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 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1E20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1E40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1E60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1E80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1EA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1EC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1EE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1F00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1F20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1F40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1F60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1F80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1FA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1FC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1FE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2000 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2020 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2040 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2060 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2080 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 20A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 20C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 20E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2100 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2120 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2140 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2160 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2180 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 21A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 21C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 21E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2200 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2220 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2240 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2260 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2280 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 22A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 22C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 22E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2300 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2320 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2340 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2360 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2380 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 23A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 23C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 23E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2400 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2420 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2440 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2460 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2480 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 24A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 24C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 24E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2500 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2520 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2540 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2560 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2580 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 25A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 25C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 25E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2600 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2620 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2640 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2660 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2680 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 26A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 26C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 26E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2700 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2720 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2740 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2760 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2780 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 27A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 27C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 27E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2800 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2820 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2840 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2860 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2880 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 28A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 28C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 28E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2900 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2920 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2940 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2960 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2980 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 29A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 29C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 29E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2A00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2A20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2A40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2A60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2A80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2AA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2AC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2AE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2B00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2B20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2B40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2B60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2B80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2BA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2BC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2BE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2C00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2C20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2C40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2C60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2C80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2CA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2CC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2CE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2D00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2D20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2D40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2D60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2D80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2DA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2DC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2DE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2E00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2E20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2E40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2E60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2E80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2EA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2EC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2EE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2F00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2F20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2F40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2F60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2F80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2FA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2FC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2FE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3000 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3020 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3040 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3060 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3080 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 30A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 30C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 30E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3100 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3120 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3140 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3160 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3180 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 31A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 31C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 31E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3200 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3220 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3240 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3260 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3280 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 32A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 32C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 32E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3300 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3320 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3340 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3360 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3380 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 33A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 33C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 33E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3400 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3420 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3440 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3460 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3480 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 34A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 34C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 34E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3500 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3520 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3540 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3560 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3580 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 35A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 35C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 35E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3600 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3620 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3640 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3660 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3680 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 36A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 36C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 36E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3700 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3720 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3740 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3760 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3780 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 37A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 37C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 37E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3800 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3820 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3840 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3860 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3880 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 38A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 38C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 38E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3900 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3920 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3940 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3960 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3980 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 39A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 39C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 39E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3A00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3A20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3A40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3A60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3A80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3AA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3AC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3AE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3B00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3B20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3B40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3B60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3B80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3BA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3BC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3BE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3C00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3C20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3C40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3C60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3C80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3CA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3CC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3CE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3D00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3D20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3D40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3D60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3D80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3DA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3DC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3DE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3E00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3E20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3E40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3E60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3E80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3EA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3EC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3EE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3F00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3F20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3F40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3F60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3F80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3FA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3FC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3FE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4000 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4020 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4040 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4060 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4080 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 40A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 40C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 40E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4100 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4120 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4140 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4160 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4180 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 41A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 41C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 41E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4200 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4220 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4240 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4260 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4280 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 42A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 42C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 42E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4300 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4320 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4340 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4360 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4380 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 43A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 43C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 43E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4400 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4420 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4440 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4460 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4480 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 44A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 44C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 44E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4500 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4520 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4540 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4560 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4580 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 45A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 45C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 45E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4600 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4620 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4640 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4660 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4680 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 46A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 46C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 46E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4700 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4720 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4740 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4760 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4780 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 47A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 47C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 47E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4800 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4820 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4840 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4860 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4880 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 48A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 48C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 48E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4900 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4920 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4940 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4960 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4980 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 49A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 49C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 49E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4A00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4A20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4A40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4A60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4A80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4AA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4AC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4AE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4B00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4B20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4B40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4B60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4B80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4BA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4BC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4BE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4C00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4C20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4C40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4C60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4C80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4CA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4CC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4CE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4D00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4D20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4D40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4D60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4D80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4DA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4DC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4DE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4E00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4E20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4E40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4E60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4E80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4EA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4EC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4EE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4F00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4F20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4F40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4F60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4F80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4FA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4FC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4FE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5000 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5020 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5040 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5060 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5080 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 50A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 50C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 50E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5100 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5120 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5140 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5160 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5180 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 51A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 51C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 51E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5200 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5220 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5240 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5260 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5280 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 52A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 52C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 52E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5300 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5320 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5340 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5360 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5380 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 53A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 53C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 53E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5400 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5420 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5440 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5460 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5480 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 54A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 54C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 54E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5500 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5520 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5540 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5560 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5580 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 55A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 55C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 55E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5600 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5620 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5640 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5660 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5680 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 56A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 56C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 56E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5700 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5720 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5740 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5760 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5780 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 57A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 57C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 57E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5800 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5820 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5840 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5860 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5880 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 58A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 58C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 58E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5900 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5920 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5940 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5960 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5980 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 59A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 59C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 59E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5A00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5A20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5A40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5A60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5A80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5AA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5AC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5AE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5B00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5B20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5B40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5B60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5B80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5BA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5BC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5BE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5C00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5C20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5C40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5C60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5C80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5CA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5CC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5CE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5D00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5D20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5D40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5D60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5D80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5DA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5DC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5DE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5E00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5E20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5E40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5E60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5E80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5EA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5EC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5EE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5F00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5F20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5F40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5F60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5F80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5FA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5FC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5FE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6000 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6020 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6040 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6060 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6080 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 60A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 60C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 60E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6100 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6120 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6140 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6160 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6180 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 61A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 61C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 61E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6200 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6220 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6240 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6260 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6280 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 62A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 62C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 62E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6300 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6320 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6340 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6360 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6380 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 63A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 63C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 63E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6400 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6420 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6440 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6460 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6480 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 64A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 64C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 64E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6500 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6520 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6540 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6560 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6580 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 65A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 65C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 65E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6600 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6620 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6640 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6660 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6680 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 66A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 66C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 66E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6700 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6720 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6740 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6760 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6780 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 67A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 67C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 67E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6800 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6820 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6840 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6860 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6880 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 68A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 68C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 68E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6900 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6920 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6940 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6960 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6980 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 69A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 69C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 69E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6A00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6A20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6A40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6A60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6A80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6AA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6AC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6AE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6B00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6B20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6B40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6B60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6B80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6BA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6BC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6BE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6C00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6C20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6C40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6C60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6C80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6CA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6CC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6CE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6D00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6D20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6D40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6D60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6D80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6DA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6DC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6DE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6E00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6E20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6E40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6E60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6E80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6EA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6EC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6EE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6F00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6F20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6F40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6F60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6F80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6FA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6FC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6FE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7000 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7020 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7040 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7060 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7080 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 70A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 70C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 70E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7100 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7120 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7140 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7160 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7180 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 71A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 71C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 71E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7200 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7220 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7240 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7260 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7280 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 72A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 72C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 72E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7300 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7320 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7340 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7360 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7380 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 73A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 73C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 73E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7400 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7420 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7440 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7460 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7480 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 74A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 74C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 74E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7500 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7520 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7540 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7560 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7580 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 75A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 75C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 75E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7600 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7620 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7640 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7660 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7680 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 76A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 76C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 76E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7700 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7720 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7740 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7760 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7780 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 77A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 77C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 77E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7800 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7820 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7840 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7860 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7880 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 78A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 78C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 78E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7900 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7920 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7940 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7960 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7980 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 79A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 79C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 79E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7A00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7A20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7A40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7A60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7A80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7AA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7AC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7AE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7B00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7B20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7B40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7B60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7B80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7BA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7BC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7BE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7C00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7C20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7C40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7C60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7C80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7CA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7CC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7CE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7D00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7D20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7D40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7D60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7D80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7DA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7DC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7DE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7E00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7E20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7E40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7E60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7E80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7EA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7EC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7EE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7F00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7F20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7F40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7F60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7F80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7FA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7FC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7FE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 8000 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 8020 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 8040 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 8060 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 8080 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 80A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 80C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 80E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 8100 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 8120 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x3000, 0x3001, 0x3002, 0xFF0C, /* 8140 */ + 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, /* 8160 */ + 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, 0x0000, + 0x00F7, 0xFF1D, 0x2260, 0xFF1C, /* 8180 */ + 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, /* 81A0 */ + 0x25BD, 0x25BC, 0x203B, 0x3012, + 0x2192, 0x2190, 0x2191, 0x2193, + 0x3013, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x2208, 0x220B, 0x2286, 0x2287, + 0x2282, 0x2283, 0x222A, 0x2229, + 0x0000, 0x0000, 0x0000, 0x0000, /* 81C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x2227, 0x2228, 0xFFE2, 0x21D2, + 0x21D4, 0x2200, 0x2203, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x2220, 0x22A5, + 0x2312, 0x2202, 0x2207, 0x2261, + 0x2252, 0x226A, 0x226B, 0x221A, /* 81E0 */ + 0x223D, 0x221D, 0x2235, 0x222B, + 0x222C, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x212B, 0x2030, 0x266F, 0x266D, + 0x266A, 0x2020, 0x2021, 0x00B6, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x25EF, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 8200 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 8220 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 8240 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0xFF10, + 0xFF11, 0xFF12, 0xFF13, 0xFF14, + 0xFF15, 0xFF16, 0xFF17, 0xFF18, + 0xFF19, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0xFF21, 0xFF22, 0xFF23, 0xFF24, /* 8260 */ + 0xFF25, 0xFF26, 0xFF27, 0xFF28, + 0xFF29, 0xFF2A, 0xFF2B, 0xFF2C, + 0xFF2D, 0xFF2E, 0xFF2F, 0xFF30, + 0xFF31, 0xFF32, 0xFF33, 0xFF34, + 0xFF35, 0xFF36, 0xFF37, 0xFF38, + 0xFF39, 0xFF3A, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0xFF41, 0xFF42, 0xFF43, /* 8280 */ + 0xFF44, 0xFF45, 0xFF46, 0xFF47, + 0xFF48, 0xFF49, 0xFF4A, 0xFF4B, + 0xFF4C, 0xFF4D, 0xFF4E, 0xFF4F, + 0xFF50, 0xFF51, 0xFF52, 0xFF53, + 0xFF54, 0xFF55, 0xFF56, 0xFF57, + 0xFF58, 0xFF59, 0xFF5A, 0x0000, + 0x0000, 0x0000, 0x0000, 0x3041, + 0x3042, 0x3043, 0x3044, 0x3045, /* 82A0 */ + 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, /* 82C0 */ + 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, /* 82E0 */ + 0x3086, 0x3087, 0x3088, 0x3089, + 0x308A, 0x308B, 0x308C, 0x308D, + 0x308E, 0x308F, 0x3090, 0x3091, + 0x3092, 0x3093, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 8300 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 8320 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x30A1, 0x30A2, 0x30A3, 0x30A4, /* 8340 */ + 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, /* 8360 */ + 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, 0x0000, + 0x30E0, 0x30E1, 0x30E2, 0x30E3, /* 8380 */ + 0x30E4, 0x30E5, 0x30E6, 0x30E7, + 0x30E8, 0x30E9, 0x30EA, 0x30EB, + 0x30EC, 0x30ED, 0x30EE, 0x30EF, + 0x30F0, 0x30F1, 0x30F2, 0x30F3, + 0x30F4, 0x30F5, 0x30F6, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0391, + 0x0392, 0x0393, 0x0394, 0x0395, /* 83A0 */ + 0x0396, 0x0397, 0x0398, 0x0399, + 0x039A, 0x039B, 0x039C, 0x039D, + 0x039E, 0x039F, 0x03A0, 0x03A1, + 0x03A3, 0x03A4, 0x03A5, 0x03A6, + 0x03A7, 0x03A8, 0x03A9, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x03B1, + 0x03B2, 0x03B3, 0x03B4, 0x03B5, /* 83C0 */ + 0x03B6, 0x03B7, 0x03B8, 0x03B9, + 0x03BA, 0x03BB, 0x03BC, 0x03BD, + 0x03BE, 0x03BF, 0x03C0, 0x03C1, + 0x03C3, 0x03C4, 0x03C5, 0x03C6, + 0x03C7, 0x03C8, 0x03C9, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 83E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 8400 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 8420 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 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, 0x0411, 0x0412, 0x0413, /* 8440 */ + 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, 0x0000, 0x0000, 0x0000, /* 8460 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0430, 0x0431, 0x0432, 0x0433, + 0x0434, 0x0435, 0x0451, 0x0436, + 0x0437, 0x0438, 0x0439, 0x043A, + 0x043B, 0x043C, 0x043D, 0x0000, + 0x043E, 0x043F, 0x0440, 0x0441, /* 8480 */ + 0x0442, 0x0443, 0x0444, 0x0445, + 0x0446, 0x0447, 0x0448, 0x0449, + 0x044A, 0x044B, 0x044C, 0x044D, + 0x044E, 0x044F, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x2500, + 0x2502, 0x250C, 0x2510, 0x2518, /* 84A0 */ + 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, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 84C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 84E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 8500 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 8520 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 8540 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 8560 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 8580 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 85A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 85C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 85E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 8600 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 8620 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 8640 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 8660 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 8680 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 86A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 86C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 86E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 8700 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 8720 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x2460, 0x2461, 0x2462, 0x2463, /* 8740 */ + 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, 0x0000, 0x3349, + 0x3314, 0x3322, 0x334D, 0x3318, /* 8760 */ + 0x3327, 0x3303, 0x3336, 0x3351, + 0x3357, 0x330D, 0x3326, 0x3323, + 0x332B, 0x334A, 0x333B, 0x339C, + 0x339D, 0x339E, 0x338E, 0x338F, + 0x33C4, 0x33A1, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x337B, 0x0000, + 0x301D, 0x301F, 0x2116, 0x33CD, /* 8780 */ + 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, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 87A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 87C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 87E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 8800 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 8820 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 8840 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 8860 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 8880 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x4E9C, + 0x5516, 0x5A03, 0x963F, 0x54C0, /* 88A0 */ + 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, /* 88C0 */ + 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, /* 88E0 */ + 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, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 8900 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 8920 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x9662, 0x9670, 0x96A0, 0x97FB, /* 8940 */ + 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, /* 8960 */ + 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, 0x0000, + 0x5712, 0x5830, 0x5944, 0x5BB4, /* 8980 */ + 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, /* 89A0 */ + 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, /* 89C0 */ + 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, /* 89E0 */ + 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, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 8A00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 8A20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x9B41, 0x6666, 0x68B0, 0x6D77, /* 8A40 */ + 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, /* 8A60 */ + 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, 0x0000, + 0x6A7F, 0x68B6, 0x9C0D, 0x6F5F, /* 8A80 */ + 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, /* 8AA0 */ + 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, /* 8AC0 */ + 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, /* 8AE0 */ + 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, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 8B00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 8B20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x6A5F, 0x5E30, 0x6BC5, 0x6C17, /* 8B40 */ + 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, /* 8B60 */ + 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, 0x0000, + 0x673D, 0x6C42, 0x6C72, 0x6CE3, /* 8B80 */ + 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, /* 8BA0 */ + 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, /* 8BC0 */ + 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, /* 8BE0 */ + 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, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 8C00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 8C20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x6398, 0x7A9F, 0x6C93, 0x9774, /* 8C40 */ + 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, /* 8C60 */ + 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, 0x0000, + 0x5287, 0x621F, 0x6483, 0x6FC0, /* 8C80 */ + 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, /* 8CA0 */ + 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, /* 8CC0 */ + 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, /* 8CE0 */ + 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, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 8D00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 8D20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x540E, 0x5589, 0x5751, 0x57A2, /* 8D40 */ + 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, /* 8D60 */ + 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, 0x0000, + 0x9805, 0x9999, 0x9AD8, 0x9D3B, /* 8D80 */ + 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, /* 8DA0 */ + 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, /* 8DC0 */ + 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, /* 8DE0 */ + 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, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 8E00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 8E20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x5BDF, 0x62F6, 0x64AE, 0x64E6, /* 8E40 */ + 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, /* 8E60 */ + 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, 0x0000, + 0x6B7B, 0x6C0F, 0x7345, 0x7949, /* 8E80 */ + 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, /* 8EA0 */ + 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, /* 8EC0 */ + 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, /* 8EE0 */ + 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, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 8F00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 8F20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x5B97, 0x5C31, 0x5DDE, 0x4FEE, /* 8F40 */ + 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, /* 8F60 */ + 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, 0x0000, + 0x6E96, 0x6F64, 0x76FE, 0x7D14, /* 8F80 */ + 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, /* 8FA0 */ + 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, /* 8FC0 */ + 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, /* 8FE0 */ + 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, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9000 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9020 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x62ED, 0x690D, 0x6B96, 0x71ED, /* 9040 */ + 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, /* 9060 */ + 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, 0x0000, + 0x9017, 0x5439, 0x5782, 0x5E25, /* 9080 */ + 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, /* 90A0 */ + 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, /* 90C0 */ + 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, /* 90E0 */ + 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, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9100 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9120 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x7E4A, 0x7FA8, 0x817A, 0x821B, /* 9140 */ + 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, /* 9160 */ + 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, 0x0000, + 0x64CD, 0x65E9, 0x66F9, 0x5DE3, /* 9180 */ + 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, /* 91A0 */ + 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, /* 91C0 */ + 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, /* 91E0 */ + 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, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9200 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9220 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x53E9, 0x4F46, 0x9054, 0x8FB0, /* 9240 */ + 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, /* 9260 */ + 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, 0x0000, + 0x9010, 0x79E9, 0x7A92, 0x8336, /* 9280 */ + 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, /* 92A0 */ + 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, /* 92C0 */ + 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, /* 92E0 */ + 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, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9300 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9320 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x90B8, 0x912D, 0x91D8, 0x9F0E, /* 9340 */ + 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, /* 9360 */ + 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, 0x0000, + 0x51CD, 0x5200, 0x5510, 0x5854, /* 9380 */ + 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, /* 93A0 */ + 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, /* 93C0 */ + 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, /* 93E0 */ + 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, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9400 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9420 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x5982, 0x5C3F, 0x97EE, 0x4EFB, /* 9440 */ + 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, /* 9460 */ + 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, 0x0000, + 0x6973, 0x7164, 0x72FD, 0x8CB7, /* 9480 */ + 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, /* 94A0 */ + 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, /* 94C0 */ + 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, /* 94E0 */ + 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, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9500 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9520 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x9F3B, 0x67CA, 0x7A17, 0x5339, /* 9540 */ + 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, /* 9560 */ + 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, 0x0000, + 0x65A7, 0x666E, 0x6D6E, 0x7236, /* 9580 */ + 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, /* 95A0 */ + 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, /* 95C0 */ + 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, /* 95E0 */ + 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, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9600 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9620 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x6CD5, 0x6CE1, 0x70F9, 0x7832, /* 9640 */ + 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, /* 9660 */ + 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, 0x0000, + 0x6469, 0x78E8, 0x9B54, 0x9EBB, /* 9680 */ + 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, /* 96A0 */ + 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, /* 96C0 */ + 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, /* 96E0 */ + 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, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9700 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9720 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x8AED, 0x8F38, 0x552F, 0x4F51, /* 9740 */ + 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, /* 9760 */ + 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, 0x0000, + 0x6C83, 0x6D74, 0x7FCC, 0x7FFC, /* 9780 */ + 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, /* 97A0 */ + 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, /* 97C0 */ + 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, /* 97E0 */ + 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, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9800 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9820 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x84EE, 0x9023, 0x932C, 0x5442, /* 9840 */ + 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, /* 9860 */ + 0x8CC4, 0x8107, 0x60D1, 0x67A0, + 0x9DF2, 0x4E99, 0x4E98, 0x9C10, + 0x8A6B, 0x85C1, 0x8568, 0x6900, + 0x6E7E, 0x7897, 0x8155, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9880 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x5F0C, + 0x4E10, 0x4E15, 0x4E2A, 0x4E31, /* 98A0 */ + 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, /* 98C0 */ + 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, /* 98E0 */ + 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, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9900 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9920 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x50C9, 0x50CA, 0x50B3, 0x50C2, /* 9940 */ + 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, /* 9960 */ + 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, 0x0000, + 0x51F0, 0x51F5, 0x51FE, 0x5204, /* 9980 */ + 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, /* 99A0 */ + 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, /* 99C0 */ + 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, /* 99E0 */ + 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, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9A00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9A20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x54AB, 0x54C2, 0x54A4, 0x54BE, /* 9A40 */ + 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, /* 9A60 */ + 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, 0x0000, + 0x566B, 0x5664, 0x562F, 0x566C, /* 9A80 */ + 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, /* 9AA0 */ + 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, /* 9AC0 */ + 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, /* 9AE0 */ + 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, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9B00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9B20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x5978, 0x5981, 0x599D, 0x4F5E, /* 9B40 */ + 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, /* 9B60 */ + 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, 0x0000, + 0x5B83, 0x5BA6, 0x5BB8, 0x5BC3, /* 9B80 */ + 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, /* 9BA0 */ + 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, /* 9BC0 */ + 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, /* 9BE0 */ + 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, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9C00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9C20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x5ED6, 0x5EE3, 0x5EDD, 0x5EDA, /* 9C40 */ + 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, /* 9C60 */ + 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, 0x0000, + 0x6019, 0x6010, 0x6029, 0x600E, /* 9C80 */ + 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, /* 9CA0 */ + 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, /* 9CC0 */ + 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, /* 9CE0 */ + 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, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9D00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9D20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x621E, 0x6221, 0x622A, 0x622E, /* 9D40 */ + 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, /* 9D60 */ + 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, 0x0000, + 0x6369, 0x63BE, 0x63E9, 0x63C0, /* 9D80 */ + 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, /* 9DA0 */ + 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, /* 9DC0 */ + 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, /* 9DE0 */ + 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, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9E00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9E20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x66C4, 0x66B8, 0x66D6, 0x66DA, /* 9E40 */ + 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, /* 9E60 */ + 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, 0x0000, + 0x68B3, 0x682B, 0x6859, 0x6863, /* 9E80 */ + 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, /* 9EA0 */ + 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, /* 9EC0 */ + 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, /* 9EE0 */ + 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, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9F00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9F20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x6A97, 0x8617, 0x6ABB, 0x6AC3, /* 9F40 */ + 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, /* 9F60 */ + 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, 0x0000, + 0x9EBE, 0x6C08, 0x6C13, 0x6C14, /* 9F80 */ + 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, /* 9FA0 */ + 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, /* 9FC0 */ + 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, /* 9FE0 */ + 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, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A000 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A020 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A040 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A060 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A080 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A0A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A0C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A0E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A100 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A120 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A140 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A160 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A180 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A1A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A1C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A1E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A200 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A220 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A240 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A260 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A280 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A2A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A2C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A2E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A300 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A320 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A340 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A360 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A380 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A3A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A3C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A3E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A400 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A420 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A440 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A460 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A480 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A4A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A4C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A4E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A500 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A520 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A540 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A560 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A580 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A5A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A5C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A5E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A600 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A620 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A640 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A660 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A680 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A6A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A6C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A6E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A700 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A720 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A740 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A760 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A780 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A7A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A7C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A7E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A800 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A820 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A840 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A860 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A880 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A8A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A8C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A8E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A900 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A920 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A940 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A960 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A980 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A9A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A9C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A9E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AA00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AA20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AA40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AA60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AA80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AAA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AAC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AAE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AB00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AB20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AB40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AB60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AB80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* ABA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* ABC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* ABE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AC00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AC20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AC40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AC60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AC80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* ACA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* ACC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* ACE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AD00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AD20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AD40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AD60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AD80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* ADA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* ADC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* ADE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AE00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AE20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AE40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AE60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AE80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AEA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AEC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AEE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AF00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AF20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AF40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AF60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AF80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AFA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AFC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AFE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B000 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B020 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B040 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B060 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B080 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B0A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B0C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B0E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B100 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B120 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B140 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B160 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B180 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B1A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B1C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B1E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B200 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B220 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B240 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B260 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B280 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B2A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B2C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B2E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B300 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B320 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B340 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B360 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B380 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B3A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B3C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B3E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B400 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B420 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B440 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B460 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B480 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B4A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B4C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B4E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B500 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B520 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B540 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B560 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B580 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B5A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B5C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B5E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B600 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B620 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B640 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B660 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B680 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B6A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B6C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B6E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B700 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B720 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B740 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B760 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B780 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B7A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B7C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B7E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B800 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B820 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B840 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B860 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B880 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B8A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B8C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B8E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B900 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B920 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B940 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B960 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B980 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B9A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B9C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B9E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BA00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BA20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BA40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BA60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BA80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BAA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BAC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BAE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BB00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BB20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BB40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BB60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BB80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BBA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BBC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BBE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BC00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BC20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BC40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BC60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BC80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BCA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BCC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BCE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BD00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BD20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BD40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BD60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BD80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BDA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BDC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BDE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BE00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BE20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BE40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BE60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BE80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BEA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BEC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BEE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BF00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BF20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BF40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BF60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BF80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BFA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BFC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BFE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C000 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C020 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C040 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C060 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C080 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C0A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C0C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C0E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C100 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C120 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C140 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C160 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C180 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C1A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C1C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C1E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C200 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C220 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C240 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C260 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C280 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C2A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C2C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C2E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C300 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C320 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C340 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C360 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C380 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C3A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C3C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C3E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C400 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C420 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C440 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C460 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C480 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C4A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C4C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C4E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C500 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C520 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C540 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C560 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C580 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C5A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C5C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C5E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C600 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C620 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C640 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C660 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C680 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C6A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C6C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C6E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C700 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C720 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C740 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C760 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C780 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C7A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C7C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C7E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C800 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C820 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C840 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C860 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C880 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C8A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C8C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C8E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C900 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C920 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C940 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C960 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C980 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C9A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C9C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C9E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CA00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CA20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CA40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CA60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CA80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CAA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CAC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CAE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CB00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CB20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CB40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CB60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CB80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CBA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CBC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CBE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CC00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CC20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CC40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CC60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CC80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CCA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CCC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CCE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CD00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CD20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CD40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CD60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CD80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CDA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CDC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CDE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CE00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CE20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CE40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CE60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CE80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CEA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CEC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CEE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CF00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CF20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CF40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CF60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CF80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CFA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CFC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CFE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D000 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D020 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D040 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D060 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D080 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D0A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D0C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D0E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D100 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D120 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D140 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D160 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D180 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D1A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D1C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D1E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D200 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D220 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D240 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D260 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D280 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D2A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D2C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D2E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D300 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D320 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D340 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D360 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D380 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D3A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D3C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D3E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D400 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D420 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D440 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D460 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D480 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D4A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D4C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D4E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D500 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D520 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D540 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D560 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D580 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D5A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D5C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D5E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D600 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D620 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D640 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D660 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D680 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D6A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D6C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D6E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D700 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D720 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D740 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D760 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D780 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D7A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D7C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D7E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D800 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D820 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D840 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D860 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D880 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D8A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D8C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D8E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D900 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D920 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D940 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D960 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D980 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D9A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D9C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D9E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DA00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DA20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DA40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DA60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DA80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DAA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DAC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DAE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DB00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DB20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DB40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DB60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DB80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DBA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DBC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DBE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DC00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DC20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DC40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DC60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DC80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DCA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DCC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DCE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DD00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DD20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DD40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DD60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DD80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DDA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DDC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DDE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DE00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DE20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DE40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DE60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DE80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DEA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DEC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DEE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DF00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DF20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DF40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DF60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DF80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DFA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DFC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DFE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* E000 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* E020 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x6F3E, 0x6F13, 0x6EF7, 0x6F86, /* E040 */ + 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, /* E060 */ + 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, 0x0000, + 0x70D9, 0x7109, 0x70FD, 0x711C, /* E080 */ + 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, /* E0A0 */ + 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, /* E0C0 */ + 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, /* E0E0 */ + 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, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* E100 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* E120 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x74E0, 0x74E3, 0x74E7, 0x74E9, /* E140 */ + 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, /* E160 */ + 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, 0x0000, + 0x75FC, 0x7601, 0x75F0, 0x75FA, /* E180 */ + 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, /* E1A0 */ + 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, /* E1C0 */ + 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, /* E1E0 */ + 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, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* E200 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* E220 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x78E7, 0x78DA, 0x78FD, 0x78F4, /* E240 */ + 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, /* E260 */ + 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, 0x0000, + 0x7AB6, 0x7AC5, 0x7AC4, 0x7ABF, /* E280 */ + 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, /* E2A0 */ + 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, /* E2C0 */ + 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, /* E2E0 */ + 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, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* E300 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* E320 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x7D02, 0x7D1C, 0x7D15, 0x7D0A, /* E340 */ + 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, /* E360 */ + 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, 0x0000, + 0x7E32, 0x7E3A, 0x7E67, 0x7E5D, /* E380 */ + 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, /* E3A0 */ + 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, /* E3C0 */ + 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, /* E3E0 */ + 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, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* E400 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* E420 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x968B, 0x8146, 0x813E, 0x8153, /* E440 */ + 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, /* E460 */ + 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, 0x0000, + 0x8262, 0x8268, 0x826A, 0x826B, /* E480 */ + 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, /* E4A0 */ + 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, /* E4C0 */ + 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, /* E4E0 */ + 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, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* E500 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* E520 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x8541, 0x8602, 0x854B, 0x8555, /* E540 */ + 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, /* E560 */ + 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, 0x0000, + 0x86DF, 0x86DB, 0x86EF, 0x8712, /* E580 */ + 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, /* E5A0 */ + 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, /* E5C0 */ + 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, /* E5E0 */ + 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, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* E600 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* E620 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x8966, 0x8964, 0x896D, 0x896A, /* E640 */ + 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, /* E660 */ + 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, 0x0000, + 0x8AE4, 0x8AF1, 0x8B14, 0x8AE0, /* E680 */ + 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, /* E6A0 */ + 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, /* E6C0 */ + 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, /* E6E0 */ + 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, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* E700 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* E720 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x8E47, 0x8E49, 0x8E4C, 0x8E50, /* E740 */ + 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, /* E760 */ + 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, 0x0000, + 0x8F62, 0x8F63, 0x8F64, 0x8F9C, /* E780 */ + 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, /* E7A0 */ + 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, /* E7C0 */ + 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, /* E7E0 */ + 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, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* E800 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* E820 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x9319, 0x9322, 0x931A, 0x9323, /* E840 */ + 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, /* E860 */ + 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, 0x0000, + 0x95A0, 0x95A8, 0x95A7, 0x95AD, /* E880 */ + 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, /* E8A0 */ + 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, /* E8C0 */ + 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, /* E8E0 */ + 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, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* E900 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* E920 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x9871, 0x9874, 0x9873, 0x98AA, /* E940 */ + 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, /* E960 */ + 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, 0x0000, + 0x9A3E, 0x9A55, 0x9A4D, 0x9A5B, /* E980 */ + 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, /* E9A0 */ + 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, /* E9C0 */ + 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, /* E9E0 */ + 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, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* EA00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* EA20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x9D5D, 0x9D5E, 0x9D64, 0x9D51, /* EA40 */ + 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, /* EA60 */ + 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, 0x0000, + 0x9EF4, 0x9EF6, 0x9EF7, 0x9EF9, /* EA80 */ + 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, /* EAA0 */ + 0x7199, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* EAC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* EAE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* EB00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* EB20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* EB40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* EB60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* EB80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* EBA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* EBC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* EBE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* EC00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* EC20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* EC40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* EC60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* EC80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* ECA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* ECC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* ECE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* ED00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* ED20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x7E8A, 0x891C, 0x9348, 0x9288, /* ED40 */ + 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, /* ED60 */ + 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, 0x0000, + 0xFA10, 0x589E, 0x58B2, 0x590B, /* ED80 */ + 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, /* EDA0 */ + 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, /* EDC0 */ + 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, /* EDE0 */ + 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, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* EE00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* EE20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x72BE, 0x7324, 0xFA16, 0x7377, /* EE40 */ + 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, /* EE60 */ + 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, 0x0000, + 0x856B, 0xFA1F, 0x85B0, 0xFA20, /* EE80 */ + 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, /* EEA0 */ + 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, /* EEC0 */ + 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, /* EEE0 */ + 0x9B8F, 0x9BB1, 0x9BBB, 0x9C00, + 0x9D70, 0x9D6B, 0xFA2D, 0x9E19, + 0x9ED1, 0x0000, 0x0000, 0x2170, + 0x2171, 0x2172, 0x2173, 0x2174, + 0x2175, 0x2176, 0x2177, 0x2178, + 0x2179, 0xFFE2, 0xFFE4, 0xFF07, + 0xFF02, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* EF00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* EF20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* EF40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* EF60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* EF80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* EFA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* EFC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* EFE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F000 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F020 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0xE000, 0xE001, 0xE002, 0xE003, /* F040 */ + 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, /* F060 */ + 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, 0x0000, + 0xE03F, 0xE040, 0xE041, 0xE042, /* F080 */ + 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, /* F0A0 */ + 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, /* F0C0 */ + 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, /* F0E0 */ + 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, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F100 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F120 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0xE0BC, 0xE0BD, 0xE0BE, 0xE0BF, /* F140 */ + 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, /* F160 */ + 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, 0x0000, + 0xE0FB, 0xE0FC, 0xE0FD, 0xE0FE, /* F180 */ + 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, /* F1A0 */ + 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, /* F1C0 */ + 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, /* F1E0 */ + 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, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F200 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F220 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0xE178, 0xE179, 0xE17A, 0xE17B, /* F240 */ + 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, /* F260 */ + 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, 0x0000, + 0xE1B7, 0xE1B8, 0xE1B9, 0xE1BA, /* F280 */ + 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, /* F2A0 */ + 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, /* F2C0 */ + 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, /* F2E0 */ + 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, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F300 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F320 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0xE234, 0xE235, 0xE236, 0xE237, /* F340 */ + 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, /* F360 */ + 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, 0x0000, + 0xE273, 0xE274, 0xE275, 0xE276, /* F380 */ + 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, /* F3A0 */ + 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, /* F3C0 */ + 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, /* F3E0 */ + 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, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F400 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F420 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0xE2F0, 0xE2F1, 0xE2F2, 0xE2F3, /* F440 */ + 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, /* F460 */ + 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, 0x0000, + 0xE32F, 0xE330, 0xE331, 0xE332, /* F480 */ + 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, /* F4A0 */ + 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, /* F4C0 */ + 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, /* F4E0 */ + 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, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F500 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F520 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0xE3AC, 0xE3AD, 0xE3AE, 0xE3AF, /* F540 */ + 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, /* F560 */ + 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, 0x0000, + 0xE3EB, 0xE3EC, 0xE3ED, 0xE3EE, /* F580 */ + 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, /* F5A0 */ + 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, /* F5C0 */ + 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, /* F5E0 */ + 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, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F600 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F620 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0xE468, 0xE469, 0xE46A, 0xE46B, /* F640 */ + 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, /* F660 */ + 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, 0x0000, + 0xE4A7, 0xE4A8, 0xE4A9, 0xE4AA, /* F680 */ + 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, /* F6A0 */ + 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, /* F6C0 */ + 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, /* F6E0 */ + 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, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F700 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F720 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0xE524, 0xE525, 0xE526, 0xE527, /* F740 */ + 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, /* F760 */ + 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, 0x0000, + 0xE563, 0xE564, 0xE565, 0xE566, /* F780 */ + 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, /* F7A0 */ + 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, /* F7C0 */ + 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, /* F7E0 */ + 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, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F800 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F820 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0xE5E0, 0xE5E1, 0xE5E2, 0xE5E3, /* F840 */ + 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, /* F860 */ + 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, 0x0000, + 0xE61F, 0xE620, 0xE621, 0xE622, /* F880 */ + 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, /* F8A0 */ + 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, /* F8C0 */ + 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, /* F8E0 */ + 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, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F900 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F920 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0xE69C, 0xE69D, 0xE69E, 0xE69F, /* F940 */ + 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, /* F960 */ + 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, 0x0000, + 0xE6DB, 0xE6DC, 0xE6DD, 0xE6DE, /* F980 */ + 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, /* F9A0 */ + 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, /* F9C0 */ + 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, /* F9E0 */ + 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, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FA00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FA20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x2170, 0x2171, 0x2172, 0x2173, /* FA40 */ + 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, /* FA60 */ + 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, 0x0000, + 0x5164, 0x519D, 0x51BE, 0x51EC, /* FA80 */ + 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, /* FAA0 */ + 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, /* FAC0 */ + 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, /* FAE0 */ + 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, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FB00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FB20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x6D96, 0x6DAC, 0x6DCF, 0x6DF8, /* FB40 */ + 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, /* FB60 */ + 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, 0x0000, + 0xFA1A, 0x7994, 0xFA1B, 0x799B, /* FB80 */ + 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, /* FBA0 */ + 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, /* FBC0 */ + 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, /* FBE0 */ + 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, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FC00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FC20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x9ADC, 0x9B75, 0x9B72, 0x9B8F, /* FC40 */ + 0x9BB1, 0x9BBB, 0x9C00, 0x9D70, + 0x9D6B, 0xFA2D, 0x9E19, 0x9ED1, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FC60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FC80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FCA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FCC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FCE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FD00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FD20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FD40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FD60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FD80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FDA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FDC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FDE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FE00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FE20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FE40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FE60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FE80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FEA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FEC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FEE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FF00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FF20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FF40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FF60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FF80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FFA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FFC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FFE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, +}; -/* 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}; +static uint16 unicode_to_cp932[65536]= +{ + 0x0000, 0x0001, 0x0002, 0x0003, /* 0000 */ + 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, /* 0020 */ + 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, /* 0040 */ + 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, /* 0060 */ + 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, /* 0080 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 00A0 */ + 0x0000, 0x0000, 0x0000, MB2(0x8198), + MB2(0x814E), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x818B), MB2(0x817D), 0x0000, 0x0000, + MB2(0x814C), 0x0000, MB2(0x81F7), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 00C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x817E), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 00E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x8180), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0100 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0120 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0140 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0160 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0180 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 01A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 01C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 01E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0200 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0220 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0240 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0260 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0280 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 02A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 02C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 02E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0300 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0320 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0340 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0360 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0380 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x839F), MB2(0x83A0), MB2(0x83A1), + MB2(0x83A2), MB2(0x83A3), MB2(0x83A4), MB2(0x83A5), + MB2(0x83A6), MB2(0x83A7), MB2(0x83A8), MB2(0x83A9), + MB2(0x83AA), MB2(0x83AB), MB2(0x83AC), MB2(0x83AD), + MB2(0x83AE), MB2(0x83AF), 0x0000, MB2(0x83B0), /* 03A0 */ + MB2(0x83B1), MB2(0x83B2), MB2(0x83B3), MB2(0x83B4), + MB2(0x83B5), MB2(0x83B6), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x83BF), MB2(0x83C0), MB2(0x83C1), + MB2(0x83C2), MB2(0x83C3), MB2(0x83C4), MB2(0x83C5), + MB2(0x83C6), MB2(0x83C7), MB2(0x83C8), MB2(0x83C9), + MB2(0x83CA), MB2(0x83CB), MB2(0x83CC), MB2(0x83CD), + MB2(0x83CE), MB2(0x83CF), 0x0000, MB2(0x83D0), /* 03C0 */ + MB2(0x83D1), MB2(0x83D2), MB2(0x83D3), MB2(0x83D4), + MB2(0x83D5), MB2(0x83D6), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 03E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x8446), 0x0000, 0x0000, /* 0400 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x8440), MB2(0x8441), MB2(0x8442), MB2(0x8443), + MB2(0x8444), MB2(0x8445), MB2(0x8447), MB2(0x8448), + MB2(0x8449), MB2(0x844A), MB2(0x844B), MB2(0x844C), + MB2(0x844D), MB2(0x844E), MB2(0x844F), MB2(0x8450), + MB2(0x8451), MB2(0x8452), MB2(0x8453), MB2(0x8454), /* 0420 */ + MB2(0x8455), MB2(0x8456), MB2(0x8457), MB2(0x8458), + MB2(0x8459), MB2(0x845A), MB2(0x845B), MB2(0x845C), + MB2(0x845D), MB2(0x845E), MB2(0x845F), MB2(0x8460), + MB2(0x8470), MB2(0x8471), MB2(0x8472), MB2(0x8473), + MB2(0x8474), MB2(0x8475), MB2(0x8477), MB2(0x8478), + MB2(0x8479), MB2(0x847A), MB2(0x847B), MB2(0x847C), + MB2(0x847D), MB2(0x847E), MB2(0x8480), MB2(0x8481), + MB2(0x8482), MB2(0x8483), MB2(0x8484), MB2(0x8485), /* 0440 */ + MB2(0x8486), MB2(0x8487), MB2(0x8488), MB2(0x8489), + MB2(0x848A), MB2(0x848B), MB2(0x848C), MB2(0x848D), + MB2(0x848E), MB2(0x848F), MB2(0x8490), MB2(0x8491), + 0x0000, MB2(0x8476), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0460 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0480 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 04A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 04C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 04E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0500 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0520 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0540 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0560 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0580 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 05A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 05C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 05E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0600 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0620 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0640 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0660 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0680 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 06A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 06C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 06E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0700 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0720 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0740 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0760 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0780 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 07A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 07C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 07E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0800 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0820 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0840 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0860 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0880 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 08A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 08C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 08E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0900 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0920 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0940 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0960 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0980 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 09A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 09C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 09E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0A00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0A20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0A40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0A60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0A80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0AA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0AC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0AE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0B00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0B20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0B40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0B60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0B80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0BA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0BC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0BE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0C00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0C20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0C40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0C60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0C80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0CA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0CC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0CE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0D00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0D20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0D40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0D60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0D80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0DA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0DC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0DE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0E00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0E20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0E40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0E60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0E80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0EA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0EC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0EE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0F00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0F20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0F40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0F60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0F80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0FA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0FC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 0FE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1000 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1020 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1040 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1060 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1080 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 10A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 10C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 10E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1100 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1120 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1140 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1160 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1180 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 11A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 11C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 11E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1200 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1220 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1240 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1260 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1280 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 12A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 12C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 12E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1300 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1320 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1340 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1360 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1380 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 13A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 13C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 13E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1400 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1420 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1440 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1460 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1480 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 14A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 14C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 14E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1500 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1520 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1540 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1560 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1580 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 15A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 15C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 15E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1600 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1620 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1640 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1660 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1680 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 16A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 16C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 16E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1700 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1720 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1740 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1760 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1780 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 17A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 17C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 17E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1800 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1820 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1840 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1860 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1880 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 18A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 18C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 18E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1900 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1920 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1940 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1960 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1980 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 19A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 19C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 19E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1A00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1A20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1A40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1A60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1A80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1AA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1AC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1AE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1B00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1B20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1B40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1B60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1B80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1BA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1BC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1BE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1C00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1C20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1C40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1C60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1C80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1CA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1CC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1CE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1D00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1D20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1D40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1D60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1D80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1DA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1DC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1DE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 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 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1E20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1E40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1E60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1E80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1EA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1EC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1EE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1F00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1F20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1F40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1F60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1F80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1FA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1FC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 1FE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2000 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x815D), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x815C), 0x0000, 0x0000, + MB2(0x8165), MB2(0x8166), 0x0000, 0x0000, + MB2(0x8167), MB2(0x8168), 0x0000, 0x0000, + MB2(0x81F5), MB2(0x81F6), 0x0000, 0x0000, /* 2020 */ + 0x0000, MB2(0x8164), MB2(0x8163), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x81F1), 0x0000, MB2(0x818C), MB2(0x818D), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x81A6), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2040 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2060 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2080 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 20A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 20C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 20E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x818E), /* 2100 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x8782), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x8784), 0x0000, 0x0000, /* 2120 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x81F0), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2140 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x8754), MB2(0x8755), MB2(0x8756), MB2(0x8757), /* 2160 */ + MB2(0x8758), MB2(0x8759), MB2(0x875A), MB2(0x875B), + MB2(0x875C), MB2(0x875D), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xFA40), MB2(0xFA41), MB2(0xFA42), MB2(0xFA43), + MB2(0xFA44), MB2(0xFA45), MB2(0xFA46), MB2(0xFA47), + MB2(0xFA48), MB2(0xFA49), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2180 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x81A9), MB2(0x81AA), MB2(0x81A8), MB2(0x81AB), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 21A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 21C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x81CB), 0x0000, + MB2(0x81CC), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 21E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x81CD), 0x0000, MB2(0x81DD), MB2(0x81CE), /* 2200 */ + 0x0000, 0x0000, 0x0000, MB2(0x81DE), + MB2(0x81B8), 0x0000, 0x0000, MB2(0x81B9), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x8794), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x81E3), 0x0000, + 0x0000, MB2(0x81E5), MB2(0x8187), MB2(0x8798), + MB2(0x81DA), 0x0000, 0x0000, 0x0000, /* 2220 */ + 0x0000, MB2(0x8161), 0x0000, MB2(0x81C8), + MB2(0x81C9), MB2(0x81BF), MB2(0x81BE), MB2(0x81E7), + MB2(0x81E8), 0x0000, MB2(0x8793), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x8188), MB2(0x81E6), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x81E4), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2240 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x81E0), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x8182), MB2(0x81DF), 0x0000, 0x0000, /* 2260 */ + 0x0000, 0x0000, MB2(0x8185), MB2(0x8186), + 0x0000, 0x0000, MB2(0x81E1), MB2(0x81E2), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x81BC), MB2(0x81BD), /* 2280 */ + 0x0000, 0x0000, MB2(0x81BA), MB2(0x81BB), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 22A0 */ + 0x0000, MB2(0x81DB), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x8799), + 0x0000, 0x0000, 0x0000, 0x0000, /* 22C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 22E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2300 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x81DC), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2320 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2340 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2360 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2380 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 23A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 23C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 23E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2400 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2420 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2440 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x8740), MB2(0x8741), MB2(0x8742), MB2(0x8743), /* 2460 */ + MB2(0x8744), MB2(0x8745), MB2(0x8746), MB2(0x8747), + MB2(0x8748), MB2(0x8749), MB2(0x874A), MB2(0x874B), + MB2(0x874C), MB2(0x874D), MB2(0x874E), MB2(0x874F), + MB2(0x8750), MB2(0x8751), MB2(0x8752), MB2(0x8753), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2480 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 24A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 24C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 24E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x849F), MB2(0x84AA), MB2(0x84A0), MB2(0x84AB), /* 2500 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x84A1), 0x0000, 0x0000, MB2(0x84AC), + MB2(0x84A2), 0x0000, 0x0000, MB2(0x84AD), + MB2(0x84A4), 0x0000, 0x0000, MB2(0x84AF), + MB2(0x84A3), 0x0000, 0x0000, MB2(0x84AE), + MB2(0x84A5), MB2(0x84BA), 0x0000, 0x0000, + MB2(0x84B5), 0x0000, 0x0000, MB2(0x84B0), /* 2520 */ + MB2(0x84A7), MB2(0x84BC), 0x0000, 0x0000, + MB2(0x84B7), 0x0000, 0x0000, MB2(0x84B2), + MB2(0x84A6), 0x0000, 0x0000, MB2(0x84B6), + MB2(0x84BB), 0x0000, 0x0000, MB2(0x84B1), + MB2(0x84A8), 0x0000, 0x0000, MB2(0x84B8), + MB2(0x84BD), 0x0000, 0x0000, MB2(0x84B3), + MB2(0x84A9), 0x0000, 0x0000, MB2(0x84B9), + 0x0000, 0x0000, MB2(0x84BE), 0x0000, /* 2540 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x84B4), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2560 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2580 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x81A1), MB2(0x81A0), 0x0000, 0x0000, /* 25A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x81A3), MB2(0x81A2), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x81A5), MB2(0x81A4), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 25C0 */ + 0x0000, 0x0000, MB2(0x819F), MB2(0x819E), + 0x0000, 0x0000, 0x0000, MB2(0x819B), + 0x0000, 0x0000, MB2(0x819D), MB2(0x819C), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 25E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x81FC), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2600 */ + 0x0000, MB2(0x819A), MB2(0x8199), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2620 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x818A), 0x0000, MB2(0x8189), 0x0000, /* 2640 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2660 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x81F4), 0x0000, + 0x0000, MB2(0x81F3), 0x0000, MB2(0x81F2), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2680 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 26A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 26C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 26E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2700 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2720 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2740 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2760 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2780 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 27A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 27C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 27E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2800 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2820 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2840 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2860 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2880 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 28A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 28C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 28E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2900 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2920 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2940 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2960 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2980 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 29A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 29C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 29E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2A00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2A20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2A40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2A60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2A80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2AA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2AC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2AE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2B00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2B20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2B40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2B60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2B80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2BA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2BC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2BE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2C00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2C20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2C40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2C60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2C80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2CA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2CC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2CE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2D00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2D20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2D40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2D60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2D80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2DA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2DC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2DE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2E00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2E20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2E40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2E60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2E80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2EA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2EC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2EE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2F00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2F20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2F40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2F60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2F80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2FA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2FC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 2FE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x8140), MB2(0x8141), MB2(0x8142), MB2(0x8156), /* 3000 */ + 0x0000, MB2(0x8158), MB2(0x8159), MB2(0x815A), + MB2(0x8171), MB2(0x8172), MB2(0x8173), MB2(0x8174), + MB2(0x8175), MB2(0x8176), MB2(0x8177), MB2(0x8178), + MB2(0x8179), MB2(0x817A), MB2(0x81A7), MB2(0x81AC), + MB2(0x816B), MB2(0x816C), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x8780), 0x0000, MB2(0x8781), + 0x0000, 0x0000, 0x0000, 0x0000, /* 3020 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x829F), MB2(0x82A0), MB2(0x82A1), /* 3040 */ + MB2(0x82A2), MB2(0x82A3), MB2(0x82A4), MB2(0x82A5), + MB2(0x82A6), MB2(0x82A7), MB2(0x82A8), MB2(0x82A9), + MB2(0x82AA), MB2(0x82AB), MB2(0x82AC), MB2(0x82AD), + MB2(0x82AE), MB2(0x82AF), MB2(0x82B0), MB2(0x82B1), + MB2(0x82B2), MB2(0x82B3), MB2(0x82B4), MB2(0x82B5), + MB2(0x82B6), MB2(0x82B7), MB2(0x82B8), MB2(0x82B9), + MB2(0x82BA), MB2(0x82BB), MB2(0x82BC), MB2(0x82BD), + MB2(0x82BE), MB2(0x82BF), MB2(0x82C0), MB2(0x82C1), /* 3060 */ + MB2(0x82C2), MB2(0x82C3), MB2(0x82C4), MB2(0x82C5), + MB2(0x82C6), MB2(0x82C7), MB2(0x82C8), MB2(0x82C9), + MB2(0x82CA), MB2(0x82CB), MB2(0x82CC), MB2(0x82CD), + MB2(0x82CE), MB2(0x82CF), MB2(0x82D0), MB2(0x82D1), + MB2(0x82D2), MB2(0x82D3), MB2(0x82D4), MB2(0x82D5), + MB2(0x82D6), MB2(0x82D7), MB2(0x82D8), MB2(0x82D9), + MB2(0x82DA), MB2(0x82DB), MB2(0x82DC), MB2(0x82DD), + MB2(0x82DE), MB2(0x82DF), MB2(0x82E0), MB2(0x82E1), /* 3080 */ + MB2(0x82E2), MB2(0x82E3), MB2(0x82E4), MB2(0x82E5), + MB2(0x82E6), MB2(0x82E7), MB2(0x82E8), MB2(0x82E9), + MB2(0x82EA), MB2(0x82EB), MB2(0x82EC), MB2(0x82ED), + MB2(0x82EE), MB2(0x82EF), MB2(0x82F0), MB2(0x82F1), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x814A), + MB2(0x814B), MB2(0x8154), MB2(0x8155), 0x0000, + 0x0000, MB2(0x8340), MB2(0x8341), MB2(0x8342), /* 30A0 */ + MB2(0x8343), MB2(0x8344), MB2(0x8345), MB2(0x8346), + MB2(0x8347), MB2(0x8348), MB2(0x8349), MB2(0x834A), + MB2(0x834B), MB2(0x834C), MB2(0x834D), MB2(0x834E), + MB2(0x834F), MB2(0x8350), MB2(0x8351), MB2(0x8352), + MB2(0x8353), MB2(0x8354), MB2(0x8355), MB2(0x8356), + MB2(0x8357), MB2(0x8358), MB2(0x8359), MB2(0x835A), + MB2(0x835B), MB2(0x835C), MB2(0x835D), MB2(0x835E), + MB2(0x835F), MB2(0x8360), MB2(0x8361), MB2(0x8362), /* 30C0 */ + MB2(0x8363), MB2(0x8364), MB2(0x8365), MB2(0x8366), + MB2(0x8367), MB2(0x8368), MB2(0x8369), MB2(0x836A), + MB2(0x836B), MB2(0x836C), MB2(0x836D), MB2(0x836E), + MB2(0x836F), MB2(0x8370), MB2(0x8371), MB2(0x8372), + MB2(0x8373), MB2(0x8374), MB2(0x8375), MB2(0x8376), + MB2(0x8377), MB2(0x8378), MB2(0x8379), MB2(0x837A), + MB2(0x837B), MB2(0x837C), MB2(0x837D), MB2(0x837E), + MB2(0x8380), MB2(0x8381), MB2(0x8382), MB2(0x8383), /* 30E0 */ + MB2(0x8384), MB2(0x8385), MB2(0x8386), MB2(0x8387), + MB2(0x8388), MB2(0x8389), MB2(0x838A), MB2(0x838B), + MB2(0x838C), MB2(0x838D), MB2(0x838E), MB2(0x838F), + MB2(0x8390), MB2(0x8391), MB2(0x8392), MB2(0x8393), + MB2(0x8394), MB2(0x8395), MB2(0x8396), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x8145), + MB2(0x815B), MB2(0x8152), MB2(0x8153), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3100 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3120 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3140 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3160 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3180 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 31A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 31C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 31E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3200 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3220 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x878A), MB2(0x878B), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x878C), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3240 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3260 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3280 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 32A0 */ + MB2(0x8785), MB2(0x8786), MB2(0x8787), MB2(0x8788), + MB2(0x8789), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 32C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 32E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x8765), /* 3300 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x8769), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x8760), 0x0000, 0x0000, 0x0000, + MB2(0x8763), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x8761), MB2(0x876B), /* 3320 */ + 0x0000, 0x0000, MB2(0x876A), MB2(0x8764), + 0x0000, 0x0000, 0x0000, MB2(0x876C), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x8766), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x876E), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3340 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x875F), MB2(0x876D), 0x0000, + 0x0000, MB2(0x8762), 0x0000, 0x0000, + 0x0000, MB2(0x8767), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x8768), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3360 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x877E), + MB2(0x878F), MB2(0x878E), MB2(0x878D), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3380 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x8772), MB2(0x8773), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x876F), MB2(0x8770), MB2(0x8771), 0x0000, + 0x0000, MB2(0x8775), 0x0000, 0x0000, /* 33A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 33C0 */ + MB2(0x8774), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x8783), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 33E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3400 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3420 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3440 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3460 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3480 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 34A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 34C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 34E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3500 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3520 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3540 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3560 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3580 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 35A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 35C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 35E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3600 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3620 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3640 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3660 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3680 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 36A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 36C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 36E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3700 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3720 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3740 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3760 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3780 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 37A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 37C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 37E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3800 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3820 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3840 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3860 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3880 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 38A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 38C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 38E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3900 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3920 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3940 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3960 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3980 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 39A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 39C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 39E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3A00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3A20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3A40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3A60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3A80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3AA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3AC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3AE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3B00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3B20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3B40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3B60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3B80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3BA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3BC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3BE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3C00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3C20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3C40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3C60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3C80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3CA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3CC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3CE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3D00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3D20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3D40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3D60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3D80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3DA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3DC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3DE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3E00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3E20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3E40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3E60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3E80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3EA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3EC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3EE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3F00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3F20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3F40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3F60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3F80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3FA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3FC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 3FE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4000 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4020 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4040 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4060 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4080 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 40A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 40C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 40E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4100 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4120 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4140 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4160 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4180 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 41A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 41C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 41E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4200 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4220 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4240 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4260 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4280 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 42A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 42C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 42E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4300 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4320 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4340 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4360 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4380 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 43A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 43C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 43E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4400 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4420 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4440 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4460 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4480 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 44A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 44C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 44E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4500 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4520 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4540 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4560 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4580 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 45A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 45C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 45E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4600 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4620 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4640 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4660 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4680 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 46A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 46C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 46E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4700 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4720 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4740 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4760 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4780 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 47A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 47C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 47E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4800 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4820 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4840 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4860 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4880 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 48A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 48C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 48E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4900 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4920 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4940 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4960 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4980 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 49A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 49C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 49E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4A00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4A20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4A40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4A60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4A80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4AA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4AC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4AE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4B00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4B20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4B40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4B60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4B80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4BA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4BC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4BE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4C00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4C20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4C40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4C60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4C80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4CA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4CC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4CE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4D00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4D20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4D40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4D60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4D80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4DA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4DC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4DE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x88EA), MB2(0x929A), 0x0000, MB2(0x8EB5), /* 4E00 */ + 0x0000, 0x0000, 0x0000, MB2(0x969C), + MB2(0x8FE4), MB2(0x8E4F), MB2(0x8FE3), MB2(0x89BA), + 0x0000, MB2(0x9573), MB2(0x975E), 0x0000, + MB2(0x98A0), MB2(0x894E), 0x0000, 0x0000, + MB2(0x8A8E), MB2(0x98A1), MB2(0x90A2), MB2(0x99C0), + MB2(0x8B75), MB2(0x95B8), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x8FE5), 0x0000, + 0x0000, MB2(0x97BC), 0x0000, 0x0000, /* 4E20 */ + 0x0000, 0x0000, MB2(0x95C0), 0x0000, + MB2(0xFA68), 0x0000, MB2(0x98A2), 0x0000, + 0x0000, MB2(0x9286), 0x0000, 0x0000, + 0x0000, MB2(0x98A3), MB2(0x8BF8), 0x0000, + 0x0000, 0x0000, MB2(0x98A4), 0x0000, + MB2(0x8ADB), MB2(0x924F), 0x0000, MB2(0x8EE5), + MB2(0x98A5), 0x0000, 0x0000, MB2(0x98A6), + 0x0000, 0x0000, MB2(0x98A7), MB2(0x9454), /* 4E40 */ + 0x0000, MB2(0x8B76), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x9456), + 0x0000, MB2(0x93E1), MB2(0x8CC1), MB2(0x9652), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE568), MB2(0x98A8), MB2(0x8FE6), + MB2(0x98A9), MB2(0x89B3), 0x0000, 0x0000, + 0x0000, MB2(0x8BE3), MB2(0x8CEE), MB2(0x96E7), + 0x0000, 0x0000, MB2(0x9BA4), 0x0000, /* 4E60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x9790), 0x0000, MB2(0x93FB), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x8AA3), 0x0000, + MB2(0x8B54), 0x0000, MB2(0x98AA), 0x0000, /* 4E80 */ + 0x0000, MB2(0x98AB), MB2(0x97B9), 0x0000, + MB2(0x975C), MB2(0x9188), MB2(0x98AD), MB2(0x8E96), + MB2(0x93F1), 0x0000, MB2(0x98B0), 0x0000, + 0x0000, MB2(0x895D), MB2(0x8CDD), 0x0000, + MB2(0x8CDC), MB2(0x88E4), 0x0000, 0x0000, + MB2(0x986A), MB2(0x9869), 0x0000, MB2(0x8DB1), + MB2(0x889F), 0x0000, MB2(0x98B1), MB2(0x98B2), + MB2(0x98B3), MB2(0x9653), MB2(0x98B4), 0x0000, /* 4EA0 */ + MB2(0x8CF0), MB2(0x88E5), MB2(0x9692), 0x0000, + MB2(0x8B9C), 0x0000, 0x0000, MB2(0x8B9D), + MB2(0x8B9E), MB2(0x92E0), MB2(0x97BA), 0x0000, + MB2(0x98B5), 0x0000, 0x0000, MB2(0x98B6), + 0x0000, 0x0000, MB2(0x98B7), 0x0000, + 0x0000, 0x0000, MB2(0x906C), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x8F59), MB2(0x906D), MB2(0x98BC), 0x0000, /* 4EC0 */ + MB2(0x98BA), 0x0000, MB2(0x98BB), MB2(0x8B77), + 0x0000, 0x0000, MB2(0x8DA1), MB2(0x89EE), + 0x0000, MB2(0x98B9), MB2(0x98B8), MB2(0x95A7), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x8E65), MB2(0x8E64), MB2(0x91BC), MB2(0x98BD), + MB2(0x9574), MB2(0x90E5), 0x0000, 0x0000, + 0x0000, MB2(0x8157), MB2(0x98BE), MB2(0x98C0), + 0x0000, MB2(0xFA69), 0x0000, MB2(0x91E3), /* 4EE0 */ + MB2(0x97DF), MB2(0x88C8), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x98BF), MB2(0x89BC), 0x0000, + MB2(0x8BC2), 0x0000, MB2(0x9287), 0x0000, + 0x0000, 0x0000, MB2(0x8C8F), MB2(0x98C1), + 0x0000, 0x0000, 0x0000, MB2(0x9443), + MB2(0xFA6A), 0x0000, 0x0000, 0x0000, + MB2(0xFA6B), MB2(0x8AE9), 0x0000, MB2(0xFA6C), /* 4F00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x98C2), MB2(0x88C9), 0x0000, + 0x0000, MB2(0x8CDE), MB2(0x8AEA), MB2(0x959A), + MB2(0x94B0), MB2(0x8B78), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x89EF), 0x0000, + MB2(0x98E5), MB2(0x9360), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4F20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x948C), + MB2(0x98C4), 0x0000, 0x0000, 0x0000, + MB2(0x94BA), 0x0000, MB2(0x97E0), 0x0000, + MB2(0x904C), MB2(0xFA6D), MB2(0x8E66), 0x0000, + MB2(0x8E97), MB2(0x89BE), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x92CF), /* 4F40 */ + 0x0000, 0x0000, MB2(0x9241), MB2(0x98C8), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x88CA), MB2(0x92E1), MB2(0x8F5A), + MB2(0x8DB2), MB2(0x9743), 0x0000, MB2(0x91CC), + 0x0000, MB2(0x89BD), MB2(0xFA6E), MB2(0x98C7), + 0x0000, MB2(0x975D), MB2(0x98C3), MB2(0x98C5), + MB2(0x8DEC), MB2(0x98C6), MB2(0x9B43), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 4F60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x98CE), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x98D1), + MB2(0x98CF), 0x0000, 0x0000, MB2(0x89C0), + 0x0000, MB2(0x95B9), MB2(0x98C9), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x98CD), + MB2(0x8CF1), 0x0000, 0x0000, MB2(0x8E67), + 0x0000, 0x0000, 0x0000, MB2(0x8AA4), /* 4F80 */ + 0x0000, 0x0000, MB2(0x98D2), 0x0000, + MB2(0x98CA), 0x0000, MB2(0xFA70), MB2(0x97E1), + 0x0000, MB2(0x8E98), 0x0000, MB2(0x98CB), + 0x0000, MB2(0x98D0), MB2(0xFA6F), 0x0000, + MB2(0xFA72), 0x0000, MB2(0x98D3), 0x0000, + MB2(0x98CC), 0x0000, MB2(0xFA71), MB2(0x8B9F), + 0x0000, MB2(0x88CB), 0x0000, 0x0000, + MB2(0x8BA0), MB2(0x89BF), 0x0000, 0x0000, /* 4FA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x9B44), + 0x0000, MB2(0x9699), MB2(0x958E), MB2(0x8CF2), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x904E), MB2(0x97B5), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x95D6), + 0x0000, 0x0000, MB2(0x8C57), MB2(0x91A3), /* 4FC0 */ + MB2(0x89E2), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xFA61), MB2(0x8F72), 0x0000, + 0x0000, MB2(0xFA73), MB2(0x98D7), 0x0000, + MB2(0x98DC), MB2(0x98DA), 0x0000, 0x0000, + MB2(0x98D5), 0x0000, 0x0000, MB2(0x91AD), + MB2(0x98D8), 0x0000, MB2(0x98DB), MB2(0x98D9), + 0x0000, MB2(0x95DB), 0x0000, MB2(0x98D6), + 0x0000, MB2(0x904D), 0x0000, MB2(0x9693), /* 4FE0 */ + MB2(0x98DD), MB2(0x98DE), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x8F43), MB2(0x98EB), + 0x0000, 0x0000, 0x0000, MB2(0x946F), + 0x0000, MB2(0x9555), MB2(0x98E6), 0x0000, + MB2(0x95EE), 0x0000, MB2(0x89B4), 0x0000, + 0x0000, 0x0000, MB2(0x98EA), MB2(0xFA76), + 0x0000, 0x0000, 0x0000, 0x0000, /* 5000 */ + 0x0000, MB2(0x98E4), MB2(0x98ED), 0x0000, + 0x0000, MB2(0x9171), 0x0000, MB2(0x8CC2), + 0x0000, MB2(0x947B), 0x0000, MB2(0xE0C5), + 0x0000, MB2(0x98EC), MB2(0x937C), 0x0000, + MB2(0x98E1), 0x0000, MB2(0x8CF4), 0x0000, + 0x0000, MB2(0x8CF3), MB2(0x98DF), 0x0000, + 0x0000, 0x0000, MB2(0xFA77), MB2(0x8ED8), + 0x0000, MB2(0x98E7), MB2(0xFA75), MB2(0x95ED), /* 5020 */ + MB2(0x926C), MB2(0x98E3), MB2(0x8C91), 0x0000, + MB2(0x98E0), MB2(0x98E8), MB2(0x98E2), MB2(0x97CF), + MB2(0x98E9), MB2(0x9860), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x8BE4), 0x0000, + 0x0000, MB2(0x8C90), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xFA74), 0x0000, MB2(0xFA7A), MB2(0x98EE), /* 5040 */ + 0x0000, 0x0000, MB2(0xFA78), MB2(0x98EF), + MB2(0x98F3), MB2(0x88CC), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x95CE), + MB2(0x98F2), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x98F1), MB2(0x98F5), 0x0000, + 0x0000, 0x0000, MB2(0x98F4), 0x0000, + MB2(0x92E2), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5060 */ + 0x0000, MB2(0x8C92), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x98F6), 0x0000, 0x0000, 0x0000, + MB2(0xFA79), 0x0000, MB2(0x8EC3), 0x0000, + MB2(0x91A4), MB2(0x92E3), MB2(0x8BF4), 0x0000, + MB2(0x98F7), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x8B55), 0x0000, 0x0000, + MB2(0x98F8), 0x0000, 0x0000, 0x0000, /* 5080 */ + 0x0000, MB2(0x98FA), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x9654), 0x0000, 0x0000, + 0x0000, MB2(0x8C86), 0x0000, 0x0000, + MB2(0xFA7B), 0x0000, 0x0000, 0x0000, + MB2(0x8E50), MB2(0x94F5), MB2(0x98F9), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 50A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x8DC3), MB2(0x9762), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x98FC), MB2(0x9942), + MB2(0x98FB), MB2(0x8DC2), 0x0000, MB2(0x8F9D), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x8C58), 0x0000, + 0x0000, 0x0000, MB2(0x9943), 0x0000, /* 50C0 */ + 0x0000, MB2(0x8BCD), 0x0000, 0x0000, + 0x0000, MB2(0x9940), MB2(0x9941), 0x0000, + 0x0000, MB2(0x93AD), 0x0000, MB2(0x919C), + 0x0000, MB2(0x8BA1), 0x0000, 0x0000, + 0x0000, MB2(0x966C), MB2(0x9944), 0x0000, + MB2(0xFA7D), 0x0000, MB2(0x97BB), 0x0000, + 0x0000, 0x0000, MB2(0x9945), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x9948), /* 50E0 */ + 0x0000, MB2(0x9946), 0x0000, MB2(0x916D), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x9947), MB2(0x9949), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xFA7C), MB2(0x994B), 0x0000, 0x0000, + 0x0000, MB2(0x994A), 0x0000, MB2(0x95C6), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x8B56), MB2(0x994D), MB2(0x994E), 0x0000, /* 5100 */ + MB2(0x89AD), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x994C), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x8EF2), 0x0000, + MB2(0x9951), MB2(0x9950), MB2(0x994F), 0x0000, + MB2(0x98D4), 0x0000, MB2(0x9952), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x8F9E), + 0x0000, MB2(0x9953), 0x0000, 0x0000, /* 5120 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9744), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x96D7), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x9955), + 0x0000, 0x0000, MB2(0x9954), MB2(0x9957), + MB2(0x9956), 0x0000, 0x0000, MB2(0x9958), + MB2(0x9959), MB2(0x88F2), 0x0000, MB2(0x8CB3), /* 5140 */ + MB2(0x8C5A), MB2(0x8F5B), MB2(0x929B), MB2(0x8BA2), + MB2(0x90E6), MB2(0x8CF5), MB2(0xFA7E), MB2(0x8D8E), + MB2(0x995B), MB2(0x96C6), MB2(0x9365), 0x0000, + MB2(0x8E99), 0x0000, MB2(0x995A), 0x0000, + MB2(0x995C), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x937D), 0x0000, + MB2(0x8A95), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x995D), 0x0000, /* 5160 */ + MB2(0xFA80), MB2(0x93FC), 0x0000, 0x0000, + MB2(0x9153), MB2(0x995F), MB2(0x9960), MB2(0x94AA), + MB2(0x8CF6), MB2(0x985A), MB2(0x9961), 0x0000, + 0x0000, MB2(0x8BA4), 0x0000, 0x0000, + 0x0000, MB2(0x95BA), MB2(0x91B4), MB2(0x8BEF), + MB2(0x9354), 0x0000, 0x0000, 0x0000, + MB2(0x8C93), 0x0000, 0x0000, 0x0000, + MB2(0x9962), 0x0000, MB2(0x9963), 0x0000, /* 5180 */ + 0x0000, MB2(0x93E0), MB2(0x897E), 0x0000, + 0x0000, MB2(0x9966), MB2(0x8DFB), 0x0000, + MB2(0x9965), MB2(0x8DC4), 0x0000, MB2(0x9967), + MB2(0xE3EC), MB2(0x9968), MB2(0x9660), MB2(0x9969), + 0x0000, MB2(0x996A), MB2(0x996B), MB2(0x8FE7), + 0x0000, MB2(0x8ECA), 0x0000, 0x0000, + 0x0000, MB2(0xFA81), 0x0000, 0x0000, + MB2(0x8AA5), 0x0000, MB2(0x996E), 0x0000, /* 51A0 */ + MB2(0x996C), MB2(0x96BB), MB2(0x996D), 0x0000, + MB2(0x9579), MB2(0x996F), MB2(0x9970), MB2(0x9971), + MB2(0x937E), 0x0000, 0x0000, 0x0000, + MB2(0x9975), MB2(0x9973), MB2(0x9974), MB2(0x9972), + MB2(0x8DE1), MB2(0x9976), MB2(0x96E8), MB2(0x97E2), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x9977), MB2(0xFA82), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 51C0 */ + MB2(0x90A6), MB2(0x9978), MB2(0x8F79), 0x0000, + 0x0000, MB2(0x9979), 0x0000, MB2(0x929C), + MB2(0x97BD), MB2(0x9380), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x99C3), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x997A), + MB2(0xEAA3), MB2(0x8BC3), 0x0000, 0x0000, + MB2(0x997B), MB2(0x967D), 0x0000, 0x0000, /* 51E0 */ + 0x0000, 0x0000, MB2(0x8F88), MB2(0x91FA), + 0x0000, MB2(0x997D), MB2(0x93E2), 0x0000, + MB2(0xFA83), MB2(0x997E), 0x0000, 0x0000, + MB2(0x9980), MB2(0x8A4D), 0x0000, 0x0000, + 0x0000, MB2(0x9981), MB2(0x8BA5), 0x0000, + MB2(0x93CA), MB2(0x899A), MB2(0x8F6F), 0x0000, + 0x0000, MB2(0x949F), MB2(0x9982), 0x0000, + MB2(0x9381), 0x0000, 0x0000, MB2(0x906E), /* 5200 */ + MB2(0x9983), 0x0000, MB2(0x95AA), MB2(0x90D8), + MB2(0x8AA0), 0x0000, MB2(0x8AA7), MB2(0x9984), + 0x0000, 0x0000, MB2(0x9986), 0x0000, + 0x0000, MB2(0x8C59), 0x0000, 0x0000, + MB2(0x9985), MB2(0xFA84), 0x0000, MB2(0x97F1), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x8F89), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5220 */ + MB2(0x94BB), MB2(0x95CA), 0x0000, MB2(0x9987), + 0x0000, MB2(0x9798), MB2(0x9988), 0x0000, + 0x0000, 0x0000, MB2(0x9989), 0x0000, + MB2(0x939E), 0x0000, 0x0000, MB2(0x998A), + 0x0000, 0x0000, MB2(0x90A7), MB2(0x8DFC), + MB2(0x8C94), MB2(0x998B), MB2(0x8E68), MB2(0x8D8F), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x92E4), /* 5240 */ + MB2(0x998D), 0x0000, 0x0000, MB2(0x91A5), + 0x0000, 0x0000, MB2(0x8DED), MB2(0x998E), + MB2(0x998F), MB2(0x914F), 0x0000, MB2(0x998C), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9991), 0x0000, MB2(0x9655), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x8D84), + 0x0000, 0x0000, MB2(0x9990), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x8C95), /* 5260 */ + MB2(0x8DDC), MB2(0x948D), 0x0000, 0x0000, + 0x0000, MB2(0x9994), MB2(0x9992), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x959B), + MB2(0x8FE8), MB2(0x999B), MB2(0x8A84), MB2(0x9995), + MB2(0x9993), MB2(0x916E), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x9997), 0x0000, MB2(0x9996), + 0x0000, 0x0000, 0x0000, MB2(0x8A63), /* 5280 */ + 0x0000, 0x0000, 0x0000, MB2(0x8C80), + MB2(0x999C), MB2(0x97AB), 0x0000, 0x0000, + 0x0000, MB2(0x9998), 0x0000, 0x0000, + 0x0000, MB2(0x999D), MB2(0x999A), 0x0000, + MB2(0x9999), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x97CD), + MB2(0xFA85), 0x0000, 0x0000, MB2(0x8CF7), + MB2(0x89C1), 0x0000, 0x0000, MB2(0x97F2), /* 52A0 */ + 0x0000, 0x0000, MB2(0xFA86), 0x0000, + 0x0000, MB2(0x8F95), MB2(0x9377), MB2(0x8D85), + MB2(0x99A0), MB2(0x99A1), 0x0000, MB2(0xFB77), + 0x0000, MB2(0x97E3), 0x0000, 0x0000, + MB2(0x984A), MB2(0x99A3), 0x0000, 0x0000, + 0x0000, MB2(0x8CF8), 0x0000, 0x0000, + MB2(0x99A2), 0x0000, MB2(0x8A4E), 0x0000, + MB2(0xFA87), MB2(0x99A4), 0x0000, MB2(0x9675), /* 52C0 */ + 0x0000, MB2(0x92BA), 0x0000, MB2(0x9745), + 0x0000, MB2(0x95D7), 0x0000, 0x0000, + 0x0000, MB2(0x99A5), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE8D3), 0x0000, + 0x0000, MB2(0x93AE), 0x0000, MB2(0x99A6), + MB2(0x8AA8), MB2(0x96B1), 0x0000, MB2(0xFA88), + 0x0000, MB2(0x8F9F), MB2(0x99A7), MB2(0x95E5), + MB2(0x99AB), 0x0000, MB2(0x90A8), MB2(0x99A8), /* 52E0 */ + MB2(0x8BCE), 0x0000, MB2(0x99A9), MB2(0x8AA9), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x8C4D), MB2(0x99AC), + 0x0000, MB2(0x99AD), 0x0000, 0x0000, + MB2(0x99AE), MB2(0x99AF), MB2(0x8ED9), 0x0000, + 0x0000, 0x0000, MB2(0x8CF9), MB2(0x96DC), + MB2(0xFA89), MB2(0x96E6), MB2(0x93F5), 0x0000, /* 5300 */ + 0x0000, MB2(0x95EF), MB2(0x99B0), MB2(0xFA8A), + MB2(0x99B1), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x99B3), 0x0000, MB2(0x99B5), + MB2(0x99B4), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x99B6), MB2(0x89BB), MB2(0x966B), + 0x0000, MB2(0x8DFA), MB2(0x99B7), 0x0000, + 0x0000, MB2(0x9178), 0x0000, 0x0000, + MB2(0x8FA0), MB2(0x8BA7), 0x0000, MB2(0x99B8), /* 5320 */ + MB2(0xFA8B), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x94D9), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x99B9), + 0x0000, MB2(0x99BA), 0x0000, MB2(0x99BB), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x99BC), MB2(0x9543), MB2(0x8BE6), MB2(0x88E3), + 0x0000, 0x0000, 0x0000, MB2(0x93BD), + MB2(0x99BD), MB2(0x8F5C), 0x0000, MB2(0x90E7), /* 5340 */ + 0x0000, MB2(0x99BF), MB2(0x99BE), MB2(0x8FA1), + MB2(0x8CDF), MB2(0x99C1), MB2(0x94BC), 0x0000, + 0x0000, MB2(0x99C2), 0x0000, 0x0000, + 0x0000, MB2(0x94DA), MB2(0x91B2), MB2(0x91EC), + MB2(0x8BA6), 0x0000, 0x0000, MB2(0x93EC), + MB2(0x9250), 0x0000, MB2(0x948E), 0x0000, + MB2(0x966D), 0x0000, MB2(0x99C4), 0x0000, + MB2(0x90E8), 0x0000, 0x0000, 0x0000, /* 5360 */ + 0x0000, 0x0000, MB2(0x8C54), 0x0000, + 0x0000, MB2(0x99C5), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x99C6), MB2(0x894B), + MB2(0x88F3), MB2(0x8AEB), MB2(0xFA8C), MB2(0x91A6), + MB2(0x8B70), MB2(0x9791), 0x0000, MB2(0x99C9), + MB2(0x89B5), 0x0000, 0x0000, MB2(0x99C8), + 0x0000, 0x0000, 0x0000, MB2(0x8BA8), + 0x0000, 0x0000, MB2(0x99CA), 0x0000, /* 5380 */ + MB2(0x96EF), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xFA8D), + 0x0000, 0x0000, MB2(0x99CB), 0x0000, + MB2(0x97D0), 0x0000, MB2(0x8CFA), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x8CB4), + MB2(0x99CC), 0x0000, 0x0000, 0x0000, /* 53A0 */ + 0x0000, MB2(0x99CE), MB2(0x99CD), 0x0000, + MB2(0x907E), MB2(0x8958), 0x0000, 0x0000, + 0x0000, MB2(0x897D), MB2(0x99CF), 0x0000, + MB2(0x99D0), 0x0000, MB2(0xFA8E), MB2(0x8CB5), + 0x0000, 0x0000, MB2(0x99D1), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x8B8E), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x8E51), MB2(0x99D2), /* 53C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9694), MB2(0x8DB3), MB2(0x8B79), MB2(0x9746), + MB2(0x916F), MB2(0x94BD), MB2(0x8EFB), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x8F66), 0x0000, MB2(0x8EE6), MB2(0x8EF3), + 0x0000, MB2(0x8F96), 0x0000, MB2(0x94BE), + 0x0000, MB2(0xFA8F), 0x0000, MB2(0x99D5), + 0x0000, MB2(0x8962), MB2(0x9170), MB2(0x8CFB), /* 53E0 */ + MB2(0x8CC3), MB2(0x8BE5), 0x0000, 0x0000, + MB2(0x99D9), MB2(0x9240), MB2(0x91FC), MB2(0x8BA9), + MB2(0x8FA2), MB2(0x99DA), MB2(0x99D8), MB2(0x89C2), + MB2(0x91E4), MB2(0x8EB6), MB2(0x8E6A), MB2(0x8945), + 0x0000, 0x0000, MB2(0x8A90), MB2(0x8D86), + MB2(0x8E69), 0x0000, MB2(0x99DB), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x99DC), 0x0000, MB2(0x8B68), /* 5400 */ + MB2(0x8A65), 0x0000, 0x0000, 0x0000, + MB2(0x8D87), MB2(0x8B67), MB2(0x92DD), MB2(0x8944), + MB2(0x93AF), MB2(0x96BC), MB2(0x8D40), MB2(0x9799), + MB2(0x9366), MB2(0x8CFC), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x8C4E), + 0x0000, MB2(0x99E5), 0x0000, MB2(0x8BE1), + MB2(0x9669), 0x0000, 0x0000, 0x0000, /* 5420 */ + 0x0000, 0x0000, MB2(0x94DB), 0x0000, + 0x0000, MB2(0x99E4), 0x0000, MB2(0x8ADC), + MB2(0x99DF), MB2(0x99E0), MB2(0x99E2), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x99E3), 0x0000, + MB2(0x8B7A), MB2(0x9081), 0x0000, MB2(0x95AB), + MB2(0x99E1), MB2(0x99DD), MB2(0x8CE1), 0x0000, + MB2(0x99DE), 0x0000, MB2(0x9843), 0x0000, /* 5440 */ + 0x0000, 0x0000, MB2(0x95F0), 0x0000, + MB2(0x92E6), MB2(0x8CE0), MB2(0x8D90), 0x0000, + 0x0000, 0x0000, MB2(0x99E6), 0x0000, + 0x0000, MB2(0x93DB), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x99EA), + 0x0000, 0x0000, 0x0000, 0x0000, /* 5460 */ + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x8EFC), 0x0000, MB2(0x8EF4), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x99ED), MB2(0x99EB), 0x0000, MB2(0x96A1), + 0x0000, MB2(0x99E8), MB2(0x99F1), MB2(0x99EC), + 0x0000, 0x0000, 0x0000, MB2(0x99EF), + MB2(0x8CC4), MB2(0x96BD), 0x0000, 0x0000, + MB2(0x99F0), 0x0000, 0x0000, 0x0000, /* 5480 */ + MB2(0x99F2), 0x0000, MB2(0x99F4), 0x0000, + 0x0000, 0x0000, MB2(0xFA92), MB2(0x8DEE), + MB2(0x9861), 0x0000, MB2(0x99E9), MB2(0x99E7), + MB2(0x99F3), 0x0000, MB2(0x99EE), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xFA91), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x99F6), 0x0000, /* 54A0 */ + MB2(0x9A42), MB2(0x99F8), 0x0000, 0x0000, + MB2(0x99FC), MB2(0xFA93), 0x0000, MB2(0x9A40), + MB2(0x99F9), 0x0000, 0x0000, MB2(0x9A5D), + 0x0000, 0x0000, MB2(0x8DE7), MB2(0x8A50), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x99F7), 0x0000, 0x0000, 0x0000, + MB2(0x9A44), MB2(0x88F4), MB2(0x9A43), 0x0000, + MB2(0x88A3), MB2(0x9569), MB2(0x9A41), 0x0000, /* 54C0 */ + MB2(0x99FA), 0x0000, 0x0000, MB2(0x99F5), + MB2(0x99FB), MB2(0x8DC6), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9A45), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x88F5), MB2(0x9A4E), 0x0000, /* 54E0 */ + 0x0000, MB2(0x9A46), MB2(0x9A47), 0x0000, + MB2(0x8FA3), MB2(0x9689), 0x0000, 0x0000, + 0x0000, MB2(0x9A4C), MB2(0x9A4B), 0x0000, + 0x0000, 0x0000, MB2(0x934E), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9A4D), 0x0000, + 0x0000, MB2(0x9A4A), 0x0000, MB2(0xFA94), + 0x0000, 0x0000, 0x0000, 0x0000, /* 5500 */ + MB2(0x8953), 0x0000, MB2(0x8DB4), MB2(0x904F), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x9A48), + MB2(0x9382), 0x0000, 0x0000, 0x0000, + MB2(0x9A49), 0x0000, MB2(0x88A0), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5520 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9A53), MB2(0x9742), + 0x0000, MB2(0x8FA5), 0x0000, MB2(0x9A59), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9A58), MB2(0x9A4F), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x91C1), 0x0000, + MB2(0x9A50), 0x0000, 0x0000, 0x0000, /* 5540 */ + MB2(0x91ED), MB2(0x9A55), MB2(0x8FA4), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9A52), 0x0000, 0x0000, MB2(0x96E2), + 0x0000, 0x0000, 0x0000, MB2(0x8C5B), + 0x0000, 0x0000, MB2(0x9A56), MB2(0x9A57), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9A54), MB2(0x9A5A), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x9A51), /* 5560 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x9A60), + MB2(0x9A65), 0x0000, MB2(0x9A61), 0x0000, + MB2(0x9A5C), 0x0000, 0x0000, MB2(0x9A66), /* 5580 */ + MB2(0x9150), 0x0000, MB2(0xFA95), MB2(0x9A68), + 0x0000, MB2(0x8D41), MB2(0x9A5E), MB2(0x929D), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9A62), MB2(0x9A5B), MB2(0x8AAB), 0x0000, + MB2(0x8AEC), MB2(0x8A85), MB2(0x9A63), MB2(0x9A5F), + 0x0000, 0x0000, 0x0000, 0x0000, /* 55A0 */ + 0x0000, 0x0000, 0x0000, MB2(0x8C96), + MB2(0x9A69), MB2(0x9A67), MB2(0x9172), MB2(0x8B69), + MB2(0x8BAA), 0x0000, MB2(0x9A64), 0x0000, + MB2(0x8BF2), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x8963), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 55C0 */ + MB2(0x9A6D), MB2(0x9A6B), 0x0000, MB2(0x9AA5), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9A70), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9A6A), 0x0000, + MB2(0x9A6E), 0x0000, 0x0000, MB2(0x9A6C), + 0x0000, 0x0000, 0x0000, MB2(0x8E6B), /* 55E0 */ + MB2(0x9A6F), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x9A72), + 0x0000, MB2(0x9A77), 0x0000, 0x0000, + 0x0000, MB2(0x9A75), MB2(0x9A74), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5600 */ + 0x0000, 0x0000, MB2(0x9251), 0x0000, + 0x0000, MB2(0x89C3), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9A71), 0x0000, MB2(0x9A73), MB2(0x8FA6), + MB2(0x8952), 0x0000, 0x0000, MB2(0x9A76), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5620 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x89DC), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x9A82), + 0x0000, MB2(0x8FFA), MB2(0x9A7D), 0x0000, + MB2(0x9A7B), 0x0000, MB2(0x9A7C), 0x0000, + MB2(0x9A7E), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x895C), 0x0000, /* 5640 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9158), 0x0000, MB2(0x9A78), 0x0000, + MB2(0x9A79), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x8A9A), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5660 */ + MB2(0x9A81), 0x0000, 0x0000, 0x0000, + MB2(0x8AED), 0x0000, MB2(0x9A84), MB2(0x9A80), + MB2(0x9A83), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x95AC), 0x0000, 0x0000, 0x0000, + MB2(0x93D3), 0x0000, MB2(0x94B6), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9A86), 0x0000, 0x0000, 0x0000, /* 5680 */ + 0x0000, 0x0000, MB2(0x9A85), MB2(0x8A64), + 0x0000, 0x0000, MB2(0x9A87), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x9A8A), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9A89), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9A88), 0x0000, MB2(0x9458), 0x0000, /* 56A0 */ + 0x0000, MB2(0x9A8B), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9A8C), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9A8E), 0x0000, MB2(0x9A8D), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9A90), 0x0000, 0x0000, 0x0000, + MB2(0x9A93), MB2(0x9A91), MB2(0x9A8F), MB2(0x9A92), /* 56C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9A94), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9A95), 0x0000, + 0x0000, MB2(0x9A96), 0x0000, MB2(0x9A97), + 0x0000, 0x0000, 0x0000, MB2(0x9A98), + MB2(0x9964), 0x0000, MB2(0x8EFA), MB2(0x8E6C), + 0x0000, 0x0000, MB2(0x89F1), 0x0000, + MB2(0x88F6), 0x0000, 0x0000, MB2(0x9263), /* 56E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9A99), 0x0000, + MB2(0x8DA2), 0x0000, MB2(0x88CD), MB2(0x907D), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x9A9A), MB2(0x8CC5), 0x0000, + 0x0000, MB2(0x8D91), 0x0000, MB2(0x9A9C), + MB2(0x9A9B), 0x0000, 0x0000, MB2(0x95DE), /* 5700 */ + MB2(0x9A9D), 0x0000, 0x0000, 0x0000, + MB2(0x9A9F), MB2(0x9A9E), 0x0000, MB2(0x9AA0), + 0x0000, MB2(0x9AA1), 0x0000, MB2(0x8C97), + 0x0000, 0x0000, MB2(0x8980), MB2(0x9AA2), + 0x0000, 0x0000, MB2(0x9AA4), 0x0000, + MB2(0x9AA3), 0x0000, 0x0000, 0x0000, + MB2(0x9AA6), 0x0000, 0x0000, MB2(0x9379), + 0x0000, 0x0000, 0x0000, 0x0000, /* 5720 */ + 0x0000, 0x0000, MB2(0x9AA7), MB2(0x88B3), + MB2(0x8DDD), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x8C5C), 0x0000, 0x0000, + MB2(0x926E), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x9AA8), + MB2(0x9AA9), 0x0000, 0x0000, MB2(0x9AAB), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9AAC), 0x0000, MB2(0x8DE2), 0x0000, /* 5740 */ + 0x0000, 0x0000, 0x0000, MB2(0x8BCF), + 0x0000, 0x0000, MB2(0x9656), 0x0000, + 0x0000, 0x0000, MB2(0x9AAA), MB2(0x9AAD), + MB2(0x8DBF), MB2(0x8D42), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xFA96), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x9AB1), 0x0000, 0x0000, /* 5760 */ + MB2(0x8DA3), MB2(0xFA97), MB2(0x9252), 0x0000, + 0x0000, MB2(0x9AAE), MB2(0x92D8), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x9AB2), + 0x0000, 0x0000, MB2(0x9082), 0x0000, /* 5780 */ + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9AB0), MB2(0x9AB3), 0x0000, MB2(0x8C5E), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x9AB4), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9AB5), 0x0000, MB2(0x8D43), MB2(0x8A5F), /* 57A0 */ + MB2(0x9AB7), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9AB8), 0x0000, + MB2(0xFA98), 0x0000, 0x0000, 0x0000, + MB2(0x9AB9), 0x0000, 0x0000, MB2(0x9AB6), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9AAF), 0x0000, 0x0000, MB2(0x9ABA), /* 57C0 */ + 0x0000, 0x0000, MB2(0x9ABB), MB2(0xFA9A), + MB2(0xFA99), 0x0000, 0x0000, MB2(0x9684), + 0x0000, 0x0000, MB2(0x8FE9), 0x0000, + 0x0000, 0x0000, MB2(0x9ABD), MB2(0x9ABE), + MB2(0x9ABC), 0x0000, MB2(0x9AC0), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9457), 0x0000, 0x0000, MB2(0x88E6), + MB2(0x9575), 0x0000, 0x0000, MB2(0x9AC1), /* 57E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x8FFB), 0x0000, 0x0000, MB2(0x8EB7), + 0x0000, MB2(0x947C), MB2(0x8AEE), 0x0000, + MB2(0x8DE9), 0x0000, 0x0000, 0x0000, + MB2(0x9678), 0x0000, MB2(0x93B0), 0x0000, /* 5800 */ + 0x0000, MB2(0x8C98), MB2(0x91CD), 0x0000, + 0x0000, 0x0000, MB2(0x9ABF), MB2(0x9AC2), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x91C2), 0x0000, 0x0000, + 0x0000, MB2(0x9AC3), 0x0000, 0x0000, + 0x0000, MB2(0x9AC4), 0x0000, 0x0000, + 0x0000, MB2(0x9AC6), 0x0000, 0x0000, /* 5820 */ + MB2(0x92E7), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x8AAC), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xEA9F), + MB2(0x8981), MB2(0x95F1), 0x0000, 0x0000, + MB2(0x8FEA), MB2(0x9367), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x8DE4), 0x0000, + 0x0000, MB2(0x9ACC), 0x0000, 0x0000, + MB2(0x95BB), MB2(0x97DB), 0x0000, 0x0000, /* 5840 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x89F2), MB2(0x9AC8), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x9159), MB2(0x9ACB), 0x0000, + MB2(0x9383), 0x0000, 0x0000, MB2(0x9368), + MB2(0x9384), MB2(0x94B7), MB2(0x92CB), 0x0000, + 0x0000, 0x0000, MB2(0x8DC7), 0x0000, + 0x0000, 0x0000, MB2(0x9AC7), 0x0000, /* 5860 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x8996), 0x0000, MB2(0x9355), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9AC9), 0x0000, MB2(0x9AC5), 0x0000, + 0x0000, MB2(0x906F), 0x0000, 0x0000, + 0x0000, MB2(0x9ACD), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x8F6D), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x8BAB), /* 5880 */ + 0x0000, MB2(0x9ACE), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x95E6), + 0x0000, 0x0000, 0x0000, MB2(0x919D), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x92C4), 0x0000, MB2(0xFA9D), MB2(0x9AD0), + 0x0000, 0x0000, 0x0000, 0x0000, /* 58A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x966E), 0x0000, 0x0000, MB2(0x9AD1), + 0x0000, 0x0000, MB2(0x9AD6), 0x0000, + 0x0000, 0x0000, MB2(0xFA9E), MB2(0x95AD), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9AD5), MB2(0x9ACF), MB2(0x9AD2), MB2(0x9AD4), + 0x0000, 0x0000, MB2(0x8DA4), 0x0000, + 0x0000, MB2(0x95C7), 0x0000, 0x0000, /* 58C0 */ + 0x0000, MB2(0x9AD7), 0x0000, MB2(0x9264), + 0x0000, 0x0000, MB2(0x89F3), 0x0000, + MB2(0x8FEB), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x9AD9), 0x0000, MB2(0x9AD8), + 0x0000, MB2(0x8D88), 0x0000, MB2(0x9ADA), + MB2(0x9ADC), MB2(0x9ADB), 0x0000, 0x0000, + MB2(0x9ADE), 0x0000, MB2(0x9AD3), MB2(0x9AE0), + 0x0000, 0x0000, 0x0000, 0x0000, /* 58E0 */ + MB2(0x9ADF), MB2(0x9ADD), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x8E6D), + MB2(0x9070), 0x0000, MB2(0x9173), MB2(0x9AE1), + MB2(0x90BA), MB2(0x88EB), MB2(0x9484), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x92D9), + 0x0000, MB2(0x9AE3), MB2(0x9AE2), MB2(0x9AE4), + MB2(0x9AE5), MB2(0x9AE6), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9AE7), 0x0000, /* 5900 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x95CF), MB2(0x9AE8), MB2(0xFA9F), + 0x0000, 0x0000, 0x0000, MB2(0x89C4), + MB2(0x9AE9), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x975B), MB2(0x8A4F), 0x0000, + MB2(0x99C7), MB2(0x8F67), MB2(0x91BD), MB2(0x9AEA), + MB2(0x96E9), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x96B2), 0x0000, /* 5920 */ + 0x0000, MB2(0x9AEC), 0x0000, MB2(0x91E5), + 0x0000, MB2(0x9356), MB2(0x91BE), MB2(0x9576), + MB2(0x9AED), MB2(0x9AEE), MB2(0x899B), 0x0000, + 0x0000, MB2(0x8EB8), MB2(0x9AEF), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x88CE), + MB2(0x9AF0), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9AF1), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5940 */ + MB2(0x8982), 0x0000, 0x0000, MB2(0x8AEF), + MB2(0x93DE), MB2(0x95F2), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9AF5), MB2(0x9174), + MB2(0x9AF4), MB2(0x8C5F), 0x0000, MB2(0xFAA0), + MB2(0x967A), MB2(0x9AF3), 0x0000, MB2(0x9385), + MB2(0x9AF7), 0x0000, MB2(0x9AF6), MB2(0xFAA1), + 0x0000, MB2(0xFAA2), 0x0000, 0x0000, + MB2(0x9AF9), 0x0000, MB2(0x9AF8), MB2(0xFAA3), /* 5960 */ + 0x0000, MB2(0x899C), 0x0000, MB2(0x9AFA), + MB2(0x8FA7), MB2(0x9AFC), MB2(0x9244), 0x0000, + MB2(0x9AFB), 0x0000, MB2(0x95B1), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x8F97), + MB2(0x937A), 0x0000, 0x0000, 0x0000, + MB2(0x9B40), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x8D44), 0x0000, 0x0000, + 0x0000, MB2(0x9B41), MB2(0x9440), MB2(0x94DC), /* 5980 */ + MB2(0x96CF), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9444), 0x0000, + 0x0000, MB2(0x9B4A), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x8B57), + 0x0000, 0x0000, MB2(0x9764), 0x0000, + 0x0000, MB2(0x96AD), 0x0000, MB2(0x9BAA), + 0x0000, MB2(0x9B42), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x9B45), /* 59A0 */ + MB2(0xFAA4), MB2(0x91C3), 0x0000, 0x0000, + MB2(0x9657), 0x0000, 0x0000, 0x0000, + MB2(0x9369), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9B46), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x9685), MB2(0xFAA5), MB2(0x8DC8), + 0x0000, 0x0000, MB2(0x8FA8), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 59C0 */ + 0x0000, 0x0000, MB2(0x9B47), 0x0000, + 0x0000, MB2(0x8E6F), 0x0000, MB2(0x8E6E), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x88B7), MB2(0x8CC6), 0x0000, MB2(0x90A9), + MB2(0x88CF), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x9B4B), MB2(0x9B4C), 0x0000, + MB2(0x9B49), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 59E0 */ + 0x0000, MB2(0x8957), MB2(0x8AAD), 0x0000, + MB2(0x9B48), 0x0000, MB2(0x96C3), MB2(0x9550), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x88A6), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x88F7), + 0x0000, 0x0000, 0x0000, MB2(0x8E70), + 0x0000, MB2(0x88D0), 0x0000, MB2(0x88A1), /* 5A00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x9B51), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x9B4F), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x96BA), 0x0000, MB2(0x9B52), 0x0000, + MB2(0x9B50), 0x0000, 0x0000, MB2(0x9B4E), + MB2(0x9050), 0x0000, 0x0000, 0x0000, /* 5A20 */ + 0x0000, MB2(0x9B4D), 0x0000, 0x0000, + 0x0000, MB2(0x95D8), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x8CE2), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x9B56), MB2(0x9B57), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x8FA9), 0x0000, 0x0000, 0x0000, + MB2(0x9B53), MB2(0x984B), 0x0000, 0x0000, /* 5A40 */ + 0x0000, 0x0000, MB2(0x946B), 0x0000, + 0x0000, MB2(0x9B55), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x8DA5), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9B58), 0x0000, /* 5A60 */ + 0x0000, 0x0000, MB2(0x9577), 0x0000, + 0x0000, 0x0000, MB2(0x9B59), 0x0000, + MB2(0x9B54), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x96B9), + 0x0000, 0x0000, 0x0000, 0x0000, /* 5A80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x947D), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9B5A), MB2(0x9551), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5AA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9B5B), MB2(0x9B5F), MB2(0x9B5C), 0x0000, + 0x0000, MB2(0x89C5), MB2(0x9B5E), 0x0000, /* 5AC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x8EB9), 0x0000, MB2(0x9B5D), + MB2(0x8C99), 0x0000, 0x0000, 0x0000, + MB2(0x9B6B), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9B64), MB2(0x9B61), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x9284), 0x0000, MB2(0x9B60), /* 5AE0 */ + 0x0000, 0x0000, MB2(0x9B62), 0x0000, + 0x0000, MB2(0x9B63), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9B65), MB2(0x9B66), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5B00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x8AF0), 0x0000, MB2(0x9B68), + MB2(0x9B67), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9B69), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x8FEC), 0x0000, /* 5B20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9B6C), 0x0000, + MB2(0x92DA), 0x0000, 0x0000, 0x0000, + MB2(0x8964), 0x0000, MB2(0x9B6A), 0x0000, + 0x0000, 0x0000, MB2(0x9B6D), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9B6E), 0x0000, + MB2(0x9B71), 0x0000, 0x0000, MB2(0x9B6F), /* 5B40 */ + 0x0000, MB2(0x9B70), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x8E71), MB2(0x9B72), 0x0000, 0x0000, + MB2(0x8D45), MB2(0x9B73), MB2(0xFAA6), MB2(0x8E9A), + MB2(0x91B6), 0x0000, MB2(0x9B74), MB2(0x9B75), + MB2(0x8E79), MB2(0x8D46), 0x0000, MB2(0x96D0), + 0x0000, 0x0000, 0x0000, MB2(0x8B47), /* 5B60 */ + MB2(0x8CC7), MB2(0x9B76), MB2(0x8A77), 0x0000, + 0x0000, MB2(0x9B77), 0x0000, MB2(0x91B7), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9B78), MB2(0x9BA1), 0x0000, MB2(0x9B79), + 0x0000, MB2(0x9B7A), 0x0000, 0x0000, + MB2(0x9B7B), 0x0000, MB2(0x9B7D), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9B7E), 0x0000, 0x0000, MB2(0x9B80), /* 5B80 */ + 0x0000, MB2(0x91EE), 0x0000, MB2(0x8946), + MB2(0x8EE7), MB2(0x88C0), 0x0000, MB2(0x9176), + MB2(0x8AAE), MB2(0x8EB3), 0x0000, MB2(0x8D47), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x9386), 0x0000, MB2(0x8F40), + MB2(0x8AAF), MB2(0x9288), MB2(0x92E8), MB2(0x88B6), + MB2(0x8B58), MB2(0x95F3), 0x0000, MB2(0x8EC0), + 0x0000, 0x0000, MB2(0x8B71), MB2(0x90E9), /* 5BA0 */ + MB2(0x8EBA), MB2(0x9747), MB2(0x9B81), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x8B7B), 0x0000, + MB2(0x8DC9), 0x0000, 0x0000, MB2(0x8A51), + MB2(0x8983), MB2(0x8FAA), MB2(0x89C6), 0x0000, + MB2(0x9B82), MB2(0x9765), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x8F68), + MB2(0xFAA7), 0x0000, MB2(0x8EE2), MB2(0x9B83), /* 5BC0 */ + MB2(0x8AF1), MB2(0x93D0), MB2(0x96A7), MB2(0x9B84), + 0x0000, MB2(0x9B85), 0x0000, 0x0000, + MB2(0x9578), 0x0000, 0x0000, 0x0000, + MB2(0x9B87), 0x0000, MB2(0x8AA6), MB2(0x8BF5), + MB2(0x9B86), 0x0000, 0x0000, 0x0000, + MB2(0xFAA9), 0x0000, 0x0000, MB2(0x8AB0), + 0x0000, MB2(0x9051), MB2(0x9B8B), MB2(0x8E40), + 0x0000, MB2(0x89C7), MB2(0x9B8A), 0x0000, /* 5BE0 */ + MB2(0x9B88), MB2(0x9B8C), MB2(0x9B89), MB2(0x944A), + MB2(0x9ECB), MB2(0x9052), 0x0000, MB2(0x9B8D), + MB2(0xFAAA), 0x0000, MB2(0x97BE), 0x0000, + MB2(0x9B8E), 0x0000, 0x0000, MB2(0x9B90), + 0x0000, MB2(0x929E), MB2(0x9B8F), 0x0000, + MB2(0x90A1), 0x0000, MB2(0x8E9B), 0x0000, + 0x0000, 0x0000, MB2(0x91CE), MB2(0x8EF5), + 0x0000, MB2(0x9595), MB2(0x90EA), 0x0000, /* 5C00 */ + MB2(0x8ECB), MB2(0x9B91), MB2(0x8FAB), MB2(0x9B92), + MB2(0x9B93), MB2(0x88D1), MB2(0x91B8), MB2(0x9071), + 0x0000, MB2(0x9B94), MB2(0x93B1), MB2(0x8FAC), + 0x0000, MB2(0x8FAD), 0x0000, MB2(0x9B95), + 0x0000, 0x0000, MB2(0x90EB), 0x0000, + 0x0000, 0x0000, MB2(0x8FAE), 0x0000, + 0x0000, 0x0000, MB2(0xFAAB), 0x0000, + MB2(0x9B96), 0x0000, MB2(0x9B97), 0x0000, /* 5C20 */ + MB2(0x96DE), 0x0000, 0x0000, 0x0000, + MB2(0x9B98), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x8BC4), 0x0000, 0x0000, + 0x0000, MB2(0x8F41), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9B99), MB2(0x9B9A), MB2(0x8EDA), MB2(0x904B), + MB2(0x93F2), MB2(0x9073), MB2(0x94F6), MB2(0x9441), + MB2(0x8BC7), MB2(0x9B9B), 0x0000, 0x0000, /* 5C40 */ + 0x0000, MB2(0x8B8F), MB2(0x9B9C), 0x0000, + MB2(0x8BFC), 0x0000, MB2(0x93CD), MB2(0x89AE), + 0x0000, MB2(0x8E72), MB2(0x9B9D), MB2(0x9BA0), + MB2(0x9B9F), MB2(0x8BFB), 0x0000, MB2(0x9B9E), + 0x0000, MB2(0x9357), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x91AE), 0x0000, + MB2(0x936A), MB2(0x8EC6), 0x0000, 0x0000, /* 5C60 */ + MB2(0x9177), MB2(0x979A), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9BA2), 0x0000, MB2(0x9BA3), MB2(0x93D4), + 0x0000, MB2(0x8E52), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9BA5), 0x0000, + 0x0000, MB2(0x9BA6), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5C80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9BA7), 0x0000, 0x0000, 0x0000, + MB2(0x8AF2), MB2(0x9BA8), 0x0000, 0x0000, + MB2(0x9BA9), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x89AA), 0x0000, 0x0000, /* 5CA0 */ + 0x0000, 0x0000, MB2(0xFAAC), 0x0000, + MB2(0x915A), MB2(0x8AE2), 0x0000, MB2(0x9BAB), + MB2(0x96A6), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x91D0), 0x0000, MB2(0x8A78), + 0x0000, 0x0000, MB2(0x9BAD), MB2(0x9BAF), + MB2(0x8ADD), 0x0000, MB2(0xFAAD), MB2(0x9BAC), + MB2(0x9BAE), 0x0000, MB2(0x9BB1), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5CC0 */ + 0x0000, MB2(0x9BB0), 0x0000, MB2(0x9BB2), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x9BB3), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x93BB), MB2(0x8BAC), 0x0000, 0x0000, /* 5CE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x89E3), MB2(0x9BB4), MB2(0x9BB9), 0x0000, + 0x0000, MB2(0x9BB7), 0x0000, MB2(0x95F5), + MB2(0x95F4), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xFAAE), MB2(0x9387), 0x0000, + 0x0000, 0x0000, MB2(0x9BB6), MB2(0x8F73), + 0x0000, MB2(0x9BB5), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5D00 */ + 0x0000, 0x0000, 0x0000, MB2(0x9092), + 0x0000, 0x0000, 0x0000, MB2(0x9BBA), + 0x0000, 0x0000, MB2(0x8DE8), 0x0000, + 0x0000, MB2(0x9BC0), 0x0000, 0x0000, + MB2(0x9BC1), MB2(0x9BBB), MB2(0x8A52), MB2(0x9BBC), + MB2(0x9BC5), MB2(0x9BC4), MB2(0x9BC3), MB2(0x9BBF), + 0x0000, 0x0000, 0x0000, MB2(0x9BBE), + 0x0000, 0x0000, MB2(0x9BC2), 0x0000, /* 5D20 */ + 0x0000, 0x0000, 0x0000, MB2(0xFAAF), + 0x0000, MB2(0x95F6), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xFAB2), 0x0000, /* 5D40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x9BC9), + MB2(0x9BC6), 0x0000, MB2(0x9BC8), 0x0000, + MB2(0x9792), 0x0000, MB2(0x9BC7), MB2(0xFAB0), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9BBD), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5D60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x9093), 0x0000, 0x0000, + MB2(0x9BCA), MB2(0xFAB3), 0x0000, MB2(0x8DB5), + 0x0000, 0x0000, 0x0000, MB2(0x9BCB), + 0x0000, 0x0000, MB2(0x9BCC), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9BCF), 0x0000, /* 5D80 */ + MB2(0x9BCE), 0x0000, 0x0000, MB2(0x9BCD), + 0x0000, 0x0000, 0x0000, MB2(0x9388), + MB2(0x9BB8), 0x0000, 0x0000, 0x0000, + MB2(0x9BD5), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x9BD1), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9BD0), 0x0000, /* 5DA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9BD2), 0x0000, MB2(0x9BD3), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x9BD6), + MB2(0xFAB4), MB2(0xFAB5), MB2(0x97E4), 0x0000, + MB2(0x9BD7), MB2(0x9BD4), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5DC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x9BD8), 0x0000, 0x0000, + MB2(0x8ADE), MB2(0x9BD9), 0x0000, 0x0000, + MB2(0xFAB6), 0x0000, MB2(0x9BDB), MB2(0x9BDA), + 0x0000, 0x0000, MB2(0x9BDC), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x9BDD), + 0x0000, MB2(0x90EC), MB2(0x8F42), 0x0000, + 0x0000, MB2(0x8F84), 0x0000, MB2(0x9183), /* 5DE0 */ + 0x0000, MB2(0x8D48), MB2(0x8DB6), MB2(0x8D49), + MB2(0x8B90), 0x0000, 0x0000, MB2(0x9BDE), + 0x0000, 0x0000, MB2(0x8DB7), 0x0000, + 0x0000, MB2(0x8CC8), MB2(0x9BDF), MB2(0x96A4), + MB2(0x9462), MB2(0x9BE0), 0x0000, MB2(0x8D4A), + 0x0000, 0x0000, 0x0000, MB2(0x8AAA), + 0x0000, MB2(0x9246), MB2(0x8BD0), 0x0000, + 0x0000, 0x0000, MB2(0x8E73), MB2(0x957A), /* 5E00 */ + 0x0000, 0x0000, MB2(0x94BF), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x9BE1), + MB2(0x8AF3), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x9BE4), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x929F), 0x0000, + 0x0000, MB2(0x9BE3), MB2(0x9BE2), MB2(0x9BE5), + 0x0000, MB2(0x92E9), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 5E20 */ + 0x0000, MB2(0x9083), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x8E74), + 0x0000, MB2(0x90C8), 0x0000, MB2(0x91D1), + MB2(0x8B41), 0x0000, 0x0000, MB2(0x92A0), + 0x0000, 0x0000, MB2(0x9BE6), MB2(0x9BE7), + MB2(0x8FED), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x9658), 0x0000, 0x0000, + MB2(0x9BEA), 0x0000, 0x0000, MB2(0x9BE9), /* 5E40 */ + MB2(0x9BE8), MB2(0x959D), 0x0000, MB2(0x9BF1), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9679), 0x0000, MB2(0x9BEB), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9BED), MB2(0x968B), 0x0000, MB2(0x9BEC), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x9BEE), + 0x0000, MB2(0x94A6), MB2(0x9BEF), MB2(0x95BC), /* 5E60 */ + MB2(0x9BF0), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x8AB1), MB2(0x95BD), + MB2(0x944E), MB2(0x9BF2), MB2(0x9BF3), 0x0000, + MB2(0x8D4B), MB2(0x8AB2), MB2(0x9BF4), MB2(0x8CB6), + MB2(0x9763), MB2(0x9748), MB2(0x8AF4), MB2(0x9BF6), + 0x0000, MB2(0x92A1), 0x0000, MB2(0x8D4C), /* 5E80 */ + MB2(0x8FAF), 0x0000, 0x0000, MB2(0x94DD), + 0x0000, 0x0000, MB2(0x8FB0), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x8F98), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x92EA), MB2(0x95F7), MB2(0x9358), + 0x0000, 0x0000, MB2(0x8D4D), 0x0000, + MB2(0x957B), 0x0000, 0x0000, 0x0000, + MB2(0x9BF7), 0x0000, 0x0000, 0x0000, /* 5EA0 */ + 0x0000, 0x0000, MB2(0x9378), MB2(0x8DC0), + 0x0000, 0x0000, 0x0000, MB2(0x8CC9), + 0x0000, MB2(0x92EB), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x88C1), MB2(0x8F8E), MB2(0x8D4E), + MB2(0x9766), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x9BF8), MB2(0x9BF9), MB2(0x9470), /* 5EC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9BFA), MB2(0x97F5), MB2(0x984C), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x9BFC), + MB2(0x9BFB), 0x0000, 0x0000, MB2(0x8A66), + 0x0000, 0x0000, MB2(0x9C40), 0x0000, + 0x0000, 0x0000, MB2(0x9C43), MB2(0x9C44), + 0x0000, MB2(0x9C42), 0x0000, MB2(0x955F), + MB2(0x8FB1), MB2(0x9C46), MB2(0x9C45), MB2(0x9C41), /* 5EE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9C47), MB2(0x9C48), 0x0000, 0x0000, + MB2(0x9C49), 0x0000, 0x0000, 0x0000, + MB2(0x9C4C), MB2(0x9C4A), 0x0000, MB2(0x9C4B), + MB2(0x9C4D), 0x0000, MB2(0x8984), MB2(0x92EC), + MB2(0x9C4E), 0x0000, MB2(0x8C9A), MB2(0x89F4), + MB2(0x9455), 0x0000, MB2(0x9C4F), MB2(0x93F9), + 0x0000, MB2(0x95D9), 0x0000, MB2(0x9C50), /* 5F00 */ + MB2(0x984D), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x9C51), MB2(0x95BE), MB2(0x9C54), + MB2(0x989F), MB2(0x98AF), 0x0000, MB2(0x8EAE), + MB2(0x93F3), MB2(0x9C55), 0x0000, MB2(0x8B7C), + MB2(0x92A2), MB2(0x88F8), MB2(0x9C56), MB2(0x95A4), + MB2(0x8D4F), 0x0000, 0x0000, MB2(0x926F), + 0x0000, 0x0000, 0x0000, MB2(0x92ED), + 0x0000, MB2(0xFAB7), 0x0000, 0x0000, /* 5F20 */ + 0x0000, MB2(0x96ED), MB2(0x8CB7), MB2(0x8CCA), + 0x0000, MB2(0x9C57), 0x0000, 0x0000, + 0x0000, MB2(0x9C58), 0x0000, MB2(0x9C5E), + 0x0000, MB2(0x8EE3), 0x0000, 0x0000, + MB2(0xFAB8), MB2(0x92A3), 0x0000, MB2(0x8BAD), + MB2(0x9C59), 0x0000, 0x0000, 0x0000, + MB2(0x954A), 0x0000, MB2(0x9265), 0x0000, + 0x0000, MB2(0x9C5A), 0x0000, 0x0000, /* 5F40 */ + 0x0000, MB2(0xFA67), 0x0000, 0x0000, + MB2(0x9C5B), 0x0000, MB2(0x8BAE), 0x0000, + MB2(0x9C5C), 0x0000, MB2(0x9C5D), 0x0000, + 0x0000, MB2(0x9C5F), 0x0000, MB2(0x9396), + 0x0000, 0x0000, MB2(0x9C60), MB2(0x9C61), + 0x0000, MB2(0x9C62), 0x0000, 0x0000, + MB2(0x9C53), MB2(0x9C52), 0x0000, 0x0000, + 0x0000, MB2(0x9C63), MB2(0x8C60), 0x0000, /* 5F60 */ + 0x0000, 0x0000, MB2(0x9546), MB2(0xFAB9), + 0x0000, MB2(0x8DCA), MB2(0x9556), MB2(0x92A4), + MB2(0x956A), MB2(0x9C64), 0x0000, 0x0000, + MB2(0x8FB2), MB2(0x8965), 0x0000, MB2(0x9C65), + 0x0000, 0x0000, 0x0000, MB2(0x9C66), + 0x0000, MB2(0x96F0), 0x0000, 0x0000, + MB2(0x94DE), 0x0000, 0x0000, MB2(0x9C69), + MB2(0x899D), MB2(0x90AA), MB2(0x9C68), MB2(0x9C67), /* 5F80 */ + MB2(0x8C61), MB2(0x91D2), 0x0000, MB2(0x9C6D), + MB2(0x9C6B), 0x0000, MB2(0x9C6A), MB2(0x97A5), + MB2(0x8CE3), 0x0000, 0x0000, 0x0000, + MB2(0x8F99), MB2(0x9C6C), MB2(0x936B), MB2(0x8F5D), + 0x0000, 0x0000, 0x0000, MB2(0x93BE), + MB2(0x9C70), MB2(0x9C6F), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9C6E), 0x0000, + MB2(0x9C71), MB2(0x8CE4), 0x0000, 0x0000, /* 5FA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9C72), MB2(0x959C), MB2(0x8F7A), 0x0000, + 0x0000, MB2(0x9C73), MB2(0x94F7), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x93BF), + MB2(0x92A5), 0x0000, 0x0000, MB2(0xFABA), + 0x0000, MB2(0x934F), 0x0000, 0x0000, + MB2(0x9C74), MB2(0x8B4A), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x9053), /* 5FC0 */ + 0x0000, MB2(0x954B), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x8AF5), MB2(0x9445), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9C75), MB2(0x8E75), + MB2(0x9659), MB2(0x965A), 0x0000, 0x0000, + MB2(0x899E), MB2(0x9C7A), MB2(0xFABB), 0x0000, + MB2(0x9289), 0x0000, 0x0000, 0x0000, /* 5FE0 */ + MB2(0x9C77), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x89F5), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9CAB), MB2(0x9C79), 0x0000, 0x0000, + 0x0000, MB2(0x944F), 0x0000, 0x0000, + MB2(0x9C78), 0x0000, 0x0000, MB2(0x9C76), + 0x0000, MB2(0x8D9A), 0x0000, MB2(0x9C7C), + 0x0000, 0x0000, 0x0000, 0x0000, /* 6000 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9C83), MB2(0x9C89), + MB2(0x9C81), 0x0000, MB2(0x937B), 0x0000, + 0x0000, MB2(0x9C86), MB2(0x957C), 0x0000, + 0x0000, MB2(0x9C80), 0x0000, MB2(0x9C85), + MB2(0x97E5), MB2(0x8E76), 0x0000, 0x0000, + MB2(0x91D3), MB2(0x9C7D), 0x0000, 0x0000, /* 6020 */ + 0x0000, MB2(0x8B7D), MB2(0x9C88), MB2(0x90AB), + MB2(0x8985), MB2(0x9C82), MB2(0x89F6), MB2(0x9C87), + 0x0000, 0x0000, 0x0000, MB2(0x8BAF), + 0x0000, MB2(0x9C84), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9C8A), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x9C8C), MB2(0x9C96), MB2(0x9C94), /* 6040 */ + 0x0000, 0x0000, MB2(0x9C91), 0x0000, + 0x0000, 0x0000, MB2(0x9C90), MB2(0x97F6), + 0x0000, MB2(0x9C92), 0x0000, 0x0000, + MB2(0x8BB0), 0x0000, MB2(0x8D50), 0x0000, + 0x0000, MB2(0x8F9A), 0x0000, 0x0000, + 0x0000, MB2(0x9C99), MB2(0x9C8B), 0x0000, + 0x0000, MB2(0xFABC), 0x0000, MB2(0x9C8F), + MB2(0x9C7E), 0x0000, MB2(0x89F8), MB2(0x9C93), /* 6060 */ + MB2(0x9C95), MB2(0x9270), 0x0000, 0x0000, + MB2(0x8DA6), MB2(0x89B6), MB2(0x9C8D), MB2(0x9C98), + MB2(0x9C97), MB2(0x8BB1), 0x0000, MB2(0x91A7), + MB2(0x8A86), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x8C62), 0x0000, MB2(0x9C8E), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x9C9A), 0x0000, MB2(0x9C9D), /* 6080 */ + MB2(0x9C9F), MB2(0xFABD), 0x0000, 0x0000, + 0x0000, MB2(0x8EBB), MB2(0xFABE), MB2(0x9CA5), + MB2(0x92EE), MB2(0x9C9B), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9CA3), 0x0000, + MB2(0x89F7), 0x0000, MB2(0x9CA1), MB2(0x9CA2), + 0x0000, 0x0000, MB2(0x9C9E), MB2(0x9CA0), + 0x0000, 0x0000, 0x0000, MB2(0x8CE5), + MB2(0x9749), 0x0000, 0x0000, MB2(0x8AB3), /* 60A0 */ + 0x0000, 0x0000, MB2(0x8978), MB2(0x9CA4), + 0x0000, MB2(0x9459), MB2(0x88AB), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x94DF), MB2(0x9C7B), + MB2(0x9CAA), MB2(0x9CAE), MB2(0x96E3), 0x0000, + MB2(0x9CA7), 0x0000, 0x0000, 0x0000, + MB2(0x9389), MB2(0x9CAC), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 60C0 */ + 0x0000, MB2(0x8FEE), MB2(0x9CAD), MB2(0x93D5), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x9866), 0x0000, MB2(0x9CA9), + 0x0000, MB2(0xFAC0), 0x0000, 0x0000, + MB2(0x9CAF), 0x0000, MB2(0x8D9B), 0x0000, + MB2(0x90C9), 0x0000, MB2(0xFABF), MB2(0x88D2), + MB2(0x9CA8), MB2(0x9CA6), 0x0000, MB2(0x9179), /* 60E0 */ + 0x0000, 0x0000, 0x0000, MB2(0x9C9C), + MB2(0x8E53), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x91C4), MB2(0x9CBB), MB2(0xFAC2), MB2(0x917A), + MB2(0x9CB6), 0x0000, MB2(0x9CB3), MB2(0x9CB4), + 0x0000, MB2(0x8EE4), MB2(0x9CB7), MB2(0x9CBA), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9CB5), MB2(0x8F44), 0x0000, MB2(0x9CB8), /* 6100 */ + 0x0000, 0x0000, MB2(0x9CB2), 0x0000, + MB2(0x96FA), MB2(0x96F9), 0x0000, 0x0000, + 0x0000, MB2(0x9CBC), MB2(0x9CBD), MB2(0x88D3), + 0x0000, MB2(0xFAC3), 0x0000, 0x0000, + 0x0000, MB2(0x9CB1), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x8BF0), MB2(0x88A4), + 0x0000, 0x0000, 0x0000, MB2(0x8AB4), + MB2(0xFAC1), MB2(0x9CB9), 0x0000, 0x0000, /* 6120 */ + 0x0000, 0x0000, 0x0000, MB2(0x9CC1), + MB2(0x9CC0), 0x0000, 0x0000, 0x0000, + MB2(0x9CC5), 0x0000, 0x0000, 0x0000, + MB2(0xFAC5), 0x0000, 0x0000, 0x0000, + MB2(0x9CC6), 0x0000, 0x0000, MB2(0xFAC4), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9CC4), MB2(0x9CC7), MB2(0x9CBF), MB2(0x9CC3), + 0x0000, 0x0000, MB2(0x9CC8), 0x0000, /* 6140 */ + MB2(0x9CC9), 0x0000, 0x0000, MB2(0x9CBE), + MB2(0x8E9C), 0x0000, MB2(0x9CC2), MB2(0x91D4), + MB2(0x8D51), MB2(0x9CB0), MB2(0x9054), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x9CD6), + 0x0000, MB2(0x95E7), 0x0000, 0x0000, + MB2(0x9CCC), MB2(0x9CCD), MB2(0x9CCE), 0x0000, + 0x0000, MB2(0x9CD5), 0x0000, MB2(0x9CD4), + 0x0000, 0x0000, MB2(0x969D), MB2(0x8AB5), /* 6160 */ + 0x0000, MB2(0x9CD2), 0x0000, MB2(0x8C64), + MB2(0x8A53), 0x0000, 0x0000, MB2(0x9CCF), + 0x0000, 0x0000, MB2(0x97B6), MB2(0x9CD1), + MB2(0x88D4), MB2(0x9CD3), 0x0000, MB2(0x9CCA), + MB2(0x9CD0), MB2(0x9CD7), MB2(0x8C63), MB2(0x9CCB), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x977C), 0x0000, + 0x0000, 0x0000, MB2(0x974A), 0x0000, /* 6180 */ + 0x0000, 0x0000, 0x0000, MB2(0x9CDA), + 0x0000, 0x0000, MB2(0x9CDE), 0x0000, + 0x0000, 0x0000, MB2(0x919E), 0x0000, + MB2(0x97F7), MB2(0x9CDF), 0x0000, 0x0000, + MB2(0x9CDC), 0x0000, MB2(0x9CD9), 0x0000, + MB2(0xFAC6), MB2(0x9CD8), MB2(0x9CDD), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 61A0 */ + MB2(0x95AE), 0x0000, 0x0000, MB2(0x93B2), + 0x0000, MB2(0x8C65), 0x0000, MB2(0x9CE0), + MB2(0x9CDB), 0x0000, MB2(0x9CE1), 0x0000, + 0x0000, 0x0000, MB2(0x8C9B), 0x0000, + 0x0000, 0x0000, MB2(0x89AF), 0x0000, + 0x0000, 0x0000, MB2(0x9CE9), 0x0000, + 0x0000, 0x0000, MB2(0x8AB6), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x9CE7), /* 61C0 */ + 0x0000, 0x0000, MB2(0x9CE8), MB2(0x8DA7), + MB2(0x9CE6), MB2(0x9CE4), MB2(0x9CE3), MB2(0x9CEA), + MB2(0x9CE2), MB2(0x9CEC), 0x0000, 0x0000, + MB2(0x89F9), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x9CEE), /* 61E0 */ + 0x0000, 0x0000, MB2(0x9CED), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x92A6), 0x0000, + MB2(0x9CF1), 0x0000, MB2(0x9CEF), MB2(0x9CE5), + MB2(0x8C9C), 0x0000, MB2(0x9CF0), 0x0000, + MB2(0x9CF4), MB2(0x9CF3), MB2(0x9CF5), MB2(0x9CF2), + MB2(0x9CF6), 0x0000, 0x0000, 0x0000, /* 6200 */ + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9CF7), MB2(0x9CF8), MB2(0x95E8), 0x0000, + MB2(0x9CFA), MB2(0x9CF9), MB2(0x8F5E), 0x0000, + MB2(0x90AC), MB2(0x89E4), MB2(0x89FA), MB2(0xFAC7), + MB2(0x9CFB), 0x0000, MB2(0x88BD), 0x0000, + 0x0000, 0x0000, MB2(0x90CA), MB2(0x9CFC), + 0x0000, MB2(0xE6C1), MB2(0x9D40), MB2(0x8C81), + 0x0000, MB2(0x9D41), 0x0000, 0x0000, /* 6220 */ + 0x0000, 0x0000, MB2(0x90ED), 0x0000, + 0x0000, 0x0000, MB2(0x9D42), 0x0000, + 0x0000, 0x0000, MB2(0x9D43), MB2(0x8B59), + MB2(0x9D44), 0x0000, MB2(0x9D45), MB2(0x9D46), + MB2(0x91D5), 0x0000, 0x0000, 0x0000, + MB2(0x8CCB), 0x0000, 0x0000, MB2(0x96DF), + 0x0000, 0x0000, 0x0000, MB2(0x965B), + MB2(0x8F8A), MB2(0x9D47), 0x0000, 0x0000, /* 6240 */ + 0x0000, 0x0000, 0x0000, MB2(0x90EE), + MB2(0xE7BB), MB2(0x94E0), 0x0000, MB2(0x8EE8), + 0x0000, MB2(0x8DCB), MB2(0x9D48), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x91C5), + 0x0000, MB2(0x95A5), 0x0000, 0x0000, + MB2(0x91EF), 0x0000, 0x0000, MB2(0x9D4B), + 0x0000, 0x0000, MB2(0x9D49), 0x0000, + MB2(0x9D4C), 0x0000, 0x0000, MB2(0x9D4A), /* 6260 */ + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9D4D), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x95AF), 0x0000, + 0x0000, MB2(0x88B5), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x957D), 0x0000, + 0x0000, MB2(0x94E1), 0x0000, 0x0000, + MB2(0x9D4E), 0x0000, MB2(0x9D51), MB2(0x8FB3), + MB2(0x8B5A), 0x0000, MB2(0x9D4F), MB2(0x9D56), /* 6280 */ + MB2(0x8FB4), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x9D50), MB2(0x9463), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x977D), MB2(0x9D52), MB2(0x9D53), + MB2(0x9D57), MB2(0x938A), MB2(0x9D54), MB2(0x8D52), + MB2(0x90DC), 0x0000, 0x0000, MB2(0x9D65), + MB2(0x94B2), 0x0000, MB2(0x91F0), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 62A0 */ + 0x0000, 0x0000, MB2(0xFAC8), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x94E2), + MB2(0x9DAB), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x95F8), 0x0000, 0x0000, + 0x0000, MB2(0x92EF), 0x0000, 0x0000, + 0x0000, MB2(0x9695), 0x0000, MB2(0x9D5A), + MB2(0x899F), MB2(0x928A), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9D63), 0x0000, /* 62C0 */ + 0x0000, MB2(0x9253), MB2(0x9D5D), MB2(0x9D64), + MB2(0x9D5F), MB2(0x9D66), MB2(0x9D62), 0x0000, + MB2(0x9D61), MB2(0x948F), 0x0000, MB2(0x9D5B), + MB2(0x89FB), MB2(0x9D59), MB2(0x8B91), MB2(0x91F1), + MB2(0x9D55), 0x0000, 0x0000, MB2(0x9D58), + MB2(0x8D53), MB2(0x90D9), 0x0000, MB2(0x8FB5), + MB2(0x9D60), MB2(0x9471), 0x0000, 0x0000, + MB2(0x8B92), MB2(0x8A67), 0x0000, 0x0000, /* 62E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x8A87), MB2(0x9040), MB2(0x9D68), MB2(0x9D6D), + 0x0000, MB2(0x9D69), 0x0000, MB2(0x8C9D), + 0x0000, MB2(0x9D6E), MB2(0x8E41), MB2(0x8D89), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x8F45), MB2(0x9D5C), + 0x0000, MB2(0x8E9D), MB2(0x9D6B), 0x0000, /* 6300 */ + 0x0000, 0x0000, 0x0000, MB2(0x8E77), + MB2(0x9D6C), MB2(0x88C2), 0x0000, 0x0000, + MB2(0x9D67), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x92A7), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x8B93), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x8BB2), + 0x0000, 0x0000, 0x0000, 0x0000, /* 6320 */ + 0x0000, 0x0000, 0x0000, MB2(0x9D6A), + MB2(0x88A5), 0x0000, 0x0000, MB2(0x8DC1), + 0x0000, 0x0000, 0x0000, MB2(0x9055), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x92F0), 0x0000, + 0x0000, MB2(0x94D2), MB2(0x9D70), MB2(0x917D), + 0x0000, 0x0000, 0x0000, 0x0000, /* 6340 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x91A8), 0x0000, 0x0000, + MB2(0x8E4A), MB2(0x9D71), 0x0000, MB2(0x9D73), + MB2(0x9D6F), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x95DF), 0x0000, MB2(0x92BB), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x917B), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6360 */ + 0x0000, 0x0000, 0x0000, MB2(0x95F9), + MB2(0x8ECC), MB2(0x9D80), 0x0000, MB2(0x9D7E), + 0x0000, 0x0000, MB2(0x9098), 0x0000, + 0x0000, 0x0000, MB2(0x8C9E), 0x0000, + 0x0000, 0x0000, MB2(0x9D78), MB2(0x8FB7), + 0x0000, 0x0000, MB2(0x93E6), MB2(0x9450), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9D76), 0x0000, 0x0000, MB2(0x917C), /* 6380 */ + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x8EF6), MB2(0x9D7B), 0x0000, 0x0000, + MB2(0x8FB6), 0x0000, MB2(0x9D75), MB2(0x9D7A), + 0x0000, 0x0000, MB2(0x9472), 0x0000, + 0x0000, 0x0000, MB2(0x9D74), 0x0000, + MB2(0x8C40), 0x0000, 0x0000, MB2(0x8A7C), + 0x0000, 0x0000, 0x0000, MB2(0x9D7C), + MB2(0x97A9), MB2(0x8DCC), MB2(0x9254), MB2(0x9D79), /* 63A0 */ + 0x0000, MB2(0x90DA), 0x0000, MB2(0x8D54), + MB2(0x9084), MB2(0x8986), MB2(0x915B), MB2(0x9D77), + MB2(0x8B64), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x8C66), 0x0000, + MB2(0x92CD), MB2(0x9D7D), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x917E), + 0x0000, 0x0000, MB2(0x9D81), 0x0000, + MB2(0x9D83), 0x0000, 0x0000, MB2(0x91B5), /* 63C0 */ + MB2(0x9D89), 0x0000, MB2(0x9D84), 0x0000, + 0x0000, MB2(0x9D86), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x9560), + MB2(0x92F1), 0x0000, MB2(0x9D87), 0x0000, + 0x0000, 0x0000, MB2(0x974B), 0x0000, + 0x0000, 0x0000, MB2(0x9767), MB2(0x8AB7), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x88AC), 0x0000, MB2(0x9D85), /* 63E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x9D82), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x8AF6), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x8987), MB2(0xFAC9), MB2(0x9D88), 0x0000, + 0x0000, 0x0000, MB2(0x9768), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6400 */ + 0x0000, 0x0000, MB2(0x9D8C), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x91B9), 0x0000, MB2(0x9D93), + 0x0000, 0x0000, 0x0000, MB2(0x9D8D), + 0x0000, 0x0000, MB2(0x9D8A), MB2(0x9D91), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9D72), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6420 */ + 0x0000, 0x0000, MB2(0x9D8E), 0x0000, + MB2(0x9D92), 0x0000, 0x0000, 0x0000, + MB2(0x94C0), MB2(0x938B), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9D8B), 0x0000, MB2(0x9D8F), 0x0000, + 0x0000, 0x0000, MB2(0x8C67), 0x0000, + 0x0000, 0x0000, MB2(0x8DEF), 0x0000, + 0x0000, 0x0000, MB2(0x90DB), 0x0000, /* 6440 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9D97), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9345), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xFACA), 0x0000, 0x0000, 0x0000, /* 6460 */ + 0x0000, 0x0000, 0x0000, MB2(0x9D94), + 0x0000, MB2(0x9680), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x9D95), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9D96), 0x0000, + MB2(0x96CC), 0x0000, MB2(0x90A0), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x8C82), /* 6480 */ + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9D9D), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x8E54), MB2(0x9D9A), + 0x0000, MB2(0x9D99), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9451), 0x0000, + 0x0000, MB2(0xFACB), MB2(0x93B3), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 64A0 */ + MB2(0x9350), MB2(0x9D9B), 0x0000, 0x0000, + 0x0000, MB2(0x9D9C), 0x0000, MB2(0x958F), + 0x0000, MB2(0x9464), MB2(0x8E42), 0x0000, + MB2(0x90EF), 0x0000, MB2(0x966F), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x8A68), 0x0000, MB2(0x9DA3), + MB2(0x9D9E), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x9769), MB2(0x9DA5), 0x0000, /* 64C0 */ + 0x0000, MB2(0x9DA1), 0x0000, MB2(0x9DA2), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x9180), MB2(0xFACC), 0x0000, + 0x0000, 0x0000, MB2(0x9DA0), 0x0000, + MB2(0x9D5E), 0x0000, 0x0000, 0x0000, + MB2(0x9DA4), 0x0000, MB2(0x9D9F), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9DA9), MB2(0x9DAA), MB2(0x9346), MB2(0x9DAC), /* 64E0 */ + 0x0000, 0x0000, MB2(0x8E43), MB2(0x9DA7), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x8B5B), 0x0000, 0x0000, MB2(0x9DAD), + 0x0000, MB2(0x9DA6), MB2(0x9DB1), 0x0000, + MB2(0x9DB0), 0x0000, MB2(0x9DAF), 0x0000, + 0x0000, 0x0000, MB2(0x9DB2), 0x0000, + 0x0000, MB2(0x9DB4), MB2(0x8FEF), 0x0000, + MB2(0x9DB3), 0x0000, 0x0000, 0x0000, /* 6500 */ + 0x0000, MB2(0x9DB7), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9DB5), 0x0000, 0x0000, 0x0000, + MB2(0x9DB6), MB2(0x9D90), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x9DB9), /* 6520 */ + MB2(0x9DB8), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9D98), MB2(0x9DBA), + MB2(0x9DAE), 0x0000, 0x0000, MB2(0x8E78), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9DBB), MB2(0x9DBC), MB2(0x9DBE), MB2(0x9DBD), + MB2(0x9DBF), MB2(0x89FC), 0x0000, MB2(0x8D55), + 0x0000, 0x0000, MB2(0x95FA), MB2(0x90AD), + 0x0000, 0x0000, 0x0000, 0x0000, /* 6540 */ + 0x0000, MB2(0x8CCC), 0x0000, 0x0000, + MB2(0x9DC1), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x9DC4), MB2(0xFACD), MB2(0x9571), + 0x0000, MB2(0x8B7E), 0x0000, 0x0000, + 0x0000, MB2(0x9DC3), MB2(0x9DC2), MB2(0x9473), + MB2(0x9DC5), MB2(0x8BB3), 0x0000, 0x0000, + 0x0000, MB2(0x9DC7), MB2(0x9DC6), 0x0000, + 0x0000, 0x0000, MB2(0x8AB8), MB2(0x8E55), /* 6560 */ + 0x0000, 0x0000, MB2(0x93D6), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x8C68), 0x0000, 0x0000, 0x0000, + MB2(0x9094), 0x0000, MB2(0x9DC8), 0x0000, + MB2(0x90AE), MB2(0x9347), 0x0000, MB2(0x957E), + MB2(0x9DC9), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9DCA), MB2(0x9DCB), /* 6580 */ + 0x0000, 0x0000, 0x0000, MB2(0x95B6), + MB2(0x9B7C), MB2(0x90C4), 0x0000, 0x0000, + MB2(0x956B), 0x0000, MB2(0x8DD6), 0x0000, + MB2(0x94E3), MB2(0x94C1), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x936C), + 0x0000, MB2(0x97BF), 0x0000, MB2(0x9DCD), + MB2(0x8ECE), 0x0000, 0x0000, MB2(0x9DCE), + 0x0000, MB2(0x88B4), 0x0000, 0x0000, /* 65A0 */ + MB2(0x8BD2), MB2(0x90CB), 0x0000, MB2(0x9580), + 0x0000, 0x0000, 0x0000, MB2(0x9DCF), + MB2(0x8E61), MB2(0x9266), 0x0000, MB2(0x8E7A), + MB2(0x9056), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x9DD0), + 0x0000, MB2(0x95FB), 0x0000, 0x0000, + MB2(0x8997), MB2(0x8E7B), 0x0000, 0x0000, + 0x0000, MB2(0x9DD3), 0x0000, MB2(0x9DD1), /* 65C0 */ + MB2(0x9DD4), MB2(0x97B7), MB2(0x9DD2), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x90F9), + MB2(0x9DD5), 0x0000, 0x0000, MB2(0x91B0), + 0x0000, 0x0000, MB2(0x9DD6), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x8AF8), + 0x0000, MB2(0x9DD8), 0x0000, MB2(0x9DD7), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9DD9), MB2(0x9DDA), MB2(0x8AF9), 0x0000, /* 65E0 */ + 0x0000, MB2(0x93FA), MB2(0x9255), MB2(0x8B8C), + MB2(0x8E7C), MB2(0x9181), 0x0000, 0x0000, + MB2(0x8F7B), MB2(0x88AE), 0x0000, 0x0000, + 0x0000, MB2(0x9DDB), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x89A0), MB2(0x9DDF), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xFACE), 0x0000, MB2(0x8D56), MB2(0x9DDE), /* 6600 */ + 0x0000, 0x0000, MB2(0x8DA9), MB2(0x8FB8), + 0x0000, MB2(0xFAD1), MB2(0x9DDD), 0x0000, + MB2(0x8FB9), 0x0000, MB2(0x96BE), MB2(0x8DA8), + 0x0000, 0x0000, 0x0000, MB2(0x88D5), + MB2(0x90CC), MB2(0xFACF), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9DE4), 0x0000, MB2(0xFAD3), MB2(0x90AF), + MB2(0x8966), 0x0000, 0x0000, 0x0000, /* 6620 */ + MB2(0xFAD4), MB2(0x8F74), 0x0000, MB2(0x9686), + MB2(0x8DF0), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x8FBA), MB2(0xFAD2), MB2(0x90A5), + 0x0000, MB2(0xFA63), 0x0000, 0x0000, + MB2(0x9DE3), MB2(0x9DE1), MB2(0x9DE2), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xFAD0), + MB2(0x928B), 0x0000, 0x0000, MB2(0x9E45), + 0x0000, MB2(0x9DE8), MB2(0x8E9E), MB2(0x8D57), /* 6640 */ + MB2(0x9DE6), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x9DE7), 0x0000, MB2(0x9057), + 0x0000, 0x0000, 0x0000, MB2(0x9DE5), + 0x0000, 0x0000, MB2(0x8E4E), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xFAD6), + 0x0000, MB2(0xFAD7), 0x0000, 0x0000, + 0x0000, MB2(0x9DEA), MB2(0x9DE9), MB2(0x9DEE), + 0x0000, MB2(0xFAD7), MB2(0x9DEF), 0x0000, /* 6660 */ + MB2(0x9DEB), MB2(0xFAD5), MB2(0x8A41), MB2(0x9DEC), + MB2(0x9DED), MB2(0x94D3), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9581), MB2(0x8C69), + MB2(0x9DF0), 0x0000, 0x0000, MB2(0xFAD9), + MB2(0x90B0), 0x0000, MB2(0x8FBB), 0x0000, + 0x0000, 0x0000, MB2(0x9271), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x8BC5), 0x0000, MB2(0x9DF1), /* 6680 */ + MB2(0x9DF5), 0x0000, 0x0000, MB2(0x89C9), + MB2(0x9DF2), MB2(0x9DF4), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9DF3), 0x0000, + 0x0000, MB2(0x8F8B), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9267), MB2(0x88C3), + MB2(0x9DF6), MB2(0xFADA), 0x0000, 0x0000, + 0x0000, MB2(0x9DF7), 0x0000, 0x0000, + MB2(0xFADB), 0x0000, MB2(0x92A8), 0x0000, /* 66A0 */ + 0x0000, 0x0000, MB2(0x97EF), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x8E62), + 0x0000, 0x0000, MB2(0x95E9), 0x0000, + 0x0000, 0x0000, MB2(0xFADC), 0x0000, + MB2(0x965C), 0x0000, 0x0000, 0x0000, + MB2(0x9E41), MB2(0x9DF9), 0x0000, 0x0000, + MB2(0x9DFC), 0x0000, MB2(0x9DFB), MB2(0xFADD), + 0x0000, MB2(0x9DF8), 0x0000, 0x0000, /* 66C0 */ + MB2(0x9E40), 0x0000, 0x0000, MB2(0x93DC), + 0x0000, MB2(0x9DFA), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9E42), 0x0000, + 0x0000, MB2(0x8F8C), MB2(0x9E43), 0x0000, + MB2(0x976A), MB2(0x9498), 0x0000, 0x0000, + MB2(0x9E44), 0x0000, 0x0000, 0x0000, /* 66E0 */ + 0x0000, 0x0000, MB2(0x9E46), 0x0000, + 0x0000, MB2(0x9E47), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9E48), 0x0000, MB2(0x8BC8), MB2(0x8967), + MB2(0x8D58), MB2(0x9E49), 0x0000, MB2(0x9E4A), + MB2(0x8F91), MB2(0x9182), MB2(0xFADE), MB2(0xFA66), + MB2(0x99D6), MB2(0x915D), MB2(0x915C), MB2(0x91D6), + MB2(0x8DC5), 0x0000, 0x0000, MB2(0x98F0), /* 6700 */ + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x8C8E), MB2(0x974C), 0x0000, MB2(0x95FC), + 0x0000, MB2(0x959E), MB2(0xFADF), MB2(0x9E4B), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x8DF1), MB2(0x92BD), MB2(0x9E4C), MB2(0x984E), + 0x0000, 0x0000, 0x0000, MB2(0x965D), + 0x0000, MB2(0x92A9), MB2(0x9E4D), MB2(0x8AFA), + 0x0000, 0x0000, 0x0000, 0x0000, /* 6720 */ + 0x0000, 0x0000, MB2(0x9E4E), MB2(0x9E4F), + MB2(0x96D8), 0x0000, MB2(0x96A2), MB2(0x9696), + MB2(0x967B), MB2(0x8E44), MB2(0x9E51), 0x0000, + 0x0000, MB2(0x8EE9), 0x0000, 0x0000, + MB2(0x9670), 0x0000, MB2(0x9E53), MB2(0x9E56), + MB2(0x9E55), 0x0000, MB2(0x8AF7), 0x0000, + 0x0000, MB2(0x8B80), 0x0000, MB2(0x9E52), + 0x0000, MB2(0x9E54), 0x0000, 0x0000, /* 6740 */ + 0x0000, 0x0000, MB2(0x9E57), 0x0000, + 0x0000, MB2(0x9099), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x979B), MB2(0x88C7), + MB2(0x8DDE), MB2(0x91BA), 0x0000, MB2(0x8EDB), + 0x0000, 0x0000, MB2(0x8FF1), 0x0000, + 0x0000, MB2(0x9E5A), 0x0000, 0x0000, + MB2(0x936D), 0x0000, MB2(0x9E58), MB2(0x91A9), + MB2(0x9E59), MB2(0x8FF0), MB2(0x96DB), MB2(0x9E5B), /* 6760 */ + MB2(0x9E5C), MB2(0x9788), MB2(0xFAE1), 0x0000, + 0x0000, 0x0000, MB2(0x9E61), 0x0000, + 0x0000, MB2(0x8D59), 0x0000, MB2(0x9474), + MB2(0x9E5E), MB2(0x938C), MB2(0x9DDC), MB2(0x9DE0), + 0x0000, MB2(0x8B6E), 0x0000, MB2(0x9466), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9E60), 0x0000, MB2(0x8FBC), MB2(0x94C2), + 0x0000, 0x0000, 0x0000, 0x0000, /* 6780 */ + 0x0000, MB2(0x9E66), 0x0000, MB2(0x94F8), + 0x0000, MB2(0x9E5D), 0x0000, MB2(0x9E63), + MB2(0x9E62), 0x0000, 0x0000, 0x0000, + MB2(0x90CD), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x968D), 0x0000, MB2(0x97D1), + 0x0000, 0x0000, MB2(0x9687), 0x0000, + MB2(0x89CA), MB2(0x8E7D), 0x0000, 0x0000, + MB2(0x9867), MB2(0x9E65), MB2(0x9095), 0x0000, /* 67A0 */ + 0x0000, 0x0000, MB2(0x9E64), 0x0000, + 0x0000, MB2(0x9E5F), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x8CCD), + 0x0000, 0x0000, 0x0000, MB2(0x9E6B), + MB2(0x9E69), 0x0000, MB2(0x89CB), MB2(0x9E67), + MB2(0x9E6D), MB2(0x9E73), 0x0000, MB2(0xFAE2), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xFAE4), MB2(0x91C6), 0x0000, 0x0000, /* 67C0 */ + MB2(0x95BF), 0x0000, MB2(0x9E75), 0x0000, + 0x0000, 0x0000, MB2(0x9541), 0x0000, + 0x0000, 0x0000, MB2(0x9E74), MB2(0x9490), + MB2(0x965E), MB2(0x8AB9), 0x0000, MB2(0x90F5), + MB2(0x8F5F), 0x0000, 0x0000, 0x0000, + MB2(0x92D1), 0x0000, MB2(0x974D), 0x0000, + 0x0000, MB2(0x9E70), MB2(0x9E6F), 0x0000, + 0x0000, 0x0000, MB2(0x9E71), 0x0000, /* 67E0 */ + MB2(0x9E6E), 0x0000, 0x0000, MB2(0x9E76), + 0x0000, MB2(0x9E6C), 0x0000, 0x0000, + MB2(0x9E6A), 0x0000, MB2(0x9E72), MB2(0x9E68), + 0x0000, MB2(0x928C), 0x0000, MB2(0x96F6), + MB2(0x8EC4), MB2(0x8DF2), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x8DB8), + 0x0000, 0x0000, MB2(0x968F), MB2(0x8A60), + 0x0000, MB2(0xFAE5), MB2(0x92CC), MB2(0x93C8), /* 6800 */ + MB2(0x8968), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x90F0), + 0x0000, 0x0000, MB2(0x90B2), MB2(0x8C49), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9E78), 0x0000, + 0x0000, MB2(0x8D5A), MB2(0x8A9C), 0x0000, /* 6820 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x9E7A), MB2(0x8A94), MB2(0x9E81), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9E7D), 0x0000, + MB2(0x90F1), 0x0000, 0x0000, 0x0000, + MB2(0x8A6A), MB2(0x8DAA), 0x0000, 0x0000, + MB2(0x8A69), MB2(0x8DCD), 0x0000, 0x0000, + MB2(0x9E7B), MB2(0x8C85), MB2(0x8C6A), MB2(0x938D), /* 6840 */ + MB2(0xFAE6), 0x0000, MB2(0x9E79), 0x0000, + MB2(0x88C4), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x9E7C), MB2(0x9E7E), 0x0000, + MB2(0x8BCB), MB2(0x8C4B), MB2(0xFAE3), MB2(0x8ABA), + MB2(0x8B6A), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x9E82), 0x0000, 0x0000, + MB2(0x8DF7), MB2(0x9691), 0x0000, MB2(0x8E56), + 0x0000, 0x0000, 0x0000, MB2(0x9E83), /* 6860 */ + 0x0000, 0x0000, 0x0000, MB2(0x954F), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9E8F), 0x0000, MB2(0x89B1), MB2(0x9E84), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9E95), MB2(0x9E85), + 0x0000, MB2(0x97C0), 0x0000, MB2(0x9E8C), /* 6880 */ + 0x0000, MB2(0x947E), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x9E94), 0x0000, MB2(0x9E87), + 0x0000, 0x0000, 0x0000, MB2(0x88B2), + MB2(0x9E89), 0x0000, 0x0000, MB2(0x8D5B), + 0x0000, 0x0000, 0x0000, MB2(0x9E8B), + 0x0000, MB2(0x9E8A), 0x0000, MB2(0x9E86), + MB2(0x9E91), 0x0000, MB2(0x8FBD), 0x0000, /* 68A0 */ + 0x0000, 0x0000, MB2(0x9AEB), MB2(0x8CE6), + MB2(0x979C), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x9E88), 0x0000, MB2(0x92F2), + MB2(0x8A42), MB2(0x8DAB), 0x0000, MB2(0x9E80), + 0x0000, MB2(0x9E90), MB2(0x8A81), 0x0000, + 0x0000, MB2(0x9E8E), MB2(0x9E92), 0x0000, + MB2(0x938E), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 68C0 */ + MB2(0x8AFC), 0x0000, MB2(0x9EB0), 0x0000, + MB2(0xFA64), MB2(0x96C7), MB2(0x9E97), MB2(0x8AFB), + 0x0000, MB2(0x9E9E), 0x0000, MB2(0xFAE7), + 0x0000, 0x0000, MB2(0x965F), 0x0000, + MB2(0x9E9F), MB2(0x9EA1), 0x0000, MB2(0x9EA5), + MB2(0x9E99), 0x0000, MB2(0x9249), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x938F), + MB2(0x9EA9), MB2(0x9E9C), 0x0000, MB2(0x9EA6), /* 68E0 */ + 0x0000, 0x0000, 0x0000, MB2(0x9EA0), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9058), MB2(0x9EAA), + 0x0000, 0x0000, MB2(0x90B1), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x9EA8), MB2(0x8ABB), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x986F), MB2(0x9E96), 0x0000, 0x0000, /* 6900 */ + MB2(0x9EA4), MB2(0x88D6), 0x0000, 0x0000, + MB2(0x9E98), 0x0000, 0x0000, MB2(0x96B8), + MB2(0x9E9D), MB2(0x9041), MB2(0x92C5), MB2(0x9E93), + 0x0000, 0x0000, MB2(0x9EA3), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x909A), MB2(0x9EAD), MB2(0x8A91), + MB2(0x8C9F), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x9EAF), MB2(0x9E9A), MB2(0x9EAE), /* 6920 */ + 0x0000, MB2(0x9EA7), MB2(0x9E9B), 0x0000, + MB2(0x9EAB), 0x0000, MB2(0x9EAC), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9EBD), 0x0000, 0x0000, 0x0000, + MB2(0x93CC), 0x0000, MB2(0x9EA2), 0x0000, + 0x0000, MB2(0x9EB9), 0x0000, 0x0000, + 0x0000, MB2(0x9EBB), 0x0000, MB2(0x92D6), + 0x0000, 0x0000, 0x0000, 0x0000, /* 6940 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x976B), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x9596), + MB2(0x9EB6), MB2(0x91C8), 0x0000, 0x0000, + 0x0000, MB2(0x9EBC), MB2(0x915E), 0x0000, + MB2(0x9EB3), MB2(0x9EC0), MB2(0x9EBF), 0x0000, + MB2(0x93ED), MB2(0x9EBE), MB2(0x93E8), 0x0000, /* 6960 */ + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xFAE9), 0x0000, MB2(0x9EC2), MB2(0x9EB5), + 0x0000, MB2(0x8BC6), MB2(0x9EB8), MB2(0x8F7C), + 0x0000, 0x0000, 0x0000, MB2(0x9480), + MB2(0x9EBA), MB2(0x8BC9), 0x0000, MB2(0x9EB2), + MB2(0x9EB4), MB2(0x9EB1), 0x0000, 0x0000, + MB2(0x984F), MB2(0x8A79), MB2(0x9EB7), 0x0000, + 0x0000, MB2(0x9EC1), MB2(0x8A54), 0x0000, /* 6980 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x8DE5), 0x0000, + 0x0000, 0x0000, MB2(0x897C), 0x0000, + 0x0000, MB2(0x9ED2), 0x0000, 0x0000, + MB2(0x9850), MB2(0x9ED5), 0x0000, 0x0000, + MB2(0xFAEB), 0x0000, 0x0000, MB2(0x9059), + MB2(0x9ED4), 0x0000, 0x0000, 0x0000, + MB2(0x9ED3), 0x0000, 0x0000, 0x0000, /* 69A0 */ + 0x0000, 0x0000, 0x0000, MB2(0x9ED0), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9EC4), 0x0000, + 0x0000, MB2(0x9EE1), MB2(0x9EC3), 0x0000, + MB2(0x9ED6), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x9ECE), + 0x0000, 0x0000, MB2(0x9EC9), MB2(0x9EC6), + 0x0000, MB2(0x9EC7), 0x0000, MB2(0x9ECF), /* 69C0 */ + 0x0000, 0x0000, 0x0000, MB2(0xEAA0), + 0x0000, 0x0000, MB2(0x9ECC), MB2(0x8D5C), + MB2(0x92C6), MB2(0x9184), MB2(0x9ECA), 0x0000, + MB2(0x9EC5), 0x0000, 0x0000, MB2(0x9EC8), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x976C), MB2(0x968A), 0x0000, 0x0000, + 0x0000, MB2(0x9ECD), MB2(0x9ED7), 0x0000, + 0x0000, 0x0000, MB2(0xFAEC), 0x0000, /* 69E0 */ + 0x0000, 0x0000, 0x0000, MB2(0x9EDF), + MB2(0x9ED8), 0x0000, 0x0000, MB2(0x9EE5), + 0x0000, MB2(0x9EE3), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9EDE), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x9EDD), 0x0000, MB2(0x92CE), + 0x0000, MB2(0x9185), 0x0000, MB2(0x9EDB), + 0x0000, 0x0000, MB2(0x9ED9), 0x0000, /* 6A00 */ + 0x0000, MB2(0x9EE0), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9EE6), MB2(0x94F3), + MB2(0x9EEC), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9EE7), MB2(0x9EEA), + MB2(0x9EE4), 0x0000, 0x0000, MB2(0x9294), + 0x0000, MB2(0x9557), 0x0000, MB2(0x9EDA), + 0x0000, 0x0000, MB2(0x9EE2), MB2(0x8FBE), + 0x0000, MB2(0x96CD), MB2(0x9EF6), MB2(0x9EE9), /* 6A20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x8CA0), MB2(0x89A1), MB2(0x8A7E), + 0x0000, 0x0000, MB2(0x9ED1), 0x0000, + MB2(0xFAED), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x8FBF), MB2(0x9EEE), 0x0000, + MB2(0x9EF5), MB2(0x8EF7), MB2(0x8A92), 0x0000, + 0x0000, MB2(0x924D), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6A40 */ + MB2(0x9EEB), 0x0000, MB2(0xFAEF), MB2(0x9EF0), + MB2(0x9EF4), 0x0000, 0x0000, MB2(0x8BB4), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x8B6B), MB2(0x9EF2), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x8B40), + 0x0000, MB2(0x93C9), MB2(0x9EF1), 0x0000, /* 6A60 */ + 0x0000, 0x0000, MB2(0x9EF3), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xFAEE), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9EED), MB2(0xFAF0), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9EEF), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xFAF1), MB2(0x8A80), + MB2(0x9268), 0x0000, 0x0000, 0x0000, /* 6A80 */ + MB2(0x9EFA), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x9EF8), MB2(0x8CE7), 0x0000, + MB2(0x9EF7), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x9F40), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9E77), 0x0000, 0x0000, 0x0000, + MB2(0x9EF9), 0x0000, MB2(0x9EFB), MB2(0x9EFC), /* 6AA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9F4B), 0x0000, + MB2(0x9F47), 0x0000, MB2(0x9E8D), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x9F46), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9F45), 0x0000, 0x0000, MB2(0x9F42), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x9EE8), MB2(0x9F44), MB2(0x9F43), /* 6AC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x9F49), 0x0000, MB2(0x9845), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9F4C), MB2(0x8BF9), + 0x0000, 0x0000, MB2(0x9F48), MB2(0x9F4A), + 0x0000, 0x0000, MB2(0xFAF2), 0x0000, /* 6AE0 */ + MB2(0xFAF3), 0x0000, 0x0000, 0x0000, + MB2(0x94A5), 0x0000, MB2(0x9F4D), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9F51), MB2(0x9F4E), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6B00 */ + MB2(0x9793), MB2(0x9F4F), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9EDC), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9F52), 0x0000, + 0x0000, 0x0000, MB2(0x9F53), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x8954), 0x0000, MB2(0x9F55), + MB2(0x8C87), MB2(0x8E9F), 0x0000, MB2(0x8BD3), /* 6B20 */ + 0x0000, 0x0000, 0x0000, MB2(0x89A2), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x977E), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x9F57), + MB2(0x9F56), MB2(0x9F59), MB2(0x8B5C), 0x0000, + 0x0000, MB2(0x8BD4), MB2(0x8ABC), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x9F5C), /* 6B40 */ + 0x0000, 0x0000, 0x0000, MB2(0x9F5B), + 0x0000, MB2(0x9F5D), 0x0000, 0x0000, + MB2(0x89CC), 0x0000, MB2(0x9256), 0x0000, + MB2(0x9F5E), 0x0000, 0x0000, MB2(0x8ABD), + MB2(0x9F60), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x9F5F), 0x0000, MB2(0x9F61), + 0x0000, 0x0000, 0x0000, MB2(0x9F62), + 0x0000, MB2(0x9F63), MB2(0x8E7E), MB2(0x90B3), /* 6B60 */ + MB2(0x8D9F), 0x0000, MB2(0x9590), 0x0000, + 0x0000, MB2(0x95E0), MB2(0x9863), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x8E95), + 0x0000, 0x0000, 0x0000, MB2(0x8DCE), + MB2(0x97F0), 0x0000, 0x0000, 0x0000, + MB2(0x9F64), MB2(0x9F65), 0x0000, MB2(0x8E80), + 0x0000, 0x0000, 0x0000, MB2(0x9F66), + MB2(0x9F67), 0x0000, 0x0000, MB2(0x9F69), /* 6B80 */ + MB2(0x9F68), 0x0000, MB2(0x9677), 0x0000, + 0x0000, MB2(0x8F7D), MB2(0x8EEA), MB2(0x8E63), + 0x0000, MB2(0x9F6A), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x9F6C), MB2(0x9042), 0x0000, + MB2(0x9F6B), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9F6D), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6BA0 */ + MB2(0x9F6E), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9F6F), MB2(0x9F70), + 0x0000, 0x0000, 0x0000, MB2(0x9F71), + 0x0000, MB2(0x9F73), MB2(0x9F72), MB2(0x9F74), + MB2(0x89A3), MB2(0x9269), 0x0000, MB2(0x9F75), + 0x0000, 0x0000, MB2(0x8E45), MB2(0x8A6B), + MB2(0x9F76), 0x0000, 0x0000, MB2(0x9361), + MB2(0x9ACA), 0x0000, 0x0000, 0x0000, /* 6BC0 */ + 0x0000, MB2(0x8B42), MB2(0x9F77), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x9F78), + 0x0000, MB2(0x95EA), MB2(0x9688), 0x0000, + 0x0000, 0x0000, MB2(0x93C5), MB2(0x9F79), + MB2(0x94E4), 0x0000, MB2(0xFAF4), 0x0000, + MB2(0x94F9), 0x0000, 0x0000, MB2(0x96D1), + 0x0000, 0x0000, 0x0000, MB2(0x9F7A), + 0x0000, 0x0000, 0x0000, 0x0000, /* 6BE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x9F7C), + MB2(0x9F7B), 0x0000, 0x0000, MB2(0x9F7E), + 0x0000, 0x0000, 0x0000, MB2(0x9F7D), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6C00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9F81), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x8E81), + 0x0000, MB2(0x96AF), 0x0000, MB2(0x9F82), + MB2(0x9F83), 0x0000, 0x0000, MB2(0x8B43), + 0x0000, 0x0000, 0x0000, MB2(0x9F84), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x9F86), /* 6C20 */ + MB2(0x9F85), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9085), 0x0000, 0x0000, MB2(0x9558), + MB2(0x8969), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x94C3), MB2(0xFAF5), + MB2(0x92F3), MB2(0x8F60), MB2(0x8B81), 0x0000, /* 6C40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x94C4), 0x0000, + MB2(0x8EAC), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x9F88), 0x0000, MB2(0x8ABE), + 0x0000, 0x0000, MB2(0x8998), 0x0000, + MB2(0xFAF6), MB2(0x93F0), MB2(0x9F87), MB2(0x8D5D), + MB2(0x9272), 0x0000, MB2(0x9F89), 0x0000, /* 6C60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9F91), 0x0000, MB2(0x9F8A), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xFAF8), + MB2(0x91BF), 0x0000, MB2(0x8B82), MB2(0x9F92), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x8C88), 0x0000, + 0x0000, MB2(0x8B44), MB2(0x9F90), 0x0000, + 0x0000, MB2(0x9F8E), MB2(0x9F8B), MB2(0x9780), /* 6C80 */ + 0x0000, 0x0000, MB2(0xFAF7), 0x0000, + MB2(0x92BE), 0x0000, 0x0000, 0x0000, + MB2(0x93D7), MB2(0x9F8C), 0x0000, 0x0000, + MB2(0x9F94), 0x0000, MB2(0x9F93), MB2(0x8C42), + 0x0000, 0x0000, MB2(0x89AB), 0x0000, + 0x0000, MB2(0x8DB9), MB2(0x9F8D), MB2(0x9F8F), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x9676), MB2(0x91F2), 0x0000, /* 6CA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x9697), + 0x0000, 0x0000, MB2(0x9F9C), 0x0000, + 0x0000, MB2(0x9F9D), 0x0000, MB2(0x89CD), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x95A6), MB2(0x96FB), MB2(0x9F9F), MB2(0x8EA1), + MB2(0x8FC0), MB2(0x9F98), MB2(0x9F9E), MB2(0x8988), + 0x0000, MB2(0x8BB5), 0x0000, 0x0000, /* 6CC0 */ + MB2(0x9F95), MB2(0x9F9A), 0x0000, 0x0000, + 0x0000, MB2(0x90F2), MB2(0x9491), 0x0000, + MB2(0x94E5), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x9F97), + 0x0000, MB2(0x9640), 0x0000, MB2(0x9F99), + 0x0000, MB2(0x9FA2), MB2(0xFAF9), MB2(0x9FA0), + 0x0000, MB2(0x9F9B), 0x0000, 0x0000, + 0x0000, MB2(0x9641), MB2(0x9467), MB2(0x8B83), /* 6CE0 */ + 0x0000, MB2(0x9344), 0x0000, 0x0000, + MB2(0x928D), 0x0000, MB2(0x9FA3), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x9FA1), + MB2(0x91D7), MB2(0x9F96), 0x0000, MB2(0x896A), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6D00 */ + MB2(0xFAFA), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x976D), + MB2(0x9FAE), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9FAD), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x90F4), + 0x0000, MB2(0x9FAA), 0x0000, MB2(0x978C), + 0x0000, 0x0000, MB2(0x93B4), MB2(0x9FA4), + 0x0000, 0x0000, 0x0000, 0x0000, /* 6D20 */ + 0x0000, MB2(0x92C3), 0x0000, 0x0000, + 0x0000, MB2(0x896B), MB2(0x8D5E), MB2(0x9FA7), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x8F46), MB2(0x9FAC), + 0x0000, MB2(0x9FAB), MB2(0x9FA6), 0x0000, + MB2(0x9FA9), 0x0000, 0x0000, MB2(0x8A88), + 0x0000, MB2(0x9FA8), MB2(0x9468), 0x0000, + 0x0000, MB2(0x97AC), 0x0000, 0x0000, /* 6D40 */ + MB2(0x8FF2), MB2(0x90F3), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x9FB4), MB2(0x9FB2), 0x0000, + MB2(0x956C), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x9FAF), /* 6D60 */ + MB2(0x9FB1), 0x0000, MB2(0x8959), 0x0000, + 0x0000, MB2(0x8D5F), MB2(0x9851), 0x0000, + MB2(0x8A5C), 0x0000, MB2(0x9582), MB2(0xFAFC), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9781), 0x0000, 0x0000, MB2(0x8A43), + MB2(0x905A), MB2(0x9FB3), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6D80 */ + 0x0000, MB2(0x9FB8), 0x0000, MB2(0xFAFB), + MB2(0x8FC1), 0x0000, 0x0000, 0x0000, + MB2(0x974F), 0x0000, MB2(0x9FB5), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x9FB0), + 0x0000, MB2(0x9FB6), MB2(0xFB40), 0x0000, + 0x0000, MB2(0x97DC), 0x0000, MB2(0x9393), + MB2(0x93C0), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6DA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xFB41), 0x0000, 0x0000, MB2(0x8A55), + 0x0000, 0x0000, MB2(0x8974), 0x0000, + 0x0000, MB2(0x9FBC), 0x0000, 0x0000, + MB2(0x9FBF), 0x0000, 0x0000, 0x0000, + MB2(0x97C1), 0x0000, 0x0000, 0x0000, + MB2(0x9784), 0x0000, 0x0000, 0x0000, /* 6DC0 */ + 0x0000, MB2(0x9FC6), MB2(0x9FC0), MB2(0x9FBD), + 0x0000, 0x0000, 0x0000, MB2(0x97D2), + MB2(0x9FC3), 0x0000, 0x0000, MB2(0xFB42), + 0x0000, MB2(0x8F69), MB2(0x9FC5), 0x0000, + 0x0000, MB2(0x9FCA), 0x0000, 0x0000, + MB2(0x9391), MB2(0x9FC8), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9FC2), 0x0000, + 0x0000, MB2(0x9257), 0x0000, 0x0000, /* 6DE0 */ + MB2(0x9FC9), 0x0000, MB2(0x9FBE), 0x0000, + MB2(0x9FC4), 0x0000, MB2(0x9FCB), MB2(0x88FA), + MB2(0x9FC1), 0x0000, MB2(0x9FCC), 0x0000, + 0x0000, MB2(0x905B), MB2(0xFB44), MB2(0x8F7E), + 0x0000, MB2(0x95A3), 0x0000, MB2(0x8DAC), + MB2(0xFB43), MB2(0x9FB9), MB2(0x9FC7), MB2(0x9359), + MB2(0xFB45), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6E00 */ + 0x0000, MB2(0x90B4), 0x0000, MB2(0x8A89), + MB2(0x8DCF), MB2(0x8FC2), MB2(0x9FBB), MB2(0x8F61), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x8C6B), + 0x0000, MB2(0x9FBA), 0x0000, 0x0000, + 0x0000, MB2(0x9FD0), MB2(0x8F8D), MB2(0x8CB8), + 0x0000, MB2(0x9FDF), 0x0000, MB2(0x9FD9), + MB2(0x8B94), MB2(0x936E), 0x0000, MB2(0x9FD4), /* 6E20 */ + MB2(0x9FDD), MB2(0x88AD), MB2(0x8951), MB2(0xFB48), + 0x0000, MB2(0x89B7), 0x0000, MB2(0x9FD6), + MB2(0x91AA), MB2(0x9FCD), MB2(0x9FCF), MB2(0x8D60), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9FE0), MB2(0xFB46), MB2(0x9FDB), 0x0000, + MB2(0xFB49), 0x0000, MB2(0x9FD3), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x9FDA), /* 6E40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x96A9), 0x0000, + 0x0000, MB2(0x9FD8), MB2(0x9FDC), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x8CCE), 0x0000, + MB2(0x8FC3), 0x0000, 0x0000, MB2(0x9258), + MB2(0xFB47), 0x0000, 0x0000, MB2(0x9FD2), + 0x0000, 0x0000, 0x0000, 0x0000, /* 6E60 */ + 0x0000, 0x0000, 0x0000, MB2(0x974E), + 0x0000, 0x0000, 0x0000, MB2(0x9FD5), + 0x0000, 0x0000, MB2(0x9FCE), MB2(0x9392), + 0x0000, 0x0000, MB2(0x9FD1), 0x0000, + 0x0000, 0x0000, MB2(0x9FD7), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9870), MB2(0x8EBC), + MB2(0x969E), 0x0000, MB2(0x9FE1), 0x0000, /* 6E80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x94AC), 0x0000, 0x0000, MB2(0x9FED), + MB2(0x8CB9), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x8F80), 0x0000, + MB2(0x9FE3), 0x0000, 0x0000, 0x0000, + MB2(0x97AD), MB2(0x8D61), 0x0000, MB2(0x9FF0), + 0x0000, 0x0000, MB2(0x88EC), 0x0000, /* 6EA0 */ + 0x0000, MB2(0x9FEE), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9FE2), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x9FE8), + 0x0000, 0x0000, MB2(0x9FEA), 0x0000, + 0x0000, 0x0000, MB2(0x976E), MB2(0x9FE5), + 0x0000, 0x0000, MB2(0x934D), 0x0000, + 0x0000, MB2(0x9FE7), 0x0000, MB2(0xFB4A), + 0x0000, 0x0000, MB2(0x9FEF), 0x0000, /* 6EC0 */ + MB2(0x9FE9), MB2(0x96C5), 0x0000, 0x0000, + 0x0000, MB2(0x9FE4), 0x0000, MB2(0x8EA0), + MB2(0x9FFC), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x8A8A), 0x0000, MB2(0x9FE6), + MB2(0x9FEB), MB2(0x9FEC), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x91EA), MB2(0x91D8), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 6EE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9FF4), 0x0000, 0x0000, MB2(0x9FFA), + 0x0000, 0x0000, MB2(0x9FF8), 0x0000, + MB2(0x9348), 0x0000, 0x0000, MB2(0xE042), + MB2(0x9FF5), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9FF6), MB2(0x9FDE), + 0x0000, MB2(0x8B99), MB2(0x9559), 0x0000, /* 6F00 */ + 0x0000, 0x0000, MB2(0x8EBD), 0x0000, + 0x0000, MB2(0x8D97), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x9852), + 0x0000, MB2(0x9FF2), 0x0000, MB2(0xE041), + MB2(0x8989), MB2(0x9186), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9499), 0x0000, MB2(0x8ABF), MB2(0x97F8), /* 6F20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x969F), + MB2(0x92D0), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x9FF9), MB2(0x9FFB), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9151), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE040), MB2(0x9FF7), + 0x0000, MB2(0x9FF1), 0x0000, 0x0000, /* 6F40 */ + 0x0000, MB2(0x8AC1), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x8C89), 0x0000, 0x0000, 0x0000, + MB2(0xE04E), 0x0000, 0x0000, MB2(0xE049), + MB2(0x90F6), 0x0000, 0x0000, MB2(0x8A83), + 0x0000, 0x0000, 0x0000, 0x0000, /* 6F60 */ + MB2(0x8F81), 0x0000, MB2(0xE052), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE04B), MB2(0x92AA), MB2(0xE048), + MB2(0x92D7), 0x0000, 0x0000, 0x0000, + MB2(0xE06B), 0x0000, 0x0000, 0x0000, + MB2(0xE045), 0x0000, MB2(0xE044), 0x0000, + MB2(0xE04D), 0x0000, 0x0000, 0x0000, + MB2(0xE047), MB2(0xE046), MB2(0xE04C), 0x0000, /* 6F80 */ + MB2(0x909F), 0x0000, MB2(0xE043), 0x0000, + MB2(0xFB4B), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE04F), 0x0000, + 0x0000, MB2(0xE050), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x8AC0), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE055), 0x0000, MB2(0xE054), /* 6FA0 */ + MB2(0xE056), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE059), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x9362), 0x0000, MB2(0xE053), + 0x0000, MB2(0xFB4C), 0x0000, 0x0000, + 0x0000, MB2(0xE057), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x8C83), MB2(0x91F7), MB2(0xE051), MB2(0x945A), /* 6FC0 */ + 0x0000, 0x0000, MB2(0xE058), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE05D), MB2(0xE05B), 0x0000, 0x0000, + MB2(0xE05E), 0x0000, 0x0000, MB2(0xE061), + 0x0000, 0x0000, 0x0000, MB2(0xE05A), + MB2(0x8D8A), MB2(0x9447), 0x0000, 0x0000, /* 6FE0 */ + MB2(0x9FB7), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x9794), + MB2(0xE05C), 0x0000, MB2(0xE060), MB2(0x91F3), + 0x0000, MB2(0xE05F), 0x0000, MB2(0xE04A), + 0x0000, MB2(0xFB4D), MB2(0xE889), 0x0000, + 0x0000, 0x0000, MB2(0xE064), 0x0000, + 0x0000, 0x0000, MB2(0xE068), 0x0000, + 0x0000, MB2(0xE066), 0x0000, 0x0000, /* 7000 */ + 0x0000, MB2(0xFB4E), 0x0000, MB2(0xFB4F), + 0x0000, MB2(0xE062), 0x0000, MB2(0xE063), + 0x0000, 0x0000, 0x0000, MB2(0xE067), + 0x0000, MB2(0xE065), 0x0000, 0x0000, + 0x0000, MB2(0x956D), 0x0000, 0x0000, + MB2(0xE06D), 0x0000, MB2(0xE06A), MB2(0xE069), + 0x0000, MB2(0xE06C), MB2(0x93D2), MB2(0xE06E), + 0x0000, 0x0000, 0x0000, 0x0000, /* 7020 */ + 0x0000, 0x0000, MB2(0x9295), MB2(0x91EB), + MB2(0xFB50), 0x0000, 0x0000, 0x0000, + MB2(0x90A3), 0x0000, 0x0000, 0x0000, + MB2(0xE06F), 0x0000, MB2(0xE071), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE070), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7040 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9FF3), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE072), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x93E5), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE073), /* 7060 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x89CE), + 0x0000, 0x0000, 0x0000, MB2(0x9394), + MB2(0x8A44), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x8B84), 0x0000, 0x0000, 0x0000, + MB2(0x8EDC), MB2(0x8DD0), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7080 */ + 0x0000, MB2(0xFB51), 0x0000, 0x0000, + 0x0000, MB2(0x9846), MB2(0x9086), 0x0000, + 0x0000, 0x0000, MB2(0x898A), 0x0000, + 0x0000, 0x0000, MB2(0xE075), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE074), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 70A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xFB52), + MB2(0xE078), MB2(0x9259), MB2(0xE07B), MB2(0xE076), + 0x0000, 0x0000, 0x0000, MB2(0xE07A), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE079), MB2(0x935F), MB2(0x88D7), MB2(0xFA62), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 70C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x97F3), 0x0000, 0x0000, MB2(0xE07D), + 0x0000, 0x0000, 0x0000, MB2(0x8947), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE080), 0x0000, 0x0000, + 0x0000, MB2(0xE07E), 0x0000, MB2(0xE07C), + 0x0000, 0x0000, 0x0000, 0x0000, /* 70E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE077), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x9642), 0x0000, 0x0000, + 0x0000, MB2(0xE082), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7100 */ + MB2(0xFB54), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE081), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xFB53), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x898B), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE084), MB2(0x95B0), 0x0000, + MB2(0xE083), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x96B3), 0x0000, 0x0000, /* 7120 */ + 0x0000, 0x0000, MB2(0x8FC5), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9152), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x8FC4), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7140 */ + 0x0000, 0x0000, MB2(0xFB56), MB2(0xFB57), + 0x0000, MB2(0x97F9), 0x0000, 0x0000, + MB2(0xE08A), 0x0000, MB2(0x90F7), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE086), MB2(0xE08B), 0x0000, + 0x0000, MB2(0x898C), 0x0000, 0x0000, + MB2(0xFB55), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE089), 0x0000, /* 7160 */ + MB2(0x9481), MB2(0xE085), MB2(0xE088), MB2(0x8FC6), + 0x0000, MB2(0x94CF), 0x0000, 0x0000, + MB2(0xE08C), 0x0000, MB2(0x8ECF), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x90F8), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7180 */ + MB2(0xE08F), 0x0000, 0x0000, 0x0000, + MB2(0xE087), 0x0000, MB2(0x8C46), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE08D), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x976F), MB2(0xE090), 0x0000, 0x0000, + 0x0000, MB2(0xEAA4), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x8F6E), + 0x0000, 0x0000, 0x0000, 0x0000, /* 71A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE091), 0x0000, 0x0000, 0x0000, + MB2(0xE092), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x944D), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE094), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE095), 0x0000, + 0x0000, MB2(0xFB59), 0x0000, MB2(0x9452), /* 71C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9395), MB2(0xE097), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE099), 0x0000, + MB2(0x97D3), 0x0000, MB2(0xE096), 0x0000, + MB2(0xE098), MB2(0x898D), 0x0000, MB2(0xE093), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x9A7A), + MB2(0xE09A), 0x0000, 0x0000, 0x0000, /* 71E0 */ + 0x0000, MB2(0x9187), MB2(0x8E57), MB2(0xE09C), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE09B), MB2(0x9043), MB2(0x99D7), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE09D), 0x0000, 0x0000, + 0x0000, MB2(0xE09F), 0x0000, MB2(0xE08E), + MB2(0xE09E), 0x0000, MB2(0xFB5A), MB2(0xE0A0), + 0x0000, 0x0000, 0x0000, 0x0000, /* 7200 */ + 0x0000, 0x0000, MB2(0x949A), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE0A1), 0x0000, 0x0000, + MB2(0xE0A2), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE0A3), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7220 */ + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE0A4), 0x0000, MB2(0x92DC), 0x0000, + MB2(0xE0A6), MB2(0xE0A5), 0x0000, 0x0000, + MB2(0xE0A7), 0x0000, MB2(0xE0A8), 0x0000, + 0x0000, MB2(0x8EDD), MB2(0x9583), 0x0000, + 0x0000, 0x0000, MB2(0x96EA), MB2(0xE0A9), + MB2(0xE0AA), MB2(0x9175), MB2(0x8EA2), MB2(0xE0AB), + MB2(0xE0AC), 0x0000, 0x0000, 0x0000, /* 7240 */ + 0x0000, 0x0000, MB2(0xE0AD), MB2(0x95D0), + MB2(0x94C5), 0x0000, 0x0000, MB2(0xE0AE), + MB2(0x9476), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x92AB), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE0AF), MB2(0x89E5), 0x0000, MB2(0x8B8D), + 0x0000, MB2(0x96C4), 0x0000, MB2(0x96B4), + 0x0000, MB2(0x89B2), MB2(0x9853), 0x0000, /* 7260 */ + 0x0000, 0x0000, 0x0000, MB2(0x9671), + 0x0000, MB2(0x95A8), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x90B5), 0x0000, + MB2(0xE0B0), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x93C1), 0x0000, 0x0000, + 0x0000, MB2(0x8CA1), MB2(0xE0B1), 0x0000, + MB2(0x8DD2), MB2(0xE0B3), MB2(0xE0B2), 0x0000, /* 7280 */ + 0x0000, 0x0000, 0x0000, MB2(0xE0B4), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE0B5), 0x0000, + 0x0000, 0x0000, MB2(0xE0B6), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x8B5D), 0x0000, MB2(0xE0B7), 0x0000, /* 72A0 */ + 0x0000, 0x0000, 0x0000, MB2(0xE0B8), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x8CA2), 0x0000, 0x0000, MB2(0x94C6), + 0x0000, MB2(0xFB5B), MB2(0xE0BA), 0x0000, + 0x0000, 0x0000, MB2(0x8FF3), 0x0000, + 0x0000, MB2(0xE0B9), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xFB5C), 0x0000, + 0x0000, 0x0000, MB2(0x8BB6), MB2(0xE0BB), /* 72C0 */ + MB2(0xE0BD), 0x0000, MB2(0xE0BC), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE0BE), 0x0000, + MB2(0x8CCF), 0x0000, MB2(0xE0BF), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x8BE7), + 0x0000, MB2(0x915F), 0x0000, MB2(0x8D9D), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE0C1), MB2(0xE0C2), MB2(0xE0C0), 0x0000, /* 72E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x8EEB), 0x0000, 0x0000, + MB2(0x93C6), MB2(0x8BB7), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE0C4), + MB2(0x924B), MB2(0xE0C3), 0x0000, 0x0000, + MB2(0x9854), MB2(0x9482), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7300 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE0C7), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE0C9), MB2(0xE0C6), + 0x0000, 0x0000, 0x0000, MB2(0x96D2), + MB2(0xE0C8), MB2(0xE0CA), 0x0000, MB2(0x97C2), + 0x0000, 0x0000, 0x0000, 0x0000, /* 7320 */ + MB2(0xFB5D), MB2(0xE0CE), 0x0000, 0x0000, + 0x0000, MB2(0xE0CD), MB2(0x9296), MB2(0x944C), + 0x0000, 0x0000, MB2(0x8CA3), MB2(0xE0CC), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE0CB), 0x0000, MB2(0x9750), MB2(0x9751), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE0CF), MB2(0x898E), + 0x0000, 0x0000, 0x0000, 0x0000, /* 7340 */ + MB2(0x8D96), MB2(0x8E82), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE0D0), MB2(0xE0D1), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE0D3), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x8F62), /* 7360 */ + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE0D5), 0x0000, MB2(0xE0D4), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE0D6), 0x0000, MB2(0x8A6C), 0x0000, + 0x0000, MB2(0xE0D8), 0x0000, MB2(0xFB5F), + MB2(0xE0D7), 0x0000, MB2(0xE0DA), MB2(0xE0D9), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7380 */ + MB2(0x8CBA), 0x0000, 0x0000, MB2(0x97A6), + 0x0000, MB2(0x8BCA), 0x0000, MB2(0x89A4), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x8BE8), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 73A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x8ADF), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x97E6), MB2(0xE0DC), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE0DE), + 0x0000, MB2(0xFB60), 0x0000, 0x0000, + MB2(0xE0DF), 0x0000, MB2(0x89CF), 0x0000, /* 73C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE0DB), MB2(0xFB61), MB2(0x8E58), 0x0000, + 0x0000, MB2(0x92BF), MB2(0xE0DD), 0x0000, + 0x0000, 0x0000, MB2(0xFB64), 0x0000, + 0x0000, 0x0000, MB2(0xFB62), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE0E2), 0x0000, + MB2(0x8EEC), 0x0000, 0x0000, MB2(0xFB63), /* 73E0 */ + 0x0000, MB2(0xE0E0), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x8C5D), 0x0000, + 0x0000, MB2(0x94C7), MB2(0xE0E1), 0x0000, + 0x0000, MB2(0xE0FC), 0x0000, 0x0000, + 0x0000, MB2(0xFB66), 0x0000, 0x0000, + MB2(0xE0E7), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x8CBB), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x8B85), /* 7400 */ + 0x0000, MB2(0xE0E4), MB2(0x979D), MB2(0xFB65), + 0x0000, MB2(0x97AE), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x91F4), 0x0000, /* 7420 */ + 0x0000, MB2(0xE0E6), MB2(0xFB67), 0x0000, + 0x0000, MB2(0xFB69), MB2(0xFB68), 0x0000, + 0x0000, 0x0000, MB2(0xFB6A), 0x0000, + 0x0000, 0x0000, MB2(0xE0E8), MB2(0x97D4), + MB2(0x8BD5), MB2(0x94FA), MB2(0x9469), 0x0000, + 0x0000, 0x0000, MB2(0xE0E9), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE0EB), + 0x0000, MB2(0xE0EE), 0x0000, 0x0000, /* 7440 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE0EA), 0x0000, 0x0000, + 0x0000, MB2(0xE0ED), MB2(0x8CE8), MB2(0x896C), + MB2(0xE0EF), 0x0000, MB2(0x9090), MB2(0xE0EC), + MB2(0x97DA), 0x0000, MB2(0xFB6B), MB2(0xE0F2), /* 7460 */ + MB2(0xEAA2), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE0F0), MB2(0xE0F3), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE0E5), + MB2(0xE0F1), 0x0000, 0x0000, MB2(0x8DBA), + 0x0000, 0x0000, MB2(0xE0F4), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE0F5), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x979E), /* 7480 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xFB6C), 0x0000, MB2(0xE0F6), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE0F7), MB2(0xFB6D), + 0x0000, 0x0000, MB2(0xE0E3), 0x0000, /* 74A0 */ + 0x0000, 0x0000, 0x0000, MB2(0xE0F8), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x8AC2), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x8EA3), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 74C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE0F9), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE0FA), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE0FB), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x895A), 0x0000, 0x0000, 0x0000, + MB2(0xE140), 0x0000, MB2(0x955A), MB2(0xE141), /* 74E0 */ + 0x0000, 0x0000, MB2(0x8AA2), MB2(0xE142), + 0x0000, MB2(0xE143), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE144), 0x0000, + MB2(0xE146), MB2(0xE147), MB2(0xE145), 0x0000, + 0x0000, 0x0000, MB2(0x9572), MB2(0xE149), + MB2(0xE148), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xFB6E), 0x0000, MB2(0xE14B), /* 7500 */ + MB2(0xE14A), MB2(0xE14C), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE14D), MB2(0xE14F), MB2(0xE14E), 0x0000, + 0x0000, MB2(0x8D99), 0x0000, MB2(0xE151), + 0x0000, MB2(0xE150), 0x0000, 0x0000, + MB2(0x8AC3), 0x0000, MB2(0x9072), 0x0000, + MB2(0x935B), 0x0000, MB2(0xE152), MB2(0x90B6), + 0x0000, 0x0000, 0x0000, MB2(0x8E59), /* 7520 */ + 0x0000, MB2(0x8999), MB2(0xE153), 0x0000, + MB2(0x9770), 0x0000, 0x0000, MB2(0x95E1), + MB2(0xE154), 0x0000, 0x0000, MB2(0xFAA8), + MB2(0x9363), MB2(0x9752), MB2(0x8D62), MB2(0x905C), + 0x0000, 0x0000, 0x0000, MB2(0x926A), + MB2(0x99B2), 0x0000, MB2(0x92AC), MB2(0x89E6), + MB2(0xE155), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7540 */ + MB2(0xE156), 0x0000, MB2(0xE15B), 0x0000, + 0x0000, MB2(0xE159), MB2(0xE158), MB2(0x9DC0), + MB2(0x8A45), MB2(0xE157), 0x0000, MB2(0x88D8), + 0x0000, MB2(0x94A8), 0x0000, 0x0000, + MB2(0x94C8), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x97AF), MB2(0xE15C), MB2(0xE15A), + MB2(0x927B), MB2(0x90A4), 0x0000, 0x0000, + MB2(0x94A9), 0x0000, MB2(0x954C), 0x0000, /* 7560 */ + MB2(0xE15E), MB2(0x97AA), MB2(0x8C6C), MB2(0xE15F), + 0x0000, MB2(0xE15D), MB2(0x94D4), MB2(0xE160), + 0x0000, MB2(0xE161), 0x0000, MB2(0xFB6F), + MB2(0x88D9), 0x0000, 0x0000, MB2(0x8FF4), + MB2(0xE166), 0x0000, MB2(0xE163), MB2(0x93EB), + MB2(0xE162), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x8B45), + 0x0000, 0x0000, MB2(0xE169), 0x0000, /* 7580 */ + 0x0000, 0x0000, MB2(0xE164), MB2(0xE165), + 0x0000, MB2(0xE168), MB2(0xE167), MB2(0x9544), + 0x0000, 0x0000, MB2(0x9161), MB2(0x9160), + 0x0000, MB2(0x8B5E), 0x0000, 0x0000, + MB2(0xE16A), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE16B), 0x0000, + 0x0000, MB2(0xE16C), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE16E), /* 75A0 */ + 0x0000, MB2(0xE16D), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x8975), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE176), MB2(0x94E6), MB2(0xE170), + 0x0000, MB2(0xE172), 0x0000, 0x0000, + MB2(0xE174), MB2(0x905D), 0x0000, 0x0000, + MB2(0xE175), MB2(0xE173), MB2(0x8EBE), 0x0000, + 0x0000, 0x0000, MB2(0xE16F), MB2(0xE171), /* 75C0 */ + 0x0000, MB2(0x9561), 0x0000, MB2(0x8FC7), + 0x0000, 0x0000, MB2(0xE178), 0x0000, + 0x0000, MB2(0xE177), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE179), 0x0000, + MB2(0x8EA4), MB2(0x8DAD), 0x0000, 0x0000, + MB2(0x9397), MB2(0xE17A), 0x0000, MB2(0x92C9), + 0x0000, 0x0000, MB2(0xE17C), 0x0000, + 0x0000, 0x0000, MB2(0x979F), MB2(0xE17B), /* 75E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x9189), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE182), 0x0000, MB2(0xE184), MB2(0xE185), + MB2(0x9273), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE183), 0x0000, + MB2(0xE180), 0x0000, MB2(0xE17D), MB2(0xE17E), + 0x0000, MB2(0xE181), 0x0000, 0x0000, /* 7600 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE188), 0x0000, MB2(0xE186), + 0x0000, MB2(0xE187), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE189), + MB2(0xE18B), MB2(0xE18C), MB2(0xE18D), 0x0000, /* 7620 */ + MB2(0xE18E), 0x0000, 0x0000, MB2(0xE18A), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE190), 0x0000, 0x0000, 0x0000, + MB2(0xE18F), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE191), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x97C3), 0x0000, /* 7640 */ + 0x0000, 0x0000, MB2(0xE194), MB2(0xE192), + MB2(0xE193), 0x0000, 0x0000, 0x0000, + MB2(0x8AE0), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x96FC), 0x0000, + 0x0000, 0x0000, MB2(0x95C8), 0x0000, + MB2(0xE196), 0x0000, 0x0000, 0x0000, + MB2(0xE195), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE197), MB2(0xE198), 0x0000, /* 7660 */ + 0x0000, 0x0000, 0x0000, MB2(0xE19C), + MB2(0xE199), MB2(0xE19A), MB2(0xE19B), 0x0000, + MB2(0xE19D), 0x0000, 0x0000, 0x0000, + MB2(0xE19E), 0x0000, MB2(0xE19F), 0x0000, + 0x0000, 0x0000, MB2(0xE1A0), 0x0000, + MB2(0xE1A1), 0x0000, MB2(0x94AD), MB2(0x936F), + MB2(0xE1A2), MB2(0x9492), MB2(0x9553), 0x0000, + MB2(0xE1A3), 0x0000, MB2(0xFB70), MB2(0xE1A4), /* 7680 */ + MB2(0x9349), 0x0000, MB2(0x8A46), MB2(0x8D63), + MB2(0xE1A5), 0x0000, 0x0000, MB2(0xE1A6), + 0x0000, 0x0000, MB2(0xE1A7), 0x0000, + MB2(0x8E48), 0x0000, 0x0000, MB2(0xE1A9), + 0x0000, 0x0000, MB2(0xE1A8), 0x0000, + 0x0000, MB2(0xE1AA), MB2(0xE1AB), MB2(0xFB73), + MB2(0xFB71), 0x0000, MB2(0xFB72), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 76A0 */ + 0x0000, 0x0000, MB2(0xFB74), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x94E7), 0x0000, + MB2(0xE1AC), 0x0000, 0x0000, 0x0000, + MB2(0xE1AD), 0x0000, 0x0000, MB2(0xEA89), + MB2(0xE1AE), MB2(0xE1AF), MB2(0xE1B0), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x8E4D), + 0x0000, 0x0000, MB2(0xE1B1), MB2(0x9475), /* 76C0 */ + 0x0000, 0x0000, MB2(0x967E), 0x0000, + MB2(0x896D), 0x0000, MB2(0x8976), 0x0000, + 0x0000, MB2(0xE1B2), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE1B4), 0x0000, + 0x0000, 0x0000, MB2(0xE1B3), MB2(0x9390), + 0x0000, 0x0000, 0x0000, MB2(0x90B7), + MB2(0x9F58), 0x0000, MB2(0xE1B5), MB2(0x96BF), + 0x0000, MB2(0xE1B6), 0x0000, MB2(0x8AC4), /* 76E0 */ + MB2(0x94D5), MB2(0xE1B7), 0x0000, MB2(0xE1B8), + 0x0000, 0x0000, MB2(0xE1B9), 0x0000, + 0x0000, 0x0000, MB2(0x96DA), 0x0000, + 0x0000, 0x0000, MB2(0x96D3), 0x0000, + MB2(0x92BC), 0x0000, 0x0000, 0x0000, + MB2(0x918A), 0x0000, 0x0000, MB2(0xE1BB), + 0x0000, 0x0000, MB2(0x8F82), 0x0000, + 0x0000, MB2(0x8FC8), 0x0000, 0x0000, /* 7700 */ + MB2(0xE1BE), 0x0000, 0x0000, MB2(0xE1BD), + MB2(0xE1BC), MB2(0x94FB), 0x0000, MB2(0x8AC5), + MB2(0x8CA7), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE1C4), + 0x0000, 0x0000, MB2(0xE1C1), MB2(0x905E), + MB2(0x96B0), 0x0000, 0x0000, 0x0000, /* 7720 */ + MB2(0xE1C0), MB2(0xE1C2), MB2(0xE1C3), 0x0000, + 0x0000, MB2(0xE1BF), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE1C5), + MB2(0xE1C6), 0x0000, MB2(0x92AD), 0x0000, + MB2(0x8AE1), 0x0000, 0x0000, 0x0000, + MB2(0x9285), 0x0000, 0x0000, 0x0000, /* 7740 */ + 0x0000, 0x0000, MB2(0xFB76), MB2(0xE1C7), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE1C8), MB2(0xE1CB), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x9087), 0x0000, MB2(0x93C2), /* 7760 */ + 0x0000, MB2(0xE1CC), MB2(0x9672), 0x0000, + MB2(0xE1C9), 0x0000, 0x0000, MB2(0xE1CA), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE1CF), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE1CE), MB2(0xE1CD), + 0x0000, 0x0000, 0x0000, 0x0000, /* 7780 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE1D1), + 0x0000, 0x0000, MB2(0xE1D0), 0x0000, + 0x0000, MB2(0xE1D2), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE1D4), 0x0000, + MB2(0xE1D3), 0x0000, 0x0000, 0x0000, /* 77A0 */ + 0x0000, MB2(0x95CB), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x8F75), MB2(0x97C4), 0x0000, 0x0000, + MB2(0xE1D5), 0x0000, 0x0000, MB2(0x93B5), + 0x0000, 0x0000, MB2(0xE1D6), 0x0000, + 0x0000, MB2(0xE1D7), 0x0000, MB2(0xE1DB), + MB2(0xE1D9), MB2(0xE1DA), 0x0000, MB2(0xE1D8), + 0x0000, 0x0000, 0x0000, 0x0000, /* 77C0 */ + 0x0000, 0x0000, 0x0000, MB2(0xE1DC), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE1DD), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE1DE), + 0x0000, 0x0000, MB2(0xE1DF), MB2(0x96B5), + MB2(0xE1E0), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x96EE), MB2(0xE1E1), /* 77E0 */ + 0x0000, MB2(0x926D), 0x0000, MB2(0x948A), + 0x0000, MB2(0x8BE9), 0x0000, 0x0000, + 0x0000, MB2(0x925A), MB2(0xE1E2), MB2(0x8BB8), + 0x0000, 0x0000, 0x0000, MB2(0x90CE), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE1E3), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x8DBB), 0x0000, /* 7800 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE1E4), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE1E5), 0x0000, + MB2(0x8CA4), MB2(0x8DD3), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE1E7), MB2(0xFB78), 0x0000, 0x0000, /* 7820 */ + 0x0000, MB2(0x9375), MB2(0x8DD4), MB2(0x8B6D), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9643), 0x0000, + MB2(0x946A), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9376), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x8D7B), + 0x0000, 0x0000, 0x0000, 0x0000, /* 7840 */ + 0x0000, MB2(0xE1E9), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xFB79), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x8FC9), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7860 */ + MB2(0xFB7A), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x97B0), + MB2(0x8D64), 0x0000, 0x0000, MB2(0x8CA5), + 0x0000, 0x0000, MB2(0x94A1), 0x0000, + MB2(0xE1EB), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xFB7B), 0x0000, + MB2(0xE1ED), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x8CE9), 0x0000, 0x0000, /* 7880 */ + 0x0000, 0x0000, MB2(0xE1EC), MB2(0x92F4), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE1EF), MB2(0x8A56), MB2(0xE1EA), 0x0000, + 0x0000, MB2(0x94E8), 0x0000, MB2(0x894F), + 0x0000, MB2(0x8DEA), 0x0000, MB2(0x9871), + 0x0000, 0x0000, MB2(0xE1EE), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE1F0), /* 78A0 */ + 0x0000, 0x0000, 0x0000, MB2(0x95C9), + 0x0000, MB2(0x90D7), MB2(0xE1F2), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE1F3), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE1F1), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x8A6D), 0x0000, + MB2(0xE1F9), 0x0000, MB2(0xE1F8), 0x0000, + 0x0000, MB2(0x8EA5), 0x0000, 0x0000, /* 78C0 */ + 0x0000, MB2(0xE1FA), MB2(0xE1F5), 0x0000, + 0x0000, 0x0000, MB2(0xE1FB), MB2(0xE1F6), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x94D6), MB2(0xE1F4), 0x0000, 0x0000, + MB2(0xE1F7), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE241), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 78E0 */ + 0x0000, 0x0000, 0x0000, MB2(0xE240), + MB2(0x9681), 0x0000, 0x0000, 0x0000, + MB2(0xE1FC), 0x0000, 0x0000, MB2(0x88E9), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE243), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE242), 0x0000, 0x0000, + 0x0000, MB2(0x8FCA), 0x0000, 0x0000, /* 7900 */ + 0x0000, 0x0000, 0x0000, MB2(0xE244), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9162), 0x0000, + 0x0000, MB2(0xE246), MB2(0xE245), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE247), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7920 */ + 0x0000, 0x0000, MB2(0xE1E6), 0x0000, + 0x0000, 0x0000, MB2(0xE1E8), MB2(0xE249), + MB2(0xE248), 0x0000, 0x0000, 0x0000, + MB2(0xFB7C), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x8EA6), 0x0000, + MB2(0x97E7), 0x0000, MB2(0x8ED0), 0x0000, + MB2(0xE24A), MB2(0x8C56), 0x0000, 0x0000, /* 7940 */ + 0x0000, 0x0000, 0x0000, MB2(0x8B5F), + MB2(0x8B46), MB2(0x8E83), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9753), 0x0000, 0x0000, MB2(0xE250), + 0x0000, MB2(0xE24F), MB2(0x9163), MB2(0xE24C), + 0x0000, 0x0000, MB2(0xE24E), 0x0000, + 0x0000, MB2(0x8F6A), MB2(0x905F), MB2(0xE24D), + MB2(0xE24B), 0x0000, MB2(0x9449), 0x0000, /* 7960 */ + 0x0000, MB2(0x8FCB), 0x0000, 0x0000, + MB2(0x955B), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x8DD5), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x9398), + 0x0000, 0x0000, MB2(0xE251), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE252), + MB2(0xE268), MB2(0x8BD6), 0x0000, 0x0000, /* 7980 */ + MB2(0x985C), MB2(0x9154), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE253), 0x0000, + 0x0000, MB2(0x89D0), MB2(0x92F5), MB2(0x959F), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xFB81), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xFB83), + 0x0000, MB2(0xE254), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 79A0 */ + 0x0000, 0x0000, MB2(0x8B9A), MB2(0xE255), + 0x0000, 0x0000, MB2(0xE257), 0x0000, + 0x0000, 0x0000, MB2(0xE258), 0x0000, + MB2(0x9448), 0x0000, 0x0000, MB2(0xE259), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE25A), MB2(0xE25B), 0x0000, + 0x0000, MB2(0x8BD7), MB2(0x89D1), MB2(0x93C3), + MB2(0x8F47), MB2(0x8E84), 0x0000, 0x0000, /* 79C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE25C), 0x0000, MB2(0x8F48), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x89C8), MB2(0x9562), 0x0000, + 0x0000, MB2(0xE25D), 0x0000, 0x0000, + MB2(0x94E9), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x9164), + 0x0000, MB2(0xE260), 0x0000, MB2(0xE261), /* 79E0 */ + MB2(0x9489), 0x0000, MB2(0x9060), MB2(0xE25E), + 0x0000, MB2(0x9281), 0x0000, 0x0000, + MB2(0xE25F), 0x0000, 0x0000, 0x0000, + MB2(0x8FCC), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x88DA), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x8B48), 0x0000, 0x0000, 0x0000, /* 7A00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE262), 0x0000, 0x0000, MB2(0x92F6), + 0x0000, MB2(0xE263), MB2(0x90C5), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x96AB), 0x0000, 0x0000, MB2(0x9542), + MB2(0xE264), MB2(0xE265), MB2(0x9274), 0x0000, + MB2(0x97C5), 0x0000, 0x0000, MB2(0xE267), + MB2(0xE266), 0x0000, 0x0000, 0x0000, /* 7A20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x8EED), 0x0000, + 0x0000, MB2(0xE269), MB2(0x88EE), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE26C), + 0x0000, 0x0000, 0x0000, MB2(0xE26A), + MB2(0x89D2), MB2(0x8C6D), MB2(0xE26B), MB2(0x8D65), + MB2(0x8D92), 0x0000, MB2(0x95E4), MB2(0xE26D), /* 7A40 */ + 0x0000, 0x0000, MB2(0x9673), 0x0000, + 0x0000, MB2(0xE26F), 0x0000, 0x0000, + 0x0000, MB2(0x90CF), MB2(0x896E), MB2(0x89B8), + MB2(0x88AA), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE26E), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE270), MB2(0xE271), MB2(0x8FF5), /* 7A60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE272), 0x0000, MB2(0x8A6E), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE274), 0x0000, 0x0000, 0x0000, + MB2(0x8C8A), 0x0000, MB2(0x8B86), 0x0000, + 0x0000, MB2(0xE275), MB2(0x8BF3), 0x0000, + 0x0000, MB2(0xE276), 0x0000, MB2(0x90FA), + 0x0000, MB2(0x93CB), 0x0000, MB2(0x90DE), /* 7A80 */ + MB2(0x8DF3), 0x0000, 0x0000, 0x0000, + MB2(0xE277), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9282), MB2(0x918B), + 0x0000, MB2(0xE279), MB2(0xE27B), MB2(0xE278), + MB2(0xE27A), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x8C41), + 0x0000, 0x0000, 0x0000, 0x0000, /* 7AA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE27C), MB2(0x8C45), 0x0000, + 0x0000, 0x0000, MB2(0x8B87), MB2(0x9771), + MB2(0xE27E), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE280), 0x0000, + 0x0000, 0x0000, MB2(0x894D), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE283), + 0x0000, 0x0000, 0x0000, MB2(0x8A96), /* 7AC0 */ + MB2(0xE282), MB2(0xE281), 0x0000, MB2(0xE285), + MB2(0xE27D), 0x0000, MB2(0xE286), MB2(0x97A7), + 0x0000, MB2(0xE287), 0x0000, MB2(0xE288), + 0x0000, MB2(0xFB84), MB2(0x9AF2), MB2(0xE28A), + 0x0000, MB2(0xE289), 0x0000, 0x0000, + 0x0000, MB2(0xE28B), MB2(0xE28C), 0x0000, + MB2(0x97B3), MB2(0xE28D), 0x0000, MB2(0xE8ED), + MB2(0x8FCD), MB2(0xE28E), MB2(0xE28F), MB2(0x8F76), /* 7AE0 */ + 0x0000, MB2(0x93B6), MB2(0xE290), MB2(0xFB85), + 0x0000, 0x0000, MB2(0x9247), MB2(0xFB87), + 0x0000, MB2(0xE291), 0x0000, MB2(0x925B), + MB2(0xE292), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x8BA3), 0x0000, + MB2(0x995E), MB2(0x927C), MB2(0x8EB1), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x8AC6), + 0x0000, 0x0000, MB2(0xE293), 0x0000, /* 7B00 */ + MB2(0xE2A0), 0x0000, MB2(0xE296), 0x0000, + MB2(0x8B88), 0x0000, MB2(0xE295), MB2(0xE2A2), + 0x0000, 0x0000, 0x0000, MB2(0xE294), + 0x0000, MB2(0x8FCE), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE298), MB2(0xE299), 0x0000, MB2(0x934A), + 0x0000, 0x0000, MB2(0xE29A), 0x0000, + MB2(0x8A7D), 0x0000, 0x0000, 0x0000, /* 7B20 */ + 0x0000, MB2(0x9079), MB2(0x9584), 0x0000, + MB2(0xE29C), 0x0000, 0x0000, 0x0000, + MB2(0x91E6), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE297), + 0x0000, MB2(0xE29B), MB2(0xE29D), 0x0000, + 0x0000, MB2(0x8DF9), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7B40 */ + 0x0000, MB2(0xE2A4), MB2(0x954D), 0x0000, + MB2(0x94A4), MB2(0x9399), 0x0000, MB2(0x8BD8), + MB2(0xE2A3), MB2(0xE2A1), 0x0000, MB2(0x94B3), + MB2(0xE29E), MB2(0x927D), MB2(0x939B), 0x0000, + MB2(0x939A), 0x0000, MB2(0x8DF4), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE2B6), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7B60 */ + 0x0000, MB2(0xE2A6), 0x0000, MB2(0xE2A8), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE2AB), 0x0000, MB2(0xE2AC), 0x0000, + MB2(0xE2A9), MB2(0xE2AA), 0x0000, 0x0000, + MB2(0xE2A7), MB2(0xE2A5), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE29F), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7B80 */ + 0x0000, 0x0000, MB2(0x95CD), MB2(0x89D3), + 0x0000, 0x0000, 0x0000, MB2(0xE2B3), + 0x0000, MB2(0xE2B0), 0x0000, MB2(0xE2B5), + 0x0000, 0x0000, MB2(0xE2B4), 0x0000, + MB2(0x9493), MB2(0x96A5), 0x0000, MB2(0x8E5A), + MB2(0xE2AE), MB2(0xE2B7), MB2(0xE2B2), 0x0000, + MB2(0xE2B1), MB2(0xE2AD), MB2(0xFB88), MB2(0xE2AF), + 0x0000, MB2(0x8AC7), 0x0000, 0x0000, /* 7BA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x925C), 0x0000, + 0x0000, MB2(0x90FB), 0x0000, 0x0000, + 0x0000, MB2(0x94A0), 0x0000, 0x0000, + MB2(0xE2BC), 0x0000, 0x0000, 0x0000, + MB2(0x94A2), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x90DF), MB2(0xE2B9), 0x0000, 0x0000, /* 7BC0 */ + MB2(0x94CD), 0x0000, MB2(0xE2BD), MB2(0x95D1), + 0x0000, MB2(0x927A), 0x0000, MB2(0xE2B8), + MB2(0xE2BA), 0x0000, 0x0000, MB2(0xE2BB), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE2BE), 0x0000, 0x0000, + MB2(0x8EC2), 0x0000, 0x0000, 0x0000, /* 7BE0 */ + MB2(0x93C4), MB2(0xE2C3), MB2(0xE2C2), 0x0000, + 0x0000, MB2(0xE2BF), 0x0000, 0x0000, + 0x0000, MB2(0x9855), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE2C8), + 0x0000, 0x0000, MB2(0xE2CC), MB2(0xE2C9), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE2C5), 0x0000, 0x0000, 0x0000, /* 7C00 */ + 0x0000, 0x0000, 0x0000, MB2(0xE2C6), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE2CB), 0x0000, 0x0000, + 0x0000, MB2(0xE2C0), MB2(0x99D3), MB2(0xE2C7), + MB2(0xE2C1), 0x0000, 0x0000, MB2(0xE2CA), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE2D0), + 0x0000, MB2(0x8AC8), 0x0000, MB2(0xE2CD), /* 7C20 */ + 0x0000, 0x0000, 0x0000, MB2(0xE2CE), + 0x0000, 0x0000, MB2(0xE2CF), MB2(0xE2D2), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE2D1), + MB2(0x94F4), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE2D3), MB2(0x97FA), MB2(0x95EB), + MB2(0xE2D8), 0x0000, 0x0000, MB2(0xE2D5), /* 7C40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE2D4), MB2(0x90D0), 0x0000, MB2(0xE2D7), + MB2(0xE2D9), 0x0000, 0x0000, 0x0000, + MB2(0xE2D6), 0x0000, MB2(0xE2DD), 0x0000, + MB2(0xE2DA), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE2DB), + MB2(0xE2C4), 0x0000, 0x0000, 0x0000, /* 7C60 */ + MB2(0xE2DC), MB2(0xE2DE), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE2DF), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x95C4), + 0x0000, MB2(0xE2E0), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x96E0), 0x0000, + 0x0000, MB2(0x8BCC), MB2(0x8C48), MB2(0xE2E1), /* 7C80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x95B2), 0x0000, MB2(0x9088), + 0x0000, MB2(0x96AE), 0x0000, 0x0000, + MB2(0xE2E2), 0x0000, MB2(0x97B1), 0x0000, + 0x0000, MB2(0x9494), 0x0000, MB2(0x9165), + MB2(0x9453), 0x0000, 0x0000, MB2(0x8F6C), + 0x0000, 0x0000, 0x0000, MB2(0x88BE), + 0x0000, MB2(0xE2E7), MB2(0xE2E5), 0x0000, /* 7CA0 */ + MB2(0xE2E3), MB2(0x8A9F), 0x0000, MB2(0x8FCF), + MB2(0xE2E8), 0x0000, 0x0000, MB2(0xE2E6), + 0x0000, MB2(0xE2E4), MB2(0xE2EC), 0x0000, + 0x0000, MB2(0xE2EB), MB2(0xE2EA), MB2(0xE2E9), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE2ED), 0x0000, 0x0000, + 0x0000, MB2(0xE2EE), MB2(0x90B8), 0x0000, + MB2(0xE2EF), 0x0000, MB2(0xE2F1), 0x0000, /* 7CC0 */ + 0x0000, MB2(0xE2F0), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x8CD0), 0x0000, + 0x0000, 0x0000, MB2(0x9157), 0x0000, + 0x0000, 0x0000, MB2(0xE2F3), 0x0000, + 0x0000, 0x0000, MB2(0x939C), 0x0000, + MB2(0xE2F2), 0x0000, 0x0000, 0x0000, + MB2(0xE2F4), 0x0000, MB2(0x95B3), MB2(0x918C), + MB2(0x8D66), 0x0000, MB2(0xE2F5), 0x0000, /* 7CE0 */ + 0x0000, 0x0000, 0x0000, MB2(0x97C6), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE2F7), + 0x0000, 0x0000, MB2(0xE2F8), 0x0000, + MB2(0xE2F9), 0x0000, MB2(0xE2FA), 0x0000, + MB2(0x8E85), 0x0000, MB2(0xE2FB), MB2(0x8C6E), + 0x0000, 0x0000, MB2(0x8B8A), 0x0000, + MB2(0x8B49), 0x0000, MB2(0xE340), 0x0000, /* 7D00 */ + MB2(0x96F1), MB2(0x8D67), MB2(0xE2FC), 0x0000, + 0x0000, 0x0000, MB2(0xE343), MB2(0x96E4), + 0x0000, MB2(0x945B), 0x0000, 0x0000, + MB2(0x9552), 0x0000, 0x0000, 0x0000, + MB2(0x8F83), MB2(0xE342), 0x0000, MB2(0x8ED1), + MB2(0x8D68), MB2(0x8E86), MB2(0x8B89), MB2(0x95B4), + MB2(0xE341), 0x0000, 0x0000, 0x0000, + MB2(0x9166), MB2(0x9661), MB2(0x8DF5), 0x0000, /* 7D20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x8E87), + MB2(0x92DB), 0x0000, MB2(0xE346), MB2(0x97DD), + MB2(0x8DD7), 0x0000, MB2(0xE347), MB2(0x9061), + 0x0000, MB2(0xE349), 0x0000, 0x0000, + 0x0000, MB2(0x8FD0), MB2(0x8DAE), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE348), + 0x0000, 0x0000, MB2(0x8F49), MB2(0x8CBC), /* 7D40 */ + MB2(0x9167), MB2(0xE344), MB2(0xE34A), 0x0000, + MB2(0xFB8A), 0x0000, 0x0000, MB2(0xE345), + MB2(0x8C6F), 0x0000, MB2(0xE34D), MB2(0xE351), + MB2(0x8C8B), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE34C), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE355), + MB2(0xFB8B), 0x0000, MB2(0x8D69), 0x0000, + 0x0000, MB2(0x978D), MB2(0x88BA), MB2(0xE352), /* 7D60 */ + 0x0000, 0x0000, MB2(0x8B8B), 0x0000, + MB2(0xE34F), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE350), 0x0000, + 0x0000, MB2(0x939D), MB2(0xE34E), MB2(0xE34B), + 0x0000, MB2(0x8A47), MB2(0x90E2), 0x0000, + 0x0000, MB2(0x8CA6), 0x0000, 0x0000, + 0x0000, MB2(0xE357), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7D80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE354), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE356), + 0x0000, 0x0000, 0x0000, MB2(0xE353), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x8C70), MB2(0x91B1), MB2(0xE358), + MB2(0x918E), 0x0000, 0x0000, MB2(0xE365), + MB2(0xFB8D), 0x0000, MB2(0xE361), MB2(0xE35B), /* 7DA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE35F), + MB2(0x8EF8), MB2(0x88DB), MB2(0xE35A), MB2(0xE362), + MB2(0xE366), MB2(0x8D6A), MB2(0x96D4), 0x0000, + MB2(0x92D4), MB2(0xE35C), 0x0000, MB2(0xFB8C), + MB2(0xE364), 0x0000, MB2(0xE359), MB2(0x925D), + 0x0000, MB2(0xE35E), MB2(0x88BB), MB2(0x96C8), + 0x0000, 0x0000, 0x0000, 0x0000, /* 7DC0 */ + 0x0000, 0x0000, 0x0000, MB2(0xE35D), + 0x0000, 0x0000, MB2(0x8BD9), MB2(0x94EA), + 0x0000, 0x0000, 0x0000, MB2(0x918D), + 0x0000, MB2(0x97CE), MB2(0x8F8F), 0x0000, + 0x0000, MB2(0xE38E), MB2(0xFB8E), 0x0000, + MB2(0xE367), 0x0000, MB2(0x90FC), 0x0000, + MB2(0xE363), MB2(0xE368), MB2(0xE36A), 0x0000, + MB2(0x92F7), MB2(0xE36D), 0x0000, 0x0000, /* 7DE0 */ + MB2(0xE369), 0x0000, 0x0000, 0x0000, + MB2(0x95D2), MB2(0x8AC9), 0x0000, 0x0000, + MB2(0x96C9), 0x0000, 0x0000, MB2(0x88DC), + 0x0000, 0x0000, MB2(0xE36C), 0x0000, + MB2(0x97FB), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE36B), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x898F), 0x0000, 0x0000, /* 7E00 */ + MB2(0x93EA), MB2(0xE36E), 0x0000, 0x0000, + 0x0000, MB2(0xE375), MB2(0xE36F), MB2(0xE376), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE372), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x949B), + 0x0000, 0x0000, MB2(0x8EC8), MB2(0xE374), + 0x0000, MB2(0xE371), MB2(0xE377), MB2(0xE370), /* 7E20 */ + 0x0000, 0x0000, MB2(0x8F63), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x9644), + 0x0000, 0x0000, MB2(0x8F6B), 0x0000, + 0x0000, MB2(0xE373), MB2(0xE380), 0x0000, + 0x0000, MB2(0xE37B), 0x0000, MB2(0xE37E), + 0x0000, MB2(0xE37C), MB2(0xE381), MB2(0xE37A), + 0x0000, MB2(0xE360), MB2(0x90D1), 0x0000, + 0x0000, MB2(0x94C9), 0x0000, MB2(0xE37D), /* 7E40 */ + 0x0000, 0x0000, MB2(0xE378), 0x0000, + 0x0000, 0x0000, MB2(0x9140), MB2(0x8C71), + 0x0000, MB2(0x8F4A), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xFB8F), 0x0000, + MB2(0x9044), MB2(0x9155), MB2(0xE384), 0x0000, + 0x0000, MB2(0xE386), MB2(0xE387), 0x0000, + 0x0000, MB2(0xE383), MB2(0xE385), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7E60 */ + 0x0000, 0x0000, MB2(0xE379), MB2(0xE382), + 0x0000, MB2(0xE38A), MB2(0xE389), 0x0000, + 0x0000, MB2(0x969A), 0x0000, 0x0000, + MB2(0x8C4A), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE388), 0x0000, MB2(0xE38C), + MB2(0xE38B), MB2(0xE38F), 0x0000, MB2(0xE391), + 0x0000, 0x0000, MB2(0x8E5B), MB2(0xE38D), /* 7E80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE392), MB2(0xE393), MB2(0xFA5C), 0x0000, + MB2(0xE394), 0x0000, MB2(0xE39A), MB2(0x935A), + MB2(0xE396), 0x0000, MB2(0xE395), MB2(0xE397), + MB2(0xE398), 0x0000, MB2(0xE399), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE39B), + MB2(0xE39C), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7EA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7EC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7EE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7F00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7F20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x8ACA), 0x0000, + MB2(0xE39D), 0x0000, MB2(0xE39E), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 7F40 */ + 0x0000, MB2(0xE39F), 0x0000, MB2(0xFB90), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE3A0), MB2(0xE3A1), MB2(0xE3A2), 0x0000, + MB2(0xE3A3), MB2(0xE3A4), 0x0000, 0x0000, + MB2(0xE3A6), MB2(0xE3A5), 0x0000, 0x0000, + MB2(0xE3A7), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE3A8), + MB2(0xE3A9), 0x0000, 0x0000, 0x0000, /* 7F60 */ + 0x0000, 0x0000, 0x0000, MB2(0xE3AC), + MB2(0xE3AA), MB2(0xE3AB), MB2(0x8DDF), MB2(0x8C72), + 0x0000, 0x0000, MB2(0x9275), 0x0000, + MB2(0x94B1), 0x0000, MB2(0x8F90), 0x0000, + 0x0000, MB2(0x946C), 0x0000, MB2(0x94EB), + MB2(0xE3AD), MB2(0x9CEB), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE3AE), MB2(0xE3B0), /* 7F80 */ + 0x0000, MB2(0x9785), MB2(0xE3AF), MB2(0xE3B2), + MB2(0xE3B1), 0x0000, MB2(0x9772), 0x0000, + MB2(0xE3B3), 0x0000, MB2(0x94FC), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE3B4), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE3B7), 0x0000, + 0x0000, MB2(0xE3B6), MB2(0xE3B5), 0x0000, + 0x0000, MB2(0xFB91), 0x0000, MB2(0xE3B8), /* 7FA0 */ + MB2(0x8C51), 0x0000, 0x0000, 0x0000, + MB2(0x9141), MB2(0x8B60), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE3BC), MB2(0xE3B9), + 0x0000, 0x0000, MB2(0xE3BA), 0x0000, + 0x0000, 0x0000, MB2(0xE3BD), 0x0000, + MB2(0xE3BE), MB2(0xE3BB), 0x0000, 0x0000, + 0x0000, MB2(0x8948), 0x0000, 0x0000, + 0x0000, MB2(0x89A5), 0x0000, 0x0000, /* 7FC0 */ + 0x0000, MB2(0xE3C0), MB2(0xE3C1), 0x0000, + 0x0000, 0x0000, MB2(0xE3C2), 0x0000, + MB2(0x9782), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x8F4B), 0x0000, + MB2(0xE3C4), MB2(0xE3C3), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9089), MB2(0xE3C5), 0x0000, 0x0000, /* 7FE0 */ + 0x0000, 0x0000, MB2(0xE3C6), 0x0000, + 0x0000, MB2(0xE3C7), 0x0000, MB2(0x8AE3), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x8ACB), 0x0000, 0x0000, MB2(0xE3C8), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE3C9), 0x0000, MB2(0x967C), + MB2(0x9783), 0x0000, 0x0000, 0x0000, + MB2(0x9773), MB2(0x9856), 0x0000, MB2(0x8D6C), /* 8000 */ + MB2(0xE3CC), MB2(0x8ED2), MB2(0xE3CB), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE3CD), + MB2(0x8EA7), 0x0000, 0x0000, 0x0000, + MB2(0x91CF), 0x0000, MB2(0xE3CE), 0x0000, + 0x0000, MB2(0x8D6B), 0x0000, MB2(0x96D5), + MB2(0xE3CF), MB2(0xE3D0), 0x0000, 0x0000, + MB2(0xE3D1), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE3D2), 0x0000, 0x0000, /* 8020 */ + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE3D3), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x8EA8), + 0x0000, 0x0000, MB2(0x96EB), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE3D5), + 0x0000, MB2(0x925E), 0x0000, MB2(0xE3D4), + 0x0000, 0x0000, 0x0000, 0x0000, /* 8040 */ + 0x0000, 0x0000, MB2(0xE3D7), 0x0000, + 0x0000, 0x0000, MB2(0xE3D6), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE3D8), 0x0000, + 0x0000, 0x0000, MB2(0x90B9), 0x0000, + MB2(0xE3D9), 0x0000, MB2(0xE3DA), 0x0000, + 0x0000, 0x0000, MB2(0x95B7), MB2(0xE3DB), + 0x0000, MB2(0x918F), MB2(0xE3DC), 0x0000, /* 8060 */ + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE3DD), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x97FC), + MB2(0xE3E0), 0x0000, MB2(0xE3DF), MB2(0xE3DE), + MB2(0x92AE), 0x0000, MB2(0xE3E1), MB2(0x9045), + 0x0000, MB2(0xE3E2), 0x0000, 0x0000, + 0x0000, MB2(0xE3E3), MB2(0x9857), MB2(0xE3E4), + 0x0000, 0x0000, 0x0000, 0x0000, /* 8080 */ + MB2(0xE3E5), MB2(0xE3E7), MB2(0xE3E6), MB2(0x94A3), + 0x0000, MB2(0x93F7), 0x0000, MB2(0x985D), + MB2(0x94A7), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE3E9), + 0x0000, 0x0000, MB2(0x8FD1), 0x0000, + MB2(0x9549), 0x0000, MB2(0xE3EA), MB2(0xE3E8), + 0x0000, MB2(0x8ACC), 0x0000, 0x0000, + 0x0000, MB2(0x8CD2), MB2(0x8E88), 0x0000, /* 80A0 */ + 0x0000, MB2(0x94EC), 0x0000, 0x0000, + 0x0000, MB2(0x8CA8), MB2(0x9662), 0x0000, + MB2(0xE3ED), MB2(0xE3EB), 0x0000, MB2(0x8D6D), + 0x0000, MB2(0x8D6E), MB2(0x88E7), 0x0000, + MB2(0x8DE6), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9478), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x88DD), /* 80C0 */ + MB2(0xE3F2), 0x0000, MB2(0x925F), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9477), 0x0000, MB2(0x91D9), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE3F4), 0x0000, + 0x0000, MB2(0xE3F0), MB2(0xE3F3), MB2(0xE3EE), + 0x0000, MB2(0xE3F1), MB2(0x9645), 0x0000, + 0x0000, MB2(0x8CD3), 0x0000, 0x0000, /* 80E0 */ + MB2(0x88FB), MB2(0xE3EF), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE3F6), + 0x0000, MB2(0xE3F7), 0x0000, 0x0000, + MB2(0x93B7), 0x0000, 0x0000, 0x0000, + MB2(0x8BB9), 0x0000, 0x0000, 0x0000, + MB2(0xE445), MB2(0x945C), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x8E89), 0x0000, /* 8100 */ + 0x0000, MB2(0x8BBA), MB2(0x90C6), MB2(0x9865), + MB2(0x96AC), MB2(0xE3F5), MB2(0x90D2), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x8B72), MB2(0xE3F8), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE3FA), /* 8120 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE3F9), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE3FB), + 0x0000, MB2(0x9245), 0x0000, MB2(0x945D), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x92AF), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE442), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 8140 */ + 0x0000, 0x0000, MB2(0xE441), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE3FC), + 0x0000, 0x0000, MB2(0x9074), 0x0000, + MB2(0x9585), MB2(0xE444), 0x0000, MB2(0xE443), + MB2(0x8D6F), MB2(0x9872), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE454), + 0x0000, 0x0000, 0x0000, 0x0000, /* 8160 */ + 0x0000, MB2(0xE448), MB2(0xE449), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x8EEE), + 0x0000, 0x0000, MB2(0xE447), 0x0000, + MB2(0x8D98), MB2(0xE446), 0x0000, 0x0000, + MB2(0xE44A), 0x0000, 0x0000, 0x0000, + MB2(0x92B0), MB2(0x95A0), MB2(0x9142), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x91DA), + MB2(0xE44E), 0x0000, MB2(0xE44F), MB2(0xE44B), /* 8180 */ + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE44C), 0x0000, MB2(0xE44D), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x8D70), + 0x0000, 0x0000, 0x0000, MB2(0xE455), + 0x0000, MB2(0xE451), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9586), 0x0000, + MB2(0x968C), MB2(0x9547), 0x0000, 0x0000, + MB2(0xE450), 0x0000, 0x0000, MB2(0xE453), /* 81A0 */ + MB2(0xE452), 0x0000, 0x0000, 0x0000, + MB2(0x9663), MB2(0xE456), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE457), 0x0000, 0x0000, MB2(0x9156), + 0x0000, MB2(0xE458), 0x0000, 0x0000, + MB2(0xE45A), 0x0000, MB2(0xE45E), 0x0000, + 0x0000, MB2(0xE45B), MB2(0xE459), MB2(0x945E), + MB2(0xE45C), 0x0000, MB2(0xE45D), 0x0000, /* 81C0 */ + 0x0000, 0x0000, MB2(0x89B0), 0x0000, + MB2(0xE464), MB2(0xE45F), 0x0000, 0x0000, + 0x0000, MB2(0xE460), 0x0000, 0x0000, + 0x0000, MB2(0xE461), 0x0000, MB2(0x919F), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE463), MB2(0xE462), MB2(0xE465), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE466), + MB2(0xE467), 0x0000, 0x0000, MB2(0x9062), /* 81E0 */ + 0x0000, MB2(0x89E7), 0x0000, MB2(0xE468), + MB2(0x97D5), 0x0000, MB2(0x8EA9), 0x0000, + 0x0000, MB2(0x8F4C), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x8E8A), + MB2(0x9276), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE469), MB2(0xE46A), + MB2(0x8950), 0x0000, MB2(0xE46B), 0x0000, + 0x0000, MB2(0xE46C), MB2(0xE46D), 0x0000, /* 8200 */ + 0x0000, MB2(0xE46E), 0x0000, MB2(0xE46F), + MB2(0x8BBB), MB2(0x9DA8), MB2(0xE470), 0x0000, + MB2(0x90E3), MB2(0xE471), MB2(0x8EC9), 0x0000, + MB2(0xE472), 0x0000, MB2(0x98AE), 0x0000, + 0x0000, 0x0000, MB2(0xE473), MB2(0x95DC), + MB2(0x8ADA), 0x0000, 0x0000, MB2(0x9143), + MB2(0x8F77), 0x0000, MB2(0x9591), MB2(0x8F4D), + 0x0000, 0x0000, 0x0000, 0x0000, /* 8220 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE474), MB2(0x8D71), MB2(0xE475), + MB2(0x94CA), 0x0000, MB2(0xE484), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE477), + 0x0000, MB2(0x91C7), MB2(0x9495), MB2(0x8CBD), + MB2(0xE476), MB2(0x9144), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE478), 0x0000, 0x0000, 0x0000, /* 8240 */ + 0x0000, 0x0000, 0x0000, MB2(0x92F8), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE47A), MB2(0xE479), MB2(0xE47C), 0x0000, + 0x0000, MB2(0xE47B), 0x0000, MB2(0xE47D), + 0x0000, 0x0000, MB2(0xE480), 0x0000, /* 8260 */ + MB2(0xE47E), 0x0000, MB2(0x8ACD), 0x0000, + MB2(0xE481), 0x0000, MB2(0xE482), MB2(0xE483), + 0x0000, 0x0000, MB2(0x8DAF), MB2(0x97C7), + 0x0000, MB2(0xE485), MB2(0x9046), 0x0000, + 0x0000, 0x0000, MB2(0x8990), MB2(0xE486), + MB2(0xE487), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE488), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 8280 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x88F0), + 0x0000, MB2(0xE489), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE48A), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x9587), 0x0000, 0x0000, + 0x0000, MB2(0x8EC5), 0x0000, MB2(0xE48C), + 0x0000, 0x0000, 0x0000, 0x0000, /* 82A0 */ + 0x0000, MB2(0x8A48), MB2(0x88B0), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE48B), + MB2(0xE48E), MB2(0x946D), 0x0000, MB2(0x9063), + 0x0000, MB2(0x89D4), 0x0000, MB2(0x9646), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x8C7C), MB2(0x8BDA), 0x0000, MB2(0xE48D), + 0x0000, MB2(0x89E8), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 82C0 */ + 0x0000, MB2(0x8AA1), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x8991), MB2(0xE492), MB2(0x97E8), + MB2(0x91DB), 0x0000, 0x0000, MB2(0x9563), + 0x0000, MB2(0xE49E), 0x0000, MB2(0x89D5), + MB2(0xE49C), 0x0000, MB2(0xE49A), MB2(0xE491), + 0x0000, MB2(0xE48F), 0x0000, MB2(0xE490), /* 82E0 */ + 0x0000, MB2(0x8EE1), MB2(0x8BEA), MB2(0x9297), + 0x0000, 0x0000, 0x0000, MB2(0x93CF), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x8970), 0x0000, MB2(0xE494), + MB2(0xE493), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE499), MB2(0xE495), MB2(0xE498), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xFB93), MB2(0x96CE), MB2(0xE497), /* 8300 */ + MB2(0x89D6), MB2(0x8A9D), MB2(0xE49B), 0x0000, + 0x0000, MB2(0xE49D), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x8C73), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE4A1), MB2(0xE4AA), + MB2(0xE4AB), 0x0000, 0x0000, 0x0000, + MB2(0x88A9), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE4B2), /* 8320 */ + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x88EF), 0x0000, 0x0000, MB2(0xE4A9), + 0x0000, 0x0000, 0x0000, MB2(0xE4A8), + 0x0000, MB2(0xE4A3), MB2(0xE4A2), 0x0000, + MB2(0xE4A0), MB2(0xE49F), MB2(0x9283), 0x0000, + MB2(0x91F9), MB2(0xE4A5), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE4A4), 0x0000, 0x0000, 0x0000, /* 8340 */ + 0x0000, MB2(0xE4A7), 0x0000, 0x0000, + 0x0000, MB2(0x9190), MB2(0x8C74), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x8960), + MB2(0xE4A6), 0x0000, MB2(0x8D72), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9191), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xFB94), 0x0000, /* 8360 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE4B8), + 0x0000, MB2(0xE4B9), 0x0000, MB2(0x89D7), + 0x0000, 0x0000, 0x0000, MB2(0x89AC), + MB2(0xE4B6), 0x0000, 0x0000, MB2(0xFB95), + 0x0000, 0x0000, 0x0000, 0x0000, /* 8380 */ + 0x0000, MB2(0xE4AC), 0x0000, MB2(0xE4B4), + 0x0000, MB2(0xE4BB), MB2(0xE4B5), 0x0000, + 0x0000, 0x0000, MB2(0xE4B3), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE496), + 0x0000, 0x0000, MB2(0xE4B1), 0x0000, + 0x0000, 0x0000, MB2(0xE4AD), 0x0000, + 0x0000, 0x0000, MB2(0x8ACE), MB2(0xE4AF), + MB2(0xE4BA), 0x0000, MB2(0xE4B0), 0x0000, /* 83A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE4BC), 0x0000, MB2(0xE4AE), MB2(0x949C), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x9789), 0x0000, 0x0000, + 0x0000, MB2(0xE4B7), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE4CD), 0x0000, 0x0000, + 0x0000, MB2(0xE4C5), 0x0000, 0x0000, /* 83C0 */ + 0x0000, MB2(0x909B), 0x0000, MB2(0xFB96), + 0x0000, 0x0000, MB2(0x8B65), 0x0000, + MB2(0x8BDB), 0x0000, MB2(0xE4C0), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x89D9), + 0x0000, 0x0000, MB2(0x8FD2), 0x0000, + MB2(0xE4C3), 0x0000, 0x0000, 0x0000, + MB2(0x8DD8), 0x0000, 0x0000, MB2(0x9370), + MB2(0xE4C8), 0x0000, 0x0000, 0x0000, /* 83E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x95EC), 0x0000, MB2(0xE4BF), + 0x0000, 0x0000, 0x0000, MB2(0x89D8), + MB2(0x8CD4), MB2(0x9548), MB2(0xE4C9), 0x0000, + MB2(0xE4BD), 0x0000, MB2(0xFB97), MB2(0xE4C6), + 0x0000, 0x0000, 0x0000, MB2(0xE4D0), + 0x0000, MB2(0xE4C1), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE4C2), /* 8400 */ + MB2(0x93B8), 0x0000, 0x0000, MB2(0xE4C7), + 0x0000, 0x0000, 0x0000, MB2(0xE4C4), + MB2(0x9647), MB2(0xE4CA), MB2(0x88DE), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE4BE), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE4CC), 0x0000, MB2(0xE4CB), 0x0000, /* 8420 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x948B), MB2(0xE4D2), 0x0000, + MB2(0xE4DD), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x8A9E), 0x0000, 0x0000, + 0x0000, MB2(0xE4E0), 0x0000, 0x0000, + MB2(0xE4CE), 0x0000, 0x0000, 0x0000, + MB2(0xE4D3), MB2(0x978E), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 8440 */ + 0x0000, 0x0000, MB2(0xE4DC), 0x0000, + MB2(0xFB98), MB2(0x9774), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x97A8), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x9298), + 0x0000, 0x0000, 0x0000, MB2(0x8A8B), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x9592), MB2(0xE4E2), MB2(0x939F), /* 8460 */ + 0x0000, 0x0000, MB2(0x88AF), 0x0000, + 0x0000, MB2(0xE4DB), 0x0000, MB2(0xE4D7), + MB2(0x9192), MB2(0xE4D1), MB2(0xE4D9), MB2(0xE4DE), + 0x0000, MB2(0x944B), 0x0000, 0x0000, + 0x0000, MB2(0x88A8), 0x0000, MB2(0xE4D6), + 0x0000, MB2(0xE4DF), MB2(0x9598), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE4DA), 0x0000, /* 8480 */ + MB2(0xE4D5), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x8FD3), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x8F4E), 0x0000, 0x0000, 0x0000, + MB2(0x8EAA), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x96D6), 0x0000, 0x0000, + MB2(0x9566), 0x0000, 0x0000, MB2(0xE4E5), + 0x0000, MB2(0xE4EE), 0x0000, 0x0000, /* 84A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE4D8), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x8A97), 0x0000, + MB2(0xFB99), 0x0000, 0x0000, 0x0000, + MB2(0x8FF6), MB2(0xE4E3), 0x0000, MB2(0xE4E8), + MB2(0x9193), 0x0000, 0x0000, MB2(0xE4E4), + 0x0000, MB2(0xE4EB), 0x0000, 0x0000, /* 84C0 */ + MB2(0x927E), 0x0000, MB2(0xE4EC), 0x0000, + 0x0000, MB2(0x9775), MB2(0xE4E1), MB2(0x8A57), + 0x0000, MB2(0xE4E7), 0x0000, 0x0000, + MB2(0xE4EA), MB2(0x96AA), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE4ED), 0x0000, + 0x0000, MB2(0xE4E6), MB2(0xE4E9), 0x0000, + MB2(0xFA60), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 84E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9648), 0x0000, MB2(0x9840), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE4F1), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE4F8), 0x0000, 0x0000, MB2(0xE4F0), + MB2(0x8EC1), 0x0000, 0x0000, 0x0000, /* 8500 */ + 0x0000, 0x0000, MB2(0xE4CF), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x95CC), 0x0000, MB2(0x96A0), + MB2(0xE4F7), MB2(0xE4F6), 0x0000, MB2(0xE4F2), + MB2(0xE4F3), 0x0000, MB2(0x8955), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE4F5), + 0x0000, MB2(0xE4EF), 0x0000, 0x0000, /* 8520 */ + 0x0000, 0x0000, MB2(0x92D3), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE4F4), MB2(0x88FC), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x91A0), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x95C1), 0x0000, 0x0000, + MB2(0xE4F9), MB2(0xE540), 0x0000, MB2(0x94D7), /* 8540 */ + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE4FC), MB2(0x8FD4), MB2(0x8EC7), MB2(0xE542), + 0x0000, 0x0000, MB2(0x8BBC), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xFB9A), + 0x0000, MB2(0xE543), 0x0000, MB2(0x9599), + MB2(0xE4FB), MB2(0xFB9B), MB2(0xE4D4), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE4FA), /* 8560 */ + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x986E), MB2(0x93A0), MB2(0x9593), MB2(0xFB9C), + 0x0000, MB2(0xE54A), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE550), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE551), 0x0000, + MB2(0xE544), 0x0000, 0x0000, 0x0000, /* 8580 */ + MB2(0x9496), 0x0000, 0x0000, MB2(0xE54E), + MB2(0xE546), 0x0000, MB2(0xE548), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE552), MB2(0xE547), 0x0000, 0x0000, + MB2(0xE54B), 0x0000, 0x0000, MB2(0x8992), + 0x0000, MB2(0x93E3), 0x0000, MB2(0xE54C), + MB2(0xE54F), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 85A0 */ + MB2(0xE545), 0x0000, MB2(0x9145), 0x0000, + MB2(0xE549), MB2(0x8E46), MB2(0x9064), MB2(0x8C4F), + MB2(0x96F2), 0x0000, MB2(0x96F7), MB2(0x8F92), + MB2(0xFB9E), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE556), MB2(0xE554), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x986D), 0x0000, 0x0000, /* 85C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE553), 0x0000, 0x0000, + 0x0000, MB2(0x9795), 0x0000, MB2(0xE555), + MB2(0xE557), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE558), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE55B), MB2(0xE559), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 85E0 */ + MB2(0x93A1), MB2(0xE55A), 0x0000, 0x0000, + 0x0000, MB2(0x94CB), MB2(0xE54D), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x8F93), + 0x0000, MB2(0xE55C), MB2(0xE561), MB2(0x9194), + 0x0000, 0x0000, MB2(0xE560), 0x0000, + 0x0000, 0x0000, MB2(0xE541), 0x0000, /* 8600 */ + 0x0000, 0x0000, MB2(0xE562), MB2(0x9168), + 0x0000, 0x0000, MB2(0xE55D), MB2(0xE55F), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE55E), + 0x0000, 0x0000, MB2(0x9F50), MB2(0x9F41), + 0x0000, 0x0000, MB2(0xE564), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE563), 0x0000, /* 8620 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x9796), 0x0000, MB2(0xE1BA), + MB2(0xE565), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE566), + 0x0000, 0x0000, 0x0000, 0x0000, /* 8640 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE567), MB2(0x8CD5), 0x0000, + MB2(0x8B73), 0x0000, 0x0000, 0x0000, + MB2(0xE569), MB2(0x997C), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x8B95), 0x0000, + MB2(0x97B8), 0x0000, MB2(0x8BF1), MB2(0xE56A), + 0x0000, 0x0000, 0x0000, 0x0000, /* 8660 */ + 0x0000, 0x0000, 0x0000, MB2(0xE56B), + 0x0000, 0x0000, 0x0000, MB2(0x928E), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE56C), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x93F8), 0x0000, MB2(0x88B8), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 8680 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x89E1), MB2(0xE571), + MB2(0xE572), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE56D), + 0x0000, MB2(0x8E5C), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE56E), /* 86A0 */ + MB2(0x9461), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE56F), MB2(0xE570), MB2(0xE57A), + 0x0000, 0x0000, 0x0000, MB2(0xE574), + MB2(0xE577), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE573), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 86C0 */ + MB2(0xE575), 0x0000, MB2(0xE576), MB2(0x8ED6), + 0x0000, MB2(0xE578), 0x0000, MB2(0x9260), + 0x0000, MB2(0x8C75), MB2(0x8A61), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE57B), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x8A5E), 0x0000, MB2(0xE581), + 0x0000, 0x0000, MB2(0xE57C), MB2(0xE580), + 0x0000, 0x0000, 0x0000, 0x0000, /* 86E0 */ + MB2(0x94B8), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE57D), 0x0000, 0x0000, + MB2(0xE57E), MB2(0x9567), MB2(0x94D8), MB2(0xE582), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x91FB), MB2(0xE58C), 0x0000, MB2(0xE588), + 0x0000, 0x0000, MB2(0x89E9), 0x0000, + MB2(0xE586), 0x0000, MB2(0x9649), MB2(0xE587), /* 8700 */ + 0x0000, 0x0000, MB2(0xE584), 0x0000, + MB2(0xE585), MB2(0xE58A), MB2(0xE58D), 0x0000, + 0x0000, MB2(0xE58B), 0x0000, 0x0000, + 0x0000, MB2(0xE589), MB2(0xE583), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9277), 0x0000, MB2(0xE594), 0x0000, + MB2(0x96A8), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 8720 */ + 0x0000, MB2(0xE592), 0x0000, 0x0000, + 0x0000, MB2(0xE593), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE58E), 0x0000, 0x0000, MB2(0xE590), + 0x0000, 0x0000, 0x0000, MB2(0xE591), + 0x0000, 0x0000, 0x0000, MB2(0xE58F), + 0x0000, 0x0000, 0x0000, 0x0000, /* 8740 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x90E4), 0x0000, MB2(0x9858), + MB2(0xE598), 0x0000, MB2(0xE599), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE59F), + 0x0000, MB2(0x9049), 0x0000, MB2(0xE59B), + 0x0000, MB2(0xE59E), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE596), + MB2(0xE595), 0x0000, 0x0000, MB2(0xE5A0), /* 8760 */ + 0x0000, 0x0000, MB2(0x89DA), 0x0000, + MB2(0xE59C), 0x0000, MB2(0xE5A1), 0x0000, + 0x0000, 0x0000, MB2(0xE59D), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE59A), 0x0000, MB2(0x92B1), 0x0000, + MB2(0xE597), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x9488), + 0x0000, 0x0000, MB2(0xE5A5), 0x0000, /* 8780 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x975A), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE5A4), + 0x0000, 0x0000, MB2(0xE5A3), 0x0000, /* 87A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE5AC), + 0x0000, 0x0000, 0x0000, MB2(0xE5A6), + 0x0000, 0x0000, 0x0000, MB2(0xE5AE), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9786), MB2(0xE5B1), + 0x0000, MB2(0xE5A8), 0x0000, 0x0000, + MB2(0xE5A9), 0x0000, 0x0000, 0x0000, /* 87C0 */ + MB2(0xE5AD), 0x0000, MB2(0xE5B0), MB2(0xE5AF), + 0x0000, 0x0000, 0x0000, MB2(0xE5A7), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE5AA), 0x0000, MB2(0xE5BB), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE5B4), 0x0000, 0x0000, 0x0000, /* 87E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE5B2), + 0x0000, 0x0000, MB2(0xE5B3), 0x0000, + 0x0000, 0x0000, MB2(0xE5B8), MB2(0xE5B9), + 0x0000, MB2(0x8A49), 0x0000, MB2(0x8B61), + 0x0000, 0x0000, MB2(0xE5B7), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 8800 */ + 0x0000, MB2(0xE5A2), 0x0000, MB2(0xFBA1), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE5B6), MB2(0xE5BA), MB2(0xE5B5), + 0x0000, MB2(0xE5BC), 0x0000, 0x0000, + 0x0000, MB2(0xE5BE), MB2(0xE5BD), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE5C0), MB2(0xE5BF), MB2(0xE579), /* 8820 */ + 0x0000, 0x0000, 0x0000, MB2(0xE5C4), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE5C1), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE5C2), 0x0000, + 0x0000, MB2(0xE5C3), 0x0000, MB2(0xE5C5), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x8C8C), 0x0000, MB2(0xE5C7), 0x0000, /* 8840 */ + MB2(0xE5C6), 0x0000, MB2(0x8F4F), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x8D73), MB2(0x9FA5), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE5C8), MB2(0x8F70), + 0x0000, 0x0000, 0x0000, MB2(0x8A58), + 0x0000, MB2(0xE5C9), 0x0000, MB2(0x8971), + 0x0000, MB2(0x8FD5), MB2(0xE5CA), 0x0000, + 0x0000, MB2(0x8D74), MB2(0xE5CB), MB2(0x88DF), /* 8860 */ + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x955C), 0x0000, 0x0000, MB2(0xE5CC), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x908A), 0x0000, MB2(0xE5D3), 0x0000, + 0x0000, MB2(0xE5D0), 0x0000, MB2(0x928F), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE5D1), MB2(0xE5CE), MB2(0x8BDC), + 0x0000, MB2(0xE5CD), MB2(0xE5D4), 0x0000, /* 8880 */ + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x8C55), 0x0000, 0x0000, MB2(0x91DC), + 0x0000, MB2(0xE5DA), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE5D6), 0x0000, + 0x0000, 0x0000, MB2(0x91B3), MB2(0xE5D5), + 0x0000, MB2(0xE5D8), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE5CF), 0x0000, + 0x0000, 0x0000, MB2(0xE5D9), 0x0000, /* 88A0 */ + MB2(0xE5DB), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x94ED), + 0x0000, 0x0000, MB2(0xE5D7), 0x0000, + MB2(0xE5DC), MB2(0xE5DE), 0x0000, 0x0000, + MB2(0x8CD1), MB2(0xE5D2), 0x0000, MB2(0x88BF), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE5DD), + 0x0000, MB2(0x8DD9), MB2(0x97F4), MB2(0xE5DF), /* 88C0 */ + MB2(0xE5E0), MB2(0x9195), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x97A0), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE5E1), MB2(0x9754), 0x0000, 0x0000, + MB2(0xE5E2), MB2(0xE5E3), 0x0000, 0x0000, + MB2(0x95E2), MB2(0xE5E4), 0x0000, MB2(0x8DBE), + 0x0000, MB2(0x97A1), 0x0000, 0x0000, /* 88E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE5E9), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE5EA), MB2(0x8FD6), + MB2(0xE5E8), MB2(0xFBA2), 0x0000, 0x0000, + MB2(0x9787), MB2(0xE5E5), 0x0000, 0x0000, + MB2(0xE5E7), MB2(0x90BB), MB2(0x909E), 0x0000, + 0x0000, 0x0000, MB2(0xE5E6), 0x0000, /* 8900 */ + MB2(0xE5EB), 0x0000, 0x0000, MB2(0x95A1), + 0x0000, 0x0000, MB2(0xE5ED), 0x0000, + MB2(0xE5EC), 0x0000, 0x0000, 0x0000, + MB2(0x8A8C), 0x0000, MB2(0x964A), MB2(0xE5EE), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xFA5D), MB2(0xE5FA), MB2(0xE5F0), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 8920 */ + 0x0000, MB2(0xE5F1), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE5F2), MB2(0xE5F3), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE5F7), 0x0000, + MB2(0xE5F8), 0x0000, 0x0000, MB2(0xE5F6), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE5F4), 0x0000, MB2(0xE5EF), /* 8940 */ + MB2(0xE5F5), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE5F9), MB2(0xE8B5), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x89A6), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE5FC), MB2(0x8BDD), + MB2(0xE5FB), 0x0000, 0x0000, 0x0000, /* 8960 */ + MB2(0xE641), 0x0000, MB2(0xE640), 0x0000, + 0x0000, 0x0000, MB2(0xE643), 0x0000, + 0x0000, MB2(0xE642), 0x0000, MB2(0xE644), + 0x0000, 0x0000, MB2(0x8F50), 0x0000, + MB2(0xE645), 0x0000, 0x0000, MB2(0xE646), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE647), MB2(0x90BC), + 0x0000, MB2(0x9776), 0x0000, MB2(0xE648), /* 8980 */ + 0x0000, 0x0000, MB2(0x95A2), MB2(0x9465), + MB2(0xE649), 0x0000, MB2(0xE64A), MB2(0x8CA9), + 0x0000, 0x0000, 0x0000, MB2(0x8B4B), + 0x0000, 0x0000, 0x0000, MB2(0xE64B), + 0x0000, 0x0000, MB2(0x8E8B), MB2(0x9460), + MB2(0xE64C), 0x0000, MB2(0x8A6F), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE64D), 0x0000, 0x0000, /* 89A0 */ + 0x0000, 0x0000, MB2(0xE64F), MB2(0x9797), + 0x0000, MB2(0xE64E), MB2(0x9065), 0x0000, + MB2(0xE650), 0x0000, 0x0000, MB2(0xE651), + 0x0000, 0x0000, MB2(0xE652), MB2(0x8ACF), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE653), 0x0000, + 0x0000, MB2(0xE654), 0x0000, MB2(0xE655), + MB2(0xE656), 0x0000, 0x0000, 0x0000, /* 89C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x8A70), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE657), 0x0000, + MB2(0xE658), MB2(0xE659), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x89F0), /* 89E0 */ + 0x0000, 0x0000, MB2(0x9047), MB2(0xE65A), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE65B), 0x0000, 0x0000, 0x0000, + MB2(0xE65C), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x8CBE), 0x0000, MB2(0x92F9), MB2(0xE65D), /* 8A00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x8C76), 0x0000, MB2(0x9075), 0x0000, + MB2(0xE660), 0x0000, MB2(0x93A2), 0x0000, + MB2(0xE65F), 0x0000, MB2(0xFBA3), MB2(0x8C50), + 0x0000, 0x0000, MB2(0xE65E), MB2(0x91F5), + MB2(0x8B4C), 0x0000, 0x0000, MB2(0xE661), + 0x0000, MB2(0xE662), 0x0000, MB2(0x8FD7), + 0x0000, 0x0000, 0x0000, MB2(0x8C8D), /* 8A20 */ + 0x0000, MB2(0xE663), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x964B), 0x0000, + 0x0000, MB2(0x90DD), 0x0000, 0x0000, + 0x0000, MB2(0x8B96), 0x0000, MB2(0x96F3), + MB2(0x9169), 0x0000, MB2(0xE664), MB2(0xFBA4), + 0x0000, 0x0000, MB2(0x9066), MB2(0x9290), + MB2(0x8FD8), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE665), 0x0000, 0x0000, /* 8A40 */ + 0x0000, 0x0000, MB2(0xE668), 0x0000, + MB2(0xE669), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x8DBC), MB2(0x91C0), MB2(0xE667), 0x0000, + MB2(0x8FD9), MB2(0x955D), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE666), + 0x0000, 0x0000, MB2(0x8E8C), 0x0000, + MB2(0x8972), 0x0000, MB2(0xE66D), MB2(0x8C77), /* 8A60 */ + 0x0000, 0x0000, MB2(0x8E8E), 0x0000, + 0x0000, MB2(0x8E8D), 0x0000, MB2(0x986C), + MB2(0xE66C), MB2(0xE66B), MB2(0x9146), 0x0000, + MB2(0x8B6C), MB2(0x9862), MB2(0x8A59), MB2(0x8FDA), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xFBA5), 0x0000, 0x0000, + MB2(0xE66A), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE66F), 0x0000, /* 8A80 */ + MB2(0xE670), MB2(0xE66E), 0x0000, MB2(0x8CD6), + 0x0000, MB2(0x975F), 0x0000, 0x0000, + MB2(0x8E8F), MB2(0x9446), 0x0000, 0x0000, + 0x0000, MB2(0xE673), 0x0000, MB2(0x90BE), + 0x0000, MB2(0x9261), 0x0000, 0x0000, + MB2(0x9755), 0x0000, MB2(0xE676), 0x0000, + 0x0000, 0x0000, MB2(0x8CEA), 0x0000, + MB2(0x90BD), MB2(0xE672), 0x0000, MB2(0xE677), /* 8AA0 */ + MB2(0x8CEB), MB2(0xE674), MB2(0xE675), MB2(0xFBA6), + MB2(0xE671), 0x0000, 0x0000, 0x0000, + MB2(0x90E0), MB2(0x93C7), 0x0000, 0x0000, + MB2(0x924E), 0x0000, MB2(0x89DB), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x94EE), 0x0000, 0x0000, + MB2(0x8B62), 0x0000, MB2(0xFBA7), MB2(0x92B2), + 0x0000, 0x0000, MB2(0xE67A), 0x0000, /* 8AC0 */ + MB2(0xE678), 0x0000, 0x0000, MB2(0x926B), + 0x0000, 0x0000, 0x0000, MB2(0x90BF), + MB2(0x8AD0), MB2(0xE679), 0x0000, MB2(0x907A), + 0x0000, 0x0000, MB2(0x97C8), 0x0000, + 0x0000, 0x0000, MB2(0x985F), 0x0000, + 0x0000, 0x0000, MB2(0xE67B), MB2(0xE687), + MB2(0x92B3), 0x0000, MB2(0xE686), MB2(0xFBA8), + MB2(0xE683), MB2(0xE68B), MB2(0xE684), 0x0000, /* 8AE0 */ + MB2(0xE680), 0x0000, MB2(0x92FA), MB2(0xE67E), + 0x0000, 0x0000, 0x0000, MB2(0xE67C), + 0x0000, MB2(0x9740), MB2(0x8E90), 0x0000, + 0x0000, MB2(0xE681), 0x0000, MB2(0xE67D), + 0x0000, 0x0000, MB2(0xFBAA), MB2(0xE685), + MB2(0x8F94), 0x0000, MB2(0x8CBF), 0x0000, + 0x0000, 0x0000, MB2(0x91F8), 0x0000, + MB2(0x9664), MB2(0x8979), MB2(0x88E0), 0x0000, /* 8B00 */ + MB2(0x93A3), 0x0000, 0x0000, MB2(0xE689), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE688), 0x0000, MB2(0x93E4), 0x0000, + MB2(0xE68D), 0x0000, 0x0000, 0x0000, + MB2(0xE682), 0x0000, MB2(0xE68C), MB2(0xE68E), + 0x0000, MB2(0x8CAA), MB2(0xE68A), MB2(0x8D75), + 0x0000, MB2(0x8ED3), 0x0000, 0x0000, + MB2(0xE68F), MB2(0x9777), 0x0000, 0x0000, /* 8B20 */ + 0x0000, 0x0000, MB2(0xE692), 0x0000, + MB2(0xE695), 0x0000, 0x0000, MB2(0xE693), + MB2(0x9554), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE690), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x8BDE), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE694), 0x0000, + 0x0000, MB2(0xE696), 0x0000, 0x0000, /* 8B40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE69A), 0x0000, 0x0000, + MB2(0xE697), 0x0000, MB2(0xE699), MB2(0xE698), + 0x0000, 0x0000, 0x0000, MB2(0xFBAB), + 0x0000, 0x0000, MB2(0xE69B), 0x0000, + MB2(0x8EAF), 0x0000, MB2(0xE69D), MB2(0xE69C), + MB2(0x9588), 0x0000, 0x0000, MB2(0xE69F), + 0x0000, 0x0000, 0x0000, 0x0000, /* 8B60 */ + 0x0000, 0x0000, MB2(0x8C78), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE69E), + MB2(0xE6A0), 0x0000, 0x0000, MB2(0xE6A1), + MB2(0x8B63), MB2(0xE3BF), MB2(0x8FF7), 0x0000, + MB2(0xE6A2), 0x0000, 0x0000, MB2(0x8CEC), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE6A3), 0x0000, MB2(0xFBAC), + MB2(0xE6A4), 0x0000, 0x0000, MB2(0x8E5D), /* 8B80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9DCC), 0x0000, + MB2(0xE6A5), 0x0000, MB2(0xE6A6), 0x0000, + MB2(0x8F51), 0x0000, MB2(0xE6A7), MB2(0xE6A8), + 0x0000, 0x0000, MB2(0xE6A9), 0x0000, + 0x0000, MB2(0xE6AA), MB2(0xE6AB), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 8BA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 8BC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 8BE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 8C00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 8C20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x924A), + 0x0000, 0x0000, MB2(0xE6AC), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE6AE), + 0x0000, MB2(0xE6AD), 0x0000, 0x0000, /* 8C40 */ + 0x0000, 0x0000, MB2(0x93A4), 0x0000, + MB2(0xE6AF), 0x0000, MB2(0x964C), 0x0000, + MB2(0xE6B0), 0x0000, MB2(0xE6B1), 0x0000, + MB2(0xE6B2), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE6B3), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x93D8), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x8FDB), MB2(0xE6B4), 0x0000, /* 8C60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x8D8B), MB2(0x98AC), + MB2(0xE6B5), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE6B6), MB2(0x955E), MB2(0xE6B7), 0x0000, + MB2(0xE6BF), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE6B8), 0x0000, /* 8C80 */ + 0x0000, MB2(0xE6BA), 0x0000, 0x0000, + 0x0000, MB2(0xE6B9), MB2(0xE6BB), 0x0000, + MB2(0x9665), MB2(0xE6BC), MB2(0xE6BD), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE6BE), 0x0000, 0x0000, 0x0000, + MB2(0xE6C0), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x8A4C), MB2(0x92E5), 0x0000, + MB2(0x9589), MB2(0x8DE0), MB2(0x8D76), 0x0000, /* 8CA0 */ + 0x0000, 0x0000, 0x0000, MB2(0x956E), + MB2(0x89DD), MB2(0x94CC), MB2(0xE6C3), MB2(0x8AD1), + MB2(0x90D3), MB2(0xE6C2), MB2(0xE6C7), MB2(0x9299), + MB2(0x96E1), 0x0000, MB2(0xE6C5), MB2(0xE6C6), + MB2(0x8B4D), 0x0000, MB2(0xE6C8), MB2(0x9483), + MB2(0x91DD), 0x0000, 0x0000, MB2(0x94EF), + MB2(0x935C), MB2(0xE6C4), 0x0000, MB2(0x9666), + MB2(0x89EA), MB2(0xE6CA), MB2(0x9847), MB2(0x92C0), /* 8CC0 */ + MB2(0x9864), 0x0000, 0x0000, MB2(0x8E91), + MB2(0xE6C9), 0x0000, MB2(0x91AF), 0x0000, + 0x0000, MB2(0xE6DA), MB2(0x9147), 0x0000, + 0x0000, MB2(0x93F6), 0x0000, MB2(0x956F), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE6CD), MB2(0x8E5E), + MB2(0x8E92), 0x0000, MB2(0x8FDC), 0x0000, + MB2(0x9485), 0x0000, MB2(0x8CAB), MB2(0xE6CC), /* 8CE0 */ + MB2(0xE6CB), 0x0000, MB2(0x958A), 0x0000, + 0x0000, 0x0000, MB2(0x8EBF), 0x0000, + 0x0000, MB2(0x9371), 0x0000, 0x0000, + MB2(0xFBAD), 0x0000, 0x0000, 0x0000, + MB2(0xFBAE), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE6CF), MB2(0xE6D0), + MB2(0x8D77), MB2(0xE6CE), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 8D00 */ + MB2(0xE6D1), MB2(0xE6D2), 0x0000, MB2(0xE6D4), + MB2(0x91A1), 0x0000, MB2(0xE6D3), MB2(0x8AE4), + 0x0000, MB2(0xE6D6), 0x0000, MB2(0xE6D5), + MB2(0xE6D7), 0x0000, MB2(0xFBAF), MB2(0xE6D9), + MB2(0xE6DB), 0x0000, MB2(0xE6DC), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 8D20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 8D40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 8D60 */ + MB2(0x90D4), 0x0000, MB2(0x8ECD), MB2(0xE6DD), + 0x0000, 0x0000, 0x0000, MB2(0x8A71), + 0x0000, MB2(0xE6DE), 0x0000, 0x0000, + MB2(0x9196), MB2(0xE6DF), 0x0000, MB2(0xE6E0), + MB2(0x958B), 0x0000, MB2(0xFBB0), MB2(0x8B4E), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE6E1), 0x0000, 0x0000, /* 8D80 */ + 0x0000, MB2(0x92B4), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x897A), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE6E2), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x8EEF), /* 8DA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9096), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x91AB), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE6E5), 0x0000, + 0x0000, 0x0000, MB2(0xE6E4), 0x0000, + 0x0000, 0x0000, MB2(0xE6E3), 0x0000, /* 8DC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE6EB), + MB2(0xE6E9), 0x0000, 0x0000, MB2(0xE6E6), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE6E8), 0x0000, + 0x0000, 0x0000, MB2(0xE6E7), MB2(0xE6EA), + 0x0000, MB2(0x8B97), 0x0000, MB2(0xE6EE), + 0x0000, MB2(0x90D5), 0x0000, MB2(0xE6EF), /* 8DE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x8CD7), 0x0000, MB2(0xE6EC), MB2(0xE6ED), + 0x0000, 0x0000, 0x0000, MB2(0x9848), + 0x0000, 0x0000, 0x0000, MB2(0x92B5), + 0x0000, MB2(0x9148), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE6F0), 0x0000, 0x0000, MB2(0xE6F3), + 0x0000, 0x0000, 0x0000, 0x0000, /* 8E00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE6F1), MB2(0xE6F2), MB2(0x9778), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x93A5), + MB2(0xE6F6), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE6F4), MB2(0xE6F5), MB2(0xE6F7), + 0x0000, 0x0000, 0x0000, 0x0000, /* 8E20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE748), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE6FA), 0x0000, 0x0000, 0x0000, + MB2(0xE6FB), MB2(0xE6F9), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE6F8), 0x0000, /* 8E40 */ + MB2(0x92FB), 0x0000, 0x0000, MB2(0xE740), + MB2(0xE744), MB2(0xE741), MB2(0xE6FC), 0x0000, + MB2(0xE742), 0x0000, 0x0000, 0x0000, + MB2(0xE743), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE74A), 0x0000, 0x0000, + 0x0000, MB2(0xE745), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x90D6), + MB2(0xE747), 0x0000, 0x0000, MB2(0xE749), /* 8E60 */ + MB2(0xE746), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE74C), 0x0000, + MB2(0x8F52), 0x0000, MB2(0xE74B), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE74D), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE74E), 0x0000, 0x0000, /* 8E80 */ + MB2(0xE751), MB2(0xE750), 0x0000, MB2(0xE74F), + 0x0000, 0x0000, MB2(0xE753), MB2(0xE752), + 0x0000, MB2(0x96F4), 0x0000, 0x0000, + 0x0000, MB2(0xE755), 0x0000, MB2(0xE754), + MB2(0xE756), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE757), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE759), 0x0000, 0x0000, /* 8EA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE758), MB2(0x9067), + MB2(0xE75A), 0x0000, 0x0000, MB2(0x8BEB), + MB2(0xE75B), MB2(0xE75D), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE75E), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 8EC0 */ + 0x0000, MB2(0xE75F), MB2(0xE75C), 0x0000, + MB2(0xE760), 0x0000, MB2(0x8ED4), MB2(0xE761), + MB2(0x8B4F), MB2(0x8C52), 0x0000, MB2(0xFBB2), + 0x0000, 0x0000, MB2(0x8CAC), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE762), + 0x0000, 0x0000, 0x0000, MB2(0x93EE), + 0x0000, 0x0000, MB2(0x935D), MB2(0xE763), /* 8EE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE766), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x8EB2), 0x0000, 0x0000, MB2(0xE765), + MB2(0xE764), MB2(0x8C79), MB2(0xE767), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x8A72), /* 8F00 */ + 0x0000, MB2(0xE769), 0x0000, 0x0000, + 0x0000, MB2(0x8DDA), MB2(0xE768), 0x0000, + MB2(0xE771), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE76B), MB2(0xE76D), + MB2(0x95E3), MB2(0xE76A), 0x0000, 0x0000, + 0x0000, MB2(0xE76C), 0x0000, MB2(0xE770), + MB2(0xE76E), MB2(0x8B50), 0x0000, MB2(0xE76F), + 0x0000, 0x0000, 0x0000, 0x0000, /* 8F20 */ + 0x0000, 0x0000, MB2(0xE772), 0x0000, + 0x0000, MB2(0x9479), MB2(0x97D6), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x8F53), + 0x0000, 0x0000, 0x0000, MB2(0xE773), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9741), MB2(0xE775), 0x0000, MB2(0xE774), + 0x0000, 0x0000, MB2(0xE778), MB2(0x9760), + 0x0000, 0x0000, MB2(0xE777), 0x0000, /* 8F40 */ + MB2(0x8A8D), MB2(0xE776), MB2(0xE77B), 0x0000, + 0x0000, MB2(0xE77A), 0x0000, 0x0000, + MB2(0xE779), MB2(0x9351), MB2(0xE77C), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE77D), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE77E), 0x0000, 0x0000, MB2(0x8D8C), + 0x0000, MB2(0x8C44), MB2(0xE780), MB2(0xE781), /* 8F60 */ + MB2(0xE782), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 8F80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x9068), + MB2(0xE783), 0x0000, MB2(0x8EAB), MB2(0xE784), + 0x0000, 0x0000, 0x0000, MB2(0xE785), /* 8FA0 */ + 0x0000, 0x0000, 0x0000, MB2(0x999F), + MB2(0x999E), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE786), MB2(0xE390), MB2(0xE787), + MB2(0x9243), MB2(0x904A), MB2(0x945F), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE788), + 0x0000, 0x0000, MB2(0x95D3), MB2(0x92D2), + MB2(0x8D9E), 0x0000, 0x0000, MB2(0x9248), + 0x0000, 0x0000, MB2(0x8949), 0x0000, /* 8FC0 */ + MB2(0x9698), MB2(0x9076), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x8C7D), 0x0000, + 0x0000, MB2(0x8BDF), 0x0000, 0x0000, + MB2(0x95D4), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE789), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE78B), 0x0000, /* 8FE0 */ + 0x0000, MB2(0xE78A), MB2(0x89DE), 0x0000, + 0x0000, MB2(0x93F4), MB2(0xE78C), MB2(0x9497), + 0x0000, MB2(0x9352), 0x0000, MB2(0xE78D), + MB2(0x8F71), 0x0000, 0x0000, 0x0000, + MB2(0xE78F), 0x0000, 0x0000, MB2(0x96C0), + MB2(0xE79E), MB2(0xE791), MB2(0xE792), 0x0000, + 0x0000, MB2(0x92C7), 0x0000, 0x0000, + MB2(0x91DE), MB2(0x9197), 0x0000, MB2(0x93A6), /* 9000 */ + 0x0000, MB2(0xE790), MB2(0x8B74), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE799), + 0x0000, MB2(0xE796), MB2(0xE7A3), MB2(0x93A7), + MB2(0x9280), MB2(0xE793), 0x0000, MB2(0x92FC), + MB2(0x9372), MB2(0xE794), MB2(0xE798), MB2(0x9080), + 0x0000, MB2(0x9487), MB2(0x92CA), 0x0000, + 0x0000, MB2(0x90C0), MB2(0xE797), MB2(0x91AC), + MB2(0x91A2), MB2(0xE795), MB2(0x88A7), MB2(0x9841), /* 9020 */ + 0x0000, 0x0000, 0x0000, MB2(0xE79A), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x91DF), 0x0000, + 0x0000, MB2(0x8F54), MB2(0x9069), 0x0000, + 0x0000, MB2(0xE79C), MB2(0xE79B), 0x0000, + MB2(0x88ED), MB2(0xE79D), 0x0000, 0x0000, + MB2(0x954E), 0x0000, MB2(0xE7A5), 0x0000, + 0x0000, MB2(0x93D9), MB2(0x908B), 0x0000, /* 9040 */ + 0x0000, MB2(0x9278), 0x0000, MB2(0x8BF6), + 0x0000, MB2(0xE7A4), MB2(0x9756), MB2(0x895E), + 0x0000, MB2(0x95D5), MB2(0x89DF), MB2(0xE79F), + MB2(0xE7A0), MB2(0xE7A1), MB2(0xE7A2), MB2(0x93B9), + MB2(0x9242), MB2(0x88E1), MB2(0xE7A6), 0x0000, + MB2(0xE7A7), MB2(0xEAA1), 0x0000, 0x0000, + MB2(0x91BB), 0x0000, MB2(0xE7A8), 0x0000, + MB2(0x8993), MB2(0x916B), 0x0000, MB2(0x8CAD), /* 9060 */ + 0x0000, MB2(0x9779), 0x0000, MB2(0xFBB5), + MB2(0xE7A9), MB2(0x934B), 0x0000, 0x0000, + 0x0000, MB2(0x9198), MB2(0x8ED5), MB2(0xE7AA), + 0x0000, 0x0000, MB2(0xE7AD), 0x0000, + 0x0000, MB2(0x8F85), MB2(0xE7AB), MB2(0x914A), + MB2(0x9149), 0x0000, MB2(0x88E2), 0x0000, + MB2(0x97C9), MB2(0xE7AF), 0x0000, MB2(0x94F0), + MB2(0xE7B1), MB2(0xE7B0), MB2(0xE7AE), MB2(0xE284), /* 9080 */ + MB2(0x8AD2), 0x0000, 0x0000, MB2(0xE78E), + 0x0000, MB2(0xE7B3), MB2(0xE7B2), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE7B4), + 0x0000, MB2(0x9757), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x93DF), /* 90A0 */ + 0x0000, 0x0000, MB2(0x964D), 0x0000, + MB2(0xE7B5), 0x0000, MB2(0x8ED7), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE7B6), + 0x0000, MB2(0xE7B7), 0x0000, 0x0000, + 0x0000, MB2(0xE7B8), 0x0000, 0x0000, + MB2(0x9340), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x88E8), 0x0000, 0x0000, /* 90C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x8D78), 0x0000, + 0x0000, 0x0000, MB2(0x9859), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE7BC), + 0x0000, 0x0000, MB2(0xFBB6), 0x0000, + 0x0000, MB2(0x8C53), MB2(0xE7B9), 0x0000, /* 90E0 */ + MB2(0xE7BA), 0x0000, 0x0000, 0x0000, + MB2(0x9594), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x8A73), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x9758), 0x0000, MB2(0x8BBD), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x9373), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE7BD), 0x0000, /* 9100 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE7BE), 0x0000, + 0x0000, MB2(0xFBB8), 0x0000, 0x0000, + 0x0000, MB2(0xE7BF), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9120 */ + 0x0000, 0x0000, 0x0000, MB2(0xFBB9), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x9341), 0x0000, 0x0000, + MB2(0xE7C1), 0x0000, MB2(0xE7C0), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9140 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x93D1), MB2(0xE7C2), MB2(0x8F55), + MB2(0x8EDE), MB2(0x947A), MB2(0x9291), 0x0000, + 0x0000, 0x0000, MB2(0x8EF0), 0x0000, + MB2(0x908C), 0x0000, MB2(0xE7C3), 0x0000, + MB2(0xE7C4), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x907C), MB2(0xE7C5), /* 9160 */ + 0x0000, MB2(0xE7C6), 0x0000, 0x0000, + 0x0000, MB2(0xE7C7), MB2(0x978F), 0x0000, + MB2(0x8F56), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE7C9), MB2(0xE7C8), + 0x0000, MB2(0x8D79), 0x0000, MB2(0x8D93), + MB2(0x8E5F), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE7CC), 0x0000, /* 9180 */ + 0x0000, 0x0000, 0x0000, MB2(0x8F86), + 0x0000, MB2(0xE7CB), 0x0000, MB2(0xE7CA), + 0x0000, MB2(0x91E7), 0x0000, 0x0000, + MB2(0x8CED), 0x0000, MB2(0x90C1), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x94AE), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x8F58), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE7CD), 0x0000, /* 91A0 */ + MB2(0x8FDD), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE7D0), MB2(0xE7CE), + 0x0000, 0x0000, 0x0000, MB2(0xE7CF), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE7D2), MB2(0xE7D1), 0x0000, 0x0000, + MB2(0x8FF8), 0x0000, MB2(0xE7D3), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE7D4), MB2(0xE7D5), 0x0000, 0x0000, /* 91C0 */ + 0x0000, 0x0000, MB2(0x94CE), MB2(0x8DD1), + MB2(0x8EDF), MB2(0xE7D6), 0x0000, MB2(0xE7D7), + MB2(0x97A2), MB2(0x8F64), MB2(0x96EC), MB2(0x97CA), + MB2(0xE7D8), MB2(0x8BE0), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE7D9), MB2(0xFBBB), + MB2(0x9342), 0x0000, MB2(0xFBBA), MB2(0xE7DC), + MB2(0x8A98), MB2(0x906A), MB2(0xFBBC), MB2(0xE7DA), + 0x0000, MB2(0xE7DB), 0x0000, MB2(0x92DE), /* 91E0 */ + MB2(0xFBBF), MB2(0xFBC0), MB2(0x9674), MB2(0x8BFA), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xFBBD), MB2(0xFBBE), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE7DE), MB2(0xE7DF), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE7DD), 0x0000, 0x0000, MB2(0xE7E1), + 0x0000, 0x0000, 0x0000, 0x0000, /* 9200 */ + 0x0000, 0x0000, MB2(0xFBC1), 0x0000, + 0x0000, 0x0000, MB2(0xFBC3), 0x0000, + 0x0000, MB2(0x93DD), MB2(0x8A62), 0x0000, + MB2(0xFBC2), MB2(0xE7E5), 0x0000, 0x0000, + MB2(0xE7E2), MB2(0xE7E4), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE7E0), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9220 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE86E), 0x0000, 0x0000, + MB2(0xE7E3), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x97E9), 0x0000, 0x0000, MB2(0x8CD8), + 0x0000, MB2(0xFBCA), MB2(0xFBC4), 0x0000, + MB2(0xFBC6), 0x0000, 0x0000, MB2(0xE7ED), + MB2(0xFBC5), 0x0000, 0x0000, 0x0000, /* 9240 */ + MB2(0x9353), MB2(0xE7E8), 0x0000, 0x0000, + MB2(0xE7EB), MB2(0xE7E9), 0x0000, MB2(0xE7EE), + 0x0000, 0x0000, MB2(0xFBC7), 0x0000, + MB2(0xE7EF), MB2(0xFBC9), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE7E7), + 0x0000, MB2(0xFBC8), MB2(0xE7F4), MB2(0x8994), + 0x0000, 0x0000, MB2(0xE7E6), 0x0000, + 0x0000, 0x0000, MB2(0x94AB), 0x0000, /* 9260 */ + MB2(0xE7EA), 0x0000, MB2(0x8FDE), MB2(0xFBCB), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x8D7A), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xFBCD), + MB2(0xFBCE), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9667), 0x0000, + MB2(0x8BE2), 0x0000, 0x0000, MB2(0x8F65), /* 9280 */ + 0x0000, MB2(0x93BA), 0x0000, 0x0000, + MB2(0xFA5F), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x914C), 0x0000, MB2(0xE7F2), + 0x0000, MB2(0xE7EC), MB2(0xE7F1), 0x0000, + MB2(0x96C1), 0x0000, MB2(0x92B6), MB2(0xE7F3), + MB2(0xE7F0), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 92A0 */ + 0x0000, 0x0000, 0x0000, MB2(0xFBCC), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x914B), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE7F7), + 0x0000, MB2(0xE7F6), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 92C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE7F5), + MB2(0xFBD2), 0x0000, MB2(0x964E), MB2(0xFBD6), + 0x0000, MB2(0xFBD4), 0x0000, MB2(0xFBD0), + 0x0000, MB2(0xFBD1), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xFBD5), 0x0000, 0x0000, 0x0000, /* 92E0 */ + MB2(0x8F9B), 0x0000, 0x0000, MB2(0xFBCF), + 0x0000, MB2(0xE7F8), MB2(0x95DD), 0x0000, + 0x0000, MB2(0x8973), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9565), MB2(0x9292), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x8B98), MB2(0xFA65), MB2(0xE7FA), MB2(0xFBD9), + MB2(0x8D7C), 0x0000, 0x0000, MB2(0xFBDC), + 0x0000, 0x0000, MB2(0xFBDE), 0x0000, /* 9300 */ + 0x0000, 0x0000, MB2(0x8E4B), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE7F9), + MB2(0x908D), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x908E), MB2(0xE840), MB2(0xE842), 0x0000, + 0x0000, MB2(0xFBDD), MB2(0xFBDB), 0x0000, + MB2(0x8FF9), MB2(0xFBD8), MB2(0xE841), MB2(0xE843), /* 9320 */ + 0x0000, MB2(0xFBD7), MB2(0x8BD1), 0x0000, + MB2(0x9564), 0x0000, 0x0000, MB2(0x8EE0), + MB2(0x9842), 0x0000, MB2(0xE7FC), MB2(0x8DF6), + 0x0000, 0x0000, MB2(0x985E), 0x0000, + 0x0000, MB2(0xE845), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE844), MB2(0xE846), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9340 */ + MB2(0xE7FB), 0x0000, 0x0000, 0x0000, + MB2(0xFA5E), 0x0000, 0x0000, MB2(0x93E7), + 0x0000, MB2(0x9374), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x92D5), 0x0000, MB2(0xE84B), MB2(0xFBE0), + 0x0000, 0x0000, 0x0000, MB2(0x9262), + MB2(0xE847), 0x0000, 0x0000, 0x0000, + MB2(0xE848), 0x0000, 0x0000, 0x0000, /* 9360 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x8C4C), 0x0000, MB2(0xE84A), 0x0000, + MB2(0xFBDF), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x8CAE), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE849), 0x0000, MB2(0x8FDF), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9380 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x8A99), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE84F), 0x0000, MB2(0x8DBD), MB2(0x9199), + 0x0000, 0x0000, MB2(0x92C8), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 93A0 */ + MB2(0xFBE1), 0x0000, 0x0000, MB2(0x8A5A), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE84D), MB2(0xE84E), MB2(0x92C1), 0x0000, + MB2(0xE84C), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE850), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE856), /* 93C0 */ + 0x0000, 0x0000, MB2(0xFBE2), 0x0000, + MB2(0xE859), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE858), MB2(0x934C), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE851), MB2(0xE852), + MB2(0xE855), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE857), MB2(0xFBE3), 0x0000, + 0x0000, MB2(0x8BBE), 0x0000, 0x0000, /* 93E0 */ + MB2(0xE85A), MB2(0xE854), 0x0000, 0x0000, + MB2(0xE853), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xFBE4), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE85E), /* 9400 */ + 0x0000, 0x0000, 0x0000, MB2(0xE85F), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE860), 0x0000, 0x0000, MB2(0xE85D), + MB2(0xE85C), 0x0000, 0x0000, 0x0000, + MB2(0x8FE0), MB2(0x93A8), MB2(0xE85B), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE864), 0x0000, 0x0000, /* 9420 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE862), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xFBE5), 0x0000, 0x0000, + 0x0000, MB2(0xE863), MB2(0xE861), 0x0000, + MB2(0x91F6), 0x0000, MB2(0xE865), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE866), 0x0000, 0x0000, /* 9440 */ + MB2(0xE868), MB2(0xFBE6), 0x0000, 0x0000, + MB2(0xFBE7), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x8AD3), MB2(0xE867), MB2(0x96F8), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE873), MB2(0xE869), + 0x0000, 0x0000, MB2(0xE86C), 0x0000, + MB2(0xE86A), 0x0000, MB2(0xE86B), 0x0000, /* 9460 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE86D), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE86F), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE870), 0x0000, MB2(0xE871), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE874), MB2(0xE872), MB2(0xE875), MB2(0xE877), + 0x0000, MB2(0xE876), 0x0000, 0x0000, /* 9480 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 94A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 94C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 94E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9500 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9520 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9540 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9560 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x92B7), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x96E5), 0x0000, MB2(0xE878), MB2(0x914D), /* 9580 */ + 0x0000, 0x0000, 0x0000, MB2(0xE879), + 0x0000, MB2(0x95C2), MB2(0xE87A), MB2(0x8A4A), + 0x0000, 0x0000, 0x0000, MB2(0x895B), + 0x0000, MB2(0x8AD5), MB2(0xFBE8), MB2(0x8AD4), + MB2(0xE87B), 0x0000, MB2(0xE87C), 0x0000, + MB2(0xE87D), MB2(0xE87E), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE880), 0x0000, MB2(0x8AD6), MB2(0x8A74), /* 95A0 */ + MB2(0x8D7D), MB2(0x94B4), 0x0000, MB2(0xE882), + MB2(0xE881), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE883), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x897B), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE886), 0x0000, MB2(0xE885), + MB2(0xE884), 0x0000, MB2(0xE887), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE88A), /* 95C0 */ + 0x0000, 0x0000, 0x0000, MB2(0x88C5), + 0x0000, 0x0000, MB2(0xE888), 0x0000, + MB2(0xE88C), MB2(0xE88B), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE88E), MB2(0xE88D), MB2(0xE88F), 0x0000, + MB2(0x93AC), 0x0000, 0x0000, 0x0000, + MB2(0xE890), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE891), MB2(0xE893), 0x0000, /* 95E0 */ + 0x0000, MB2(0xE892), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9600 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x958C), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE894), 0x0000, 0x0000, /* 9620 */ + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE895), 0x0000, MB2(0x8DE3), 0x0000, + 0x0000, 0x0000, MB2(0xE896), MB2(0xE897), + 0x0000, 0x0000, MB2(0x9668), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x916A), + 0x0000, 0x0000, 0x0000, MB2(0x88A2), + MB2(0x91C9), 0x0000, MB2(0xE898), 0x0000, /* 9640 */ + MB2(0x958D), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE89B), + MB2(0xE899), MB2(0x8D7E), 0x0000, MB2(0xE89A), + MB2(0x8CC0), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x95C3), + MB2(0xE89D), MB2(0xE89F), MB2(0xE89E), MB2(0xE8A0), + 0x0000, 0x0000, MB2(0x8940), MB2(0x9077), /* 9660 */ + MB2(0x8F9C), MB2(0x8AD7), MB2(0xE8A1), 0x0000, + 0x0000, 0x0000, MB2(0x9486), 0x0000, + MB2(0xE8A3), 0x0000, 0x0000, 0x0000, + MB2(0x8941), 0x0000, MB2(0xE8A2), MB2(0x92C2), + 0x0000, MB2(0x97CB), MB2(0x93A9), MB2(0xE89C), + MB2(0x97A4), 0x0000, MB2(0x8CAF), 0x0000, + 0x0000, MB2(0x977A), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9680 */ + 0x0000, MB2(0x8BF7), MB2(0x97B2), 0x0000, + MB2(0x8C47), 0x0000, MB2(0x91E0), MB2(0xE440), + 0x0000, MB2(0xE8A4), MB2(0x8A4B), MB2(0x908F), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x8A75), MB2(0xE8A6), 0x0000, MB2(0xE8A7), + MB2(0xE8A5), MB2(0x8C84), 0x0000, MB2(0x8DDB), + MB2(0x8FE1), MB2(0xFBEB), 0x0000, 0x0000, + MB2(0x8942), 0x0000, 0x0000, MB2(0x97D7), /* 96A0 */ + 0x0000, 0x0000, 0x0000, MB2(0xE8A9), + MB2(0xE7AC), 0x0000, MB2(0xE8A8), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xFBEC), + MB2(0xE8AC), MB2(0xE8AA), MB2(0xE8AB), 0x0000, + MB2(0xE8AD), 0x0000, MB2(0xE8AE), MB2(0x97EA), + MB2(0xE8AF), MB2(0xE8B0), 0x0000, MB2(0x90C7), + MB2(0x94B9), 0x0000, 0x0000, 0x0000, + MB2(0x909D), MB2(0x8AE5), 0x0000, 0x0000, /* 96C0 */ + MB2(0x9759), MB2(0x89EB), MB2(0x8F57), MB2(0x8CD9), + 0x0000, MB2(0xE8B3), 0x0000, MB2(0xE8B2), + MB2(0x8E93), MB2(0xE8B4), MB2(0xE8B1), 0x0000, + 0x0000, MB2(0x8E47), 0x0000, 0x0000, + 0x0000, MB2(0xE8B8), MB2(0xE5AB), 0x0000, + 0x0000, MB2(0x99D4), 0x0000, MB2(0x9097), + MB2(0xE8B6), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x97A3), MB2(0x93EF), /* 96E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x894A), 0x0000, MB2(0x90E1), MB2(0x8EB4), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x95B5), 0x0000, MB2(0x895F), 0x0000, + 0x0000, 0x0000, MB2(0x97EB), MB2(0x978B), + 0x0000, MB2(0xE8B9), 0x0000, MB2(0x9364), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x8EF9), 0x0000, 0x0000, 0x0000, /* 9700 */ + MB2(0xE8BA), 0x0000, MB2(0xE8BB), MB2(0x906B), + MB2(0xE8BC), 0x0000, MB2(0x97EC), 0x0000, + 0x0000, MB2(0xE8B7), MB2(0xE8BE), MB2(0xE8C0), + 0x0000, MB2(0xE8BF), 0x0000, MB2(0xE8BD), + 0x0000, 0x0000, MB2(0xE8C1), 0x0000, + 0x0000, MB2(0xE8C2), 0x0000, 0x0000, + MB2(0x919A), 0x0000, MB2(0x89E0), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9720 */ + MB2(0xE8C3), 0x0000, 0x0000, MB2(0x96B6), + 0x0000, 0x0000, MB2(0xE8C4), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE8C5), 0x0000, MB2(0x9849), MB2(0xFBED), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9E50), MB2(0xE8C6), 0x0000, MB2(0xFBEE), + 0x0000, MB2(0xE8C7), MB2(0xE8C8), 0x0000, + 0x0000, 0x0000, MB2(0xE8CC), MB2(0xFBEF), /* 9740 */ + MB2(0xE8C9), 0x0000, MB2(0xE8CA), 0x0000, + MB2(0xE8CB), MB2(0xE8CD), 0x0000, 0x0000, + 0x0000, MB2(0xFBF0), 0x0000, MB2(0xFBF1), + 0x0000, MB2(0xFBF2), MB2(0x90C2), 0x0000, + 0x0000, MB2(0xFBF3), MB2(0x96F5), 0x0000, + 0x0000, MB2(0x90C3), 0x0000, 0x0000, + MB2(0xE8CE), 0x0000, MB2(0x94F1), 0x0000, + MB2(0xE8CF), MB2(0xEA72), MB2(0x96CA), 0x0000, /* 9760 */ + MB2(0xE8D0), 0x0000, MB2(0xE8D1), 0x0000, + MB2(0xE8D2), MB2(0x8A76), 0x0000, MB2(0xE8D4), + 0x0000, MB2(0x9078), 0x0000, 0x0000, + 0x0000, MB2(0xE8D5), 0x0000, 0x0000, + MB2(0x8C43), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE8D6), MB2(0xE8DA), 0x0000, + MB2(0xE8D8), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE8D9), 0x0000, 0x0000, /* 9780 */ + MB2(0x8A93), MB2(0xE8D7), MB2(0xE8DB), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE8DC), + 0x0000, MB2(0x88C6), 0x0000, MB2(0xE8DD), + MB2(0xE8DE), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x8FE2), 0x0000, 0x0000, 0x0000, + MB2(0xE8DF), 0x0000, 0x0000, 0x0000, + MB2(0x8B66), 0x0000, 0x0000, MB2(0xE8E2), /* 97A0 */ + 0x0000, 0x0000, MB2(0xE8E1), 0x0000, + MB2(0xE8E0), 0x0000, 0x0000, MB2(0xE691), + 0x0000, MB2(0x95DA), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE8E3), + MB2(0xE8E4), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE8E5), /* 97C0 */ + 0x0000, 0x0000, MB2(0xE8E6), 0x0000, + MB2(0xE8E7), 0x0000, 0x0000, MB2(0xE8E8), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x8AD8), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE8E9), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 97E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE8EA), MB2(0x9442), 0x0000, + 0x0000, 0x0000, MB2(0xE8EC), MB2(0x89B9), + 0x0000, MB2(0xE8EF), MB2(0xE8EE), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x8943), + 0x0000, 0x0000, 0x0000, MB2(0x8BBF), + 0x0000, MB2(0x95C5), MB2(0x92B8), MB2(0x8DA0), /* 9800 */ + 0x0000, MB2(0x8D80), MB2(0x8F87), 0x0000, + MB2(0x907B), 0x0000, 0x0000, 0x0000, + MB2(0xE8F1), 0x0000, 0x0000, MB2(0xE8F0), + MB2(0x9761), MB2(0x8AE6), MB2(0x94D0), MB2(0x93DA), + 0x0000, 0x0000, 0x0000, MB2(0x909C), + MB2(0x97CC), 0x0000, MB2(0x8C7A), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE8F4), 0x0000, 0x0000, /* 9820 */ + MB2(0xE8F3), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x966A), MB2(0x93AA), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x896F), 0x0000, 0x0000, MB2(0xE8F5), + MB2(0xE8F2), 0x0000, 0x0000, MB2(0x9570), + MB2(0x978A), MB2(0xE8F6), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9840 */ + 0x0000, 0x0000, MB2(0xE8F7), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE8F9), + MB2(0x91E8), MB2(0x8A7A), MB2(0x8A7B), MB2(0xE8F8), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x8AE7), MB2(0x8CB0), 0x0000, MB2(0xFBF4), + MB2(0x8AE8), 0x0000, 0x0000, MB2(0x935E), + 0x0000, 0x0000, MB2(0x97DE), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9860 */ + 0x0000, MB2(0xFBF5), 0x0000, MB2(0x8CDA), + 0x0000, 0x0000, 0x0000, MB2(0xE8FA), + 0x0000, 0x0000, 0x0000, MB2(0xE8FB), + MB2(0xE8FC), MB2(0xE940), 0x0000, MB2(0xE942), + MB2(0xE941), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9880 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 98A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9597), 0x0000, MB2(0xE943), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE944), + 0x0000, MB2(0xE945), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE946), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE948), /* 98C0 */ + MB2(0xE947), 0x0000, MB2(0xE949), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x94F2), + MB2(0xE3CA), 0x0000, 0x0000, MB2(0x9048), + 0x0000, 0x0000, MB2(0x8B51), 0x0000, /* 98E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE94A), 0x0000, MB2(0xE94B), + 0x0000, MB2(0x99AA), MB2(0x9F5A), MB2(0x94D1), + 0x0000, 0x0000, MB2(0x88F9), 0x0000, + MB2(0x88B9), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x8E94), MB2(0x964F), MB2(0x8FFC), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE94C), /* 9900 */ + 0x0000, MB2(0x96DD), 0x0000, 0x0000, + 0x0000, MB2(0xE94D), MB2(0x977B), 0x0000, + MB2(0x8961), 0x0000, 0x0000, 0x0000, + MB2(0x8E60), 0x0000, MB2(0xE94E), MB2(0x89EC), + MB2(0xE94F), 0x0000, 0x0000, 0x0000, + MB2(0xE950), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE952), MB2(0xE953), 0x0000, + MB2(0xE955), MB2(0xE951), 0x0000, 0x0000, /* 9920 */ + MB2(0xE954), 0x0000, 0x0000, MB2(0xFBF8), + MB2(0x8AD9), 0x0000, 0x0000, 0x0000, + MB2(0xE956), 0x0000, MB2(0xE957), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE958), MB2(0xE959), 0x0000, + 0x0000, 0x0000, MB2(0xE95A), 0x0000, /* 9940 */ + 0x0000, MB2(0xE95C), 0x0000, 0x0000, + 0x0000, MB2(0xE95B), 0x0000, MB2(0xE95E), + MB2(0xE961), 0x0000, 0x0000, 0x0000, + MB2(0xE95D), MB2(0xE95F), MB2(0xE960), 0x0000, + 0x0000, MB2(0xE962), 0x0000, MB2(0x8BC0), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9960 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9980 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x8EF1), MB2(0xE963), + MB2(0xE964), MB2(0x8D81), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xFBFA), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 99A0 */ + 0x0000, MB2(0xE965), 0x0000, 0x0000, + MB2(0x8A5D), 0x0000, 0x0000, 0x0000, + MB2(0x946E), MB2(0xE966), MB2(0xE967), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x9279), + MB2(0x93E9), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE968), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x949D), 0x0000, 0x0000, /* 99C0 */ + MB2(0x91CA), MB2(0x8977), MB2(0x8BEC), 0x0000, + MB2(0x8BED), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x9293), MB2(0xE96D), MB2(0x8BEE), 0x0000, + 0x0000, MB2(0x89ED), 0x0000, 0x0000, + MB2(0xE96C), 0x0000, 0x0000, MB2(0xE96A), + 0x0000, MB2(0xE96B), 0x0000, MB2(0xE969), + 0x0000, 0x0000, MB2(0xE977), 0x0000, /* 99E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE96E), MB2(0xE96F), 0x0000, + 0x0000, MB2(0xE970), MB2(0xE971), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE973), 0x0000, 0x0000, MB2(0xE972), + 0x0000, 0x0000, 0x0000, MB2(0x8F78), + 0x0000, MB2(0xE974), 0x0000, 0x0000, /* 9A00 */ + 0x0000, MB2(0xE976), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x8B52), MB2(0xE975), + 0x0000, 0x0000, MB2(0x919B), MB2(0x8CB1), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE978), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9A20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x91CB), 0x0000, 0x0000, MB2(0xE979), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x93AB), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE97A), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE980), 0x0000, + MB2(0xE97D), 0x0000, MB2(0xE97C), MB2(0xE97E), /* 9A40 */ + 0x0000, MB2(0xE97B), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE982), MB2(0xFBFB), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE981), 0x0000, MB2(0xE984), + 0x0000, 0x0000, MB2(0x8BC1), MB2(0xE983), + 0x0000, 0x0000, 0x0000, MB2(0xE985), + 0x0000, 0x0000, MB2(0xE986), 0x0000, /* 9A60 */ + MB2(0xE988), MB2(0xE987), 0x0000, 0x0000, + 0x0000, MB2(0xE989), MB2(0xE98B), MB2(0xE98A), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9A80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9AA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x8D9C), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE98C), 0x0000, 0x0000, + MB2(0xE98D), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x8A5B), 0x0000, 0x0000, 0x0000, + MB2(0xE98E), 0x0000, 0x0000, 0x0000, + MB2(0xE98F), 0x0000, 0x0000, 0x0000, /* 9AC0 */ + MB2(0x9091), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE990), + 0x0000, MB2(0xE991), 0x0000, MB2(0xE992), + MB2(0xE993), 0x0000, 0x0000, 0x0000, + MB2(0x8D82), MB2(0xFBFC), 0x0000, 0x0000, + MB2(0xFC40), 0x0000, MB2(0xE994), MB2(0xE995), + 0x0000, 0x0000, MB2(0xE996), MB2(0xE997), /* 9AE0 */ + 0x0000, 0x0000, MB2(0xE998), 0x0000, + 0x0000, 0x0000, MB2(0x94AF), MB2(0xE99A), + 0x0000, MB2(0x9545), MB2(0xE99B), MB2(0xE999), + 0x0000, MB2(0xE99D), 0x0000, 0x0000, + MB2(0xE99C), 0x0000, 0x0000, MB2(0xE99E), + 0x0000, 0x0000, 0x0000, MB2(0xE99F), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9B00 */ + 0x0000, 0x0000, MB2(0xE9A0), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE9A1), 0x0000, MB2(0xE9A2), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE9A3), + 0x0000, 0x0000, MB2(0xE9A4), MB2(0xE9A5), /* 9B20 */ + 0x0000, MB2(0xE9A6), 0x0000, MB2(0xE9A7), + MB2(0xE9A8), MB2(0xE9A9), MB2(0xE9AA), 0x0000, + 0x0000, 0x0000, MB2(0xE9AB), MB2(0xE9AC), + 0x0000, MB2(0x9F54), MB2(0xE9AD), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE2F6), + MB2(0x8B53), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x8A40), MB2(0x8DB0), MB2(0xE9AF), /* 9B40 */ + MB2(0xE9AE), MB2(0x96A3), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE9B1), MB2(0xE9B2), MB2(0xE9B0), + 0x0000, MB2(0xE9B3), 0x0000, 0x0000, + MB2(0x9682), 0x0000, 0x0000, 0x0000, + MB2(0xE9B4), 0x0000, MB2(0x8B9B), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9B60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x9844), + 0x0000, 0x0000, MB2(0xFC42), 0x0000, + MB2(0xE9B5), MB2(0xFC41), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE9B7), /* 9B80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x88BC), MB2(0xFC43), + 0x0000, MB2(0xE9B8), MB2(0x95A9), MB2(0xE9B6), + 0x0000, 0x0000, MB2(0xE9B9), MB2(0xE9BA), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE9BB), + MB2(0xE9BC), 0x0000, 0x0000, 0x0000, /* 9BA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE9BD), 0x0000, MB2(0x968E), MB2(0x8E4C), + 0x0000, MB2(0x8DF8), MB2(0x914E), 0x0000, + 0x0000, MB2(0xFC44), 0x0000, 0x0000, + MB2(0xE9BE), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE9C1), 0x0000, MB2(0xFC45), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE9BF), 0x0000, 0x0000, 0x0000, /* 9BC0 */ + 0x0000, 0x0000, MB2(0xE9C2), 0x0000, + 0x0000, MB2(0x8CEF), MB2(0xE9C0), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE9C3), + 0x0000, MB2(0xE9C4), MB2(0xE9C5), 0x0000, + MB2(0xE9C9), 0x0000, MB2(0x8E49), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x91E2), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE9CA), MB2(0xE9C7), MB2(0xE9C6), /* 9BE0 */ + MB2(0xE9C8), 0x0000, 0x0000, 0x0000, + MB2(0x8C7E), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE9CE), MB2(0xE9CD), MB2(0xE9CC), 0x0000, + 0x0000, MB2(0x88B1), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xFC46), 0x0000, 0x0000, 0x0000, /* 9C00 */ + MB2(0xE9D8), 0x0000, MB2(0xE9D4), 0x0000, + MB2(0xE9D5), MB2(0xE9D1), MB2(0xE9D7), 0x0000, + MB2(0xE9D3), MB2(0x8A82), 0x0000, 0x0000, + MB2(0x986B), 0x0000, MB2(0xE9D6), MB2(0xE9D2), + MB2(0xE9D0), MB2(0xE9CF), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE9DA), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xE9DD), 0x0000, 0x0000, /* 9C20 */ + MB2(0xE9DC), MB2(0xE9DB), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x9568), MB2(0xE9D9), MB2(0x88F1), + MB2(0xE9DE), 0x0000, MB2(0xE9E0), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x8A8F), MB2(0xE9CB), MB2(0x8956), + 0x0000, 0x0000, MB2(0xE9E2), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9C40 */ + 0x0000, 0x0000, MB2(0xE9E1), MB2(0xE9DF), + MB2(0x924C), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9690), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x97D8), + 0x0000, 0x0000, MB2(0xE9E3), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xE9E4), 0x0000, 0x0000, 0x0000, /* 9C60 */ + 0x0000, 0x0000, 0x0000, MB2(0xE9E5), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xE9E6), 0x0000, + MB2(0xE9E7), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9C80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9CA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9CC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9CE0 */ + 0x0000, MB2(0x92B9), 0x0000, MB2(0xE9E8), + 0x0000, MB2(0x94B5), 0x0000, MB2(0xE9ED), + MB2(0xE9E9), 0x0000, 0x0000, 0x0000, + MB2(0xE9EA), 0x0000, 0x0000, MB2(0x9650), + MB2(0x96C2), 0x0000, MB2(0x93CE), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xE9EE), /* 9D00 */ + 0x0000, 0x0000, MB2(0xE9EF), MB2(0x93BC), + MB2(0xE9EC), MB2(0xE9EB), 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x89A8), 0x0000, + 0x0000, 0x0000, MB2(0xE9F7), 0x0000, + 0x0000, MB2(0xE9F6), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x8995), + 0x0000, 0x0000, 0x0000, MB2(0xE9F4), + 0x0000, 0x0000, 0x0000, MB2(0xE9F3), /* 9D20 */ + 0x0000, 0x0000, MB2(0xE9F1), 0x0000, + MB2(0x8A9B), 0x0000, MB2(0xE9F0), MB2(0x8EB0), + MB2(0x89A7), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x8D83), + 0x0000, 0x0000, MB2(0xE9FA), MB2(0xE9F9), + 0x0000, MB2(0xE9F8), 0x0000, 0x0000, /* 9D40 */ + MB2(0xE9F5), 0x0000, MB2(0xE9FB), 0x0000, + MB2(0xE9FC), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xEA44), MB2(0xEA43), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xEA45), 0x0000, 0x0000, + MB2(0x894C), MB2(0xEA40), MB2(0xEA41), 0x0000, + MB2(0x8D94), MB2(0x96B7), 0x0000, 0x0000, /* 9D60 */ + MB2(0xEA42), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xFC48), + MB2(0x9651), 0x0000, 0x0000, MB2(0xEA4A), + MB2(0xFC47), 0x0000, MB2(0xEA46), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xEA4B), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9D80 */ + 0x0000, 0x0000, 0x0000, MB2(0xEA48), + 0x0000, MB2(0xEA47), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x8C7B), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xEA4C), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9DA0 */ + MB2(0xEA4D), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xEA4E), 0x0000, MB2(0xEA49), + 0x0000, 0x0000, 0x0000, MB2(0xE9F2), + 0x0000, 0x0000, MB2(0xEA4F), 0x0000, + MB2(0x92DF), 0x0000, 0x0000, 0x0000, + MB2(0xEA53), 0x0000, MB2(0xEA54), MB2(0xEA52), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xEA51), MB2(0xEA57), 0x0000, /* 9DC0 */ + MB2(0xEA50), 0x0000, MB2(0xEA55), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xEA56), + 0x0000, 0x0000, 0x0000, MB2(0xEA59), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xEA58), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9DE0 */ + 0x0000, 0x0000, MB2(0xEA5B), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xEA5C), 0x0000, MB2(0xEA5D), + 0x0000, 0x0000, MB2(0x9868), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xEA5A), MB2(0x91E9), MB2(0x8DEB), 0x0000, + 0x0000, MB2(0xEA5E), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9E00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xFC4A), MB2(0xEA5F), MB2(0xEA60), + 0x0000, 0x0000, MB2(0xEA61), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9E20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9E40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9E60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xEA62), 0x0000, 0x0000, + MB2(0x8CB2), MB2(0xEA63), 0x0000, 0x0000, + 0x0000, MB2(0xEA64), 0x0000, MB2(0x8EAD), + 0x0000, MB2(0xEA65), 0x0000, 0x0000, /* 9E80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xEA66), 0x0000, 0x0000, MB2(0xEA67), + MB2(0xEA68), 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xEA6B), MB2(0xEA69), MB2(0x985B), + 0x0000, MB2(0xEA6A), 0x0000, MB2(0x97ED), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xEA6C), 0x0000, MB2(0x97D9), + 0x0000, 0x0000, 0x0000, 0x0000, /* 9EA0 */ + 0x0000, MB2(0xEA6D), MB2(0x949E), 0x0000, + 0x0000, MB2(0xEA6E), MB2(0xEA70), 0x0000, + 0x0000, MB2(0xEA71), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xEA6F), MB2(0x8D8D), MB2(0x96CB), MB2(0x9683), + MB2(0x9BF5), 0x0000, MB2(0x9F80), MB2(0x969B), + 0x0000, 0x0000, 0x0000, 0x0000, /* 9EC0 */ + MB2(0x89A9), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xEA73), MB2(0x8B6F), MB2(0xEA74), MB2(0xEA75), + MB2(0xEA76), MB2(0xFC4B), MB2(0x8D95), 0x0000, + MB2(0xEA77), 0x0000, 0x0000, 0x0000, + MB2(0xE0D2), MB2(0x96D9), 0x0000, MB2(0x91E1), + MB2(0xEA78), MB2(0xEA7A), MB2(0xEA79), 0x0000, + MB2(0xEA7B), 0x0000, 0x0000, 0x0000, /* 9EE0 */ + 0x0000, MB2(0xEA7C), 0x0000, 0x0000, + MB2(0xEA7D), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xEA7E), + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xEA80), 0x0000, MB2(0xEA81), MB2(0xEA82), + 0x0000, MB2(0xEA83), 0x0000, MB2(0xEA84), + MB2(0xEA85), MB2(0xEA86), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9F00 */ + 0x0000, 0x0000, 0x0000, MB2(0xEA87), + MB2(0xEA88), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0x9343), 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x8CDB), + 0x0000, MB2(0xEA8A), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x916C), MB2(0xEA8B), 0x0000, 0x0000, /* 9F20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xEA8C), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0x9540), + 0x0000, 0x0000, MB2(0xEA8D), 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9F40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xEA8E), MB2(0xE256), + 0x0000, 0x0000, MB2(0xE6D8), MB2(0xE8EB), + 0x0000, 0x0000, MB2(0xEA8F), 0x0000, + MB2(0xEA90), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, MB2(0xEA92), + MB2(0xEA93), MB2(0xEA94), MB2(0x97EE), MB2(0xEA91), /* 9F60 */ + 0x0000, 0x0000, MB2(0xEA95), MB2(0xEA96), + 0x0000, 0x0000, MB2(0xEA98), 0x0000, + MB2(0xEA97), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xEA9A), 0x0000, + 0x0000, 0x0000, MB2(0xEA9B), MB2(0xEA99), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9F80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x97B4), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xEA9C), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xEA9D), MB2(0xE273), 0x0000, 0x0000, + MB2(0xEA9E), 0x0000, 0x0000, 0x0000, /* 9FA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9FC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* 9FE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A000 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A020 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A040 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A060 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A080 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A0A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A0C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A0E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A100 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A120 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A140 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A160 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A180 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A1A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A1C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A1E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A200 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A220 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A240 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A260 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A280 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A2A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A2C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A2E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A300 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A320 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A340 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A360 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A380 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A3A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A3C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A3E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A400 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A420 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A440 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A460 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A480 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A4A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A4C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A4E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A500 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A520 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A540 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A560 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A580 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A5A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A5C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A5E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A600 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A620 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A640 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A660 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A680 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A6A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A6C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A6E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A700 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A720 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A740 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A760 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A780 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A7A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A7C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A7E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A800 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A820 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A840 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A860 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A880 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A8A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A8C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A8E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A900 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A920 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A940 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A960 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A980 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A9A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A9C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* A9E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AA00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AA20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AA40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AA60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AA80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AAA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AAC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AAE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AB00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AB20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AB40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AB60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AB80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* ABA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* ABC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* ABE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AC00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AC20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AC40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AC60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AC80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* ACA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* ACC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* ACE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AD00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AD20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AD40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AD60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AD80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* ADA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* ADC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* ADE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AE00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AE20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AE40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AE60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AE80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AEA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AEC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AEE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AF00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AF20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AF40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AF60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AF80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AFA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AFC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* AFE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B000 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B020 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B040 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B060 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B080 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B0A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B0C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B0E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B100 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B120 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B140 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B160 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B180 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B1A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B1C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B1E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B200 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B220 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B240 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B260 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B280 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B2A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B2C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B2E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B300 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B320 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B340 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B360 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B380 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B3A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B3C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B3E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B400 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B420 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B440 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B460 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B480 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B4A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B4C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B4E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B500 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B520 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B540 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B560 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B580 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B5A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B5C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B5E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B600 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B620 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B640 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B660 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B680 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B6A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B6C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B6E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B700 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B720 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B740 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B760 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B780 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B7A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B7C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B7E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B800 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B820 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B840 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B860 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B880 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B8A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B8C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B8E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B900 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B920 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B940 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B960 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B980 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B9A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B9C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* B9E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BA00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BA20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BA40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BA60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BA80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BAA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BAC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BAE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BB00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BB20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BB40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BB60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BB80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BBA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BBC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BBE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BC00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BC20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BC40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BC60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BC80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BCA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BCC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BCE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BD00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BD20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BD40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BD60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BD80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BDA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BDC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BDE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BE00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BE20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BE40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BE60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BE80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BEA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BEC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BEE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BF00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BF20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BF40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BF60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BF80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BFA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BFC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* BFE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C000 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C020 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C040 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C060 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C080 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C0A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C0C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C0E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C100 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C120 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C140 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C160 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C180 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C1A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C1C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C1E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C200 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C220 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C240 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C260 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C280 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C2A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C2C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C2E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C300 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C320 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C340 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C360 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C380 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C3A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C3C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C3E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C400 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C420 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C440 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C460 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C480 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C4A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C4C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C4E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C500 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C520 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C540 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C560 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C580 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C5A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C5C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C5E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C600 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C620 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C640 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C660 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C680 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C6A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C6C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C6E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C700 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C720 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C740 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C760 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C780 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C7A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C7C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C7E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C800 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C820 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C840 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C860 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C880 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C8A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C8C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C8E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C900 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C920 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C940 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C960 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C980 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C9A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C9C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* C9E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CA00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CA20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CA40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CA60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CA80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CAA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CAC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CAE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CB00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CB20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CB40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CB60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CB80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CBA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CBC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CBE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CC00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CC20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CC40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CC60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CC80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CCA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CCC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CCE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CD00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CD20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CD40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CD60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CD80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CDA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CDC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CDE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CE00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CE20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CE40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CE60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CE80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CEA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CEC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CEE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CF00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CF20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CF40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CF60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CF80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CFA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CFC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* CFE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D000 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D020 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D040 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D060 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D080 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D0A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D0C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D0E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D100 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D120 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D140 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D160 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D180 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D1A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D1C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D1E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D200 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D220 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D240 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D260 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D280 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D2A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D2C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D2E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D300 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D320 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D340 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D360 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D380 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D3A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D3C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D3E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D400 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D420 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D440 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D460 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D480 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D4A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D4C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D4E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D500 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D520 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D540 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D560 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D580 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D5A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D5C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D5E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D600 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D620 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D640 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D660 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D680 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D6A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D6C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D6E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D700 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D720 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D740 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D760 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D780 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D7A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D7C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D7E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D800 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D820 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D840 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D860 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D880 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D8A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D8C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D8E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D900 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D920 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D940 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D960 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D980 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D9A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D9C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* D9E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DA00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DA20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DA40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DA60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DA80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DAA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DAC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DAE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DB00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DB20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DB40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DB60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DB80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DBA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DBC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DBE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DC00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DC20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DC40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DC60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DC80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DCA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DCC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DCE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DD00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DD20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DD40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DD60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DD80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DDA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DDC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DDE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DE00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DE20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DE40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DE60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DE80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DEA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DEC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DEE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DF00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DF20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DF40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DF60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DF80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DFA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DFC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* DFE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xF040), MB2(0xF041), MB2(0xF042), MB2(0xF043), /* E000 */ + MB2(0xF044), MB2(0xF045), MB2(0xF046), MB2(0xF047), + MB2(0xF048), MB2(0xF049), MB2(0xF04A), MB2(0xF04B), + MB2(0xF04C), MB2(0xF04D), MB2(0xF04E), MB2(0xF04F), + MB2(0xF050), MB2(0xF051), MB2(0xF052), MB2(0xF053), + MB2(0xF054), MB2(0xF055), MB2(0xF056), MB2(0xF057), + MB2(0xF058), MB2(0xF059), MB2(0xF05A), MB2(0xF05B), + MB2(0xF05C), MB2(0xF05D), MB2(0xF05E), MB2(0xF05F), + MB2(0xF060), MB2(0xF061), MB2(0xF062), MB2(0xF063), /* E020 */ + MB2(0xF064), MB2(0xF065), MB2(0xF066), MB2(0xF067), + MB2(0xF068), MB2(0xF069), MB2(0xF06A), MB2(0xF06B), + MB2(0xF06C), MB2(0xF06D), MB2(0xF06E), MB2(0xF06F), + MB2(0xF070), MB2(0xF071), MB2(0xF072), MB2(0xF073), + MB2(0xF074), MB2(0xF075), MB2(0xF076), MB2(0xF077), + MB2(0xF078), MB2(0xF079), MB2(0xF07A), MB2(0xF07B), + MB2(0xF07C), MB2(0xF07D), MB2(0xF07E), MB2(0xF080), + MB2(0xF081), MB2(0xF082), MB2(0xF083), MB2(0xF084), /* E040 */ + MB2(0xF085), MB2(0xF086), MB2(0xF087), MB2(0xF088), + MB2(0xF089), MB2(0xF08A), MB2(0xF08B), MB2(0xF08C), + MB2(0xF08D), MB2(0xF08E), MB2(0xF08F), MB2(0xF090), + MB2(0xF091), MB2(0xF092), MB2(0xF093), MB2(0xF094), + MB2(0xF095), MB2(0xF096), MB2(0xF097), MB2(0xF098), + MB2(0xF099), MB2(0xF09A), MB2(0xF09B), MB2(0xF09C), + MB2(0xF09D), MB2(0xF09E), MB2(0xF09F), MB2(0xF0A0), + MB2(0xF0A1), MB2(0xF0A2), MB2(0xF0A3), MB2(0xF0A4), /* E060 */ + MB2(0xF0A5), MB2(0xF0A6), MB2(0xF0A7), MB2(0xF0A8), + MB2(0xF0A9), MB2(0xF0AA), MB2(0xF0AB), MB2(0xF0AC), + MB2(0xF0AD), MB2(0xF0AE), MB2(0xF0AF), MB2(0xF0B0), + MB2(0xF0B1), MB2(0xF0B2), MB2(0xF0B3), MB2(0xF0B4), + MB2(0xF0B5), MB2(0xF0B6), MB2(0xF0B7), MB2(0xF0B8), + MB2(0xF0B9), MB2(0xF0BA), MB2(0xF0BB), MB2(0xF0BC), + MB2(0xF0BD), MB2(0xF0BE), MB2(0xF0BF), MB2(0xF0C0), + MB2(0xF0C1), MB2(0xF0C2), MB2(0xF0C3), MB2(0xF0C4), /* E080 */ + MB2(0xF0C5), MB2(0xF0C6), MB2(0xF0C7), MB2(0xF0C8), + MB2(0xF0C9), MB2(0xF0CA), MB2(0xF0CB), MB2(0xF0CC), + MB2(0xF0CD), MB2(0xF0CE), MB2(0xF0CF), MB2(0xF0D0), + MB2(0xF0D1), MB2(0xF0D2), MB2(0xF0D3), MB2(0xF0D4), + MB2(0xF0D5), MB2(0xF0D6), MB2(0xF0D7), MB2(0xF0D8), + MB2(0xF0D9), MB2(0xF0DA), MB2(0xF0DB), MB2(0xF0DC), + MB2(0xF0DD), MB2(0xF0DE), MB2(0xF0DF), MB2(0xF0E0), + MB2(0xF0E1), MB2(0xF0E2), MB2(0xF0E3), MB2(0xF0E4), /* E0A0 */ + MB2(0xF0E5), MB2(0xF0E6), MB2(0xF0E7), MB2(0xF0E8), + MB2(0xF0E9), MB2(0xF0EA), MB2(0xF0EB), MB2(0xF0EC), + MB2(0xF0ED), MB2(0xF0EE), MB2(0xF0EF), MB2(0xF0F0), + MB2(0xF0F1), MB2(0xF0F2), MB2(0xF0F3), MB2(0xF0F4), + MB2(0xF0F5), MB2(0xF0F6), MB2(0xF0F7), MB2(0xF0F8), + MB2(0xF0F9), MB2(0xF0FA), MB2(0xF0FB), MB2(0xF0FC), + MB2(0xF140), MB2(0xF141), MB2(0xF142), MB2(0xF143), + MB2(0xF144), MB2(0xF145), MB2(0xF146), MB2(0xF147), /* E0C0 */ + MB2(0xF148), MB2(0xF149), MB2(0xF14A), MB2(0xF14B), + MB2(0xF14C), MB2(0xF14D), MB2(0xF14E), MB2(0xF14F), + MB2(0xF150), MB2(0xF151), MB2(0xF152), MB2(0xF153), + MB2(0xF154), MB2(0xF155), MB2(0xF156), MB2(0xF157), + MB2(0xF158), MB2(0xF159), MB2(0xF15A), MB2(0xF15B), + MB2(0xF15C), MB2(0xF15D), MB2(0xF15E), MB2(0xF15F), + MB2(0xF160), MB2(0xF161), MB2(0xF162), MB2(0xF163), + MB2(0xF164), MB2(0xF165), MB2(0xF166), MB2(0xF167), /* E0E0 */ + MB2(0xF168), MB2(0xF169), MB2(0xF16A), MB2(0xF16B), + MB2(0xF16C), MB2(0xF16D), MB2(0xF16E), MB2(0xF16F), + MB2(0xF170), MB2(0xF171), MB2(0xF172), MB2(0xF173), + MB2(0xF174), MB2(0xF175), MB2(0xF176), MB2(0xF177), + MB2(0xF178), MB2(0xF179), MB2(0xF17A), MB2(0xF17B), + MB2(0xF17C), MB2(0xF17D), MB2(0xF17E), MB2(0xF180), + MB2(0xF181), MB2(0xF182), MB2(0xF183), MB2(0xF184), + MB2(0xF185), MB2(0xF186), MB2(0xF187), MB2(0xF188), /* E100 */ + MB2(0xF189), MB2(0xF18A), MB2(0xF18B), MB2(0xF18C), + MB2(0xF18D), MB2(0xF18E), MB2(0xF18F), MB2(0xF190), + MB2(0xF191), MB2(0xF192), MB2(0xF193), MB2(0xF194), + MB2(0xF195), MB2(0xF196), MB2(0xF197), MB2(0xF198), + MB2(0xF199), MB2(0xF19A), MB2(0xF19B), MB2(0xF19C), + MB2(0xF19D), MB2(0xF19E), MB2(0xF19F), MB2(0xF1A0), + MB2(0xF1A1), MB2(0xF1A2), MB2(0xF1A3), MB2(0xF1A4), + MB2(0xF1A5), MB2(0xF1A6), MB2(0xF1A7), MB2(0xF1A8), /* E120 */ + MB2(0xF1A9), MB2(0xF1AA), MB2(0xF1AB), MB2(0xF1AC), + MB2(0xF1AD), MB2(0xF1AE), MB2(0xF1AF), MB2(0xF1B0), + MB2(0xF1B1), MB2(0xF1B2), MB2(0xF1B3), MB2(0xF1B4), + MB2(0xF1B5), MB2(0xF1B6), MB2(0xF1B7), MB2(0xF1B8), + MB2(0xF1B9), MB2(0xF1BA), MB2(0xF1BB), MB2(0xF1BC), + MB2(0xF1BD), MB2(0xF1BE), MB2(0xF1BF), MB2(0xF1C0), + MB2(0xF1C1), MB2(0xF1C2), MB2(0xF1C3), MB2(0xF1C4), + MB2(0xF1C5), MB2(0xF1C6), MB2(0xF1C7), MB2(0xF1C8), /* E140 */ + MB2(0xF1C9), MB2(0xF1CA), MB2(0xF1CB), MB2(0xF1CC), + MB2(0xF1CD), MB2(0xF1CE), MB2(0xF1CF), MB2(0xF1D0), + MB2(0xF1D1), MB2(0xF1D2), MB2(0xF1D3), MB2(0xF1D4), + MB2(0xF1D5), MB2(0xF1D6), MB2(0xF1D7), MB2(0xF1D8), + MB2(0xF1D9), MB2(0xF1DA), MB2(0xF1DB), MB2(0xF1DC), + MB2(0xF1DD), MB2(0xF1DE), MB2(0xF1DF), MB2(0xF1E0), + MB2(0xF1E1), MB2(0xF1E2), MB2(0xF1E3), MB2(0xF1E4), + MB2(0xF1E5), MB2(0xF1E6), MB2(0xF1E7), MB2(0xF1E8), /* E160 */ + MB2(0xF1E9), MB2(0xF1EA), MB2(0xF1EB), MB2(0xF1EC), + MB2(0xF1ED), MB2(0xF1EE), MB2(0xF1EF), MB2(0xF1F0), + MB2(0xF1F1), MB2(0xF1F2), MB2(0xF1F3), MB2(0xF1F4), + MB2(0xF1F5), MB2(0xF1F6), MB2(0xF1F7), MB2(0xF1F8), + MB2(0xF1F9), MB2(0xF1FA), MB2(0xF1FB), MB2(0xF1FC), + MB2(0xF240), MB2(0xF241), MB2(0xF242), MB2(0xF243), + MB2(0xF244), MB2(0xF245), MB2(0xF246), MB2(0xF247), + MB2(0xF248), MB2(0xF249), MB2(0xF24A), MB2(0xF24B), /* E180 */ + MB2(0xF24C), MB2(0xF24D), MB2(0xF24E), MB2(0xF24F), + MB2(0xF250), MB2(0xF251), MB2(0xF252), MB2(0xF253), + MB2(0xF254), MB2(0xF255), MB2(0xF256), MB2(0xF257), + MB2(0xF258), MB2(0xF259), MB2(0xF25A), MB2(0xF25B), + MB2(0xF25C), MB2(0xF25D), MB2(0xF25E), MB2(0xF25F), + MB2(0xF260), MB2(0xF261), MB2(0xF262), MB2(0xF263), + MB2(0xF264), MB2(0xF265), MB2(0xF266), MB2(0xF267), + MB2(0xF268), MB2(0xF269), MB2(0xF26A), MB2(0xF26B), /* E1A0 */ + MB2(0xF26C), MB2(0xF26D), MB2(0xF26E), MB2(0xF26F), + MB2(0xF270), MB2(0xF271), MB2(0xF272), MB2(0xF273), + MB2(0xF274), MB2(0xF275), MB2(0xF276), MB2(0xF277), + MB2(0xF278), MB2(0xF279), MB2(0xF27A), MB2(0xF27B), + MB2(0xF27C), MB2(0xF27D), MB2(0xF27E), MB2(0xF280), + MB2(0xF281), MB2(0xF282), MB2(0xF283), MB2(0xF284), + MB2(0xF285), MB2(0xF286), MB2(0xF287), MB2(0xF288), + MB2(0xF289), MB2(0xF28A), MB2(0xF28B), MB2(0xF28C), /* E1C0 */ + MB2(0xF28D), MB2(0xF28E), MB2(0xF28F), MB2(0xF290), + MB2(0xF291), MB2(0xF292), MB2(0xF293), MB2(0xF294), + MB2(0xF295), MB2(0xF296), MB2(0xF297), MB2(0xF298), + MB2(0xF299), MB2(0xF29A), MB2(0xF29B), MB2(0xF29C), + MB2(0xF29D), MB2(0xF29E), MB2(0xF29F), MB2(0xF2A0), + MB2(0xF2A1), MB2(0xF2A2), MB2(0xF2A3), MB2(0xF2A4), + MB2(0xF2A5), MB2(0xF2A6), MB2(0xF2A7), MB2(0xF2A8), + MB2(0xF2A9), MB2(0xF2AA), MB2(0xF2AB), MB2(0xF2AC), /* E1E0 */ + MB2(0xF2AD), MB2(0xF2AE), MB2(0xF2AF), MB2(0xF2B0), + MB2(0xF2B1), MB2(0xF2B2), MB2(0xF2B3), MB2(0xF2B4), + MB2(0xF2B5), MB2(0xF2B6), MB2(0xF2B7), MB2(0xF2B8), + MB2(0xF2B9), MB2(0xF2BA), MB2(0xF2BB), MB2(0xF2BC), + MB2(0xF2BD), MB2(0xF2BE), MB2(0xF2BF), MB2(0xF2C0), + MB2(0xF2C1), MB2(0xF2C2), MB2(0xF2C3), MB2(0xF2C4), + MB2(0xF2C5), MB2(0xF2C6), MB2(0xF2C7), MB2(0xF2C8), + MB2(0xF2C9), MB2(0xF2CA), MB2(0xF2CB), MB2(0xF2CC), /* E200 */ + MB2(0xF2CD), MB2(0xF2CE), MB2(0xF2CF), MB2(0xF2D0), + MB2(0xF2D1), MB2(0xF2D2), MB2(0xF2D3), MB2(0xF2D4), + MB2(0xF2D5), MB2(0xF2D6), MB2(0xF2D7), MB2(0xF2D8), + MB2(0xF2D9), MB2(0xF2DA), MB2(0xF2DB), MB2(0xF2DC), + MB2(0xF2DD), MB2(0xF2DE), MB2(0xF2DF), MB2(0xF2E0), + MB2(0xF2E1), MB2(0xF2E2), MB2(0xF2E3), MB2(0xF2E4), + MB2(0xF2E5), MB2(0xF2E6), MB2(0xF2E7), MB2(0xF2E8), + MB2(0xF2E9), MB2(0xF2EA), MB2(0xF2EB), MB2(0xF2EC), /* E220 */ + MB2(0xF2ED), MB2(0xF2EE), MB2(0xF2EF), MB2(0xF2F0), + MB2(0xF2F1), MB2(0xF2F2), MB2(0xF2F3), MB2(0xF2F4), + MB2(0xF2F5), MB2(0xF2F6), MB2(0xF2F7), MB2(0xF2F8), + MB2(0xF2F9), MB2(0xF2FA), MB2(0xF2FB), MB2(0xF2FC), + MB2(0xF340), MB2(0xF341), MB2(0xF342), MB2(0xF343), + MB2(0xF344), MB2(0xF345), MB2(0xF346), MB2(0xF347), + MB2(0xF348), MB2(0xF349), MB2(0xF34A), MB2(0xF34B), + MB2(0xF34C), MB2(0xF34D), MB2(0xF34E), MB2(0xF34F), /* E240 */ + MB2(0xF350), MB2(0xF351), MB2(0xF352), MB2(0xF353), + MB2(0xF354), MB2(0xF355), MB2(0xF356), MB2(0xF357), + MB2(0xF358), MB2(0xF359), MB2(0xF35A), MB2(0xF35B), + MB2(0xF35C), MB2(0xF35D), MB2(0xF35E), MB2(0xF35F), + MB2(0xF360), MB2(0xF361), MB2(0xF362), MB2(0xF363), + MB2(0xF364), MB2(0xF365), MB2(0xF366), MB2(0xF367), + MB2(0xF368), MB2(0xF369), MB2(0xF36A), MB2(0xF36B), + MB2(0xF36C), MB2(0xF36D), MB2(0xF36E), MB2(0xF36F), /* E260 */ + MB2(0xF370), MB2(0xF371), MB2(0xF372), MB2(0xF373), + MB2(0xF374), MB2(0xF375), MB2(0xF376), MB2(0xF377), + MB2(0xF378), MB2(0xF379), MB2(0xF37A), MB2(0xF37B), + MB2(0xF37C), MB2(0xF37D), MB2(0xF37E), MB2(0xF380), + MB2(0xF381), MB2(0xF382), MB2(0xF383), MB2(0xF384), + MB2(0xF385), MB2(0xF386), MB2(0xF387), MB2(0xF388), + MB2(0xF389), MB2(0xF38A), MB2(0xF38B), MB2(0xF38C), + MB2(0xF38D), MB2(0xF38E), MB2(0xF38F), MB2(0xF390), /* E280 */ + MB2(0xF391), MB2(0xF392), MB2(0xF393), MB2(0xF394), + MB2(0xF395), MB2(0xF396), MB2(0xF397), MB2(0xF398), + MB2(0xF399), MB2(0xF39A), MB2(0xF39B), MB2(0xF39C), + MB2(0xF39D), MB2(0xF39E), MB2(0xF39F), MB2(0xF3A0), + MB2(0xF3A1), MB2(0xF3A2), MB2(0xF3A3), MB2(0xF3A4), + MB2(0xF3A5), MB2(0xF3A6), MB2(0xF3A7), MB2(0xF3A8), + MB2(0xF3A9), MB2(0xF3AA), MB2(0xF3AB), MB2(0xF3AC), + MB2(0xF3AD), MB2(0xF3AE), MB2(0xF3AF), MB2(0xF3B0), /* E2A0 */ + MB2(0xF3B1), MB2(0xF3B2), MB2(0xF3B3), MB2(0xF3B4), + MB2(0xF3B5), MB2(0xF3B6), MB2(0xF3B7), MB2(0xF3B8), + MB2(0xF3B9), MB2(0xF3BA), MB2(0xF3BB), MB2(0xF3BC), + MB2(0xF3BD), MB2(0xF3BE), MB2(0xF3BF), MB2(0xF3C0), + MB2(0xF3C1), MB2(0xF3C2), MB2(0xF3C3), MB2(0xF3C4), + MB2(0xF3C5), MB2(0xF3C6), MB2(0xF3C7), MB2(0xF3C8), + MB2(0xF3C9), MB2(0xF3CA), MB2(0xF3CB), MB2(0xF3CC), + MB2(0xF3CD), MB2(0xF3CE), MB2(0xF3CF), MB2(0xF3D0), /* E2C0 */ + MB2(0xF3D1), MB2(0xF3D2), MB2(0xF3D3), MB2(0xF3D4), + MB2(0xF3D5), MB2(0xF3D6), MB2(0xF3D7), MB2(0xF3D8), + MB2(0xF3D9), MB2(0xF3DA), MB2(0xF3DB), MB2(0xF3DC), + MB2(0xF3DD), MB2(0xF3DE), MB2(0xF3DF), MB2(0xF3E0), + MB2(0xF3E1), MB2(0xF3E2), MB2(0xF3E3), MB2(0xF3E4), + MB2(0xF3E5), MB2(0xF3E6), MB2(0xF3E7), MB2(0xF3E8), + MB2(0xF3E9), MB2(0xF3EA), MB2(0xF3EB), MB2(0xF3EC), + MB2(0xF3ED), MB2(0xF3EE), MB2(0xF3EF), MB2(0xF3F0), /* E2E0 */ + MB2(0xF3F1), MB2(0xF3F2), MB2(0xF3F3), MB2(0xF3F4), + MB2(0xF3F5), MB2(0xF3F6), MB2(0xF3F7), MB2(0xF3F8), + MB2(0xF3F9), MB2(0xF3FA), MB2(0xF3FB), MB2(0xF3FC), + MB2(0xF440), MB2(0xF441), MB2(0xF442), MB2(0xF443), + MB2(0xF444), MB2(0xF445), MB2(0xF446), MB2(0xF447), + MB2(0xF448), MB2(0xF449), MB2(0xF44A), MB2(0xF44B), + MB2(0xF44C), MB2(0xF44D), MB2(0xF44E), MB2(0xF44F), + MB2(0xF450), MB2(0xF451), MB2(0xF452), MB2(0xF453), /* E300 */ + MB2(0xF454), MB2(0xF455), MB2(0xF456), MB2(0xF457), + MB2(0xF458), MB2(0xF459), MB2(0xF45A), MB2(0xF45B), + MB2(0xF45C), MB2(0xF45D), MB2(0xF45E), MB2(0xF45F), + MB2(0xF460), MB2(0xF461), MB2(0xF462), MB2(0xF463), + MB2(0xF464), MB2(0xF465), MB2(0xF466), MB2(0xF467), + MB2(0xF468), MB2(0xF469), MB2(0xF46A), MB2(0xF46B), + MB2(0xF46C), MB2(0xF46D), MB2(0xF46E), MB2(0xF46F), + MB2(0xF470), MB2(0xF471), MB2(0xF472), MB2(0xF473), /* E320 */ + MB2(0xF474), MB2(0xF475), MB2(0xF476), MB2(0xF477), + MB2(0xF478), MB2(0xF479), MB2(0xF47A), MB2(0xF47B), + MB2(0xF47C), MB2(0xF47D), MB2(0xF47E), MB2(0xF480), + MB2(0xF481), MB2(0xF482), MB2(0xF483), MB2(0xF484), + MB2(0xF485), MB2(0xF486), MB2(0xF487), MB2(0xF488), + MB2(0xF489), MB2(0xF48A), MB2(0xF48B), MB2(0xF48C), + MB2(0xF48D), MB2(0xF48E), MB2(0xF48F), MB2(0xF490), + MB2(0xF491), MB2(0xF492), MB2(0xF493), MB2(0xF494), /* E340 */ + MB2(0xF495), MB2(0xF496), MB2(0xF497), MB2(0xF498), + MB2(0xF499), MB2(0xF49A), MB2(0xF49B), MB2(0xF49C), + MB2(0xF49D), MB2(0xF49E), MB2(0xF49F), MB2(0xF4A0), + MB2(0xF4A1), MB2(0xF4A2), MB2(0xF4A3), MB2(0xF4A4), + MB2(0xF4A5), MB2(0xF4A6), MB2(0xF4A7), MB2(0xF4A8), + MB2(0xF4A9), MB2(0xF4AA), MB2(0xF4AB), MB2(0xF4AC), + MB2(0xF4AD), MB2(0xF4AE), MB2(0xF4AF), MB2(0xF4B0), + MB2(0xF4B1), MB2(0xF4B2), MB2(0xF4B3), MB2(0xF4B4), /* E360 */ + MB2(0xF4B5), MB2(0xF4B6), MB2(0xF4B7), MB2(0xF4B8), + MB2(0xF4B9), MB2(0xF4BA), MB2(0xF4BB), MB2(0xF4BC), + MB2(0xF4BD), MB2(0xF4BE), MB2(0xF4BF), MB2(0xF4C0), + MB2(0xF4C1), MB2(0xF4C2), MB2(0xF4C3), MB2(0xF4C4), + MB2(0xF4C5), MB2(0xF4C6), MB2(0xF4C7), MB2(0xF4C8), + MB2(0xF4C9), MB2(0xF4CA), MB2(0xF4CB), MB2(0xF4CC), + MB2(0xF4CD), MB2(0xF4CE), MB2(0xF4CF), MB2(0xF4D0), + MB2(0xF4D1), MB2(0xF4D2), MB2(0xF4D3), MB2(0xF4D4), /* E380 */ + MB2(0xF4D5), MB2(0xF4D6), MB2(0xF4D7), MB2(0xF4D8), + MB2(0xF4D9), MB2(0xF4DA), MB2(0xF4DB), MB2(0xF4DC), + MB2(0xF4DD), MB2(0xF4DE), MB2(0xF4DF), MB2(0xF4E0), + MB2(0xF4E1), MB2(0xF4E2), MB2(0xF4E3), MB2(0xF4E4), + MB2(0xF4E5), MB2(0xF4E6), MB2(0xF4E7), MB2(0xF4E8), + MB2(0xF4E9), MB2(0xF4EA), MB2(0xF4EB), MB2(0xF4EC), + MB2(0xF4ED), MB2(0xF4EE), MB2(0xF4EF), MB2(0xF4F0), + MB2(0xF4F1), MB2(0xF4F2), MB2(0xF4F3), MB2(0xF4F4), /* E3A0 */ + MB2(0xF4F5), MB2(0xF4F6), MB2(0xF4F7), MB2(0xF4F8), + MB2(0xF4F9), MB2(0xF4FA), MB2(0xF4FB), MB2(0xF4FC), + MB2(0xF540), MB2(0xF541), MB2(0xF542), MB2(0xF543), + MB2(0xF544), MB2(0xF545), MB2(0xF546), MB2(0xF547), + MB2(0xF548), MB2(0xF549), MB2(0xF54A), MB2(0xF54B), + MB2(0xF54C), MB2(0xF54D), MB2(0xF54E), MB2(0xF54F), + MB2(0xF550), MB2(0xF551), MB2(0xF552), MB2(0xF553), + MB2(0xF554), MB2(0xF555), MB2(0xF556), MB2(0xF557), /* E3C0 */ + MB2(0xF558), MB2(0xF559), MB2(0xF55A), MB2(0xF55B), + MB2(0xF55C), MB2(0xF55D), MB2(0xF55E), MB2(0xF55F), + MB2(0xF560), MB2(0xF561), MB2(0xF562), MB2(0xF563), + MB2(0xF564), MB2(0xF565), MB2(0xF566), MB2(0xF567), + MB2(0xF568), MB2(0xF569), MB2(0xF56A), MB2(0xF56B), + MB2(0xF56C), MB2(0xF56D), MB2(0xF56E), MB2(0xF56F), + MB2(0xF570), MB2(0xF571), MB2(0xF572), MB2(0xF573), + MB2(0xF574), MB2(0xF575), MB2(0xF576), MB2(0xF577), /* E3E0 */ + MB2(0xF578), MB2(0xF579), MB2(0xF57A), MB2(0xF57B), + MB2(0xF57C), MB2(0xF57D), MB2(0xF57E), MB2(0xF580), + MB2(0xF581), MB2(0xF582), MB2(0xF583), MB2(0xF584), + MB2(0xF585), MB2(0xF586), MB2(0xF587), MB2(0xF588), + MB2(0xF589), MB2(0xF58A), MB2(0xF58B), MB2(0xF58C), + MB2(0xF58D), MB2(0xF58E), MB2(0xF58F), MB2(0xF590), + MB2(0xF591), MB2(0xF592), MB2(0xF593), MB2(0xF594), + MB2(0xF595), MB2(0xF596), MB2(0xF597), MB2(0xF598), /* E400 */ + MB2(0xF599), MB2(0xF59A), MB2(0xF59B), MB2(0xF59C), + MB2(0xF59D), MB2(0xF59E), MB2(0xF59F), MB2(0xF5A0), + MB2(0xF5A1), MB2(0xF5A2), MB2(0xF5A3), MB2(0xF5A4), + MB2(0xF5A5), MB2(0xF5A6), MB2(0xF5A7), MB2(0xF5A8), + MB2(0xF5A9), MB2(0xF5AA), MB2(0xF5AB), MB2(0xF5AC), + MB2(0xF5AD), MB2(0xF5AE), MB2(0xF5AF), MB2(0xF5B0), + MB2(0xF5B1), MB2(0xF5B2), MB2(0xF5B3), MB2(0xF5B4), + MB2(0xF5B5), MB2(0xF5B6), MB2(0xF5B7), MB2(0xF5B8), /* E420 */ + MB2(0xF5B9), MB2(0xF5BA), MB2(0xF5BB), MB2(0xF5BC), + MB2(0xF5BD), MB2(0xF5BE), MB2(0xF5BF), MB2(0xF5C0), + MB2(0xF5C1), MB2(0xF5C2), MB2(0xF5C3), MB2(0xF5C4), + MB2(0xF5C5), MB2(0xF5C6), MB2(0xF5C7), MB2(0xF5C8), + MB2(0xF5C9), MB2(0xF5CA), MB2(0xF5CB), MB2(0xF5CC), + MB2(0xF5CD), MB2(0xF5CE), MB2(0xF5CF), MB2(0xF5D0), + MB2(0xF5D1), MB2(0xF5D2), MB2(0xF5D3), MB2(0xF5D4), + MB2(0xF5D5), MB2(0xF5D6), MB2(0xF5D7), MB2(0xF5D8), /* E440 */ + MB2(0xF5D9), MB2(0xF5DA), MB2(0xF5DB), MB2(0xF5DC), + MB2(0xF5DD), MB2(0xF5DE), MB2(0xF5DF), MB2(0xF5E0), + MB2(0xF5E1), MB2(0xF5E2), MB2(0xF5E3), MB2(0xF5E4), + MB2(0xF5E5), MB2(0xF5E6), MB2(0xF5E7), MB2(0xF5E8), + MB2(0xF5E9), MB2(0xF5EA), MB2(0xF5EB), MB2(0xF5EC), + MB2(0xF5ED), MB2(0xF5EE), MB2(0xF5EF), MB2(0xF5F0), + MB2(0xF5F1), MB2(0xF5F2), MB2(0xF5F3), MB2(0xF5F4), + MB2(0xF5F5), MB2(0xF5F6), MB2(0xF5F7), MB2(0xF5F8), /* E460 */ + MB2(0xF5F9), MB2(0xF5FA), MB2(0xF5FB), MB2(0xF5FC), + MB2(0xF640), MB2(0xF641), MB2(0xF642), MB2(0xF643), + MB2(0xF644), MB2(0xF645), MB2(0xF646), MB2(0xF647), + MB2(0xF648), MB2(0xF649), MB2(0xF64A), MB2(0xF64B), + MB2(0xF64C), MB2(0xF64D), MB2(0xF64E), MB2(0xF64F), + MB2(0xF650), MB2(0xF651), MB2(0xF652), MB2(0xF653), + MB2(0xF654), MB2(0xF655), MB2(0xF656), MB2(0xF657), + MB2(0xF658), MB2(0xF659), MB2(0xF65A), MB2(0xF65B), /* E480 */ + MB2(0xF65C), MB2(0xF65D), MB2(0xF65E), MB2(0xF65F), + MB2(0xF660), MB2(0xF661), MB2(0xF662), MB2(0xF663), + MB2(0xF664), MB2(0xF665), MB2(0xF666), MB2(0xF667), + MB2(0xF668), MB2(0xF669), MB2(0xF66A), MB2(0xF66B), + MB2(0xF66C), MB2(0xF66D), MB2(0xF66E), MB2(0xF66F), + MB2(0xF670), MB2(0xF671), MB2(0xF672), MB2(0xF673), + MB2(0xF674), MB2(0xF675), MB2(0xF676), MB2(0xF677), + MB2(0xF678), MB2(0xF679), MB2(0xF67A), MB2(0xF67B), /* E4A0 */ + MB2(0xF67C), MB2(0xF67D), MB2(0xF67E), MB2(0xF680), + MB2(0xF681), MB2(0xF682), MB2(0xF683), MB2(0xF684), + MB2(0xF685), MB2(0xF686), MB2(0xF687), MB2(0xF688), + MB2(0xF689), MB2(0xF68A), MB2(0xF68B), MB2(0xF68C), + MB2(0xF68D), MB2(0xF68E), MB2(0xF68F), MB2(0xF690), + MB2(0xF691), MB2(0xF692), MB2(0xF693), MB2(0xF694), + MB2(0xF695), MB2(0xF696), MB2(0xF697), MB2(0xF698), + MB2(0xF699), MB2(0xF69A), MB2(0xF69B), MB2(0xF69C), /* E4C0 */ + MB2(0xF69D), MB2(0xF69E), MB2(0xF69F), MB2(0xF6A0), + MB2(0xF6A1), MB2(0xF6A2), MB2(0xF6A3), MB2(0xF6A4), + MB2(0xF6A5), MB2(0xF6A6), MB2(0xF6A7), MB2(0xF6A8), + MB2(0xF6A9), MB2(0xF6AA), MB2(0xF6AB), MB2(0xF6AC), + MB2(0xF6AD), MB2(0xF6AE), MB2(0xF6AF), MB2(0xF6B0), + MB2(0xF6B1), MB2(0xF6B2), MB2(0xF6B3), MB2(0xF6B4), + MB2(0xF6B5), MB2(0xF6B6), MB2(0xF6B7), MB2(0xF6B8), + MB2(0xF6B9), MB2(0xF6BA), MB2(0xF6BB), MB2(0xF6BC), /* E4E0 */ + MB2(0xF6BD), MB2(0xF6BE), MB2(0xF6BF), MB2(0xF6C0), + MB2(0xF6C1), MB2(0xF6C2), MB2(0xF6C3), MB2(0xF6C4), + MB2(0xF6C5), MB2(0xF6C6), MB2(0xF6C7), MB2(0xF6C8), + MB2(0xF6C9), MB2(0xF6CA), MB2(0xF6CB), MB2(0xF6CC), + MB2(0xF6CD), MB2(0xF6CE), MB2(0xF6CF), MB2(0xF6D0), + MB2(0xF6D1), MB2(0xF6D2), MB2(0xF6D3), MB2(0xF6D4), + MB2(0xF6D5), MB2(0xF6D6), MB2(0xF6D7), MB2(0xF6D8), + MB2(0xF6D9), MB2(0xF6DA), MB2(0xF6DB), MB2(0xF6DC), /* E500 */ + MB2(0xF6DD), MB2(0xF6DE), MB2(0xF6DF), MB2(0xF6E0), + MB2(0xF6E1), MB2(0xF6E2), MB2(0xF6E3), MB2(0xF6E4), + MB2(0xF6E5), MB2(0xF6E6), MB2(0xF6E7), MB2(0xF6E8), + MB2(0xF6E9), MB2(0xF6EA), MB2(0xF6EB), MB2(0xF6EC), + MB2(0xF6ED), MB2(0xF6EE), MB2(0xF6EF), MB2(0xF6F0), + MB2(0xF6F1), MB2(0xF6F2), MB2(0xF6F3), MB2(0xF6F4), + MB2(0xF6F5), MB2(0xF6F6), MB2(0xF6F7), MB2(0xF6F8), + MB2(0xF6F9), MB2(0xF6FA), MB2(0xF6FB), MB2(0xF6FC), /* E520 */ + MB2(0xF740), MB2(0xF741), MB2(0xF742), MB2(0xF743), + MB2(0xF744), MB2(0xF745), MB2(0xF746), MB2(0xF747), + MB2(0xF748), MB2(0xF749), MB2(0xF74A), MB2(0xF74B), + MB2(0xF74C), MB2(0xF74D), MB2(0xF74E), MB2(0xF74F), + MB2(0xF750), MB2(0xF751), MB2(0xF752), MB2(0xF753), + MB2(0xF754), MB2(0xF755), MB2(0xF756), MB2(0xF757), + MB2(0xF758), MB2(0xF759), MB2(0xF75A), MB2(0xF75B), + MB2(0xF75C), MB2(0xF75D), MB2(0xF75E), MB2(0xF75F), /* E540 */ + MB2(0xF760), MB2(0xF761), MB2(0xF762), MB2(0xF763), + MB2(0xF764), MB2(0xF765), MB2(0xF766), MB2(0xF767), + MB2(0xF768), MB2(0xF769), MB2(0xF76A), MB2(0xF76B), + MB2(0xF76C), MB2(0xF76D), MB2(0xF76E), MB2(0xF76F), + MB2(0xF770), MB2(0xF771), MB2(0xF772), MB2(0xF773), + MB2(0xF774), MB2(0xF775), MB2(0xF776), MB2(0xF777), + MB2(0xF778), MB2(0xF779), MB2(0xF77A), MB2(0xF77B), + MB2(0xF77C), MB2(0xF77D), MB2(0xF77E), MB2(0xF780), /* E560 */ + MB2(0xF781), MB2(0xF782), MB2(0xF783), MB2(0xF784), + MB2(0xF785), MB2(0xF786), MB2(0xF787), MB2(0xF788), + MB2(0xF789), MB2(0xF78A), MB2(0xF78B), MB2(0xF78C), + MB2(0xF78D), MB2(0xF78E), MB2(0xF78F), MB2(0xF790), + MB2(0xF791), MB2(0xF792), MB2(0xF793), MB2(0xF794), + MB2(0xF795), MB2(0xF796), MB2(0xF797), MB2(0xF798), + MB2(0xF799), MB2(0xF79A), MB2(0xF79B), MB2(0xF79C), + MB2(0xF79D), MB2(0xF79E), MB2(0xF79F), MB2(0xF7A0), /* E580 */ + MB2(0xF7A1), MB2(0xF7A2), MB2(0xF7A3), MB2(0xF7A4), + MB2(0xF7A5), MB2(0xF7A6), MB2(0xF7A7), MB2(0xF7A8), + MB2(0xF7A9), MB2(0xF7AA), MB2(0xF7AB), MB2(0xF7AC), + MB2(0xF7AD), MB2(0xF7AE), MB2(0xF7AF), MB2(0xF7B0), + MB2(0xF7B1), MB2(0xF7B2), MB2(0xF7B3), MB2(0xF7B4), + MB2(0xF7B5), MB2(0xF7B6), MB2(0xF7B7), MB2(0xF7B8), + MB2(0xF7B9), MB2(0xF7BA), MB2(0xF7BB), MB2(0xF7BC), + MB2(0xF7BD), MB2(0xF7BE), MB2(0xF7BF), MB2(0xF7C0), /* E5A0 */ + MB2(0xF7C1), MB2(0xF7C2), MB2(0xF7C3), MB2(0xF7C4), + MB2(0xF7C5), MB2(0xF7C6), MB2(0xF7C7), MB2(0xF7C8), + MB2(0xF7C9), MB2(0xF7CA), MB2(0xF7CB), MB2(0xF7CC), + MB2(0xF7CD), MB2(0xF7CE), MB2(0xF7CF), MB2(0xF7D0), + MB2(0xF7D1), MB2(0xF7D2), MB2(0xF7D3), MB2(0xF7D4), + MB2(0xF7D5), MB2(0xF7D6), MB2(0xF7D7), MB2(0xF7D8), + MB2(0xF7D9), MB2(0xF7DA), MB2(0xF7DB), MB2(0xF7DC), + MB2(0xF7DD), MB2(0xF7DE), MB2(0xF7DF), MB2(0xF7E0), /* E5C0 */ + MB2(0xF7E1), MB2(0xF7E2), MB2(0xF7E3), MB2(0xF7E4), + MB2(0xF7E5), MB2(0xF7E6), MB2(0xF7E7), MB2(0xF7E8), + MB2(0xF7E9), MB2(0xF7EA), MB2(0xF7EB), MB2(0xF7EC), + MB2(0xF7ED), MB2(0xF7EE), MB2(0xF7EF), MB2(0xF7F0), + MB2(0xF7F1), MB2(0xF7F2), MB2(0xF7F3), MB2(0xF7F4), + MB2(0xF7F5), MB2(0xF7F6), MB2(0xF7F7), MB2(0xF7F8), + MB2(0xF7F9), MB2(0xF7FA), MB2(0xF7FB), MB2(0xF7FC), + MB2(0xF840), MB2(0xF841), MB2(0xF842), MB2(0xF843), /* E5E0 */ + MB2(0xF844), MB2(0xF845), MB2(0xF846), MB2(0xF847), + MB2(0xF848), MB2(0xF849), MB2(0xF84A), MB2(0xF84B), + MB2(0xF84C), MB2(0xF84D), MB2(0xF84E), MB2(0xF84F), + MB2(0xF850), MB2(0xF851), MB2(0xF852), MB2(0xF853), + MB2(0xF854), MB2(0xF855), MB2(0xF856), MB2(0xF857), + MB2(0xF858), MB2(0xF859), MB2(0xF85A), MB2(0xF85B), + MB2(0xF85C), MB2(0xF85D), MB2(0xF85E), MB2(0xF85F), + MB2(0xF860), MB2(0xF861), MB2(0xF862), MB2(0xF863), /* E600 */ + MB2(0xF864), MB2(0xF865), MB2(0xF866), MB2(0xF867), + MB2(0xF868), MB2(0xF869), MB2(0xF86A), MB2(0xF86B), + MB2(0xF86C), MB2(0xF86D), MB2(0xF86E), MB2(0xF86F), + MB2(0xF870), MB2(0xF871), MB2(0xF872), MB2(0xF873), + MB2(0xF874), MB2(0xF875), MB2(0xF876), MB2(0xF877), + MB2(0xF878), MB2(0xF879), MB2(0xF87A), MB2(0xF87B), + MB2(0xF87C), MB2(0xF87D), MB2(0xF87E), MB2(0xF880), + MB2(0xF881), MB2(0xF882), MB2(0xF883), MB2(0xF884), /* E620 */ + MB2(0xF885), MB2(0xF886), MB2(0xF887), MB2(0xF888), + MB2(0xF889), MB2(0xF88A), MB2(0xF88B), MB2(0xF88C), + MB2(0xF88D), MB2(0xF88E), MB2(0xF88F), MB2(0xF890), + MB2(0xF891), MB2(0xF892), MB2(0xF893), MB2(0xF894), + MB2(0xF895), MB2(0xF896), MB2(0xF897), MB2(0xF898), + MB2(0xF899), MB2(0xF89A), MB2(0xF89B), MB2(0xF89C), + MB2(0xF89D), MB2(0xF89E), MB2(0xF89F), MB2(0xF8A0), + MB2(0xF8A1), MB2(0xF8A2), MB2(0xF8A3), MB2(0xF8A4), /* E640 */ + MB2(0xF8A5), MB2(0xF8A6), MB2(0xF8A7), MB2(0xF8A8), + MB2(0xF8A9), MB2(0xF8AA), MB2(0xF8AB), MB2(0xF8AC), + MB2(0xF8AD), MB2(0xF8AE), MB2(0xF8AF), MB2(0xF8B0), + MB2(0xF8B1), MB2(0xF8B2), MB2(0xF8B3), MB2(0xF8B4), + MB2(0xF8B5), MB2(0xF8B6), MB2(0xF8B7), MB2(0xF8B8), + MB2(0xF8B9), MB2(0xF8BA), MB2(0xF8BB), MB2(0xF8BC), + MB2(0xF8BD), MB2(0xF8BE), MB2(0xF8BF), MB2(0xF8C0), + MB2(0xF8C1), MB2(0xF8C2), MB2(0xF8C3), MB2(0xF8C4), /* E660 */ + MB2(0xF8C5), MB2(0xF8C6), MB2(0xF8C7), MB2(0xF8C8), + MB2(0xF8C9), MB2(0xF8CA), MB2(0xF8CB), MB2(0xF8CC), + MB2(0xF8CD), MB2(0xF8CE), MB2(0xF8CF), MB2(0xF8D0), + MB2(0xF8D1), MB2(0xF8D2), MB2(0xF8D3), MB2(0xF8D4), + MB2(0xF8D5), MB2(0xF8D6), MB2(0xF8D7), MB2(0xF8D8), + MB2(0xF8D9), MB2(0xF8DA), MB2(0xF8DB), MB2(0xF8DC), + MB2(0xF8DD), MB2(0xF8DE), MB2(0xF8DF), MB2(0xF8E0), + MB2(0xF8E1), MB2(0xF8E2), MB2(0xF8E3), MB2(0xF8E4), /* E680 */ + MB2(0xF8E5), MB2(0xF8E6), MB2(0xF8E7), MB2(0xF8E8), + MB2(0xF8E9), MB2(0xF8EA), MB2(0xF8EB), MB2(0xF8EC), + MB2(0xF8ED), MB2(0xF8EE), MB2(0xF8EF), MB2(0xF8F0), + MB2(0xF8F1), MB2(0xF8F2), MB2(0xF8F3), MB2(0xF8F4), + MB2(0xF8F5), MB2(0xF8F6), MB2(0xF8F7), MB2(0xF8F8), + MB2(0xF8F9), MB2(0xF8FA), MB2(0xF8FB), MB2(0xF8FC), + MB2(0xF940), MB2(0xF941), MB2(0xF942), MB2(0xF943), + MB2(0xF944), MB2(0xF945), MB2(0xF946), MB2(0xF947), /* E6A0 */ + MB2(0xF948), MB2(0xF949), MB2(0xF94A), MB2(0xF94B), + MB2(0xF94C), MB2(0xF94D), MB2(0xF94E), MB2(0xF94F), + MB2(0xF950), MB2(0xF951), MB2(0xF952), MB2(0xF953), + MB2(0xF954), MB2(0xF955), MB2(0xF956), MB2(0xF957), + MB2(0xF958), MB2(0xF959), MB2(0xF95A), MB2(0xF95B), + MB2(0xF95C), MB2(0xF95D), MB2(0xF95E), MB2(0xF95F), + MB2(0xF960), MB2(0xF961), MB2(0xF962), MB2(0xF963), + MB2(0xF964), MB2(0xF965), MB2(0xF966), MB2(0xF967), /* E6C0 */ + MB2(0xF968), MB2(0xF969), MB2(0xF96A), MB2(0xF96B), + MB2(0xF96C), MB2(0xF96D), MB2(0xF96E), MB2(0xF96F), + MB2(0xF970), MB2(0xF971), MB2(0xF972), MB2(0xF973), + MB2(0xF974), MB2(0xF975), MB2(0xF976), MB2(0xF977), + MB2(0xF978), MB2(0xF979), MB2(0xF97A), MB2(0xF97B), + MB2(0xF97C), MB2(0xF97D), MB2(0xF97E), MB2(0xF980), + MB2(0xF981), MB2(0xF982), MB2(0xF983), MB2(0xF984), + MB2(0xF985), MB2(0xF986), MB2(0xF987), MB2(0xF988), /* E6E0 */ + MB2(0xF989), MB2(0xF98A), MB2(0xF98B), MB2(0xF98C), + MB2(0xF98D), MB2(0xF98E), MB2(0xF98F), MB2(0xF990), + MB2(0xF991), MB2(0xF992), MB2(0xF993), MB2(0xF994), + MB2(0xF995), MB2(0xF996), MB2(0xF997), MB2(0xF998), + MB2(0xF999), MB2(0xF99A), MB2(0xF99B), MB2(0xF99C), + MB2(0xF99D), MB2(0xF99E), MB2(0xF99F), MB2(0xF9A0), + MB2(0xF9A1), MB2(0xF9A2), MB2(0xF9A3), MB2(0xF9A4), + MB2(0xF9A5), MB2(0xF9A6), MB2(0xF9A7), MB2(0xF9A8), /* E700 */ + MB2(0xF9A9), MB2(0xF9AA), MB2(0xF9AB), MB2(0xF9AC), + MB2(0xF9AD), MB2(0xF9AE), MB2(0xF9AF), MB2(0xF9B0), + MB2(0xF9B1), MB2(0xF9B2), MB2(0xF9B3), MB2(0xF9B4), + MB2(0xF9B5), MB2(0xF9B6), MB2(0xF9B7), MB2(0xF9B8), + MB2(0xF9B9), MB2(0xF9BA), MB2(0xF9BB), MB2(0xF9BC), + MB2(0xF9BD), MB2(0xF9BE), MB2(0xF9BF), MB2(0xF9C0), + MB2(0xF9C1), MB2(0xF9C2), MB2(0xF9C3), MB2(0xF9C4), + MB2(0xF9C5), MB2(0xF9C6), MB2(0xF9C7), MB2(0xF9C8), /* E720 */ + MB2(0xF9C9), MB2(0xF9CA), MB2(0xF9CB), MB2(0xF9CC), + MB2(0xF9CD), MB2(0xF9CE), MB2(0xF9CF), MB2(0xF9D0), + MB2(0xF9D1), MB2(0xF9D2), MB2(0xF9D3), MB2(0xF9D4), + MB2(0xF9D5), MB2(0xF9D6), MB2(0xF9D7), MB2(0xF9D8), + MB2(0xF9D9), MB2(0xF9DA), MB2(0xF9DB), MB2(0xF9DC), + MB2(0xF9DD), MB2(0xF9DE), MB2(0xF9DF), MB2(0xF9E0), + MB2(0xF9E1), MB2(0xF9E2), MB2(0xF9E3), MB2(0xF9E4), + MB2(0xF9E5), MB2(0xF9E6), MB2(0xF9E7), MB2(0xF9E8), /* E740 */ + MB2(0xF9E9), MB2(0xF9EA), MB2(0xF9EB), MB2(0xF9EC), + MB2(0xF9ED), MB2(0xF9EE), MB2(0xF9EF), MB2(0xF9F0), + MB2(0xF9F1), MB2(0xF9F2), MB2(0xF9F3), MB2(0xF9F4), + MB2(0xF9F5), MB2(0xF9F6), MB2(0xF9F7), MB2(0xF9F8), + MB2(0xF9F9), MB2(0xF9FA), MB2(0xF9FB), MB2(0xF9FC), + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* E760 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* E780 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* E7A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* E7C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* E7E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* E800 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* E820 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* E840 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* E860 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* E880 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* E8A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* E8C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* E8E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* E900 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* E920 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* E940 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* E960 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* E980 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* E9A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* E9C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* E9E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* EA00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* EA20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* EA40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* EA60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* EA80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* EAA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* EAC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* EAE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* EB00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* EB20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* EB40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* EB60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* EB80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* EBA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* EBC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* EBE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* EC00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* EC20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* EC40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* EC60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* EC80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* ECA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* ECC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* ECE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* ED00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* ED20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* ED40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* ED60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* ED80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* EDA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* EDC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* EDE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* EE00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* EE20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* EE40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* EE60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* EE80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* EEA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* EEC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* EEE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* EF00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* EF20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* EF40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* EF60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* EF80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* EFA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* EFC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* EFE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F000 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F020 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F040 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F060 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F080 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F0A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F0C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F0E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F100 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F120 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F140 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F160 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F180 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F1A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F1C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F1E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F200 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F220 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F240 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F260 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F280 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F2A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F2C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F2E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F300 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F320 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F340 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F360 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F380 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F3A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F3C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F3E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F400 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F420 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F440 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F460 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F480 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F4A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F4C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F4E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F500 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F520 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F540 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F560 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F580 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F5A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F5C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F5E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F600 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F620 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F640 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F660 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F680 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F6A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F6C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F6E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F700 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F720 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F740 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F760 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F780 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F7A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F7C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F7E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F800 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F820 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F840 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F860 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F880 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F8A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F8C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F8E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F900 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F920 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0xFAE0), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F940 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F960 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F980 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F9A0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F9C0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0xFBE9), 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* F9E0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FA00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, MB2(0xFA90), MB2(0xFA9B), + MB2(0xFA9C), MB2(0xFAB1), MB2(0xFAD8), MB2(0xFAE8), + MB2(0xFAEA), MB2(0xFB58), MB2(0xFB5E), MB2(0xFB75), + MB2(0xFB7D), MB2(0xFB7E), MB2(0xFB80), MB2(0xFB82), + MB2(0xFB86), MB2(0xFB89), MB2(0xFB92), MB2(0xFB9D), + MB2(0xFB9F), MB2(0xFBA0), MB2(0xFBA9), MB2(0xFBB1), /* FA20 */ + MB2(0xFBB3), MB2(0xFBB4), MB2(0xFBB7), MB2(0xFBD3), + MB2(0xFBDA), MB2(0xFBEA), MB2(0xFBF6), MB2(0xFBF7), + MB2(0xFBF9), MB2(0xFC49), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FA40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FA60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FA80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FAA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FAC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FAE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FB00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FB20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FB40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FB60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FB80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FBA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FBC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FBE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FC00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FC20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FC40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FC60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FC80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FCA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FCC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FCE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FD00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FD20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FD40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FD60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FD80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FDA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FDC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FDE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FE00 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FE20 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FE40 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FE60 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FE80 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FEA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FEC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FEE0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, MB2(0x8149), MB2(0xFA57), MB2(0x8194), /* FF00 */ + MB2(0x8190), MB2(0x8193), MB2(0x8195), MB2(0xFA56), + MB2(0x8169), MB2(0x816A), MB2(0x8196), MB2(0x817B), + MB2(0x8143), MB2(0x817C), MB2(0x8144), MB2(0x815E), + MB2(0x824F), MB2(0x8250), MB2(0x8251), MB2(0x8252), + MB2(0x8253), MB2(0x8254), MB2(0x8255), MB2(0x8256), + MB2(0x8257), MB2(0x8258), MB2(0x8146), MB2(0x8147), + MB2(0x8183), MB2(0x8181), MB2(0x8184), MB2(0x8148), + MB2(0x8197), MB2(0x8260), MB2(0x8261), MB2(0x8262), /* FF20 */ + MB2(0x8263), MB2(0x8264), MB2(0x8265), MB2(0x8266), + MB2(0x8267), MB2(0x8268), MB2(0x8269), MB2(0x826A), + MB2(0x826B), MB2(0x826C), MB2(0x826D), MB2(0x826E), + MB2(0x826F), MB2(0x8270), MB2(0x8271), MB2(0x8272), + MB2(0x8273), MB2(0x8274), MB2(0x8275), MB2(0x8276), + MB2(0x8277), MB2(0x8278), MB2(0x8279), MB2(0x816D), + MB2(0x815F), MB2(0x816E), MB2(0x814F), MB2(0x8151), + MB2(0x814D), MB2(0x8281), MB2(0x8282), MB2(0x8283), /* FF40 */ + MB2(0x8284), MB2(0x8285), MB2(0x8286), MB2(0x8287), + MB2(0x8288), MB2(0x8289), MB2(0x828A), MB2(0x828B), + MB2(0x828C), MB2(0x828D), MB2(0x828E), MB2(0x828F), + MB2(0x8290), MB2(0x8291), MB2(0x8292), MB2(0x8293), + MB2(0x8294), MB2(0x8295), MB2(0x8296), MB2(0x8297), + MB2(0x8298), MB2(0x8299), MB2(0x829A), MB2(0x816F), + MB2(0x8162), MB2(0x8170), MB2(0x8160), 0x0000, + 0x0000, 0x00A1, 0x00A2, 0x00A3, /* FF60 */ + 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, /* FF80 */ + 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, + 0x0000, 0x0000, 0x0000, 0x0000, /* FFA0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, /* FFC0 */ + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + MB2(0x8191), MB2(0x8192), MB2(0x81CA), MB2(0x8150), /* FFE0 */ + MB2(0xFA55), MB2(0x818F), 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, +}; -/* 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}; +/* + CP932 encoding components: + + [00..7F] = ASCII [U+0000..U+007F] + [A1..DF] = JIS-X-0201 Katakana [U+FF61..U+FF9F] + [81..9F,E0..FC][40..7E,80..FC] = JIS-X-0208 (MS version) + + [80,A0,FD,FE,FF] = Invalid leading byte +*/ -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}; +/** + Scans a CP932 character from the input string + and converts to Unicode code point. -/* 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}; + @param[out] pwc Unicode code point + @param[in] s Beginning of the input string + @param[in[ e End of the input string -/* 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}; + @retval MY_CS_TOOSMALL If the string was too short to scan a character + @retval 1 If a 1-byte character was scanned + @retval 2 If a 2-byte character was scanned + @retval -2 If a 2-byte unassigned character was scanned + @retval MY_CS_ILSEQ If a wrong byte sequence was found +*/ -/* 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 -}; +static int +my_mb_wc_cp932(CHARSET_INFO *cs __attribute__((unused)), + my_wc_t *pwc, const uchar *s, const uchar *e){ + int hi; -/* 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}; + if (s >= e) + return MY_CS_TOOSMALL; -/* 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}; + if ((hi= s[0]) < 0x80) /* ASCII: [00-7F] -> [U+0000..U+007F] */ + { + *pwc= hi; + return 1; + } -/* 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}; + /* JIS-X-0201 Half width Katakana: [A1..DF] -> [U+FF61..U+FF9F] */ + if (hi >= 0xA1 && hi <= 0xDF) + { + *pwc= cp932_to_unicode[hi]; + return 1; + } -/* 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}; + if (s + 2 > e) + return MY_CS_TOOSMALL2; -/* 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}; + /* JIS-X-0208-MS [81..9F,E0..FC][40..7E,80..FC] */ + if (!(pwc[0]= cp932_to_unicode[(hi << 8) + s[1]])) + return (iscp932head(hi) && iscp932tail(s[1])) ? -2 : MY_CS_ILSEQ; -/* 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}; + return 2; +} -/* 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); -} +/** + Puts the given Unicode character into a CP932 string. + @param[in] wc Unicode code point + @param[in] s Beginning of the out string + @param[in] e End of the out string + @retval MY_CS_TOOSMALL If the string was too short to put a character + @retval 1 If a 1-byte character was put + @retval 2 If a 2-byte character was put + @retval MY_CS_ILUNI If the Unicode character does not exist in CP932 +*/ static int -my_wc_mb_cp932(CHARSET_INFO *cs __attribute__((unused)), - my_wc_t wc, uchar *s, uchar *e) +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) + + if ((int) wc < 0x80) /* ASCII: [U+0000..U+007F] -> [00-7F] */ { - s[0]= (uchar) wc; - return 1; + /* + This branch is for performance purposes on ASCII range, + to avoid using unicode_to_cp932[]: about 10% improvement. + */ + if (s >= e) + return MY_CS_TOOSMALL; + s[0]= (uchar) wc; + return 1; } - - if (!(code=func_uni_cp932_onechar(wc))) + + if (wc > 0xFFFF || + !(code= unicode_to_cp932[wc])) /* Bad Unicode code point */ return MY_CS_ILUNI; - - if (code>=0xA1 && code <= 0xDF) + + if (code <= 0xFF) { + /* JIS-X-0201 HALF WIDTH KATAKANA [U+FF61..U+FF9F] -> [A1..DF] */ + if (s >= e) + return MY_CS_TOOSMALL; s[0]= code; return 1; } - s[0]=code>>8; - s[1]=code&0xFF; + if (s + 2 > e) + return MY_CS_TOOSMALL2; + + MY_PUT_MB2(s, code); /* JIS-X-0208(MS) */ 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)), @@ -5454,7 +34838,7 @@ CHARSET_INFO my_charset_cp932_japanese_ci= NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - my_unicase_default, /* caseinfo */ + my_caseinfo_cp932, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ @@ -5486,7 +34870,7 @@ CHARSET_INFO my_charset_cp932_bin= NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - my_unicase_default, /* caseinfo */ + my_caseinfo_cp932, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ diff --git a/dep/mysqllite/strings/ctype-czech.c b/dep/mysqllite/strings/ctype-czech.c index a5df86cc6b39f..0095fe7f9956c 100644 --- a/dep/mysqllite/strings/ctype-czech.c +++ b/dep/mysqllite/strings/ctype-czech.c @@ -430,7 +430,7 @@ static my_bool my_like_range_czech(CHARSET_INFO *cs __attribute__((unused)), #include #include "m_string.h" -static uchar NEAR ctype_czech[257] = { +static uchar 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, @@ -450,7 +450,7 @@ static uchar NEAR ctype_czech[257] = { 2, 2, 2, 2, 2, 2, 2, 16, 2, 2, 2, 2, 2, 2, 2, 16, }; -static uchar NEAR to_lower_czech[] = { +static uchar 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, @@ -469,7 +469,7 @@ static uchar NEAR to_lower_czech[] = { 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255, }; -static uchar NEAR to_upper_czech[] = { +static uchar 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, @@ -488,7 +488,7 @@ static uchar NEAR to_upper_czech[] = { 240,209,210,211,212,213,214,247,216,217,218,219,220,221,222,255, }; -static uchar NEAR sort_order_czech[] = { +static uchar 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, diff --git a/dep/mysqllite/strings/ctype-euc_kr.c b/dep/mysqllite/strings/ctype-euc_kr.c index ee9573047160f..7329f9ec09a2e 100644 --- a/dep/mysqllite/strings/ctype-euc_kr.c +++ b/dep/mysqllite/strings/ctype-euc_kr.c @@ -32,7 +32,7 @@ #ifdef HAVE_CHARSET_euckr -static uchar NEAR ctype_euc_kr[257] = +static uchar ctype_euc_kr[257] = { 0, /* For standard library */ 0040, 0040, 0040, 0040, 0040, 0040, 0040, 0040, /* NUL ^A - ^G */ @@ -69,7 +69,7 @@ static uchar NEAR ctype_euc_kr[257] = 0020, 0020, 0020, 0020, 0020, 0020, 0020, 0000, }; -static uchar NEAR to_lower_euc_kr[]= +static uchar to_lower_euc_kr[]= { '\000','\001','\002','\003','\004','\005','\006','\007', '\010','\011','\012','\013','\014','\015','\016','\017', @@ -105,7 +105,7 @@ static uchar NEAR to_lower_euc_kr[]= (uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377', }; -static uchar NEAR to_upper_euc_kr[]= +static uchar to_upper_euc_kr[]= { '\000','\001','\002','\003','\004','\005','\006','\007', '\010','\011','\012','\013','\014','\015','\016','\017', @@ -141,7 +141,7 @@ static uchar NEAR to_upper_euc_kr[]= (uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377', }; -static uchar NEAR sort_order_euc_kr[]= +static uchar sort_order_euc_kr[]= { '\000','\001','\002','\003','\004','\005','\006','\007', '\010','\011','\012','\013','\014','\015','\016','\017', @@ -216,6 +216,1273 @@ static uint mbcharlen_euc_kr(CHARSET_INFO *cs __attribute__((unused)),uint c) } +static MY_UNICASE_INFO cA3[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}, /* xx00 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx10 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx20 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx30 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0xA340,0xA340,0x003F}, /* A340 */ + {0xA341,0xA341,0xC971}, + {0xA342,0xA342,0xC972}, + {0xA343,0xA343,0xC973}, + {0xA344,0xA344,0xC975}, + {0xA345,0xA345,0xC976}, + {0xA346,0xA346,0xC977}, + {0xA347,0xA347,0xC978}, + {0xA348,0xA348,0xC979}, + {0xA349,0xA349,0xC97A}, + {0xA34A,0xA34A,0xC97B}, + {0xA34B,0xA34B,0xC97D}, + {0xA34C,0xA34C,0xC97E}, + {0xA34D,0xA34D,0xC97F}, + {0xA34E,0xA34E,0xC980}, + {0xA34F,0xA34F,0xC981}, + {0xA350,0xA350,0xC982}, /* A350 */ + {0xA351,0xA351,0xC983}, + {0xA352,0xA352,0xC984}, + {0xA353,0xA353,0xC985}, + {0xA354,0xA354,0xC986}, + {0xA355,0xA355,0xC987}, + {0xA356,0xA356,0xC98A}, + {0xA357,0xA357,0xC98B}, + {0xA358,0xA358,0xC98D}, + {0xA359,0xA359,0xC98E}, + {0xA35A,0xA35A,0xC98F}, + {0xA35B,0xA35B,0x003F}, + {0xA35C,0xA35C,0x003F}, + {0xA35D,0xA35D,0x003F}, + {0xA35E,0xA35E,0x003F}, + {0xA35F,0xA35F,0x003F}, + {0xA360,0xA360,0x003F}, /* A360 */ + {0xA361,0xA361,0xC991}, + {0xA362,0xA362,0xC992}, + {0xA363,0xA363,0xC993}, + {0xA364,0xA364,0xC994}, + {0xA365,0xA365,0xC995}, + {0xA366,0xA366,0xC996}, + {0xA367,0xA367,0xC997}, + {0xA368,0xA368,0xC99A}, + {0xA369,0xA369,0xC99C}, + {0xA36A,0xA36A,0xC99E}, + {0xA36B,0xA36B,0xC99F}, + {0xA36C,0xA36C,0xC9A0}, + {0xA36D,0xA36D,0xC9A1}, + {0xA36E,0xA36E,0xC9A2}, + {0xA36F,0xA36F,0xC9A3}, + {0xA370,0xA370,0xC9A4}, /* A370 */ + {0xA371,0xA371,0xC9A5}, + {0xA372,0xA372,0xC9A6}, + {0xA373,0xA373,0xC9A7}, + {0xA374,0xA374,0xC9A8}, + {0xA375,0xA375,0xC9A9}, + {0xA376,0xA376,0xC9AA}, + {0xA377,0xA377,0xC9AB}, + {0xA378,0xA378,0xC9AC}, + {0xA379,0xA379,0xC9AD}, + {0xA37A,0xA37A,0xC9AE}, + {0xA37B,0xA37B,0x003F}, + {0xA37C,0xA37C,0x003F}, + {0xA37D,0xA37D,0x003F}, + {0xA37E,0xA37E,0x003F}, + {0xA37F,0xA37F,0x003F}, + {0xA380,0xA380,0x003F}, /* A380 */ + {0xA381,0xA381,0xC9AF}, + {0xA382,0xA382,0xC9B0}, + {0xA383,0xA383,0xC9B1}, + {0xA384,0xA384,0xC9B2}, + {0xA385,0xA385,0xC9B3}, + {0xA386,0xA386,0xC9B4}, + {0xA387,0xA387,0xC9B5}, + {0xA388,0xA388,0xC9B6}, + {0xA389,0xA389,0xC9B7}, + {0xA38A,0xA38A,0xC9B8}, + {0xA38B,0xA38B,0xC9B9}, + {0xA38C,0xA38C,0xC9BA}, + {0xA38D,0xA38D,0xC9BB}, + {0xA38E,0xA38E,0xC9BC}, + {0xA38F,0xA38F,0xC9BD}, + {0xA390,0xA390,0xC9BE}, /* A390 */ + {0xA391,0xA391,0xC9BF}, + {0xA392,0xA392,0xC9C2}, + {0xA393,0xA393,0xC9C3}, + {0xA394,0xA394,0xC9C5}, + {0xA395,0xA395,0xC9C6}, + {0xA396,0xA396,0xC9C9}, + {0xA397,0xA397,0xC9CB}, + {0xA398,0xA398,0xC9CC}, + {0xA399,0xA399,0xC9CD}, + {0xA39A,0xA39A,0xC9CE}, + {0xA39B,0xA39B,0xC9CF}, + {0xA39C,0xA39C,0xC9D2}, + {0xA39D,0xA39D,0xC9D4}, + {0xA39E,0xA39E,0xC9D7}, + {0xA39F,0xA39F,0xC9D8}, + {0xA3A0,0xA3A0,0xC9DB}, /* A3A0 */ + {0xA3A1,0xA3A1,0xFF01}, + {0xA3A2,0xA3A2,0xFF02}, + {0xA3A3,0xA3A3,0xFF03}, + {0xA3A4,0xA3A4,0xFF04}, + {0xA3A5,0xA3A5,0xFF05}, + {0xA3A6,0xA3A6,0xFF06}, + {0xA3A7,0xA3A7,0xFF07}, + {0xA3A8,0xA3A8,0xFF08}, + {0xA3A9,0xA3A9,0xFF09}, + {0xA3AA,0xA3AA,0xFF0A}, + {0xA3AB,0xA3AB,0xFF0B}, + {0xA3AC,0xA3AC,0xFF0C}, + {0xA3AD,0xA3AD,0xFF0D}, + {0xA3AE,0xA3AE,0xFF0E}, + {0xA3AF,0xA3AF,0xFF0F}, + {0xA3B0,0xA3B0,0xFF10}, /* A3B0 */ + {0xA3B1,0xA3B1,0xFF11}, + {0xA3B2,0xA3B2,0xFF12}, + {0xA3B3,0xA3B3,0xFF13}, + {0xA3B4,0xA3B4,0xFF14}, + {0xA3B5,0xA3B5,0xFF15}, + {0xA3B6,0xA3B6,0xFF16}, + {0xA3B7,0xA3B7,0xFF17}, + {0xA3B8,0xA3B8,0xFF18}, + {0xA3B9,0xA3B9,0xFF19}, + {0xA3BA,0xA3BA,0xFF1A}, + {0xA3BB,0xA3BB,0xFF1B}, + {0xA3BC,0xA3BC,0xFF1C}, + {0xA3BD,0xA3BD,0xFF1D}, + {0xA3BE,0xA3BE,0xFF1E}, + {0xA3BF,0xA3BF,0xFF1F}, + {0xA3C0,0xA3C0,0xFF20}, /* A3C0 */ + {0xA3C1,0xA3E1,0xFF21}, + {0xA3C2,0xA3E2,0xFF22}, + {0xA3C3,0xA3E3,0xFF23}, + {0xA3C4,0xA3E4,0xFF24}, + {0xA3C5,0xA3E5,0xFF25}, + {0xA3C6,0xA3E6,0xFF26}, + {0xA3C7,0xA3E7,0xFF27}, + {0xA3C8,0xA3E8,0xFF28}, + {0xA3C9,0xA3E9,0xFF29}, + {0xA3CA,0xA3EA,0xFF2A}, + {0xA3CB,0xA3EB,0xFF2B}, + {0xA3CC,0xA3EC,0xFF2C}, + {0xA3CD,0xA3ED,0xFF2D}, + {0xA3CE,0xA3EE,0xFF2E}, + {0xA3CF,0xA3EF,0xFF2F}, + {0xA3D0,0xA3F0,0xFF30}, /* A3D0 */ + {0xA3D1,0xA3F1,0xFF31}, + {0xA3D2,0xA3F2,0xFF32}, + {0xA3D3,0xA3F3,0xFF33}, + {0xA3D4,0xA3F4,0xFF34}, + {0xA3D5,0xA3F5,0xFF35}, + {0xA3D6,0xA3F6,0xFF36}, + {0xA3D7,0xA3F7,0xFF37}, + {0xA3D8,0xA3F8,0xFF38}, + {0xA3D9,0xA3F9,0xFF39}, + {0xA3DA,0xA3FA,0xFF3A}, + {0xA3DB,0xA3DB,0xFF3B}, + {0xA3DC,0xA3DC,0xFFE6}, + {0xA3DD,0xA3DD,0xFF3D}, + {0xA3DE,0xA3DE,0xFF3E}, + {0xA3DF,0xA3DF,0xFF3F}, + {0xA3E0,0xA3E0,0xFF40}, /* A3E0 */ + {0xA3C1,0xA3E1,0xFF41}, + {0xA3C2,0xA3E2,0xFF42}, + {0xA3C3,0xA3E3,0xFF43}, + {0xA3C4,0xA3E4,0xFF44}, + {0xA3C5,0xA3E5,0xFF45}, + {0xA3C6,0xA3E6,0xFF46}, + {0xA3C7,0xA3E7,0xFF47}, + {0xA3C8,0xA3E8,0xFF48}, + {0xA3C9,0xA3E9,0xFF49}, + {0xA3CA,0xA3EA,0xFF4A}, + {0xA3CB,0xA3EB,0xFF4B}, + {0xA3CC,0xA3EC,0xFF4C}, + {0xA3CD,0xA3ED,0xFF4D}, + {0xA3CE,0xA3EE,0xFF4E}, + {0xA3CF,0xA3EF,0xFF4F}, + {0xA3D0,0xA3F0,0xFF50}, /* A3F0 */ + {0xA3D1,0xA3F1,0xFF51}, + {0xA3D2,0xA3F2,0xFF52}, + {0xA3D3,0xA3F3,0xFF53}, + {0xA3D4,0xA3F4,0xFF54}, + {0xA3D5,0xA3F5,0xFF55}, + {0xA3D6,0xA3F6,0xFF56}, + {0xA3D7,0xA3F7,0xFF57}, + {0xA3D8,0xA3F8,0xFF58}, + {0xA3D9,0xA3F9,0xFF59}, + {0xA3DA,0xA3FA,0xFF5A}, + {0xA3FB,0xA3FB,0xFF5B}, + {0xA3FC,0xA3FC,0xFF5C}, + {0xA3FD,0xA3FD,0xFF5D}, + {0xA3FE,0xA3FE,0xFFE3}, + {0xA3FF,0xA3FF,0x003F} +}; + + +static MY_UNICASE_INFO cA5[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}, /* xx00 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx10 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx20 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx30 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0xA540,0xA540,0x003F}, /* A540 */ + {0xA541,0xA541,0xCA47}, + {0xA542,0xA542,0xCA48}, + {0xA543,0xA543,0xCA49}, + {0xA544,0xA544,0xCA4A}, + {0xA545,0xA545,0xCA4B}, + {0xA546,0xA546,0xCA4E}, + {0xA547,0xA547,0xCA4F}, + {0xA548,0xA548,0xCA51}, + {0xA549,0xA549,0xCA52}, + {0xA54A,0xA54A,0xCA53}, + {0xA54B,0xA54B,0xCA55}, + {0xA54C,0xA54C,0xCA56}, + {0xA54D,0xA54D,0xCA57}, + {0xA54E,0xA54E,0xCA58}, + {0xA54F,0xA54F,0xCA59}, + {0xA550,0xA550,0xCA5A}, /* A550 */ + {0xA551,0xA551,0xCA5B}, + {0xA552,0xA552,0xCA5E}, + {0xA553,0xA553,0xCA62}, + {0xA554,0xA554,0xCA63}, + {0xA555,0xA555,0xCA64}, + {0xA556,0xA556,0xCA65}, + {0xA557,0xA557,0xCA66}, + {0xA558,0xA558,0xCA67}, + {0xA559,0xA559,0xCA69}, + {0xA55A,0xA55A,0xCA6A}, + {0xA55B,0xA55B,0x003F}, + {0xA55C,0xA55C,0x003F}, + {0xA55D,0xA55D,0x003F}, + {0xA55E,0xA55E,0x003F}, + {0xA55F,0xA55F,0x003F}, + {0xA560,0xA560,0x003F}, /* A560 */ + {0xA561,0xA561,0xCA6B}, + {0xA562,0xA562,0xCA6C}, + {0xA563,0xA563,0xCA6D}, + {0xA564,0xA564,0xCA6E}, + {0xA565,0xA565,0xCA6F}, + {0xA566,0xA566,0xCA70}, + {0xA567,0xA567,0xCA71}, + {0xA568,0xA568,0xCA72}, + {0xA569,0xA569,0xCA73}, + {0xA56A,0xA56A,0xCA74}, + {0xA56B,0xA56B,0xCA75}, + {0xA56C,0xA56C,0xCA76}, + {0xA56D,0xA56D,0xCA77}, + {0xA56E,0xA56E,0xCA78}, + {0xA56F,0xA56F,0xCA79}, + {0xA570,0xA570,0xCA7A}, /* A570 */ + {0xA571,0xA571,0xCA7B}, + {0xA572,0xA572,0xCA7C}, + {0xA573,0xA573,0xCA7E}, + {0xA574,0xA574,0xCA7F}, + {0xA575,0xA575,0xCA80}, + {0xA576,0xA576,0xCA81}, + {0xA577,0xA577,0xCA82}, + {0xA578,0xA578,0xCA83}, + {0xA579,0xA579,0xCA85}, + {0xA57A,0xA57A,0xCA86}, + {0xA57B,0xA57B,0x003F}, + {0xA57C,0xA57C,0x003F}, + {0xA57D,0xA57D,0x003F}, + {0xA57E,0xA57E,0x003F}, + {0xA57F,0xA57F,0x003F}, + {0xA580,0xA580,0x003F}, /* A580 */ + {0xA581,0xA581,0xCA87}, + {0xA582,0xA582,0xCA88}, + {0xA583,0xA583,0xCA89}, + {0xA584,0xA584,0xCA8A}, + {0xA585,0xA585,0xCA8B}, + {0xA586,0xA586,0xCA8C}, + {0xA587,0xA587,0xCA8D}, + {0xA588,0xA588,0xCA8E}, + {0xA589,0xA589,0xCA8F}, + {0xA58A,0xA58A,0xCA90}, + {0xA58B,0xA58B,0xCA91}, + {0xA58C,0xA58C,0xCA92}, + {0xA58D,0xA58D,0xCA93}, + {0xA58E,0xA58E,0xCA94}, + {0xA58F,0xA58F,0xCA95}, + {0xA590,0xA590,0xCA96}, /* A590 */ + {0xA591,0xA591,0xCA97}, + {0xA592,0xA592,0xCA99}, + {0xA593,0xA593,0xCA9A}, + {0xA594,0xA594,0xCA9B}, + {0xA595,0xA595,0xCA9C}, + {0xA596,0xA596,0xCA9D}, + {0xA597,0xA597,0xCA9E}, + {0xA598,0xA598,0xCA9F}, + {0xA599,0xA599,0xCAA0}, + {0xA59A,0xA59A,0xCAA1}, + {0xA59B,0xA59B,0xCAA2}, + {0xA59C,0xA59C,0xCAA3}, + {0xA59D,0xA59D,0xCAA4}, + {0xA59E,0xA59E,0xCAA5}, + {0xA59F,0xA59F,0xCAA6}, + {0xA5A0,0xA5A0,0xCAA7}, /* A5A0 */ + {0xA5B0,0xA5A1,0x2170}, + {0xA5B1,0xA5A2,0x2171}, + {0xA5B2,0xA5A3,0x2172}, + {0xA5B3,0xA5A4,0x2173}, + {0xA5B4,0xA5A5,0x2174}, + {0xA5B5,0xA5A6,0x2175}, + {0xA5B6,0xA5A7,0x2176}, + {0xA5B7,0xA5A8,0x2177}, + {0xA5B8,0xA5A9,0x2178}, + {0xA5B9,0xA5AA,0x2179}, + {0xA5AB,0xA5AB,0x003F}, + {0xA5AC,0xA5AC,0x003F}, + {0xA5AD,0xA5AD,0x003F}, + {0xA5AE,0xA5AE,0x003F}, + {0xA5AF,0xA5AF,0x003F}, + {0xA5B0,0xA5A1,0x2160}, /* A5B0 */ + {0xA5B1,0xA5A2,0x2161}, + {0xA5B2,0xA5A3,0x2162}, + {0xA5B3,0xA5A4,0x2163}, + {0xA5B4,0xA5A5,0x2164}, + {0xA5B5,0xA5A6,0x2165}, + {0xA5B6,0xA5A7,0x2166}, + {0xA5B7,0xA5A8,0x2167}, + {0xA5B8,0xA5A9,0x2168}, + {0xA5B9,0xA5AA,0x2169}, + {0xA5BA,0xA5BA,0x003F}, + {0xA5BB,0xA5BB,0x003F}, + {0xA5BC,0xA5BC,0x003F}, + {0xA5BD,0xA5BD,0x003F}, + {0xA5BE,0xA5BE,0x003F}, + {0xA5BF,0xA5BF,0x003F}, + {0xA5C0,0xA5C0,0x003F}, /* A5C0 */ + {0xA5C1,0xA5E1,0x0391}, + {0xA5C2,0xA5E2,0x0392}, + {0xA5C3,0xA5E3,0x0393}, + {0xA5C4,0xA5E4,0x0394}, + {0xA5C5,0xA5E5,0x0395}, + {0xA5C6,0xA5E6,0x0396}, + {0xA5C7,0xA5E7,0x0397}, + {0xA5C8,0xA5E8,0x0398}, + {0xA5C9,0xA5E9,0x0399}, + {0xA5CA,0xA5EA,0x039A}, + {0xA5CB,0xA5EB,0x039B}, + {0xA5CC,0xA5EC,0x039C}, + {0xA5CD,0xA5ED,0x039D}, + {0xA5CE,0xA5EE,0x039E}, + {0xA5CF,0xA5EF,0x039F}, + {0xA5D0,0xA5F0,0x03A0}, /* A5D0 */ + {0xA5D1,0xA5F1,0x03A1}, + {0xA5D2,0xA5F2,0x03A3}, + {0xA5D3,0xA5F3,0x03A4}, + {0xA5D4,0xA5F4,0x03A5}, + {0xA5D5,0xA5F5,0x03A6}, + {0xA5D6,0xA5F6,0x03A7}, + {0xA5D7,0xA5F7,0x03A8}, + {0xA5D8,0xA5F8,0x03A9}, + {0xA5D9,0xA5D9,0x003F}, + {0xA5DA,0xA5DA,0x003F}, + {0xA5DB,0xA5DB,0x003F}, + {0xA5DC,0xA5DC,0x003F}, + {0xA5DD,0xA5DD,0x003F}, + {0xA5DE,0xA5DE,0x003F}, + {0xA5DF,0xA5DF,0x003F}, + {0xA5E0,0xA5E0,0x003F}, /* A5E0 */ + {0xA5C1,0xA5E1,0x03B1}, + {0xA5C2,0xA5E2,0x03B2}, + {0xA5C3,0xA5E3,0x03B3}, + {0xA5C4,0xA5E4,0x03B4}, + {0xA5C5,0xA5E5,0x03B5}, + {0xA5C6,0xA5E6,0x03B6}, + {0xA5C7,0xA5E7,0x03B7}, + {0xA5C8,0xA5E8,0x03B8}, + {0xA5C9,0xA5E9,0x03B9}, + {0xA5CA,0xA5EA,0x03BA}, + {0xA5CB,0xA5EB,0x03BB}, + {0xA5CC,0xA5EC,0x03BC}, + {0xA5CD,0xA5ED,0x03BD}, + {0xA5CE,0xA5EE,0x03BE}, + {0xA5CF,0xA5EF,0x03BF}, + {0xA5D0,0xA5F0,0x03C0}, /* A5F0 */ + {0xA5D1,0xA5F1,0x03C1}, + {0xA5D2,0xA5F2,0x03C3}, + {0xA5D3,0xA5F3,0x03C4}, + {0xA5D4,0xA5F4,0x03C5}, + {0xA5D5,0xA5F5,0x03C6}, + {0xA5D6,0xA5F6,0x03C7}, + {0xA5D7,0xA5F7,0x03C8}, + {0xA5D8,0xA5F8,0x03C9}, + {0xA5F9,0xA5F9,0x003F}, + {0xA5FA,0xA5FA,0x003F}, + {0xA5FB,0xA5FB,0x003F}, + {0xA5FC,0xA5FC,0x003F}, + {0xA5FD,0xA5FD,0x003F}, + {0xA5FE,0xA5FE,0x003F}, + {0xA5FF,0xA5FF,0x003F} +}; + + +static MY_UNICASE_INFO cA7[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}, /* xx00 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx10 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx20 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx30 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0xA740,0xA740,0x003F}, /* A740 */ + {0xA741,0xA741,0xCB0B}, + {0xA742,0xA742,0xCB0C}, + {0xA743,0xA743,0xCB0D}, + {0xA744,0xA744,0xCB0E}, + {0xA745,0xA745,0xCB0F}, + {0xA746,0xA746,0xCB11}, + {0xA747,0xA747,0xCB12}, + {0xA748,0xA748,0xCB13}, + {0xA749,0xA749,0xCB15}, + {0xA74A,0xA74A,0xCB16}, + {0xA74B,0xA74B,0xCB17}, + {0xA74C,0xA74C,0xCB19}, + {0xA74D,0xA74D,0xCB1A}, + {0xA74E,0xA74E,0xCB1B}, + {0xA74F,0xA74F,0xCB1C}, + {0xA750,0xA750,0xCB1D}, /* A750 */ + {0xA751,0xA751,0xCB1E}, + {0xA752,0xA752,0xCB1F}, + {0xA753,0xA753,0xCB22}, + {0xA754,0xA754,0xCB23}, + {0xA755,0xA755,0xCB24}, + {0xA756,0xA756,0xCB25}, + {0xA757,0xA757,0xCB26}, + {0xA758,0xA758,0xCB27}, + {0xA759,0xA759,0xCB28}, + {0xA75A,0xA75A,0xCB29}, + {0xA75B,0xA75B,0x003F}, + {0xA75C,0xA75C,0x003F}, + {0xA75D,0xA75D,0x003F}, + {0xA75E,0xA75E,0x003F}, + {0xA75F,0xA75F,0x003F}, + {0xA760,0xA760,0x003F}, /* A760 */ + {0xA761,0xA761,0xCB2A}, + {0xA762,0xA762,0xCB2B}, + {0xA763,0xA763,0xCB2C}, + {0xA764,0xA764,0xCB2D}, + {0xA765,0xA765,0xCB2E}, + {0xA766,0xA766,0xCB2F}, + {0xA767,0xA767,0xCB30}, + {0xA768,0xA768,0xCB31}, + {0xA769,0xA769,0xCB32}, + {0xA76A,0xA76A,0xCB33}, + {0xA76B,0xA76B,0xCB34}, + {0xA76C,0xA76C,0xCB35}, + {0xA76D,0xA76D,0xCB36}, + {0xA76E,0xA76E,0xCB37}, + {0xA76F,0xA76F,0xCB38}, + {0xA770,0xA770,0xCB39}, /* A770 */ + {0xA771,0xA771,0xCB3A}, + {0xA772,0xA772,0xCB3B}, + {0xA773,0xA773,0xCB3C}, + {0xA774,0xA774,0xCB3D}, + {0xA775,0xA775,0xCB3E}, + {0xA776,0xA776,0xCB3F}, + {0xA777,0xA777,0xCB40}, + {0xA778,0xA778,0xCB42}, + {0xA779,0xA779,0xCB43}, + {0xA77A,0xA77A,0xCB44}, + {0xA77B,0xA77B,0x003F}, + {0xA77C,0xA77C,0x003F}, + {0xA77D,0xA77D,0x003F}, + {0xA77E,0xA77E,0x003F}, + {0xA77F,0xA77F,0x003F}, + {0xA780,0xA780,0x003F}, /* A780 */ + {0xA781,0xA781,0xCB45}, + {0xA782,0xA782,0xCB46}, + {0xA783,0xA783,0xCB47}, + {0xA784,0xA784,0xCB4A}, + {0xA785,0xA785,0xCB4B}, + {0xA786,0xA786,0xCB4D}, + {0xA787,0xA787,0xCB4E}, + {0xA788,0xA788,0xCB4F}, + {0xA789,0xA789,0xCB51}, + {0xA78A,0xA78A,0xCB52}, + {0xA78B,0xA78B,0xCB53}, + {0xA78C,0xA78C,0xCB54}, + {0xA78D,0xA78D,0xCB55}, + {0xA78E,0xA78E,0xCB56}, + {0xA78F,0xA78F,0xCB57}, + {0xA790,0xA790,0xCB5A}, /* A790 */ + {0xA791,0xA791,0xCB5B}, + {0xA792,0xA792,0xCB5C}, + {0xA793,0xA793,0xCB5E}, + {0xA794,0xA794,0xCB5F}, + {0xA795,0xA795,0xCB60}, + {0xA796,0xA796,0xCB61}, + {0xA797,0xA797,0xCB62}, + {0xA798,0xA798,0xCB63}, + {0xA799,0xA799,0xCB65}, + {0xA79A,0xA79A,0xCB66}, + {0xA79B,0xA79B,0xCB67}, + {0xA79C,0xA79C,0xCB68}, + {0xA79D,0xA79D,0xCB69}, + {0xA79E,0xA79E,0xCB6A}, + {0xA79F,0xA79F,0xCB6B}, + {0xA7A0,0xA7A0,0xCB6C}, /* A7A0 */ + {0xA7A1,0xA7A1,0x3395}, + {0xA7A2,0xA7A2,0x3396}, + {0xA7A3,0xA7A3,0x3397}, + {0xA7A4,0xA7A4,0x2113}, + {0xA7A5,0xA7A5,0x3398}, + {0xA7A6,0xA7A6,0x33C4}, + {0xA7A7,0xA7A7,0x33A3}, + {0xA7A8,0xA7A8,0x33A4}, + {0xA7A9,0xA7A9,0x33A5}, + {0xA7AA,0xA7AA,0x33A6}, + {0xA7AB,0xA7AB,0x3399}, + {0xA7AC,0xA7AC,0x339A}, + {0xA7AD,0xA7AD,0x339B}, + {0xA7AE,0xA7AE,0x339C}, + {0xA7AF,0xA7AF,0x339D}, + {0xA7B0,0xA7B0,0x339E}, /* A7B0 */ + {0xA7B1,0xA7B1,0x339F}, + {0xA7B2,0xA7B2,0x33A0}, + {0xA7B3,0xA7B3,0x33A1}, + {0xA7B4,0xA7B4,0x33A2}, + {0xA7B5,0xA7B5,0x33CA}, + {0xA7B6,0xA7B6,0x338D}, + {0xA7B7,0xA7B7,0x338E}, + {0xA7B8,0xA7B8,0x338F}, + {0xA7B9,0xA7B9,0x33CF}, + {0xA7BA,0xA7BA,0x3388}, + {0xA7BB,0xA7BB,0x3389}, + {0xA7BC,0xA7BC,0x33C8}, + {0xA7BD,0xA7BD,0x33A7}, + {0xA7BE,0xA7BE,0x33A8}, + {0xA7BF,0xA7BF,0x33B0}, + {0xA7C0,0xA7C0,0x33B1}, /* A7C0 */ + {0xA7C1,0xA7C1,0x33B2}, + {0xA7C2,0xA7C2,0x33B3}, + {0xA7C3,0xA7C3,0x33B4}, + {0xA7C4,0xA7C4,0x33B5}, + {0xA7C5,0xA7C5,0x33B6}, + {0xA7C6,0xA7C6,0x33B7}, + {0xA7C7,0xA7C7,0x33B8}, + {0xA7C8,0xA7C8,0x33B9}, + {0xA7C9,0xA7C9,0x3380}, + {0xA7CA,0xA7CA,0x3381}, + {0xA7CB,0xA7CB,0x3382}, + {0xA7CC,0xA7CC,0x3383}, + {0xA7CD,0xA7CD,0x3384}, + {0xA7CE,0xA7CE,0x33BA}, + {0xA7CF,0xA7CF,0x33BB}, + {0xA7D0,0xA7D0,0x33BC}, /* A7D0 */ + {0xA7D1,0xA7D1,0x33BD}, + {0xA7D2,0xA7D2,0x33BE}, + {0xA7D3,0xA7D3,0x33BF}, + {0xA7D4,0xA7D4,0x3390}, + {0xA7D5,0xA7D5,0x3391}, + {0xA7D6,0xA7D6,0x3392}, + {0xA7D7,0xA7D7,0x3393}, + {0xA7D8,0xA7D8,0x3394}, + {0xA7D9,0xA5F8,0x2126}, + {0xA7DA,0xA7DA,0x33C0}, + {0xA7DB,0xA7DB,0x33C1}, + {0xA7DC,0xA7DC,0x338A}, + {0xA7DD,0xA7DD,0x338B}, + {0xA7DE,0xA7DE,0x338C}, + {0xA7DF,0xA7DF,0x33D6}, + {0xA7E0,0xA7E0,0x33C5}, /* A7E0 */ + {0xA7E1,0xA7E1,0x33AD}, + {0xA7E2,0xA7E2,0x33AE}, + {0xA7E3,0xA7E3,0x33AF}, + {0xA7E4,0xA7E4,0x33DB}, + {0xA7E5,0xA7E5,0x33A9}, + {0xA7E6,0xA7E6,0x33AA}, + {0xA7E7,0xA7E7,0x33AB}, + {0xA7E8,0xA7E8,0x33AC}, + {0xA7E9,0xA7E9,0x33DD}, + {0xA7EA,0xA7EA,0x33D0}, + {0xA7EB,0xA7EB,0x33D3}, + {0xA7EC,0xA7EC,0x33C3}, + {0xA7ED,0xA7ED,0x33C9}, + {0xA7EE,0xA7EE,0x33DC}, + {0xA7EF,0xA7EF,0x33C6}, + {0xA7F0,0xA7F0,0x003F}, /* A7F0 */ + {0xA7F1,0xA7F1,0x003F}, + {0xA7F2,0xA7F2,0x003F}, + {0xA7F3,0xA7F3,0x003F}, + {0xA7F4,0xA7F4,0x003F}, + {0xA7F5,0xA7F5,0x003F}, + {0xA7F6,0xA7F6,0x003F}, + {0xA7F7,0xA7F7,0x003F}, + {0xA7F8,0xA7F8,0x003F}, + {0xA7F9,0xA7F9,0x003F}, + {0xA7FA,0xA7FA,0x003F}, + {0xA7FB,0xA7FB,0x003F}, + {0xA7FC,0xA7FC,0x003F}, + {0xA7FD,0xA7FD,0x003F}, + {0xA7FE,0xA7FE,0x003F}, + {0xA7FF,0xA7FF,0x003F} +}; + + +static MY_UNICASE_INFO cA8[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}, /* xx00 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx10 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx20 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx30 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0xA840,0xA840,0x003F}, /* A840 */ + {0xA841,0xA841,0xCB6D}, + {0xA842,0xA842,0xCB6E}, + {0xA843,0xA843,0xCB6F}, + {0xA844,0xA844,0xCB70}, + {0xA845,0xA845,0xCB71}, + {0xA846,0xA846,0xCB72}, + {0xA847,0xA847,0xCB73}, + {0xA848,0xA848,0xCB74}, + {0xA849,0xA849,0xCB75}, + {0xA84A,0xA84A,0xCB76}, + {0xA84B,0xA84B,0xCB77}, + {0xA84C,0xA84C,0xCB7A}, + {0xA84D,0xA84D,0xCB7B}, + {0xA84E,0xA84E,0xCB7C}, + {0xA84F,0xA84F,0xCB7D}, + {0xA850,0xA850,0xCB7E}, /* A850 */ + {0xA851,0xA851,0xCB7F}, + {0xA852,0xA852,0xCB80}, + {0xA853,0xA853,0xCB81}, + {0xA854,0xA854,0xCB82}, + {0xA855,0xA855,0xCB83}, + {0xA856,0xA856,0xCB84}, + {0xA857,0xA857,0xCB85}, + {0xA858,0xA858,0xCB86}, + {0xA859,0xA859,0xCB87}, + {0xA85A,0xA85A,0xCB88}, + {0xA85B,0xA85B,0x003F}, + {0xA85C,0xA85C,0x003F}, + {0xA85D,0xA85D,0x003F}, + {0xA85E,0xA85E,0x003F}, + {0xA85F,0xA85F,0x003F}, + {0xA860,0xA860,0x003F}, /* A860 */ + {0xA861,0xA861,0xCB89}, + {0xA862,0xA862,0xCB8A}, + {0xA863,0xA863,0xCB8B}, + {0xA864,0xA864,0xCB8C}, + {0xA865,0xA865,0xCB8D}, + {0xA866,0xA866,0xCB8E}, + {0xA867,0xA867,0xCB8F}, + {0xA868,0xA868,0xCB90}, + {0xA869,0xA869,0xCB91}, + {0xA86A,0xA86A,0xCB92}, + {0xA86B,0xA86B,0xCB93}, + {0xA86C,0xA86C,0xCB94}, + {0xA86D,0xA86D,0xCB95}, + {0xA86E,0xA86E,0xCB96}, + {0xA86F,0xA86F,0xCB97}, + {0xA870,0xA870,0xCB98}, /* A870 */ + {0xA871,0xA871,0xCB99}, + {0xA872,0xA872,0xCB9A}, + {0xA873,0xA873,0xCB9B}, + {0xA874,0xA874,0xCB9D}, + {0xA875,0xA875,0xCB9E}, + {0xA876,0xA876,0xCB9F}, + {0xA877,0xA877,0xCBA0}, + {0xA878,0xA878,0xCBA1}, + {0xA879,0xA879,0xCBA2}, + {0xA87A,0xA87A,0xCBA3}, + {0xA87B,0xA87B,0x003F}, + {0xA87C,0xA87C,0x003F}, + {0xA87D,0xA87D,0x003F}, + {0xA87E,0xA87E,0x003F}, + {0xA87F,0xA87F,0x003F}, + {0xA880,0xA880,0x003F}, /* A880 */ + {0xA881,0xA881,0xCBA4}, + {0xA882,0xA882,0xCBA5}, + {0xA883,0xA883,0xCBA6}, + {0xA884,0xA884,0xCBA7}, + {0xA885,0xA885,0xCBA8}, + {0xA886,0xA886,0xCBA9}, + {0xA887,0xA887,0xCBAA}, + {0xA888,0xA888,0xCBAB}, + {0xA889,0xA889,0xCBAC}, + {0xA88A,0xA88A,0xCBAD}, + {0xA88B,0xA88B,0xCBAE}, + {0xA88C,0xA88C,0xCBAF}, + {0xA88D,0xA88D,0xCBB0}, + {0xA88E,0xA88E,0xCBB1}, + {0xA88F,0xA88F,0xCBB2}, + {0xA890,0xA890,0xCBB3}, /* A890 */ + {0xA891,0xA891,0xCBB4}, + {0xA892,0xA892,0xCBB5}, + {0xA893,0xA893,0xCBB6}, + {0xA894,0xA894,0xCBB7}, + {0xA895,0xA895,0xCBB9}, + {0xA896,0xA896,0xCBBA}, + {0xA897,0xA897,0xCBBB}, + {0xA898,0xA898,0xCBBC}, + {0xA899,0xA899,0xCBBD}, + {0xA89A,0xA89A,0xCBBE}, + {0xA89B,0xA89B,0xCBBF}, + {0xA89C,0xA89C,0xCBC0}, + {0xA89D,0xA89D,0xCBC1}, + {0xA89E,0xA89E,0xCBC2}, + {0xA89F,0xA89F,0xCBC3}, + {0xA8A0,0xA8A0,0xCBC4}, /* A8A0 */ + {0xA8A1,0xA9A1,0x00C6}, + {0xA8A2,0xA9A3,0x00D0}, + {0xA8A3,0xA8A3,0x00AA}, + {0xA8A4,0xA9A4,0x0126}, + {0xA8A5,0xA8A5,0x003F}, + {0xA8A6,0xA9A6,0x0132}, + {0xA8A7,0xA8A7,0x003F}, + {0xA8A8,0xA9A8,0x013F}, + {0xA8A9,0xA9A9,0x0141}, + {0xA8AA,0xA9AA,0x00D8}, + {0xA8AB,0xA9AB,0x0152}, + {0xA8AC,0xA8AC,0x00BA}, + {0xA8AD,0xA9AD,0x00DE}, + {0xA8AE,0xA9AE,0x0166}, + {0xA8AF,0xA9AF,0x014A}, + {0xA8B0,0xA8B0,0x003F}, /* A8B0 */ + {0xA8B1,0xA8B1,0x3260}, + {0xA8B2,0xA8B2,0x3261}, + {0xA8B3,0xA8B3,0x3262}, + {0xA8B4,0xA8B4,0x3263}, + {0xA8B5,0xA8B5,0x3264}, + {0xA8B6,0xA8B6,0x3265}, + {0xA8B7,0xA8B7,0x3266}, + {0xA8B8,0xA8B8,0x3267}, + {0xA8B9,0xA8B9,0x3268}, + {0xA8BA,0xA8BA,0x3269}, + {0xA8BB,0xA8BB,0x326A}, + {0xA8BC,0xA8BC,0x326B}, + {0xA8BD,0xA8BD,0x326C}, + {0xA8BE,0xA8BE,0x326D}, + {0xA8BF,0xA8BF,0x326E}, + {0xA8C0,0xA8C0,0x326F}, /* A8C0 */ + {0xA8C1,0xA8C1,0x3270}, + {0xA8C2,0xA8C2,0x3271}, + {0xA8C3,0xA8C3,0x3272}, + {0xA8C4,0xA8C4,0x3273}, + {0xA8C5,0xA8C5,0x3274}, + {0xA8C6,0xA8C6,0x3275}, + {0xA8C7,0xA8C7,0x3276}, + {0xA8C8,0xA8C8,0x3277}, + {0xA8C9,0xA8C9,0x3278}, + {0xA8CA,0xA8CA,0x3279}, + {0xA8CB,0xA8CB,0x327A}, + {0xA8CC,0xA8CC,0x327B}, + {0xA8CD,0xA8CD,0x24D0}, + {0xA8CE,0xA8CE,0x24D1}, + {0xA8CF,0xA8CF,0x24D2}, + {0xA8D0,0xA8D0,0x24D3}, /* A8D0 */ + {0xA8D1,0xA8D1,0x24D4}, + {0xA8D2,0xA8D2,0x24D5}, + {0xA8D3,0xA8D3,0x24D6}, + {0xA8D4,0xA8D4,0x24D7}, + {0xA8D5,0xA8D5,0x24D8}, + {0xA8D6,0xA8D6,0x24D9}, + {0xA8D7,0xA8D7,0x24DA}, + {0xA8D8,0xA8D8,0x24DB}, + {0xA8D9,0xA8D9,0x24DC}, + {0xA8DA,0xA8DA,0x24DD}, + {0xA8DB,0xA8DB,0x24DE}, + {0xA8DC,0xA8DC,0x24DF}, + {0xA8DD,0xA8DD,0x24E0}, + {0xA8DE,0xA8DE,0x24E1}, + {0xA8DF,0xA8DF,0x24E2}, + {0xA8E0,0xA8E0,0x24E3}, /* A8E0 */ + {0xA8E1,0xA8E1,0x24E4}, + {0xA8E2,0xA8E2,0x24E5}, + {0xA8E3,0xA8E3,0x24E6}, + {0xA8E4,0xA8E4,0x24E7}, + {0xA8E5,0xA8E5,0x24E8}, + {0xA8E6,0xA8E6,0x24E9}, + {0xA8E7,0xA8E7,0x2460}, + {0xA8E8,0xA8E8,0x2461}, + {0xA8E9,0xA8E9,0x2462}, + {0xA8EA,0xA8EA,0x2463}, + {0xA8EB,0xA8EB,0x2464}, + {0xA8EC,0xA8EC,0x2465}, + {0xA8ED,0xA8ED,0x2466}, + {0xA8EE,0xA8EE,0x2467}, + {0xA8EF,0xA8EF,0x2468}, + {0xA8F0,0xA8F0,0x2469}, /* A8F0 */ + {0xA8F1,0xA8F1,0x246A}, + {0xA8F2,0xA8F2,0x246B}, + {0xA8F3,0xA8F3,0x246C}, + {0xA8F4,0xA8F4,0x246D}, + {0xA8F5,0xA8F5,0x246E}, + {0xA8F6,0xA8F6,0x00BD}, + {0xA8F7,0xA8F7,0x2153}, + {0xA8F8,0xA8F8,0x2154}, + {0xA8F9,0xA8F9,0x00BC}, + {0xA8FA,0xA8FA,0x00BE}, + {0xA8FB,0xA8FB,0x215B}, + {0xA8FC,0xA8FC,0x215C}, + {0xA8FD,0xA8FD,0x215D}, + {0xA8FE,0xA8FE,0x215E}, + {0xA8FF,0xA8FF,0x003F} +}; + + +static MY_UNICASE_INFO cA9[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}, /* xx00 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx10 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx20 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx30 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0xA940,0xA940,0x003F}, /* A940 */ + {0xA941,0xA941,0xCBC5}, + {0xA942,0xA942,0xCBC6}, + {0xA943,0xA943,0xCBC7}, + {0xA944,0xA944,0xCBC8}, + {0xA945,0xA945,0xCBC9}, + {0xA946,0xA946,0xCBCA}, + {0xA947,0xA947,0xCBCB}, + {0xA948,0xA948,0xCBCC}, + {0xA949,0xA949,0xCBCD}, + {0xA94A,0xA94A,0xCBCE}, + {0xA94B,0xA94B,0xCBCF}, + {0xA94C,0xA94C,0xCBD0}, + {0xA94D,0xA94D,0xCBD1}, + {0xA94E,0xA94E,0xCBD2}, + {0xA94F,0xA94F,0xCBD3}, + {0xA950,0xA950,0xCBD5}, /* A950 */ + {0xA951,0xA951,0xCBD6}, + {0xA952,0xA952,0xCBD7}, + {0xA953,0xA953,0xCBD8}, + {0xA954,0xA954,0xCBD9}, + {0xA955,0xA955,0xCBDA}, + {0xA956,0xA956,0xCBDB}, + {0xA957,0xA957,0xCBDC}, + {0xA958,0xA958,0xCBDD}, + {0xA959,0xA959,0xCBDE}, + {0xA95A,0xA95A,0xCBDF}, + {0xA95B,0xA95B,0x003F}, + {0xA95C,0xA95C,0x003F}, + {0xA95D,0xA95D,0x003F}, + {0xA95E,0xA95E,0x003F}, + {0xA95F,0xA95F,0x003F}, + {0xA960,0xA960,0x003F}, /* A960 */ + {0xA961,0xA961,0xCBE0}, + {0xA962,0xA962,0xCBE1}, + {0xA963,0xA963,0xCBE2}, + {0xA964,0xA964,0xCBE3}, + {0xA965,0xA965,0xCBE5}, + {0xA966,0xA966,0xCBE6}, + {0xA967,0xA967,0xCBE8}, + {0xA968,0xA968,0xCBEA}, + {0xA969,0xA969,0xCBEB}, + {0xA96A,0xA96A,0xCBEC}, + {0xA96B,0xA96B,0xCBED}, + {0xA96C,0xA96C,0xCBEE}, + {0xA96D,0xA96D,0xCBEF}, + {0xA96E,0xA96E,0xCBF0}, + {0xA96F,0xA96F,0xCBF1}, + {0xA970,0xA970,0xCBF2}, /* A970 */ + {0xA971,0xA971,0xCBF3}, + {0xA972,0xA972,0xCBF4}, + {0xA973,0xA973,0xCBF5}, + {0xA974,0xA974,0xCBF6}, + {0xA975,0xA975,0xCBF7}, + {0xA976,0xA976,0xCBF8}, + {0xA977,0xA977,0xCBF9}, + {0xA978,0xA978,0xCBFA}, + {0xA979,0xA979,0xCBFB}, + {0xA97A,0xA97A,0xCBFC}, + {0xA97B,0xA97B,0x003F}, + {0xA97C,0xA97C,0x003F}, + {0xA97D,0xA97D,0x003F}, + {0xA97E,0xA97E,0x003F}, + {0xA97F,0xA97F,0x003F}, + {0xA980,0xA980,0x003F}, /* A980 */ + {0xA981,0xA981,0xCBFD}, + {0xA982,0xA982,0xCBFE}, + {0xA983,0xA983,0xCBFF}, + {0xA984,0xA984,0xCC00}, + {0xA985,0xA985,0xCC01}, + {0xA986,0xA986,0xCC02}, + {0xA987,0xA987,0xCC03}, + {0xA988,0xA988,0xCC04}, + {0xA989,0xA989,0xCC05}, + {0xA98A,0xA98A,0xCC06}, + {0xA98B,0xA98B,0xCC07}, + {0xA98C,0xA98C,0xCC08}, + {0xA98D,0xA98D,0xCC09}, + {0xA98E,0xA98E,0xCC0A}, + {0xA98F,0xA98F,0xCC0B}, + {0xA990,0xA990,0xCC0E}, /* A990 */ + {0xA991,0xA991,0xCC0F}, + {0xA992,0xA992,0xCC11}, + {0xA993,0xA993,0xCC12}, + {0xA994,0xA994,0xCC13}, + {0xA995,0xA995,0xCC15}, + {0xA996,0xA996,0xCC16}, + {0xA997,0xA997,0xCC17}, + {0xA998,0xA998,0xCC18}, + {0xA999,0xA999,0xCC19}, + {0xA99A,0xA99A,0xCC1A}, + {0xA99B,0xA99B,0xCC1B}, + {0xA99C,0xA99C,0xCC1E}, + {0xA99D,0xA99D,0xCC1F}, + {0xA99E,0xA99E,0xCC20}, + {0xA99F,0xA99F,0xCC23}, + {0xA9A0,0xA9A0,0xCC24}, /* A9A0 */ + {0xA8A1,0xA9A1,0x00E6}, + {0xA9A2,0xA9A2,0x0111}, + {0xA8A2,0xA9A3,0x00F0}, + {0xA8A4,0xA9A4,0x0127}, + { 0x49,0xA9A5,0x0131}, /* Turkish i */ + {0xA8A6,0xA9A6,0x0133}, + {0xA9A7,0xA9A7,0x0138}, + {0xA8A8,0xA9A8,0x0140}, + {0xA8A9,0xA9A9,0x0142}, + {0xA8AA,0xA9AA,0x00F8}, + {0xA8AB,0xA9AB,0x0153}, + {0xA9AC,0xA9AC,0x00DF}, + {0xA8AD,0xA9AD,0x00FE}, + {0xA8AE,0xA9AE,0x0167}, + {0xA8AF,0xA9AF,0x014B}, + {0xA9B0,0xA9B0,0x0149}, /* A9B0 */ + {0xA9B1,0xA9B1,0x3200}, + {0xA9B2,0xA9B2,0x3201}, + {0xA9B3,0xA9B3,0x3202}, + {0xA9B4,0xA9B4,0x3203}, + {0xA9B5,0xA9B5,0x3204}, + {0xA9B6,0xA9B6,0x3205}, + {0xA9B7,0xA9B7,0x3206}, + {0xA9B8,0xA9B8,0x3207}, + {0xA9B9,0xA9B9,0x3208}, + {0xA9BA,0xA9BA,0x3209}, + {0xA9BB,0xA9BB,0x320A}, + {0xA9BC,0xA9BC,0x320B}, + {0xA9BD,0xA9BD,0x320C}, + {0xA9BE,0xA9BE,0x320D}, + {0xA9BF,0xA9BF,0x320E}, + {0xA9C0,0xA9C0,0x320F}, /* A9C0 */ + {0xA9C1,0xA9C1,0x3210}, + {0xA9C2,0xA9C2,0x3211}, + {0xA9C3,0xA9C3,0x3212}, + {0xA9C4,0xA9C4,0x3213}, + {0xA9C5,0xA9C5,0x3214}, + {0xA9C6,0xA9C6,0x3215}, + {0xA9C7,0xA9C7,0x3216}, + {0xA9C8,0xA9C8,0x3217}, + {0xA9C9,0xA9C9,0x3218}, + {0xA9CA,0xA9CA,0x3219}, + {0xA9CB,0xA9CB,0x321A}, + {0xA9CC,0xA9CC,0x321B}, + {0xA9CD,0xA9CD,0x249C}, + {0xA9CE,0xA9CE,0x249D}, + {0xA9CF,0xA9CF,0x249E}, + {0xA9D0,0xA9D0,0x249F}, /* A9D0 */ + {0xA9D1,0xA9D1,0x24A0}, + {0xA9D2,0xA9D2,0x24A1}, + {0xA9D3,0xA9D3,0x24A2}, + {0xA9D4,0xA9D4,0x24A3}, + {0xA9D5,0xA9D5,0x24A4}, + {0xA9D6,0xA9D6,0x24A5}, + {0xA9D7,0xA9D7,0x24A6}, + {0xA9D8,0xA9D8,0x24A7}, + {0xA9D9,0xA9D9,0x24A8}, + {0xA9DA,0xA9DA,0x24A9}, + {0xA9DB,0xA9DB,0x24AA}, + {0xA9DC,0xA9DC,0x24AB}, + {0xA9DD,0xA9DD,0x24AC}, + {0xA9DE,0xA9DE,0x24AD}, + {0xA9DF,0xA9DF,0x24AE}, + {0xA9E0,0xA9E0,0x24AF}, /* A9E0 */ + {0xA9E1,0xA9E1,0x24B0}, + {0xA9E2,0xA9E2,0x24B1}, + {0xA9E3,0xA9E3,0x24B2}, + {0xA9E4,0xA9E4,0x24B3}, + {0xA9E5,0xA9E5,0x24B4}, + {0xA9E6,0xA9E6,0x24B5}, + {0xA9E7,0xA9E7,0x2474}, + {0xA9E8,0xA9E8,0x2475}, + {0xA9E9,0xA9E9,0x2476}, + {0xA9EA,0xA9EA,0x2477}, + {0xA9EB,0xA9EB,0x2478}, + {0xA9EC,0xA9EC,0x2479}, + {0xA9ED,0xA9ED,0x247A}, + {0xA9EE,0xA9EE,0x247B}, + {0xA9EF,0xA9EF,0x247C}, + {0xA9F0,0xA9F0,0x247D}, /* A9F0 */ + {0xA9F1,0xA9F1,0x247E}, + {0xA9F2,0xA9F2,0x247F}, + {0xA9F3,0xA9F3,0x2480}, + {0xA9F4,0xA9F4,0x2481}, + {0xA9F5,0xA9F5,0x2482}, + {0xA9F6,0xA9F6,0x00B9}, + {0xA9F7,0xA9F7,0x00B2}, + {0xA9F8,0xA9F8,0x00B3}, + {0xA9F9,0xA9F9,0x2074}, + {0xA9FA,0xA9FA,0x207F}, + {0xA9FB,0xA9FB,0x2081}, + {0xA9FC,0xA9FC,0x2082}, + {0xA9FD,0xA9FD,0x2083}, + {0xA9FE,0xA9FE,0x2084}, + {0xA9FF,0xA9FF,0x003F} +}; + + +static MY_UNICASE_INFO cAC[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}, /* xx00 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx10 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx20 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx30 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0xAC40,0xAC40,0x003F}, /* AC40 */ + {0xAC41,0xAC41,0xCCFE}, + {0xAC42,0xAC42,0xCCFF}, + {0xAC43,0xAC43,0xCD00}, + {0xAC44,0xAC44,0xCD02}, + {0xAC45,0xAC45,0xCD03}, + {0xAC46,0xAC46,0xCD04}, + {0xAC47,0xAC47,0xCD05}, + {0xAC48,0xAC48,0xCD06}, + {0xAC49,0xAC49,0xCD07}, + {0xAC4A,0xAC4A,0xCD0A}, + {0xAC4B,0xAC4B,0xCD0B}, + {0xAC4C,0xAC4C,0xCD0D}, + {0xAC4D,0xAC4D,0xCD0E}, + {0xAC4E,0xAC4E,0xCD0F}, + {0xAC4F,0xAC4F,0xCD11}, + {0xAC50,0xAC50,0xCD12}, /* AC50 */ + {0xAC51,0xAC51,0xCD13}, + {0xAC52,0xAC52,0xCD14}, + {0xAC53,0xAC53,0xCD15}, + {0xAC54,0xAC54,0xCD16}, + {0xAC55,0xAC55,0xCD17}, + {0xAC56,0xAC56,0xCD1A}, + {0xAC57,0xAC57,0xCD1C}, + {0xAC58,0xAC58,0xCD1E}, + {0xAC59,0xAC59,0xCD1F}, + {0xAC5A,0xAC5A,0xCD20}, + {0xAC5B,0xAC5B,0x003F}, + {0xAC5C,0xAC5C,0x003F}, + {0xAC5D,0xAC5D,0x003F}, + {0xAC5E,0xAC5E,0x003F}, + {0xAC5F,0xAC5F,0x003F}, + {0xAC60,0xAC60,0x003F}, /* AC60 */ + {0xAC61,0xAC61,0xCD21}, + {0xAC62,0xAC62,0xCD22}, + {0xAC63,0xAC63,0xCD23}, + {0xAC64,0xAC64,0xCD25}, + {0xAC65,0xAC65,0xCD26}, + {0xAC66,0xAC66,0xCD27}, + {0xAC67,0xAC67,0xCD29}, + {0xAC68,0xAC68,0xCD2A}, + {0xAC69,0xAC69,0xCD2B}, + {0xAC6A,0xAC6A,0xCD2D}, + {0xAC6B,0xAC6B,0xCD2E}, + {0xAC6C,0xAC6C,0xCD2F}, + {0xAC6D,0xAC6D,0xCD30}, + {0xAC6E,0xAC6E,0xCD31}, + {0xAC6F,0xAC6F,0xCD32}, + {0xAC70,0xAC70,0xCD33}, /* AC70 */ + {0xAC71,0xAC71,0xCD34}, + {0xAC72,0xAC72,0xCD35}, + {0xAC73,0xAC73,0xCD36}, + {0xAC74,0xAC74,0xCD37}, + {0xAC75,0xAC75,0xCD38}, + {0xAC76,0xAC76,0xCD3A}, + {0xAC77,0xAC77,0xCD3B}, + {0xAC78,0xAC78,0xCD3C}, + {0xAC79,0xAC79,0xCD3D}, + {0xAC7A,0xAC7A,0xCD3E}, + {0xAC7B,0xAC7B,0x003F}, + {0xAC7C,0xAC7C,0x003F}, + {0xAC7D,0xAC7D,0x003F}, + {0xAC7E,0xAC7E,0x003F}, + {0xAC7F,0xAC7F,0x003F}, + {0xAC80,0xAC80,0x003F}, /* AC80 */ + {0xAC81,0xAC81,0xCD3F}, + {0xAC82,0xAC82,0xCD40}, + {0xAC83,0xAC83,0xCD41}, + {0xAC84,0xAC84,0xCD42}, + {0xAC85,0xAC85,0xCD43}, + {0xAC86,0xAC86,0xCD44}, + {0xAC87,0xAC87,0xCD45}, + {0xAC88,0xAC88,0xCD46}, + {0xAC89,0xAC89,0xCD47}, + {0xAC8A,0xAC8A,0xCD48}, + {0xAC8B,0xAC8B,0xCD49}, + {0xAC8C,0xAC8C,0xCD4A}, + {0xAC8D,0xAC8D,0xCD4B}, + {0xAC8E,0xAC8E,0xCD4C}, + {0xAC8F,0xAC8F,0xCD4D}, + {0xAC90,0xAC90,0xCD4E}, /* AC90 */ + {0xAC91,0xAC91,0xCD4F}, + {0xAC92,0xAC92,0xCD50}, + {0xAC93,0xAC93,0xCD51}, + {0xAC94,0xAC94,0xCD52}, + {0xAC95,0xAC95,0xCD53}, + {0xAC96,0xAC96,0xCD54}, + {0xAC97,0xAC97,0xCD55}, + {0xAC98,0xAC98,0xCD56}, + {0xAC99,0xAC99,0xCD57}, + {0xAC9A,0xAC9A,0xCD58}, + {0xAC9B,0xAC9B,0xCD59}, + {0xAC9C,0xAC9C,0xCD5A}, + {0xAC9D,0xAC9D,0xCD5B}, + {0xAC9E,0xAC9E,0xCD5D}, + {0xAC9F,0xAC9F,0xCD5E}, + {0xACA0,0xACA0,0xCD5F}, /* ACA0 */ + {0xACA1,0xACD1,0x0410}, + {0xACA2,0xACD2,0x0411}, + {0xACA3,0xACD3,0x0412}, + {0xACA4,0xACD4,0x0413}, + {0xACA5,0xACD5,0x0414}, + {0xACA6,0xACD6,0x0415}, + {0xACA7,0xACD7,0x0401}, + {0xACA8,0xACD8,0x0416}, + {0xACA9,0xACD9,0x0417}, + {0xACAA,0xACDA,0x0418}, + {0xACAB,0xACDB,0x0419}, + {0xACAC,0xACDC,0x041A}, + {0xACAD,0xACDD,0x041B}, + {0xACAE,0xACDE,0x041C}, + {0xACAF,0xACDF,0x041D}, + {0xACB0,0xACE0,0x041E}, /* ACB0 */ + {0xACB1,0xACE1,0x041F}, + {0xACB2,0xACE2,0x0420}, + {0xACB3,0xACE3,0x0421}, + {0xACB4,0xACE4,0x0422}, + {0xACB5,0xACE5,0x0423}, + {0xACB6,0xACE6,0x0424}, + {0xACB7,0xACE7,0x0425}, + {0xACB8,0xACE8,0x0426}, + {0xACB9,0xACE9,0x0427}, + {0xACBA,0xACEA,0x0428}, + {0xACBB,0xACEB,0x0429}, + {0xACBC,0xACEC,0x042A}, + {0xACBD,0xACED,0x042B}, + {0xACBE,0xACEE,0x042C}, + {0xACBF,0xACEF,0x042D}, + {0xACC0,0xACF0,0x042E}, /* ACC0 */ + {0xACC1,0xACF1,0x042F}, + {0xACC2,0xACC2,0x003F}, + {0xACC3,0xACC3,0x003F}, + {0xACC4,0xACC4,0x003F}, + {0xACC5,0xACC5,0x003F}, + {0xACC6,0xACC6,0x003F}, + {0xACC7,0xACC7,0x003F}, + {0xACC8,0xACC8,0x003F}, + {0xACC9,0xACC9,0x003F}, + {0xACCA,0xACCA,0x003F}, + {0xACCB,0xACCB,0x003F}, + {0xACCC,0xACCC,0x003F}, + {0xACCD,0xACCD,0x003F}, + {0xACCE,0xACCE,0x003F}, + {0xACCF,0xACCF,0x003F}, + {0xACD0,0xACD0,0x003F}, /* ACD0 */ + {0xACA1,0xACD1,0x0430}, + {0xACA2,0xACD2,0x0431}, + {0xACA3,0xACD3,0x0432}, + {0xACA4,0xACD4,0x0433}, + {0xACA5,0xACD5,0x0434}, + {0xACA6,0xACD6,0x0435}, + {0xACA7,0xACD7,0x0451}, + {0xACA8,0xACD8,0x0436}, + {0xACA9,0xACD9,0x0437}, + {0xACAA,0xACDA,0x0438}, + {0xACAB,0xACDB,0x0439}, + {0xACAC,0xACDC,0x043A}, + {0xACAD,0xACDD,0x043B}, + {0xACAE,0xACDE,0x043C}, + {0xACAF,0xACDF,0x043D}, + {0xACB0,0xACE0,0x043E}, /* ACE0 */ + {0xACB1,0xACE1,0x043F}, + {0xACB2,0xACE2,0x0440}, + {0xACB3,0xACE3,0x0441}, + {0xACB4,0xACE4,0x0442}, + {0xACB5,0xACE5,0x0443}, + {0xACB6,0xACE6,0x0444}, + {0xACB7,0xACE7,0x0445}, + {0xACB8,0xACE8,0x0446}, + {0xACB9,0xACE9,0x0447}, + {0xACBA,0xACEA,0x0448}, + {0xACBB,0xACEB,0x0449}, + {0xACBC,0xACEC,0x044A}, + {0xACBD,0xACED,0x044B}, + {0xACBE,0xACEE,0x044C}, + {0xACBF,0xACEF,0x044D}, + {0xACC0,0xACF0,0x044E}, /* ACF0 */ + {0xACC1,0xACF1,0x044F}, + {0xACF2,0xACF2,0x003F}, + {0xACF3,0xACF3,0x003F}, + {0xACF4,0xACF4,0x003F}, + {0xACF5,0xACF5,0x003F}, + {0xACF6,0xACF6,0x003F}, + {0xACF7,0xACF7,0x003F}, + {0xACF8,0xACF8,0x003F}, + {0xACF9,0xACF9,0x003F}, + {0xACFA,0xACFA,0x003F}, + {0xACFB,0xACFB,0x003F}, + {0xACFC,0xACFC,0x003F}, + {0xACFD,0xACFD,0x003F}, + {0xACFE,0xACFE,0x003F}, + {0xACFF,0xACFF,0x003F} +}; + + +static MY_UNICASE_INFO *my_caseinfo_euckr[256]= +{ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 0 */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 1 */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 2 */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 3 */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 4 */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 5 */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 6 */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 7 */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 8 */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 9 */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, cA3, NULL, cA5, NULL, cA7, /* A */ + cA8, cA9, NULL, NULL, cAC, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* B */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* C */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* D */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* E */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* F */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL +}; + + /* page 0 0x8141-0xC8FE */ static uint16 tab_ksc5601_uni0[]={ 0xAC02,0xAC03,0xAC05,0xAC06,0xAC0B,0xAC0C,0xAC0D,0xAC0E, @@ -8720,8 +9987,8 @@ static MY_CHARSET_HANDLER my_charset_handler= my_mb_ctype_mb, my_caseup_str_mb, my_casedn_str_mb, - my_caseup_mb, - my_casedn_mb, + my_caseup_mb_varlen, /* UPPER() can reduce length: Turkish DOTLESS i -> I */ + my_casedn_mb, /* LOWER() does not change length, use simple version*/ my_snprintf_8bit, my_long10_to_str_8bit, my_longlong10_to_str_8bit, @@ -8753,7 +10020,7 @@ CHARSET_INFO my_charset_euckr_korean_ci= NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - my_unicase_default, /* caseinfo */ + my_caseinfo_euckr, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ @@ -8786,7 +10053,7 @@ CHARSET_INFO my_charset_euckr_bin= NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - my_unicase_default, /* caseinfo */ + my_caseinfo_euckr, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ diff --git a/dep/mysqllite/strings/ctype-eucjpms.c b/dep/mysqllite/strings/ctype-eucjpms.c deleted file mode 100644 index 615981b4d27a5..0000000000000 --- a/dep/mysqllite/strings/ctype-eucjpms.c +++ /dev/null @@ -1,8754 +0,0 @@ -/* 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_simple, /* 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 */ - 0xFEFE, /* max_sort_char */ - ' ', /* pad_char */ - 0, /* escape_with_backslash_is_dangerous */ - &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 */ - 0xFEFE, /* max_sort_char */ - ' ', /* pad_char */ - 0, /* escape_with_backslash_is_dangerous */ - &my_charset_handler, - &my_collation_mb_bin_handler -}; - - -#endif diff --git a/dep/mysqllite/strings/ctype-extra.c b/dep/mysqllite/strings/ctype-extra.c index 75244e404353f..f89a45d6ed83d 100644 --- a/dep/mysqllite/strings/ctype-extra.c +++ b/dep/mysqllite/strings/ctype-extra.c @@ -6,7 +6,7 @@ ./conf_to_src ../sql/share/charsets/ > FILE */ -/* Copyright (C) 2000-2007 MySQL AB +/* 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 @@ -1040,7 +1040,7 @@ uint16 to_uni_cp1251_bulgarian_ci[] = { 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, +0x20AC,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, @@ -1730,7 +1730,7 @@ uint16 to_uni_cp1251_ukrainian_ci[] = { 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, +0x20AC,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, @@ -3762,7 +3762,7 @@ uint16 to_uni_cp1251_bin[] = { 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, +0x20AC,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, @@ -3877,7 +3877,7 @@ uint16 to_uni_cp1251_general_ci[] = { 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, +0x20AC,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, @@ -3992,7 +3992,7 @@ uint16 to_uni_cp1251_general_cs[] = { 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, +0x20AC,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, @@ -6804,7 +6804,7 @@ CHARSET_INFO compiled_charsets[] = { #ifdef HAVE_CHARSET_swe7 { 10,0,0, - MY_CS_COMPILED|MY_CS_PRIMARY, + MY_CS_COMPILED|MY_CS_PRIMARY|MY_CS_NONASCII, "swe7", /* cset name */ "swe7_swedish_ci", /* coll name */ "", /* comment */ @@ -8454,7 +8454,7 @@ CHARSET_INFO compiled_charsets[] = { #ifdef HAVE_CHARSET_swe7 { 82,0,0, - MY_CS_COMPILED|MY_CS_BINSORT, + MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_NONASCII, "swe7", /* cset name */ "swe7_bin", /* coll name */ "", /* comment */ @@ -8550,72 +8550,6 @@ CHARSET_INFO compiled_charsets[] = { } , #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 */ - &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 */ - &my_charset_8bit_handler, - &my_collation_8bit_bin_handler, -} -, -#endif #ifdef HAVE_CHARSET_latin1 { 94,0,0, diff --git a/dep/mysqllite/strings/ctype-gb2312.c b/dep/mysqllite/strings/ctype-gb2312.c index 84f67dbbc2ebe..b1acd643df392 100644 --- a/dep/mysqllite/strings/ctype-gb2312.c +++ b/dep/mysqllite/strings/ctype-gb2312.c @@ -29,7 +29,7 @@ #ifdef HAVE_CHARSET_gb2312 -static uchar NEAR ctype_gb2312[257] = +static uchar ctype_gb2312[257] = { 0, /* For standard library */ 32,32,32,32,32,32,32,32,32,40,40,40,40,40,32,32, @@ -50,7 +50,7 @@ static uchar NEAR ctype_gb2312[257] = 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0, }; -static uchar NEAR to_lower_gb2312[]= +static uchar to_lower_gb2312[]= { '\000','\001','\002','\003','\004','\005','\006','\007', '\010','\011','\012','\013','\014','\015','\016','\017', @@ -86,7 +86,7 @@ static uchar NEAR to_lower_gb2312[]= (uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377', }; -static uchar NEAR to_upper_gb2312[]= +static uchar to_upper_gb2312[]= { '\000','\001','\002','\003','\004','\005','\006','\007', '\010','\011','\012','\013','\014','\015','\016','\017', @@ -122,7 +122,7 @@ static uchar NEAR to_upper_gb2312[]= (uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377', }; -static uchar NEAR sort_order_gb2312[]= +static uchar sort_order_gb2312[]= { '\000','\001','\002','\003','\004','\005','\006','\007', '\010','\011','\012','\013','\014','\015','\016','\017', @@ -177,6 +177,648 @@ static uint mbcharlen_gb2312(CHARSET_INFO *cs __attribute__((unused)),uint c) } +static MY_UNICASE_INFO cA2[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}, /* xx00 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx10 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx20 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx30 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx40 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx50 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx60 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx70 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx80 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx90 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0xA2A0,0xA2A0,0xA2A0}, /* A2A0 */ + {0xA2A1,0xA2A1,0x003F}, + {0xA2A2,0xA2A2,0x003F}, + {0xA2A3,0xA2A3,0x003F}, + {0xA2A4,0xA2A4,0x003F}, + {0xA2A5,0xA2A5,0x003F}, + {0xA2A6,0xA2A6,0x003F}, + {0xA2A7,0xA2A7,0x003F}, + {0xA2A8,0xA2A8,0x003F}, + {0xA2A9,0xA2A9,0x003F}, + {0xA2AA,0xA2AA,0x003F}, + {0xA2AB,0xA2AB,0x003F}, + {0xA2AC,0xA2AC,0x003F}, + {0xA2AD,0xA2AD,0x003F}, + {0xA2AE,0xA2AE,0x003F}, + {0xA2AF,0xA2AF,0x003F}, + {0xA2B0,0xA2B0,0x003F}, /* A2B0 */ + {0xA2B1,0xA2B1,0x2488}, + {0xA2B2,0xA2B2,0x2489}, + {0xA2B3,0xA2B3,0x248A}, + {0xA2B4,0xA2B4,0x248B}, + {0xA2B5,0xA2B5,0x248C}, + {0xA2B6,0xA2B6,0x248D}, + {0xA2B7,0xA2B7,0x248E}, + {0xA2B8,0xA2B8,0x248F}, + {0xA2B9,0xA2B9,0x2490}, + {0xA2BA,0xA2BA,0x2491}, + {0xA2BB,0xA2BB,0x2492}, + {0xA2BC,0xA2BC,0x2493}, + {0xA2BD,0xA2BD,0x2494}, + {0xA2BE,0xA2BE,0x2495}, + {0xA2BF,0xA2BF,0x2496}, + {0xA2C0,0xA2C0,0x2497}, /* A2C0 */ + {0xA2C1,0xA2C1,0x2498}, + {0xA2C2,0xA2C2,0x2499}, + {0xA2C3,0xA2C3,0x249A}, + {0xA2C4,0xA2C4,0x249B}, + {0xA2C5,0xA2C5,0x2474}, + {0xA2C6,0xA2C6,0x2475}, + {0xA2C7,0xA2C7,0x2476}, + {0xA2C8,0xA2C8,0x2477}, + {0xA2C9,0xA2C9,0x2478}, + {0xA2CA,0xA2CA,0x2479}, + {0xA2CB,0xA2CB,0x247A}, + {0xA2CC,0xA2CC,0x247B}, + {0xA2CD,0xA2CD,0x247C}, + {0xA2CE,0xA2CE,0x247D}, + {0xA2CF,0xA2CF,0x247E}, + {0xA2D0,0xA2D0,0x247F}, /* A2D0 */ + {0xA2D1,0xA2D1,0x2480}, + {0xA2D2,0xA2D2,0x2481}, + {0xA2D3,0xA2D3,0x2482}, + {0xA2D4,0xA2D4,0x2483}, + {0xA2D5,0xA2D5,0x2484}, + {0xA2D6,0xA2D6,0x2485}, + {0xA2D7,0xA2D7,0x2486}, + {0xA2D8,0xA2D8,0x2487}, + {0xA2D9,0xA2D9,0x2460}, + {0xA2DA,0xA2DA,0x2461}, + {0xA2DB,0xA2DB,0x2462}, + {0xA2DC,0xA2DC,0x2463}, + {0xA2DD,0xA2DD,0x2464}, + {0xA2DE,0xA2DE,0x2465}, + {0xA2DF,0xA2DF,0x2466}, + {0xA2E0,0xA2E0,0x2467}, /* A2E0 */ + {0xA2E1,0xA2E1,0x2468}, + {0xA2E2,0xA2E2,0x2469}, + {0xA2E3,0xA2E3,0x003F}, + {0xA2E4,0xA2E4,0x003F}, + {0xA2E5,0xA2E5,0x3220}, + {0xA2E6,0xA2E6,0x3221}, + {0xA2E7,0xA2E7,0x3222}, + {0xA2E8,0xA2E8,0x3223}, + {0xA2E9,0xA2E9,0x3224}, + {0xA2EA,0xA2EA,0x3225}, + {0xA2EB,0xA2EB,0x3226}, + {0xA2EC,0xA2EC,0x3227}, + {0xA2ED,0xA2ED,0x3228}, + {0xA2EE,0xA2EE,0x3229}, + {0xA2EF,0xA2EF,0x003F}, + {0xA2F0,0xA2F0,0x003F}, /* A2F0 */ + {0xA2F1,0xA2F1,0x2160}, + {0xA2F2,0xA2F2,0x2161}, + {0xA2F3,0xA2F3,0x2162}, + {0xA2F4,0xA2F4,0x2163}, + {0xA2F5,0xA2F5,0x2164}, + {0xA2F6,0xA2F6,0x2165}, + {0xA2F7,0xA2F7,0x2166}, + {0xA2F8,0xA2F8,0x2167}, + {0xA2F9,0xA2F9,0x2168}, + {0xA2FA,0xA2FA,0x2169}, + {0xA2FB,0xA2FB,0x216A}, + {0xA2FC,0xA2FC,0x216B}, + {0xA2FD,0xA2FD,0x003F}, + {0xA2FE,0xA2FE,0x003F}, + {0xA2FF,0xA2FF,0xA2FF} +}; + + +static MY_UNICASE_INFO cA3[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}, /* xx00 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx10 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx20 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx30 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx40 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx50 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx60 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx70 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx80 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx90 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0xA3A0,0xA3A0,0xA3A0}, /* A3A0 */ + {0xA3A1,0xA3A1,0xFF01}, + {0xA3A2,0xA3A2,0xFF02}, + {0xA3A3,0xA3A3,0xFF03}, + {0xA3A4,0xA3A4,0xFFE5}, + {0xA3A5,0xA3A5,0xFF05}, + {0xA3A6,0xA3A6,0xFF06}, + {0xA3A7,0xA3A7,0xFF07}, + {0xA3A8,0xA3A8,0xFF08}, + {0xA3A9,0xA3A9,0xFF09}, + {0xA3AA,0xA3AA,0xFF0A}, + {0xA3AB,0xA3AB,0xFF0B}, + {0xA3AC,0xA3AC,0xFF0C}, + {0xA3AD,0xA3AD,0xFF0D}, + {0xA3AE,0xA3AE,0xFF0E}, + {0xA3AF,0xA3AF,0xFF0F}, + {0xA3B0,0xA3B0,0xFF10}, /* A3B0 */ + {0xA3B1,0xA3B1,0xFF11}, + {0xA3B2,0xA3B2,0xFF12}, + {0xA3B3,0xA3B3,0xFF13}, + {0xA3B4,0xA3B4,0xFF14}, + {0xA3B5,0xA3B5,0xFF15}, + {0xA3B6,0xA3B6,0xFF16}, + {0xA3B7,0xA3B7,0xFF17}, + {0xA3B8,0xA3B8,0xFF18}, + {0xA3B9,0xA3B9,0xFF19}, + {0xA3BA,0xA3BA,0xFF1A}, + {0xA3BB,0xA3BB,0xFF1B}, + {0xA3BC,0xA3BC,0xFF1C}, + {0xA3BD,0xA3BD,0xFF1D}, + {0xA3BE,0xA3BE,0xFF1E}, + {0xA3BF,0xA3BF,0xFF1F}, + {0xA3C0,0xA3C0,0xFF20}, /* A3C0 */ + {0xA3C1,0xA3E1,0xFF21}, + {0xA3C2,0xA3E2,0xFF22}, + {0xA3C3,0xA3E3,0xFF23}, + {0xA3C4,0xA3E4,0xFF24}, + {0xA3C5,0xA3E5,0xFF25}, + {0xA3C6,0xA3E6,0xFF26}, + {0xA3C7,0xA3E7,0xFF27}, + {0xA3C8,0xA3E8,0xFF28}, + {0xA3C9,0xA3E9,0xFF29}, + {0xA3CA,0xA3EA,0xFF2A}, + {0xA3CB,0xA3EB,0xFF2B}, + {0xA3CC,0xA3EC,0xFF2C}, + {0xA3CD,0xA3ED,0xFF2D}, + {0xA3CE,0xA3EE,0xFF2E}, + {0xA3CF,0xA3EF,0xFF2F}, + {0xA3D0,0xA3F0,0xFF30}, /* A3D0 */ + {0xA3D1,0xA3F1,0xFF31}, + {0xA3D2,0xA3F2,0xFF32}, + {0xA3D3,0xA3F3,0xFF33}, + {0xA3D4,0xA3F4,0xFF34}, + {0xA3D5,0xA3F5,0xFF35}, + {0xA3D6,0xA3F6,0xFF36}, + {0xA3D7,0xA3F7,0xFF37}, + {0xA3D8,0xA3F8,0xFF38}, + {0xA3D9,0xA3F9,0xFF39}, + {0xA3DA,0xA3FA,0xFF3A}, + {0xA3DB,0xA3DB,0xFF3B}, + {0xA3DC,0xA3DC,0xFF3C}, + {0xA3DD,0xA3DD,0xFF3D}, + {0xA3DE,0xA3DE,0xFF3E}, + {0xA3DF,0xA3DF,0xFF3F}, + {0xA3E0,0xA3E0,0xFF40}, /* A3E0 */ + {0xA3C1,0xA3E1,0xFF41}, + {0xA3C2,0xA3E2,0xFF42}, + {0xA3C3,0xA3E3,0xFF43}, + {0xA3C4,0xA3E4,0xFF44}, + {0xA3C5,0xA3E5,0xFF45}, + {0xA3C6,0xA3E6,0xFF46}, + {0xA3C7,0xA3E7,0xFF47}, + {0xA3C8,0xA3E8,0xFF48}, + {0xA3C9,0xA3E9,0xFF49}, + {0xA3CA,0xA3EA,0xFF4A}, + {0xA3CB,0xA3EB,0xFF4B}, + {0xA3CC,0xA3EC,0xFF4C}, + {0xA3CD,0xA3ED,0xFF4D}, + {0xA3CE,0xA3EE,0xFF4E}, + {0xA3CF,0xA3EF,0xFF4F}, + {0xA3D0,0xA3F0,0xFF50}, /* A3F0 */ + {0xA3D1,0xA3F1,0xFF51}, + {0xA3D2,0xA3F2,0xFF52}, + {0xA3D3,0xA3F3,0xFF53}, + {0xA3D4,0xA3F4,0xFF54}, + {0xA3D5,0xA3F5,0xFF55}, + {0xA3D6,0xA3F6,0xFF56}, + {0xA3D7,0xA3F7,0xFF57}, + {0xA3D8,0xA3F8,0xFF58}, + {0xA3D9,0xA3F9,0xFF59}, + {0xA3DA,0xA3FA,0xFF5A}, + {0xA3FB,0xA3FB,0xFF5B}, + {0xA3FC,0xA3FC,0xFF5C}, + {0xA3FD,0xA3FD,0xFF5D}, + {0xA3FE,0xA3FE,0xFFE3}, + {0xA3FF,0xA3FF,0xA3FF} +}; + + +static MY_UNICASE_INFO cA6[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}, /* xx00 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx10 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx20 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx30 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx40 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx50 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx60 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx70 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx80 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx90 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0xA6A0,0xA6A0,0xA6A0}, /* A6A0 */ + {0xA6A1,0xA6C1,0x0391}, + {0xA6A2,0xA6C2,0x0392}, + {0xA6A3,0xA6C3,0x0393}, + {0xA6A4,0xA6C4,0x0394}, + {0xA6A5,0xA6C5,0x0395}, + {0xA6A6,0xA6C6,0x0396}, + {0xA6A7,0xA6C7,0x0397}, + {0xA6A8,0xA6C8,0x0398}, + {0xA6A9,0xA6C9,0x0399}, + {0xA6AA,0xA6CA,0x039A}, + {0xA6AB,0xA6CB,0x039B}, + {0xA6AC,0xA6CC,0x039C}, + {0xA6AD,0xA6CD,0x039D}, + {0xA6AE,0xA6CE,0x039E}, + {0xA6AF,0xA6CF,0x039F}, + {0xA6B0,0xA6D0,0x03A0}, /* A6B0 */ + {0xA6B1,0xA6D1,0x03A1}, + {0xA6B2,0xA6D2,0x03A3}, + {0xA6B3,0xA6D3,0x03A4}, + {0xA6B4,0xA6D4,0x03A5}, + {0xA6B5,0xA6D5,0x03A6}, + {0xA6B6,0xA6D6,0x03A7}, + {0xA6B7,0xA6D7,0x03A8}, + {0xA6B8,0xA6D8,0x03A9}, + {0xA6B9,0xA6B9,0x003F}, + {0xA6BA,0xA6BA,0x003F}, + {0xA6BB,0xA6BB,0x003F}, + {0xA6BC,0xA6BC,0x003F}, + {0xA6BD,0xA6BD,0x003F}, + {0xA6BE,0xA6BE,0x003F}, + {0xA6BF,0xA6BF,0x003F}, + {0xA6C0,0xA6C0,0x003F}, /* A6C0 */ + {0xA6A1,0xA6C1,0x03B1}, + {0xA6A2,0xA6C2,0x03B2}, + {0xA6A3,0xA6C3,0x03B3}, + {0xA6A4,0xA6C4,0x03B4}, + {0xA6A5,0xA6C5,0x03B5}, + {0xA6A6,0xA6C6,0x03B6}, + {0xA6A7,0xA6C7,0x03B7}, + {0xA6A8,0xA6C8,0x03B8}, + {0xA6A9,0xA6C9,0x03B9}, + {0xA6AA,0xA6CA,0x03BA}, + {0xA6AB,0xA6CB,0x03BB}, + {0xA6AC,0xA6CC,0x03BC}, + {0xA6AD,0xA6CD,0x03BD}, + {0xA6AE,0xA6CE,0x03BE}, + {0xA6AF,0xA6CF,0x03BF}, + {0xA6B0,0xA6D0,0x03C0}, /* A6D0 */ + {0xA6B1,0xA6D1,0x03C1}, + {0xA6B2,0xA6D2,0x03C3}, + {0xA6B3,0xA6D3,0x03C4}, + {0xA6B4,0xA6D4,0x03C5}, + {0xA6B5,0xA6D5,0x03C6}, + {0xA6B6,0xA6D6,0x03C7}, + {0xA6B7,0xA6D7,0x03C8}, + {0xA6B8,0xA6D8,0x03C9}, + {0xA6D9,0xA6D9,0x003F}, + {0xA6DA,0xA6DA,0x003F}, + {0xA6DB,0xA6DB,0x003F}, + {0xA6DC,0xA6DC,0x003F}, + {0xA6DD,0xA6DD,0x003F}, + {0xA6DE,0xA6DE,0x003F}, + {0xA6DF,0xA6DF,0x003F}, + {0xA6E0,0xA6E0,0x003F}, /* A6E0 */ + {0xA6E1,0xA6E1,0x003F}, + {0xA6E2,0xA6E2,0x003F}, + {0xA6E3,0xA6E3,0x003F}, + {0xA6E4,0xA6E4,0x003F}, + {0xA6E5,0xA6E5,0x003F}, + {0xA6E6,0xA6E6,0x003F}, + {0xA6E7,0xA6E7,0x003F}, + {0xA6E8,0xA6E8,0x003F}, + {0xA6E9,0xA6E9,0x003F}, + {0xA6EA,0xA6EA,0x003F}, + {0xA6EB,0xA6EB,0x003F}, + {0xA6EC,0xA6EC,0x003F}, + {0xA6ED,0xA6ED,0x003F}, + {0xA6EE,0xA6EE,0x003F}, + {0xA6EF,0xA6EF,0x003F}, + {0xA6F0,0xA6F0,0x003F}, /* A6F0 */ + {0xA6F1,0xA6F1,0x003F}, + {0xA6F2,0xA6F2,0x003F}, + {0xA6F3,0xA6F3,0x003F}, + {0xA6F4,0xA6F4,0x003F}, + {0xA6F5,0xA6F5,0x003F}, + {0xA6F6,0xA6F6,0x003F}, + {0xA6F7,0xA6F7,0x003F}, + {0xA6F8,0xA6F8,0x003F}, + {0xA6F9,0xA6F9,0x003F}, + {0xA6FA,0xA6FA,0x003F}, + {0xA6FB,0xA6FB,0x003F}, + {0xA6FC,0xA6FC,0x003F}, + {0xA6FD,0xA6FD,0x003F}, + {0xA6FE,0xA6FE,0x003F}, + {0xA6FF,0xA6FF,0xA6FF} +}; + + +static MY_UNICASE_INFO cA7[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}, /* xx00 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx10 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx20 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx30 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx40 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx50 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx60 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx70 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx80 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx90 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0xA7A0,0xA7A0,0xA7A0}, /* A7A0 */ + {0xA7A1,0xA7D1,0x0410}, + {0xA7A2,0xA7D2,0x0411}, + {0xA7A3,0xA7D3,0x0412}, + {0xA7A4,0xA7D4,0x0413}, + {0xA7A5,0xA7D5,0x0414}, + {0xA7A6,0xA7D6,0x0415}, + {0xA7A7,0xA7D7,0x0401}, + {0xA7A8,0xA7D8,0x0416}, + {0xA7A9,0xA7D9,0x0417}, + {0xA7AA,0xA7DA,0x0418}, + {0xA7AB,0xA7DB,0x0419}, + {0xA7AC,0xA7DC,0x041A}, + {0xA7AD,0xA7DD,0x041B}, + {0xA7AE,0xA7DE,0x041C}, + {0xA7AF,0xA7DF,0x041D}, + {0xA7B0,0xA7E0,0x041E}, /* A7B0 */ + {0xA7B1,0xA7E1,0x041F}, + {0xA7B2,0xA7E2,0x0420}, + {0xA7B3,0xA7E3,0x0421}, + {0xA7B4,0xA7E4,0x0422}, + {0xA7B5,0xA7E5,0x0423}, + {0xA7B6,0xA7E6,0x0424}, + {0xA7B7,0xA7E7,0x0425}, + {0xA7B8,0xA7E8,0x0426}, + {0xA7B9,0xA7E9,0x0427}, + {0xA7BA,0xA7EA,0x0428}, + {0xA7BB,0xA7EB,0x0429}, + {0xA7BC,0xA7EC,0x042A}, + {0xA7BD,0xA7ED,0x042B}, + {0xA7BE,0xA7EE,0x042C}, + {0xA7BF,0xA7EF,0x042D}, + {0xA7C0,0xA7F0,0x042E}, /* A7C0 */ + {0xA7C1,0xA7F1,0x042F}, + {0xA7C2,0xA7C2,0x003F}, + {0xA7C3,0xA7C3,0x003F}, + {0xA7C4,0xA7C4,0x003F}, + {0xA7C5,0xA7C5,0x003F}, + {0xA7C6,0xA7C6,0x003F}, + {0xA7C7,0xA7C7,0x003F}, + {0xA7C8,0xA7C8,0x003F}, + {0xA7C9,0xA7C9,0x003F}, + {0xA7CA,0xA7CA,0x003F}, + {0xA7CB,0xA7CB,0x003F}, + {0xA7CC,0xA7CC,0x003F}, + {0xA7CD,0xA7CD,0x003F}, + {0xA7CE,0xA7CE,0x003F}, + {0xA7CF,0xA7CF,0x003F}, + {0xA7D0,0xA7D0,0x003F}, /* A7D0 */ + {0xA7A1,0xA7D1,0x0430}, + {0xA7A2,0xA7D2,0x0431}, + {0xA7A3,0xA7D3,0x0432}, + {0xA7A4,0xA7D4,0x0433}, + {0xA7A5,0xA7D5,0x0434}, + {0xA7A6,0xA7D6,0x0435}, + {0xA7A7,0xA7D7,0x0451}, + {0xA7A8,0xA7D8,0x0436}, + {0xA7A9,0xA7D9,0x0437}, + {0xA7AA,0xA7DA,0x0438}, + {0xA7AB,0xA7DB,0x0439}, + {0xA7AC,0xA7DC,0x043A}, + {0xA7AD,0xA7DD,0x043B}, + {0xA7AE,0xA7DE,0x043C}, + {0xA7AF,0xA7DF,0x043D}, + {0xA7B0,0xA7E0,0x043E}, /* A7E0 */ + {0xA7B1,0xA7E1,0x043F}, + {0xA7B2,0xA7E2,0x0440}, + {0xA7B3,0xA7E3,0x0441}, + {0xA7B4,0xA7E4,0x0442}, + {0xA7B5,0xA7E5,0x0443}, + {0xA7B6,0xA7E6,0x0444}, + {0xA7B7,0xA7E7,0x0445}, + {0xA7B8,0xA7E8,0x0446}, + {0xA7B9,0xA7E9,0x0447}, + {0xA7BA,0xA7EA,0x0448}, + {0xA7BB,0xA7EB,0x0449}, + {0xA7BC,0xA7EC,0x044A}, + {0xA7BD,0xA7ED,0x044B}, + {0xA7BE,0xA7EE,0x044C}, + {0xA7BF,0xA7EF,0x044D}, + {0xA7C0,0xA7F0,0x044E}, /* A7F0 */ + {0xA7C1,0xA7F1,0x044F}, + {0xA7F2,0xA7F2,0x003F}, + {0xA7F3,0xA7F3,0x003F}, + {0xA7F4,0xA7F4,0x003F}, + {0xA7F5,0xA7F5,0x003F}, + {0xA7F6,0xA7F6,0x003F}, + {0xA7F7,0xA7F7,0x003F}, + {0xA7F8,0xA7F8,0x003F}, + {0xA7F9,0xA7F9,0x003F}, + {0xA7FA,0xA7FA,0x003F}, + {0xA7FB,0xA7FB,0x003F}, + {0xA7FC,0xA7FC,0x003F}, + {0xA7FD,0xA7FD,0x003F}, + {0xA7FE,0xA7FE,0x003F}, + {0xA7FF,0xA7FF,0xA7FF} +}; + + +static MY_UNICASE_INFO cA8[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}, /* xx00 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx10 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx20 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx30 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx40 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx50 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx60 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx70 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx80 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx90 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0xA8A0,0xA8A0,0xA8A0}, /* A8A0 */ + {0xA8A1,0xA8A1,0x0101}, + {0xA8A2,0xA8A2,0x00E1}, + {0xA8A3,0xA8A3,0x01CE}, + {0xA8A4,0xA8A4,0x00E0}, + {0xA8A5,0xA8A5,0x0113}, + {0xA8A6,0xA8A6,0x00E9}, + {0xA8A7,0xA8A7,0x011B}, + {0xA8A8,0xA8A8,0x00E8}, + {0xA8A9,0xA8A9,0x012B}, + {0xA8AA,0xA8AA,0x00ED}, + {0xA8AB,0xA8AB,0x01D0}, + {0xA8AC,0xA8AC,0x00EC}, + {0xA8AD,0xA8AD,0x014D}, + {0xA8AE,0xA8AE,0x00F3}, + {0xA8AF,0xA8AF,0x01D2}, + {0xA8B0,0xA8B0,0x00F2}, /* A8B0 */ + {0xA8B1,0xA8B1,0x016B}, + {0xA8B2,0xA8B2,0x00FA}, + {0xA8B3,0xA8B3,0x01D4}, + {0xA8B4,0xA8B4,0x00F9}, + {0xA8B5,0xA8B5,0x01D6}, + {0xA8B6,0xA8B6,0x01D8}, + {0xA8B7,0xA8B7,0x01DA}, + {0xA8B8,0xA8B8,0x01DC}, + {0xA8B9,0xA8B9,0x00FC}, + {0xA8BA,0xA8BA,0x00EA}, + {0xA8BB,0xA8BB,0x003F}, + {0xA8BC,0xA8BC,0x003F}, + {0xA8BD,0xA8BD,0x003F}, + {0xA8BE,0xA8BE,0x003F}, + {0xA8BF,0xA8BF,0x003F}, + {0xA8C0,0xA8C0,0x003F}, /* A8C0 */ + {0xA8C1,0xA8C1,0x003F}, + {0xA8C2,0xA8C2,0x003F}, + {0xA8C3,0xA8C3,0x003F}, + {0xA8C4,0xA8C4,0x003F}, + {0xA8C5,0xA8C5,0x3105}, + {0xA8C6,0xA8C6,0x3106}, + {0xA8C7,0xA8C7,0x3107}, + {0xA8C8,0xA8C8,0x3108}, + {0xA8C9,0xA8C9,0x3109}, + {0xA8CA,0xA8CA,0x310A}, + {0xA8CB,0xA8CB,0x310B}, + {0xA8CC,0xA8CC,0x310C}, + {0xA8CD,0xA8CD,0x310D}, + {0xA8CE,0xA8CE,0x310E}, + {0xA8CF,0xA8CF,0x310F}, + {0xA8D0,0xA8D0,0x3110}, /* A8D0 */ + {0xA8D1,0xA8D1,0x3111}, + {0xA8D2,0xA8D2,0x3112}, + {0xA8D3,0xA8D3,0x3113}, + {0xA8D4,0xA8D4,0x3114}, + {0xA8D5,0xA8D5,0x3115}, + {0xA8D6,0xA8D6,0x3116}, + {0xA8D7,0xA8D7,0x3117}, + {0xA8D8,0xA8D8,0x3118}, + {0xA8D9,0xA8D9,0x3119}, + {0xA8DA,0xA8DA,0x311A}, + {0xA8DB,0xA8DB,0x311B}, + {0xA8DC,0xA8DC,0x311C}, + {0xA8DD,0xA8DD,0x311D}, + {0xA8DE,0xA8DE,0x311E}, + {0xA8DF,0xA8DF,0x311F}, + {0xA8E0,0xA8E0,0x3120}, /* A8E0 */ + {0xA8E1,0xA8E1,0x3121}, + {0xA8E2,0xA8E2,0x3122}, + {0xA8E3,0xA8E3,0x3123}, + {0xA8E4,0xA8E4,0x3124}, + {0xA8E5,0xA8E5,0x3125}, + {0xA8E6,0xA8E6,0x3126}, + {0xA8E7,0xA8E7,0x3127}, + {0xA8E8,0xA8E8,0x3128}, + {0xA8E9,0xA8E9,0x3129}, + {0xA8EA,0xA8EA,0x003F}, + {0xA8EB,0xA8EB,0x003F}, + {0xA8EC,0xA8EC,0x003F}, + {0xA8ED,0xA8ED,0x003F}, + {0xA8EE,0xA8EE,0x003F}, + {0xA8EF,0xA8EF,0x003F}, + {0xA8F0,0xA8F0,0x003F}, /* A8F0 */ + {0xA8F1,0xA8F1,0x003F}, + {0xA8F2,0xA8F2,0x003F}, + {0xA8F3,0xA8F3,0x003F}, + {0xA8F4,0xA8F4,0x003F}, + {0xA8F5,0xA8F5,0x003F}, + {0xA8F6,0xA8F6,0x003F}, + {0xA8F7,0xA8F7,0x003F}, + {0xA8F8,0xA8F8,0x003F}, + {0xA8F9,0xA8F9,0x003F}, + {0xA8FA,0xA8FA,0x003F}, + {0xA8FB,0xA8FB,0x003F}, + {0xA8FC,0xA8FC,0x003F}, + {0xA8FD,0xA8FD,0x003F}, + {0xA8FE,0xA8FE,0x003F}, + {0xA8FF,0xA8FF,0xA8FF} +}; + + +static MY_UNICASE_INFO *my_caseinfo_gb2312[256]= +{ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 0 */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 1 */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 2 */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 3 */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 4 */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 5 */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 6 */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 7 */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 8 */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 9 */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, cA2, cA3, NULL, NULL, cA6, cA7, /* A */ + cA8, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* B */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* C */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* D */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* E */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* F */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL +}; + + /* page 0 0x2121-0x2658 */ static uint16 tab_gb2312_uni0[]={ 0x3000,0x3001,0x3002,0x30FB,0x02C9,0x02C7,0x00A8,0x3003, @@ -5781,7 +6423,7 @@ CHARSET_INFO my_charset_gb2312_chinese_ci= NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - my_unicase_default, /* caseinfo */ + my_caseinfo_gb2312, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ @@ -5813,7 +6455,7 @@ CHARSET_INFO my_charset_gb2312_bin= NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - my_unicase_default, /* caseinfo */ + my_caseinfo_gb2312, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ diff --git a/dep/mysqllite/strings/ctype-gbk.c b/dep/mysqllite/strings/ctype-gbk.c index 89607823d347a..547c882122991 100644 --- a/dep/mysqllite/strings/ctype-gbk.c +++ b/dep/mysqllite/strings/ctype-gbk.c @@ -44,7 +44,7 @@ #define gbkhead(e) ((uchar)(e>>8)) #define gbktail(e) ((uchar)(e&0xff)) -static uchar NEAR ctype_gbk[257] = +static uchar ctype_gbk[257] = { 0, /* For standard library */ 32,32,32,32,32,32,32,32,32,40,40,40,40,40,32,32, @@ -65,7 +65,7 @@ static uchar NEAR ctype_gbk[257] = 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0, }; -static uchar NEAR to_lower_gbk[]= +static uchar to_lower_gbk[]= { '\000','\001','\002','\003','\004','\005','\006','\007', '\010','\011','\012','\013','\014','\015','\016','\017', @@ -101,7 +101,7 @@ static uchar NEAR to_lower_gbk[]= (uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377', }; -static uchar NEAR to_upper_gbk[]= +static uchar to_upper_gbk[]= { '\000','\001','\002','\003','\004','\005','\006','\007', '\010','\011','\012','\013','\014','\015','\016','\017', @@ -137,7 +137,865 @@ static uchar NEAR to_upper_gbk[]= (uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377', }; -static uchar NEAR sort_order_gbk[]= + +static MY_UNICASE_INFO cA2[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}, /* xx00 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx10 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx20 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx30 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0xA240,0xA240,0x003F}, /* A240 */ + {0xA241,0xA241,0x003F}, + {0xA242,0xA242,0x003F}, + {0xA243,0xA243,0x003F}, + {0xA244,0xA244,0x003F}, + {0xA245,0xA245,0x003F}, + {0xA246,0xA246,0x003F}, + {0xA247,0xA247,0x003F}, + {0xA248,0xA248,0x003F}, + {0xA249,0xA249,0x003F}, + {0xA24A,0xA24A,0x003F}, + {0xA24B,0xA24B,0x003F}, + {0xA24C,0xA24C,0x003F}, + {0xA24D,0xA24D,0x003F}, + {0xA24E,0xA24E,0x003F}, + {0xA24F,0xA24F,0x003F}, + {0xA250,0xA250,0x003F}, /* A250 */ + {0xA251,0xA251,0x003F}, + {0xA252,0xA252,0x003F}, + {0xA253,0xA253,0x003F}, + {0xA254,0xA254,0x003F}, + {0xA255,0xA255,0x003F}, + {0xA256,0xA256,0x003F}, + {0xA257,0xA257,0x003F}, + {0xA258,0xA258,0x003F}, + {0xA259,0xA259,0x003F}, + {0xA25A,0xA25A,0x003F}, + {0xA25B,0xA25B,0x003F}, + {0xA25C,0xA25C,0x003F}, + {0xA25D,0xA25D,0x003F}, + {0xA25E,0xA25E,0x003F}, + {0xA25F,0xA25F,0x003F}, + {0xA260,0xA260,0x003F}, /* A260 */ + {0xA261,0xA261,0x003F}, + {0xA262,0xA262,0x003F}, + {0xA263,0xA263,0x003F}, + {0xA264,0xA264,0x003F}, + {0xA265,0xA265,0x003F}, + {0xA266,0xA266,0x003F}, + {0xA267,0xA267,0x003F}, + {0xA268,0xA268,0x003F}, + {0xA269,0xA269,0x003F}, + {0xA26A,0xA26A,0x003F}, + {0xA26B,0xA26B,0x003F}, + {0xA26C,0xA26C,0x003F}, + {0xA26D,0xA26D,0x003F}, + {0xA26E,0xA26E,0x003F}, + {0xA26F,0xA26F,0x003F}, + {0xA270,0xA270,0x003F}, /* A270 */ + {0xA271,0xA271,0x003F}, + {0xA272,0xA272,0x003F}, + {0xA273,0xA273,0x003F}, + {0xA274,0xA274,0x003F}, + {0xA275,0xA275,0x003F}, + {0xA276,0xA276,0x003F}, + {0xA277,0xA277,0x003F}, + {0xA278,0xA278,0x003F}, + {0xA279,0xA279,0x003F}, + {0xA27A,0xA27A,0x003F}, + {0xA27B,0xA27B,0x003F}, + {0xA27C,0xA27C,0x003F}, + {0xA27D,0xA27D,0x003F}, + {0xA27E,0xA27E,0x003F}, + {0xA27F,0xA27F,0xA27F}, + {0xA280,0xA280,0x003F}, /* A280 */ + {0xA281,0xA281,0x003F}, + {0xA282,0xA282,0x003F}, + {0xA283,0xA283,0x003F}, + {0xA284,0xA284,0x003F}, + {0xA285,0xA285,0x003F}, + {0xA286,0xA286,0x003F}, + {0xA287,0xA287,0x003F}, + {0xA288,0xA288,0x003F}, + {0xA289,0xA289,0x003F}, + {0xA28A,0xA28A,0x003F}, + {0xA28B,0xA28B,0x003F}, + {0xA28C,0xA28C,0x003F}, + {0xA28D,0xA28D,0x003F}, + {0xA28E,0xA28E,0x003F}, + {0xA28F,0xA28F,0x003F}, + {0xA290,0xA290,0x003F}, /* A290 */ + {0xA291,0xA291,0x003F}, + {0xA292,0xA292,0x003F}, + {0xA293,0xA293,0x003F}, + {0xA294,0xA294,0x003F}, + {0xA295,0xA295,0x003F}, + {0xA296,0xA296,0x003F}, + {0xA297,0xA297,0x003F}, + {0xA298,0xA298,0x003F}, + {0xA299,0xA299,0x003F}, + {0xA29A,0xA29A,0x003F}, + {0xA29B,0xA29B,0x003F}, + {0xA29C,0xA29C,0x003F}, + {0xA29D,0xA29D,0x003F}, + {0xA29E,0xA29E,0x003F}, + {0xA29F,0xA29F,0x003F}, + {0xA2A0,0xA2A0,0x003F}, /* A2A0 */ + {0xA2F1,0xA2A1,0x2170}, + {0xA2F2,0xA2A2,0x2171}, + {0xA2F3,0xA2A3,0x2172}, + {0xA2F4,0xA2A4,0x2173}, + {0xA2F5,0xA2A5,0x2174}, + {0xA2F6,0xA2A6,0x2175}, + {0xA2F7,0xA2A7,0x2176}, + {0xA2F8,0xA2A8,0x2177}, + {0xA2F9,0xA2A9,0x2178}, + {0xA2FA,0xA2AA,0x2179}, + {0xA2AB,0xA2AB,0x003F}, + {0xA2AC,0xA2AC,0x003F}, + {0xA2AD,0xA2AD,0x003F}, + {0xA2AE,0xA2AE,0x003F}, + {0xA2AF,0xA2AF,0x003F}, + {0xA2B0,0xA2B0,0x003F}, /* A2B0 */ + {0xA2B1,0xA2B1,0x2488}, + {0xA2B2,0xA2B2,0x2489}, + {0xA2B3,0xA2B3,0x248A}, + {0xA2B4,0xA2B4,0x248B}, + {0xA2B5,0xA2B5,0x248C}, + {0xA2B6,0xA2B6,0x248D}, + {0xA2B7,0xA2B7,0x248E}, + {0xA2B8,0xA2B8,0x248F}, + {0xA2B9,0xA2B9,0x2490}, + {0xA2BA,0xA2BA,0x2491}, + {0xA2BB,0xA2BB,0x2492}, + {0xA2BC,0xA2BC,0x2493}, + {0xA2BD,0xA2BD,0x2494}, + {0xA2BE,0xA2BE,0x2495}, + {0xA2BF,0xA2BF,0x2496}, + {0xA2C0,0xA2C0,0x2497}, /* A2C0 */ + {0xA2C1,0xA2C1,0x2498}, + {0xA2C2,0xA2C2,0x2499}, + {0xA2C3,0xA2C3,0x249A}, + {0xA2C4,0xA2C4,0x249B}, + {0xA2C5,0xA2C5,0x2474}, + {0xA2C6,0xA2C6,0x2475}, + {0xA2C7,0xA2C7,0x2476}, + {0xA2C8,0xA2C8,0x2477}, + {0xA2C9,0xA2C9,0x2478}, + {0xA2CA,0xA2CA,0x2479}, + {0xA2CB,0xA2CB,0x247A}, + {0xA2CC,0xA2CC,0x247B}, + {0xA2CD,0xA2CD,0x247C}, + {0xA2CE,0xA2CE,0x247D}, + {0xA2CF,0xA2CF,0x247E}, + {0xA2D0,0xA2D0,0x247F}, /* A2D0 */ + {0xA2D1,0xA2D1,0x2480}, + {0xA2D2,0xA2D2,0x2481}, + {0xA2D3,0xA2D3,0x2482}, + {0xA2D4,0xA2D4,0x2483}, + {0xA2D5,0xA2D5,0x2484}, + {0xA2D6,0xA2D6,0x2485}, + {0xA2D7,0xA2D7,0x2486}, + {0xA2D8,0xA2D8,0x2487}, + {0xA2D9,0xA2D9,0x2460}, + {0xA2DA,0xA2DA,0x2461}, + {0xA2DB,0xA2DB,0x2462}, + {0xA2DC,0xA2DC,0x2463}, + {0xA2DD,0xA2DD,0x2464}, + {0xA2DE,0xA2DE,0x2465}, + {0xA2DF,0xA2DF,0x2466}, + {0xA2E0,0xA2E0,0x2467}, /* A2E0 */ + {0xA2E1,0xA2E1,0x2468}, + {0xA2E2,0xA2E2,0x2469}, + {0xA2E3,0xA2E3,0x003F}, + {0xA2E4,0xA2E4,0x003F}, + {0xA2E5,0xA2E5,0x3220}, + {0xA2E6,0xA2E6,0x3221}, + {0xA2E7,0xA2E7,0x3222}, + {0xA2E8,0xA2E8,0x3223}, + {0xA2E9,0xA2E9,0x3224}, + {0xA2EA,0xA2EA,0x3225}, + {0xA2EB,0xA2EB,0x3226}, + {0xA2EC,0xA2EC,0x3227}, + {0xA2ED,0xA2ED,0x3228}, + {0xA2EE,0xA2EE,0x3229}, + {0xA2EF,0xA2EF,0x003F}, + {0xA2F0,0xA2F0,0x003F}, /* A2F0 */ + {0xA2F1,0xA2A1,0x2160}, + {0xA2F2,0xA2A2,0x2161}, + {0xA2F3,0xA2A3,0x2162}, + {0xA2F4,0xA2A4,0x2163}, + {0xA2F5,0xA2A5,0x2164}, + {0xA2F6,0xA2A6,0x2165}, + {0xA2F7,0xA2A7,0x2166}, + {0xA2F8,0xA2A8,0x2167}, + {0xA2F9,0xA2A9,0x2168}, + {0xA2FA,0xA2AA,0x2169}, + {0xA2FB,0xA2FB,0x216A}, + {0xA2FC,0xA2FC,0x216B}, + {0xA2FD,0xA2FD,0x003F}, + {0xA2FE,0xA2FE,0x003F}, + {0xA2FF,0xA2FF,0xA2FF} +}; + +static MY_UNICASE_INFO cA3[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}, /* xx00 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx10 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx20 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx30 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0xA340,0xA340,0x003F}, /* A340 */ + {0xA341,0xA341,0x003F}, + {0xA342,0xA342,0x003F}, + {0xA343,0xA343,0x003F}, + {0xA344,0xA344,0x003F}, + {0xA345,0xA345,0x003F}, + {0xA346,0xA346,0x003F}, + {0xA347,0xA347,0x003F}, + {0xA348,0xA348,0x003F}, + {0xA349,0xA349,0x003F}, + {0xA34A,0xA34A,0x003F}, + {0xA34B,0xA34B,0x003F}, + {0xA34C,0xA34C,0x003F}, + {0xA34D,0xA34D,0x003F}, + {0xA34E,0xA34E,0x003F}, + {0xA34F,0xA34F,0x003F}, + {0xA350,0xA350,0x003F}, /* A350 */ + {0xA351,0xA351,0x003F}, + {0xA352,0xA352,0x003F}, + {0xA353,0xA353,0x003F}, + {0xA354,0xA354,0x003F}, + {0xA355,0xA355,0x003F}, + {0xA356,0xA356,0x003F}, + {0xA357,0xA357,0x003F}, + {0xA358,0xA358,0x003F}, + {0xA359,0xA359,0x003F}, + {0xA35A,0xA35A,0x003F}, + {0xA35B,0xA35B,0x003F}, + {0xA35C,0xA35C,0x003F}, + {0xA35D,0xA35D,0x003F}, + {0xA35E,0xA35E,0x003F}, + {0xA35F,0xA35F,0x003F}, + {0xA360,0xA360,0x003F}, /* A360 */ + {0xA361,0xA361,0x003F}, + {0xA362,0xA362,0x003F}, + {0xA363,0xA363,0x003F}, + {0xA364,0xA364,0x003F}, + {0xA365,0xA365,0x003F}, + {0xA366,0xA366,0x003F}, + {0xA367,0xA367,0x003F}, + {0xA368,0xA368,0x003F}, + {0xA369,0xA369,0x003F}, + {0xA36A,0xA36A,0x003F}, + {0xA36B,0xA36B,0x003F}, + {0xA36C,0xA36C,0x003F}, + {0xA36D,0xA36D,0x003F}, + {0xA36E,0xA36E,0x003F}, + {0xA36F,0xA36F,0x003F}, + {0xA370,0xA370,0x003F}, /* A370 */ + {0xA371,0xA371,0x003F}, + {0xA372,0xA372,0x003F}, + {0xA373,0xA373,0x003F}, + {0xA374,0xA374,0x003F}, + {0xA375,0xA375,0x003F}, + {0xA376,0xA376,0x003F}, + {0xA377,0xA377,0x003F}, + {0xA378,0xA378,0x003F}, + {0xA379,0xA379,0x003F}, + {0xA37A,0xA37A,0x003F}, + {0xA37B,0xA37B,0x003F}, + {0xA37C,0xA37C,0x003F}, + {0xA37D,0xA37D,0x003F}, + {0xA37E,0xA37E,0x003F}, + {0xA37F,0xA37F,0xA37F}, + {0xA380,0xA380,0x003F}, /* A380 */ + {0xA381,0xA381,0x003F}, + {0xA382,0xA382,0x003F}, + {0xA383,0xA383,0x003F}, + {0xA384,0xA384,0x003F}, + {0xA385,0xA385,0x003F}, + {0xA386,0xA386,0x003F}, + {0xA387,0xA387,0x003F}, + {0xA388,0xA388,0x003F}, + {0xA389,0xA389,0x003F}, + {0xA38A,0xA38A,0x003F}, + {0xA38B,0xA38B,0x003F}, + {0xA38C,0xA38C,0x003F}, + {0xA38D,0xA38D,0x003F}, + {0xA38E,0xA38E,0x003F}, + {0xA38F,0xA38F,0x003F}, + {0xA390,0xA390,0x003F}, /* A390 */ + {0xA391,0xA391,0x003F}, + {0xA392,0xA392,0x003F}, + {0xA393,0xA393,0x003F}, + {0xA394,0xA394,0x003F}, + {0xA395,0xA395,0x003F}, + {0xA396,0xA396,0x003F}, + {0xA397,0xA397,0x003F}, + {0xA398,0xA398,0x003F}, + {0xA399,0xA399,0x003F}, + {0xA39A,0xA39A,0x003F}, + {0xA39B,0xA39B,0x003F}, + {0xA39C,0xA39C,0x003F}, + {0xA39D,0xA39D,0x003F}, + {0xA39E,0xA39E,0x003F}, + {0xA39F,0xA39F,0x003F}, + {0xA3A0,0xA3A0,0x003F}, /* A3A0 */ + {0xA3A1,0xA3A1,0xFF01}, + {0xA3A2,0xA3A2,0xFF02}, + {0xA3A3,0xA3A3,0xFF03}, + {0xA3A4,0xA3A4,0xFFE5}, + {0xA3A5,0xA3A5,0xFF05}, + {0xA3A6,0xA3A6,0xFF06}, + {0xA3A7,0xA3A7,0xFF07}, + {0xA3A8,0xA3A8,0xFF08}, + {0xA3A9,0xA3A9,0xFF09}, + {0xA3AA,0xA3AA,0xFF0A}, + {0xA3AB,0xA3AB,0xFF0B}, + {0xA3AC,0xA3AC,0xFF0C}, + {0xA3AD,0xA3AD,0xFF0D}, + {0xA3AE,0xA3AE,0xFF0E}, + {0xA3AF,0xA3AF,0xFF0F}, + {0xA3B0,0xA3B0,0xFF10}, /* A3B0 */ + {0xA3B1,0xA3B1,0xFF11}, + {0xA3B2,0xA3B2,0xFF12}, + {0xA3B3,0xA3B3,0xFF13}, + {0xA3B4,0xA3B4,0xFF14}, + {0xA3B5,0xA3B5,0xFF15}, + {0xA3B6,0xA3B6,0xFF16}, + {0xA3B7,0xA3B7,0xFF17}, + {0xA3B8,0xA3B8,0xFF18}, + {0xA3B9,0xA3B9,0xFF19}, + {0xA3BA,0xA3BA,0xFF1A}, + {0xA3BB,0xA3BB,0xFF1B}, + {0xA3BC,0xA3BC,0xFF1C}, + {0xA3BD,0xA3BD,0xFF1D}, + {0xA3BE,0xA3BE,0xFF1E}, + {0xA3BF,0xA3BF,0xFF1F}, + {0xA3C0,0xA3C0,0xFF20}, /* A3C0 */ + {0xA3C1,0xA3E1,0xFF21}, + {0xA3C2,0xA3E2,0xFF22}, + {0xA3C3,0xA3E3,0xFF23}, + {0xA3C4,0xA3E4,0xFF24}, + {0xA3C5,0xA3E5,0xFF25}, + {0xA3C6,0xA3E6,0xFF26}, + {0xA3C7,0xA3E7,0xFF27}, + {0xA3C8,0xA3E8,0xFF28}, + {0xA3C9,0xA3E9,0xFF29}, + {0xA3CA,0xA3EA,0xFF2A}, + {0xA3CB,0xA3EB,0xFF2B}, + {0xA3CC,0xA3EC,0xFF2C}, + {0xA3CD,0xA3ED,0xFF2D}, + {0xA3CE,0xA3EE,0xFF2E}, + {0xA3CF,0xA3EF,0xFF2F}, + {0xA3D0,0xA3F0,0xFF30}, /* A3D0 */ + {0xA3D1,0xA3F1,0xFF31}, + {0xA3D2,0xA3F2,0xFF32}, + {0xA3D3,0xA3F3,0xFF33}, + {0xA3D4,0xA3F4,0xFF34}, + {0xA3D5,0xA3F5,0xFF35}, + {0xA3D6,0xA3F6,0xFF36}, + {0xA3D7,0xA3F7,0xFF37}, + {0xA3D8,0xA3F8,0xFF38}, + {0xA3D9,0xA3F9,0xFF39}, + {0xA3DA,0xA3FA,0xFF3A}, + {0xA3DB,0xA3DB,0xFF3B}, + {0xA3DC,0xA3DC,0xFF3C}, + {0xA3DD,0xA3DD,0xFF3D}, + {0xA3DE,0xA3DE,0xFF3E}, + {0xA3DF,0xA3DF,0xFF3F}, + {0xA3E0,0xA3E0,0xFF40}, /* A3E0 */ + {0xA3C1,0xA3E1,0xFF41}, + {0xA3C2,0xA3E2,0xFF42}, + {0xA3C3,0xA3E3,0xFF43}, + {0xA3C4,0xA3E4,0xFF44}, + {0xA3C5,0xA3E5,0xFF45}, + {0xA3C6,0xA3E6,0xFF46}, + {0xA3C7,0xA3E7,0xFF47}, + {0xA3C8,0xA3E8,0xFF48}, + {0xA3C9,0xA3E9,0xFF49}, + {0xA3CA,0xA3EA,0xFF4A}, + {0xA3CB,0xA3EB,0xFF4B}, + {0xA3CC,0xA3EC,0xFF4C}, + {0xA3CD,0xA3ED,0xFF4D}, + {0xA3CE,0xA3EE,0xFF4E}, + {0xA3CF,0xA3EF,0xFF4F}, + {0xA3D0,0xA3F0,0xFF50}, /* A3F0 */ + {0xA3D1,0xA3F1,0xFF51}, + {0xA3D2,0xA3F2,0xFF52}, + {0xA3D3,0xA3F3,0xFF53}, + {0xA3D4,0xA3F4,0xFF54}, + {0xA3D5,0xA3F5,0xFF55}, + {0xA3D6,0xA3F6,0xFF56}, + {0xA3D7,0xA3F7,0xFF57}, + {0xA3D8,0xA3F8,0xFF58}, + {0xA3D9,0xA3F9,0xFF59}, + {0xA3DA,0xA3FA,0xFF5A}, + {0xA3FB,0xA3FB,0xFF5B}, + {0xA3FC,0xA3FC,0xFF5C}, + {0xA3FD,0xA3FD,0xFF5D}, + {0xA3FE,0xA3FE,0xFFE3}, + {0xA3FF,0xA3FF,0xA3FF} +}; + + +static MY_UNICASE_INFO cA6[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}, /* xx00 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx10 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx20 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx30 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0xA640,0xA640,0x003F}, /* A640 */ + {0xA641,0xA641,0x003F}, + {0xA642,0xA642,0x003F}, + {0xA643,0xA643,0x003F}, + {0xA644,0xA644,0x003F}, + {0xA645,0xA645,0x003F}, + {0xA646,0xA646,0x003F}, + {0xA647,0xA647,0x003F}, + {0xA648,0xA648,0x003F}, + {0xA649,0xA649,0x003F}, + {0xA64A,0xA64A,0x003F}, + {0xA64B,0xA64B,0x003F}, + {0xA64C,0xA64C,0x003F}, + {0xA64D,0xA64D,0x003F}, + {0xA64E,0xA64E,0x003F}, + {0xA64F,0xA64F,0x003F}, + {0xA650,0xA650,0x003F}, /* A650 */ + {0xA651,0xA651,0x003F}, + {0xA652,0xA652,0x003F}, + {0xA653,0xA653,0x003F}, + {0xA654,0xA654,0x003F}, + {0xA655,0xA655,0x003F}, + {0xA656,0xA656,0x003F}, + {0xA657,0xA657,0x003F}, + {0xA658,0xA658,0x003F}, + {0xA659,0xA659,0x003F}, + {0xA65A,0xA65A,0x003F}, + {0xA65B,0xA65B,0x003F}, + {0xA65C,0xA65C,0x003F}, + {0xA65D,0xA65D,0x003F}, + {0xA65E,0xA65E,0x003F}, + {0xA65F,0xA65F,0x003F}, + {0xA660,0xA660,0x003F}, /* A660 */ + {0xA661,0xA661,0x003F}, + {0xA662,0xA662,0x003F}, + {0xA663,0xA663,0x003F}, + {0xA664,0xA664,0x003F}, + {0xA665,0xA665,0x003F}, + {0xA666,0xA666,0x003F}, + {0xA667,0xA667,0x003F}, + {0xA668,0xA668,0x003F}, + {0xA669,0xA669,0x003F}, + {0xA66A,0xA66A,0x003F}, + {0xA66B,0xA66B,0x003F}, + {0xA66C,0xA66C,0x003F}, + {0xA66D,0xA66D,0x003F}, + {0xA66E,0xA66E,0x003F}, + {0xA66F,0xA66F,0x003F}, + {0xA670,0xA670,0x003F}, /* A670 */ + {0xA671,0xA671,0x003F}, + {0xA672,0xA672,0x003F}, + {0xA673,0xA673,0x003F}, + {0xA674,0xA674,0x003F}, + {0xA675,0xA675,0x003F}, + {0xA676,0xA676,0x003F}, + {0xA677,0xA677,0x003F}, + {0xA678,0xA678,0x003F}, + {0xA679,0xA679,0x003F}, + {0xA67A,0xA67A,0x003F}, + {0xA67B,0xA67B,0x003F}, + {0xA67C,0xA67C,0x003F}, + {0xA67D,0xA67D,0x003F}, + {0xA67E,0xA67E,0x003F}, + {0xA67F,0xA67F,0xA67F}, + {0xA680,0xA680,0x003F}, /* A680 */ + {0xA681,0xA681,0x003F}, + {0xA682,0xA682,0x003F}, + {0xA683,0xA683,0x003F}, + {0xA684,0xA684,0x003F}, + {0xA685,0xA685,0x003F}, + {0xA686,0xA686,0x003F}, + {0xA687,0xA687,0x003F}, + {0xA688,0xA688,0x003F}, + {0xA689,0xA689,0x003F}, + {0xA68A,0xA68A,0x003F}, + {0xA68B,0xA68B,0x003F}, + {0xA68C,0xA68C,0x003F}, + {0xA68D,0xA68D,0x003F}, + {0xA68E,0xA68E,0x003F}, + {0xA68F,0xA68F,0x003F}, + {0xA690,0xA690,0x003F}, /* A690 */ + {0xA691,0xA691,0x003F}, + {0xA692,0xA692,0x003F}, + {0xA693,0xA693,0x003F}, + {0xA694,0xA694,0x003F}, + {0xA695,0xA695,0x003F}, + {0xA696,0xA696,0x003F}, + {0xA697,0xA697,0x003F}, + {0xA698,0xA698,0x003F}, + {0xA699,0xA699,0x003F}, + {0xA69A,0xA69A,0x003F}, + {0xA69B,0xA69B,0x003F}, + {0xA69C,0xA69C,0x003F}, + {0xA69D,0xA69D,0x003F}, + {0xA69E,0xA69E,0x003F}, + {0xA69F,0xA69F,0x003F}, + {0xA6A0,0xA6A0,0x003F}, /* A6A0 */ + {0xA6A1,0xA6C1,0x0391}, + {0xA6A2,0xA6C2,0x0392}, + {0xA6A3,0xA6C3,0x0393}, + {0xA6A4,0xA6C4,0x0394}, + {0xA6A5,0xA6C5,0x0395}, + {0xA6A6,0xA6C6,0x0396}, + {0xA6A7,0xA6C7,0x0397}, + {0xA6A8,0xA6C8,0x0398}, + {0xA6A9,0xA6C9,0x0399}, + {0xA6AA,0xA6CA,0x039A}, + {0xA6AB,0xA6CB,0x039B}, + {0xA6AC,0xA6CC,0x039C}, + {0xA6AD,0xA6CD,0x039D}, + {0xA6AE,0xA6CE,0x039E}, + {0xA6AF,0xA6CF,0x039F}, + {0xA6B0,0xA6D0,0x03A0}, /* A6B0 */ + {0xA6B1,0xA6D1,0x03A1}, + {0xA6B2,0xA6D2,0x03A3}, + {0xA6B3,0xA6D3,0x03A4}, + {0xA6B4,0xA6D4,0x03A5}, + {0xA6B5,0xA6D5,0x03A6}, + {0xA6B6,0xA6D6,0x03A7}, + {0xA6B7,0xA6D7,0x03A8}, + {0xA6B8,0xA6D8,0x03A9}, + {0xA6B9,0xA6B9,0x003F}, + {0xA6BA,0xA6BA,0x003F}, + {0xA6BB,0xA6BB,0x003F}, + {0xA6BC,0xA6BC,0x003F}, + {0xA6BD,0xA6BD,0x003F}, + {0xA6BE,0xA6BE,0x003F}, + {0xA6BF,0xA6BF,0x003F}, + {0xA6C0,0xA6C0,0x003F}, /* A6C0 */ + {0xA6A1,0xA6C1,0x03B1}, + {0xA6A2,0xA6C2,0x03B2}, + {0xA6A3,0xA6C3,0x03B3}, + {0xA6A4,0xA6C4,0x03B4}, + {0xA6A5,0xA6C5,0x03B5}, + {0xA6A6,0xA6C6,0x03B6}, + {0xA6A7,0xA6C7,0x03B7}, + {0xA6A8,0xA6C8,0x03B8}, + {0xA6A9,0xA6C9,0x03B9}, + {0xA6AA,0xA6CA,0x03BA}, + {0xA6AB,0xA6CB,0x03BB}, + {0xA6AC,0xA6CC,0x03BC}, + {0xA6AD,0xA6CD,0x03BD}, + {0xA6AE,0xA6CE,0x03BE}, + {0xA6AF,0xA6CF,0x03BF}, + {0xA6B0,0xA6D0,0x03C0}, /* A6D0 */ + {0xA6B1,0xA6D1,0x03C1}, + {0xA6B2,0xA6D2,0x03C3}, + {0xA6B3,0xA6D3,0x03C4}, + {0xA6B4,0xA6D4,0x03C5}, + {0xA6B5,0xA6D5,0x03C6}, + {0xA6B6,0xA6D6,0x03C7}, + {0xA6B7,0xA6D7,0x03C8}, + {0xA6B8,0xA6D8,0x03C9}, + {0xA6D9,0xA6D9,0x003F}, + {0xA6DA,0xA6DA,0x003F}, + {0xA6DB,0xA6DB,0x003F}, + {0xA6DC,0xA6DC,0x003F}, + {0xA6DD,0xA6DD,0x003F}, + {0xA6DE,0xA6DE,0x003F}, + {0xA6DF,0xA6DF,0x003F}, + {0xA6E0,0xA6E0,0xFE35}, /* A6E0 */ + {0xA6E1,0xA6E1,0xFE36}, + {0xA6E2,0xA6E2,0xFE39}, + {0xA6E3,0xA6E3,0xFE3A}, + {0xA6E4,0xA6E4,0xFE3F}, + {0xA6E5,0xA6E5,0xFE40}, + {0xA6E6,0xA6E6,0xFE3D}, + {0xA6E7,0xA6E7,0xFE3E}, + {0xA6E8,0xA6E8,0xFE41}, + {0xA6E9,0xA6E9,0xFE42}, + {0xA6EA,0xA6EA,0xFE43}, + {0xA6EB,0xA6EB,0xFE44}, + {0xA6EC,0xA6EC,0x003F}, + {0xA6ED,0xA6ED,0x003F}, + {0xA6EE,0xA6EE,0xFE3B}, + {0xA6EF,0xA6EF,0xFE3C}, + {0xA6F0,0xA6F0,0xFE37}, /* A6F0 */ + {0xA6F1,0xA6F1,0xFE38}, + {0xA6F2,0xA6F2,0xFE31}, + {0xA6F3,0xA6F3,0x003F}, + {0xA6F4,0xA6F4,0xFE33}, + {0xA6F5,0xA6F5,0xFE34}, + {0xA6F6,0xA6F6,0x003F}, + {0xA6F7,0xA6F7,0x003F}, + {0xA6F8,0xA6F8,0x003F}, + {0xA6F9,0xA6F9,0x003F}, + {0xA6FA,0xA6FA,0x003F}, + {0xA6FB,0xA6FB,0x003F}, + {0xA6FC,0xA6FC,0x003F}, + {0xA6FD,0xA6FD,0x003F}, + {0xA6FE,0xA6FE,0x003F}, + {0xA6FF,0xA6FF,0xA6FF} +}; + + +static MY_UNICASE_INFO cA7[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}, /* xx00 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx10 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx20 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, /* xx30 */ + {0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0},{0,0,0}, + {0xA740,0xA740,0x003F}, /* A740 */ + {0xA741,0xA741,0x003F}, + {0xA742,0xA742,0x003F}, + {0xA743,0xA743,0x003F}, + {0xA744,0xA744,0x003F}, + {0xA745,0xA745,0x003F}, + {0xA746,0xA746,0x003F}, + {0xA747,0xA747,0x003F}, + {0xA748,0xA748,0x003F}, + {0xA749,0xA749,0x003F}, + {0xA74A,0xA74A,0x003F}, + {0xA74B,0xA74B,0x003F}, + {0xA74C,0xA74C,0x003F}, + {0xA74D,0xA74D,0x003F}, + {0xA74E,0xA74E,0x003F}, + {0xA74F,0xA74F,0x003F}, + {0xA750,0xA750,0x003F}, /* A750 */ + {0xA751,0xA751,0x003F}, + {0xA752,0xA752,0x003F}, + {0xA753,0xA753,0x003F}, + {0xA754,0xA754,0x003F}, + {0xA755,0xA755,0x003F}, + {0xA756,0xA756,0x003F}, + {0xA757,0xA757,0x003F}, + {0xA758,0xA758,0x003F}, + {0xA759,0xA759,0x003F}, + {0xA75A,0xA75A,0x003F}, + {0xA75B,0xA75B,0x003F}, + {0xA75C,0xA75C,0x003F}, + {0xA75D,0xA75D,0x003F}, + {0xA75E,0xA75E,0x003F}, + {0xA75F,0xA75F,0x003F}, + {0xA760,0xA760,0x003F}, /* A760 */ + {0xA761,0xA761,0x003F}, + {0xA762,0xA762,0x003F}, + {0xA763,0xA763,0x003F}, + {0xA764,0xA764,0x003F}, + {0xA765,0xA765,0x003F}, + {0xA766,0xA766,0x003F}, + {0xA767,0xA767,0x003F}, + {0xA768,0xA768,0x003F}, + {0xA769,0xA769,0x003F}, + {0xA76A,0xA76A,0x003F}, + {0xA76B,0xA76B,0x003F}, + {0xA76C,0xA76C,0x003F}, + {0xA76D,0xA76D,0x003F}, + {0xA76E,0xA76E,0x003F}, + {0xA76F,0xA76F,0x003F}, + {0xA770,0xA770,0x003F}, /* A770 */ + {0xA771,0xA771,0x003F}, + {0xA772,0xA772,0x003F}, + {0xA773,0xA773,0x003F}, + {0xA774,0xA774,0x003F}, + {0xA775,0xA775,0x003F}, + {0xA776,0xA776,0x003F}, + {0xA777,0xA777,0x003F}, + {0xA778,0xA778,0x003F}, + {0xA779,0xA779,0x003F}, + {0xA77A,0xA77A,0x003F}, + {0xA77B,0xA77B,0x003F}, + {0xA77C,0xA77C,0x003F}, + {0xA77D,0xA77D,0x003F}, + {0xA77E,0xA77E,0x003F}, + {0xA77F,0xA77F,0xA77F}, + {0xA780,0xA780,0x003F}, /* A780 */ + {0xA781,0xA781,0x003F}, + {0xA782,0xA782,0x003F}, + {0xA783,0xA783,0x003F}, + {0xA784,0xA784,0x003F}, + {0xA785,0xA785,0x003F}, + {0xA786,0xA786,0x003F}, + {0xA787,0xA787,0x003F}, + {0xA788,0xA788,0x003F}, + {0xA789,0xA789,0x003F}, + {0xA78A,0xA78A,0x003F}, + {0xA78B,0xA78B,0x003F}, + {0xA78C,0xA78C,0x003F}, + {0xA78D,0xA78D,0x003F}, + {0xA78E,0xA78E,0x003F}, + {0xA78F,0xA78F,0x003F}, + {0xA790,0xA790,0x003F}, /* A790 */ + {0xA791,0xA791,0x003F}, + {0xA792,0xA792,0x003F}, + {0xA793,0xA793,0x003F}, + {0xA794,0xA794,0x003F}, + {0xA795,0xA795,0x003F}, + {0xA796,0xA796,0x003F}, + {0xA797,0xA797,0x003F}, + {0xA798,0xA798,0x003F}, + {0xA799,0xA799,0x003F}, + {0xA79A,0xA79A,0x003F}, + {0xA79B,0xA79B,0x003F}, + {0xA79C,0xA79C,0x003F}, + {0xA79D,0xA79D,0x003F}, + {0xA79E,0xA79E,0x003F}, + {0xA79F,0xA79F,0x003F}, + {0xA7A0,0xA7A0,0x003F}, /* A7A0 */ + {0xA7A1,0xA7D1,0x0410}, + {0xA7A2,0xA7D2,0x0411}, + {0xA7A3,0xA7D3,0x0412}, + {0xA7A4,0xA7D4,0x0413}, + {0xA7A5,0xA7D5,0x0414}, + {0xA7A6,0xA7D6,0x0415}, + {0xA7A7,0xA7D7,0x0401}, + {0xA7A8,0xA7D8,0x0416}, + {0xA7A9,0xA7D9,0x0417}, + {0xA7AA,0xA7DA,0x0418}, + {0xA7AB,0xA7DB,0x0419}, + {0xA7AC,0xA7DC,0x041A}, + {0xA7AD,0xA7DD,0x041B}, + {0xA7AE,0xA7DE,0x041C}, + {0xA7AF,0xA7DF,0x041D}, + {0xA7B0,0xA7E0,0x041E}, /* A7B0 */ + {0xA7B1,0xA7E1,0x041F}, + {0xA7B2,0xA7E2,0x0420}, + {0xA7B3,0xA7E3,0x0421}, + {0xA7B4,0xA7E4,0x0422}, + {0xA7B5,0xA7E5,0x0423}, + {0xA7B6,0xA7E6,0x0424}, + {0xA7B7,0xA7E7,0x0425}, + {0xA7B8,0xA7E8,0x0426}, + {0xA7B9,0xA7E9,0x0427}, + {0xA7BA,0xA7EA,0x0428}, + {0xA7BB,0xA7EB,0x0429}, + {0xA7BC,0xA7EC,0x042A}, + {0xA7BD,0xA7ED,0x042B}, + {0xA7BE,0xA7EE,0x042C}, + {0xA7BF,0xA7EF,0x042D}, + {0xA7C0,0xA7F0,0x042E}, /* A7C0 */ + {0xA7C1,0xA7F1,0x042F}, + {0xA7C2,0xA7C2,0x003F}, + {0xA7C3,0xA7C3,0x003F}, + {0xA7C4,0xA7C4,0x003F}, + {0xA7C5,0xA7C5,0x003F}, + {0xA7C6,0xA7C6,0x003F}, + {0xA7C7,0xA7C7,0x003F}, + {0xA7C8,0xA7C8,0x003F}, + {0xA7C9,0xA7C9,0x003F}, + {0xA7CA,0xA7CA,0x003F}, + {0xA7CB,0xA7CB,0x003F}, + {0xA7CC,0xA7CC,0x003F}, + {0xA7CD,0xA7CD,0x003F}, + {0xA7CE,0xA7CE,0x003F}, + {0xA7CF,0xA7CF,0x003F}, + {0xA7D0,0xA7D0,0x003F}, /* A7D0 */ + {0xA7A1,0xA7D1,0x0430}, + {0xA7A2,0xA7D2,0x0431}, + {0xA7A3,0xA7D3,0x0432}, + {0xA7A4,0xA7D4,0x0433}, + {0xA7A5,0xA7D5,0x0434}, + {0xA7A6,0xA7D6,0x0435}, + {0xA7A7,0xA7D7,0x0451}, + {0xA7A8,0xA7D8,0x0436}, + {0xA7A9,0xA7D9,0x0437}, + {0xA7AA,0xA7DA,0x0438}, + {0xA7AB,0xA7DB,0x0439}, + {0xA7AC,0xA7DC,0x043A}, + {0xA7AD,0xA7DD,0x043B}, + {0xA7AE,0xA7DE,0x043C}, + {0xA7AF,0xA7DF,0x043D}, + {0xA7B0,0xA7E0,0x043E}, /* A7E0 */ + {0xA7B1,0xA7E1,0x043F}, + {0xA7B2,0xA7E2,0x0440}, + {0xA7B3,0xA7E3,0x0441}, + {0xA7B4,0xA7E4,0x0442}, + {0xA7B5,0xA7E5,0x0443}, + {0xA7B6,0xA7E6,0x0444}, + {0xA7B7,0xA7E7,0x0445}, + {0xA7B8,0xA7E8,0x0446}, + {0xA7B9,0xA7E9,0x0447}, + {0xA7BA,0xA7EA,0x0448}, + {0xA7BB,0xA7EB,0x0449}, + {0xA7BC,0xA7EC,0x044A}, + {0xA7BD,0xA7ED,0x044B}, + {0xA7BE,0xA7EE,0x044C}, + {0xA7BF,0xA7EF,0x044D}, + {0xA7C0,0xA7F0,0x044E}, /* A7F0 */ + {0xA7C1,0xA7F1,0x044F}, + {0xA7F2,0xA7F2,0x003F}, + {0xA7F3,0xA7F3,0x003F}, + {0xA7F4,0xA7F4,0x003F}, + {0xA7F5,0xA7F5,0x003F}, + {0xA7F6,0xA7F6,0x003F}, + {0xA7F7,0xA7F7,0x003F}, + {0xA7F8,0xA7F8,0x003F}, + {0xA7F9,0xA7F9,0x003F}, + {0xA7FA,0xA7FA,0x003F}, + {0xA7FB,0xA7FB,0x003F}, + {0xA7FC,0xA7FC,0x003F}, + {0xA7FD,0xA7FD,0x003F}, + {0xA7FE,0xA7FE,0x003F}, + {0xA7FF,0xA7FF,0xA7FF} +}; + + +static MY_UNICASE_INFO *my_caseinfo_gbk[256]= +{ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 0 */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 1 */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 2 */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 3 */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 4 */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 5 */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 6 */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 7 */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 8 */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* 9 */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, cA2, cA3, NULL, NULL, cA6, cA7, /* A */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* B */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* C */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* D */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* E */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, /* F */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL +}; + + + +static uchar sort_order_gbk[]= { '\000','\001','\002','\003','\004','\005','\006','\007', '\010','\011','\012','\013','\014','\015','\016','\017', @@ -173,7 +1031,7 @@ static uchar NEAR sort_order_gbk[]= (uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377', }; -static uint16 NEAR gbk_order[]= +static uint16 gbk_order[]= { 8653,14277,17116,11482,11160,2751,14613,3913,13337,9827, 19496,1759,8105,7103,7836,5638,2223,21433,5878,8006, @@ -9959,7 +10817,7 @@ CHARSET_INFO my_charset_gbk_chinese_ci= NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - my_unicase_default, /* caseinfo */ + my_caseinfo_gbk, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ @@ -9991,7 +10849,7 @@ CHARSET_INFO my_charset_gbk_bin= NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ NULL, /* tab_from_uni */ - my_unicase_default, /* caseinfo */ + my_caseinfo_gbk, /* caseinfo */ NULL, /* state_map */ NULL, /* ident_map */ 1, /* strxfrm_multiply */ diff --git a/dep/mysqllite/strings/ctype-latin1.c b/dep/mysqllite/strings/ctype-latin1.c index e5333c4101b35..dbd91c09637e7 100644 --- a/dep/mysqllite/strings/ctype-latin1.c +++ b/dep/mysqllite/strings/ctype-latin1.c @@ -678,13 +678,12 @@ void my_hash_sort_latin1_de(CHARSET_INFO *cs __attribute__((unused)), const uchar *key, size_t len, ulong *nr1, ulong *nr2) { - const uchar *end= key+len; + const uchar *end; /* Remove end space. We have to do this to be able to compare 'AE' and 'Ä' as identical */ - while (end > key && end[-1] == ' ') - end--; + end= skip_trailing_space(key, len); for (; key < end ; key++) { diff --git a/dep/mysqllite/strings/ctype-mb.c b/dep/mysqllite/strings/ctype-mb.c index e3788fc4dff41..8b985b7405b8a 100644 --- a/dep/mysqllite/strings/ctype-mb.c +++ b/dep/mysqllite/strings/ctype-mb.c @@ -62,6 +62,17 @@ size_t my_casedn_str_mb(CHARSET_INFO * cs, char *str) } +static inline MY_UNICASE_INFO* +get_case_info_for_ch(CHARSET_INFO *cs, uint page, uint offs) +{ + MY_UNICASE_INFO *p; + return cs->caseinfo ? ((p= cs->caseinfo[page]) ? &p[offs] : NULL) : NULL; +} + + +/* + For character sets which don't change octet length in case conversion. +*/ size_t my_caseup_mb(CHARSET_INFO * cs, char *src, size_t srclen, char *dst __attribute__((unused)), size_t dstlen __attribute__((unused))) @@ -70,11 +81,23 @@ size_t my_caseup_mb(CHARSET_INFO * cs, char *src, size_t srclen, register char *srcend= src + srclen; register uchar *map= cs->to_upper; + DBUG_ASSERT(cs->caseup_multiply == 1); DBUG_ASSERT(src == dst && srclen == dstlen); + DBUG_ASSERT(cs->mbmaxlen == 2); + while (src < srcend) { if ((l=my_ismbchar(cs, src, srcend))) - src+= l; + { + MY_UNICASE_INFO *ch; + if ((ch= get_case_info_for_ch(cs, (uchar) src[0], (uchar) src[1]))) + { + *src++= ch->toupper >> 8; + *src++= ch->toupper & 0xFF; + } + else + src+= l; + } else { *src=(char) map[(uchar) *src]; @@ -93,11 +116,23 @@ size_t my_casedn_mb(CHARSET_INFO * cs, char *src, size_t srclen, register char *srcend= src + srclen; register uchar *map=cs->to_lower; + DBUG_ASSERT(cs->casedn_multiply == 1); DBUG_ASSERT(src == dst && srclen == dstlen); + DBUG_ASSERT(cs->mbmaxlen == 2); + while (src < srcend) { if ((l= my_ismbchar(cs, src, srcend))) - src+= l; + { + MY_UNICASE_INFO *ch; + if ((ch= get_case_info_for_ch(cs, (uchar) src[0], (uchar) src[1]))) + { + *src++= ch->tolower >> 8; + *src++= ch->tolower & 0xFF; + } + else + src+= l; + } else { *src= (char) map[(uchar)*src]; @@ -108,6 +143,75 @@ size_t my_casedn_mb(CHARSET_INFO * cs, char *src, size_t srclen, } +/* + Case folding functions for character set + where case conversion can change string octet length. + For example, in EUCKR, + _euckr 0xA9A5 == "LATIN LETTER DOTLESS I" (Turkish letter) + is upper-cased to to + _euckr 0x49 "LATIN CAPITAL LETTER I" ('usual' letter I) + Length is reduced in this example from two bytes to one byte. +*/ +static size_t +my_casefold_mb_varlen(CHARSET_INFO *cs, + char *src, size_t srclen, + char *dst, size_t dstlen __attribute__((unused)), + uchar *map, + size_t is_upper) +{ + char *srcend= src + srclen, *dst0= dst; + + DBUG_ASSERT(cs->mbmaxlen == 2); + + while (src < srcend) + { + size_t mblen= my_ismbchar(cs, src, srcend); + if (mblen) + { + MY_UNICASE_INFO *ch; + if ((ch= get_case_info_for_ch(cs, (uchar) src[0], (uchar) src[1]))) + { + int code= is_upper ? ch->toupper : ch->tolower; + src+= 2; + if (code > 0xFF) + *dst++= code >> 8; + *dst++= code & 0xFF; + } + else + { + *dst++= *src++; + *dst++= *src++; + } + } + else + { + *dst++= (char) map[(uchar) *src++]; + } + } + return (size_t) (dst - dst0); +} + + +size_t +my_casedn_mb_varlen(CHARSET_INFO * cs, char *src, size_t srclen, + char *dst, size_t dstlen) +{ + DBUG_ASSERT(dstlen >= srclen * cs->casedn_multiply); + DBUG_ASSERT(src != dst || cs->casedn_multiply == 1); + return my_casefold_mb_varlen(cs, src, srclen, dst, dstlen, cs->to_lower, 0); +} + + +size_t +my_caseup_mb_varlen(CHARSET_INFO * cs, char *src, size_t srclen, + char *dst, size_t dstlen) +{ + DBUG_ASSERT(dstlen >= srclen * cs->caseup_multiply); + DBUG_ASSERT(src != dst || cs->caseup_multiply == 1); + return my_casefold_mb_varlen(cs, src, srclen, dst, dstlen, cs->to_upper, 1); +} + + /* my_strcasecmp_mb() returns 0 if strings are equal, non-zero otherwise. */ @@ -363,10 +467,11 @@ uint my_instr_mb(CHARSET_INFO *cs, /* BINARY collations handlers for MB charsets */ -static 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) +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); @@ -399,10 +504,11 @@ static int my_strnncoll_mb_bin(CHARSET_INFO * cs __attribute__((unused)), 0 if strings are equal */ -static 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) +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; @@ -458,25 +564,25 @@ static size_t my_strnxfrm_mb_bin(CHARSET_INFO *cs __attribute__((unused)), } -static int my_strcasecmp_mb_bin(CHARSET_INFO * cs __attribute__((unused)), - const char *s, const char *t) +int +my_strcasecmp_mb_bin(CHARSET_INFO * cs __attribute__((unused)), + const char *s, const char *t) { return strcmp(s,t); } -static void my_hash_sort_mb_bin(CHARSET_INFO *cs __attribute__((unused)), - const uchar *key, size_t len,ulong *nr1, ulong *nr2) + +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; - key+= len; - /* Remove trailing spaces. We have to do this to be able to compare 'A ' and 'A' as identical */ - while (key > pos && key[-1] == ' ') - key--; + key= skip_trailing_space(key, len); for (; pos < (uchar*) key ; pos++) { @@ -530,7 +636,7 @@ static void pad_max_char(CHARSET_INFO *cs, char *str, char *end) DBUG_ASSERT(buflen > 0); do { - if ((str + buflen) < end) + if ((str + buflen) <= end) { /* Enough space for the characer */ memcpy(str, buf, buflen); @@ -696,10 +802,197 @@ my_bool my_like_range_mb(CHARSET_INFO *cs, } -static 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) +/** + Calculate min_str and max_str that ranges a LIKE string. + Generic function, currently used for ucs2, utf16, utf32, + but should be suitable for any other character sets with + cs->min_sort_char and cs->max_sort_char represented in + Unicode code points. + + @param cs Character set and collation pointer + @param ptr Pointer to LIKE pattern. + @param ptr_length Length of LIKE pattern. + @param escape Escape character pattern, typically '\'. + @param w_one 'One character' pattern, typically '_'. + @param w_many 'Many characters' pattern, typically '%'. + @param res_length Length of min_str and max_str. + + @param[out] min_str Smallest string that ranges LIKE. + @param[out] max_str Largest string that ranges LIKE. + @param[out] min_len Length of min_str + @param[out] max_len Length of max_str + + @return Optimization status. + @retval FALSE if LIKE pattern can be optimized + @rerval TRUE if LIKE can't be optimized. +*/ +my_bool +my_like_range_generic(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; + const char *min_org= min_str; + const char *max_org= max_str; + char *min_end= min_str + res_length; + char *max_end= max_str + res_length; + size_t charlen= res_length / cs->mbmaxlen; + size_t res_length_diff; + my_bool have_contractions= my_cs_have_contractions(cs); + + for ( ; charlen > 0; charlen--) + { + my_wc_t wc, wc2; + int res; + if ((res= cs->cset->mb_wc(cs, &wc, (uchar*) ptr, (uchar*) end)) <= 0) + { + if (res == MY_CS_ILSEQ) /* Bad sequence */ + return TRUE; /* min_length and max_length are not important */ + break; /* End of the string */ + } + ptr+= res; + + if (wc == (my_wc_t) escape) + { + if ((res= cs->cset->mb_wc(cs, &wc, (uchar*) ptr, (uchar*) end)) <= 0) + { + if (res == MY_CS_ILSEQ) + return TRUE; /* min_length and max_length are not important */ + /* + End of the string: Escape is the last character. + Put escape as a normal character. + We'll will leave the loop on the next iteration. + */ + } + else + ptr+= res; + + /* Put escape character to min_str and max_str */ + if ((res= cs->cset->wc_mb(cs, wc, + (uchar*) min_str, (uchar*) min_end)) <= 0) + goto pad_set_lengths; /* No space */ + min_str+= res; + + if ((res= cs->cset->wc_mb(cs, wc, + (uchar*) max_str, (uchar*) max_end)) <= 0) + goto pad_set_lengths; /* No space */ + max_str+= res; + continue; + } + else if (wc == (my_wc_t) w_one) + { + if ((res= cs->cset->wc_mb(cs, cs->min_sort_char, + (uchar*) min_str, (uchar*) min_end)) <= 0) + goto pad_set_lengths; + min_str+= res; + + if ((res= cs->cset->wc_mb(cs, cs->max_sort_char, + (uchar*) max_str, (uchar*) max_end)) <= 0) + goto pad_set_lengths; + max_str+= res; + continue; + } + else if (wc == (my_wc_t) w_many) + { + /* + Calculate length of keys: + a\min\min... is the smallest possible string + a\max\max... 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; + } + + if (have_contractions && + my_cs_can_be_contraction_head(cs, wc) && + (res= cs->cset->mb_wc(cs, &wc2, (uchar*) ptr, (uchar*) end)) > 0) + { + uint16 *weight; + if ((wc2 == (my_wc_t) w_one || wc2 == (my_wc_t) w_many)) + { + /* Contraction head followed by a wildcard */ + *min_length= *max_length= res_length; + goto pad_min_max; + } + + if (my_cs_can_be_contraction_tail(cs, wc2) && + (weight= my_cs_contraction2_weight(cs, wc, wc2)) && weight[0]) + { + /* Contraction found */ + if (charlen == 1) + { + /* contraction does not fit to result */ + *min_length= *max_length= res_length; + goto pad_min_max; + } + + ptr+= res; + charlen--; + + /* Put contraction head */ + if ((res= cs->cset->wc_mb(cs, wc, + (uchar*) min_str, (uchar*) min_end)) <= 0) + goto pad_set_lengths; + min_str+= res; + + if ((res= cs->cset->wc_mb(cs, wc, + (uchar*) max_str, (uchar*) max_end)) <= 0) + goto pad_set_lengths; + max_str+= res; + wc= wc2; /* Prepare to put contraction tail */ + } + } + + /* Normal character, or contraction tail */ + if ((res= cs->cset->wc_mb(cs, wc, + (uchar*) min_str, (uchar*) min_end)) <= 0) + goto pad_set_lengths; + min_str+= res; + if ((res= cs->cset->wc_mb(cs, wc, + (uchar*) max_str, (uchar*) max_end)) <= 0) + goto pad_set_lengths; + max_str+= res; + } + +pad_set_lengths: + *min_length= (size_t) (min_str - min_org); + *max_length= (size_t) (max_str - max_org); + +pad_min_max: + /* + Fill up max_str and min_str to res_length. + fill() cannot set incomplete characters and + requires that "length" argument is divisible to mbminlen. + Make sure to call fill() with proper "length" argument. + */ + res_length_diff= res_length % cs->mbminlen; + cs->cset->fill(cs, min_str, min_end - min_str - res_length_diff, + cs->min_sort_char); + cs->cset->fill(cs, max_str, max_end - max_str - res_length_diff, + cs->max_sort_char); + + /* In case of incomplete characters set the remainder to 0x00's */ + if (res_length_diff) + { + /* Example: odd res_length for ucs2 */ + memset(min_end - res_length_diff, 0, res_length_diff); + memset(max_end - res_length_diff, 0, res_length_diff); + } + return FALSE; +} + + +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 */ @@ -1026,8 +1319,16 @@ size_t my_numcells_mb(CHARSET_INFO *cs, const char *b, const char *e) continue; } b+= mb_len; - pg= (wc >> 8) & 0xFF; - clen+= utr11_data[pg].p ? utr11_data[pg].p[wc & 0xFF] : utr11_data[pg].page; + if (wc > 0xFFFF) + { + if (wc >= 0x20000 && wc <= 0x3FFFD) /* CJK Ideograph Extension B, C */ + clen+= 1; + } + else + { + pg= (wc >> 8) & 0xFF; + clen+= utr11_data[pg].p ? utr11_data[pg].p[wc & 0xFF] : utr11_data[pg].page; + } clen++; } return clen; @@ -1039,7 +1340,7 @@ int my_mb_ctype_mb(CHARSET_INFO *cs, int *ctype, { my_wc_t wc; int res= cs->cset->mb_wc(cs, &wc, s, e); - if (res <= 0) + if (res <= 0 || wc > 0xFFFF) *ctype= 0; else *ctype= my_uni_ctype[wc>>8].ctype ? diff --git a/dep/mysqllite/strings/ctype-simple.c b/dep/mysqllite/strings/ctype-simple.c index 4f3aaa6f66809..2e5f78a30bf9a 100644 --- a/dep/mysqllite/strings/ctype-simple.c +++ b/dep/mysqllite/strings/ctype-simple.c @@ -304,14 +304,13 @@ void my_hash_sort_simple(CHARSET_INFO *cs, ulong *nr1, ulong *nr2) { register uchar *sort_order=cs->sort_order; - const uchar *end= key + len; + const uchar *end; /* Remove end space. We have to do this to be able to compare 'A ' and 'A' as identical */ - while (end > key && end[-1] == ' ') - end--; + end= skip_trailing_space(key, len); for (; key < (uchar*) end ; key++) { @@ -336,10 +335,6 @@ long my_strntol_8bit(CHARSET_INFO *cs, 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; @@ -365,29 +360,6 @@ long my_strntol_8bit(CHARSET_INFO *cs, else negative = 0; -#ifdef NOT_USED - if (base == 16 && s[0] == '0' && (s[1]=='X' || s[1]=='x')) - s += 2; -#endif - -#ifdef NOT_USED - if (base == 0) - { - if (*s == '0') - { - if (s[1]=='X' || s[1]=='x') - { - s += 2; - base = 16; - } - else - base = 8; - } - else - base = 10; - } -#endif - save = s; cutoff = ((uint32)~0L) / (uint32) base; cutlim = (uint) (((uint32)~0L) % (uint32) base); @@ -459,10 +431,6 @@ ulong my_strntoul_8bit(CHARSET_INFO *cs, 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; @@ -487,29 +455,6 @@ ulong my_strntoul_8bit(CHARSET_INFO *cs, else negative = 0; -#ifdef NOT_USED - if (base == 16 && s[0] == '0' && (s[1]=='X' || s[1]=='x')) - s += 2; -#endif - -#ifdef NOT_USED - if (base == 0) - { - if (*s == '0') - { - if (s[1]=='X' || s[1]=='x') - { - s += 2; - base = 16; - } - else - base = 8; - } - else - base = 10; - } -#endif - save = s; cutoff = ((uint32)~0L) / (uint32) base; cutlim = (uint) (((uint32)~0L) % (uint32) base); @@ -572,10 +517,6 @@ longlong my_strntoll_8bit(CHARSET_INFO *cs __attribute__((unused)), 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; @@ -600,29 +541,6 @@ longlong my_strntoll_8bit(CHARSET_INFO *cs __attribute__((unused)), else negative = 0; -#ifdef NOT_USED - if (base == 16 && s[0] == '0' && (s[1]=='X'|| s[1]=='x')) - s += 2; -#endif - -#ifdef NOT_USED - if (base == 0) - { - if (*s == '0') - { - if (s[1]=='X' || s[1]=='x') - { - s += 2; - base = 16; - } - else - base = 8; - } - else - base = 10; - } -#endif - save = s; cutoff = (~(ulonglong) 0) / (unsigned long int) base; @@ -695,10 +613,6 @@ ulonglong my_strntoull_8bit(CHARSET_INFO *cs, 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; @@ -723,29 +637,6 @@ ulonglong my_strntoull_8bit(CHARSET_INFO *cs, else negative = 0; -#ifdef NOT_USED - if (base == 16 && s[0] == '0' && (s[1]=='X' || s[1]=='x')) - s += 2; -#endif - -#ifdef NOT_USED - if (base == 0) - { - if (*s == '0') - { - if (s[1]=='X' || s[1]=='x') - { - s += 2; - base = 16; - } - else - base = 8; - } - else - base = 10; - } -#endif - save = s; cutoff = (~(ulonglong) 0) / (unsigned long int) base; @@ -1165,9 +1056,8 @@ size_t my_well_formed_len_8bit(CHARSET_INFO *cs __attribute__((unused)), size_t my_lengthsp_8bit(CHARSET_INFO *cs __attribute__((unused)), const char *ptr, size_t length) { - const char *end= ptr+length; - while (end > ptr && end[-1] == ' ') - end--; + const char *end; + end= (const char *) skip_trailing_space((const uchar *)ptr, length); return (size_t) (end-ptr); } @@ -1387,19 +1277,6 @@ int my_mb_ctype_8bit(CHARSET_INFO *cs, int *ctype, } -#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 diff --git a/dep/mysqllite/strings/ctype-sjis.c b/dep/mysqllite/strings/ctype-sjis.c deleted file mode 100644 index 3f479ffc1027e..0000000000000 --- a/dep/mysqllite/strings/ctype-sjis.c +++ /dev/null @@ -1,4657 +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 */ - -/* 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; -} - - - -static size_t my_strnxfrm_sjis(CHARSET_INFO *cs __attribute__((unused)), - uchar *dest, size_t len, - const uchar *src, size_t srclen) -{ - uchar *d_end = dest + len; - uchar *s_end = (uchar*) src + srclen; - while (dest < d_end && src < s_end) - { - if (ismbchar_sjis(cs,(char*) src, (char*) s_end)) - { - *dest++ = *src++; - if (dest < d_end && src < s_end) - *dest++ = *src++; - } - else - *dest++ = sort_order_sjis[(uchar)*src++]; - } - if (len > srclen) - bfill(dest, len - srclen, ' '); - return len; -} - - -/* 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_sjis, - my_strnxfrmlen_simple, - my_like_range_mb, - 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_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_sjis_japanese_ci= -{ - 13,0,0, /* number */ - MY_CS_COMPILED|MY_CS_PRIMARY|MY_CS_STRNXFRM, /* 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 */ - 0xFCFC, /* max_sort_char */ - ' ', /* pad char */ - 1, /* escape_with_backslash_is_dangerous */ - &my_charset_handler, - &my_collation_ci_handler -}; - -CHARSET_INFO my_charset_sjis_bin= -{ - 88,0,0, /* number */ - MY_CS_COMPILED|MY_CS_BINSORT, /* 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 */ - 0xFCFC, /* max_sort_char */ - ' ', /* pad char */ - 1, /* escape_with_backslash_is_dangerous */ - &my_charset_handler, - &my_collation_mb_bin_handler -}; - -#endif diff --git a/dep/mysqllite/strings/ctype-tis620.c b/dep/mysqllite/strings/ctype-tis620.c index a8c05dc4fd0ff..14b661ab0fc6f 100644 --- a/dep/mysqllite/strings/ctype-tis620.c +++ b/dep/mysqllite/strings/ctype-tis620.c @@ -323,7 +323,7 @@ static int t_ctype[][TOT_LEVELS] = { /*0xFF*/ { 255 /*IGNORE*/, IGNORE, IGNORE, IGNORE, X }, }; -static uchar NEAR ctype_tis620[257] = +static uchar ctype_tis620[257] = { 0, /* For standard library */ 32,32,32,32,32,32,32,32,32,40,40,40,40,40,32,32, @@ -344,7 +344,7 @@ static uchar NEAR ctype_tis620[257] = 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, }; -static uchar NEAR to_lower_tis620[]= +static uchar to_lower_tis620[]= { '\000','\001','\002','\003','\004','\005','\006','\007', '\010','\011','\012','\013','\014','\015','\016','\017', @@ -380,7 +380,7 @@ static uchar NEAR to_lower_tis620[]= (uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377', }; -static uchar NEAR to_upper_tis620[]= +static uchar to_upper_tis620[]= { '\000','\001','\002','\003','\004','\005','\006','\007', '\010','\011','\012','\013','\014','\015','\016','\017', @@ -416,7 +416,7 @@ static uchar NEAR to_upper_tis620[]= (uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377', }; -static uchar NEAR sort_order_tis620[]= +static uchar sort_order_tis620[]= { '\000','\001','\002','\003','\004','\005','\006','\007', '\010','\011','\012','\013','\014','\015','\016','\017', diff --git a/dep/mysqllite/strings/ctype-uca.c b/dep/mysqllite/strings/ctype-uca.c index 6ae0cc3a293dd..2f7bf030d9034 100644 --- a/dep/mysqllite/strings/ctype-uca.c +++ b/dep/mysqllite/strings/ctype-uca.c @@ -6712,6 +6712,34 @@ 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: @@ -6955,9 +6983,18 @@ static int my_uca_scanner_next_any(my_uca_scanner *scanner) scanner->send)) <= 0)) return -1; - scanner->page= wc >> 8; - scanner->code= wc & 0xFF; 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)) @@ -7633,6 +7670,13 @@ static my_coll_lexem_num my_coll_lexem_next(MY_COLL_LEXEM *lexem) goto ex; } + if (beg[0] == '=') + { + beg++; + rc= MY_COLL_LEXEM_DIFF; + goto ex; + } + if (beg[0] == '<') { for (beg++, lexem->diff= 1; @@ -7793,6 +7837,10 @@ static int my_coll_rule_parse(MY_COLL_RULE *rule, size_t mitems, 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"); @@ -8079,7 +8127,7 @@ MY_COLLATION_HANDLER my_collation_ucs2_uca_handler = my_strnncollsp_ucs2_uca, my_strnxfrm_ucs2_uca, my_strnxfrmlen_simple, - my_like_range_ucs2, + my_like_range_generic, my_wildcmp_uca, NULL, my_instr_mb, @@ -8090,7 +8138,7 @@ MY_COLLATION_HANDLER my_collation_ucs2_uca_handler = CHARSET_INFO my_charset_ucs2_unicode_ci= { 128,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, "ucs2", /* cs name */ "ucs2_unicode_ci", /* name */ "", /* comment */ @@ -8122,7 +8170,7 @@ CHARSET_INFO my_charset_ucs2_unicode_ci= CHARSET_INFO my_charset_ucs2_icelandic_uca_ci= { 129,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, "ucs2", /* cs name */ "ucs2_icelandic_ci",/* name */ "", /* comment */ @@ -8154,7 +8202,7 @@ CHARSET_INFO my_charset_ucs2_icelandic_uca_ci= CHARSET_INFO my_charset_ucs2_latvian_uca_ci= { 130,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, "ucs2", /* cs name */ "ucs2_latvian_ci", /* name */ "", /* comment */ @@ -8186,7 +8234,7 @@ CHARSET_INFO my_charset_ucs2_latvian_uca_ci= CHARSET_INFO my_charset_ucs2_romanian_uca_ci= { 131,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, "ucs2", /* cs name */ "ucs2_romanian_ci", /* name */ "", /* comment */ @@ -8218,7 +8266,7 @@ CHARSET_INFO my_charset_ucs2_romanian_uca_ci= CHARSET_INFO my_charset_ucs2_slovenian_uca_ci= { 132,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, "ucs2", /* cs name */ "ucs2_slovenian_ci",/* name */ "", /* comment */ @@ -8250,7 +8298,7 @@ CHARSET_INFO my_charset_ucs2_slovenian_uca_ci= CHARSET_INFO my_charset_ucs2_polish_uca_ci= { 133,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, "ucs2", /* cs name */ "ucs2_polish_ci", /* name */ "", /* comment */ @@ -8282,7 +8330,7 @@ CHARSET_INFO my_charset_ucs2_polish_uca_ci= CHARSET_INFO my_charset_ucs2_estonian_uca_ci= { 134,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, "ucs2", /* cs name */ "ucs2_estonian_ci", /* name */ "", /* comment */ @@ -8314,7 +8362,7 @@ CHARSET_INFO my_charset_ucs2_estonian_uca_ci= CHARSET_INFO my_charset_ucs2_spanish_uca_ci= { 135,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, "ucs2", /* cs name */ "ucs2_spanish_ci", /* name */ "", /* comment */ @@ -8346,7 +8394,7 @@ CHARSET_INFO my_charset_ucs2_spanish_uca_ci= CHARSET_INFO my_charset_ucs2_swedish_uca_ci= { 136,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, "ucs2", /* cs name */ "ucs2_swedish_ci", /* name */ "", /* comment */ @@ -8378,7 +8426,7 @@ CHARSET_INFO my_charset_ucs2_swedish_uca_ci= CHARSET_INFO my_charset_ucs2_turkish_uca_ci= { 137,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, "ucs2", /* cs name */ "ucs2_turkish_ci", /* name */ "", /* comment */ @@ -8410,7 +8458,7 @@ CHARSET_INFO my_charset_ucs2_turkish_uca_ci= CHARSET_INFO my_charset_ucs2_czech_uca_ci= { 138,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, "ucs2", /* cs name */ "ucs2_czech_ci", /* name */ "", /* comment */ @@ -8443,7 +8491,7 @@ CHARSET_INFO my_charset_ucs2_czech_uca_ci= CHARSET_INFO my_charset_ucs2_danish_uca_ci= { 139,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, "ucs2", /* cs name */ "ucs2_danish_ci", /* name */ "", /* comment */ @@ -8475,7 +8523,7 @@ CHARSET_INFO my_charset_ucs2_danish_uca_ci= CHARSET_INFO my_charset_ucs2_lithuanian_uca_ci= { 140,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, "ucs2", /* cs name */ "ucs2_lithuanian_ci",/* name */ "", /* comment */ @@ -8507,7 +8555,7 @@ CHARSET_INFO my_charset_ucs2_lithuanian_uca_ci= CHARSET_INFO my_charset_ucs2_slovak_uca_ci= { 141,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, "ucs2", /* cs name */ "ucs2_slovak_ci", /* name */ "", /* comment */ @@ -8539,7 +8587,7 @@ CHARSET_INFO my_charset_ucs2_slovak_uca_ci= CHARSET_INFO my_charset_ucs2_spanish2_uca_ci= { 142,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, "ucs2", /* cs name */ "ucs2_spanish2_ci", /* name */ "", /* comment */ @@ -8572,7 +8620,7 @@ CHARSET_INFO my_charset_ucs2_spanish2_uca_ci= CHARSET_INFO my_charset_ucs2_roman_uca_ci= { 143,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, "ucs2", /* cs name */ "ucs2_roman_ci", /* name */ "", /* comment */ @@ -8605,7 +8653,7 @@ CHARSET_INFO my_charset_ucs2_roman_uca_ci= CHARSET_INFO my_charset_ucs2_persian_uca_ci= { 144,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, "ucs2", /* cs name */ "ucs2_persian_ci", /* name */ "", /* comment */ @@ -8638,7 +8686,7 @@ CHARSET_INFO my_charset_ucs2_persian_uca_ci= CHARSET_INFO my_charset_ucs2_esperanto_uca_ci= { 145,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, "ucs2", /* cs name */ "ucs2_esperanto_ci",/* name */ "", /* comment */ @@ -8671,7 +8719,7 @@ CHARSET_INFO my_charset_ucs2_esperanto_uca_ci= CHARSET_INFO my_charset_ucs2_hungarian_uca_ci= { 146,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, "ucs2", /* cs name */ "ucs2_hungarian_ci",/* name */ "", /* comment */ @@ -8701,6 +8749,39 @@ CHARSET_INFO my_charset_ucs2_hungarian_uca_ci= }; +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 */ + &my_charset_ucs2_handler, + &my_collation_ucs2_uca_handler +}; + + #endif @@ -8751,7 +8832,7 @@ extern MY_CHARSET_HANDLER my_charset_utf8_handler; CHARSET_INFO my_charset_utf8_unicode_ci= { 192,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, "utf8", /* cs name */ "utf8_unicode_ci", /* name */ "", /* comment */ @@ -8784,7 +8865,7 @@ CHARSET_INFO my_charset_utf8_unicode_ci= CHARSET_INFO my_charset_utf8_icelandic_uca_ci= { 193,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, "utf8", /* cs name */ "utf8_icelandic_ci",/* name */ "", /* comment */ @@ -8816,7 +8897,7 @@ CHARSET_INFO my_charset_utf8_icelandic_uca_ci= CHARSET_INFO my_charset_utf8_latvian_uca_ci= { 194,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, "utf8", /* cs name */ "utf8_latvian_ci", /* name */ "", /* comment */ @@ -8848,7 +8929,7 @@ CHARSET_INFO my_charset_utf8_latvian_uca_ci= CHARSET_INFO my_charset_utf8_romanian_uca_ci= { 195,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, "utf8", /* cs name */ "utf8_romanian_ci", /* name */ "", /* comment */ @@ -8880,7 +8961,7 @@ CHARSET_INFO my_charset_utf8_romanian_uca_ci= CHARSET_INFO my_charset_utf8_slovenian_uca_ci= { 196,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, "utf8", /* cs name */ "utf8_slovenian_ci",/* name */ "", /* comment */ @@ -8912,7 +8993,7 @@ CHARSET_INFO my_charset_utf8_slovenian_uca_ci= CHARSET_INFO my_charset_utf8_polish_uca_ci= { 197,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, "utf8", /* cs name */ "utf8_polish_ci", /* name */ "", /* comment */ @@ -8944,7 +9025,7 @@ CHARSET_INFO my_charset_utf8_polish_uca_ci= CHARSET_INFO my_charset_utf8_estonian_uca_ci= { 198,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, "utf8", /* cs name */ "utf8_estonian_ci", /* name */ "", /* comment */ @@ -8976,7 +9057,7 @@ CHARSET_INFO my_charset_utf8_estonian_uca_ci= CHARSET_INFO my_charset_utf8_spanish_uca_ci= { 199,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, "utf8", /* cs name */ "utf8_spanish_ci", /* name */ "", /* comment */ @@ -9008,7 +9089,7 @@ CHARSET_INFO my_charset_utf8_spanish_uca_ci= CHARSET_INFO my_charset_utf8_swedish_uca_ci= { 200,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, "utf8", /* cs name */ "utf8_swedish_ci", /* name */ "", /* comment */ @@ -9040,7 +9121,7 @@ CHARSET_INFO my_charset_utf8_swedish_uca_ci= CHARSET_INFO my_charset_utf8_turkish_uca_ci= { 201,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, "utf8", /* cs name */ "utf8_turkish_ci", /* name */ "", /* comment */ @@ -9072,7 +9153,7 @@ CHARSET_INFO my_charset_utf8_turkish_uca_ci= CHARSET_INFO my_charset_utf8_czech_uca_ci= { 202,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, "utf8", /* cs name */ "utf8_czech_ci", /* name */ "", /* comment */ @@ -9105,7 +9186,7 @@ CHARSET_INFO my_charset_utf8_czech_uca_ci= CHARSET_INFO my_charset_utf8_danish_uca_ci= { 203,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, "utf8", /* cs name */ "utf8_danish_ci", /* name */ "", /* comment */ @@ -9137,7 +9218,7 @@ CHARSET_INFO my_charset_utf8_danish_uca_ci= CHARSET_INFO my_charset_utf8_lithuanian_uca_ci= { 204,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, "utf8", /* cs name */ "utf8_lithuanian_ci",/* name */ "", /* comment */ @@ -9169,7 +9250,7 @@ CHARSET_INFO my_charset_utf8_lithuanian_uca_ci= CHARSET_INFO my_charset_utf8_slovak_uca_ci= { 205,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, "utf8", /* cs name */ "utf8_slovak_ci", /* name */ "", /* comment */ @@ -9201,7 +9282,7 @@ CHARSET_INFO my_charset_utf8_slovak_uca_ci= CHARSET_INFO my_charset_utf8_spanish2_uca_ci= { 206,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, "utf8", /* cs name */ "utf8_spanish2_ci", /* name */ "", /* comment */ @@ -9233,7 +9314,7 @@ CHARSET_INFO my_charset_utf8_spanish2_uca_ci= CHARSET_INFO my_charset_utf8_roman_uca_ci= { 207,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, "utf8", /* cs name */ "utf8_roman_ci", /* name */ "", /* comment */ @@ -9265,7 +9346,7 @@ CHARSET_INFO my_charset_utf8_roman_uca_ci= CHARSET_INFO my_charset_utf8_persian_uca_ci= { 208,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, "utf8", /* cs name */ "utf8_persian_ci", /* name */ "", /* comment */ @@ -9297,7 +9378,7 @@ CHARSET_INFO my_charset_utf8_persian_uca_ci= CHARSET_INFO my_charset_utf8_esperanto_uca_ci= { 209,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, "utf8", /* cs name */ "utf8_esperanto_ci",/* name */ "", /* comment */ @@ -9329,7 +9410,7 @@ CHARSET_INFO my_charset_utf8_esperanto_uca_ci= CHARSET_INFO my_charset_utf8_hungarian_uca_ci= { 210,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, "utf8", /* cs name */ "utf8_hungarian_ci",/* name */ "", /* comment */ @@ -9358,6 +9439,2024 @@ CHARSET_INFO my_charset_utf8_hungarian_uca_ci= &my_collation_any_uca_handler }; +CHARSET_INFO my_charset_utf8_sinhala_uca_ci= +{ + 211,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + "utf8", /* cs name */ + "utf8_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 */ + 3, /* mbmaxlen */ + 9, /* min_sort_char */ + 0xFFFF, /* max_sort_char */ + ' ', /* pad char */ + 0, /* escape_with_backslash_is_dangerous */ + &my_charset_utf8_handler, + &my_collation_any_uca_handler +}; + #endif /* HAVE_CHARSET_utf8 */ + +#ifdef HAVE_CHARSET_utf8mb4 + +extern MY_CHARSET_HANDLER my_charset_utf8mb4_handler; + +#define MY_CS_UTF8MB4_UCA_FLAGS (MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_UNICODE_SUPPLEMENT) + +CHARSET_INFO my_charset_utf8mb4_unicode_ci= +{ + 224,0,0, /* number */ + MY_CS_UTF8MB4_UCA_FLAGS,/* state */ + 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 */ + &my_charset_utf8mb4_handler, + &my_collation_any_uca_handler +}; + + +CHARSET_INFO my_charset_utf8mb4_icelandic_uca_ci= +{ + 225,0,0, /* number */ + MY_CS_UTF8MB4_UCA_FLAGS,/* state */ + 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 */ + &my_charset_utf8mb4_handler, + &my_collation_any_uca_handler +}; + +CHARSET_INFO my_charset_utf8mb4_latvian_uca_ci= +{ + 226,0,0, /* number */ + MY_CS_UTF8MB4_UCA_FLAGS,/* state */ + 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 */ + &my_charset_utf8mb4_handler, + &my_collation_any_uca_handler +}; + +CHARSET_INFO my_charset_utf8mb4_romanian_uca_ci= +{ + 227,0,0, /* number */ + MY_CS_UTF8MB4_UCA_FLAGS,/* state */ + 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 */ + &my_charset_utf8mb4_handler, + &my_collation_any_uca_handler +}; + +CHARSET_INFO my_charset_utf8mb4_slovenian_uca_ci= +{ + 228,0,0, /* number */ + MY_CS_UTF8MB4_UCA_FLAGS,/* state */ + 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 */ + &my_charset_utf8mb4_handler, + &my_collation_any_uca_handler +}; + +CHARSET_INFO my_charset_utf8mb4_polish_uca_ci= +{ + 229,0,0, /* number */ + MY_CS_UTF8MB4_UCA_FLAGS,/* state */ + 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 */ + &my_charset_utf8mb4_handler, + &my_collation_any_uca_handler +}; + +CHARSET_INFO my_charset_utf8mb4_estonian_uca_ci= +{ + 230,0,0, /* number */ + MY_CS_UTF8MB4_UCA_FLAGS,/* state */ + 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 */ + &my_charset_utf8mb4_handler, + &my_collation_any_uca_handler +}; + +CHARSET_INFO my_charset_utf8mb4_spanish_uca_ci= +{ + 231,0,0, /* number */ + MY_CS_UTF8MB4_UCA_FLAGS,/* state */ + 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 */ + &my_charset_utf8mb4_handler, + &my_collation_any_uca_handler +}; + +CHARSET_INFO my_charset_utf8mb4_swedish_uca_ci= +{ + 232,0,0, /* number */ + MY_CS_UTF8MB4_UCA_FLAGS,/* state */ + 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 */ + &my_charset_utf8mb4_handler, + &my_collation_any_uca_handler +}; + +CHARSET_INFO my_charset_utf8mb4_turkish_uca_ci= +{ + 233,0,0, /* number */ + MY_CS_UTF8MB4_UCA_FLAGS,/* state */ + 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 */ + &my_charset_utf8mb4_handler, + &my_collation_any_uca_handler +}; + +CHARSET_INFO my_charset_utf8mb4_czech_uca_ci= +{ + 234,0,0, /* number */ + MY_CS_UTF8MB4_UCA_FLAGS,/* state */ + 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 */ + &my_charset_utf8mb4_handler, + &my_collation_any_uca_handler +}; + + +CHARSET_INFO my_charset_utf8mb4_danish_uca_ci= +{ + 235,0,0, /* number */ + MY_CS_UTF8MB4_UCA_FLAGS,/* state */ + 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 */ + &my_charset_utf8mb4_handler, + &my_collation_any_uca_handler +}; + +CHARSET_INFO my_charset_utf8mb4_lithuanian_uca_ci= +{ + 236,0,0, /* number */ + MY_CS_UTF8MB4_UCA_FLAGS,/* state */ + 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 */ + &my_charset_utf8mb4_handler, + &my_collation_any_uca_handler +}; + +CHARSET_INFO my_charset_utf8mb4_slovak_uca_ci= +{ + 237,0,0, /* number */ + MY_CS_UTF8MB4_UCA_FLAGS,/* state */ + 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 */ + &my_charset_utf8mb4_handler, + &my_collation_any_uca_handler +}; + +CHARSET_INFO my_charset_utf8mb4_spanish2_uca_ci= +{ + 238,0,0, /* number */ + MY_CS_UTF8MB4_UCA_FLAGS,/* state */ + 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 */ + &my_charset_utf8mb4_handler, + &my_collation_any_uca_handler +}; + +CHARSET_INFO my_charset_utf8mb4_roman_uca_ci= +{ + 239,0,0, /* number */ + MY_CS_UTF8MB4_UCA_FLAGS,/* state */ + 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 */ + &my_charset_utf8mb4_handler, + &my_collation_any_uca_handler +}; + +CHARSET_INFO my_charset_utf8mb4_persian_uca_ci= +{ + 240,0,0, /* number */ + MY_CS_UTF8MB4_UCA_FLAGS,/* state */ + 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 */ + &my_charset_utf8mb4_handler, + &my_collation_any_uca_handler +}; + +CHARSET_INFO my_charset_utf8mb4_esperanto_uca_ci= +{ + 241,0,0, /* number */ + MY_CS_UTF8MB4_UCA_FLAGS,/* state */ + 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 */ + &my_charset_utf8mb4_handler, + &my_collation_any_uca_handler +}; + +CHARSET_INFO my_charset_utf8mb4_hungarian_uca_ci= +{ + 242,0,0, /* number */ + MY_CS_UTF8MB4_UCA_FLAGS,/* state */ + 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 */ + &my_charset_utf8mb4_handler, + &my_collation_any_uca_handler +}; + +CHARSET_INFO my_charset_utf8mb4_sinhala_uca_ci= +{ + 243,0,0, /* number */ + MY_CS_UTF8MB4_UCA_FLAGS,/* state */ + 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 */ + &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_generic, + my_wildcmp_uca, + NULL, + my_instr_mb, + my_hash_sort_any_uca, + my_propagate_complex +}; + +extern MY_CHARSET_HANDLER my_charset_utf32_handler; + +#define MY_CS_UTF32_UCA_FLAGS (MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII) + +CHARSET_INFO my_charset_utf32_unicode_ci= +{ + 160,0,0, /* number */ + MY_CS_UTF32_UCA_FLAGS,/* state */ + "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 */ + &my_charset_utf32_handler, + &my_collation_utf32_uca_handler +}; + + +CHARSET_INFO my_charset_utf32_icelandic_uca_ci= +{ + 161,0,0, /* number */ + MY_CS_UTF32_UCA_FLAGS,/* state */ + "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 */ + &my_charset_utf32_handler, + &my_collation_utf32_uca_handler +}; + +CHARSET_INFO my_charset_utf32_latvian_uca_ci= +{ + 162,0,0, /* number */ + MY_CS_UTF32_UCA_FLAGS,/* state */ + "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 */ + &my_charset_utf32_handler, + &my_collation_utf32_uca_handler +}; + +CHARSET_INFO my_charset_utf32_romanian_uca_ci= +{ + 163,0,0, /* number */ + MY_CS_UTF32_UCA_FLAGS,/* state */ + "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 */ + &my_charset_utf32_handler, + &my_collation_utf32_uca_handler +}; + +CHARSET_INFO my_charset_utf32_slovenian_uca_ci= +{ + 164,0,0, /* number */ + MY_CS_UTF32_UCA_FLAGS,/* state */ + "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 */ + &my_charset_utf32_handler, + &my_collation_utf32_uca_handler +}; + +CHARSET_INFO my_charset_utf32_polish_uca_ci= +{ + 165,0,0, /* number */ + MY_CS_UTF32_UCA_FLAGS,/* state */ + "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 */ + &my_charset_utf32_handler, + &my_collation_utf32_uca_handler +}; + +CHARSET_INFO my_charset_utf32_estonian_uca_ci= +{ + 166,0,0, /* number */ + MY_CS_UTF32_UCA_FLAGS,/* state */ + "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 */ + &my_charset_utf32_handler, + &my_collation_utf32_uca_handler +}; + +CHARSET_INFO my_charset_utf32_spanish_uca_ci= +{ + 167,0,0, /* number */ + MY_CS_UTF32_UCA_FLAGS,/* state */ + "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 */ + &my_charset_utf32_handler, + &my_collation_utf32_uca_handler +}; + +CHARSET_INFO my_charset_utf32_swedish_uca_ci= +{ + 168,0,0, /* number */ + MY_CS_UTF32_UCA_FLAGS,/* state */ + "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 */ + &my_charset_utf32_handler, + &my_collation_utf32_uca_handler +}; + +CHARSET_INFO my_charset_utf32_turkish_uca_ci= +{ + 169,0,0, /* number */ + MY_CS_UTF32_UCA_FLAGS,/* state */ + "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 */ + &my_charset_utf32_handler, + &my_collation_utf32_uca_handler +}; + +CHARSET_INFO my_charset_utf32_czech_uca_ci= +{ + 170,0,0, /* number */ + MY_CS_UTF32_UCA_FLAGS,/* state */ + "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 */ + &my_charset_utf32_handler, + &my_collation_utf32_uca_handler +}; + + +CHARSET_INFO my_charset_utf32_danish_uca_ci= +{ + 171,0,0, /* number */ + MY_CS_UTF32_UCA_FLAGS,/* state */ + "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 */ + &my_charset_utf32_handler, + &my_collation_utf32_uca_handler +}; + +CHARSET_INFO my_charset_utf32_lithuanian_uca_ci= +{ + 172,0,0, /* number */ + MY_CS_UTF32_UCA_FLAGS,/* state */ + "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 */ + &my_charset_utf32_handler, + &my_collation_utf32_uca_handler +}; + +CHARSET_INFO my_charset_utf32_slovak_uca_ci= +{ + 173,0,0, /* number */ + MY_CS_UTF32_UCA_FLAGS,/* state */ + "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 */ + &my_charset_utf32_handler, + &my_collation_utf32_uca_handler +}; + +CHARSET_INFO my_charset_utf32_spanish2_uca_ci= +{ + 174,0,0, /* number */ + MY_CS_UTF32_UCA_FLAGS,/* state */ + "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 */ + &my_charset_utf32_handler, + &my_collation_utf32_uca_handler +}; + +CHARSET_INFO my_charset_utf32_roman_uca_ci= +{ + 175,0,0, /* number */ + MY_CS_UTF32_UCA_FLAGS,/* state */ + "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 */ + &my_charset_utf32_handler, + &my_collation_utf32_uca_handler +}; + +CHARSET_INFO my_charset_utf32_persian_uca_ci= +{ + 176,0,0, /* number */ + MY_CS_UTF32_UCA_FLAGS,/* state */ + "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 */ + &my_charset_utf32_handler, + &my_collation_utf32_uca_handler +}; + +CHARSET_INFO my_charset_utf32_esperanto_uca_ci= +{ + 177,0,0, /* number */ + MY_CS_UTF32_UCA_FLAGS,/* state */ + "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 */ + &my_charset_utf32_handler, + &my_collation_utf32_uca_handler +}; + +CHARSET_INFO my_charset_utf32_hungarian_uca_ci= +{ + 178,0,0, /* number */ + MY_CS_UTF32_UCA_FLAGS,/* state */ + "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 */ + &my_charset_utf32_handler, + &my_collation_utf32_uca_handler +}; + +CHARSET_INFO my_charset_utf32_sinhala_uca_ci= +{ + 179,0,0, /* number */ + MY_CS_UTF32_UCA_FLAGS,/* state */ + "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 */ + &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_generic, + my_wildcmp_uca, + NULL, + my_instr_mb, + my_hash_sort_any_uca, + my_propagate_complex +}; + +extern MY_CHARSET_HANDLER my_charset_utf16_handler; + +#define MY_CS_UTF16_UCA_FLAGS (MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII) + +CHARSET_INFO my_charset_utf16_unicode_ci= +{ + 101,0,0, /* number */ + MY_CS_UTF16_UCA_FLAGS,/* state */ + "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 */ + &my_charset_utf16_handler, + &my_collation_utf16_uca_handler +}; + + +CHARSET_INFO my_charset_utf16_icelandic_uca_ci= +{ + 102,0,0, /* number */ + MY_CS_UTF16_UCA_FLAGS,/* state */ + "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 */ + &my_charset_utf16_handler, + &my_collation_utf16_uca_handler +}; + +CHARSET_INFO my_charset_utf16_latvian_uca_ci= +{ + 103,0,0, /* number */ + MY_CS_UTF16_UCA_FLAGS,/* state */ + "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 */ + &my_charset_utf16_handler, + &my_collation_utf16_uca_handler +}; + +CHARSET_INFO my_charset_utf16_romanian_uca_ci= +{ + 104,0,0, /* number */ + MY_CS_UTF16_UCA_FLAGS,/* state */ + "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 */ + &my_charset_utf16_handler, + &my_collation_utf16_uca_handler +}; + +CHARSET_INFO my_charset_utf16_slovenian_uca_ci= +{ + 105,0,0, /* number */ + MY_CS_UTF16_UCA_FLAGS,/* state */ + "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 */ + &my_charset_utf16_handler, + &my_collation_utf16_uca_handler +}; + +CHARSET_INFO my_charset_utf16_polish_uca_ci= +{ + 106,0,0, /* number */ + MY_CS_UTF16_UCA_FLAGS,/* state */ + "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 */ + &my_charset_utf16_handler, + &my_collation_utf16_uca_handler +}; + +CHARSET_INFO my_charset_utf16_estonian_uca_ci= +{ + 107,0,0, /* number */ + MY_CS_UTF16_UCA_FLAGS,/* state */ + "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 */ + &my_charset_utf16_handler, + &my_collation_utf16_uca_handler +}; + +CHARSET_INFO my_charset_utf16_spanish_uca_ci= +{ + 108,0,0, /* number */ + MY_CS_UTF16_UCA_FLAGS,/* state */ + "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 */ + &my_charset_utf16_handler, + &my_collation_utf16_uca_handler +}; + +CHARSET_INFO my_charset_utf16_swedish_uca_ci= +{ + 109,0,0, /* number */ + MY_CS_UTF16_UCA_FLAGS,/* state */ + "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 */ + &my_charset_utf16_handler, + &my_collation_utf16_uca_handler +}; + +CHARSET_INFO my_charset_utf16_turkish_uca_ci= +{ + 110,0,0, /* number */ + MY_CS_UTF16_UCA_FLAGS,/* state */ + "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 */ + &my_charset_utf16_handler, + &my_collation_utf16_uca_handler +}; + +CHARSET_INFO my_charset_utf16_czech_uca_ci= +{ + 111,0,0, /* number */ + MY_CS_UTF16_UCA_FLAGS,/* state */ + "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 */ + &my_charset_utf16_handler, + &my_collation_utf16_uca_handler +}; + + +CHARSET_INFO my_charset_utf16_danish_uca_ci= +{ + 112,0,0, /* number */ + MY_CS_UTF16_UCA_FLAGS,/* state */ + "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 */ + &my_charset_utf16_handler, + &my_collation_utf16_uca_handler +}; + +CHARSET_INFO my_charset_utf16_lithuanian_uca_ci= +{ + 113,0,0, /* number */ + MY_CS_UTF16_UCA_FLAGS,/* state */ + "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 */ + &my_charset_utf16_handler, + &my_collation_utf16_uca_handler +}; + +CHARSET_INFO my_charset_utf16_slovak_uca_ci= +{ + 114,0,0, /* number */ + MY_CS_UTF16_UCA_FLAGS,/* state */ + "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 */ + &my_charset_utf16_handler, + &my_collation_utf16_uca_handler +}; + +CHARSET_INFO my_charset_utf16_spanish2_uca_ci= +{ + 115,0,0, /* number */ + MY_CS_UTF16_UCA_FLAGS,/* state */ + "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 */ + &my_charset_utf16_handler, + &my_collation_utf16_uca_handler +}; + +CHARSET_INFO my_charset_utf16_roman_uca_ci= +{ + 116,0,0, /* number */ + MY_CS_UTF16_UCA_FLAGS,/* state */ + "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 */ + &my_charset_utf16_handler, + &my_collation_utf16_uca_handler +}; + +CHARSET_INFO my_charset_utf16_persian_uca_ci= +{ + 117,0,0, /* number */ + MY_CS_UTF16_UCA_FLAGS,/* state */ + "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 */ + &my_charset_utf16_handler, + &my_collation_utf16_uca_handler +}; + +CHARSET_INFO my_charset_utf16_esperanto_uca_ci= +{ + 118,0,0, /* number */ + MY_CS_UTF16_UCA_FLAGS,/* state */ + "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 */ + &my_charset_utf16_handler, + &my_collation_utf16_uca_handler +}; + +CHARSET_INFO my_charset_utf16_hungarian_uca_ci= +{ + 119,0,0, /* number */ + MY_CS_UTF16_UCA_FLAGS,/* state */ + "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 */ + &my_charset_utf16_handler, + &my_collation_utf16_uca_handler +}; + +CHARSET_INFO my_charset_utf16_sinhala_uca_ci= +{ + 120,0,0, /* number */ + MY_CS_UTF16_UCA_FLAGS,/* state */ + "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 */ + &my_charset_utf16_handler, + &my_collation_utf16_uca_handler +}; + +#endif /* HAVE_CHARSET_utf16 */ + + + #endif /* HAVE_UCA_COLLATIONS */ diff --git a/dep/mysqllite/strings/ctype-ucs2.c b/dep/mysqllite/strings/ctype-ucs2.c index 865a19b082891..67be793c3dc25 100644 --- a/dep/mysqllite/strings/ctype-ucs2.c +++ b/dep/mysqllite/strings/ctype-ucs2.c @@ -25,479 +25,190 @@ #include -#ifdef HAVE_CHARSET_ucs2 - -#ifndef EILSEQ -#define EILSEQ ENOENT +#if defined(HAVE_CHARSET_utf16) || defined(HAVE_CHARSET_ucs2) +#define HAVE_CHARSET_mb2 #endif -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 -}; +#if defined(HAVE_CHARSET_mb2) || defined(HAVE_CHARSET_utf32) +#define HAVE_CHARSET_mb2_or_mb4 +#endif -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; -} +#ifndef EILSEQ +#define EILSEQ ENOENT +#endif -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; -} +#undef ULONGLONG_MAX +#define ULONGLONG_MAX (~(ulonglong) 0) +#define MAX_NEGATIVE_NUMBER ((ulonglong) LL(0x8000000000000000)) +#define INIT_CNT 9 +#define LFACTOR ULL(1000000000) +#define LFACTOR1 ULL(10000000000) +#define LFACTOR2 ULL(100000000000) +static unsigned long lfactor[9]= +{ 1L, 10L, 100L, 1000L, 10000L, 100000L, 1000000L, 10000000L, 100000000L }; -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) +#ifdef HAVE_CHARSET_mb2_or_mb4 +static inline int +my_bincmp(const uchar *s, const uchar *se, + const uchar *t, const uchar *te) { - 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; - } + 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_ucs2(CHARSET_INFO * cs __attribute__((unused)), - char * s __attribute__((unused))) +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_ucs2(CHARSET_INFO *cs, char *src, size_t srclen, - char *dst __attribute__((unused)), - size_t dstlen __attribute__((unused))) +static size_t +my_casedn_str_mb2_or_mb4(CHARSET_INFO *cs __attribute__((unused)), + char * s __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; + DBUG_ASSERT(0); + return 0; } -static size_t my_casedn_str_ucs2(CHARSET_INFO *cs __attribute__((unused)), - char * s __attribute__((unused))) +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 int my_strnncoll_ucs2(CHARSET_INFO *cs, - const uchar *s, size_t slen, - const uchar *t, size_t tlen, - my_bool t_is_prefix) +static long +my_strntol_mb2_or_mb4(CHARSET_INFO *cs, + const char *nptr, size_t l, int base, + char **endptr, int *err) { - int s_res,t_res; - my_wc_t UNINIT_VAR(s_wc), UNINIT_VAR(t_wc); - const uchar *se=s+slen; - const uchar *te=t+tlen; - MY_UNICASE_INFO **uni_plane= cs->caseinfo; - - while ( s < se && t < te ) + 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 { - 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 ) + if ((cnv= cs->cset->mb_wc(cs, &wc, s, e))>0) { - /* Incorrect string, compare by char value */ - return ((int)s[0]-(int)t[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: + + 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; + } } - - 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 ) + else if (cnv == MY_CS_ILSEQ) { - return s_wc > t_wc ? 1 : -1; + if (endptr !=NULL ) + *endptr = (char*) s; + err[0]= EILSEQ; + return 0; + } + else + { + /* No more characters */ + break; } - - s+=s_res; - t+=t_res; + } while(1); + + if (endptr != NULL) + *endptr = (char *) s; + + if (s == save) + { + err[0]= EDOM; + return 0L; } - return (int) (t_is_prefix ? t-te : ((se-s) - (te-t))); + + 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); } -/* - Compare strings, discarding end space - SYNOPSIS - my_strnncollsp_ucs2() - cs character set handler - a First string to compare - a_length Length of 'a' - b Second string to compare - b_length Length of 'b' - - 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 -*/ - -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 int my_strncasecmp_ucs2(CHARSET_INFO *cs, - const char *s, const char *t, size_t len) -{ - int s_res,t_res; - my_wc_t UNINIT_VAR(s_wc), UNINIT_VAR(t_wc); - const char *se=s+len; - const char *te=t+len; - MY_UNICASE_INFO **uni_plane= cs->caseinfo; - - while ( s < se && t < te ) - { - int plane; - - s_res=my_ucs2_uni(cs,&s_wc, (const uchar*)s, (const uchar*)se); - t_res=my_ucs2_uni(cs,&t_wc, (const uchar*)t, (const uchar*)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].tolower : s_wc; - - plane=(t_wc>>8) & 0xFF; - t_wc = uni_plane[plane] ? uni_plane[plane][t_wc & 0xFF].tolower : t_wc; - - if ( s_wc != t_wc ) - return ((int) s_wc) - ((int) t_wc); - - s+=s_res; - t+=t_res; - } - return (int) ( (se-s) - (te-t) ); -} - - -static int my_strcasecmp_ucs2(CHARSET_INFO *cs, const char *s, const char *t) -{ - size_t s_len= strlen(s); - size_t t_len= strlen(t); - size_t len = (s_len > t_len) ? s_len : t_len; - return my_strncasecmp_ucs2(cs, s, t, len); -} - - -static size_t my_strnxfrm_ucs2(CHARSET_INFO *cs, - uchar *dst, size_t dstlen, const uchar *src, - size_t srclen) -{ - my_wc_t wc; - int res; - int plane; - uchar *de = dst + dstlen; - const uchar *se = src + srclen; - MY_UNICASE_INFO **uni_plane= cs->caseinfo; - - while( src < se && dst < de ) - { - if ((res=my_ucs2_uni(cs,&wc, src, se))<0) - { - break; - } - src+=res; - srclen-=res; - - plane=(wc>>8) & 0xFF; - wc = uni_plane[plane] ? uni_plane[plane][wc & 0xFF].sort : wc; - - if ((res=my_uni_ucs2(cs,wc,dst,de)) <0) - { - break; - } - dst+=res; - } - if (dst < de) - cs->cset->fill(cs, (char*) dst, (size_t) (de - dst), ' '); - return dstlen; -} - - -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 int my_vsnprintf_ucs2(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 */ - { - 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*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 */ - { - register 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_ucs2(CHARSET_INFO *cs __attribute__((unused)), - char* to, size_t n, const char* fmt, ...) -{ - va_list args; - va_start(args,fmt); - return my_vsnprintf_ucs2(to, n, fmt, args); -} - - -long my_strntol_ucs2(CHARSET_INFO *cs, - const char *nptr, size_t l, int base, - char **endptr, int *err) +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 negative= 0; int overflow; int cnv; my_wc_t wc; @@ -505,13 +216,13 @@ long my_strntol_ucs2(CHARSET_INFO *cs, register uint32 cutoff; register uint32 res; register const uchar *s= (const uchar*) nptr; - register const uchar *e= (const uchar*) nptr+l; + 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) + if ((cnv= cs->cset->mb_wc(cs, &wc, s, e)) > 0) { switch (wc) { @@ -525,53 +236,49 @@ long my_strntol_ucs2(CHARSET_INFO *cs, else /* No more characters or bad multibyte sequence */ { if (endptr !=NULL ) - *endptr = (char*)s; - err[0] = (cnv==MY_CS_ILSEQ) ? EILSEQ : EDOM; + *endptr= (char*)s; + err[0]= (cnv == MY_CS_ILSEQ) ? EILSEQ : EDOM; return 0; } - s+=cnv; + 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); + 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) + 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; + 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) + if ((int) wc >= base) break; if (res > cutoff || (res == cutoff && wc > cutlim)) overflow = 1; else { - res *= (uint32) base; - res += wc; + res*= (uint32) base; + res+= wc; } } - else if (cnv==MY_CS_ILSEQ) + else if (cnv == MY_CS_ILSEQ) { - if (endptr !=NULL ) - *endptr = (char*)s; - err[0]=EILSEQ; + if (endptr != NULL ) + *endptr= (char*)s; + err[0]= EILSEQ; return 0; } else @@ -582,43 +289,36 @@ long my_strntol_ucs2(CHARSET_INFO *cs, } while(1); if (endptr != NULL) - *endptr = (char *) s; + *endptr= (char *) s; if (s == save) { - err[0]=EDOM; + 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; + err[0]= (ERANGE); + return (~(uint32) 0); } return (negative ? -((long) res) : (long) res); } -ulong my_strntoul_ucs2(CHARSET_INFO *cs, - const char *nptr, size_t l, int base, - char **endptr, int *err) +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 uint32 cutoff; - register uint32 res; + register ulonglong res; register const uchar *s= (const uchar*) nptr; register const uchar *e= (const uchar*) nptr+l; const uchar *save; @@ -649,19 +349,13 @@ ulong my_strntoul_ucs2(CHARSET_INFO *cs, 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 - { + 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; @@ -679,115 +373,7 @@ ulong my_strntoul_ucs2(CHARSET_INFO *cs, 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); -} - - - -longlong my_strntoll_ucs2(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 *= (ulonglong) base; res += wc; } } @@ -832,13 +418,12 @@ longlong my_strntoll_ucs2(CHARSET_INFO *cs, } - - -ulonglong my_strntoull_ucs2(CHARSET_INFO *cs, - const char *nptr, size_t l, int base, - char **endptr, int *err) +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 negative= 0; int overflow; int cnv; my_wc_t wc; @@ -846,13 +431,13 @@ ulonglong my_strntoull_ucs2(CHARSET_INFO *cs, register unsigned int cutlim; register ulonglong res; register const uchar *s= (const uchar*) nptr; - register const uchar *e= (const uchar*) nptr+l; + 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) + if ((cnv= cs->cset->mb_wc(cs,&wc,s,e)) > 0) { switch (wc) { @@ -874,11 +459,6 @@ ulonglong my_strntoull_ucs2(CHARSET_INFO *cs, } while (1); bs: - -#ifdef NOT_USED - if (base <= 0 || base == 1 || base > 36) - base = 10; -#endif overflow = 0; res = 0; @@ -942,49 +522,51 @@ ulonglong my_strntoull_ucs2(CHARSET_INFO *cs, } -double my_strntod_ucs2(CHARSET_INFO *cs __attribute__((unused)), - char *nptr, size_t length, - char **endptr, int *err) +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 char *b= buf; register const uchar *s= (const uchar*) nptr; const uchar *end; my_wc_t wc; - int cnv; + int cnv; *err= 0; /* Cut too long strings */ if (length >= sizeof(buf)) - length= sizeof(buf)-1; - end= s+length; + length= sizeof(buf) - 1; + end= s + length; - while ((cnv=cs->cset->mb_wc(cs,&wc,s,end)) > 0) + while ((cnv= cs->cset->mb_wc(cs,&wc,s,end)) > 0) { - s+=cnv; + s+= cnv; if (wc > (int) (uchar) 'e' || !wc) - break; /* Can't be part of double */ + break; /* Can't be part of double */ *b++= (char) wc; } *endptr= b; res= my_strtod(buf, endptr, err); - *endptr= nptr + (size_t) (*endptr- buf); + *endptr= nptr + cs->mbminlen * (size_t) (*endptr - buf); return res; } -ulonglong my_strntoull10rnd_ucs2(CHARSET_INFO *cs __attribute__((unused)), - const char *nptr, size_t length, - int unsign_fl, - char **endptr, int *err) +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; + char buf[256], *b= buf; ulonglong res; const uchar *end, *s= (const uchar*) nptr; my_wc_t wc; - int cnv; + int cnv; /* Cut too long strings */ if (length >= sizeof(buf)) @@ -1000,7 +582,7 @@ ulonglong my_strntoull10rnd_ucs2(CHARSET_INFO *cs __attribute__((unused)), } res= my_strntoull10rnd_8bit(cs, buf, b - buf, unsign_fl, endptr, err); - *endptr= (char*) nptr + 2 * (size_t) (*endptr- buf); + *endptr= (char*) nptr + cs->mbminlen * (size_t) (*endptr - buf); return res; } @@ -1009,23 +591,24 @@ ulonglong my_strntoull10rnd_ucs2(CHARSET_INFO *cs __attribute__((unused)), This is a fast version optimized for the case of radix 10 / -10 */ -size_t my_l10tostr_ucs2(CHARSET_INFO *cs, - char *dst, size_t len, int radix, long int val) +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; + int sl= 0; unsigned long int uval = (unsigned long int) val; - p = &buffer[sizeof(buffer)-1]; - *p='\0'; + p= &buffer[sizeof(buffer) - 1]; + *p= '\0'; if (radix < 0) { if (val < 0) { - sl = 1; + sl= 1; /* Avoid integer overflow in (-val) for LONGLONG_MIN (BUG#31799). */ uval = (unsigned long int)0 - uval; } @@ -1033,57 +616,58 @@ size_t my_l10tostr_ucs2(CHARSET_INFO *cs, new_val = (long) (uval / 10); *--p = '0'+ (char) (uval - (unsigned long) new_val * 10); - val = new_val; + val= new_val; while (val != 0) { - new_val=val/10; - *--p = '0' + (char) (val-new_val*10); + new_val= val / 10; + *--p= '0' + (char) (val - new_val * 10); val= new_val; } if (sl) { - *--p='-'; + *--p= '-'; } - for ( db=dst, de=dst+len ; (dstcset->wc_mb(cs,(my_wc_t)p[0],(uchar*) dst, (uchar*) de); - if (cnvres>0) - dst+=cnvres; + 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); + return (int) (dst - db); } -size_t my_ll10tostr_ucs2(CHARSET_INFO *cs __attribute__((unused)), - char *dst, size_t len, int radix, longlong val) +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; + int sl= 0; ulonglong uval= (ulonglong) val; if (radix < 0) { if (val < 0) { - sl=1; + sl= 1; /* Avoid integer overflow in (-val) for LONGLONG_MIN (BUG#31799). */ uval = (ulonglong)0 - uval; } } - p = &buffer[sizeof(buffer)-1]; + p= &buffer[sizeof(buffer)-1]; *p='\0'; if (uval == 0) { - *--p='0'; + *--p= '0'; goto cnv; } @@ -1091,7 +675,7 @@ size_t my_ll10tostr_ucs2(CHARSET_INFO *cs __attribute__((unused)), { ulonglong quo= uval/(uint) 10; uint rem= (uint) (uval- quo* (uint) 10); - *--p = '0' + rem; + *--p= '0' + rem; uval= quo; } @@ -1099,207 +683,2224 @@ size_t my_ll10tostr_ucs2(CHARSET_INFO *cs __attribute__((unused)), while (long_val != 0) { long quo= long_val/10; - *--p = (char) ('0' + (long_val - quo*10)); + *--p= (char) ('0' + (long_val - quo*10)); long_val= quo; } cnv: if (sl) { - *--p='-'; + *--p= '-'; } - for ( db=dst, de=dst+len ; (dstcset->wc_mb(cs, (my_wc_t) p[0], (uchar*) dst, (uchar*) de); - if (cnvres>0) - dst+=cnvres; + 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); + return (int) (dst -db); } +#endif /* HAVE_CHARSET_mb2_or_mb4 */ -#undef ULONGLONG_MAX -#define ULONGLONG_MAX (~(ulonglong) 0) -#define MAX_NEGATIVE_NUMBER ((ulonglong) LL(0x8000000000000000)) -#define INIT_CNT 9 -#define LFACTOR ULL(1000000000) -#define LFACTOR1 ULL(10000000000) -#define LFACTOR2 ULL(100000000000) -static unsigned long lfactor[9]= +#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) +{ + DBUG_ASSERT(fill <= 0xFFFF); + for ( ; l >= 2; s[0]= (fill >> 8), s[1]= (fill & 0xFF), 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 /* HAVE_CHARSET_mb2*/ + + + + +#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= MY_CS_REPLACEMENT_CHARACTER; + } +} + + +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 UNINIT_VAR(s_wc), UNINIT_VAR(t_wc); + const uchar *se= s + slen; + const uchar *te= t + tlen; + MY_UNICASE_INFO **uni_plane= cs->caseinfo; + + 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 UNINIT_VAR(s_wc), UNINIT_VAR(t_wc); + const uchar *se= s + slen, *te= t + tlen; + MY_UNICASE_INFO **uni_plane= cs->caseinfo; + + 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 UNINIT_VAR(s_wc), UNINIT_VAR(t_wc); + const uchar *se=s+slen; + const uchar *te=t+tlen; + + 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 UNINIT_VAR(s_wc), UNINIT_VAR(t_wc); + const uchar *se= s + slen, *te= t + tlen; + + 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; + } +} + + +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_generic, + 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_full_bin, + my_strnxfrmlen_unicode_full_bin, + my_like_range_generic, + 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 */ + &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 */ + &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= MY_CS_REPLACEMENT_CHARACTER; + } +} + + +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 UNINIT_VAR(s_wc),UNINIT_VAR(t_wc); + const uchar *se= s + slen; + const uchar *te= t + tlen; + MY_UNICASE_INFO **uni_plane= cs->caseinfo; + + 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 UNINIT_VAR(s_wc), UNINIT_VAR(t_wc); + const uchar *se= s + slen, *te= t + tlen; + MY_UNICASE_INFO **uni_plane= cs->caseinfo; + + 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 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 UNINIT_VAR(s_wc), UNINIT_VAR(t_wc); + const uchar *se= s + slen; + const uchar *te= t + tlen; + + 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; +} + + +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, (uchar*) str, (uchar*) 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_generic, + 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_full_bin, + my_strnxfrmlen_unicode_full_bin, + my_like_range_generic, + 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 */ + &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 */ + &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; + + if (wc > 0xFFFF) /* UCS2 does not support characters outside BMP */ + return MY_CS_ILUNI; + + 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 UNINIT_VAR(s_wc),UNINIT_VAR(t_wc); + const uchar *se=s+slen; + const uchar *te=t+tlen; + MY_UNICASE_INFO **uni_plane= cs->caseinfo; + + 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 + + SYNOPSIS + my_strnncollsp_ucs2() + cs character set handler + a First string to compare + a_length Length of 'a' + b Second string to compare + b_length Length of 'b' + + 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 +*/ + +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))) { - 1L, 10L, 100L, 1000L, 10000L, 100000L, 1000000L, 10000000L, 100000000L -}; + 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; -longlong my_strtoll10_ucs2(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; + se= s + slen; + te= t + tlen; - 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 + for (minlen= min(slen, tlen); minlen; minlen-= 2) { - /* We don't support null terminated strings in UCS2 */ - goto no_conv; - } + 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; - /* 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; + t+= 2; } - else + + if (slen != tlen) { - *error= 0; - if (!s[0] && s[1] == '+') + int swap= 1; + if (slen < tlen) { - s+= 2; - if (s == end) - goto no_conv; + s= t; + se= te; + swap= -1; } - 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 + for ( ; s < se ; s+= 2) { - s+= 2; - if (s == end) - goto end_i; /* Return 0 */ + if (s[0] || s[1] != ' ') + return (s[0] == 0 && s[1] < ' ') ? -swap : swap; } - 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); + return 0; +} -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); +static uint my_ismbchar_ucs2(CHARSET_INFO *cs __attribute__((unused)), + const char *b __attribute__((unused)), + const char *e __attribute__((unused))) +{ + return 2; +} -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 uint my_mbcharlen_ucs2(CHARSET_INFO *cs __attribute__((unused)) , + uint c __attribute__((unused))) +{ + return 2; } @@ -1335,25 +2936,6 @@ size_t my_well_formed_len_ucs2(CHARSET_INFO *cs __attribute__((unused)), } -static -void my_fill_ucs2(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 -size_t my_lengthsp_ucs2(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); -} - - static int my_wildcmp_ucs2_ci(CHARSET_INFO *cs, const char *str,const char *str_end, @@ -1384,7 +2966,7 @@ int my_strnncoll_ucs2_bin(CHARSET_INFO *cs, my_bool t_is_prefix) { int s_res,t_res; - my_wc_t UNINIT_VAR(s_wc), UNINIT_VAR(t_wc); + my_wc_t UNINIT_VAR(s_wc),UNINIT_VAR(t_wc); const uchar *se=s+slen; const uchar *te=t+tlen; @@ -1456,29 +3038,6 @@ static int my_strnncollsp_ucs2_bin(CHARSET_INFO *cs __attribute__((unused)), } -static -int my_strcasecmp_ucs2_bin(CHARSET_INFO *cs, const char *s, const char *t) -{ - size_t s_len= strlen(s); - size_t t_len= strlen(t); - size_t len = (s_len > t_len) ? s_len : t_len; - return my_strncasecmp_ucs2(cs, s, t, len); -} - - -static -size_t my_strnxfrm_ucs2_bin(CHARSET_INFO *cs __attribute__((unused)), - uchar *dst, size_t dstlen, - const uchar *src, size_t srclen) -{ - if (dst != src) - memcpy(dst,src,srclen= min(dstlen,srclen)); - if (dstlen > srclen) - cs->cset->fill(cs, (char*) dst + srclen, dstlen - srclen, ' '); - return dstlen; -} - - static void my_hash_sort_ucs2_bin(CHARSET_INFO *cs __attribute__((unused)), const uchar *key, size_t len,ulong *nr1, ulong *nr2) @@ -1498,153 +3057,17 @@ void my_hash_sort_ucs2_bin(CHARSET_INFO *cs __attribute__((unused)), } } -/* -** 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_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 0; - } - - 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]; - } - - *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 0; -} - - - -size_t my_scan_ucs2(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 MY_COLLATION_HANDLER my_collation_ucs2_general_ci_handler = { NULL, /* init */ my_strnncoll_ucs2, my_strnncollsp_ucs2, - my_strnxfrm_ucs2, + my_strnxfrm_unicode, my_strnxfrmlen_simple, - my_like_range_ucs2, + my_like_range_generic, my_wildcmp_ucs2_ci, - my_strcasecmp_ucs2, + my_strcasecmp_mb2_or_mb4, my_instr_mb, my_hash_sort_ucs2, my_propagate_simple @@ -1656,11 +3079,11 @@ static MY_COLLATION_HANDLER my_collation_ucs2_bin_handler = NULL, /* init */ my_strnncoll_ucs2_bin, my_strnncollsp_ucs2_bin, - my_strnxfrm_ucs2_bin, + my_strnxfrm_unicode, my_strnxfrmlen_simple, - my_like_range_ucs2, + my_like_range_generic, my_wildcmp_ucs2_bin, - my_strcasecmp_ucs2_bin, + my_strcasecmp_mb2_or_mb4, my_instr_mb, my_hash_sort_ucs2_bin, my_propagate_simple @@ -1675,34 +3098,34 @@ MY_CHARSET_HANDLER my_charset_ucs2_handler= my_numchars_ucs2, my_charpos_ucs2, my_well_formed_len_ucs2, - my_lengthsp_ucs2, + my_lengthsp_mb2, my_numcells_mb, my_ucs2_uni, /* mb_wc */ my_uni_ucs2, /* wc_mb */ my_mb_ctype_mb, - my_caseup_str_ucs2, - my_casedn_str_ucs2, + my_caseup_str_mb2_or_mb4, + my_casedn_str_mb2_or_mb4, my_caseup_ucs2, my_casedn_ucs2, - my_snprintf_ucs2, - my_l10tostr_ucs2, - my_ll10tostr_ucs2, - my_fill_ucs2, - my_strntol_ucs2, - my_strntoul_ucs2, - my_strntoll_ucs2, - my_strntoull_ucs2, - my_strntod_ucs2, - my_strtoll10_ucs2, - my_strntoull10rnd_ucs2, - my_scan_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_COMPILED|MY_CS_PRIMARY|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, "ucs2", /* cs name */ "ucs2_general_ci", /* name */ "", /* comment */ @@ -1734,7 +3157,7 @@ CHARSET_INFO my_charset_ucs2_general_ci= CHARSET_INFO my_charset_ucs2_bin= { 90,0,0, /* number */ - MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_UNICODE, + MY_CS_COMPILED|MY_CS_BINSORT|MY_CS_UNICODE|MY_CS_NONASCII, "ucs2", /* cs name */ "ucs2_bin", /* name */ "", /* comment */ @@ -1764,4 +3187,4 @@ CHARSET_INFO my_charset_ucs2_bin= }; -#endif +#endif /* HAVE_CHARSET_ucs2 */ diff --git a/dep/mysqllite/strings/ctype-ujis.c b/dep/mysqllite/strings/ctype-ujis.c deleted file mode 100644 index 4474bd0cf9659..0000000000000 --- a/dep/mysqllite/strings/ctype-ujis.c +++ /dev/null @@ -1,8611 +0,0 @@ -/* 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_simple, /* 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 */ - 0xFEFE, /* max_sort_char */ - ' ', /* pad char */ - 0, /* escape_with_backslash_is_dangerous */ - &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 */ - 0xFEFE, /* max_sort_char */ - ' ', /* pad char */ - 0, /* escape_with_backslash_is_dangerous */ - &my_charset_handler, - &my_collation_mb_bin_handler -}; - - -#endif diff --git a/dep/mysqllite/strings/ctype-utf8.c b/dep/mysqllite/strings/ctype-utf8.c index ae942b59caa4f..324f6b9aafbf7 100644 --- a/dep/mysqllite/strings/ctype-utf8.c +++ b/dep/mysqllite/strings/ctype-utf8.c @@ -27,6 +27,16 @@ #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" + + + #ifndef HAVE_CHARSET_utf8 #define HAVE_CHARSET_utf8 #endif @@ -39,6 +49,14 @@ #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" @@ -1702,6 +1720,21 @@ MY_UNICASE_INFO *my_unicase_turkish[256]= }; +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= MY_CS_REPLACEMENT_CHARACTER; + } +} + /* ** Compare string against string with wildcard @@ -1712,15 +1745,16 @@ MY_UNICASE_INFO *my_unicase_turkish[256]= ** 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 +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 */ + int result= -1; /* Not found, using wildcards */ my_wc_t s_wc, w_wc; - int scan, plane; + int scan; int (*mb_wc)(struct charset_info_st *, my_wc_t *, const uchar *, const uchar *); mb_wc= cs->cset->mb_wc; @@ -1734,14 +1768,14 @@ int my_wildcmp_unicode(CHARSET_INFO *cs, (const uchar*)wildend)) <= 0) return 1; - if (w_wc == (my_wc_t)w_many) + if (w_wc == (my_wc_t) w_many) { - result= 1; /* Found an anchor char */ + result= 1; /* Found an anchor char */ break; } wildstr+= scan; - if (w_wc == (my_wc_t)escape && wildstr < wildend) + if (w_wc == (my_wc_t) escape && wildstr < wildend) { if ((scan= mb_wc(cs, &w_wc, (const uchar*)wildstr, (const uchar*)wildend)) <= 0) @@ -1755,29 +1789,27 @@ int my_wildcmp_unicode(CHARSET_INFO *cs, return 1; str+= scan; - if (!escaped && w_wc == (my_wc_t)w_one) + if (!escaped && w_wc == (my_wc_t) w_one) { - result= 1; /* Found an anchor char */ + result= 1; /* Found an anchor char */ } else { 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; + my_tosort_unicode(weights, &s_wc); + my_tosort_unicode(weights, &w_wc); } if (s_wc != w_wc) - return 1; /* No match */ + return 1; /* No match */ } if (wildstr == wildend) - return (str != str_end); /* Match if both are at end */ + return (str != str_end); /* Match if both are at end */ } - if (w_wc == (my_wc_t)w_many) - { /* Found w_many */ + if (w_wc == (my_wc_t) w_many) + { /* Found w_many */ /* Remove any '%' and '_' from the wild search string */ for ( ; wildstr != wildend ; ) @@ -1786,29 +1818,29 @@ int my_wildcmp_unicode(CHARSET_INFO *cs, (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 (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 */ + continue; + } + break; /* Not a wild character */ } if (wildstr == wildend) - return 0; /* Ok if w_many is last */ + return 0; /* Ok if w_many is last */ if (str == str_end) - return -1; + return -1; if ((scan= mb_wc(cs, &w_wc, (const uchar*)wildstr, (const uchar*)wildend)) <=0) @@ -1836,10 +1868,8 @@ int my_wildcmp_unicode(CHARSET_INFO *cs, 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; + my_tosort_unicode(weights, &s_wc); + my_tosort_unicode(weights, &w_wc); } if (s_wc == w_wc) @@ -1861,8 +1891,112 @@ int my_wildcmp_unicode(CHARSET_INFO *cs, return (str != str_end ? 1 : 0); } -#endif +/* + Store sorting weights using 2 bytes per character. + + This function is shared between + - utf8mb3_general_ci, utf8_bin, ucs2_general_ci, ucs2_bin + which support BMP only (U+0000..U+FFFF). + - utf8mb4_general_ci, utf16_general_ci, utf32_general_ci, + which map all supplementary characters to weight 0xFFFD. +*/ +size_t +my_strnxfrm_unicode(CHARSET_INFO *cs, + uchar *dst, size_t dstlen, + const uchar *src, size_t srclen) +{ + my_wc_t wc; + int res; + uchar *de= dst + dstlen; + uchar *de_beg= de - 1; + const uchar *se = src + srclen; + MY_UNICASE_INFO **uni_plane= (cs->state & MY_CS_BINSORT) ? + NULL : cs->caseinfo; + LINT_INIT(wc); + DBUG_ASSERT(src); + + while (dst < de_beg) + { + 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); + } + + while (dst < de_beg) /* Fill the tail with keys for space character */ + { + *dst++= 0x00; + *dst++= 0x20; + } + + if (dst < de) /* Clear the last byte, if "dstlen" was an odd number */ + *dst= 0x00; + + return dstlen; +} + + +/* + Store sorting weights using 3 bytes per character. + This function is shared between utf8mb4_bin, utf16_bin, utf32_bin. +*/ +size_t +my_strnxfrm_unicode_full_bin(CHARSET_INFO *cs, + uchar *dst, size_t dstlen, + const uchar *src, size_t srclen) +{ + my_wc_t wc; + uchar *de= dst + dstlen; + uchar *de_beg= de - 2; /* The beginning of the last chunk */ + const uchar *se = src + srclen; + + LINT_INIT(wc); + DBUG_ASSERT(src); + DBUG_ASSERT(cs->state & MY_CS_BINSORT); + + while (dst < de_beg) + { + int res; + if ((res= cs->cset->mb_wc(cs, &wc, src, se)) <= 0) + break; + src+= res; + *dst++= (uchar) (wc >> 16); + *dst++= (uchar) ((wc >> 8) & 0xFF); + *dst++= (uchar) (wc & 0xFF); + } + + while (dst < de_beg) /* Fill the tail with keys for space character */ + { + *dst++= 0x00; + *dst++= 0x00; + *dst++= 0x20; + } + + /* Clear the last one or two bytes, if "dstlen" was not divisible by 3 */ + if (dst < de) + { + *dst++= 0x00; + if (dst < de) + *dst= 0x00; + } + + return dstlen; +} + + +size_t +my_strnxfrmlen_unicode_full_bin(CHARSET_INFO *cs, size_t len) +{ + return ((len + 3) / cs->mbmaxlen) * 3; +} +#endif /* HAVE_UNIDATA */ #ifdef HAVE_CHARSET_utf8 @@ -2569,44 +2703,6 @@ size_t my_strnxfrmlen_utf8(CHARSET_INFO *cs __attribute__((unused)), } -static size_t my_strnxfrm_utf8(CHARSET_INFO *cs, - uchar *dst, size_t dstlen, - const uchar *src, size_t srclen) -{ - my_wc_t wc; - int res; - int plane; - uchar *de= dst + dstlen; - uchar *de_beg= de - 1; - const uchar *se = src + srclen; - MY_UNICASE_INFO **uni_plane= cs->caseinfo; - - while (dst < de_beg) - { - if ((res=my_utf8_uni(cs,&wc, src, se)) <= 0) - break; - src+=res; - - plane=(wc>>8) & 0xFF; - wc = uni_plane[plane] ? uni_plane[plane][wc & 0xFF].sort : wc; - - *dst++= (uchar)(wc >> 8); - *dst++= (uchar)(wc & 0xFF); - - } - - while (dst < de_beg) /* Fill the tail with keys for space character */ - { - *dst++= 0x00; - *dst++= 0x20; - } - - if (dst < de) /* Clear the last byte, if "dstlen" was an odd number */ - *dst= 0x00; - - return dstlen; -} - static uint my_ismbchar_utf8(CHARSET_INFO *cs,const char *b, const char *e) { my_wc_t wc; @@ -2642,7 +2738,7 @@ static MY_COLLATION_HANDLER my_collation_ci_handler = NULL, /* init */ my_strnncoll_utf8, my_strnncollsp_utf8, - my_strnxfrm_utf8, + my_strnxfrm_unicode, my_strnxfrmlen_utf8, my_like_range_mb, my_wildcmp_utf8, @@ -2891,7 +2987,7 @@ static MY_COLLATION_HANDLER my_collation_cs_handler = NULL, /* init */ my_strnncoll_utf8_cs, my_strnncollsp_utf8_cs, - my_strnxfrm_utf8, + my_strnxfrm_unicode, my_strnxfrmlen_utf8, my_like_range_simple, my_wildcmp_mb, @@ -4154,7 +4250,7 @@ static MY_COLLATION_HANDLER my_collation_filename_handler = NULL, /* init */ my_strnncoll_utf8, my_strnncollsp_utf8, - my_strnxfrm_utf8, + my_strnxfrm_unicode, my_strnxfrmlen_utf8, my_like_range_mb, my_wildcmp_utf8, @@ -4200,7 +4296,7 @@ static MY_CHARSET_HANDLER my_charset_filename_handler= 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_COMPILED|MY_CS_PRIMARY|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_HIDDEN|MY_CS_NONASCII, "filename", /* cs name */ "filename", /* name */ "", /* comment */ @@ -4284,3 +4380,859 @@ int main() +#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_full_bin, + my_strnxfrmlen_unicode_full_bin, + 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|MY_CS_UNICODE_SUPPLEMENT, /* 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 */ + &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|MY_CS_UNICODE_SUPPLEMENT, /* 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 */ + &my_charset_utf8mb4_handler, + &my_collation_utf8mb4_bin_handler +}; + +#endif /* HAVE_CHARSET_utf8mb4 */ diff --git a/dep/mysqllite/strings/ctype-win1250ch.c b/dep/mysqllite/strings/ctype-win1250ch.c index b22b4364e8a80..d9d092beb8f92 100644 --- a/dep/mysqllite/strings/ctype-win1250ch.c +++ b/dep/mysqllite/strings/ctype-win1250ch.c @@ -152,7 +152,7 @@ static MY_UNI_IDX idx_uni_cp1250[]={ }; -static uchar NEAR ctype_win1250ch[] = { +static uchar ctype_win1250ch[] = { 0x00, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x28, 0x28, 0x28, 0x28, 0x28, 0x20, 0x20, @@ -188,7 +188,7 @@ static uchar NEAR ctype_win1250ch[] = { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x10 }; -static uchar NEAR to_lower_win1250ch[] = { +static uchar 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, @@ -223,7 +223,7 @@ static uchar NEAR to_lower_win1250ch[] = { 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff }; -static uchar NEAR to_upper_win1250ch[] = { +static uchar 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, @@ -260,7 +260,7 @@ static uchar NEAR to_upper_win1250ch[] = { -static uchar NEAR sort_order_win1250ch[] = { +static uchar 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, @@ -279,7 +279,7 @@ static uchar NEAR sort_order_win1250ch[] = { 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255 }; -static uchar NEAR _sort_order_win1250ch1[] = { +static uchar _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, @@ -339,7 +339,7 @@ static uchar NEAR _sort_order_win1250ch1[] = { 0xb8, 0xbd, 0xbd, 0xbd, 0xbd, 0xc1, 0xbc, 0xf5 }; -static uchar NEAR _sort_order_win1250ch2[] = { +static uchar _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, @@ -513,7 +513,7 @@ static size_t my_strnxfrm_win1250ch(CHARSET_INFO * cs __attribute__((unused)), #ifdef REAL_MYSQL -static uchar NEAR like_range_prefix_min_win1250ch[]= +static uchar like_range_prefix_min_win1250ch[]= { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, @@ -557,7 +557,7 @@ static uchar NEAR like_range_prefix_min_win1250ch[]= For all other characters: prefix_max[i] == i */ -static uchar NEAR like_range_prefix_max_win1250ch[]= +static uchar like_range_prefix_max_win1250ch[]= { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, diff --git a/dep/mysqllite/strings/ctype.c b/dep/mysqllite/strings/ctype.c index 17ad1256e74e3..4891e657b6ea7 100644 --- a/dep/mysqllite/strings/ctype.c +++ b/dep/mysqllite/strings/ctype.c @@ -74,6 +74,7 @@ struct my_cs_file_section_st #define _CS_DIFF1 19 #define _CS_DIFF2 20 #define _CS_DIFF3 21 +#define _CS_IDENTICAL 22 static struct my_cs_file_section_st sec[] = @@ -108,6 +109,7 @@ static struct my_cs_file_section_st sec[] = {_CS_DIFF1, "charsets/charset/collation/rules/p"}, {_CS_DIFF2, "charsets/charset/collation/rules/s"}, {_CS_DIFF3, "charsets/charset/collation/rules/t"}, + {_CS_IDENTICAL, "charsets/charset/collation/rules/i"}, {0, NULL} }; @@ -269,6 +271,7 @@ static int cs_value(MY_XML_PARSER *st,const char *attr, size_t len) case _CS_DIFF1: case _CS_DIFF2: case _CS_DIFF3: + case _CS_IDENTICAL: { /* Convert collation description from @@ -276,7 +279,7 @@ static int cs_value(MY_XML_PARSER *st,const char *attr, size_t len) into ICU Collation Customization expression. */ char arg[16]; - const char *cmd[]= {"&","<","<<","<<<"}; + const char *cmd[]= {"&","<","<<","<<<","="}; i->cs.tailoring= i->tailoring; mstr(arg,attr,len,sizeof(arg)-1); if (i->tailoring_length + 20 < sizeof(i->tailoring)) @@ -405,3 +408,23 @@ my_charset_is_8bit_pure_ascii(CHARSET_INFO *cs) } 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/dep/mysqllite/strings/decimal.c b/dep/mysqllite/strings/decimal.c new file mode 100644 index 0000000000000..7625ed80ec320 --- /dev/null +++ b/dep/mysqllite/strings/decimal.c @@ -0,0 +1,3128 @@ +/* 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", *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=ULL(0); + 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 UNINIT_VAR(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 UNINIT_VAR(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), UNINIT_VAR(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); + + 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; + 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, + UNINIT_VAR(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; + + 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(ULL(12345), "12345", 0); + test_ull2d(ULL(0), "0", 0); + test_ull2d(ULL(18446744073709551615), "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(LL(-12345), "-12345", 0); + test_ll2d(LL(-1), "-1", 0); + test_ll2d(LL(-9223372036854775807), "-9223372036854775807", 0); + test_ll2d(ULL(9223372036854775808), "-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/dep/mysqllite/strings/dtoa.c b/dep/mysqllite/strings/dtoa.c new file mode 100644 index 0000000000000..d64c420b4991b --- /dev/null +++ b/dep/mysqllite/strings/dtoa.c @@ -0,0 +1,2793 @@ +/* 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(end != NULL && ((str != NULL && *end != NULL) || + (str == 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) (x)->L[0] +#define word1(x) (x)->L[1] +#else +#define word0(x) (x)->L[1] +#define word1(x) (x)->L[0] +#endif + +#define dval(x) (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(U *x) +{ + register Long L; + U u; + + L= (word0(x) & Exp_mask) - (P - 1)*Exp_msk1; + word0(&u) = L; + word1(&u) = 0; + return dval(&u); +} + + +static double b2d(Bigint *a, int *e) +{ + ULong *xa, *xa0, w, y, z; + int k; + U 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(U *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) +{ + U 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, UNINIT_VAR(c), dsign, + e, e1, esign, i, j, k, nd, nd0, nf, nz, nz0, sign; + const char *s, *s0, *s1, *end = *se; + double aadj, aadj1; + U aadj2, 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; + + *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.d= -rv.d; + 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.d= -rv.d; + 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.d= -rv.d; + 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(&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->p.x[0] && delta->wds <= 1) + { + /* exact */ +#ifdef SET_INEXACT + inexact= 0; +#endif + break; + } + if (rounding) + { + if (dsign) + { + adj.d= 1.; + goto apply_adj; + } + } + else if (!dsign) + { + adj.d= -1.; + if (!word1(&rv) && !(word0(&rv) & Frac_mask)) + { + y= word0(&rv) & Exp_mask; + if (!scale || y > 2*P*Exp_msk1) + { + delta= lshift(delta, Log2P, &alloc); + if (cmp(delta, bs) <= 0) + adj.d= -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.d * ulp(&rv); + } + break; + } + adj.d= ratio(delta, bs); + if (adj.d < 1.) + adj.d= 1.; + if (adj.d <= 0x7ffffffe) + { + /* adj = rounding ? ceil(adj) : floor(adj); */ + y= adj.d; + if (y != adj.d) + { + if (!((rounding >> 1) ^ dsign)) + y++; + adj.d= y; + } + } + if (scale && (y= word0(&rv) & Exp_mask) <= 2 * P * Exp_msk1) + word0(&adj)+= (2 * P + 1) * Exp_msk1 - y; + adj.d*= ulp(&rv); + if (dsign) + dval(&rv)+= adj.d; + else + dval(&rv)-= adj.d; + 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(&rv); + else + { + dval(&rv)-= ulp(&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.d= aadj1 * ulp(&rv); + dval(&rv)+= adj.d; + 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; + } + dval(&aadj2) = aadj1; + word0(&aadj2)+= (2 * P + 1) * Exp_msk1 - y; + aadj1= dval(&aadj2); + adj.d= aadj1 * ulp(&rv); + dval(&rv)+= adj.d; + if (rv.d == 0.) + goto undfl; + } + else + { + adj.d= aadj1 * ulp(&rv); + dval(&rv)+= adj.d; + } + } + 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 dd, 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, UNINIT_VAR(ilim), ilim0, + UNINIT_VAR(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; + U d2, eps, u; + double ds; + char *s, *s0; +#ifdef Honor_FLT_ROUNDS + int rounding; +#endif + Stack_alloc alloc; + + alloc.begin= alloc.free= buf; + alloc.end= buf + buf_size; + memset(alloc.freelist, 0, sizeof(alloc.freelist)); + + u.d= dd; + if (word0(&u) & Sign_bit) + { + /* set sign for everything, including 0's and NaNs */ + *sign= 1; + word0(&u) &= ~Sign_bit; /* clear sign bit */ + } + else + *sign= 0; + + /* If infinity, set decpt to DTOA_OVERFLOW, if 0 set it to 1 */ + if (((word0(&u) & Exp_mask) == Exp_mask && (*decpt= DTOA_OVERFLOW)) || + (!dval(&u) && (*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(&u, &be, &bbits, &alloc); + if ((i= (int)(word0(&u) >> Exp_shift1 & (Exp_mask>>Exp_shift1)))) + { + dval(&d2)= dval(&u); + 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(&u) << (64 - i) | word1(&u) >> (i - 32) + : word1(&u) << (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(&u) < 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(&u); + 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(&u)/= bigtens[n_bigtens-1]; + ieps++; + } + for (; j; j>>= 1, i++) + { + if (j & 1) + { + ieps++; + ds*= bigtens[i]; + } + } + dval(&u)/= ds; + } + else if ((j1= -k)) + { + dval(&u)*= tens[j1 & 0xf]; + for (j= j1 >> 4; j; j>>= 1, i++) + { + if (j & 1) + { + ieps++; + dval(&u)*= bigtens[i]; + } + } + } + if (k_check && dval(&u) < 1. && ilim > 0) + { + if (ilim1 <= 0) + goto fast_failed; + ilim= ilim1; + k--; + dval(&u)*= 10.; + ieps++; + } + dval(&eps)= ieps*dval(&u) + 7.; + word0(&eps)-= (P-1)*Exp_msk1; + if (ilim == 0) + { + S= mhi= 0; + dval(&u)-= 5.; + if (dval(&u) > dval(&eps)) + goto one_digit; + if (dval(&u) < -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(&u); + dval(&u)-= L; + *s++= '0' + (int)L; + if (dval(&u) < dval(&eps)) + goto ret1; + if (1. - dval(&u) < dval(&eps)) + goto bump_up; + if (++i >= ilim) + break; + dval(&eps)*= 10.; + dval(&u)*= 10.; + } + } + else + { + /* Generate ilim digits, then fix them up. */ + dval(&eps)*= tens[ilim-1]; + for (i= 1;; i++, dval(&u)*= 10.) + { + L= (Long)(dval(&u)); + if (!(dval(&u)-= L)) + ilim= i; + *s++= '0' + (int)L; + if (i == ilim) + { + if (dval(&u) > 0.5 + dval(&eps)) + goto bump_up; + else if (dval(&u) < 0.5 - dval(&eps)) + { + while (*--s == '0'); + s++; + goto ret1; + } + break; + } + } + } + fast_failed: + s= s0; + dval(&u)= 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(&u) <= 5*ds) + goto no_digits; + goto one_digit; + } + for (i= 1;; i++, dval(&u)*= 10.) + { + L= (Long)(dval(&u) / ds); + dval(&u)-= L*ds; +#ifdef Check_FLT_ROUNDS + /* If FLT_ROUNDS == 2, L will usually be high by 1 */ + if (dval(&u) < 0) + { + L--; + dval(&u)+= ds; + } +#endif + *s++= '0' + (int)L; + if (!dval(&u)) + { + break; + } + if (i == ilim) + { +#ifdef Honor_FLT_ROUNDS + if (mode > 1) + { + switch (rounding) { + case 0: goto ret1; + case 2: goto bump_up; + } + } +#endif + dval(&u)+= dval(&u); + if (dval(&u) > ds || (dval(&u) == 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(&u) && !(word0(&u) & Bndry_mask) && + word0(&u) & (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(&u) & 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(&u) & 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/dep/mysqllite/strings/int2str.c b/dep/mysqllite/strings/int2str.c index fba98aac3f1ca..ecc214d58d50f 100644 --- a/dep/mysqllite/strings/int2str.c +++ b/dep/mysqllite/strings/int2str.c @@ -19,9 +19,9 @@ /* _dig_vec arrays are public because they are used in several outer places. */ -char NEAR _dig_vec_upper[] = +char _dig_vec_upper[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; -char NEAR _dig_vec_lower[] = +char _dig_vec_lower[] = "0123456789abcdefghijklmnopqrstuvwxyz"; diff --git a/dep/mysqllite/strings/latin2.def b/dep/mysqllite/strings/latin2.def new file mode 100644 index 0000000000000..159d01894f394 --- /dev/null +++ b/dep/mysqllite/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/dep/mysqllite/strings/longlong2str-x86.s b/dep/mysqllite/strings/longlong2str-x86.s deleted file mode 100644 index 3de43a96e7821..0000000000000 --- a/dep/mysqllite/strings/longlong2str-x86.s +++ /dev/null @@ -1,216 +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 - -# Optimized longlong2str function for Intel 80x86 (gcc/gas syntax) -# Some set sequences are optimized for pentuimpro II - - .file "longlong2str-x86.s" - .version "1.02" - -.text - .align 4 - -.globl longlong2str_with_dig_vector - .type longlong2str_with_dig_vector,@function - -longlong2str_with_dig_vector: - subl $80,%esp # Temporary buffer for up to 64 radix-2 digits - pushl %ebp - pushl %esi - pushl %edi - pushl %ebx - movl 100(%esp),%esi # esi = Lower part of val - movl 112(%esp),%ebx # ebx = Radix - movl 104(%esp),%ebp # ebp = Higher part of val - movl 108(%esp),%edi # edi = dst - - testl %ebx,%ebx - jge .L144 # Radix was positive - negl %ebx # Change radix to positive - testl %ebp,%ebp # Test if given value is negative - jge .L144 - movb $45,(%edi) # Add sign - incl %edi # Change sign of val - negl %esi - adcl $0,%ebp - negl %ebp - -.L144: # Test that radix is between 2 and 36 - movl %ebx, %eax - addl $-2,%eax # Test that radix is between 2 and 36 - cmpl $34,%eax - ja .Lerror # Radix was not in range - - leal 92(%esp),%ecx # End of buffer - movl %edi, 108(%esp) # Store possible modified dest - movl 116(%esp), %edi # dig_vec_upper - testl %ebp,%ebp # Test if value > 0xFFFFFFFF - jne .Llongdiv - cmpl %ebx, %esi # Test if <= radix, for easy loop - movl %esi, %eax # Value in eax (for Llow) - jae .Llow - - # Value is one digit (negative or positive) - movb (%eax,%edi),%bl - movl 108(%esp),%edi # get dst - movb %bl,(%edi) - incl %edi # End null here - jmp .L10_end - -.Llongdiv: - # Value in ebp:esi. div the high part by the radix, - # then div remainder + low part by the radix. - movl %ebp,%eax # edx=0,eax=high(from ebp) - xorl %edx,%edx - decl %ecx - divl %ebx - movl %eax,%ebp # edx=result of last, eax=low(from esi) - movl %esi,%eax - divl %ebx - movl %eax,%esi # ebp:esi = quotient - movb (%edx,%edi),%dl # Store result number in temporary buffer - testl %ebp,%ebp - movb %dl,(%ecx) # store value in buff - ja .Llongdiv # (Higher part of val still > 0) - - .align 4 -.Llow: # Do rest with integer precision - # Value in 0:eax. div 0 + low part by the radix. - xorl %edx,%edx - decl %ecx - divl %ebx - movb (%edx,%edi),%dl # bh is always zero as ebx=radix < 36 - testl %eax,%eax - movb %dl,(%ecx) - jne .Llow - -.L160: - movl 108(%esp),%edi # get dst - -.Lcopy_end: - leal 92(%esp),%esi # End of buffer -.Lmov: # mov temporary buffer to result (%ecx -> %edi) - movb (%ecx), %al - movb %al, (%edi) - incl %ecx - incl %edi - cmpl %ecx,%esi - jne .Lmov - -.L10_end: - movl %edi,%eax # Pointer to end null - movb $0,(%edi) # Store the end null - -.L165: - popl %ebx - popl %edi - popl %esi - popl %ebp - addl $80,%esp - ret - -.Lerror: - xorl %eax,%eax # Wrong radix - jmp .L165 - -.Lfe3: - .size longlong2str_with_dig_vector,.Lfe3-longlong2str_with_dig_vector - -# -# This is almost equal to the above, except that we can do the final -# loop much more efficient -# - - .align 4 - -.globl longlong10_to_str - .type longlong10_to_str,@function -longlong10_to_str: - subl $80,%esp - pushl %ebp - pushl %esi - pushl %edi - pushl %ebx - movl 100(%esp),%esi # Lower part of val - movl 104(%esp),%ebp # Higher part of val - movl 108(%esp),%edi # get dst - movl 112(%esp),%ebx # Radix (10 or -10) - testl %ebx,%ebx - jge .L10_10 # Positive radix - - negl %ebx # Change radix to positive (= 10) - - testl %ebp,%ebp # Test if negative value - jge .L10_10 - movb $45,(%edi) # Add sign - incl %edi - negl %esi # Change sign of val (ebp:esi) - adcl $0,%ebp - negl %ebp - -.L10_10: - leal 92(%esp),%ecx # End of buffer - testl %ebp,%ebp # Test if value > 0xFFFFFFFF - jne .L10_longdiv - cmpl $10, %esi # Test if <= radix, for easy loop - movl %esi, %ebx # Value in eax (for L10_low) - jae .L10_low - - # Value is one digit (negative or positive) - addb $48, %bl - movb %bl,(%edi) - incl %edi - jmp .L10_end - .align 4 - -.L10_longdiv: - # val is stored in in ebp:esi - movl %ebp,%eax # High part of value - xorl %edx,%edx - divl %ebx # Divide by 10 - movl %eax,%ebp - movl %esi,%eax - divl %ebx # Divide by 10 - decl %ecx - movl %eax,%esi # quotent in ebp:esi - addl $48,%edx # Convert to ascii - movb %dl,(%ecx) # store value in buff - -.L10_30: - testl %ebp,%ebp - ja .L10_longdiv - movl %esi,%ebx # Move val to %ebx - -.L10_low: - # The following code uses some tricks to change division by 10 to - # multiplication and shifts - movl $0xcccccccd,%esi - -.L10_40: # Divide %ebx with 10 - movl %ebx,%eax - mull %esi - decl %ecx - shrl $3,%edx - leal (%edx,%edx,4),%eax - addl %eax,%eax - subb %al,%bl # %bl now contains val % 10 - addb $48,%bl - movb %bl,(%ecx) - movl %edx,%ebx - testl %ebx,%ebx - jne .L10_40 - jmp .Lcopy_end # Shared end with longlong2str - -.L10end: - .size longlong10_to_str,.L10end-longlong10_to_str diff --git a/dep/mysqllite/strings/longlong2str.c b/dep/mysqllite/strings/longlong2str.c index d7de5bb0f7cd0..641ae0955d351 100644 --- a/dep/mysqllite/strings/longlong2str.c +++ b/dep/mysqllite/strings/longlong2str.c @@ -40,17 +40,18 @@ #include #include "m_string.h" -#if defined(HAVE_LONG_LONG) && !defined(longlong2str) && !defined(HAVE_LONGLONG2STR) +#ifndef ll2str /* This assumes that longlong multiplication is faster than longlong division. */ -char *longlong2str(longlong val,char *dst,int radix) +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) @@ -80,20 +81,19 @@ char *longlong2str(longlong val,char *dst,int radix) { ulonglong quo= uval/(uint) radix; uint rem= (uint) (uval- quo* (uint) radix); - *--p = _dig_vec_upper[rem]; + *--p= dig_vec[rem]; uval= quo; } long_val= (long) uval; while (long_val != 0) { long quo= long_val/radix; - *--p = _dig_vec_upper[(uchar) (long_val - quo*radix)]; + *--p= dig_vec[(uchar) (long_val - quo*radix)]; long_val= quo; } while ((*dst++ = *p++) != 0) ; return dst-1; } - #endif #ifndef longlong10_to_str diff --git a/dep/mysqllite/strings/my_strchr.c b/dep/mysqllite/strings/my_strchr.c new file mode 100644 index 0000000000000..08fa51ba17a28 --- /dev/null +++ b/dep/mysqllite/strings/my_strchr.c @@ -0,0 +1,104 @@ +/* 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 +#include "m_string.h" +#include "m_ctype.h" + +#define NEQ(A, B) ((A) != (B)) +#define EQU(A, B) ((A) == (B)) + +/** + Macro for the body of the string scanning. + + @param CS The character set of the string + @param STR Pointer to beginning of string + @param END Pointer to one-after-end of string + @param ACC Pointer to beginning of accept (or reject) string + @param LEN Length of accept (or reject) string + @param CMP is a function-like for doing the comparison of two characters. + */ + +#define SCAN_STRING(CS, STR, END, ACC, LEN, CMP) \ + do { \ + uint mbl; \ + const char *ptr_str, *ptr_acc; \ + const char *acc_end= (ACC) + (LEN); \ + for (ptr_str= (STR) ; ptr_str < (END) ; ptr_str+= mbl) \ + { \ + mbl= my_mbcharlen((CS), *(uchar*)ptr_str); \ + if (mbl < 2) \ + { \ + DBUG_ASSERT(mbl == 1); \ + for (ptr_acc= (ACC) ; ptr_acc < acc_end ; ++ptr_acc) \ + if (CMP(*ptr_acc, *ptr_str)) \ + goto end; \ + } \ + } \ +end: \ + return (size_t) (ptr_str - (STR)); \ + } while (0) + + +/* + 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. +*/ + +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); +} + +/** + Calculate the length of the initial segment of 'str' which consists + entirely of characters not in 'reject'. + + @note The reject string points to single-byte characters so it is + only possible to find the first occurrence of a single-byte + character. Multi-byte characters in 'str' are treated as not + matching any character in the reject string. + + @todo should be moved to CHARSET_INFO if it's going to be called + frequently. + + @internal The implementation builds on the assumption that 'str' is long, + while 'reject' is short. So it compares each character in string + with the characters in 'reject' in a tight loop over the characters + in 'reject'. +*/ + +size_t my_strcspn(CHARSET_INFO *cs, const char *str, const char *str_end, + const char *reject) +{ + SCAN_STRING(cs, str, str_end, reject, strlen(reject), EQU); +} diff --git a/dep/mysqllite/strings/my_strtoll10-x86.s b/dep/mysqllite/strings/my_strtoll10-x86.s deleted file mode 100644 index f73428de7de5a..0000000000000 --- a/dep/mysqllite/strings/my_strtoll10-x86.s +++ /dev/null @@ -1,418 +0,0 @@ -# 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 - -# Implemention of my_strtoll(): Converting a string to a 64 bit integer. -# For documentation, check my_strtoll.c - - .file "my_strtoll10-x86.s" - .version "01.02" - -.text - .align 4 - -.globl my_strtoll10 - .type my_strtoll10,@function - - - # Used stack variables - # ebp-4 dummy for storing endptr if endptr = 0 - # ebp-8 First 9 digits of return values - # ebp-12 Pointer to first digit of second part - # ebp-16 Store lowest 2 digits - # ebp-20 != 0 if value was negative - # ebp-24 High max value - # ebp-28 Middle max value - # ebp-32 Low max value - # ebp-36 Temp value - - # esi Pointer to input string - # ebx End of string - -my_strtoll10: - pushl %ebp - movl %esp,%ebp - subl $48,%esp - pushl %esi - pushl %edi - pushl %ebx - movl 8(%ebp),%esi # esi= nptr - movl 16(%ebp),%ecx # ecx= error (Will be overwritten later) - movl 12(%ebp),%eax # eax= endptr - cmpl $0,%eax # if (endptr) - je .L110 - -# Fixed length string - movl (%eax),%ebx # bx= end-of-string - .p2align 4,,7 -.L100: - cmpl %ebx,%esi - je .Lno_conv - movb (%esi), %al # al= next byte - incl %esi - cmpb $32,%al # Skip space - je .L100 - cmpb $9,%al # Skip tab - je .L100 - jmp .L130 - -# String that ends with \0 - -.L110: - leal -4(%ebp),%edi - movl %edi,12(%ebp) # endptr= &dummy, for easier end check - .p2align 4,,7 -.L120: - movb (%esi), %al # al= next byte - incl %esi - cmpb $32,%al - je .L120 - cmpb $9,%al - je .L120 - testb %al,%al # Test if we found end \0 - je .Lno_conv - leal 65535(%esi),%ebx # ebx = end-of-string - -.L130: - cmpb $45,%al # Test if '-' - jne .Lpositive - - # negative number - movl $-1,(%ecx) # error = -1 (mark that number is negative) - movl $1,-20(%ebp) # negative= 1 - movl $92233720,-24(%ebp) - movl $368547758,-28(%ebp) - movl $8,-32(%ebp) - jmp .L460 - - .p2align 4,,7 -.Lpositive: - movl $0,(%ecx) # error=0 - movl $0,-20(%ebp) # negative= 0 - movl $184467440,-24(%ebp) - movl $737095516,-28(%ebp) - movl $15,-32(%ebp) - cmpb $43,%al # Check if '+' - jne .L462 - -.L460: - cmpl %ebx,%esi # Check if overflow - je .Lno_conv - movb (%esi), %al # al= next byte after sign - incl %esi - - # Remove pre zero to be able to handle a lot of pre-zero -.L462: - cmpb $48,%al - jne .L475 # Number doesn't start with 0 - decl %esi - .p2align 4,,7 - - # Skip pre zeros -.L481: - incl %esi # Skip processed byte - cmpl %ebx,%esi - je .Lms_return_zero - cmpb (%esi),%al # Test if next byte is also zero - je .L481 - leal 9(%esi),%ecx # ecx = end-of-current-part - xorl %edi,%edi # Store first 9 digits in edi - jmp .L482 - .p2align 4,,7 - - # Check if first char is a valid number -.L475: - addb $-48,%al - cmpb $9,%al - ja .Lno_conv -.L477: - movzbl %al,%edi # edi = first digit - leal 8(%esi),%ecx # ecx = end-of-current-part - - # Handle first 8/9 digits and store them in edi -.L482: - cmpl %ebx,%ecx - jbe .L522 - movl %ebx,%ecx # ecx = min(end-of-current-part, end-of-string) - jmp .L522 - - .p2align 4,,7 -.L488: - movb (%esi), %al # al= next byte - incl %esi - addb $-48,%al - cmpb $9,%al - ja .Lend_i_dec_esi - - # Calculate edi= edi*10 + al - leal (%edi,%edi,4),%edx - movzbl %al,%eax - leal (%eax,%edx,2),%edi -.L522: - cmpl %ecx,%esi # If more digits at this level - jne .L488 - cmpl %ebx,%esi # If end of string - je .Lend_i - - movl %edi,-8(%ebp) # Store first 9 digits - movl %esi,-12(%ebp) # store pos to first digit of second part - - # Calculate next 9 digits and store them in edi - - xorl %edi,%edi - leal 9(%esi),%ecx # ecx= end-of-current-part - movl %ecx,-36(%ebp) # Store max length - cmpl %ebx,%ecx - jbe .L498 - movl %ebx,%ecx # ecx = min(end-of-current-part, end-of-string) - - .p2align 4,,7 -.L498: - movb (%esi), %al # al= next byte - incl %esi - addb $-48,%al - cmpb $9,%al - ja .Lend_i_and_j_decl_esi - - # Calculate edi= edi*10 + al - leal (%edi,%edi,4),%edx - movzbl %al,%eax - leal (%eax,%edx,2),%edi - - cmpl %ecx,%esi # If end of current part - jne .L498 - cmpl %ebx,%esi # If end of string - jne .L500 - cmpl -36(%ebp),%esi # Test if string is less than 18 digits - jne .Lend_i_and_j -.L499: - movl $1000000000,%eax - jmp .Lgot_factor # 18 digit string - - # Handle the possible next to last digit and store in ecx -.L500: - movb (%esi),%al - addb $-48,%al - cmpb $9,%al - ja .L499 # 18 digit string - - incl %esi - movzbl %al,%ecx - cmpl %ebx,%esi # If end of string - je .Lend4 - - movb (%esi),%al # Read last digit - addb $-48,%al - cmpb $9,%al - ja .Lend4 - - # ecx= ecx*10 + al - leal (%ecx,%ecx,4),%edx - movzbl %al,%eax - leal (%eax,%edx,2),%ecx - - movl 12(%ebp),%eax # eax = endptr - incl %esi - movl %esi,(%eax) # *endptr = end-of-string - cmpl %ebx,%esi - je .L505 # At end of string - - movb (%esi),%al # check if extra digits - addb $-48,%al - cmpb $9,%al - jbe .Loverflow - - # At this point we have: - # -8(%ebp) First 9 digits - # edi Next 9 digits - # ecx Last 2 digits - # *endpos end-of-string - -.L505: # Check that we are not going to get overflow for unsigned long long - movl -8(%ebp),%eax # First 9 digits - cmpl -24(%ebp),%eax - ja .Loverflow - jne .L507 - cmpl -28(%ebp),%edi - ja .Loverflow - jne .L507 - cmpl -32(%ebp),%ecx - ja .Loverflow - -.L507: - movl %edi,-4(%ebp) # Save middle bytes - movl %ecx,%esi # esi = 2 last digits - movl $1215752192,%ecx # %ecx= lower_32_bits(100000000000) - mull %ecx - imull $23,-8(%ebp),%ecx - movl $0,-36(%ebp) - movl %eax,%ebx - imull $1215752192,-36(%ebp),%eax - movl %edx,%edi - addl %ecx,%edi - addl %eax,%edi # Temp in edi:ebx - - movl $100,%eax # j= j*100 - mull -4(%ebp) - addl %ebx,%eax # edx:eax+= edi:ebx - adcl %edi,%edx - addl %esi,%eax - adcl $0,%edx - jmp .Lms_return - -.Loverflow: - # When we come here, *endptr is already updated - - movl 16(%ebp),%edx # edx= error - movl $34,(%edx) # *error = 34 - movl $-1,%eax - movl %eax,%edx - cmpl $0,-20(%ebp) # If negative - je .Lms_return - xor %eax,%eax # edx:eax = LONGLONG_LMIN - movl $-2147483648,%edx - jmp .Lms_return - - # Return value that is in %edi as long long - .p2align 4,,7 -.Lend_i_dec_esi: - decl %esi # Fix so that it points at last digit -.Lend_i: - xorl %edx,%edx - movl %edi,%eax - cmpl $0,-20(%ebp) - je .Lreturn_save_endptr # Positive number - negl %eax - cltd # Neg result in edx:eax - jmp .Lreturn_save_endptr - - # Return value (%ebp-8) * lfactor[(uint) (edx-start)] + edi - .p2align 4,,7 -.Lend_i_and_j_decl_esi: - decl %esi # Fix so that it points at last digit -.Lend_i_and_j: - movl %esi,%ecx - subl -12(%ebp),%ecx # ecx= number of digits in second part - - # Calculate %eax= 10 ** %cl, where %cl <= 8 - # With an array one could do this with: - # movl 10_factor_table(,%ecx,4),%eax - # We calculate the table here to avoid problems in - # position independent code (gcc -pic) - - cmpb $3,%cl - ja .L4_to_8 - movl $1000, %eax - je .Lgot_factor # %cl=3, eax= 1000 - movl $10, %eax - cmpb $1,%cl # %cl is here 0 - 2 - je .Lgot_factor # %cl=1, eax= 10 - movl $100, %eax - ja .Lgot_factor # %cl=2, eax=100 - movl $1, %eax - jmp .Lgot_factor # %cl=0, eax=1 - -.L4_to_8: # %cl is here 4-8 - cmpb $5,%cl - movl $100000, %eax - je .Lgot_factor # %cl=5, eax=100000 - movl $10000, %eax - jbe .Lgot_factor # %cl=4, eax=10000 - movl $10000000, %eax - cmpb $7,%cl - je .Lgot_factor # %cl=7, eax=10000000 - movl $100000000, %eax - ja .Lgot_factor # %cl=8, eax=100000000 - movl $1000000, %eax # %cl=6, eax=1000000 - - # Return -8(%ebp) * %eax + edi - .p2align 4,,7 -.Lgot_factor: - mull -8(%ebp) - addl %edi,%eax - adcl $0,%edx - cmpl $0,-20(%ebp) # if negative - je .Lreturn_save_endptr - negl %eax # Neg edx:%eax - adcl $0,%edx - negl %edx - jmp .Lreturn_save_endptr - - # Return -8(%ebp) * $10000000000 + edi*10 + ecx - .p2align 4,,7 -.Lend4: - movl %ecx,-16(%ebp) # store lowest digits - movl 12(%ebp),%ebx - movl %esi,(%ebx) # *endpos = end-of-string - movl -8(%ebp),%eax # First 9 digits - movl $1410065408,%ecx # ecx= lower_32_bits(10000000000) - mull %ecx - movl $0,-36(%ebp) - movl %eax,%ebx # Store lowest 32 byte from multiplication - imull $1410065408,-36(%ebp),%eax - movl -8(%ebp),%ecx # First 9 digits - movl %edx,%esi - addl %ecx,%ecx - addl %ecx,%esi - addl %eax,%esi # %esi:%ebx now has -8(%ebp) * $10000000000 - - movl $10,%eax # Calc edi*10 - mull %edi - addl %ebx,%eax # And add to result - adcl %esi,%edx - addl -16(%ebp),%eax # Add lowest digit - adcl $0,%edx - cmpl $0,-20(%ebp) # if negative - je .Lms_return - - cmpl $-2147483648,%edx # Test if too big signed integer - ja .Loverflow - jne .L516 - testl %eax,%eax - ja .Loverflow - -.L516: - negl %eax - adcl $0,%edx - negl %edx - jmp .Lms_return - - .p2align 4,,7 -.Lno_conv: # Not a legal number - movl 16(%ebp),%eax - movl $33,(%eax) # error= edom - -.Lms_return_zero: - xorl %eax,%eax # Return zero - xorl %edx,%edx - - .p2align 4,,7 -.Lreturn_save_endptr: - movl 12(%ebp),%ecx # endptr= end-of-string - movl %esi,(%ecx) # *endptr= end-of-string - -.Lms_return: - popl %ebx - popl %edi - popl %esi - movl %ebp,%esp - popl %ebp - ret - -.my_strtoll10_end: - .size my_strtoll10,.my_strtoll10_end-my_strtoll10 - .comm res,240,32 - .comm end_ptr,120,32 - .comm error,120,32 - .ident "Monty" diff --git a/dep/mysqllite/strings/my_strtoll10.c b/dep/mysqllite/strings/my_strtoll10.c index 4f73b1f8e717c..b9fc4b4be8ef6 100644 --- a/dep/mysqllite/strings/my_strtoll10.c +++ b/dep/mysqllite/strings/my_strtoll10.c @@ -17,17 +17,6 @@ #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) LL(0x8000000000000000)) #define INIT_CNT 9 #define LFACTOR ULL(1000000000) diff --git a/dep/mysqllite/strings/my_vsnprintf.c b/dep/mysqllite/strings/my_vsnprintf.c index 920022aae91ad..e9786dacfdcd2 100644 --- a/dep/mysqllite/strings/my_vsnprintf.c +++ b/dep/mysqllite/strings/my_vsnprintf.c @@ -18,61 +18,571 @@ #include #include -/* - Limited snprintf() implementations - SYNOPSIS - my_vsnprintf() - to Store result here - n Store up to n-1 characters, followed by an end 0 - fmt printf format - ap Arguments - - IMPLEMENTION: - Supports following formats: - %#[l]d - %#[l]u - %#[l]x - %#.#b Local format; note first # is ignored and second is REQUIRED - %#.#s Note first # is ignored +#define MAX_ARGS 32 /* max positional args count*/ +#define MAX_PRINT_INFO 32 /* max print position count */ + +#define LENGTH_ARG 1 +#define WIDTH_ARG 2 +#define PREZERO_ARG 4 +#define ESCAPED_ARG 8 + +typedef struct pos_arg_info ARGS_INFO; +typedef struct print_info PRINT_INFO; + +struct pos_arg_info +{ + char arg_type; /* argument type */ + uint have_longlong; /* used from integer values */ + char *str_arg; /* string value of the arg */ + longlong longlong_arg; /* integer value of the arg */ + double double_arg; /* double value of the arg */ +}; + + +struct print_info +{ + char arg_type; /* argument type */ + size_t arg_idx; /* index of the positional arg */ + size_t length; /* print width or arg index */ + size_t width; /* print width or arg index */ + uint flags; + const char *begin; /**/ + const char *end; /**/ +}; + + +/** + Calculates print length or index of positional argument + + @param fmt processed string + @param length print length or index of positional argument + @param pre_zero returns flags with PREZERO_ARG set if necessary + + @retval + string position right after length digits +*/ + +static const char *get_length(const char *fmt, size_t *length, uint *pre_zero) +{ + for (; my_isdigit(&my_charset_latin1, *fmt); fmt++) + { + *length= *length * 10 + (uint)(*fmt - '0'); + if (!*length) + *pre_zero|= PREZERO_ARG; /* first digit was 0 */ + } + return fmt; +} + + +/** + Calculates print width or index of positional argument + + @param fmt processed string + @param width print width or index of positional argument + + @retval + string position right after width digits +*/ + +static const char *get_width(const char *fmt, size_t *width) +{ + for (; my_isdigit(&my_charset_latin1, *fmt); fmt++) + { + *width= *width * 10 + (uint)(*fmt - '0'); + } + return fmt; +} + +/** + Calculates print width or index of positional argument + + @param fmt processed string + @param have_longlong TRUE if longlong is required + + @retval + string position right after modifier symbol +*/ + +static const char *check_longlong(const char *fmt, uint *have_longlong) +{ + *have_longlong= 0; + 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)); + } + return fmt; +} + + +/** + Returns escaped string + + @param cs string charset + @param to buffer where escaped string will be placed + @param end end of buffer + @param par string to escape + @param par_len string length + @param quote_char character for quoting + + @retval + position in buffer which points on the end of escaped string +*/ + +static char *backtick_string(CHARSET_INFO *cs, char *to, char *end, + char *par, size_t par_len, char quote_char) +{ + uint char_len; + char *start= to; + char *par_end= par + par_len; + size_t buff_length= (size_t) (end - to); + + if (buff_length <= par_len) + goto err; + *start++= quote_char; + + for ( ; par < par_end; par+= char_len) + { + uchar c= *(uchar *) par; + if (!(char_len= my_mbcharlen(cs, c))) + char_len= 1; + if (char_len == 1 && c == (uchar) quote_char ) + { + if (start + 1 >= end) + goto err; + *start++= quote_char; + } + if (start + char_len >= end) + goto err; + start= strnmov(start, par, char_len); + } - RETURN + if (start + 1 >= end) + goto err; + *start++= quote_char; + return start; + +err: + *to='\0'; + return to; +} + + +/** + Prints string argument +*/ + +static char *process_str_arg(CHARSET_INFO *cs, char *to, char *end, + size_t width, char *par, uint print_type) +{ + int well_formed_error; + 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; + plen= cs->cset->well_formed_len(cs, par, par + plen, + width, &well_formed_error); + if (print_type & ESCAPED_ARG) + to= backtick_string(cs, to, end, par, plen, '`'); + else + to= strnmov(to,par,plen); + return to; +} + + +/** + Prints binary argument +*/ + +static char *process_bin_arg(char *to, char *end, size_t width, char *par) +{ + DBUG_ASSERT(to <= end); + if (to + width + 1 > end) + width= end - to - 1; /* sign doesn't matter */ + memmove(to, par, width); + to+= width; + return to; +} + + +/** + Prints double or float argument +*/ + +static char *process_dbl_arg(char *to, char *end, size_t width, + double par, char arg_type) +{ + 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 (arg_type == 'f') + to+= my_fcvt(par, (int)width , to, NULL); + else + to+= my_gcvt(par, MY_GCVT_ARG_DOUBLE, (int) width , to, NULL); + return to; +} + + +/** + Prints integer argument +*/ + +static char *process_int_arg(char *to, char *end, size_t length, + longlong par, char arg_type, uint print_type) +{ + size_t res_length, to_length; + char *store_start= to, *store_end; + char buff[32]; + + if ((to_length= (size_t) (end-to)) < 16 || length) + store_start= buff; + + if (arg_type == 'd' || arg_type == 'i') + store_end= longlong10_to_str(par, store_start, -10); + else if (arg_type == 'u') + store_end= longlong10_to_str(par, store_start, 10); + else if (arg_type == 'p') + { + store_start[0]= '0'; + store_start[1]= 'x'; + store_end= ll2str(par, store_start + 2, 16, 0); + } + else if (arg_type == 'o') + { + store_end= ll2str(par, store_start, 8, 0); + } + else + { + DBUG_ASSERT(arg_type == 'X' || arg_type =='x'); + store_end= ll2str(par, store_start, 16, (arg_type == 'X')); + } + + if ((res_length= (size_t) (store_end - store_start)) > to_length) + return to; /* 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, (print_type & PREZERO_ARG) ? '0' : ' '); + if (arg_type == 'p' && print_type & PREZERO_ARG) + { + if (diff > 1) + to[1]= 'x'; + else + store_start[0]= 'x'; + store_start[1]= '0'; + } + to+= diff; + } + bmove(to, store_start, res_length); + } + to+= res_length; + return to; +} + + +/** + Procesed positional arguments. + + @param cs string charset + @param to buffer where processed string will be place + @param end end of buffer + @param par format string + @param arg_index arg index of the first occurrence of positional arg + @param ap list of parameters + + @retval + end of buffer where processed string is placed +*/ + +static char *process_args(CHARSET_INFO *cs, char *to, char *end, + const char* fmt, size_t arg_index, va_list ap) +{ + ARGS_INFO args_arr[MAX_ARGS]; + PRINT_INFO print_arr[MAX_PRINT_INFO]; + uint idx= 0, arg_count= arg_index; + +start: + /* Here we are at the beginning of positional argument, right after $ */ + arg_index--; + print_arr[idx].flags= 0; + if (*fmt == '`') + { + print_arr[idx].flags|= ESCAPED_ARG; + fmt++; + } + if (*fmt == '-') + fmt++; + print_arr[idx].length= print_arr[idx].width= 0; + /* Get print length */ + if (*fmt == '*') + { + fmt++; + fmt= get_length(fmt, &print_arr[idx].length, &print_arr[idx].flags); + print_arr[idx].length--; + DBUG_ASSERT(*fmt == '$' && print_arr[idx].length < MAX_ARGS); + args_arr[print_arr[idx].length].arg_type= 'd'; + print_arr[idx].flags|= LENGTH_ARG; + arg_count= max(arg_count, print_arr[idx].length + 1); + fmt++; + } + else + fmt= get_length(fmt, &print_arr[idx].length, &print_arr[idx].flags); + + if (*fmt == '.') + { + fmt++; + /* Get print width */ + if (*fmt == '*') + { + fmt++; + fmt= get_width(fmt, &print_arr[idx].width); + print_arr[idx].width--; + DBUG_ASSERT(*fmt == '$' && print_arr[idx].width < MAX_ARGS); + args_arr[print_arr[idx].width].arg_type= 'd'; + print_arr[idx].flags|= WIDTH_ARG; + arg_count= max(arg_count, print_arr[idx].width + 1); + fmt++; + } + else + fmt= get_width(fmt, &print_arr[idx].width); + } + else + print_arr[idx].width= SIZE_T_MAX; + + fmt= check_longlong(fmt, &args_arr[arg_index].have_longlong); + if (*fmt == 'p') + args_arr[arg_index].have_longlong= (sizeof(void *) == sizeof(longlong)); + args_arr[arg_index].arg_type= print_arr[idx].arg_type= *fmt; + + print_arr[idx].arg_idx= arg_index; + print_arr[idx].begin= ++fmt; + + while (*fmt && *fmt != '%') + fmt++; + + if (!*fmt) /* End of format string */ + { + uint i; + print_arr[idx].end= fmt; + /* Obtain parameters from the list */ + for (i= 0 ; i < arg_count; i++) + { + switch (args_arr[i].arg_type) { + case 's': + case 'b': + args_arr[i].str_arg= va_arg(ap, char *); + break; + case 'f': + case 'g': + args_arr[i].double_arg= va_arg(ap, double); + break; + case 'd': + case 'i': + case 'u': + case 'x': + case 'X': + case 'o': + case 'p': + if (args_arr[i].have_longlong) + args_arr[i].longlong_arg= va_arg(ap,longlong); + else if (args_arr[i].arg_type == 'd' || args_arr[i].arg_type == 'i') + args_arr[i].longlong_arg= va_arg(ap, int); + else + args_arr[i].longlong_arg= va_arg(ap, uint); + break; + case 'c': + args_arr[i].longlong_arg= va_arg(ap, int); + break; + default: + DBUG_ASSERT(0); + } + } + /* Print result string */ + for (i= 0; i <= idx; i++) + { + size_t width= 0, length= 0; + switch (print_arr[i].arg_type) { + case 's': + { + char *par= args_arr[print_arr[i].arg_idx].str_arg; + width= (print_arr[i].flags & WIDTH_ARG) + ? (size_t)args_arr[print_arr[i].width].longlong_arg + : print_arr[i].width; + to= process_str_arg(cs, to, end, width, par, print_arr[i].flags); + break; + } + case 'b': + { + char *par = args_arr[print_arr[i].arg_idx].str_arg; + width= (print_arr[i].flags & WIDTH_ARG) + ? (size_t)args_arr[print_arr[i].width].longlong_arg + : print_arr[i].width; + to= process_bin_arg(to, end, width, par); + break; + } + case 'c': + { + if (to == end) + break; + *to++= (char) args_arr[print_arr[i].arg_idx].longlong_arg; + break; + } + case 'f': + case 'g': + { + double d= args_arr[print_arr[i].arg_idx].double_arg; + width= (print_arr[i].flags & WIDTH_ARG) ? + (uint)args_arr[print_arr[i].width].longlong_arg : print_arr[i].width; + to= process_dbl_arg(to, end, width, d, print_arr[i].arg_type); + break; + } + case 'd': + case 'i': + case 'u': + case 'x': + case 'X': + case 'o': + case 'p': + { + /* Integer parameter */ + longlong larg; + length= (print_arr[i].flags & LENGTH_ARG) + ? (size_t)args_arr[print_arr[i].length].longlong_arg + : print_arr[i].length; + + if (args_arr[print_arr[i].arg_idx].have_longlong) + larg = args_arr[print_arr[i].arg_idx].longlong_arg; + else if (print_arr[i].arg_type == 'd' || print_arr[i].arg_type == 'i' ) + larg = (int) args_arr[print_arr[i].arg_idx].longlong_arg; + else + larg= (uint) args_arr[print_arr[i].arg_idx].longlong_arg; + + to= process_int_arg(to, end, length, larg, print_arr[i].arg_type, + print_arr[i].flags); + break; + } + default: + break; + } + + if (to == end) + break; + + length= min(end - to , print_arr[i].end - print_arr[i].begin); + if (to + length < end) + length++; + to= strnmov(to, print_arr[i].begin, length); + } + DBUG_ASSERT(to <= end); + *to='\0'; /* End of errmessage */ + return to; + } + else + { + /* Process next positional argument*/ + DBUG_ASSERT(*fmt == '%'); + print_arr[idx].end= fmt - 1; + idx++; + fmt++; + arg_index= 0; + fmt= get_width(fmt, &arg_index); + DBUG_ASSERT(*fmt == '$'); + fmt++; + arg_count= max(arg_count, arg_index); + goto start; + } + + return 0; +} + + + +/** + Produces output string according to a format string + + See the detailed documentation around my_snprintf_service_st + + @param cs string charset + @param to buffer where processed string will be place + @param n size of buffer + @param par format string + @param ap list of parameters + + @retval length of result string */ -size_t my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap) +size_t my_vsnprintf_ex(CHARSET_INFO *cs, 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_long; + uint print_type, have_longlong; for (; *fmt ; fmt++) { if (*fmt != '%') { - if (to == end) /* End of buffer */ + if (to == end) /* End of buffer */ break; - *to++= *fmt; /* Copy ordinary char */ + *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_long= 0; - if (*fmt == '*') + print_type= 0; + + /* Read max fill size (only used with %d and %u) */ + if (my_isdigit(&my_charset_latin1, *fmt)) { - fmt++; - length= va_arg(ap, int); + fmt= get_length(fmt, &length, &print_type); + if (*fmt == '$') + { + to= process_args(cs, to, end, (fmt+1), length, ap); + return (size_t) (to - start); + } } else - for (; my_isdigit(&my_charset_latin1, *fmt); fmt++) + { + if (*fmt == '`') + { + print_type|= ESCAPED_ARG; + fmt++; + } + if (*fmt == '-') + fmt++; + if (*fmt == '*') { - length= length * 10 + (uint)(*fmt - '0'); - if (!length) - pre_zero= 1; /* first digit was 0 */ + fmt++; + length= va_arg(ap, int); } + else + fmt= get_length(fmt, &length, &print_type); + } + if (*fmt == '.') { fmt++; @@ -82,75 +592,47 @@ size_t my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap) width= va_arg(ap, int); } else - for (; my_isdigit(&my_charset_latin1, *fmt); fmt++) - width= width * 10 + (uint)(*fmt - '0'); + fmt= get_width(fmt, &width); } else - width= ~0; - if (*fmt == 'l') - { - fmt++; - have_long= 1; - } + width= SIZE_T_MAX; + + fmt= check_longlong(fmt, &have_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= (uint) strnlen(par, width); - if (left_len <= plen) - plen = left_len - 1; - to=strnmov(to,par,plen); + reg2 char *par= va_arg(ap, char *); + to= process_str_arg(cs, to, end, width, par, print_type); continue; } else if (*fmt == 'b') /* Buffer parameter */ { char *par = va_arg(ap, char *); - DBUG_ASSERT(to <= end); - if (to + abs(width) + 1 > end) - width= (uint) (end - to - 1); /* sign doesn't matter */ - memmove(to, par, abs(width)); - to+= width; + to= process_bin_arg(to, end, width, par); continue; } - else if (*fmt == 'd' || *fmt == 'u'|| *fmt== 'x') /* Integer parameter */ + else if (*fmt == 'f' || *fmt == 'g') { - register long larg; - size_t res_length, to_length; - char *store_start= to, *store_end; - char buff[32]; - - if ((to_length= (size_t) (end-to)) < 16 || length) - store_start= buff; - if (have_long) - larg = va_arg(ap, long); - else - if (*fmt == 'd') - larg = va_arg(ap, int); - else - larg= (long) (uint) va_arg(ap, int); - if (*fmt == 'd') - store_end= int10_to_str(larg, store_start, -10); + double d= va_arg(ap, double); + to= process_dbl_arg(to, end, width, d, *fmt); + continue; + } + else if (*fmt == 'd' || *fmt == 'i' || *fmt == 'u' || *fmt == 'x' || + *fmt == 'X' || *fmt == 'p' || *fmt == 'o') + { + /* Integer parameter */ + longlong larg; + if (*fmt == 'p') + have_longlong= (sizeof(void *) == sizeof(longlong)); + + if (have_longlong) + larg = va_arg(ap,longlong); + else if (*fmt == 'd' || *fmt == 'i') + larg = va_arg(ap, int); else - if (*fmt== 'u') - store_end= int10_to_str(larg, store_start, 10); - else - store_end= int2str(larg, store_start, 16, 0); - 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; + larg= va_arg(ap, uint); + + to= process_int_arg(to, end, length, larg, *fmt, print_type); continue; } else if (*fmt == 'c') /* Character parameter */ @@ -174,6 +656,19 @@ size_t my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap) } +/* + 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) +{ + return my_vsnprintf_ex(&my_charset_latin1, to, n, fmt, ap); +} + + size_t my_snprintf(char* to, size_t n, const char* fmt, ...) { size_t result; @@ -184,42 +679,3 @@ size_t my_snprintf(char* to, size_t n, const char* fmt, ...) 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/dep/mysqllite/strings/strappend-sparc.s b/dep/mysqllite/strings/strappend-sparc.s deleted file mode 100644 index d5add816eb0a6..0000000000000 --- a/dep/mysqllite/strings/strappend-sparc.s +++ /dev/null @@ -1,49 +0,0 @@ -! Copyright (C) 2000, 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 "strappend-sparc.s" -.section ".text" - .align 4 - .global strappend - .type strappend,#function - .proc 020 -strappend: - add %o0, %o1, %o3 ! o3 = endpos - ldsb [%o0], %o4 -.loop1: - add %o0, 1, %o0 ! find end of str - cmp %o4, 0 - bne,a .loop1 - ldsb [%o0], %o4 - - sub %o0, 1, %o0 - cmp %o0, %o3 - bgeu .end - nop - - stb %o2, [%o0] -.loop2: - add %o0, 1, %o0 - cmp %o0, %o3 - blu,a .loop2 - stb %o2, [%o0] -.end: - retl - stb %g0, [%o3] -.strappend_end: - .size strappend,.strappend_end-strappend - .ident "Matt Wagner & Monty" diff --git a/dep/mysqllite/strings/strtoll.c b/dep/mysqllite/strings/strappend.c similarity index 55% rename from dep/mysqllite/strings/strtoll.c rename to dep/mysqllite/strings/strappend.c index cfb6fbd75ee56..bb926f7466563 100644 --- a/dep/mysqllite/strings/strtoll.c +++ b/dep/mysqllite/strings/strappend.c @@ -13,21 +13,27 @@ 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 */ +/* File : strappend.c + Author : Monty + Updated: 1987.02.07 + Defines: strappend() + strappend(dest, len, fill) appends fill-characters to a string so that + the result length == len. If the string is longer than len it's + trunked. The des+len character is allways set to NULL. +*/ -/* - 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 +#include "m_string.h" -#if !defined(HAVE_STRTOLL) && defined(HAVE_LONG_LONG) -#define USE_LONGLONG -#include "strto.c" -#endif + +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 (;;) @@ -51,4 +34,3 @@ char *strcend(register const char *s, register pchar c) } } -#endif diff --git a/dep/mysqllite/strings/strend-sparc.s b/dep/mysqllite/strings/strend-sparc.s deleted file mode 100644 index f264fcef32fb5..0000000000000 --- a/dep/mysqllite/strings/strend-sparc.s +++ /dev/null @@ -1,35 +0,0 @@ -! Copyright (C) 2000, 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-sparc.s" -.section ".text" - .align 4 - .global strend - .type strend,#function - .proc 0102 -strend: - ldsb [%o0], %o3 ! Handle first char differently to make -.loop: ! a faster loop - add %o0, 1, %o0 - cmp %o3, 0 - bne,a .loop - ldsb [%o0], %o3 - retl - sub %o0,1,%o0 -.strend_end: - .size strend,.strend_end-strend - .ident "Matt Wagner & Monty" diff --git a/dep/mysqllite/strings/strend.c b/dep/mysqllite/strings/strend.c index 4dadf0675dc4e..d70a5d648d511 100644 --- a/dep/mysqllite/strings/strend.c +++ b/dep/mysqllite/strings/strend.c @@ -24,27 +24,14 @@ 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/dep/mysqllite/strings/strings-x86.s b/dep/mysqllite/strings/strings-x86.s deleted file mode 100644 index db7bb0c1274f8..0000000000000 --- a/dep/mysqllite/strings/strings-x86.s +++ /dev/null @@ -1,416 +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 - -# Optimized string functions Intel 80x86 (gcc/gas syntax) - - .file "strings.s" - .version "1.00" - -.text - -# Move a alligned, not overlapped, by (long) divided memory area -# Args: to,from,length - -.globl bmove_align - .type bmove_align,@function -bmove_align: - movl %edi,%edx - push %esi - movl 4(%esp),%edi # to - movl 8(%esp),%esi # from - movl 12(%esp),%ecx # length - addw $3,%cx # fix if not divisible with long - shrw $2,%cx - jz .ba_20 - .p2align 4,,7 -.ba_10: - movl -4(%esi,%ecx),%eax - movl %eax,-4(%edi,%ecx) - decl %ecx - jnz .ba_10 -.ba_20: pop %esi - movl %edx,%edi - ret - -.bmove_align_end: - .size bmove_align,.bmove_align_end-bmove_align - - # Move a string from higher to lower - # Arg from_end+1,to_end+1,length - -.globl bmove_upp - .type bmove_upp,@function -bmove_upp: - movl %edi,%edx # Remember %edi - push %esi - movl 8(%esp),%edi # dst - movl 16(%esp),%ecx # length - movl 12(%esp),%esi # source - test %ecx,%ecx - jz .bu_20 - subl %ecx,%esi # To start of strings - subl %ecx,%edi - - .p2align 4,,7 -.bu_10: movb -1(%esi,%ecx),%al - movb %al,-1(%edi,%ecx) - decl %ecx - jnz .bu_10 -.bu_20: pop %esi - movl %edx,%edi - ret - -.bmove_upp_end: - .size bmove_upp,.bmove_upp_end-bmove_upp - - # Append fillchars to string - # Args: dest,len,fill - -.globl strappend - .type strappend,@function -strappend: - pushl %edi - movl 8(%esp),%edi # Memory pointer - movl 12(%esp),%ecx # Length - clrl %eax # Find end of string - repne - scasb - jnz sa_99 # String to long, shorten it - movzb 16(%esp),%eax # Fillchar - decl %edi # Point at end null - incl %ecx # rep made one dec for null-char - - movb %al,%ah # (2) Set up a 32 bit pattern. - movw %ax,%dx # (2) - shll $16,%eax # (3) - movw %dx,%ax # (2) %eax has the 32 bit pattern. - - movl %ecx,%edx # (2) Save the count of bytes. - shrl $2,%ecx # (2) Number of dwords. - rep - stosl # (5 + 5n) - movb $3,%cl # (2) - and %edx,%ecx # (2) Fill in the odd bytes - rep - stosb # Move last bytes if any - -sa_99: movb $0,(%edi) # End of string - popl %edi - ret -.strappend_end: - .size strappend,.strappend_end-strappend - - # Find if string contains any char in another string - # Arg: str,set - # Ret: Pointer to first found char in str - -.globl strcont - .type strcont,@function -strcont: - movl %edi,%edx - pushl %esi - movl 8(%esp),%esi # str - movl 12(%esp),%ecx # set - clrb %ah # For endtest - jmp sc_60 - -sc_10: scasb - jz sc_fo # Found char -sc_20: cmp (%edi),%ah # Test if null - jnz sc_10 # Not end of set yet - incl %esi # Next char in str -sc_60: movl %ecx,%edi # %edi = Set - movb (%esi),%al # Test if this char exist - andb %al,%al - jnz sc_20 # Not end of string - clrl %esi # Return Null -sc_fo: movl %esi,%eax # Char found here - movl %edx,%edi # Restore - popl %esi - ret -.strcont_end: - .size strcont,.strcont_end-strcont - - # Find end of string - # Arg: str - # ret: Pointer to end null - -.globl strend - .type strend,@function -strend: - movl %edi,%edx # Save - movl 4(%esp),%edi # str - clrl %eax # Find end of string - movl %eax,%ecx - decl %ecx # ECX = -1 - repne - scasb - movl %edi,%eax - decl %eax # End of string - movl %edx,%edi # Restore - ret -.strend_end: - .size strend,.strend_end-strend - - # Make a string with len fill-chars and endnull - # Args: dest,len,fill - # Ret: dest+len - -.globl strfill - .type strfill,@function -strfill: - pushl %edi - movl 8(%esp),%edi # Memory pointer - movl 12(%esp),%ecx # Length - movzb 16(%esp),%eax # Fill - - movb %al,%ah # (2) Set up a 32 bit pattern - movw %ax,%dx # (2) - shll $16,%eax # (3) - movw %dx,%ax # (2) %eax has the 32 bit pattern. - - movl %ecx,%edx # (2) Save the count of bytes. - shrl $2,%ecx # (2) Number of dwords. - rep - stosl # (5 + 5n) - movb $3,%cl # (2) - and %edx,%ecx # (2) Fill in the odd bytes - rep - stosb # Move last bytes if any - - movb %cl,(%edi) # End NULL - movl %edi,%eax # End i %eax - popl %edi - ret -.strfill_end: - .size strfill,.strfill_end-strfill - - - # Find a char in or end of a string - # Arg: str,char - # Ret: pointer to found char or NullS - -.globl strcend - .type strcend,@function -strcend: - movl %edi,%edx - movl 4(%esp),%edi # str - movb 8(%esp),%ah # search - clrb %al # for scasb to find end - -se_10: cmpb (%edi),%ah - jz se_20 # Found char - scasb - jnz se_10 # Not end - dec %edi # Not found, point at end of string -se_20: movl %edi,%eax - movl %edx,%edi # Restore - ret -.strcend_end: - .size strcend,.strcend_end-strcend - - # Test if string has a given suffix - -.globl is_prefix - .type is_prefix,@function -is_prefix: - movl %edi,%edx # Save %edi - pushl %esi # and %esi - movl 12(%esp),%esi # get suffix - movl 8(%esp),%edi # s1 - movl $1,%eax # Ok and zero-test -ip_10: cmpb (%esi),%ah - jz suf_ok # End of string/ found suffix - cmpsb # Compare strings - jz ip_10 # Same, possible prefix - xor %eax,%eax # Not suffix -suf_ok: popl %esi - movl %edx,%edi - ret -.is_prefix_end: - .size is_prefix,.is_prefix_end-is_prefix - - # Find a substring in string - # Arg: str,search - -.globl strstr - .type strstr,@function - -strstr: - pushl %edi - pushl %esi - movl 12(%esp),%esi # str - movl 16(%esp),%edi # search - movl %edi,%ecx - incl %ecx # %ecx = search+1 - movb (%edi),%ah # %ah = First char in search - jmp sf_10 - -sf_00: movl %edx,%esi # si = Current str-pos -sf_10: movb (%esi),%al # Test if this char exist - andb %al,%al - jz sf_90 # End of string, didn't find search - incl %esi - cmpb %al,%ah - jnz sf_10 # Didn't find first char, continue - movl %esi,%edx # Save str-pos in %edx - movl %ecx,%edi -sf_20: cmpb $0,(%edi) - jz sf_fo # Found substring - cmpsb - jz sf_20 # Char ok - jmp sf_00 # Next str-pos - -sf_90: movl $1,%edx # Return Null -sf_fo: movl %edx,%eax # Char found here - decl %eax # Pointed one after - popl %esi - popl %edi - ret -.strstr_end: - .size strstr,.strstr_end-strstr - - - # Find a substring in string, return index - # Arg: str,search - -.globl strinstr - .type strinstr,@function - -strinstr: - pushl %ebp - movl %esp,%ebp - pushl 12(%ebp) # search - pushl 8(%ebp) # str - call strstr - add $8,%esp - or %eax,%eax - jz si_99 # Not found, return NULL - sub 8(%ebp),%eax # Pos from start - inc %eax # And first pos = 1 -si_99: popl %ebp - ret -.strinstr_end: - .size strinstr,.strinstr_end-strinstr - - # Make a string of len length from another string - # Arg: dst,src,length - # ret: end of dst - -.globl strmake - .type strmake,@function - -strmake: - pushl %edi - pushl %esi - mov 12(%esp),%edi # dst - movl $0,%edx - movl 20(%esp),%ecx # length - movl 16(%esp),%esi # src - cmpl %edx,%ecx - jz sm_90 -sm_00: movb (%esi,%edx),%al - cmpb $0,%al - jz sm_90 - movb %al,(%edi,%edx) - incl %edx - cmpl %edx,%ecx - jnz sm_00 -sm_90: movb $0,(%edi,%edx) -sm_99: lea (%edi,%edx),%eax # Return pointer to end null - pop %esi - pop %edi - ret -.strmake_end: - .size strmake,.strmake_end-strmake - - # Move a string with max len chars - # arg: dst,src,len - # ret: pos to first null or dst+len - -.globl strnmov - .type strnmov,@function -strnmov: - pushl %edi - pushl %esi - movl 12(%esp),%edi # dst - movl 16(%esp),%esi # src - movl 20(%esp),%ecx # Length of memory-area - jecxz snm_99 # Nothing to do - clrb %al # For test of end-null - -snm_10: cmpb (%esi),%al # Next char to move - movsb # move arg - jz snm_20 # last char, fill with null - loop snm_10 # Continue moving - incl %edi # Point two after last -snm_20: decl %edi # Point at first null (or last+1) -snm_99: movl %edi,%eax # Pointer at last char - popl %esi - popl %edi - ret -.strnmov_end: - .size strnmov,.strnmov_end-strnmov - - -.globl strmov - .type strmov,@function -strmov: - movl %esi,%ecx # Save old %esi and %edi - movl %edi,%edx - movl 8(%esp),%esi # get source pointer (s2) - movl 4(%esp),%edi # %edi -> s1 -smo_10: movb (%esi),%al - movsb # move arg - andb %al,%al - jnz smo_10 # Not last - movl %edi,%eax - dec %eax - movl %ecx,%esi # Restore - movl %edx,%edi - ret -.strmov_end: - .size strmov,.strmov_end-strmov - -.globl strxmov - .type strxmov,@function -strxmov: - movl %ebx,%edx # Save %ebx, %esi and %edi - mov %esi,%ecx - push %edi - leal 8(%esp),%ebx # Get destination - movl (%ebx),%edi - xorb %al,%al - jmp next_str # Handle source ebx+4 - -start_str: - movsb - cmpb -1(%edi),%al - jne start_str - decl %edi # Don't copy last null - -next_str: - addl $4,%ebx - movl (%ebx),%esi - orl %esi,%esi - jne start_str - movb %al,0(%edi) # Force last to ASCII 0 - - movl %edi,%eax # Return ptr to ASCII 0 - pop %edi # Restore registers - movl %ecx,%esi - movl %edx,%ebx - ret -.strxmov_end: - .size strxmov,.strxmov_end-strxmov diff --git a/dep/mysqllite/strings/strinstr-sparc.s b/dep/mysqllite/strings/strinstr-sparc.s deleted file mode 100644 index 5278aff6aa7a5..0000000000000 --- a/dep/mysqllite/strings/strinstr-sparc.s +++ /dev/null @@ -1,43 +0,0 @@ -! 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 - - .file "strinstr-sparc.s" -.section ".text" - .align 4 - .global strinstr - .type strinstr,#function - .proc 0102 -strinstr: - save %sp,-96,%sp - or %g0,%i1,%o1 - call strstr,2 ! Result = %o0 - or %g0,%i0,%o0 - orcc %g0,%o0,%o0 - bne .end - sub %o0,%i0,%i0 - ret - restore %g0,%g0,%o0 -.end: - ret - restore %i0,1,%o0 ! Offset for return value is from 1 - -.strinstr_end: - .size strinstr,.strinstr_end-strinstr - .ident "Matt Wagner & Monty" - - - diff --git a/dep/mysqllite/strings/strinstr.c b/dep/mysqllite/strings/strinstr.c deleted file mode 100644 index dce498d61e801..0000000000000 --- a/dep/mysqllite/strings/strinstr.c +++ /dev/null @@ -1,48 +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 */ - -/* 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/dep/mysqllite/strings/strmake-sparc.s b/dep/mysqllite/strings/strmake-sparc.s deleted file mode 100644 index 36db8efd402b4..0000000000000 --- a/dep/mysqllite/strings/strmake-sparc.s +++ /dev/null @@ -1,43 +0,0 @@ -! Copyright (C) 2000, 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 "strmake-sparc.s" -.section ".text" - .align 4 - .global strmake - .type strmake,#function - .proc 0102 -strmake: - orcc %g0,%o2,%g0 - be,a .end - nop - ldsb [%o1],%o3 -.loop: - stb %o3,[%o0] - cmp %o3,0 - be .end ! Jump to end on end of string - add %o1,1,%o1 - add %o0,1,%o0 - subcc %o2,1,%o2 - bne,a .loop - ldsb [%o1],%o3 -.end: - retl - stb %g0,[%o0] -.strmake_end: - .size strmake,.strmake_end-strmake - .ident "Matt Wagner & Monty" diff --git a/dep/mysqllite/strings/strmov-sparc.s b/dep/mysqllite/strings/strmov-sparc.s deleted file mode 100644 index f124da2dc9f69..0000000000000 --- a/dep/mysqllite/strings/strmov-sparc.s +++ /dev/null @@ -1,36 +0,0 @@ -! Copyright (C) 2000, 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 "strmov-sparc.s" -.section ".text" - .align 4 - .global strmov - .type strmov,#function - .proc 0102 -strmov: -.loop: - ldub [%o1], %o3 - stb %o3, [%o0] - add %o1, 1, %o1 - cmp %o3, 0 - bne,a .loop - add %o0, 1, %o0 - retl - nop -.strmov_end: - .size strmov,.strmov_end-strmov - .ident "Matt Wagner" diff --git a/dep/mysqllite/strings/strmov.c b/dep/mysqllite/strings/strmov.c index eedf22a4ef1ed..4d4915d27a012 100644 --- a/dep/mysqllite/strings/strmov.c +++ b/dep/mysqllite/strings/strmov.c @@ -29,25 +29,9 @@ #define strmov strmov_overlapp #endif -#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 diff --git a/dep/mysqllite/strings/strnmov-sparc.s b/dep/mysqllite/strings/strnmov-sparc.s deleted file mode 100644 index df0c4bebf034d..0000000000000 --- a/dep/mysqllite/strings/strnmov-sparc.s +++ /dev/null @@ -1,43 +0,0 @@ -! Copyright (C) 2000, 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 "strnmov-sparc.s" -.section ".text" - .align 4 - .global strnmov - .type strnmov,#function - .proc 0102 -strnmov: - orcc %g0,%o2,%g0 - be,a .end - nop - ldsb [%o1],%o3 -.loop: - stb %o3,[%o0] - cmp %o3,0 - be .end ! Jump to end on end of string - add %o1,1,%o1 - add %o0,1,%o0 - subcc %o2,1,%o2 - bne,a .loop - ldsb [%o1],%o3 -.end: - retl - nop -.strnmov_end: - .size strnmov,.strnmov_end-strnmov - .ident "Matt Wagner" diff --git a/dep/mysqllite/strings/strstr-sparc.s b/dep/mysqllite/strings/strstr-sparc.s deleted file mode 100644 index 2a6590c9c9318..0000000000000 --- a/dep/mysqllite/strings/strstr-sparc.s +++ /dev/null @@ -1,72 +0,0 @@ -! Copyright (C) 2000, 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-sparc.s" -.section ".text" - .align 4 - .global strstr - .type strstr,#function - .proc 0102 -strstr: - -!char *strstr(register const char *str,const char *search) -!{ -! register char *i,*j; -!skipp: -! while (*str != '\0') { -! if (*str++ == *search) { -! i=(char*) str; j=(char*) search+1; - - ldsb [%o1],%o2 ! o2= First char of search -.top: - ldsb [%o0],%o4 ! o4= First char of rest of str - cmp %o4,0 - be .abort ! Found end null ; - cmp %o4,%o2 - bne .top - add %o0,1,%o0 - -.outloop1: - -! while (*j) -! if (*i++ != *j++) goto skipp; - - or %g0,%o0,%o3 - add %o1,1,%o4 ! o4= search+1 - ldsb [%o0],%o5 ! o5= [current_str+1] - -.loop2: - ldsb [%o4],%g4 - add %o4,1,%o4 - cmp %g4,0 - be .end - cmp %o5,%g4 - bne .top - add %o3,1,%o3 - ba .loop2 - ldsb [%o3],%o5 - -.end: - retl - sub %o0,1,%o0 -.abort: - retl - or %g0,0,%o0 - -.strstr_end: - .size strstr,.strstr_end-strstr - .ident "Matt Wagner & Monty" diff --git a/dep/mysqllite/strings/strto.c b/dep/mysqllite/strings/strto.c deleted file mode 100644 index fcb0d800b8193..0000000000000 --- a/dep/mysqllite/strings/strto.c +++ /dev/null @@ -1,209 +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 */ - -/* - 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/dep/mysqllite/strings/strtod.c b/dep/mysqllite/strings/strtod.c deleted file mode 100644 index 4c9cf931cb31b..0000000000000 --- a/dep/mysqllite/strings/strtod.c +++ /dev/null @@ -1,236 +0,0 @@ -/* - An alternative implementation of "strtod()" that is both - simplier, and thread-safe. - - Original code from mit-threads as bundled with MySQL 3.23 - - SQL:2003 specifies a number as - - ::= [ ] - - ::= - - | - - ::= - [ [ ] ] - | - - ::= E - - ::= - - ::= - - So do we. - - */ - -#include "my_base.h" /* Includes errno.h + EOVERFLOW */ -#include "m_ctype.h" -#ifdef HAVE_IEEEFP_H -#include -#endif - -#define MAX_DBL_EXP 308 -#define MAX_RESULT_FOR_MAX_EXP 1.7976931348623157 - -const double log_10[] = { - 1e000, 1e001, 1e002, 1e003, 1e004, 1e005, 1e006, 1e007, 1e008, 1e009, - 1e010, 1e011, 1e012, 1e013, 1e014, 1e015, 1e016, 1e017, 1e018, 1e019, - 1e020, 1e021, 1e022, 1e023, 1e024, 1e025, 1e026, 1e027, 1e028, 1e029, - 1e030, 1e031, 1e032, 1e033, 1e034, 1e035, 1e036, 1e037, 1e038, 1e039, - 1e040, 1e041, 1e042, 1e043, 1e044, 1e045, 1e046, 1e047, 1e048, 1e049, - 1e050, 1e051, 1e052, 1e053, 1e054, 1e055, 1e056, 1e057, 1e058, 1e059, - 1e060, 1e061, 1e062, 1e063, 1e064, 1e065, 1e066, 1e067, 1e068, 1e069, - 1e070, 1e071, 1e072, 1e073, 1e074, 1e075, 1e076, 1e077, 1e078, 1e079, - 1e080, 1e081, 1e082, 1e083, 1e084, 1e085, 1e086, 1e087, 1e088, 1e089, - 1e090, 1e091, 1e092, 1e093, 1e094, 1e095, 1e096, 1e097, 1e098, 1e099, - 1e100, 1e101, 1e102, 1e103, 1e104, 1e105, 1e106, 1e107, 1e108, 1e109, - 1e110, 1e111, 1e112, 1e113, 1e114, 1e115, 1e116, 1e117, 1e118, 1e119, - 1e120, 1e121, 1e122, 1e123, 1e124, 1e125, 1e126, 1e127, 1e128, 1e129, - 1e130, 1e131, 1e132, 1e133, 1e134, 1e135, 1e136, 1e137, 1e138, 1e139, - 1e140, 1e141, 1e142, 1e143, 1e144, 1e145, 1e146, 1e147, 1e148, 1e149, - 1e150, 1e151, 1e152, 1e153, 1e154, 1e155, 1e156, 1e157, 1e158, 1e159, - 1e160, 1e161, 1e162, 1e163, 1e164, 1e165, 1e166, 1e167, 1e168, 1e169, - 1e170, 1e171, 1e172, 1e173, 1e174, 1e175, 1e176, 1e177, 1e178, 1e179, - 1e180, 1e181, 1e182, 1e183, 1e184, 1e185, 1e186, 1e187, 1e188, 1e189, - 1e190, 1e191, 1e192, 1e193, 1e194, 1e195, 1e196, 1e197, 1e198, 1e199, - 1e200, 1e201, 1e202, 1e203, 1e204, 1e205, 1e206, 1e207, 1e208, 1e209, - 1e210, 1e211, 1e212, 1e213, 1e214, 1e215, 1e216, 1e217, 1e218, 1e219, - 1e220, 1e221, 1e222, 1e223, 1e224, 1e225, 1e226, 1e227, 1e228, 1e229, - 1e230, 1e231, 1e232, 1e233, 1e234, 1e235, 1e236, 1e237, 1e238, 1e239, - 1e240, 1e241, 1e242, 1e243, 1e244, 1e245, 1e246, 1e247, 1e248, 1e249, - 1e250, 1e251, 1e252, 1e253, 1e254, 1e255, 1e256, 1e257, 1e258, 1e259, - 1e260, 1e261, 1e262, 1e263, 1e264, 1e265, 1e266, 1e267, 1e268, 1e269, - 1e270, 1e271, 1e272, 1e273, 1e274, 1e275, 1e276, 1e277, 1e278, 1e279, - 1e280, 1e281, 1e282, 1e283, 1e284, 1e285, 1e286, 1e287, 1e288, 1e289, - 1e290, 1e291, 1e292, 1e293, 1e294, 1e295, 1e296, 1e297, 1e298, 1e299, - 1e300, 1e301, 1e302, 1e303, 1e304, 1e305, 1e306, 1e307, 1e308 -}; - -/* - Convert string to double (string doesn't have to be null terminated) - - SYNOPSIS - my_strtod() - str String to convert - end_ptr Pointer to pointer that points to end of string - Will be updated to point to end of double. - error Will contain error number in case of error (else 0) - - RETURN - value of str as double -*/ - -double my_strtod(const char *str, char **end_ptr, int *error) -{ - double result= 0.0; - uint negative= 0, neg_exp= 0; - size_t ndigits, dec_digits= 0; - int exponent= 0, digits_after_dec_point= 0, tmp_exp, step; - const char *old_str, *end= *end_ptr, *start_of_number; - char next_char; - my_bool overflow=0; - double scaler= 1.0; - - *error= 0; - if (str >= end) - goto done; - - while (my_isspace(&my_charset_latin1, *str)) - { - if (++str == end) - goto done; - } - - start_of_number= str; - if ((negative= (*str == '-')) || *str=='+') - { - if (++str == end) - goto done; /* Could be changed to error */ - } - - /* Skip pre-zero for easier calculation of overflows */ - while (*str == '0') - { - if (++str == end) - goto done; - start_of_number= 0; /* Found digit */ - } - - old_str= str; - while ((next_char= *str) >= '0' && next_char <= '9') - { - result= result*10.0 + (next_char - '0'); - scaler= scaler*10.0; - if (++str == end) - { - next_char= 0; /* Found end of string */ - break; - } - start_of_number= 0; /* Found digit */ - } - ndigits= (size_t) (str-old_str); - - if (next_char == '.' && str < end-1) - { - /* - Continue to add numbers after decimal point to the result, as if there - was no decimal point. We will later (in the exponent handling) shift - the number down with the required number of fractions. We do it this - way to be able to get maximum precision for numbers like 123.45E+02, - which are normal for some ODBC applications. - */ - old_str= ++str; - while (my_isdigit(&my_charset_latin1, (next_char= *str))) - { - result= result*10.0 + (next_char - '0'); - digits_after_dec_point++; - scaler= scaler*10.0; - if (++str == end) - { - next_char= 0; - break; - } - } - /* If we found just '+.' or '.' then point at first character */ - if (!(dec_digits= (size_t) (str-old_str)) && start_of_number) - str= start_of_number; /* Point at '+' or '.' */ - } - if ((next_char == 'e' || next_char == 'E') && - dec_digits + ndigits != 0 && str < end-1) - { - const char *old_str2= str++; - - if ((neg_exp= (*str == '-')) || *str == '+') - str++; - - if (str == end || !my_isdigit(&my_charset_latin1, *str)) - str= old_str2; - else - { - do - { - if (exponent < 9999) /* prot. against exp overfl. */ - exponent= exponent*10 + (*str - '0'); - str++; - } while (str < end && my_isdigit(&my_charset_latin1, *str)); - } - } - tmp_exp= (neg_exp ? exponent + digits_after_dec_point : - exponent - digits_after_dec_point); - if (tmp_exp) - { - int order; - /* - Check for underflow/overflow. - order is such an integer number that f = C * 10 ^ order, - where f is the resulting floating point number and 1 <= C < 10. - Here we compute the modulus - */ - order= exponent + (neg_exp ? -1 : 1) * (ndigits - 1); - if (order < 0) - order= -order; - if (order >= MAX_DBL_EXP && !neg_exp && result) - { - double c; - /* Compute modulus of C (see comment above) */ - c= result / scaler * 10.0; - if (order > MAX_DBL_EXP || c > MAX_RESULT_FOR_MAX_EXP) - { - overflow= 1; - goto done; - } - } - - exponent= tmp_exp; - if (exponent < 0) - { - exponent= -exponent; - neg_exp= 1; /* neg_exp was 0 before */ - } - step= array_elements(log_10) - 1; - for (; exponent > step; exponent-= step) - result= neg_exp ? result / log_10[step] : result * log_10[step]; - result= neg_exp ? result / log_10[exponent] : result * log_10[exponent]; - } - -done: - *end_ptr= (char*) str; /* end of number */ - - if (overflow || my_isinf(result)) - { - result= DBL_MAX; - *error= EOVERFLOW; - } - - return negative ? -result : result; -} - -double my_atof(const char *nptr) -{ - int error; - const char *end= nptr+65535; /* Should be enough */ - return (my_strtod(nptr, (char**) &end, &error)); -} diff --git a/dep/mysqllite/strings/strxmov-sparc.s b/dep/mysqllite/strings/strxmov-sparc.s deleted file mode 100644 index 11ae49a876b60..0000000000000 --- a/dep/mysqllite/strings/strxmov-sparc.s +++ /dev/null @@ -1,54 +0,0 @@ -! Copyright (C) 2000, 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 - -! -! Note that this function only works on 32 bit sparc systems -! on 64 bits the offsets to %sp are different ! - - .file "strxmov-sparc.s" -.section ".text" - .align 4 - .global strxmov - .type strxmov,#function - .proc 0102 - -strxmov: - st %o2, [%sp+76] ! store 3rd param before other params - st %o3, [%sp+80] ! store 4th param " " - cmp %o1, 0 ! check if no from args - st %o4, [%sp+84] ! store 5th param - be .end - st %o5, [%sp+88] ! store last - add %sp, 76, %o4 ! put pointer to 3rd arg -.loop: - ldub [%o1], %o5 ! set values of src (o1) - add %o1, 1, %o1 ! inc src - stb %o5, [%o0] ! and dst (o2) equal - cmp %o5, 0 ! second while cmp - bne,a .loop - add %o0, 1, %o0 ! inc dst - ld [%o4], %o1 ! get next param - cmp %o1, 0 ! check if last param - bne .loop - add %o4, 4, %o4 ! advance to next param -.end: - retl - stb %g0, [%o0] -.strxmov_end: - .size strxmov,.strxmov_end-strxmov - .ident "Matt Wagner & Monty" - diff --git a/dep/mysqllite/vio/vio.c b/dep/mysqllite/vio/vio.c index 4253651bf84bc..48f103c33e857 100644 --- a/dep/mysqllite/vio/vio.c +++ b/dep/mysqllite/vio/vio.c @@ -22,6 +22,33 @@ #include "vio_priv.h" +#if defined(__WIN__) || defined(HAVE_SMEM) + +/** + Stub poll_read method that defaults to indicate that there + is data to read. + + Used for named pipe and shared memory VIO types. + + @param vio Unused. + @param timeout Unused. + + @retval FALSE There is data to read. +*/ + +static my_bool no_poll_read(Vio *vio __attribute__((unused)), + uint timeout __attribute__((unused))) +{ + return FALSE; +} + +#endif + +static my_bool has_no_data(Vio *vio __attribute__((unused))) +{ + return FALSE; +} + /* * Helper to fill most of the Vio* with defaults. */ @@ -56,10 +83,13 @@ static void vio_init(Vio* vio, enum enum_vio_type type, vio->was_interrupted=vio_was_interrupted; vio->vioclose =vio_close_pipe; vio->peer_addr =vio_peer_addr; - vio->in_addr =vio_in_addr; vio->vioblocking =vio_blocking; vio->is_blocking =vio_is_blocking; + vio->poll_read =no_poll_read; + vio->is_connected =vio_is_connected_pipe; + vio->has_data =has_no_data; + vio->timeout=vio_win32_timeout; /* Set default timeout */ vio->read_timeout_ms= INFINITE; @@ -81,10 +111,13 @@ static void vio_init(Vio* vio, enum enum_vio_type type, vio->was_interrupted=vio_was_interrupted; vio->vioclose =vio_close_shared_memory; vio->peer_addr =vio_peer_addr; - vio->in_addr =vio_in_addr; vio->vioblocking =vio_blocking; vio->is_blocking =vio_is_blocking; + vio->poll_read =no_poll_read; + vio->is_connected =vio_is_connected_shared_memory; + vio->has_data =has_no_data; + /* Currently, shared memory is on Windows only, hence the below is ok*/ vio->timeout= vio_win32_timeout; /* Set default timeout */ @@ -106,27 +139,32 @@ static void vio_init(Vio* vio, enum enum_vio_type type, vio->was_interrupted=vio_was_interrupted; vio->vioclose =vio_ssl_close; vio->peer_addr =vio_peer_addr; - vio->in_addr =vio_in_addr; vio->vioblocking =vio_ssl_blocking; vio->is_blocking =vio_is_blocking; vio->timeout =vio_timeout; + vio->poll_read =vio_poll_read; + vio->is_connected =vio_is_connected; + vio->has_data =vio_ssl_has_data; DBUG_VOID_RETURN; } #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->in_addr =vio_in_addr; - vio->vioblocking =vio_blocking; - vio->is_blocking =vio_is_blocking; - vio->timeout =vio_timeout; + 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; + vio->poll_read =vio_poll_read; + vio->is_connected =vio_is_connected; + vio->has_data= (flags & VIO_BUFFERED_READ) ? + vio_buff_has_data : has_no_data; DBUG_VOID_RETURN; } @@ -136,7 +174,7 @@ static void vio_init(Vio* vio, enum enum_vio_type 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)); + my_free(vio->read_buffer); vio_init(vio, type, sd, hPipe, flags); } @@ -235,8 +273,8 @@ void vio_delete(Vio* vio) 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)); + my_free(vio->read_buffer); + my_free(vio); } diff --git a/dep/mysqllite/vio/vio_priv.h b/dep/mysqllite/vio/vio_priv.h index b662a616eef9c..1bfb857b039fe 100644 --- a/dep/mysqllite/vio/vio_priv.h +++ b/dep/mysqllite/vio/vio_priv.h @@ -1,3 +1,6 @@ +#ifndef VIO_PRIV_INCLUDED +#define VIO_PRIV_INCLUDED + /* Copyright (C) 2003 MySQL AB This program is free software; you can redistribute it and/or modify @@ -22,11 +25,31 @@ #include #include +#ifndef __WIN__ +#include +#include +#endif + #ifdef _WIN32 void vio_win32_timeout(Vio *vio, uint which, uint timeout); #endif +#ifdef __WIN__ +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); +my_bool vio_is_connected_pipe(Vio *vio); +int vio_close_pipe(Vio * vio); +#endif + +#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); +my_bool vio_is_connected_shared_memory(Vio *vio); +int vio_close_shared_memory(Vio * vio); +#endif + void vio_timeout(Vio *vio,uint which, uint timeout); +my_bool vio_buff_has_data(Vio *vio); #ifdef HAVE_OPENSSL #include "my_net.h" /* needed because of struct in_addr */ @@ -40,4 +63,7 @@ void vio_ssl_delete(Vio *vio); int vio_ssl_blocking(Vio *vio, my_bool set_blocking_mode, my_bool *old_mode); +my_bool vio_ssl_has_data(Vio *vio); + #endif /* HAVE_OPENSSL */ +#endif /* VIO_PRIV_INCLUDED */ diff --git a/dep/mysqllite/vio/viosocket.c b/dep/mysqllite/vio/viosocket.c index f73b890c6975d..163eb279d4522 100644 --- a/dep/mysqllite/vio/viosocket.c +++ b/dep/mysqllite/vio/viosocket.c @@ -98,6 +98,10 @@ size_t vio_read_buff(Vio *vio, uchar* buf, size_t size) #undef VIO_UNBUFFERED_READ_MIN_SIZE } +my_bool vio_buff_has_data(Vio *vio) +{ + return (vio->read_pos != vio->read_end); +} size_t vio_write(Vio * vio, const uchar* buf, size_t size) { @@ -208,7 +212,7 @@ int vio_fastsend(Vio * vio __attribute__((unused))) #endif r= setsockopt(vio->sd, IPPROTO_TCP, TCP_NODELAY, - IF_WIN(const char*, void*) &nodelay, + IF_WIN((const char*), (void*)) &nodelay, sizeof(nodelay)); } @@ -240,11 +244,20 @@ int vio_keepalive(Vio* vio, my_bool set_keep_alive) my_bool -vio_should_retry(Vio * vio __attribute__((unused))) +vio_should_retry(Vio * vio) { int en = socket_errno; - return (en == SOCKET_EAGAIN || en == SOCKET_EINTR || - en == SOCKET_EWOULDBLOCK); + /* + man 2 read write + EAGAIN or EWOULDBLOCK when a socket is a non-blocking mode means + that the read/write would block. + man 7 socket + EAGAIN or EWOULDBLOCK when a socket is in a blocking mode means + that the corresponding receiving or sending timeout was reached. + */ + return en == SOCKET_EINTR || + (!vio_is_blocking(vio) && + (en == SOCKET_EAGAIN || en == SOCKET_EWOULDBLOCK)); } @@ -300,75 +313,367 @@ my_socket vio_fd(Vio* vio) return vio->sd; } +/** + Convert a sock-address (AF_INET or AF_INET6) into the "normalized" form, + which is the IPv4 form for IPv4-mapped or IPv4-compatible IPv6 addresses. + + @note Background: when IPv4 and IPv6 are used simultaneously, IPv4 + addresses may be written in a form of IPv4-mapped or IPv4-compatible IPv6 + addresses. That means, one address (a.b.c.d) can be written in three forms: + - IPv4: a.b.c.d; + - IPv4-compatible IPv6: ::a.b.c.d; + - IPv4-mapped IPv4: ::ffff:a.b.c.d; + + Having three forms of one address makes it a little difficult to compare + addresses with each other (the IPv4-compatible IPv6-address of foo.bar + will be different from the IPv4-mapped IPv6-address of foo.bar). + + @note This function can be made public when it's needed. + + @param src [in] source IP address (AF_INET or AF_INET6). + @param src_length [in] length of the src. + @param dst [out] a buffer to store normalized IP address + (sockaddr_storage). + @param dst_length [out] actual length of the normalized IP address. +*/ +static void vio_get_normalized_ip(const struct sockaddr *src, + int src_length, + struct sockaddr *dst, + int *dst_length) +{ + switch (src->sa_family) { + case AF_INET: + memcpy(dst, src, src_length); + *dst_length= src_length; + break; + +#ifdef HAVE_IPV6 + case AF_INET6: + { + const struct sockaddr_in6 *src_addr6= (const struct sockaddr_in6 *) src; + const struct in6_addr *src_ip6= &(src_addr6->sin6_addr); + const uint32 *src_ip6_int32= (uint32 *) src_ip6->s6_addr; + + if (IN6_IS_ADDR_V4MAPPED(src_ip6) || IN6_IS_ADDR_V4COMPAT(src_ip6)) + { + struct sockaddr_in *dst_ip4= (struct sockaddr_in *) dst; + + /* + This is an IPv4-mapped or IPv4-compatible IPv6 address. It should + be converted to the IPv4 form. + */ + + *dst_length= sizeof (struct sockaddr_in); + + memset(dst_ip4, 0, *dst_length); + dst_ip4->sin_family= AF_INET; + dst_ip4->sin_port= src_addr6->sin6_port; + + /* + In an IPv4 mapped or compatible address, the last 32 bits represent + the IPv4 address. The byte orders for IPv6 and IPv4 addresses are + the same, so a simple copy is possible. + */ + dst_ip4->sin_addr.s_addr= src_ip6_int32[3]; + } + else + { + /* This is a "native" IPv6 address. */ + + memcpy(dst, src, src_length); + *dst_length= src_length; + } + + break; + } +#endif /* HAVE_IPV6 */ + } +} + + +/** + Return the normalized IP address string for a sock-address. + + The idea is to return an IPv4-address for an IPv4-mapped and + IPv4-compatible IPv6 address. + + The function writes the normalized IP address to the given buffer. + The buffer should have enough space, otherwise error flag is returned. + The system constant INET6_ADDRSTRLEN can be used to reserve buffers of + the right size. + + @param addr [in] sockaddr object (AF_INET or AF_INET6). + @param addr_length [in] length of the addr. + @param ip_string [out] buffer to write normalized IP address. + @param ip_string_size [in] size of the ip_string. + + @return Error status. + @retval TRUE in case of error (the ip_string buffer is not enough). + @retval FALSE on success. +*/ + +my_bool vio_get_normalized_ip_string(const struct sockaddr *addr, + int addr_length, + char *ip_string, + size_t ip_string_size) +{ + struct sockaddr_storage norm_addr_storage; + struct sockaddr *norm_addr= (struct sockaddr *) &norm_addr_storage; + int norm_addr_length; + int err_code; + + vio_get_normalized_ip(addr, addr_length, norm_addr, &norm_addr_length); + + err_code= vio_getnameinfo(norm_addr, ip_string, ip_string_size, NULL, 0, + NI_NUMERICHOST); + + if (!err_code) + return FALSE; + + DBUG_PRINT("error", ("getnameinfo() failed with %d (%s).", + (int) err_code, + (const char *) gai_strerror(err_code))); + return TRUE; +} + + +/** + Return IP address and port of a VIO client socket. + + The function returns an IPv4 address if IPv6 support is disabled. -my_bool vio_peer_addr(Vio * vio, char *buf, uint16 *port) + The function returns an IPv4 address if the client socket is associated + with an IPv4-compatible or IPv4-mapped IPv6 address. Otherwise, the native + IPv6 address is returned. +*/ + +my_bool vio_peer_addr(Vio *vio, char *ip_buffer, uint16 *port, + size_t ip_buffer_size) { DBUG_ENTER("vio_peer_addr"); - DBUG_PRINT("enter", ("sd: %d", vio->sd)); + DBUG_PRINT("enter", ("Client socked fd: %d", (int) vio->sd)); + if (vio->localhost) { - strmov(buf,"127.0.0.1"); + /* + Initialize vio->remote and vio->addLen. Set vio->remote to IPv4 loopback + address. + */ + struct in_addr *ip4= &((struct sockaddr_in *) &(vio->remote))->sin_addr; + + vio->remote.ss_family= AF_INET; + vio->addrLen= sizeof (struct sockaddr_in); + + ip4->s_addr= htonl(INADDR_LOOPBACK); + + /* Initialize ip_buffer and port. */ + + strmov(ip_buffer, "127.0.0.1"); *port= 0; } else { - size_socket addrLen = sizeof(vio->remote); - if (getpeername(vio->sd, (struct sockaddr *) (&vio->remote), - &addrLen) != 0) + int err_code; + char port_buffer[NI_MAXSERV]; + + struct sockaddr_storage addr_storage; + struct sockaddr *addr= (struct sockaddr *) &addr_storage; + size_socket addr_length= sizeof (addr_storage); + + /* Get sockaddr by socked fd. */ + + err_code= getpeername(vio->sd, addr, &addr_length); + + if (err_code) { - DBUG_PRINT("exit", ("getpeername gave error: %d", socket_errno)); - DBUG_RETURN(1); + DBUG_PRINT("exit", ("getpeername() gave error: %d", socket_errno)); + DBUG_RETURN(TRUE); } - my_inet_ntoa(vio->remote.sin_addr,buf); - *port= ntohs(vio->remote.sin_port); - } - DBUG_PRINT("exit", ("addr: %s", buf)); - DBUG_RETURN(0); -} + /* Normalize IP address. */ -/* - Get in_addr for a TCP/IP connection + vio_get_normalized_ip(addr, addr_length, + (struct sockaddr *) &vio->remote, &vio->addrLen); - SYNOPSIS - vio_in_addr() - vio vio handle - in put in_addr here + /* Get IP address & port number. */ - NOTES - one must call vio_peer_addr() before calling this one -*/ + err_code= vio_getnameinfo((struct sockaddr *) &vio->remote, + ip_buffer, ip_buffer_size, + port_buffer, NI_MAXSERV, + NI_NUMERICHOST | NI_NUMERICSERV); -void vio_in_addr(Vio *vio, struct in_addr *in) -{ - DBUG_ENTER("vio_in_addr"); - if (vio->localhost) - bzero((char*) in, sizeof(*in)); - else - *in=vio->remote.sin_addr; - DBUG_VOID_RETURN; + if (err_code) + { + DBUG_PRINT("exit", ("getnameinfo() gave error: %s", + gai_strerror(err_code))); + DBUG_RETURN(TRUE); + } + + *port= (uint16) strtol(port_buffer, NULL, 10); + } + + DBUG_PRINT("exit", ("Client IP address: %s; port: %d", + (const char *) ip_buffer, + (int) *port)); + DBUG_RETURN(FALSE); } -/* Return 0 if there is data to be read */ +/** + Indicate whether there is data to read on a given socket. + + @note An exceptional condition event and/or errors are + interpreted as if there is data to read. + + @param sd A connected socket. + @param timeout Maximum time in seconds to poll. + + @retval FALSE There is data to read. + @retval TRUE There is no data to read. +*/ -my_bool vio_poll_read(Vio *vio,uint timeout) +static my_bool socket_poll_read(my_socket sd, uint timeout) { -#ifndef HAVE_POLL - return 0; -#else +#ifdef __WIN__ + int res; + my_socket fd= sd; + fd_set readfds, errorfds; + struct timeval tm; + DBUG_ENTER("socket_poll_read"); + 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; + DBUG_ENTER("socket_poll_read"); + fds.fd=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 ? 0 : 1); + DBUG_RETURN(fds.revents & (POLLIN | POLLERR | POLLHUP) ? 0 : 1); +#else + return 0; +#endif +} + + +/** + Retrieve the amount of data that can be read from a socket. + + @param vio A VIO object. + @param bytes[out] The amount of bytes available. + + @retval FALSE Success. + @retval TRUE Failure. +*/ + +static my_bool socket_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 +} + + +/** + Indicate whether there is data to read on a given socket. + + @remark Errors are interpreted as if there is data to read. + + @param sd A connected socket. + @param timeout Maximum time in seconds to wait. + + @retval FALSE There is data (or EOF) to read. Also FALSE if error. + @retval TRUE There is _NO_ data to read or timed out. +*/ + +my_bool vio_poll_read(Vio *vio, uint timeout) +{ + my_socket sd= vio->sd; + DBUG_ENTER("vio_poll_read"); +#ifdef HAVE_OPENSSL + if (vio->type == VIO_TYPE_SSL) + sd= SSL_get_fd((SSL*) vio->ssl_arg); +#endif + DBUG_RETURN(socket_poll_read(sd, timeout)); +} + + +/** + Determine if the endpoint of a connection is still available. + + @remark The socket is assumed to be disconnected if an EOF + condition is encountered. + + @param vio The VIO object. + + @retval TRUE EOF condition not found. + @retval FALSE EOF condition is signaled. +*/ + +my_bool vio_is_connected(Vio *vio) +{ + uint bytes= 0; + DBUG_ENTER("vio_is_connected"); + + /* In the presence of errors the socket is assumed to be connected. */ + + /* + The first step of detecting a EOF condition is veryfing + whether there is data to read. Data in this case would + be the EOF. + */ + if (vio_poll_read(vio, 0)) + DBUG_RETURN(TRUE); + + /* + The second step is read() or recv() from the socket returning + 0 (EOF). Unfortunelly, it's not possible to call read directly + as we could inadvertently read meaningful connection data. + Simulate a read by retrieving the number of bytes available to + read -- 0 meaning EOF. + */ + if (socket_peek_read(vio, &bytes)) + DBUG_RETURN(TRUE); + +#ifdef HAVE_OPENSSL + /* There might be buffered data at the SSL layer. */ + if (!bytes && vio->type == VIO_TYPE_SSL) + bytes= SSL_pending((SSL*) vio->ssl_arg); #endif + + DBUG_RETURN(bytes ? TRUE : FALSE); } @@ -390,15 +695,13 @@ void vio_timeout(Vio *vio, uint which, uint timeout) #endif r= setsockopt(vio->sd, SOL_SOCKET, which ? SO_SNDTIMEO : SO_RCVTIMEO, - IF_WIN(const char*, const void*)&wait_timeout, + 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 @@ -503,11 +806,21 @@ size_t vio_write_pipe(Vio * vio, const uchar* buf, size_t size) } +my_bool vio_is_connected_pipe(Vio *vio) +{ + if (PeekNamedPipe(vio->hPipe, NULL, 0, NULL, NULL, NULL)) + return TRUE; + else + return (GetLastError() != ERROR_BROKEN_PIPE); +} + + int vio_close_pipe(Vio * vio) { int r; DBUG_ENTER("vio_close_pipe"); + CancelIo(vio->hPipe); CloseHandle(vio->pipe_overlapped.hEvent); DisconnectNamedPipe(vio->hPipe); r= CloseHandle(vio->hPipe); @@ -653,6 +966,12 @@ size_t vio_write_shared_memory(Vio * vio, const uchar* buf, size_t size) } +my_bool vio_is_connected_shared_memory(Vio *vio) +{ + return (WaitForSingleObject(vio->event_conn_closed, 0) != WAIT_OBJECT_0); +} + + /** Close shared memory and DBUG_PRINT any errors that happen on closing. @return Zero if all closing functions succeed, and nonzero otherwise. @@ -714,3 +1033,68 @@ int vio_close_shared_memory(Vio * vio) } #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; +} + + +/** + This is a wrapper for the system getnameinfo(), because different OS + differ in the getnameinfo() implementation: + - Solaris 10 requires that the 2nd argument (salen) must match the + actual size of the struct sockaddr_storage passed to it; + - Mac OS X has sockaddr_in::sin_len and sockaddr_in6::sin6_len and + requires them to be filled. +*/ + +int vio_getnameinfo(const struct sockaddr *sa, + char *hostname, size_t hostname_size, + char *port, size_t port_size, + int flags) +{ + int sa_length= 0; + + switch (sa->sa_family) { + case AF_INET: + sa_length= sizeof (struct sockaddr_in); +#ifdef HAVE_SOCKADDR_IN_SIN_LEN + ((struct sockaddr_in *) sa)->sin_len= sa_length; +#endif /* HAVE_SOCKADDR_IN_SIN_LEN */ + break; + +#ifdef HAVE_IPV6 + case AF_INET6: + sa_length= sizeof (struct sockaddr_in6); +# ifdef HAVE_SOCKADDR_IN6_SIN6_LEN + ((struct sockaddr_in6 *) sa)->sin6_len= sa_length; +# endif /* HAVE_SOCKADDR_IN6_SIN6_LEN */ + break; +#endif /* HAVE_IPV6 */ + } + + return getnameinfo(sa, sa_length, + hostname, hostname_size, + port, port_size, + flags); +} diff --git a/dep/mysqllite/vio/viossl.c b/dep/mysqllite/vio/viossl.c index 0651fd8b7a39e..5cb5f36f20d5e 100644 --- a/dep/mysqllite/vio/viossl.c +++ b/dep/mysqllite/vio/viossl.c @@ -24,36 +24,6 @@ #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) { @@ -274,6 +244,9 @@ int vio_ssl_blocking(Vio *vio __attribute__((unused)), return (set_blocking_mode ? 0 : 1); } - +my_bool vio_ssl_has_data(Vio *vio) +{ + return SSL_pending(vio->ssl_arg) > 0 ? TRUE : FALSE; +} #endif /* HAVE_OPENSSL */ diff --git a/dep/mysqllite/vio/viosslfactories.c b/dep/mysqllite/vio/viosslfactories.c index d0a0a69f70bb0..4971dec37fb99 100644 --- a/dep/mysqllite/vio/viosslfactories.c +++ b/dep/mysqllite/vio/viosslfactories.c @@ -143,36 +143,6 @@ vio_set_cert_stuff(SSL_CTX *ctx, const char *cert_file, const char *key_file, } -#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) @@ -183,10 +153,6 @@ static void check_ssl_init() } -#ifdef __NETWARE__ - netware_ssl_init(); -#endif - if (!ssl_error_strings_loaded) { ssl_error_strings_loaded= TRUE; @@ -224,7 +190,7 @@ new_VioSSLFd(const char *key_file, const char *cert_file, *error= SSL_INITERR_MEMFAIL; DBUG_PRINT("error", ("%s", sslGetErrString(*error))); report_errors(); - my_free((void*)ssl_fd,MYF(0)); + my_free(ssl_fd); DBUG_RETURN(0); } @@ -240,7 +206,7 @@ new_VioSSLFd(const char *key_file, const char *cert_file, DBUG_PRINT("error", ("%s", sslGetErrString(*error))); report_errors(); SSL_CTX_free(ssl_fd->ssl_context); - my_free((void*)ssl_fd,MYF(0)); + my_free(ssl_fd); DBUG_RETURN(0); } @@ -254,7 +220,7 @@ new_VioSSLFd(const char *key_file, const char *cert_file, DBUG_PRINT("error", ("%s", sslGetErrString(*error))); report_errors(); SSL_CTX_free(ssl_fd->ssl_context); - my_free((void*)ssl_fd,MYF(0)); + my_free(ssl_fd); DBUG_RETURN(0); } } @@ -264,7 +230,7 @@ new_VioSSLFd(const char *key_file, const char *cert_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)); + my_free(ssl_fd); DBUG_RETURN(0); } @@ -344,6 +310,6 @@ new_VioSSLAcceptorFd(const char *key_file, const char *cert_file, void free_vio_ssl_acceptor_fd(struct st_VioSSLFd *fd) { SSL_CTX_free(fd->ssl_context); - my_free((uchar*) fd, MYF(0)); + my_free(fd); } #endif /* HAVE_OPENSSL */ diff --git a/sql/base/characters_database.sql b/sql/base/characters_database.sql index e0bf22ab4c034..6bbb7c0c07893 100644 --- a/sql/base/characters_database.sql +++ b/sql/base/characters_database.sql @@ -23,11 +23,11 @@ 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(10) unsigned NOT NULL DEFAULT '0', + `accountId` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Account Identifier', `type` tinyint(3) unsigned NOT NULL DEFAULT '0', `time` int(10) unsigned NOT NULL DEFAULT '0', `data` blob NOT NULL, - PRIMARY KEY (`account`,`type`) + PRIMARY KEY (`accountId`,`type`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; @@ -65,6 +65,36 @@ LOCK TABLES `account_instance_times` WRITE; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; +-- +-- Table structure for table `account_tutorial` +-- + +DROP TABLE IF EXISTS `account_tutorial`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `account_tutorial` ( + `accountId` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Account Identifier', + `tut0` int(10) unsigned NOT NULL DEFAULT '0', + `tut1` int(10) unsigned NOT NULL DEFAULT '0', + `tut2` int(10) unsigned NOT NULL DEFAULT '0', + `tut3` int(10) unsigned NOT NULL DEFAULT '0', + `tut4` int(10) unsigned NOT NULL DEFAULT '0', + `tut5` int(10) unsigned NOT NULL DEFAULT '0', + `tut6` int(10) unsigned NOT NULL DEFAULT '0', + `tut7` int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`accountId`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `account_tutorial` +-- + +LOCK TABLES `account_tutorial` WRITE; +/*!40000 ALTER TABLE `account_tutorial` DISABLE KEYS */; +/*!40000 ALTER TABLE `account_tutorial` ENABLE KEYS */; +UNLOCK TABLES; + -- -- Table structure for table `addons` -- @@ -237,14 +267,14 @@ DROP TABLE IF EXISTS `channels`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `channels` ( - `m_name` varchar(128) NOT NULL, - `m_team` int(10) unsigned NOT NULL, - `m_announce` tinyint(3) unsigned NOT NULL DEFAULT '1', - `m_ownership` tinyint(3) unsigned NOT NULL DEFAULT '1', - `m_password` varchar(32) DEFAULT NULL, - `BannedList` text, - `last_used` int(10) unsigned NOT NULL, - PRIMARY KEY (`m_name`,`m_team`) + `name` varchar(128) NOT NULL, + `team` int(10) unsigned NOT NULL, + `announce` tinyint(3) unsigned NOT NULL DEFAULT '1', + `ownership` tinyint(3) unsigned NOT NULL DEFAULT '1', + `password` varchar(32) DEFAULT NULL, + `bannedList` text, + `lastUsed` int(10) unsigned NOT NULL, + PRIMARY KEY (`name`,`team`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Channel System'; /*!40101 SET character_set_client = @saved_cs_client */; @@ -694,7 +724,7 @@ CREATE TABLE `character_inventory` ( `slot` tinyint(3) unsigned NOT NULL DEFAULT '0', `item` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Item Global Unique Identifier', PRIMARY KEY (`item`), - UNIQUE KEY (`guid`,`bag`,`slot`), + UNIQUE KEY `guid` (`guid`,`bag`,`slot`), KEY `idx_guid` (`guid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Player System'; /*!40101 SET character_set_client = @saved_cs_client */; @@ -1085,36 +1115,6 @@ LOCK TABLES `character_talent` WRITE; /*!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` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Account Identifier', - `tut0` int(10) unsigned NOT NULL DEFAULT '0', - `tut1` int(10) unsigned NOT NULL DEFAULT '0', - `tut2` int(10) unsigned NOT NULL DEFAULT '0', - `tut3` int(10) unsigned NOT NULL DEFAULT '0', - `tut4` int(10) unsigned NOT NULL DEFAULT '0', - `tut5` int(10) unsigned NOT NULL DEFAULT '0', - `tut6` int(10) unsigned NOT NULL DEFAULT '0', - `tut7` int(10) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`account`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 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 `characters` -- @@ -1224,7 +1224,7 @@ CREATE TABLE `corpse` ( `position_z` float NOT NULL DEFAULT '0', `orientation` float NOT NULL DEFAULT '0', `map` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Map Identifier', - `phaseMask` tinyint(3) unsigned NOT NULL DEFAULT '1', + `phaseMask` smallint(5) unsigned NOT NULL DEFAULT '1', `displayId` int(10) unsigned NOT NULL DEFAULT '0', `itemCache` text NOT NULL, `bytes1` int(10) unsigned NOT NULL DEFAULT '0', @@ -1285,10 +1285,10 @@ 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` smallint(5) unsigned NOT NULL, + `eventEntry` tinyint(3) unsigned NOT NULL, `condition_id` int(10) unsigned NOT NULL DEFAULT '0', `done` float DEFAULT '0', - PRIMARY KEY (`event_id`,`condition_id`) + PRIMARY KEY (`eventEntry`,`condition_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; @@ -1309,10 +1309,10 @@ 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` smallint(5) unsigned NOT NULL, + `eventEntry` tinyint(3) unsigned NOT NULL, `state` tinyint(3) unsigned NOT NULL DEFAULT '1', `next_start` int(10) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`event_id`) + PRIMARY KEY (`eventEntry`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; diff --git a/sql/base/world_database.sql b/sql/base/world_database.sql index 21f4032ecab2a..2d17676e89b20 100644 --- a/sql/base/world_database.sql +++ b/sql/base/world_database.sql @@ -650,6 +650,8 @@ INSERT INTO `command` VALUES ('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 trinity_string',3,'Syntax: .reload trinity_string\nReload trinity_string table.'), +('reload vehicle_accessory', 3, 'Syntax: .reload vehicle_accessory\n\nReloads GUID-based vehicle accessory definitions from the database.'), +('reload vehicle_template_accessory', 3, 'Syntax: .reload vehicle_template_accessory\n\nReloads entry-based vehicle accessory definitions from the database.'), ('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'), @@ -16737,34 +16739,34 @@ DROP TABLE IF EXISTS `smart_scripts`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `smart_scripts` ( - `entryorguid` mediumint(11) NOT NULL, - `source_type` mediumint(5) unsigned NOT NULL DEFAULT '0', - `id` mediumint(11) unsigned NOT NULL DEFAULT '0', - `link` mediumint(11) unsigned NOT NULL DEFAULT '0', - `event_type` mediumint(5) unsigned NOT NULL DEFAULT '0', - `event_phase_mask` mediumint(11) unsigned NOT NULL DEFAULT '0', - `event_chance` mediumint(5) unsigned NOT NULL DEFAULT '100', - `event_flags` mediumint(11) unsigned NOT NULL DEFAULT '0', - `event_param1` mediumint(11) unsigned NOT NULL DEFAULT '0', - `event_param2` mediumint(11) unsigned NOT NULL DEFAULT '0', - `event_param3` mediumint(11) unsigned NOT NULL DEFAULT '0', - `event_param4` mediumint(11) unsigned NOT NULL DEFAULT '0', - `action_type` mediumint(5) unsigned NOT NULL DEFAULT '0', - `action_param1` mediumint(11) unsigned NOT NULL DEFAULT '0', - `action_param2` mediumint(11) unsigned NOT NULL DEFAULT '0', - `action_param3` mediumint(11) unsigned NOT NULL DEFAULT '0', - `action_param4` mediumint(11) unsigned NOT NULL DEFAULT '0', - `action_param5` mediumint(11) unsigned NOT NULL DEFAULT '0', - `action_param6` mediumint(11) unsigned NOT NULL DEFAULT '0', - `target_type` mediumint(11) unsigned NOT NULL DEFAULT '0', - `target_param1` mediumint(11) unsigned NOT NULL DEFAULT '0', - `target_param2` mediumint(11) unsigned NOT NULL DEFAULT '0', - `target_param3` mediumint(11) unsigned NOT NULL DEFAULT '0', + `entryorguid` int(11) NOT NULL, + `source_type` tinyint(3) unsigned NOT NULL DEFAULT '0', + `id` smallint(5) unsigned NOT NULL DEFAULT '0', + `link` smallint(5) unsigned NOT NULL DEFAULT '0', + `event_type` tinyint(3) unsigned NOT NULL DEFAULT '0', + `event_phase_mask` tinyint(3) unsigned NOT NULL DEFAULT '0', + `event_chance` tinyint(3) unsigned NOT NULL DEFAULT '100', + `event_flags` tinyint(3) unsigned NOT NULL DEFAULT '0', + `event_param1` int(10) unsigned NOT NULL DEFAULT '0', + `event_param2` int(10) unsigned NOT NULL DEFAULT '0', + `event_param3` int(10) unsigned NOT NULL DEFAULT '0', + `event_param4` int(10) unsigned NOT NULL DEFAULT '0', + `action_type` tinyint(3) unsigned NOT NULL DEFAULT '0', + `action_param1` int(10) unsigned NOT NULL DEFAULT '0', + `action_param2` int(10) unsigned NOT NULL DEFAULT '0', + `action_param3` int(10) unsigned NOT NULL DEFAULT '0', + `action_param4` int(10) unsigned NOT NULL DEFAULT '0', + `action_param5` int(10) unsigned NOT NULL DEFAULT '0', + `action_param6` int(10) unsigned NOT NULL DEFAULT '0', + `target_type` tinyint(3) unsigned NOT NULL DEFAULT '0', + `target_param1` int(10) unsigned NOT NULL DEFAULT '0', + `target_param2` int(10) unsigned NOT NULL DEFAULT '0', + `target_param3` int(10) unsigned NOT NULL DEFAULT '0', `target_x` float NOT NULL DEFAULT '0', `target_y` float NOT NULL DEFAULT '0', `target_z` float NOT NULL DEFAULT '0', `target_o` float NOT NULL DEFAULT '0', - `comment` varchar(255) NOT NULL DEFAULT '' COMMENT 'Event Comment', + `comment` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'Event Comment', PRIMARY KEY (`entryorguid`,`source_type`,`id`,`link`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED; /*!40101 SET character_set_client = @saved_cs_client */; @@ -18019,6 +18021,7 @@ INSERT INTO `spell_linked_spell` (`spell_trigger`,`spell_effect`,`type`,`comment ( 17851, 54501, 2, 'Consume Shadows - Rank 3'), ( 17850, 54501, 2, 'Consume Shadows - Rank 2'), ( 17767, 54501, 2, 'Consume Shadows - Rank 1'), +(-11129,-28682, 0, 'Combustion'), (-5143, -36032, 0, 'Arcane Missiles Rank 1'), (-5144, -36032, 0, 'Arcane Missiles Rank 2'), (-5145, -36032, 0, 'Arcane Missiles Rank 3'), @@ -18064,6 +18067,13 @@ INSERT INTO `spell_linked_spell` (`spell_trigger`,`spell_effect`,`type`,`comment ( 20066,-61840, 0, 'Repentance'), ( 66235, 66233, 0, 'Ardent Defender Visuals'), ( 58875, 58876, 1, 'Spirit Walk'), +-- Misc +( 55428, 55475, 0, 'Lifeblood (Rank 1)'), +( 55480, 55475, 0, 'Lifeblood (Rank 2)'), +( 55500, 55475, 0, 'Lifeblood (Rank 3)'), +( 55501, 55475, 0, 'Lifeblood (Rank 4)'), +( 55502, 55475, 0, 'Lifeblood (Rank 5)'), +( 55503, 55475, 0, 'Lifeblood (Rank 6)'), -- Quest ( 26286, 44430, 0, 'Small Red Rocket - questcredit'), ( 26292, 44430, 0, 'Small Green Rocket - questcredit'), @@ -18141,6 +18151,7 @@ INSERT INTO `spell_linked_spell` (`spell_trigger`,`spell_effect`,`type`,`comment (-59743, 54343, 0, 'Void Shift (Heroic) - Void Shifted'), -- Gundrak ( 54850, 54851, 1, 'Emerge - Emerge Summon'), +( 55814, 55817, 1, 'Eck Residue'), -- Trial of the Champion ( 66680, 66547, 0, 'Confess - Confess'), ( 66889,-66865, 0, 'Remove Vengeance'), @@ -18151,6 +18162,7 @@ INSERT INTO `spell_linked_spell` (`spell_trigger`,`spell_effect`,`type`,`comment ( 67623,-67620, 1, 'Remove Paralytic Toxin when hit by Burning Bite'), (-66683, 68667, 0, 'Icehowl - Surge of Adrenaline'), (-67661, 68667, 0, 'Icehowl - Surge of Adrenaline'), +( 65940, 65941, 0, 'Trial of the Crusader: Shattering Throw'), -- Forge of Souls (-68839, 68846, 0, 'Bronjahm: Corrupt Soul Summon'), -- Icecrown Citadel @@ -18177,6 +18189,8 @@ INSERT INTO `spell_linked_spell` (`spell_trigger`,`spell_effect`,`type`,`comment ( 71480, 71483, 1, 'Blood-Queen: Bloodbolt Splash'), ( 71952, 70995, 1, 'Blood-Queen: Presence of the Darkfallen'), ( 70157, 69700, 2, 'Sindragosa - Ice Tomb resistance'), +-- Eye Of Eternity +( 56397, 63934, 1,'Arcane Barrage - Arcane Barrage'), -- Isle of Conquest ( 66548, 66550, 0, 'Isle of Conquest (IN>OUT)'), ( 66549, 66551, 0, 'Isle of Conquest (OUT>IN)'), @@ -18200,6 +18214,7 @@ INSERT INTO `spell_linked_spell` (`spell_trigger`,`spell_effect`,`type`,`comment ( 50141, 50001, 0, 'Blood Oath to Blood Oath Aura'), ( 61263, 61267, 0, 'Intravenous Healing Effect'), ( 61263, 61268, 0, 'Intravenous Mana Regeneration Effect'), +(-57350,60242,0, 'Darkmoon Card: Illusion'), -- PvP Trinket / Every Man for Himself / Will of the Forsaken (7744, 72757, 0, 'Will of the Forsaken Cooldown Trigger (WOTF)'), (42292, 72752, 0, 'Will of the Forsaken Cooldown Trigger'), @@ -18368,6 +18383,11 @@ INSERT INTO `spell_proc_event` (`entry`,`SchoolMask`,`SpellFamilyName`,`SpellFam ( 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) +( 11213, 0x00, 3, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Arcane Concentration (Rank 1) +( 12574, 0x00, 3, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Arcane Concentration (Rank 2) +( 12575, 0x00, 3, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Arcane Concentration (Rank 3) +( 12576, 0x00, 3, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Arcane Concentration (Rank 4) +( 12577, 0x00, 3, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Arcane Concentration (Rank 5) ( 12169, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000040, 0, 0, 0), -- Shield Block ( 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) @@ -19087,6 +19107,7 @@ INSERT INTO `spell_proc_event` (`entry`,`SchoolMask`,`SpellFamilyName`,`SpellFam ( 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) +( 54646, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Focus Magic ( 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 @@ -19107,6 +19128,7 @@ INSERT INTO `spell_proc_event` (`entry`,`SchoolMask`,`SpellFamilyName`,`SpellFam ( 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 +( 55681, 0x00, 6, 0x00008000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Glyph of Shadow Word: Pain ( 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 @@ -19382,6 +19404,8 @@ INSERT INTO `spell_proc_event` (`entry`,`SchoolMask`,`SpellFamilyName`,`SpellFam ( 71640, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 30), -- Corpse Tongue Coin (Heroic) ( 71642, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 45), -- Althor's Abacus (Heroic) ( 71645, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 45), -- Dislodged Foreign Object (Heroic) +( 71880, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 1, 0, 0), -- Heartpierce +( 71892, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 1, 0, 0), -- Heartpierce (Heroic) ( 72417, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 60), -- Item - Icecrown Reputation Ring Caster Trigger ( 72413, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 60), -- Item - Icecrown Reputation Ring Melee ( 72419, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 60), -- Item - Icecrown Reputation Ring Healer Trigger @@ -27279,7 +27303,7 @@ INSERT INTO `trinity_string` (`entry`,`content_default`,`content_loc1`,`content_ (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), +(539, 'Player selected NPC\nDB GUID: %u, current GUID: %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), @@ -27742,13 +27766,13 @@ INSERT INTO `trinity_string` (`entry`,`content_default`,`content_loc1`,`content_ UNLOCK TABLES; -- --- Table structure for table `vehicle_accessory` +-- Table structure for table `vehicle_template_accessory` -- -DROP TABLE IF EXISTS `vehicle_accessory`; +DROP TABLE IF EXISTS `vehicle_template_accessory`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; -CREATE TABLE `vehicle_accessory` ( +CREATE TABLE `vehicle_template_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, @@ -27763,17 +27787,47 @@ AVG_ROW_LENGTH=0; /*!40101 SET character_set_client = @saved_cs_client */; -- --- Dumping data for table `vehicle_accessory` +-- Dumping data for table `vehicle_template_accessory` -- -LOCK TABLES `vehicle_accessory` WRITE; -/*!40000 ALTER TABLE `vehicle_accessory` DISABLE KEYS */; -INSERT INTO `vehicle_accessory` VALUES +LOCK TABLES `vehicle_template_accessory` WRITE; +/*!40000 ALTER TABLE `vehicle_template_accessory` DISABLE KEYS */; +INSERT INTO `vehicle_template_accessory` VALUES (36476,36477,0,0, 'Krick and Ick'), (36661,36658,0,0, 'Scourgelord Tyrannus and Rimefang'), (36891,31260,0,0, 'Ymirjar Skycaller on Drake'), (36678,38309,0,1, 'Professor Putricide - trigger'), (36678,38308,1,1, 'Professor Putricide - trigger'); +/*!40000 ALTER TABLE `vehicle_template_accessory` 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` ( + `guid` 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 (`accessory_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 `vehicle_accessory` +-- + +LOCK TABLES `vehicle_accessory` WRITE; +/*!40000 ALTER TABLE `vehicle_accessory` DISABLE KEYS */; /*!40000 ALTER TABLE `vehicle_accessory` ENABLE KEYS */; UNLOCK TABLES; diff --git a/sql/bloodycore/11499_world_spell_bonus_data.sql b/sql/bloodycore/11499_world_spell_bonus_data.sql new file mode 100644 index 0000000000000..83f1bea5d1e40 --- /dev/null +++ b/sql/bloodycore/11499_world_spell_bonus_data.sql @@ -0,0 +1,3 @@ +-- Explosive Trap DoT +UPDATE `spell_bonus_data` SET `ap_dot_bonus` = '0.1' WHERE `entry` = 13812; + diff --git a/sql/bloodycore/11517_world_spell_proc_event.sql b/sql/bloodycore/11517_world_spell_proc_event.sql new file mode 100644 index 0000000000000..9585af9ba5e35 --- /dev/null +++ b/sql/bloodycore/11517_world_spell_proc_event.sql @@ -0,0 +1,3 @@ +-- Cinderglacier +UPDATE `spell_proc_event` SET `SpellFamilyName` = '15', `SpellFamilyMask0` = 0x42002, `SpellFamilyMask1` = 0x6, `SpellFamilyMask2` = 0x80 WHERE `entry` = 53386; + diff --git a/sql/bloodycore/11537_world_spell_dbc.sql b/sql/bloodycore/11537_world_spell_dbc.sql new file mode 100644 index 0000000000000..65871fb9a7913 --- /dev/null +++ b/sql/bloodycore/11537_world_spell_dbc.sql @@ -0,0 +1,4 @@ +-- Bone Shield Charges Cooldown +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 +(250000, 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, 'Bone Shield Charges Cooldown'); + diff --git a/sql/bloodycore/11700_world_spell_linked_spell.sql b/sql/bloodycore/11700_world_spell_linked_spell.sql new file mode 100644 index 0000000000000..adf9c56b6f370 --- /dev/null +++ b/sql/bloodycore/11700_world_spell_linked_spell.sql @@ -0,0 +1,8 @@ +-- Sanctuary Linked Spells +DELETE FROM `spell_linked_spell` WHERE `spell_effect` = 54661 AND `spell_trigger` IN (32612, 5215, 1784, 1856); +INSERT INTO `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES +('32612', '54661', '0', 'Invisibility Sanctuary Effect'), +('5215', '54661', '0', 'Prowl Sanctuary Effect'), +('1784', '54661', '0', 'Stealth Sanctuary Effect'), +('1856', '54661', '0', 'Stealth Sanctuary Effect'); + diff --git a/sql/bloodycore/11709_world_npc_spellclick_spells.sql b/sql/bloodycore/11709_world_npc_spellclick_spells.sql new file mode 100644 index 0000000000000..b3209a8cfb2ef --- /dev/null +++ b/sql/bloodycore/11709_world_npc_spellclick_spells.sql @@ -0,0 +1,6 @@ +-- Emerald Drake, Amber Drake, Ruby Drake Ride Vehicle Hardcoded +DELETE FROM `npc_spellclick_spells` WHERE `npc_entry` IN (27692, 27756, 27755); +INSERT INTO `npc_spellclick_spells` (`npc_entry`,`spell_id`,`quest_start`,`quest_start_active`,`quest_end`,`cast_flags`,`aura_required`,`aura_forbidden`,`user_type`) VALUES +(27692,46598,0,0,0,1,0,0,0), +(27756,46598,0,0,0,1,0,0,0), +(27755,46598,0,0,0,1,0,0,0); \ No newline at end of file diff --git a/sql/bloodycore/11821_world_spell_scriptname.sql b/sql/bloodycore/11821_world_spell_scriptname.sql new file mode 100644 index 0000000000000..4750bcecfa2e4 --- /dev/null +++ b/sql/bloodycore/11821_world_spell_scriptname.sql @@ -0,0 +1,4 @@ +INSERT INTO `spell_script_names` VALUES +('62575', 'spell_gen_shieldbreaker'), +('63010', 'spell_gen_atcharge'); + diff --git a/sql/bloodycore/11842_world_spell_scriptname.sql b/sql/bloodycore/11842_world_spell_scriptname.sql new file mode 100644 index 0000000000000..9db62b3528bb5 --- /dev/null +++ b/sql/bloodycore/11842_world_spell_scriptname.sql @@ -0,0 +1,3 @@ +INSERT INTO `spell_script_names` VALUES +('68504', 'spell_gen_npcshieldbreaker'); + diff --git a/sql/bloodycore/11868_world_spell_scriptname.sql b/sql/bloodycore/11868_world_spell_scriptname.sql new file mode 100644 index 0000000000000..974474ee4eb7b --- /dev/null +++ b/sql/bloodycore/11868_world_spell_scriptname.sql @@ -0,0 +1,3 @@ +INSERT INTO `spell_script_names` VALUES +('66515', 'spell_gen_reflective_shield'); + diff --git a/sql/bloodycore/11967_world_spell_proc_event.sql b/sql/bloodycore/11967_world_spell_proc_event.sql new file mode 100644 index 0000000000000..6ad5a3be3cd41 --- /dev/null +++ b/sql/bloodycore/11967_world_spell_proc_event.sql @@ -0,0 +1,3 @@ +-- Threat of Thassarian +UPDATE `spell_proc_event` SET `SpellFamilyMask0` = `SpellFamilyMask0` | 1 WHERE `entry` IN (66192, 66191, 65661); + diff --git a/sql/bloodycore/12030_world_spell_proc_event.sql b/sql/bloodycore/12030_world_spell_proc_event.sql new file mode 100644 index 0000000000000..4106ac47829d4 --- /dev/null +++ b/sql/bloodycore/12030_world_spell_proc_event.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_proc_event` WHERE `entry` = 16689; +INSERT INTO `spell_proc_event` (`entry`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `procFlags`, `procEx`, `ppmRate`, `CustomChance`, `Cooldown`) VALUE (16689, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2); + diff --git a/sql/bloodycore/12034_world_spell_proc_event.sql b/sql/bloodycore/12034_world_spell_proc_event.sql new file mode 100644 index 0000000000000..b958af76e8243 --- /dev/null +++ b/sql/bloodycore/12034_world_spell_proc_event.sql @@ -0,0 +1,5 @@ +DELETE FROM `spell_proc_event` WHERE `entry` IN (34753, 34859, 34860); +INSERT INTO `spell_proc_event` (`entry`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `procFlags`, `procEx`, `ppmRate`, `CustomChance`, `Cooldown`) VALUES +(34753, 0, 6, 6144, 4, 4096, 0, 2, 0, 0, 0), -- rank1 +(34859, 0, 6, 6144, 4, 4096, 0, 2, 0, 0, 0), -- rank2 +(34860, 0, 6, 6144, 4, 4096, 0, 2, 0, 0, 0); -- rank3 \ No newline at end of file diff --git a/sql/bloodycore/12035_world_spell_scriptname.sql b/sql/bloodycore/12035_world_spell_scriptname.sql new file mode 100644 index 0000000000000..1b1850efcfa1a --- /dev/null +++ b/sql/bloodycore/12035_world_spell_scriptname.sql @@ -0,0 +1,7 @@ +-- Spnning pain strike scriptname +DELETE FROM `spell_script_names` WHERE `spell_id` IN (66316,67100,67101,67102) AND `ScriptName`='spell_spinning_pain_strike'; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(66316, 'spell_spinning_pain_strike'), +(67100, 'spell_spinning_pain_strike'), +(67101, 'spell_spinning_pain_strike'), +(67102, 'spell_spinning_pain_strike'); \ No newline at end of file diff --git a/sql/bloodycore/custom/11870_vendor_item_imprendibili.sql b/sql/bloodycore/custom/11870_vendor_item_imprendibili.sql new file mode 100644 index 0000000000000..cc7e4a558827c --- /dev/null +++ b/sql/bloodycore/custom/11870_vendor_item_imprendibili.sql @@ -0,0 +1,31 @@ +DELETE FROM `quest_template` WHERE `entry` IN (500001, 500002, 500003, 500004, 500005, 500006, 500007); +INSERT INTO `quest_template` (`entry`, `Method`, `ZoneOrSort`, `SkillOrClassMask`, `MinLevel`, `MaxLevel`, `QuestLevel`, `Type`, `RequiredRaces`, `RequiredSkillValue`, `RepObjectiveFaction`, `RepObjectiveValue`, `RepObjectiveFaction2`, `RepObjectiveValue2`, `RequiredMinRepFaction`, `RequiredMinRepValue`, `RequiredMaxRepFaction`, `RequiredMaxRepValue`, `SuggestedPlayers`, `LimitTime`, `QuestFlags`, `SpecialFlags`, `CharTitleId`, `PlayersSlain`, `BonusTalents`, `RewardArenaPoints`, `PrevQuestId`, `NextQuestId`, `ExclusiveGroup`, `NextQuestInChain`, `RewXPId`, `SrcItemId`, `SrcItemCount`, `SrcSpell`, `Title`, `Details`, `Objectives`, `OfferRewardText`, `RequestItemsText`, `EndText`, `CompletedText`, `ObjectiveText1`, `ObjectiveText2`, `ObjectiveText3`, `ObjectiveText4`, `ReqItemId1`, `ReqItemId2`, `ReqItemId3`, `ReqItemId4`, `ReqItemId5`, `ReqItemId6`, `ReqItemCount1`, `ReqItemCount2`, `ReqItemCount3`, `ReqItemCount4`, `ReqItemCount5`, `ReqItemCount6`, `ReqSourceId1`, `ReqSourceId2`, `ReqSourceId3`, `ReqSourceId4`, `ReqSourceCount1`, `ReqSourceCount2`, `ReqSourceCount3`, `ReqSourceCount4`, `ReqCreatureOrGOId1`, `ReqCreatureOrGOId2`, `ReqCreatureOrGOId3`, `ReqCreatureOrGOId4`, `ReqCreatureOrGOCount1`, `ReqCreatureOrGOCount2`, `ReqCreatureOrGOCount3`, `ReqCreatureOrGOCount4`, `ReqSpellCast1`, `ReqSpellCast2`, `ReqSpellCast3`, `ReqSpellCast4`, `RewChoiceItemId1`, `RewChoiceItemId2`, `RewChoiceItemId3`, `RewChoiceItemId4`, `RewChoiceItemId5`, `RewChoiceItemId6`, `RewChoiceItemCount1`, `RewChoiceItemCount2`, `RewChoiceItemCount3`, `RewChoiceItemCount4`, `RewChoiceItemCount5`, `RewChoiceItemCount6`, `RewItemId1`, `RewItemId2`, `RewItemId3`, `RewItemId4`, `RewItemCount1`, `RewItemCount2`, `RewItemCount3`, `RewItemCount4`, `RewRepFaction1`, `RewRepFaction2`, `RewRepFaction3`, `RewRepFaction4`, `RewRepFaction5`, `RewRepValueId1`, `RewRepValueId2`, `RewRepValueId3`, `RewRepValueId4`, `RewRepValueId5`, `RewRepValue1`, `RewRepValue2`, `RewRepValue3`, `RewRepValue4`, `RewRepValue5`, `RewHonorAddition`, `RewHonorMultiplier`, `unk0`, `RewOrReqMoney`, `RewMoneyMaxLevel`, `RewSpell`, `RewSpellCast`, `RewMailTemplateId`, `RewMailDelaySecs`, `PointMapId`, `PointX`, `PointY`, `PointOpt`, `DetailsEmote1`, `DetailsEmote2`, `DetailsEmote3`, `DetailsEmote4`, `DetailsEmoteDelay1`, `DetailsEmoteDelay2`, `DetailsEmoteDelay3`, `DetailsEmoteDelay4`, `IncompleteEmote`, `CompleteEmote`, `OfferRewardEmote1`, `OfferRewardEmote2`, `OfferRewardEmote3`, `OfferRewardEmote4`, `OfferRewardEmoteDelay1`, `OfferRewardEmoteDelay2`, `OfferRewardEmoteDelay3`, `OfferRewardEmoteDelay4`, `StartScript`, `CompleteScript`, `WDBVerified`) VALUES +('500001','2','4395','0','80','0','80','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','Blazing Hippogryph','Questo grifone è un rarissimo esemplare, e non credere che te lo darò gratis. Ha un costo molto elevato.','Dammi 20 Emblem of Triumph, 5 Runed Orb, uccidi Anub\'arak(ToC)(Normal) e dammi 15000 pezzi d\'oro.','Ottimo! Ecco quello che ti ho promesso! ','Hai portato quello che ti ho chiesto?','','','','','','','47241','45087','0','0','0','0','20','5','0','0','0','0','0','0','0','0','0','0','0','0','34564','0','0','0','1','0','0','0','0','0','0','0','54069','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','-150000000','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0'), +('500002','2','4395','0','80','0','80','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','X-53 Touring Rocket','Con questo andrai veloce come un razzo! Ma non è facile costruirlo, per vari motivi. Innanzi tutto, Kel\'Thuzad mi impedisce di reperire alcuni materiali. Toglimelo di mezzo! Poi, mi servono alcuni... \"ingredienti\". Sarai capace di portarmeli?','Dammi 20 Emblem of Triumph, 5 Runed Orb, uccidi Kel\'Thuzad (Normal) e dammi 30000 pezzi d\'oro.','Ottimo! Ecco quello che ti ho promesso! ','Hai portato quello che ti ho chiesto?','','','','','','','47241','45087','0','0','0','0','20','5','0','0','0','0','0','0','0','0','0','0','0','0','15990','0','0','0','1','0','0','0','0','0','0','0','54860','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','10','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','-150000000','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0'), +('500003','2','4395','0','80','0','80','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','Magic Rooster Egg','Sono disposto a darti questo uovo a 15.000 goldi, ma per schiuderlo devi portarmi necessariamente alcuni ingredienti','Dammi 20 Emblem of Triumph, 5 Runed Orb, Uccidi Razorscale e dammi 15000 pezzi d\'oro.','Ottimo! Ecco quello che ti ho promesso! ','Hai portato quello che ti ho chiesto?','','','','','','','47241','45087','0','0','0','0','20','5','0','0','0','0','0','0','0','0','0','0','0','0','33186','0','0','0','1','0','0','0','0','0','0','0','49290','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','-150000000','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0'), +('500004','2','4395','0','80','0','80','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','Great Brewfest Kodo','Sono molto affezionato a questo Kodo, ma sono disposto a cedertelo. Ovviamente, ha un costo...','Dammi 20 Emblem of Triumph, 5 Runed Orb, uccidi Sartharion (Normal) e dammi 15000 pezzi d\'oro','Ottimo! Ecco quello che ti ho promesso! ','Hai portato quello che ti ho chiesto?','','','','','','','47241','45087','0','0','0','0','20','5','0','0','0','0','0','0','0','0','0','0','0','0','28860','0','0','0','1','0','0','0','0','0','0','0','37828','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','-150000000','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0'), +('500005','2','4395','0','80','0','80','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','Celestial Steed','Questo cavallo celestiale è semplicemente rarissimo e indomabile! Non vorrai sperare che te lo dia gratis vero?','Dammi 20 Emblem of Triumph, 5 Runed Orb, uccidi Mimiron (Normal) e dammi 15000 pezzi d\'oro','Ottimo! Ecco quello che ti ho promesso! ','Hai portato quello che ti ho chiesto?','','','','','','','47241','45087','0','0','0','0','20','5','0','0','0','0','0','0','0','0','0','0','0','0','33350','0','0','0','1','0','0','0','0','0','0','0','54811','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','-150000000','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0'), +('500006','2','4395','0','80','0','80','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','Wooly White Rhino','Questo è il più bel kodo che ho! Lo vuoi?','Dammi 20 Emblem of Triumph, 5 Runed ORb, uccidi Ignis The Furnace Master (Normal) e dammi 15000 pezzi d\'oro','Ottimo! Ecco quello che ti ho promesso! ','Hai portato quello che ti ho chiesto?','','','','','','','47241','45087','0','0','0','0','20','5','0','0','0','0','0','0','0','0','0','0','0','0','33118','0','0','0','1','0','0','0','0','0','0','0','54068','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','-150000000','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0'); + +DELETE FROM `creature_template` WHERE `entry` = 500000; +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`, `speed_run`, `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`, `WDBVerified`) VALUE +('500000','0','0','0','0','0','23761','0','0','0','Spacciatore','Wanted from Staff','','0','80','80','2','35','35','3','1.1','1.14286','1','0','252','357','0','304','1','2000','0','1','768','8','0','0','0','0','0','215','320','44','7','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','0','0','0','0','0','0','0','0','1','0','0','0','','1'); + +DELETE FROM `creature_involvedrelation` WHERE `id` = 500000; +INSERT INTO `creature_involvedrelation` (`id`, `quest`) VALUES +('500000','500001'), +('500000','500002'), +('500000','500003'), +('500000','500004'), +('500000','500005'), +('500000','500006'); + +DELETE FROM `creature_questrelation` WHERE `id` = 500000; +INSERT INTO `creature_questrelation` (`id`, `quest`) VALUES +('500000','500001'), +('500000','500002'), +('500000','500003'), +('500000','500004'), +('500000','500005'), +('500000','500006'); + diff --git a/sql/bloodycore/database/11495_xt002_vehicleid.sql b/sql/bloodycore/database/11495_xt002_vehicleid.sql new file mode 100644 index 0000000000000..c95ab25224faf --- /dev/null +++ b/sql/bloodycore/database/11495_xt002_vehicleid.sql @@ -0,0 +1,11 @@ +-- XT-002 correct vehicle id +UPDATE `creature_template` SET `VehicleId` = 353 WHERE `entry` = 33293; +-- XT-002 Hearth +DELETE FROM `vehicle_accessory` WHERE `entry` = 33293; +INSERT INTO `vehicle_accessory` VALUES +(33293, 33329, 0, 1, "XT-002 Hearth"); +-- Gravity Bomb +DELETE FROM spell_script_names WHERE spell_id IN (63025, 64233); +INSERT INTO spell_script_names VALUES +(63025, "spell_xt002_gravity_bomb"), +(64233, "spell_xt002_gravity_bomb"); \ No newline at end of file diff --git a/sql/bloodycore/database/11496_gluth_decimate.sql b/sql/bloodycore/database/11496_gluth_decimate.sql new file mode 100644 index 0000000000000..f65dae8809817 --- /dev/null +++ b/sql/bloodycore/database/11496_gluth_decimate.sql @@ -0,0 +1,4 @@ +DELETE FROM spell_script_names WHERE spell_id IN (28374, 54426); +INSERT INTO spell_script_names VALUES +(28374, "spell_gluth_decimate"), +(54426, "spell_gluth_decimate"); \ No newline at end of file diff --git a/sql/bloodycore/database/11535_argent_tabard_tele.sql b/sql/bloodycore/database/11535_argent_tabard_tele.sql new file mode 100644 index 0000000000000..e274bf20ca644 --- /dev/null +++ b/sql/bloodycore/database/11535_argent_tabard_tele.sql @@ -0,0 +1,4 @@ +-- Fix Argent Crusader's Tabard teleport location +DELETE FROM `spell_target_position` WHERE `id`=66238; +INSERT INTO `spell_target_position` (`id`,`target_map`,`target_position_x`,`target_position_y`,`target_position_z`,`target_orientation`) VALUES +(66238,571,8491.808594,1100.631470,554.361206,0.693504); \ No newline at end of file diff --git a/sql/bloodycore/database/11600_ulduar_fix.sql b/sql/bloodycore/database/11600_ulduar_fix.sql new file mode 100644 index 0000000000000..7c06242dd7995 --- /dev/null +++ b/sql/bloodycore/database/11600_ulduar_fix.sql @@ -0,0 +1,4 @@ +-- Salvaged Chopper has faction dependent modelid +UPDATE `creature_template` SET `modelid2` = 0 WHERE `entry` = 33062; +-- Sanctum Sentry 25 damage nerf +UPDATE `creature_template` SET `dmg_multiplier` = 35 WHERE `entry` = 34166; \ No newline at end of file diff --git a/sql/bloodycore/database/11605_dalaran_tele.sql b/sql/bloodycore/database/11605_dalaran_tele.sql new file mode 100644 index 0000000000000..605198b1cf062 --- /dev/null +++ b/sql/bloodycore/database/11605_dalaran_tele.sql @@ -0,0 +1,4 @@ +-- Fix Dalaran teleport location +DELETE FROM `spell_target_position` WHERE `id`=71512; +INSERT INTO `spell_target_position` (`id`,`target_map`,`target_position_x`,`target_position_y`,`target_position_z`,`target_orientation`) VALUES +(71512,571,5804.15,624.77,647.77,1.64); \ No newline at end of file diff --git a/sql/bloodycore/database/11606_onixya_warder_respawn.sql b/sql/bloodycore/database/11606_onixya_warder_respawn.sql new file mode 100644 index 0000000000000..b26e488e152a9 --- /dev/null +++ b/sql/bloodycore/database/11606_onixya_warder_respawn.sql @@ -0,0 +1,2 @@ +-- Onixya Warder respawn +UPDATE `creature` SET `spawntimesecs`=1000000 WHERE `id`=12129; \ No newline at end of file diff --git a/sql/bloodycore/database/11606_voa_koralon.sql b/sql/bloodycore/database/11606_voa_koralon.sql new file mode 100644 index 0000000000000..06027c9fea18a --- /dev/null +++ b/sql/bloodycore/database/11606_voa_koralon.sql @@ -0,0 +1,6 @@ +DELETE FROM spell_script_names WHERE spell_id = 66765; +INSERT INTO spell_script_names VALUES +(66765, "spell_koralon_meteor_fists"); + +DELETE FROM `creature_model_info` WHERE (`modelid`=29524); +INSERT INTO `creature_model_info` (`modelid`, `bounding_radius`, `combat_reach`, `gender`, `modelid_other_gender`) VALUES (29524, 0.45, 8, 2, 0); \ No newline at end of file diff --git a/sql/bloodycore/database/11653_argent_floor_hp.sql b/sql/bloodycore/database/11653_argent_floor_hp.sql new file mode 100644 index 0000000000000..47c726927e03f --- /dev/null +++ b/sql/bloodycore/database/11653_argent_floor_hp.sql @@ -0,0 +1,2 @@ +-- trial fo rusader floor HP +UPDATE `gameobject_template` SET `data0`=10000000 WHERE `entry`=195527; \ No newline at end of file diff --git a/sql/bloodycore/database/11687_achi_koralon.sql b/sql/bloodycore/database/11687_achi_koralon.sql new file mode 100644 index 0000000000000..4ce56b81faf2b --- /dev/null +++ b/sql/bloodycore/database/11687_achi_koralon.sql @@ -0,0 +1,5 @@ +-- Achievement Defeat Koralon the Flame Watcher +DELETE FROM achievement_criteria_data WHERE criteria_id IN (11478, 11479); +INSERT INTO achievement_criteria_data VALUES +(11478, 12, 0, 0, ""), -- Koralon 10 +(11479, 12, 1, 0, ""); -- Koralon 25 \ No newline at end of file diff --git a/sql/bloodycore/database/11697_season7_vendor.sql b/sql/bloodycore/database/11697_season7_vendor.sql new file mode 100644 index 0000000000000..c8bf6a56b45b5 --- /dev/null +++ b/sql/bloodycore/database/11697_season7_vendor.sql @@ -0,0 +1,20 @@ +DELETE FROM `npc_vendor` WHERE `entry` IN (34060, 34078) AND `item` IN (42133, 42134, 42135, 42136, 42137); +INSERT INTO `npc_vendor` (`entry`, `slot`, `item`, `maxcount`, `incrtime`, `ExtendedCost`) VALUES +-- Battlemaster HORDE +(34060, 0, 42137, 0, 0, 2718), +(34060, 0, 42136, 0, 0, 2718), +(34060, 0, 42134, 0, 0, 2718), +(34060, 0, 42135, 0, 0, 2718), +(34060, 0, 42133, 0, 0, 2718), +-- Battlemaster ALLY +(34078, 0, 42137, 0, 0, 2718), +(34078, 0, 42136, 0, 0, 2718), +(34078, 0, 42134, 0, 0, 2718), +(34078, 0, 42135, 0, 0, 2718), +(34078, 0, 42133, 0, 0, 2718); +-- Relentless shields +DELETE FROM `npc_vendor` WHERE `entry` = 33927 AND `item` IN (42561, 42566, 42572); +INSERT INTO `npc_vendor` (`entry`, `slot`, `item`, `maxcount`, `incrtime`, `ExtendedCost`) VALUES +(33927, 0, 42561, 0, 0, 2701), +(33927, 0, 42566, 0, 0, 2701), +(33927, 0, 42572, 0, 0, 2701); diff --git a/sql/bloodycore/database/11704_spell_powring_up.sql b/sql/bloodycore/database/11704_spell_powring_up.sql new file mode 100644 index 0000000000000..af231758645df --- /dev/null +++ b/sql/bloodycore/database/11704_spell_powring_up.sql @@ -0,0 +1,6 @@ +DELETE FROM `spell_script_names` WHERE `spell_id` IN (67590,67602,67603,67604) AND `ScriptName`='spell_powering_up'; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(67590, 'spell_powering_up'), +(67602, 'spell_powering_up'), +(67603, 'spell_powering_up'), +(67604, 'spell_powering_up'); diff --git a/sql/bloodycore/database/11705_deadly_furious_wands.sql b/sql/bloodycore/database/11705_deadly_furious_wands.sql new file mode 100644 index 0000000000000..8646a0b3edcce --- /dev/null +++ b/sql/bloodycore/database/11705_deadly_furious_wands.sql @@ -0,0 +1,9 @@ +DELETE FROM `npc_vendor` WHERE (`entry` = 33925 AND `item` IN (42519, 42502)) OR (`entry` = 33926 AND `item` IN (42503, 42514, 42520)); +INSERT INTO `npc_vendor` VALUES +-- Deadly Wands +(33925, 0, 42519, 0, 0, 386), +(33925, 0, 42502, 0, 0, 386), +-- Furious Wands +(33926, 0, 42503, 0, 0, 2608), +(33926, 0, 42514, 0, 0, 2608), +(33926, 0, 42520, 0, 0, 2608); diff --git a/sql/bloodycore/database/11763_netherwing_chain.sql b/sql/bloodycore/database/11763_netherwing_chain.sql new file mode 100644 index 0000000000000..20ed3cc0a13fa --- /dev/null +++ b/sql/bloodycore/database/11763_netherwing_chain.sql @@ -0,0 +1,2 @@ +-- Fix Unlocking Zuluhed's Chains +UPDATE `quest_template` SET `ReqCreatureOrGOId1` = -185156 WHERE `entry` = 10866; \ No newline at end of file diff --git a/sql/bloodycore/database/11764_trial_champion.sql b/sql/bloodycore/database/11764_trial_champion.sql new file mode 100644 index 0000000000000..c2563102cfc2b --- /dev/null +++ b/sql/bloodycore/database/11764_trial_champion.sql @@ -0,0 +1,41 @@ +-- Trail of the champions +-- Faction of Argent Warhorse and Argent Battleworg +UPDATE `creature_template` SET `faction_H`=16 WHERE `entry`=35644; +UPDATE `creature_template` SET `faction_A`=16 WHERE `entry`=36558; +-- Unit flags Battleworg +UPDATE `creature_template` SET `unit_flags`=256 WHERE `entry`=36558; +-- Spells for Battleworg +UPDATE `creature_template` SET `spell1`=68505, `spell2`=62575, `spell3`=68282, `spell4`=66482 WHERE `entry`=36558; +-- Vehicleid of Warhorse +UPDATE `creature_template` SET `VehicleId`=486 WHERE `entry`=35644; +-- Speeds +UPDATE `creature_template` SET `speed_run`=2 WHERE `entry` IN (36558, 35644); +-- Attacktime +UPDATE `creature_template` SET `baseattacktime`=0 WHERE `entry` IN (36558, 35644); +-- Vehicle template accessory for minions +DELETE FROM `vehicle_template_accessory` WHERE `entry` IN (33321, 33323, 33320, 33322, 33316, 33317, 33324, 33217, 33318, 33319); +INSERT INTO `vehicle_template_accessory` (`entry`,`accessory_entry`,`seat_id`,`minion`,`description`) VALUES +(33321,35323,0,1, 'Darkspear Raptor'), +(33323,35326,0,1, 'Silvermoon Hawkstrider'), +(33320,35314,0,1, 'Orgrimmar Wolf'), +(33322,35325,0,1, 'Thunder Bluff Kodo'), +(33316,35329,0,1, 'Ironforge Ram'), +(33317,35331,0,1, 'Gnomeregan Mechanostrider'), +(33324,35327,0,1, 'Forsaken Warhorse'), +(33217,35328,0,1, 'Stormwind Steed'), +(33318,35330,0,1, 'Exodar Elekk'), +(33319,35332,0,1, 'Darnassian Nightsaber'); +-- Equipements ids +UPDATE `creature_template` SET `equipment_id`=2049 WHERE `entry` in (35314,35326,35327,35325,35323,35331,35330,35329,35328,35332); +UPDATE `creature_template` SET `equipment_id`=2025 WHERE `entry` in (35571,36090); +UPDATE `creature_template` SET `equipment_id`=2021 WHERE `entry` in (35569,36085); +UPDATE `creature_template` SET `equipment_id`=2018 WHERE `entry` in (35572,36089); +UPDATE `creature_template` SET `equipment_id`=2020 WHERE `entry` in (35617,36084); +UPDATE `creature_template` SET `equipment_id`=2019 WHERE `entry` in (35570,36091); +UPDATE `creature_template` SET `equipment_id`=2096 WHERE `entry` in (34701,36803); +UPDATE `creature_template` SET `equipment_id`=2093 WHERE `entry` in (34703,36087); +UPDATE `creature_template` SET `equipment_id`=2095 WHERE `entry` in (34657,36086); +UPDATE `creature_template` SET `equipment_id`=2092 WHERE `entry` in (34705,36088); +UPDATE `creature_template` SET `equipment_id`=834 WHERE `entry` in (35119,35518); +UPDATE `creature_template` SET `equipment_id`=235 WHERE `entry` in (34928,35517); +UPDATE `creature_template` SET `equipment_id`=0 WHERE `entry` in (35451,35490); \ No newline at end of file diff --git a/sql/bloodycore/database/11766_trial_champion_2.sql b/sql/bloodycore/database/11766_trial_champion_2.sql new file mode 100644 index 0000000000000..100de01025c0b --- /dev/null +++ b/sql/bloodycore/database/11766_trial_champion_2.sql @@ -0,0 +1,31 @@ +-- Scriptname, hp, damage, level +UPDATE `creature_template` SET +`ScriptName`='generic_vehicleAI_toc5', +`minlevel`='80', +`maxlevel`='80', +`rank`='1', +`mindmg`='420', +`maxdmg`='630', +`attackpower`='157', +`Health_mod`='5,95238' WHERE `entry` IN (33324, 33321, 33322, 33320, 33323, 33319, 33318, 33317, 33316, 33324); + +-- Hp, damage and level.. +UPDATE `creature_template` SET +`unit_flags`=0 , +`minlevel`='80', +`maxlevel`='80', +`mindmg`='420', +`rank`='1', +`maxdmg`='630', +`attackpower`='157', +`Health_mod`='15' WHERE `entry` IN (35635, 35640, 35634, 35638, 35641, 34658, 35633, 35768, 35636, 35637); + +-- Npcs on vehicle should be passive and untargettable +-- (not blizzlike, but only way to make the event works. On offy players must kill the champions not the vehicles..) +UPDATE `creature_template` SET +`AIName`='PassiveAI', +`unit_flags`=33554434 +WHERE `entry` IN (SELECT `accessory_entry` FROM `vehicle_template_accessory` WHERE `entry` IN (33324, 33321, 33322, 33320, 33323, 33319, 33318, 33317, 33316, 33324)); + +-- scale of mokra mount +UPDATE `creature_template` SET `scale`=1.5 WHERE `entry`=35638; \ No newline at end of file diff --git a/sql/bloodycore/database/11781_champions_ai.sql b/sql/bloodycore/database/11781_champions_ai.sql new file mode 100644 index 0000000000000..f05dacb0c9b98 --- /dev/null +++ b/sql/bloodycore/database/11781_champions_ai.sql @@ -0,0 +1,4 @@ +-- Revert PassiveAI for champions on mount +UPDATE `creature_template` SET +`AIName`='' +WHERE `entry` IN (SELECT `accessory_entry` FROM `vehicle_template_accessory` WHERE `entry` IN (33324, 33321, 33322, 33320, 33323, 33319, 33318, 33317, 33316, 33324)); \ No newline at end of file diff --git a/sql/bloodycore/database/11785_ulduar_vehicles_spells.sql b/sql/bloodycore/database/11785_ulduar_vehicles_spells.sql new file mode 100644 index 0000000000000..450671f3c28c5 --- /dev/null +++ b/sql/bloodycore/database/11785_ulduar_vehicles_spells.sql @@ -0,0 +1,8 @@ +DELETE FROM `npc_spellclick_spells` WHERE `npc_entry` IN (33113, 33114, 33118, 33293, 33432, 33651); +INSERT INTO `npc_spellclick_spells` (`npc_entry`,`spell_id`,`quest_start`,`quest_start_active`,`quest_end`,`cast_flags`,`aura_required`,`aura_forbidden`,`user_type`) VALUES +(33113,46598,0,0,0,0,0,0,0), -- Flame Leviathan +(33114,46598,0,0,0,0,0,0,0), -- Flame Leviathan Seat +(33118,46598,0,0,0,0,0,0,0), -- Ignis +(33293,46598,0,0,0,0,0,0,0), -- XT-002 +(33432,46598,0,0,0,0,0,0,0), -- Leviathan MK II +(33651,46598,0,0,0,0,0,0,0); -- VX-001 \ No newline at end of file diff --git a/sql/bloodycore/database/11814_memories_template.sql b/sql/bloodycore/database/11814_memories_template.sql new file mode 100644 index 0000000000000..ac20a169db577 --- /dev/null +++ b/sql/bloodycore/database/11814_memories_template.sql @@ -0,0 +1,2 @@ +-- Template update of all Memories of boss "Argent Confessor Paletress" +UPDATE `creature_template` SET `faction_A`=16, `faction_H`=16, `rank`=1, `minlevel`=82, `maxlevel`=82, `exp`=2 WHERE `name` LIKE 'Memory of %'; \ No newline at end of file diff --git a/sql/bloodycore/database/11815_toc5_missing.sql b/sql/bloodycore/database/11815_toc5_missing.sql new file mode 100644 index 0000000000000..daf723ff74705 --- /dev/null +++ b/sql/bloodycore/database/11815_toc5_missing.sql @@ -0,0 +1,13 @@ +-- Faction of vehicles +UPDATE `creature_template` SET +`Faction_A`=16, +`Faction_H`=16 +WHERE `entry` IN (33324, 33321, 33322, 33320, 33323, 33319, 33318, 33317, 33316, 33324); + +-- Scriptname of all Memories of boss "Argent Confessor Paletress" +UPDATE `creature_template` SET `scriptname`='npc_memory' WHERE `name` LIKE 'Memory of %'; + +-- Vehicle for black knight +DELETE FROM `vehicle_template_accessory` WHERE `entry` = 35491; +INSERT INTO `vehicle_template_accessory` (`entry`,`accessory_entry`,`seat_id`,`minion`,`description`) VALUES +(35491,35451,0,0, 'Trial of the Champion - Black Knight on his gryphon'); \ No newline at end of file diff --git a/sql/bloodycore/database/11816_toc5_black_knight.sql.sql b/sql/bloodycore/database/11816_toc5_black_knight.sql.sql new file mode 100644 index 0000000000000..a9be755b2f29e --- /dev/null +++ b/sql/bloodycore/database/11816_toc5_black_knight.sql.sql @@ -0,0 +1,21 @@ +-- Black Knight Gryphon +UPDATE `creature_template` SET +`faction_A`=35, +`faction_H`=35, +`mindmg`=0, +`maxdmg`=0, +`attackpower`=0, +`dmg_multiplier`=0, +`baseattacktime`=0, +`unit_flags`=33554432, +`dynamicflags`=0, +`minrangedmg`=0, +`maxrangedmg`=0, +`rangedattackpower`=0, +`VehicleId`=486 WHERE `entry`=35491; + +-- Boss immune mask +UPDATE `creature_template` SET `mechanic_immune_mask`=805257215 WHERE `entry` IN (35490,35451,35518,35517); + +-- Spellids fix for mounts +UPDATE `creature_template` SET `spell1`=62544, `spell3`=63010 WHERE `entry`IN(35644,36558); \ No newline at end of file diff --git a/sql/bloodycore/database/11817_toc5_event.sql b/sql/bloodycore/database/11817_toc5_event.sql new file mode 100644 index 0000000000000..b2a072d8089b5 --- /dev/null +++ b/sql/bloodycore/database/11817_toc5_event.sql @@ -0,0 +1,53 @@ +-- Black Knight gryphon +DELETE FROM `npc_spellclick_spells` WHERE `npc_entry`= 35491; +INSERT INTO `npc_spellclick_spells` (`npc_entry`,`spell_id`,`quest_start`,`quest_start_active`,`quest_end`,`cast_flags`,`aura_required`,`aura_forbidden`,`user_type`) VALUES +(35491,46598,0,0,0,0,0,0,0); + +-- Script texts +DELETE FROM `script_texts` WHERE `entry` <= -1999926 and `entry` >= -1999970; +INSERT INTO `script_texts` (`npc_entry`,`entry`,`content_default`,`sound`,`type`,`language`,`emote`,`comment`) VALUES +(0,-1999926, 'Coming out of the gate Grand Champions other faction. ' ,0,0,0,1, 'SAY_START' ), +(0,-1999927, 'Good work! You can get your award from Crusader\'s Coliseum chest!. ' ,0,1,0,1, 'Win' ), +(0,-1999928, 'You spoiled my grand entrance. Rat.' ,16256,1,0,5, 'SAY_AGGRO' ), +(0,-1999929, 'Did you honestly think an agent if the Kich King would be bested on the field of your pathetic little tournament?' ,16257,1,0,5, 'SAY_AGGRO_1' ), +(0,-1999930, 'I have come to finish my task ' ,16258,1,0,5, 'SAY_AGGRO_2' ), +(0,-1999931, 'This farce ends here!' ,16259,1,0,5, 'SAY_AGGRO_3' ), +(0,-1999932, '[Zombie]Brains.... .... ....' ,0,1,0,5, 'SAY_SLAY' ), +(0,-1999933, 'My roting flash was just getting in the way!' ,16262,1,0,5, 'SAY_DEATH_1' ), +(0,-1999934, 'I have no need for bones to best you!' ,16263,1,0,5, 'SAY_DEATH_2' ), +(0,-1999935, 'No! I must not fail...again...' ,16264,1,0,5, 'SAY_DEATH_3' ), +(0,-1999936, 'What\'s that. up near the rafters ?' ,0,1,0,5, 'detected' ), +(0,-1999937, 'Please change your weapon! Next battle will be start now!' ,0,3,0,5, 'nx' ), +(0,-1999939, 'Excellent work!' ,0,1,0,1, 'work' ), +(0,-1999940, 'Coming out of the gate Crusader\'s Coliseum Champion.' ,0,0,0,1, 'SAY_START3' ), +(0,-1999941, 'Excellent work! You are win Argent champion!' ,0,3,0,0, 'win' ), +(0,-1999942, 'The Sunreavers are proud to present their representatives in this trial by combat.' ,0,0,0,1, 'an1' ), +(0,-1999943, 'Welcome, champions. Today, before the eyes of your leeders and peers, you will prove youselves worthy combatants.' ,0,0,0,1, 'an2' ), +(0,-1999944, 'Fight well, Horde! Lok\'tar Ogar!' ,0,1,0,5, 'Thrall' ), +(0,-1999945, 'Finally, a fight worth watching.' ,0,1,0,5, 'Garrosh' ), +(0,-1999946, 'I did not come here to watch animals tear at each other senselessly, Tirion' ,0,1,0,5, 'King' ), +(0,-1999947, 'You will first be facing three of the Grand Champions of the Tournament! These fierce contenders have beaten out all others to reach the pinnacle of skill in the joust.' ,0,1,0,5, 'Hightlord' ), +(0,-1999948, 'Will tought! You next challenge comes from the Crusade\'s own ranks. You will be tested against their consederable prowess.' ,0,1,0,5, 'Hightlord2' ), +(0,-1999949, 'You may begin!' ,0,0,0,5, 'text' ), +(0,-1999951, 'Take this time to consider your past deeds.' ,16248,1,0,5, 'palsum' ), +(0,-1999952, 'What is the meaning of this?' ,0,1,0,5, 'dk_hightlord' ), +(0,-1999953, 'No...I\'m still too young' ,0,1,0,5, 'die' ), +(0,-1999954, 'Excellent work! You are win Argent champion!' ,0,3,0,0, 'win' ), +(0,-1999969, 'Pathetic.' ,16260, 1, 0, 0, NULL), +(0,-1999955, 'Well then, let us begin.' ,16247, 1, 0, 0, 'start'), +(0,-1999960, 'Take your rest.' ,16250, 1, 0, 0, NULL), +(0,-1999959, 'Be at ease.' ,16251, 1, 0, 0, NULL), +(0,-1999957, 'You... You need more practice.' ,16137, 1, 0, 0, NULL), +(0,-1999958, 'Nay! Nay! And I say yet again nay! Not good enough!' ,16138, 1, 0, 0, NULL), +(0,-1999961, 'Prepare yourselves!' ,16135, 1, 0, 0, NULL), +(0,-1999962, 'I yield! I submit. Excellent work. May I run away now?' ,16139, 1, 0, 0, NULL), +(0,-1999963, 'Hammer of the Righteous!' ,16136, 1, 0, 0, NULL), +(0,-1999964, 'Are you up to the challenge? I will not hold back.' ,16134, 1, 0, 0, NULL), +(0,-1999965, 'Thank you, good herald. Your words are too kind.' ,16245, 1, 0, 0, NULL), +(0,-1999966, 'May the Light give me strength to provide a worthy challenge.' ,16246, 1, 0, 0, NULL), +(0,-1999967, 'Excellent work!' ,16252, 1, 0, 0, NULL), +(0,-1999968, 'Even the darkest memory fades when confronted.' ,16249, 1, 0, 0, NULL), +(0,-1999970, 'A waste of flesh.' ,16261, 1, 0, 0, NULL); + +-- Unused gate +DELETE FROM `gameobject` WHERE `guid`=150077; \ No newline at end of file diff --git a/sql/bloodycore/database/11818_toc5_announcer.sql b/sql/bloodycore/database/11818_toc5_announcer.sql new file mode 100644 index 0000000000000..bacd623f2b2be --- /dev/null +++ b/sql/bloodycore/database/11818_toc5_announcer.sql @@ -0,0 +1,10 @@ +-- Despawn old announcer +DELETE FROM `creature` WHERE `guid`=200038; +-- Insert new announcer +DELETE FROM `creature_template` WHERE `entry` in (35591,35592); +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_run`, `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`, `RacialLeader`, `questItem1`, `questItem2`, `questItem3`, `questItem4`, `questItem5`, `questItem6`, `movementId`, `RegenHealth`, `equipment_id`, `mechanic_immune_mask`, `flags_extra`, `ScriptName`) VALUES +(35591, 0, 0, 0, 0, 0, 29894, 0, 0, 0, 'Jaeren Sunsworn', '', '', 0, 75, 75, 2, 14, 14, 0, 1, 1, 0, 0, 0, 0, 0, 1, 2000, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '', 0, 3, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 'npc_anstart'), +(35592, 0, 0, 0, 0, 0, 29893, 0, 0, 0, 'Arelas Brightstar', '', '', 0, 75, 75, 2, 14, 14, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 512, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '', 0, 3, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 'npc_anstart');-- Spawn new announcer +DELETE FROM `creature` WHERE `guid` = 230961; +INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `DeathState`, `MovementType`) VALUES +(230961, 35591, 650, 3, 1, 0, 0, 746.626, 618.54, 411.09, 4.63158, 86400, 0, 0, 10635, 0, 0, 0); \ No newline at end of file diff --git a/sql/bloodycore/database/11845_toc5_horde.sql b/sql/bloodycore/database/11845_toc5_horde.sql new file mode 100644 index 0000000000000..baded263d1e7e --- /dev/null +++ b/sql/bloodycore/database/11845_toc5_horde.sql @@ -0,0 +1,6 @@ +DELETE FROM `creature` WHERE `guid` = 230961; -- Despwan an_start +DELETE FROM `creature` WHERE `guid` = 200038; -- despwan announcer +INSERT INTO `creature` VALUES (200038, 35004, 650, 3, 1, 0, 0, 748.309, 619.488, 411.172, 4.71239, 120, 0, 0, 1, 0, 0, 0, 0, 0, 0); -- spawn announcer +-- Modify faction for mounts of players +UPDATE `creature_template` SET `faction_A`=84, `faction_H`=84 WHERE `entry`=35644; +UPDATE `creature_template` SET `faction_A`=83, `faction_H`=83 WHERE `entry`=36558; \ No newline at end of file diff --git a/sql/bloodycore/database/11860_toc5_stormwind.sql b/sql/bloodycore/database/11860_toc5_stormwind.sql new file mode 100644 index 0000000000000..bd5de0e3541d8 --- /dev/null +++ b/sql/bloodycore/database/11860_toc5_stormwind.sql @@ -0,0 +1,4 @@ +-- Stormwind steed template +UPDATE `creature_template` SET `rank`=1, `Health_mod`=5, `faction_A`=16, `faction_H`=16, `ScriptName`='generic_vehicleAI_toc5' WHERE `entry`=33217; +-- Stomwind champion template +UPDATE `creature_template` SET `unit_flags`=33554434, `AIName`='' WHERE `entry`=35328; \ No newline at end of file diff --git a/sql/bloodycore/database/11875_kologarn_arms.sql b/sql/bloodycore/database/11875_kologarn_arms.sql new file mode 100644 index 0000000000000..867eebc6dc04c --- /dev/null +++ b/sql/bloodycore/database/11875_kologarn_arms.sql @@ -0,0 +1,4 @@ +DELETE FROM vehicle_template_accessory WHERE entry = 32930; +INSERT INTO vehicle_template_accessory VALUES +(32930, 32933, 0, 1, "Kologarn - Left Arm", 6, 30000), +(32930, 32934, 1, 1, "Kologarn - Right Arm", 6, 30000); \ No newline at end of file diff --git a/sql/bloodycore/database/11945_yoggsaron_encounter.sql b/sql/bloodycore/database/11945_yoggsaron_encounter.sql new file mode 100644 index 0000000000000..a8998372d4902 --- /dev/null +++ b/sql/bloodycore/database/11945_yoggsaron_encounter.sql @@ -0,0 +1,155 @@ +-- Sara +UPDATE `creature_template` SET `mechanic_immune_mask` = 650854235, `flags_extra` = 1, `ScriptName` = 'boss_sara' WHERE `entry` IN (33134, 34332); +UPDATE creature_model_info SET bounding_radius = 0.465, combat_reach = 45 WHERE modelid = 29117; +UPDATE `creature` SET `spawndist` = 0 WHERE `id` = 33134; +-- Ominous cloud +DELETE FROM `creature` WHERE `id`=33292; +UPDATE `creature_template` SET `ScriptName` = 'npc_ominous_cloud' WHERE `entry` = 33292; +-- Guardian of Yogg-Saron +UPDATE `creature_template` SET `difficulty_entry_1` = 33968, `faction_A` = 14, `faction_H` = 14, `ScriptName` = 'npc_guardian_yoggsaron' WHERE `entry` = 33136; +UPDATE `creature_template` SET `minlevel` = 82, `maxlevel` = 82, `faction_A` = 14, `faction_H` = 14 WHERE `entry` = 33968; +UPDATE creature_model_info SET bounding_radius = 0.62, combat_reach = 1.5 WHERE modelid = 28465; +-- Yogg-Saron +UPDATE `creature_template` SET `faction_A` = 14, `faction_H` = 14, `mechanic_immune_mask` = 650854235, `ScriptName` = 'boss_yoggsaron' WHERE `entry` = 33288; +UPDATE `creature_template` SET `faction_A` = 14, `faction_H` = 14, `mechanic_immune_mask` = 650854235, `flags_extra` = 1 WHERE `entry` = 33955; +UPDATE creature_model_info SET bounding_radius = 0.755, combat_reach = 18 WHERE modelid = 28817; +UPDATE `creature_template` SET `faction_A` = 14, `faction_H` = 14, `speed_walk` = 2, `ScriptName` = 'npc_death_orb' WHERE `entry` = 33882; +-- Brain of Yogg-Saron +UPDATE `creature_template` SET `difficulty_entry_1` = 33954, `faction_A` = 14, `faction_H` = 14, `mechanic_immune_mask` = 650854235, `ScriptName` = 'boss_brain_yoggsaron' WHERE `entry` = 33890; +UPDATE `creature_template` SET `faction_A` = 14, `faction_H` = 14, `mechanic_immune_mask` = 650854235 WHERE `entry` = 33954; +UPDATE creature_model_info SET bounding_radius = 0.755, combat_reach = 30 WHERE modelid = 28951; +-- Illusions +UPDATE `creature_template` SET `minlevel` = 82, `maxlevel` = 82, `faction_A` = 14, `faction_H` = 14, `ScriptName` = 'npc_laughing_skull' WHERE `entry` = 33990; +UPDATE `creature_template` SET `minlevel` = 82, `maxlevel` = 82, `faction_A` = 7, `faction_H` = 7, `mechanic_immune_mask` = 650854235, `ScriptName` = 'npc_illusion' WHERE `entry` IN (33433, 33716, 33717, 33719, 33720, 33567); +UPDATE creature_model_info SET bounding_radius = 0.306, combat_reach = 1.5 WHERE modelid = 28621; +UPDATE creature_model_info SET bounding_radius = 1, combat_reach = 10 WHERE modelid IN (2718, 1687, 2717, 12869); +-- Influence Tentacle +UPDATE `creature_template` SET `difficulty_entry_1` = 33959, `minlevel` = 82, `maxlevel` = 82, `faction_A` = 14, `faction_H` = 14 WHERE `entry` = 33943; +UPDATE `creature_template` SET `minlevel` = 82, `maxlevel` = 82, `faction_A` = 14, `faction_H` = 14 WHERE `entry` = 33959; +UPDATE creature_model_info SET bounding_radius = 0.306, combat_reach = 1.5 WHERE modelid = 28813; +-- Fake npcs +UPDATE `creature_template` SET ScriptName = "npc_passive_illusion" WHERE `entry` IN (33436, 33437, 33536, 33535, 33495, 33523, 33441, 33442); +-- Whispers +UPDATE `script_texts` SET `type` = 4 WHERE `entry` IN (-1603317, -1603340, -1603339); +-- Descend into madness portal +UPDATE `creature_template` SET `npcflag` = 16777216, `unit_flags` = 2, `type_flags` = 0, `ScriptName` = 'npc_descend_into_madness' WHERE `entry` = 34072; +DELETE FROM `creature_template` WHERE entry IN (34122, 34123); +INSERT INTO `creature_template` VALUES +('34122','0','0','0','0','0','29074','0','0','0','Descend Into Madness','','Interact','0','81','81','0','35','35','16777216','1','1.14286','1','0','0','0','0','0','1','2000','0','1','2','0','0','0','0','0','0','0','0','0','10','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','0','3','1','1','1','0','0','0','0','0','0','0','0','1','0','0','0','npc_descend_into_madness','11159'), +('34123','0','0','0','0','0','29074','0','0','0','Descend Into Madness','','Interact','0','81','81','0','35','35','16777216','1','1.14286','1','0','0','0','0','0','1','2000','0','1','2','0','0','0','0','0','0','0','0','0','10','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','0','3','1','1','1','0','0','0','0','0','0','0','0','1','0','0','0','npc_descend_into_madness','11159'); +-- Flee to the Surface +UPDATE `gameobject_template` SET `data10` = 63992 WHERE `entry` = 194625; +DELETE FROM `gameobject` WHERE `id` = 194625; +INSERT INTO `gameobject` VALUES +(NULL, 194625, 603, 3, 1, 1996.41, -0.070, 240.59, 0, 0, 0, 1, 0, 300, 0, 1), +(NULL, 194625, 603, 3, 1, 1949.63, -26.07, 241.25, 0, 0, 0, 1, 0, 300, 0, 1), +(NULL, 194625, 603, 3, 1, 1995.03, -52.98, 241.02, 0, 0, 0, 1, 0, 300, 0, 1); +DELETE FROM `npc_spellclick_spells` WHERE `npc_entry` IN (34072, 34122, 34123); +INSERT INTO `npc_spellclick_spells` VALUES +(34072, 63989, 0, 0, 0, 3, 0, 0, 0), -- Stormwind +(34122, 63997, 0, 0, 0, 3, 0, 0, 0), -- Chamber +(34123, 63998, 0, 0, 0, 3, 0, 0, 0); -- Icecrown +-- Cancel Illusion Room Aura +DELETE FROM `spell_linked_spell` WHERE `spell_trigger` = 63992; +INSERT INTO `spell_linked_spell` VALUES +(63992, -63988, 0, "Cancel Illusion Room Aura"); +-- Dragon blood +DELETE FROM gameobject WHERE id = 194462; +INSERT INTO gameobject VALUES (NULL, 194462, 603, 3, 1, 2104.35, -25.3753, 242.647, 0, 0, 0, 0, -1, 300, 0, 1); +-- Remove spawned mobs +-- DELETE FROM `creature` WHERE `id`=34137 AND position_x = 1921.84; +-- Portals coordinates +DELETE FROM `spell_target_position` WHERE `id` IN (63989, 63992, 63997, 63998); +INSERT INTO `spell_target_position` VALUES +(63989, 603, 1953.91, 21.91, 239.71, 2.08), +(63992, 603, 1980.28, -25.59, 329.40, 3.14), +(63997, 603, 2042.02, -25.54, 239.72, 0), +(63998, 603, 1948.44, -82.04, 239.99, 4.18); +-- Tentacles +UPDATE `creature_template` SET `difficulty_entry_1` = 33984, `faction_A` = 14, `faction_H` = 14, `ScriptName` = "npc_constrictor_tentacle" WHERE `entry` = 33983; +UPDATE `creature_template` SET `minlevel` = 82, `maxlevel` = 82, `faction_A` = 14, `faction_H` = 14, `VehicleId` = 385 WHERE `entry` = 33984; +UPDATE creature_model_info SET bounding_radius = 0.306, combat_reach = 1.5 WHERE modelid = 28815; +-- Constrictor vehicle +DELETE FROM `npc_spellclick_spells` WHERE `npc_entry` = 33983; +INSERT INTO `npc_spellclick_spells` (`npc_entry`,`spell_id`,`quest_start`,`quest_start_active`,`quest_end`,`cast_flags`,`aura_required`,`aura_forbidden`,`user_type`) VALUES +(33983,46598,0,0,0,0,0,0,0); +UPDATE `creature_template` SET `difficulty_entry_1` = 33967, `faction_A` = 14, `faction_H` = 14, `baseattacktime` = 1800, `ScriptName` = 'npc_crusher_tentacle' WHERE `entry` = 33966; +UPDATE `creature_template` SET `minlevel` = 81, `maxlevel` = 81, `faction_A` = 14, `faction_H` = 14, `baseattacktime` = 1800 WHERE `entry` = 33967; +UPDATE creature_model_info SET bounding_radius = 0.985, combat_reach = 5 WHERE modelid = 28814; +UPDATE `creature_template` SET `difficulty_entry_1` = 33986, `faction_A` = 14, `faction_H` = 14, `ScriptName` = 'npc_corruptor_tentacle' WHERE `entry` = 33985; +UPDATE `creature_template` SET `minlevel` = 82, `maxlevel` = 82, `faction_A` = 14, `faction_H` = 14 WHERE `entry` = 33986; +-- Immortal Guardian +UPDATE `creature_template` SET `difficulty_entry_1` = 33989, `faction_A` = 14, `faction_H` = 14, `mechanic_immune_mask` = 650854235, `ScriptName` = 'npc_immortal_guardian' WHERE `entry` = 33988; +UPDATE `creature_template` SET `minlevel` = 82, `maxlevel` = 82, `faction_A` = 14, `faction_H` = 14, `mechanic_immune_mask` = 650854235 WHERE `entry` = 33989; +UPDATE creature_model_info SET bounding_radius = 0.92, combat_reach = 4 WHERE modelid = 29024; +-- Remove area stun +DELETE FROM `spell_linked_spell` WHERE `spell_trigger` IN (64059, 65238); +INSERT INTO `spell_linked_spell` VALUES +(64059, 65238, 0, "Shattered illusion remove"), +(65238, -64173, 1, "Shattered illusion remove"); +-- Yogg-Saron emotes +DELETE FROM script_texts WHERE entry IN (-1603342, -1603343, -1603344); +INSERT INTO script_texts VALUES +(33288, -1603342, "Portals open into Yogg-Saron's mind!", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 5, 0, 0, "YoggSaron EMOTE_PORTALS"), +(33288, -1603343, "The Illusion shatters and a path to the central chamber opens!", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 5, 0, 0, "YoggSaron EMOTE_OPEN_CHAMBER"), +(33288, -1603344, "Yogg-Saron prepares to unleash Empowering Shadows!", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 5, 0, 0, "YoggSaron EMOTE_EMPOWERING"); +-- Ulduar Keepers Images +DELETE FROM `creature` WHERE `id` IN (33213, 33241, 33242, 33244); +INSERT INTO `creature` (`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`DeathState`,`MovementType`) VALUES +(33241, 603, 3, 1, 0, 0, 2057.81, -24.0768, 421.532, 3.12904, 604800, 0, 0, 14433075, 0, 0, 0), +(33242, 603, 3, 1, 0, 0, 2036.81, -73.7053, 411.353, 2.43575, 604800, 0, 0, 14433075, 0, 0, 0), +(33244, 603, 3, 1, 0, 0, 2036.74, 25.4642, 411.357, 3.81412, 604800, 0, 0, 14433075, 0, 0, 0), +(33213, 603, 3, 1, 0, 0, 1939.29, -90.6994, 411.357, 1.02595, 604800, 0, 0, 14433075, 0, 0, 0); + +UPDATE `creature_template` SET `faction_A` = 35, `faction_H` = 35, `npcflag` = 1, `flags_extra` = 2, `ScriptName` = 'npc_keeper_image' WHERE `entry` IN (33213, 33241, 33242, 33244); + +-- Keepers (Yogg Saron Encounter) +DELETE FROM `creature` WHERE `id` IN (33410, 33411, 33412, 33413); +INSERT INTO `creature` (`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`DeathState`,`MovementType`) VALUES +(33410, 603, 3, 1, 0, 0, 2036.739, 25.464, 338.296, 3.814, 604800, 0, 0, 14433075, 0, 0, 0), +(33411, 603, 3, 1, 0, 0, 1939.094, -90.699, 338.296, 1.026, 604800, 0, 0, 14433075, 0, 0, 0), +(33412, 603, 3, 1, 0, 0, 1939.094, 42.534, 338.296, 5.321, 604800, 0, 0, 14433075, 0, 0, 0), +(33413, 603, 3, 1, 0, 0, 2036.739, -73.705, 338.296, 2.435, 604800, 0, 0, 14433075, 0, 0, 0); + +UPDATE `creature_template` SET `ScriptName` = 'npc_ys_freya' WHERE `entry` = 33410; +UPDATE `creature_template` SET `ScriptName` = 'npc_ys_hodir' WHERE `entry` = 33411; +UPDATE `creature_template` SET `ScriptName` = 'npc_ys_mimiron' WHERE `entry` = 33412; +UPDATE `creature_template` SET `ScriptName` = 'npc_ys_thorim' WHERE `entry` = 33413; +UPDATE `creature_template` SET `ScriptName` = 'npc_sanity_well' WHERE `entry` = 33991; + +-- Death Ray Target +DELETE FROM conditions WHERE SourceEntry IN (63882, 63886); +INSERT INTO conditions VALUES +(13, 0, 63882, 0, 18, 1, 33134, 0, 0, '', 'Death Ray Warning (Yogg-Saron)'), +(13, 0, 63886, 0, 18, 1, 33134, 0, 0, '', 'Death Ray Damage (Yogg-Saron)'); + +-- Shattered Illusion Targets +DELETE FROM conditions WHERE SourceEntry = 64173; +INSERT INTO conditions VALUES +(13, 0, 64173, 0, 18, 1, 33966, 0, 0, '', 'Shattered Illusion (Yogg-Saron)'), +(13, 0, 64173, 0, 18, 1, 33983, 0, 0, '', 'Shattered Illusion (Yogg-Saron)'), +(13, 0, 64173, 0, 18, 1, 33985, 0, 0, '', 'Shattered Illusion (Yogg-Saron)'); + +-- Thorim's Titanic Storm +DELETE FROM conditions WHERE SourceEntry = 64172; +INSERT INTO conditions VALUES +(13, 0, 64172, 0, 18, 1, 33988, 0, 0, '', 'Thorim''s Titanic Storm (Yogg-Saron)'); + +-- Empowering Shadows +DELETE FROM conditions WHERE SourceEntry = 64468; +INSERT INTO conditions VALUES +(13, 0, 64468, 0, 18, 1, 33288, 0, 0, '', 'Empowering Shadows (Yogg-Saron)'), +(13, 0, 64468, 0, 18, 1, 33988, 0, 0, '', 'Empowering Shadows (Yogg-Saron)'); + +-- Shadow Nova Target +DELETE FROM conditions WHERE SourceEntry IN (62714, 65209); +INSERT INTO conditions VALUES +(13, 0, 62714, 0, 18, 1, 33134, 0, 0, '', 'Shadow Nova (Yogg-Saron)'), +(13, 0, 65209, 0, 18, 1, 33134, 0, 0, '', 'Shadow Nova (Yogg-Saron)'); + +-- Spell Scripts +DELETE FROM spell_script_names WHERE spell_id IN (64164, 64168, 64059); +INSERT INTO spell_script_names VALUES +(64164, "spell_yoggsaron_lunatic_gaze"), +(64168, "spell_yoggsaron_lunatic_gaze"), +(64059, "spell_yoggsaron_induce_madness"); \ No newline at end of file diff --git a/sql/bloodycore/database/11946_custom_zingara.sql b/sql/bloodycore/database/11946_custom_zingara.sql new file mode 100644 index 0000000000000..ed0ccdc586522 --- /dev/null +++ b/sql/bloodycore/database/11946_custom_zingara.sql @@ -0,0 +1,3 @@ +DELETE FROM `creature_template` WHERE `entry`=100001; +INSERT INTO `creature_template` VALUES +('100001','0','0','0','0','0','108','0','0','0','Zingara','La Luna Nera',NULL,'0','80','80','0','35','35','1','2.18','1.14286','1','3','509','683','0','805','45','1500','0','1','64','8','0','0','0','0','0','20','30','4','7','0','100001','0','0','0','0','0','0','0','0','48138','48142','59265','55266','53095','54098','27020','0','0','0','1305000','1595000','','0','3','310','2','1','0','0','0','0','0','0','0','0','1','0','617299803','0','npc_zingara','0'); \ No newline at end of file diff --git a/sql/bloodycore/database/11968_bloodworms_ai.sql b/sql/bloodycore/database/11968_bloodworms_ai.sql new file mode 100644 index 0000000000000..cc70964ed2bc1 --- /dev/null +++ b/sql/bloodycore/database/11968_bloodworms_ai.sql @@ -0,0 +1,5 @@ +-- Bloodworm AI +DELETE FROM `creature_ai_scripts` WHERE `creature_id` = 28017; +INSERT INTO `creature_ai_scripts` (`id`, `creature_id`, `event_type`, `event_inverse_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action1_type`, `action1_param1`, `action1_param2`, `action1_param3`, `action2_type`, `action2_param1`, `action2_param2`, `action2_param3`, `action3_type`, `action3_param1`, `action3_param2`, `action3_param3`, `comment`) VALUES +(2801700, 28017, 4, 0, 100, 0, 0, 0, 0, 0, 11, 50453, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Bloodworm - Health Leech'); + diff --git a/sql/bloodycore/database/12014_argent_squire.sql b/sql/bloodycore/database/12014_argent_squire.sql new file mode 100644 index 0000000000000..cf4e7f123248a --- /dev/null +++ b/sql/bloodycore/database/12014_argent_squire.sql @@ -0,0 +1,86 @@ +-- ARGENT SQUIRE/GRUNTLING +DELETE FROM `spell_script_names` WHERE `spell_id` = 67039; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUE (67039, 'spell_gen_mounting_check'); +-- Gossip flag +UPDATE `creature_template` SET `npcflag` = 0x81, `gossip_menu_id` = 50000, `ScriptName` = 'npc_argent_squire' WHERE `entry` = 33238; +UPDATE `creature_template` SET `npcflag` = 0x81, `gossip_menu_id` = 50001, `ScriptName` = 'npc_argent_squire' WHERE `entry` = 33239; + +DELETE FROM `gossip_menu` WHERE `entry` IN (50000, 50001); +INSERT INTO `gossip_menu` (`entry`, `text_id`) VALUES +(50000, 14324), +(50001, 14372); + +DELETE FROM `spell_linked_spell` WHERE `spell_effect` = 67401; +INSERT INTO `spell_linked_spell` (`spell_trigger`,`spell_effect`, `type`, `comment`) VALUES +(-67368, 67401, 0, 'Argent Squire - Bank'), +(-67377, 67401, 0, 'Argent Squire - Shop'), +(-67376, 67401, 0, 'Argent Squire - Mail'); + +DELETE FROM `npc_vendor` WHERE `entry` IN (33238, 33239); +INSERT INTO `npc_vendor` (`entry`, `slot`, `item`, `maxcount`, `incrtime`, `ExtendedCost`) VALUES +-- Squire +(33238, 1, 3775, 0, 0, 0), +(33238, 2, 5237, 0, 0, 0), +(33238, 3, 5565, 0, 0, 0), +(33238, 4, 16583, 0, 0, 0), +(33238, 5, 17020, 0, 0, 0), +(33238, 6, 17030, 0, 0, 0), +(33238, 7, 17031, 0, 0, 0), +(33238, 8, 17032, 0, 0, 0), +(33238, 9, 17033, 0, 0, 0), +(33238, 10, 21177, 0, 0, 0), +(33238, 11, 37201, 0, 0, 0), +(33238, 12, 41584, 0, 0, 0), +(33238, 13, 41586, 0, 0, 0), +(33238, 14, 43231, 0, 0, 0), +(33238, 15, 43233, 0, 0, 0), +(33238, 16, 43235, 0, 0, 0), +(33238, 17, 43237, 0, 0, 0), +(33238, 18, 44605, 0, 0, 0), +(33238, 19, 44614, 0, 0, 0), +(33238, 20, 44615, 0, 0, 0), + +(33238, 21, 33449, 0, 0, 0), +(33238, 22, 33451, 0, 0, 0), +(33238, 23, 33454, 0, 0, 0), +(33238, 24, 33443, 0, 0, 0), +(33238, 25, 35949, 0, 0, 0), +(33238, 26, 35952, 0, 0, 0), +(33238, 27, 35953, 0, 0, 0), +(33238, 28, 35951, 0, 0, 0), +(33238, 29, 35948, 0, 0, 0), +(33238, 30, 35950, 0, 0, 0), + +-- Gruntling +(33239, 1, 3775, 0, 0, 0), +(33239, 2, 5237, 0, 0, 0), +(33239, 3, 5565, 0, 0, 0), +(33239, 4, 16583, 0, 0, 0), +(33239, 5, 17020, 0, 0, 0), +(33239, 6, 17030, 0, 0, 0), +(33239, 7, 17031, 0, 0, 0), +(33239, 8, 17032, 0, 0, 0), +(33239, 9, 17033, 0, 0, 0), +(33239, 10, 21177, 0, 0, 0), +(33239, 11, 37201, 0, 0, 0), +(33239, 12, 41584, 0, 0, 0), +(33239, 13, 41586, 0, 0, 0), +(33239, 14, 43231, 0, 0, 0), +(33239, 15, 43233, 0, 0, 0), +(33239, 16, 43235, 0, 0, 0), +(33239, 17, 43237, 0, 0, 0), +(33239, 18, 44605, 0, 0, 0), +(33239, 19, 44614, 0, 0, 0), +(33239, 20, 44615, 0, 0, 0), + +(33239, 21, 33449, 0, 0, 0), +(33239, 22, 33451, 0, 0, 0), +(33239, 23, 33454, 0, 0, 0), +(33239, 24, 33443, 0, 0, 0), +(33239, 25, 35949, 0, 0, 0), +(33239, 26, 35952, 0, 0, 0), +(33239, 27, 35953, 0, 0, 0), +(33239, 28, 35951, 0, 0, 0), +(33239, 29, 35948, 0, 0, 0), +(33239, 30, 35950, 0, 0, 0); + diff --git a/sql/bloodycore/database/12031_wintergrasp_commendation.sql b/sql/bloodycore/database/12031_wintergrasp_commendation.sql new file mode 100644 index 0000000000000..d24da48d1b7a4 --- /dev/null +++ b/sql/bloodycore/database/12031_wintergrasp_commendation.sql @@ -0,0 +1,5 @@ +DELETE FROM `npc_vendor` WHERE `item` = 44115 AND `ExtendedCost` = 2576; +INSERT INTO `npc_vendor` (`entry`, `slot`, `item`, `maxcount`, `incrtime`, `ExtendedCost`) VALUES +(32294, 0, 44115, 0, 0, 2576), +(32296, 0, 44115, 0, 0, 2576); + diff --git a/sql/bloodycore/database/12032_onyxia_eggs.sql b/sql/bloodycore/database/12032_onyxia_eggs.sql new file mode 100644 index 0000000000000..edb0921d85ab1 --- /dev/null +++ b/sql/bloodycore/database/12032_onyxia_eggs.sql @@ -0,0 +1,2 @@ +-- Onyxia eggs cooldown +UPDATE `gameobject_template` SET `data5` = 15 WHERE `entry` = 176511; \ No newline at end of file diff --git a/sql/bloodycore/database/12052_npc_pusillin.sql b/sql/bloodycore/database/12052_npc_pusillin.sql new file mode 100644 index 0000000000000..4d388591b243b --- /dev/null +++ b/sql/bloodycore/database/12052_npc_pusillin.sql @@ -0,0 +1,32 @@ +-- Pusillin script +DELETE FROM `script_texts` WHERE `npc_entry` = 14354; +INSERT INTO `script_texts` (`npc_entry`,`entry`,`content_default`,`sound`,`type`,`language`,`emote`,`comment`) VALUES +(14354, -1901000,'If your want the key, you\'ll have to catch me!',0,0,0,0,'Pusillin 1'), +(14354, -1901002,'Why would you ever want to harm me!? Come. Friends we can be!',0,0,0,0,'pusillin 3'), +(14354, -1901001,'Chase me if you dare! I run without a care',0,0,0,0,'pusillin 2'), +(14354, -1901003,'DIE?! You make Pusillin cry!',0,0,0,0,'pusillin 4'), +(14354, -1901004,'Say hello to my little friends!',0,0,0,0,'pusillin 5'); + +DELETE FROM `script_waypoint` WHERE `entry` = 14354; +INSERT INTO `script_waypoint` (`entry`,`pointid`,`location_x`,`location_y`,`location_z`,`waittime`,`point_comment`) VALUES +(14354,0,83.389,-198.429,-3.95,0,'pusillin 1'), +(14354,1,-161.875,-199.876,-4.159,0,'pusillin 2'), +(14354,2,-153.733,-271.985,-4.147,0,'pusillin 3'), +(14354,3,-133.801,-349.232,-4.067,0,'pusillin 4'), +(14354,4,110.114,-355.008,-4.115,0,'pusillin 5'), +(14354,5,111.454,-468.53,-2.71,0,'pusillin 6'), +(14354,6,112,-513.661,-6.91,0,'pusillin 7'), +(14354,7,110.34,-538.94,-11.07,0,'pusillin 8'), +(14354,8,68.37,-546.36,-15.24,0,'pusillin 9'), +(14354,9,49.46,-564.84,-19.41,0,'pusillin 10'), +(14354,10,50.29,-641.51,-25.14,0,'pusillin 11'), +(14354,11,31.16,-696.35,-25.16,0,'pusillin 12'), +(14354,12,2.65,-695.88,-25.16,0,'pusillin 13'), +(14354,13,3,-671.75,-12.64,0,'pusillin 14'), +(14354,14,10.38,-665.57,-12.64,0,'pusillin 15'), +(14354,15,8.11,-673.06,-12.64,0,'pusillin 16'), +(14354,16,11.46,-708.44,-12.64,0,'pusillin 17'); + +UPDATE `creature` SET `spawntimesecs` = 300 WHERE `guid` = 84377; + +UPDATE `creature_template` SET `ScriptName` = 'npc_pusillin', `speed_run` = 2.14286 WHERE `entry` =14354; \ No newline at end of file diff --git a/sql/bloodycore/database/12055_rare_faction.sql b/sql/bloodycore/database/12055_rare_faction.sql new file mode 100644 index 0000000000000..e34e802884fe2 --- /dev/null +++ b/sql/bloodycore/database/12055_rare_faction.sql @@ -0,0 +1,3 @@ +-- Faction of rare elites of northrend +UPDATE `creature_template` SET `faction_A`=14, `faction_H`=14 WHERE `entry` IN +(32357,32361, 32358,32481,32471,32501,32398,32377,32438,32475,32386,32400); \ No newline at end of file diff --git a/sql/old/3.3.5a/2011_01_06_0_world_scriptname.sql b/sql/old/3.3.5a/2011_01_06_00_world_scriptname.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_06_0_world_scriptname.sql rename to sql/old/3.3.5a/2011_01_06_00_world_scriptname.sql diff --git a/sql/old/3.3.5a/2011_01_06_1_world_scriptname.sql b/sql/old/3.3.5a/2011_01_06_01_world_scriptname.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_06_1_world_scriptname.sql rename to sql/old/3.3.5a/2011_01_06_01_world_scriptname.sql diff --git a/sql/old/3.3.5a/2011_01_06_2_world_scriptname.sql b/sql/old/3.3.5a/2011_01_06_02_world_scriptname.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_06_2_world_scriptname.sql rename to sql/old/3.3.5a/2011_01_06_02_world_scriptname.sql diff --git a/sql/old/3.3.5a/2011_01_08_0_world_spell_script_names.sql b/sql/old/3.3.5a/2011_01_08_00_world_spell_script_names.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_08_0_world_spell_script_names.sql rename to sql/old/3.3.5a/2011_01_08_00_world_spell_script_names.sql diff --git a/sql/old/3.3.5a/2011_01_08_1_world_scriptname.sql b/sql/old/3.3.5a/2011_01_08_01_world_scriptname.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_08_1_world_scriptname.sql rename to sql/old/3.3.5a/2011_01_08_01_world_scriptname.sql diff --git a/sql/old/3.3.5a/2011_01_08_2_world_scriptname.sql b/sql/old/3.3.5a/2011_01_08_02_world_scriptname.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_08_2_world_scriptname.sql rename to sql/old/3.3.5a/2011_01_08_02_world_scriptname.sql diff --git a/sql/old/3.3.5a/2011_01_08_3_world_trinity_strings.sql b/sql/old/3.3.5a/2011_01_08_03_world_trinity_strings.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_08_3_world_trinity_strings.sql rename to sql/old/3.3.5a/2011_01_08_03_world_trinity_strings.sql diff --git a/sql/old/3.3.5a/2011_01_08_4_world_spell_linked_spell.sql b/sql/old/3.3.5a/2011_01_08_04_world_spell_linked_spell.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_08_4_world_spell_linked_spell.sql rename to sql/old/3.3.5a/2011_01_08_04_world_spell_linked_spell.sql diff --git a/sql/old/3.3.5a/2011_01_09_0_world_scriptname.sql b/sql/old/3.3.5a/2011_01_09_00_world_scriptname.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_09_0_world_scriptname.sql rename to sql/old/3.3.5a/2011_01_09_00_world_scriptname.sql diff --git a/sql/old/3.3.5a/2011_01_10_0_world_spell_linked_spell.sql b/sql/old/3.3.5a/2011_01_10_00_world_spell_linked_spell.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_10_0_world_spell_linked_spell.sql rename to sql/old/3.3.5a/2011_01_10_00_world_spell_linked_spell.sql diff --git a/sql/old/3.3.5a/2011_01_16_0_world_spell_script_names.sql b/sql/old/3.3.5a/2011_01_16_00_world_spell_script_names.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_16_0_world_spell_script_names.sql rename to sql/old/3.3.5a/2011_01_16_00_world_spell_script_names.sql diff --git a/sql/old/3.3.5a/2011_01_19_0_characters_account_data.sql b/sql/old/3.3.5a/2011_01_19_00_characters_account_data.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_19_0_characters_account_data.sql rename to sql/old/3.3.5a/2011_01_19_00_characters_account_data.sql diff --git a/sql/old/3.3.5a/2011_01_19_0_characters_addons.sql b/sql/old/3.3.5a/2011_01_19_00_characters_addons.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_19_0_characters_addons.sql rename to sql/old/3.3.5a/2011_01_19_00_characters_addons.sql diff --git a/sql/old/3.3.5a/2011_01_19_0_characters_arena_team.sql b/sql/old/3.3.5a/2011_01_19_00_characters_arena_team.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_19_0_characters_arena_team.sql rename to sql/old/3.3.5a/2011_01_19_00_characters_arena_team.sql diff --git a/sql/old/3.3.5a/2011_01_19_0_characters_auctionhouse.sql b/sql/old/3.3.5a/2011_01_19_00_characters_auctionhouse.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_19_0_characters_auctionhouse.sql rename to sql/old/3.3.5a/2011_01_19_00_characters_auctionhouse.sql diff --git a/sql/old/3.3.5a/2011_01_19_0_characters_bugreport.sql b/sql/old/3.3.5a/2011_01_19_00_characters_bugreport.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_19_0_characters_bugreport.sql rename to sql/old/3.3.5a/2011_01_19_00_characters_bugreport.sql diff --git a/sql/old/3.3.5a/2011_01_19_0_characters_channels.sql b/sql/old/3.3.5a/2011_01_19_00_characters_channels.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_19_0_characters_channels.sql rename to sql/old/3.3.5a/2011_01_19_00_characters_channels.sql diff --git a/sql/old/3.3.5a/2011_01_19_0_characters_character_account_data.sql b/sql/old/3.3.5a/2011_01_19_00_characters_character_account_data.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_19_0_characters_character_account_data.sql rename to sql/old/3.3.5a/2011_01_19_00_characters_character_account_data.sql diff --git a/sql/old/3.3.5a/2011_01_19_0_characters_character_achievement.sql b/sql/old/3.3.5a/2011_01_19_00_characters_character_achievement.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_19_0_characters_character_achievement.sql rename to sql/old/3.3.5a/2011_01_19_00_characters_character_achievement.sql diff --git a/sql/old/3.3.5a/2011_01_19_0_characters_character_achievement_progress.sql b/sql/old/3.3.5a/2011_01_19_00_characters_character_achievement_progress.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_19_0_characters_character_achievement_progress.sql rename to sql/old/3.3.5a/2011_01_19_00_characters_character_achievement_progress.sql diff --git a/sql/old/3.3.5a/2011_01_19_0_characters_character_action.sql b/sql/old/3.3.5a/2011_01_19_00_characters_character_action.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_19_0_characters_character_action.sql rename to sql/old/3.3.5a/2011_01_19_00_characters_character_action.sql diff --git a/sql/old/3.3.5a/2011_01_19_0_characters_character_arena_stats.sql b/sql/old/3.3.5a/2011_01_19_00_characters_character_arena_stats.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_19_0_characters_character_arena_stats.sql rename to sql/old/3.3.5a/2011_01_19_00_characters_character_arena_stats.sql diff --git a/sql/old/3.3.5a/2011_01_19_0_characters_character_aura.sql b/sql/old/3.3.5a/2011_01_19_00_characters_character_aura.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_19_0_characters_character_aura.sql rename to sql/old/3.3.5a/2011_01_19_00_characters_character_aura.sql diff --git a/sql/old/3.3.5a/2011_01_19_0_characters_character_banned.sql b/sql/old/3.3.5a/2011_01_19_00_characters_character_banned.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_19_0_characters_character_banned.sql rename to sql/old/3.3.5a/2011_01_19_00_characters_character_banned.sql diff --git a/sql/old/3.3.5a/2011_01_19_0_characters_character_battleground_data.sql b/sql/old/3.3.5a/2011_01_19_00_characters_character_battleground_data.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_19_0_characters_character_battleground_data.sql rename to sql/old/3.3.5a/2011_01_19_00_characters_character_battleground_data.sql diff --git a/sql/old/3.3.5a/2011_01_19_0_characters_character_battleground_random.sql b/sql/old/3.3.5a/2011_01_19_00_characters_character_battleground_random.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_19_0_characters_character_battleground_random.sql rename to sql/old/3.3.5a/2011_01_19_00_characters_character_battleground_random.sql diff --git a/sql/old/3.3.5a/2011_01_19_0_characters_character_declinedname.sql b/sql/old/3.3.5a/2011_01_19_00_characters_character_declinedname.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_19_0_characters_character_declinedname.sql rename to sql/old/3.3.5a/2011_01_19_00_characters_character_declinedname.sql diff --git a/sql/old/3.3.5a/2011_01_19_0_characters_character_equipmentsets.sql b/sql/old/3.3.5a/2011_01_19_00_characters_character_equipmentsets.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_19_0_characters_character_equipmentsets.sql rename to sql/old/3.3.5a/2011_01_19_00_characters_character_equipmentsets.sql diff --git a/sql/old/3.3.5a/2011_01_19_0_characters_character_gifts.sql b/sql/old/3.3.5a/2011_01_19_00_characters_character_gifts.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_19_0_characters_character_gifts.sql rename to sql/old/3.3.5a/2011_01_19_00_characters_character_gifts.sql diff --git a/sql/old/3.3.5a/2011_01_19_0_characters_character_glyphs.sql b/sql/old/3.3.5a/2011_01_19_00_characters_character_glyphs.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_19_0_characters_character_glyphs.sql rename to sql/old/3.3.5a/2011_01_19_00_characters_character_glyphs.sql diff --git a/sql/old/3.3.5a/2011_01_19_0_characters_character_homebind.sql b/sql/old/3.3.5a/2011_01_19_00_characters_character_homebind.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_19_0_characters_character_homebind.sql rename to sql/old/3.3.5a/2011_01_19_00_characters_character_homebind.sql diff --git a/sql/old/3.3.5a/2011_01_19_0_characters_character_instance.sql b/sql/old/3.3.5a/2011_01_19_00_characters_character_instance.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_19_0_characters_character_instance.sql rename to sql/old/3.3.5a/2011_01_19_00_characters_character_instance.sql diff --git a/sql/old/3.3.5a/2011_01_19_0_characters_character_inventory.sql b/sql/old/3.3.5a/2011_01_19_00_characters_character_inventory.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_19_0_characters_character_inventory.sql rename to sql/old/3.3.5a/2011_01_19_00_characters_character_inventory.sql diff --git a/sql/old/3.3.5a/2011_01_19_0_characters_character_pet.sql b/sql/old/3.3.5a/2011_01_19_00_characters_character_pet.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_19_0_characters_character_pet.sql rename to sql/old/3.3.5a/2011_01_19_00_characters_character_pet.sql diff --git a/sql/old/3.3.5a/2011_01_19_0_characters_character_pet_declinedname.sql b/sql/old/3.3.5a/2011_01_19_00_characters_character_pet_declinedname.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_19_0_characters_character_pet_declinedname.sql rename to sql/old/3.3.5a/2011_01_19_00_characters_character_pet_declinedname.sql diff --git a/sql/old/3.3.5a/2011_01_19_0_characters_character_queststatus.sql b/sql/old/3.3.5a/2011_01_19_00_characters_character_queststatus.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_19_0_characters_character_queststatus.sql rename to sql/old/3.3.5a/2011_01_19_00_characters_character_queststatus.sql diff --git a/sql/old/3.3.5a/2011_01_19_0_characters_character_queststatus_daily.sql b/sql/old/3.3.5a/2011_01_19_00_characters_character_queststatus_daily.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_19_0_characters_character_queststatus_daily.sql rename to sql/old/3.3.5a/2011_01_19_00_characters_character_queststatus_daily.sql diff --git a/sql/old/3.3.5a/2011_01_19_0_characters_character_queststatus_weekly.sql b/sql/old/3.3.5a/2011_01_19_00_characters_character_queststatus_weekly.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_19_0_characters_character_queststatus_weekly.sql rename to sql/old/3.3.5a/2011_01_19_00_characters_character_queststatus_weekly.sql diff --git a/sql/old/3.3.5a/2011_01_19_0_characters_character_reputation.sql b/sql/old/3.3.5a/2011_01_19_00_characters_character_reputation.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_19_0_characters_character_reputation.sql rename to sql/old/3.3.5a/2011_01_19_00_characters_character_reputation.sql diff --git a/sql/old/3.3.5a/2011_01_19_0_characters_character_skills.sql b/sql/old/3.3.5a/2011_01_19_00_characters_character_skills.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_19_0_characters_character_skills.sql rename to sql/old/3.3.5a/2011_01_19_00_characters_character_skills.sql diff --git a/sql/old/3.3.5a/2011_01_19_0_characters_character_social.sql b/sql/old/3.3.5a/2011_01_19_00_characters_character_social.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_19_0_characters_character_social.sql rename to sql/old/3.3.5a/2011_01_19_00_characters_character_social.sql diff --git a/sql/old/3.3.5a/2011_01_19_0_characters_character_spell.sql b/sql/old/3.3.5a/2011_01_19_00_characters_character_spell.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_19_0_characters_character_spell.sql rename to sql/old/3.3.5a/2011_01_19_00_characters_character_spell.sql diff --git a/sql/old/3.3.5a/2011_01_19_0_characters_character_spell_cooldown.sql b/sql/old/3.3.5a/2011_01_19_00_characters_character_spell_cooldown.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_19_0_characters_character_spell_cooldown.sql rename to sql/old/3.3.5a/2011_01_19_00_characters_character_spell_cooldown.sql diff --git a/sql/old/3.3.5a/2011_01_19_0_characters_character_stats.sql b/sql/old/3.3.5a/2011_01_19_00_characters_character_stats.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_19_0_characters_character_stats.sql rename to sql/old/3.3.5a/2011_01_19_00_characters_character_stats.sql diff --git a/sql/old/3.3.5a/2011_01_19_0_characters_character_talent.sql b/sql/old/3.3.5a/2011_01_19_00_characters_character_talent.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_19_0_characters_character_talent.sql rename to sql/old/3.3.5a/2011_01_19_00_characters_character_talent.sql diff --git a/sql/old/3.3.5a/2011_01_19_0_characters_character_tutorial.sql b/sql/old/3.3.5a/2011_01_19_00_characters_character_tutorial.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_19_0_characters_character_tutorial.sql rename to sql/old/3.3.5a/2011_01_19_00_characters_character_tutorial.sql diff --git a/sql/old/3.3.5a/2011_01_19_0_characters_characters.sql b/sql/old/3.3.5a/2011_01_19_00_characters_characters.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_19_0_characters_characters.sql rename to sql/old/3.3.5a/2011_01_19_00_characters_characters.sql diff --git a/sql/old/3.3.5a/2011_01_19_0_characters_corpse.sql b/sql/old/3.3.5a/2011_01_19_00_characters_corpse.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_19_0_characters_corpse.sql rename to sql/old/3.3.5a/2011_01_19_00_characters_corpse.sql diff --git a/sql/old/3.3.5a/2011_01_19_0_characters_creature_respawn.sql b/sql/old/3.3.5a/2011_01_19_00_characters_creature_respawn.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_19_0_characters_creature_respawn.sql rename to sql/old/3.3.5a/2011_01_19_00_characters_creature_respawn.sql diff --git a/sql/old/3.3.5a/2011_01_19_0_characters_game_event_condition_save.sql b/sql/old/3.3.5a/2011_01_19_00_characters_game_event_condition_save.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_19_0_characters_game_event_condition_save.sql rename to sql/old/3.3.5a/2011_01_19_00_characters_game_event_condition_save.sql diff --git a/sql/old/3.3.5a/2011_01_20_0_characters_game_event_save.sql b/sql/old/3.3.5a/2011_01_20_00_characters_game_event_save.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_20_0_characters_game_event_save.sql rename to sql/old/3.3.5a/2011_01_20_00_characters_game_event_save.sql diff --git a/sql/old/3.3.5a/2011_01_20_0_characters_gameobject_respawn.sql b/sql/old/3.3.5a/2011_01_20_00_characters_gameobject_respawn.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_20_0_characters_gameobject_respawn.sql rename to sql/old/3.3.5a/2011_01_20_00_characters_gameobject_respawn.sql diff --git a/sql/old/3.3.5a/2011_01_20_0_characters_gm_subsurveys.sql b/sql/old/3.3.5a/2011_01_20_00_characters_gm_subsurveys.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_20_0_characters_gm_subsurveys.sql rename to sql/old/3.3.5a/2011_01_20_00_characters_gm_subsurveys.sql diff --git a/sql/old/3.3.5a/2011_01_20_0_characters_gm_surveys.sql b/sql/old/3.3.5a/2011_01_20_00_characters_gm_surveys.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_20_0_characters_gm_surveys.sql rename to sql/old/3.3.5a/2011_01_20_00_characters_gm_surveys.sql diff --git a/sql/old/3.3.5a/2011_01_20_0_characters_gm_tickets.sql b/sql/old/3.3.5a/2011_01_20_00_characters_gm_tickets.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_20_0_characters_gm_tickets.sql rename to sql/old/3.3.5a/2011_01_20_00_characters_gm_tickets.sql diff --git a/sql/old/3.3.5a/2011_01_20_0_characters_group_instance.sql b/sql/old/3.3.5a/2011_01_20_00_characters_group_instance.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_20_0_characters_group_instance.sql rename to sql/old/3.3.5a/2011_01_20_00_characters_group_instance.sql diff --git a/sql/old/3.3.5a/2011_01_20_0_characters_group_member.sql b/sql/old/3.3.5a/2011_01_20_00_characters_group_member.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_20_0_characters_group_member.sql rename to sql/old/3.3.5a/2011_01_20_00_characters_group_member.sql diff --git a/sql/old/3.3.5a/2011_01_20_0_characters_groups.sql b/sql/old/3.3.5a/2011_01_20_00_characters_groups.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_20_0_characters_groups.sql rename to sql/old/3.3.5a/2011_01_20_00_characters_groups.sql diff --git a/sql/old/3.3.5a/2011_01_20_0_characters_guild.sql b/sql/old/3.3.5a/2011_01_20_00_characters_guild.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_20_0_characters_guild.sql rename to sql/old/3.3.5a/2011_01_20_00_characters_guild.sql diff --git a/sql/old/3.3.5a/2011_01_20_0_characters_guild_bank_eventlog.sql b/sql/old/3.3.5a/2011_01_20_00_characters_guild_bank_eventlog.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_20_0_characters_guild_bank_eventlog.sql rename to sql/old/3.3.5a/2011_01_20_00_characters_guild_bank_eventlog.sql diff --git a/sql/old/3.3.5a/2011_01_20_0_characters_guild_bank_item.sql b/sql/old/3.3.5a/2011_01_20_00_characters_guild_bank_item.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_20_0_characters_guild_bank_item.sql rename to sql/old/3.3.5a/2011_01_20_00_characters_guild_bank_item.sql diff --git a/sql/old/3.3.5a/2011_01_20_0_characters_guild_bank_right.sql b/sql/old/3.3.5a/2011_01_20_00_characters_guild_bank_right.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_20_0_characters_guild_bank_right.sql rename to sql/old/3.3.5a/2011_01_20_00_characters_guild_bank_right.sql diff --git a/sql/old/3.3.5a/2011_01_20_0_characters_guild_bank_tab.sql b/sql/old/3.3.5a/2011_01_20_00_characters_guild_bank_tab.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_20_0_characters_guild_bank_tab.sql rename to sql/old/3.3.5a/2011_01_20_00_characters_guild_bank_tab.sql diff --git a/sql/old/3.3.5a/2011_01_20_0_characters_guild_eventlog.sql b/sql/old/3.3.5a/2011_01_20_00_characters_guild_eventlog.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_20_0_characters_guild_eventlog.sql rename to sql/old/3.3.5a/2011_01_20_00_characters_guild_eventlog.sql diff --git a/sql/old/3.3.5a/2011_01_20_0_characters_guild_member.sql b/sql/old/3.3.5a/2011_01_20_00_characters_guild_member.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_20_0_characters_guild_member.sql rename to sql/old/3.3.5a/2011_01_20_00_characters_guild_member.sql diff --git a/sql/old/3.3.5a/2011_01_20_0_characters_guild_rank.sql b/sql/old/3.3.5a/2011_01_20_00_characters_guild_rank.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_20_0_characters_guild_rank.sql rename to sql/old/3.3.5a/2011_01_20_00_characters_guild_rank.sql diff --git a/sql/old/3.3.5a/2011_01_20_0_characters_instance.sql b/sql/old/3.3.5a/2011_01_20_00_characters_instance.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_20_0_characters_instance.sql rename to sql/old/3.3.5a/2011_01_20_00_characters_instance.sql diff --git a/sql/old/3.3.5a/2011_01_20_0_characters_instance_reset.sql b/sql/old/3.3.5a/2011_01_20_00_characters_instance_reset.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_20_0_characters_instance_reset.sql rename to sql/old/3.3.5a/2011_01_20_00_characters_instance_reset.sql diff --git a/sql/old/3.3.5a/2011_01_20_0_characters_item_instance.sql b/sql/old/3.3.5a/2011_01_20_00_characters_item_instance.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_20_0_characters_item_instance.sql rename to sql/old/3.3.5a/2011_01_20_00_characters_item_instance.sql diff --git a/sql/old/3.3.5a/2011_01_20_0_characters_item_refund_instance.sql b/sql/old/3.3.5a/2011_01_20_00_characters_item_refund_instance.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_20_0_characters_item_refund_instance.sql rename to sql/old/3.3.5a/2011_01_20_00_characters_item_refund_instance.sql diff --git a/sql/old/3.3.5a/2011_01_20_0_characters_item_soulbound_trace_data.sql b/sql/old/3.3.5a/2011_01_20_00_characters_item_soulbound_trace_data.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_20_0_characters_item_soulbound_trace_data.sql rename to sql/old/3.3.5a/2011_01_20_00_characters_item_soulbound_trace_data.sql diff --git a/sql/old/3.3.5a/2011_01_20_0_characters_lag_reports.sql b/sql/old/3.3.5a/2011_01_20_00_characters_lag_reports.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_20_0_characters_lag_reports.sql rename to sql/old/3.3.5a/2011_01_20_00_characters_lag_reports.sql diff --git a/sql/old/3.3.5a/2011_01_20_0_characters_mail.sql b/sql/old/3.3.5a/2011_01_20_00_characters_mail.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_20_0_characters_mail.sql rename to sql/old/3.3.5a/2011_01_20_00_characters_mail.sql diff --git a/sql/old/3.3.5a/2011_01_20_0_characters_mail_items.sql b/sql/old/3.3.5a/2011_01_20_00_characters_mail_items.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_20_0_characters_mail_items.sql rename to sql/old/3.3.5a/2011_01_20_00_characters_mail_items.sql diff --git a/sql/old/3.3.5a/2011_01_20_0_characters_pet_aura.sql b/sql/old/3.3.5a/2011_01_20_00_characters_pet_aura.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_20_0_characters_pet_aura.sql rename to sql/old/3.3.5a/2011_01_20_00_characters_pet_aura.sql diff --git a/sql/old/3.3.5a/2011_01_20_0_characters_pet_spell.sql b/sql/old/3.3.5a/2011_01_20_00_characters_pet_spell.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_20_0_characters_pet_spell.sql rename to sql/old/3.3.5a/2011_01_20_00_characters_pet_spell.sql diff --git a/sql/old/3.3.5a/2011_01_20_0_characters_pet_spell_cooldown.sql b/sql/old/3.3.5a/2011_01_20_00_characters_pet_spell_cooldown.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_20_0_characters_pet_spell_cooldown.sql rename to sql/old/3.3.5a/2011_01_20_00_characters_pet_spell_cooldown.sql diff --git a/sql/old/3.3.5a/2011_01_20_0_characters_petition.sql b/sql/old/3.3.5a/2011_01_20_00_characters_petition.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_20_0_characters_petition.sql rename to sql/old/3.3.5a/2011_01_20_00_characters_petition.sql diff --git a/sql/old/3.3.5a/2011_01_20_0_characters_petition_sign.sql b/sql/old/3.3.5a/2011_01_20_00_characters_petition_sign.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_20_0_characters_petition_sign.sql rename to sql/old/3.3.5a/2011_01_20_00_characters_petition_sign.sql diff --git a/sql/old/3.3.5a/2011_01_20_0_characters_worldstates.sql b/sql/old/3.3.5a/2011_01_20_00_characters_worldstates.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_20_0_characters_worldstates.sql rename to sql/old/3.3.5a/2011_01_20_00_characters_worldstates.sql diff --git a/sql/old/3.3.5a/2011_01_20_0_world_scriptname.sql b/sql/old/3.3.5a/2011_01_20_00_world_scriptname.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_20_0_world_scriptname.sql rename to sql/old/3.3.5a/2011_01_20_00_world_scriptname.sql diff --git a/sql/old/3.3.5a/2011_01_22_0_world_spell_script_names.sql b/sql/old/3.3.5a/2011_01_22_00_world_spell_script_names.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_22_0_world_spell_script_names.sql rename to sql/old/3.3.5a/2011_01_22_00_world_spell_script_names.sql diff --git a/sql/old/3.3.5a/2011_01_22_1_characters_character_inventory.sql b/sql/old/3.3.5a/2011_01_22_01_characters_character_inventory.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_22_1_characters_character_inventory.sql rename to sql/old/3.3.5a/2011_01_22_01_characters_character_inventory.sql diff --git a/sql/old/3.3.5a/2011_01_24_0_characters_account_instance_times.sql b/sql/old/3.3.5a/2011_01_24_00_characters_account_instance_times.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_24_0_characters_account_instance_times.sql rename to sql/old/3.3.5a/2011_01_24_00_characters_account_instance_times.sql diff --git a/sql/old/3.3.5a/2011_01_24_0_world_scriptname.sql b/sql/old/3.3.5a/2011_01_24_00_world_scriptname.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_24_0_world_scriptname.sql rename to sql/old/3.3.5a/2011_01_24_00_world_scriptname.sql diff --git a/sql/old/3.3.5a/2011_01_26_0_world_scriptname.sql b/sql/old/3.3.5a/2011_01_26_00_world_scriptname.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_26_0_world_scriptname.sql rename to sql/old/3.3.5a/2011_01_26_00_world_scriptname.sql diff --git a/sql/old/3.3.5a/2011_01_26_0_world_spell_script_names.sql b/sql/old/3.3.5a/2011_01_26_00_world_spell_script_names.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_26_0_world_spell_script_names.sql rename to sql/old/3.3.5a/2011_01_26_00_world_spell_script_names.sql diff --git a/sql/old/3.3.5a/2011_01_28_0_world_spell_linked_spell.sql b/sql/old/3.3.5a/2011_01_28_00_world_spell_linked_spell.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_28_0_world_spell_linked_spell.sql rename to sql/old/3.3.5a/2011_01_28_00_world_spell_linked_spell.sql diff --git a/sql/old/3.3.5a/2011_01_28_0_world_spell_script_names.sql b/sql/old/3.3.5a/2011_01_28_00_world_spell_script_names.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_28_0_world_spell_script_names.sql rename to sql/old/3.3.5a/2011_01_28_00_world_spell_script_names.sql diff --git a/sql/old/3.3.5a/2011_01_28_1_world_spell_script_names.sql b/sql/old/3.3.5a/2011_01_28_01_world_spell_script_names.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_28_1_world_spell_script_names.sql rename to sql/old/3.3.5a/2011_01_28_01_world_spell_script_names.sql diff --git a/sql/old/3.3.5a/2011_01_29_0_world_spell_linked_spell.sql b/sql/old/3.3.5a/2011_01_29_00_world_spell_linked_spell.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_29_0_world_spell_linked_spell.sql rename to sql/old/3.3.5a/2011_01_29_00_world_spell_linked_spell.sql diff --git a/sql/old/3.3.5a/2011_01_30_0_world_spell_proc_event.sql b/sql/old/3.3.5a/2011_01_30_00_world_spell_proc_event.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_30_0_world_spell_proc_event.sql rename to sql/old/3.3.5a/2011_01_30_00_world_spell_proc_event.sql diff --git a/sql/old/3.3.5a/2011_01_30_0_world_spell_script_names.sql b/sql/old/3.3.5a/2011_01_30_00_world_spell_script_names.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_30_0_world_spell_script_names.sql rename to sql/old/3.3.5a/2011_01_30_00_world_spell_script_names.sql diff --git a/sql/old/3.3.5a/2011_01_30_1_world_scriptnames.sql b/sql/old/3.3.5a/2011_01_30_01_world_scriptnames.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_30_1_world_scriptnames.sql rename to sql/old/3.3.5a/2011_01_30_01_world_scriptnames.sql diff --git a/sql/old/3.3.5a/2011_01_31_0_world_spell_bonus_data.sql b/sql/old/3.3.5a/2011_01_31_00_world_spell_bonus_data.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_31_0_world_spell_bonus_data.sql rename to sql/old/3.3.5a/2011_01_31_00_world_spell_bonus_data.sql diff --git a/sql/old/3.3.5a/2011_01_31_0_world_spell_proc_event.sql b/sql/old/3.3.5a/2011_01_31_00_world_spell_proc_event.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_31_0_world_spell_proc_event.sql rename to sql/old/3.3.5a/2011_01_31_00_world_spell_proc_event.sql diff --git a/sql/old/3.3.5a/2011_01_31_0_world_spell_script_names.sql b/sql/old/3.3.5a/2011_01_31_00_world_spell_script_names.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_31_0_world_spell_script_names.sql rename to sql/old/3.3.5a/2011_01_31_00_world_spell_script_names.sql diff --git a/sql/old/3.3.5a/2011_01_31_1_world_spell_proc_event.sql b/sql/old/3.3.5a/2011_01_31_01_world_spell_proc_event.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_31_1_world_spell_proc_event.sql rename to sql/old/3.3.5a/2011_01_31_01_world_spell_proc_event.sql diff --git a/sql/old/3.3.5a/2011_01_31_1_world_spell_script_names.sql b/sql/old/3.3.5a/2011_01_31_01_world_spell_script_names.sql similarity index 100% rename from sql/old/3.3.5a/2011_01_31_1_world_spell_script_names.sql rename to sql/old/3.3.5a/2011_01_31_01_world_spell_script_names.sql diff --git a/sql/updates/auth_char/2011_02_03_0_characters_instance.sql b/sql/old/3.3.5a/2011_02_03_00_characters_instance.sql similarity index 100% rename from sql/updates/auth_char/2011_02_03_0_characters_instance.sql rename to sql/old/3.3.5a/2011_02_03_00_characters_instance.sql diff --git a/sql/old/3.3.5a/2011_02_03_0_world_instance_encounters.sql b/sql/old/3.3.5a/2011_02_03_00_world_instance_encounters.sql similarity index 100% rename from sql/old/3.3.5a/2011_02_03_0_world_instance_encounters.sql rename to sql/old/3.3.5a/2011_02_03_00_world_instance_encounters.sql diff --git a/sql/old/3.3.5a/2011_02_03_1_world_command.sql b/sql/old/3.3.5a/2011_02_03_01_world_command.sql similarity index 100% rename from sql/old/3.3.5a/2011_02_03_1_world_command.sql rename to sql/old/3.3.5a/2011_02_03_01_world_command.sql diff --git a/sql/old/3.3.5a/2011_02_03_2_world_lfg_dungeon_encounters.sql b/sql/old/3.3.5a/2011_02_03_02_world_lfg_dungeon_encounters.sql similarity index 100% rename from sql/old/3.3.5a/2011_02_03_2_world_lfg_dungeon_encounters.sql rename to sql/old/3.3.5a/2011_02_03_02_world_lfg_dungeon_encounters.sql diff --git a/sql/old/3.3.5a/2011_02_03_3_world_spell_dbc.sql b/sql/old/3.3.5a/2011_02_03_03_world_spell_dbc.sql similarity index 100% rename from sql/old/3.3.5a/2011_02_03_3_world_spell_dbc.sql rename to sql/old/3.3.5a/2011_02_03_03_world_spell_dbc.sql diff --git a/sql/old/3.3.5a/2011_02_04_0_world_battleground_isle_of_conquest.sql b/sql/old/3.3.5a/2011_02_04_00_world_battleground_isle_of_conquest.sql similarity index 100% rename from sql/old/3.3.5a/2011_02_04_0_world_battleground_isle_of_conquest.sql rename to sql/old/3.3.5a/2011_02_04_00_world_battleground_isle_of_conquest.sql diff --git a/sql/old/3.3.5a/2011_02_04_0_world_conditions.sql b/sql/old/3.3.5a/2011_02_04_00_world_conditions.sql similarity index 100% rename from sql/old/3.3.5a/2011_02_04_0_world_conditions.sql rename to sql/old/3.3.5a/2011_02_04_00_world_conditions.sql diff --git a/sql/old/3.3.5a/2011_02_04_0_world_creature_631.sql b/sql/old/3.3.5a/2011_02_04_00_world_creature_631.sql similarity index 100% rename from sql/old/3.3.5a/2011_02_04_0_world_creature_631.sql rename to sql/old/3.3.5a/2011_02_04_00_world_creature_631.sql diff --git a/sql/old/3.3.5a/2011_02_04_0_world_creature_questrelation.sql b/sql/old/3.3.5a/2011_02_04_00_world_creature_questrelation.sql similarity index 100% rename from sql/old/3.3.5a/2011_02_04_0_world_creature_questrelation.sql rename to sql/old/3.3.5a/2011_02_04_00_world_creature_questrelation.sql diff --git a/sql/old/3.3.5a/2011_02_04_0_world_creature_template.sql b/sql/old/3.3.5a/2011_02_04_00_world_creature_template.sql similarity index 100% rename from sql/old/3.3.5a/2011_02_04_0_world_creature_template.sql rename to sql/old/3.3.5a/2011_02_04_00_world_creature_template.sql diff --git a/sql/old/3.3.5a/2011_02_04_0_world_game_event.sql b/sql/old/3.3.5a/2011_02_04_00_world_game_event.sql similarity index 100% rename from sql/old/3.3.5a/2011_02_04_0_world_game_event.sql rename to sql/old/3.3.5a/2011_02_04_00_world_game_event.sql diff --git a/sql/old/3.3.5a/2011_02_04_0_world_gameobject_questrelation.sql b/sql/old/3.3.5a/2011_02_04_00_world_gameobject_questrelation.sql similarity index 100% rename from sql/old/3.3.5a/2011_02_04_0_world_gameobject_questrelation.sql rename to sql/old/3.3.5a/2011_02_04_00_world_gameobject_questrelation.sql diff --git a/sql/old/3.3.5a/2011_02_04_0_world_instance_pit_of_saron.sql b/sql/old/3.3.5a/2011_02_04_00_world_instance_pit_of_saron.sql similarity index 100% rename from sql/old/3.3.5a/2011_02_04_0_world_instance_pit_of_saron.sql rename to sql/old/3.3.5a/2011_02_04_00_world_instance_pit_of_saron.sql diff --git a/sql/old/3.3.5a/2011_02_04_0_world_item_loot_template.sql b/sql/old/3.3.5a/2011_02_04_00_world_item_loot_template.sql similarity index 100% rename from sql/old/3.3.5a/2011_02_04_0_world_item_loot_template.sql rename to sql/old/3.3.5a/2011_02_04_00_world_item_loot_template.sql diff --git a/sql/old/3.3.5a/2011_02_04_0_world_mail_loot_template.sql b/sql/old/3.3.5a/2011_02_04_00_world_mail_loot_template.sql similarity index 100% rename from sql/old/3.3.5a/2011_02_04_0_world_mail_loot_template.sql rename to sql/old/3.3.5a/2011_02_04_00_world_mail_loot_template.sql diff --git a/sql/old/3.3.5a/2011_02_04_0_world_quest_template.sql b/sql/old/3.3.5a/2011_02_04_00_world_quest_template.sql similarity index 100% rename from sql/old/3.3.5a/2011_02_04_0_world_quest_template.sql rename to sql/old/3.3.5a/2011_02_04_00_world_quest_template.sql diff --git a/sql/old/3.3.5a/2011_02_04_0_world_sai.sql b/sql/old/3.3.5a/2011_02_04_00_world_sai.sql similarity index 100% rename from sql/old/3.3.5a/2011_02_04_0_world_sai.sql rename to sql/old/3.3.5a/2011_02_04_00_world_sai.sql diff --git a/sql/old/3.3.5a/2011_02_04_0_world_spell_script_names.sql b/sql/old/3.3.5a/2011_02_04_00_world_spell_script_names.sql similarity index 100% rename from sql/old/3.3.5a/2011_02_04_0_world_spell_script_names.sql rename to sql/old/3.3.5a/2011_02_04_00_world_spell_script_names.sql diff --git a/sql/old/3.3.5a/2011_02_04_0_world_spell_target_position.sql b/sql/old/3.3.5a/2011_02_04_00_world_spell_target_position.sql similarity index 100% rename from sql/old/3.3.5a/2011_02_04_0_world_spell_target_position.sql rename to sql/old/3.3.5a/2011_02_04_00_world_spell_target_position.sql diff --git a/sql/old/3.3.5a/2011_02_04_1_world_game_event.sql b/sql/old/3.3.5a/2011_02_04_01_world_game_event.sql similarity index 100% rename from sql/old/3.3.5a/2011_02_04_1_world_game_event.sql rename to sql/old/3.3.5a/2011_02_04_01_world_game_event.sql diff --git a/sql/old/3.3.5a/2011_02_04_1_world_quest_template.sql b/sql/old/3.3.5a/2011_02_04_01_world_quest_template.sql similarity index 100% rename from sql/old/3.3.5a/2011_02_04_1_world_quest_template.sql rename to sql/old/3.3.5a/2011_02_04_01_world_quest_template.sql diff --git a/sql/old/3.3.5a/2011_02_04_1_world_sai.sql b/sql/old/3.3.5a/2011_02_04_01_world_sai.sql similarity index 100% rename from sql/old/3.3.5a/2011_02_04_1_world_sai.sql rename to sql/old/3.3.5a/2011_02_04_01_world_sai.sql diff --git a/sql/old/3.3.5a/2011_02_04_2_world_quest_template.sql b/sql/old/3.3.5a/2011_02_04_02_world_quest_template.sql similarity index 100% rename from sql/old/3.3.5a/2011_02_04_2_world_quest_template.sql rename to sql/old/3.3.5a/2011_02_04_02_world_quest_template.sql diff --git a/sql/old/3.3.5a/2011_02_04_2_world_sai.sql b/sql/old/3.3.5a/2011_02_04_02_world_sai.sql similarity index 100% rename from sql/old/3.3.5a/2011_02_04_2_world_sai.sql rename to sql/old/3.3.5a/2011_02_04_02_world_sai.sql diff --git a/sql/old/3.3.5a/2011_02_04_3_world_quest_template.sql b/sql/old/3.3.5a/2011_02_04_03_world_quest_template.sql similarity index 100% rename from sql/old/3.3.5a/2011_02_04_3_world_quest_template.sql rename to sql/old/3.3.5a/2011_02_04_03_world_quest_template.sql diff --git a/sql/old/3.3.5a/2011_02_04_3_world_sai.sql b/sql/old/3.3.5a/2011_02_04_03_world_sai.sql similarity index 100% rename from sql/old/3.3.5a/2011_02_04_3_world_sai.sql rename to sql/old/3.3.5a/2011_02_04_03_world_sai.sql diff --git a/sql/old/3.3.5a/2011_02_04_4_world_quest_template.sql b/sql/old/3.3.5a/2011_02_04_04_world_quest_template.sql similarity index 100% rename from sql/old/3.3.5a/2011_02_04_4_world_quest_template.sql rename to sql/old/3.3.5a/2011_02_04_04_world_quest_template.sql diff --git a/sql/old/3.3.5a/2011_02_04_4_world_sai.sql b/sql/old/3.3.5a/2011_02_04_04_world_sai.sql similarity index 100% rename from sql/old/3.3.5a/2011_02_04_4_world_sai.sql rename to sql/old/3.3.5a/2011_02_04_04_world_sai.sql diff --git a/sql/old/3.3.5a/2011_02_05_0_world_sai.sql b/sql/old/3.3.5a/2011_02_05_00_world_sai.sql similarity index 100% rename from sql/old/3.3.5a/2011_02_05_0_world_sai.sql rename to sql/old/3.3.5a/2011_02_05_00_world_sai.sql diff --git a/sql/old/3.3.5a/2011_02_05_1_world_quest_template.sql b/sql/old/3.3.5a/2011_02_05_01_world_quest_template.sql similarity index 100% rename from sql/old/3.3.5a/2011_02_05_1_world_quest_template.sql rename to sql/old/3.3.5a/2011_02_05_01_world_quest_template.sql diff --git a/sql/old/3.3.5a/2011_02_05_2_world_creature_template.sql b/sql/old/3.3.5a/2011_02_05_02_world_creature_template.sql similarity index 100% rename from sql/old/3.3.5a/2011_02_05_2_world_creature_template.sql rename to sql/old/3.3.5a/2011_02_05_02_world_creature_template.sql diff --git a/sql/old/3.3.5a/2011_02_05_3_world_creature_template.sql b/sql/old/3.3.5a/2011_02_05_03_world_creature_template.sql similarity index 100% rename from sql/old/3.3.5a/2011_02_05_3_world_creature_template.sql rename to sql/old/3.3.5a/2011_02_05_03_world_creature_template.sql diff --git a/sql/old/3.3.5a/2011_02_05_4_world_game_event.sql b/sql/old/3.3.5a/2011_02_05_04_world_game_event.sql similarity index 100% rename from sql/old/3.3.5a/2011_02_05_4_world_game_event.sql rename to sql/old/3.3.5a/2011_02_05_04_world_game_event.sql diff --git a/sql/old/3.3.5a/2011_02_05_5_world_sai.sql b/sql/old/3.3.5a/2011_02_05_05_world_sai.sql similarity index 100% rename from sql/old/3.3.5a/2011_02_05_5_world_sai.sql rename to sql/old/3.3.5a/2011_02_05_05_world_sai.sql diff --git a/sql/old/3.3.5a/2011_02_05_6_world_waypoint_data.sql b/sql/old/3.3.5a/2011_02_05_06_world_waypoint_data.sql similarity index 100% rename from sql/old/3.3.5a/2011_02_05_6_world_waypoint_data.sql rename to sql/old/3.3.5a/2011_02_05_06_world_waypoint_data.sql diff --git a/sql/old/3.3.5a/2011_02_05_7_world_sai.sql b/sql/old/3.3.5a/2011_02_05_07_world_sai.sql similarity index 100% rename from sql/old/3.3.5a/2011_02_05_7_world_sai.sql rename to sql/old/3.3.5a/2011_02_05_07_world_sai.sql diff --git a/sql/old/3.3.5a/2011_02_05_8_world_sai.sql b/sql/old/3.3.5a/2011_02_05_08_world_sai.sql similarity index 100% rename from sql/old/3.3.5a/2011_02_05_8_world_sai.sql rename to sql/old/3.3.5a/2011_02_05_08_world_sai.sql diff --git a/sql/old/3.3.5a/2011_02_06_0_world_instance_sindragosa_lair.sql b/sql/old/3.3.5a/2011_02_06_00_world_instance_sindragosa_lair.sql similarity index 100% rename from sql/old/3.3.5a/2011_02_06_0_world_instance_sindragosa_lair.sql rename to sql/old/3.3.5a/2011_02_06_00_world_instance_sindragosa_lair.sql diff --git a/sql/old/3.3.5a/2011_02_06_1_world_creature_loot_template.sql b/sql/old/3.3.5a/2011_02_06_01_world_creature_loot_template.sql similarity index 100% rename from sql/old/3.3.5a/2011_02_06_1_world_creature_loot_template.sql rename to sql/old/3.3.5a/2011_02_06_01_world_creature_loot_template.sql diff --git a/sql/old/3.3.5a/2011_02_06_2_world_item_loot_template.sql b/sql/old/3.3.5a/2011_02_06_02_world_item_loot_template.sql similarity index 100% rename from sql/old/3.3.5a/2011_02_06_2_world_item_loot_template.sql rename to sql/old/3.3.5a/2011_02_06_02_world_item_loot_template.sql diff --git a/sql/old/3.3.5a/2011_02_07_0_world_achievement_criteria_data.sql b/sql/old/3.3.5a/2011_02_07_00_world_achievement_criteria_data.sql similarity index 100% rename from sql/old/3.3.5a/2011_02_07_0_world_achievement_criteria_data.sql rename to sql/old/3.3.5a/2011_02_07_00_world_achievement_criteria_data.sql diff --git a/sql/old/3.3.5a/2011_02_07_0_world_areatrigger_scripts.sql b/sql/old/3.3.5a/2011_02_07_00_world_areatrigger_scripts.sql similarity index 100% rename from sql/old/3.3.5a/2011_02_07_0_world_areatrigger_scripts.sql rename to sql/old/3.3.5a/2011_02_07_00_world_areatrigger_scripts.sql diff --git a/sql/old/3.3.5a/2011_02_07_0_world_creature_template.sql b/sql/old/3.3.5a/2011_02_07_00_world_creature_template.sql similarity index 100% rename from sql/old/3.3.5a/2011_02_07_0_world_creature_template.sql rename to sql/old/3.3.5a/2011_02_07_00_world_creature_template.sql diff --git a/sql/old/3.3.5a/2011_02_07_0_world_creature_text.sql b/sql/old/3.3.5a/2011_02_07_00_world_creature_text.sql similarity index 100% rename from sql/old/3.3.5a/2011_02_07_0_world_creature_text.sql rename to sql/old/3.3.5a/2011_02_07_00_world_creature_text.sql diff --git a/sql/old/3.3.5a/2011_02_07_0_world_scriptname.sql b/sql/old/3.3.5a/2011_02_07_00_world_scriptname.sql similarity index 100% rename from sql/old/3.3.5a/2011_02_07_0_world_scriptname.sql rename to sql/old/3.3.5a/2011_02_07_00_world_scriptname.sql diff --git a/sql/old/3.3.5a/2011_02_07_0_world_spell_linked_spell.sql b/sql/old/3.3.5a/2011_02_07_00_world_spell_linked_spell.sql similarity index 100% rename from sql/old/3.3.5a/2011_02_07_0_world_spell_linked_spell.sql rename to sql/old/3.3.5a/2011_02_07_00_world_spell_linked_spell.sql diff --git a/sql/old/3.3.5a/2011_02_07_0_world_spell_script_names.sql b/sql/old/3.3.5a/2011_02_07_00_world_spell_script_names.sql similarity index 100% rename from sql/old/3.3.5a/2011_02_07_0_world_spell_script_names.sql rename to sql/old/3.3.5a/2011_02_07_00_world_spell_script_names.sql diff --git a/sql/old/3.3.5a/2011_02_07_1_world_creature_questrelation.sql b/sql/old/3.3.5a/2011_02_07_01_world_creature_questrelation.sql similarity index 100% rename from sql/old/3.3.5a/2011_02_07_1_world_creature_questrelation.sql rename to sql/old/3.3.5a/2011_02_07_01_world_creature_questrelation.sql diff --git a/sql/old/3.3.5a/2011_02_07_2_world_sai.sql b/sql/old/3.3.5a/2011_02_07_02_world_sai.sql similarity index 100% rename from sql/old/3.3.5a/2011_02_07_2_world_sai.sql rename to sql/old/3.3.5a/2011_02_07_02_world_sai.sql diff --git a/sql/old/3.3.5a/2011_02_08_0_world_instance_saurfang_traps.sql b/sql/old/3.3.5a/2011_02_080_0_world_instance_saurfang_traps.sql similarity index 100% rename from sql/old/3.3.5a/2011_02_08_0_world_instance_saurfang_traps.sql rename to sql/old/3.3.5a/2011_02_080_0_world_instance_saurfang_traps.sql diff --git a/sql/old/3.3.5a/2011_02_08_0_world_areatrigger_scripts.sql b/sql/old/3.3.5a/2011_02_08_00_world_areatrigger_scripts.sql similarity index 100% rename from sql/old/3.3.5a/2011_02_08_0_world_areatrigger_scripts.sql rename to sql/old/3.3.5a/2011_02_08_00_world_areatrigger_scripts.sql diff --git a/sql/old/3.3.5a/2011_02_08_0_world_scriptname.sql b/sql/old/3.3.5a/2011_02_08_00_world_scriptname.sql similarity index 100% rename from sql/old/3.3.5a/2011_02_08_0_world_scriptname.sql rename to sql/old/3.3.5a/2011_02_08_00_world_scriptname.sql diff --git a/sql/old/3.3.5a/2011_02_08_1_world_creature_template.sql b/sql/old/3.3.5a/2011_02_08_01_world_creature_template.sql similarity index 100% rename from sql/old/3.3.5a/2011_02_08_1_world_creature_template.sql rename to sql/old/3.3.5a/2011_02_08_01_world_creature_template.sql diff --git a/sql/old/3.3.5a/2011_02_08_2_world_waypoint_scripts.sql b/sql/old/3.3.5a/2011_02_08_02_world_waypoint_scripts.sql similarity index 100% rename from sql/old/3.3.5a/2011_02_08_2_world_waypoint_scripts.sql rename to sql/old/3.3.5a/2011_02_08_02_world_waypoint_scripts.sql diff --git a/sql/old/3.3.5a/2011_02_10_0_world_sai.sql b/sql/old/3.3.5a/2011_02_10_00_world_sai.sql similarity index 100% rename from sql/old/3.3.5a/2011_02_10_0_world_sai.sql rename to sql/old/3.3.5a/2011_02_10_00_world_sai.sql diff --git a/sql/old/3.3.5a/2011_02_10_1_world_sai.sql b/sql/old/3.3.5a/2011_02_10_01_world_sai.sql similarity index 100% rename from sql/old/3.3.5a/2011_02_10_1_world_sai.sql rename to sql/old/3.3.5a/2011_02_10_01_world_sai.sql diff --git a/sql/old/3.3.5a/2011_02_10_2_world_instance_oculus.sql b/sql/old/3.3.5a/2011_02_10_02_world_instance_oculus.sql similarity index 100% rename from sql/old/3.3.5a/2011_02_10_2_world_instance_oculus.sql rename to sql/old/3.3.5a/2011_02_10_02_world_instance_oculus.sql diff --git a/sql/old/3.3.5a/2011_02_10_3_world_creature_template.sql b/sql/old/3.3.5a/2011_02_10_03_world_creature_template.sql similarity index 100% rename from sql/old/3.3.5a/2011_02_10_3_world_creature_template.sql rename to sql/old/3.3.5a/2011_02_10_03_world_creature_template.sql diff --git a/sql/old/3.3.5a/2011_02_10_4_world_scriptname.sql b/sql/old/3.3.5a/2011_02_10_04_world_scriptname.sql similarity index 100% rename from sql/old/3.3.5a/2011_02_10_4_world_scriptname.sql rename to sql/old/3.3.5a/2011_02_10_04_world_scriptname.sql diff --git a/sql/old/3.3.5a/2011_02_11_0_world_coredevdata.sql b/sql/old/3.3.5a/2011_02_11_00_world_coredevdata.sql similarity index 100% rename from sql/old/3.3.5a/2011_02_11_0_world_coredevdata.sql rename to sql/old/3.3.5a/2011_02_11_00_world_coredevdata.sql diff --git a/sql/old/3.3.5a/2011_02_11_1_world_command.sql b/sql/old/3.3.5a/2011_02_11_01_world_command.sql similarity index 100% rename from sql/old/3.3.5a/2011_02_11_1_world_command.sql rename to sql/old/3.3.5a/2011_02_11_01_world_command.sql diff --git a/sql/old/3.3.5a/2011_02_11_1_world_coredevdata.sql b/sql/old/3.3.5a/2011_02_11_01_world_coredevdata.sql similarity index 100% rename from sql/old/3.3.5a/2011_02_11_1_world_coredevdata.sql rename to sql/old/3.3.5a/2011_02_11_01_world_coredevdata.sql diff --git a/sql/old/3.3.5a/2011_02_11_2_world_npc_gossip.sql b/sql/old/3.3.5a/2011_02_11_02_world_npc_gossip.sql similarity index 100% rename from sql/old/3.3.5a/2011_02_11_2_world_npc_gossip.sql rename to sql/old/3.3.5a/2011_02_11_02_world_npc_gossip.sql diff --git a/sql/old/3.3.5a/2011_02_11_3_creature_involvedrelation.sql b/sql/old/3.3.5a/2011_02_11_03_world_creature_involvedrelation.sql similarity index 100% rename from sql/old/3.3.5a/2011_02_11_3_creature_involvedrelation.sql rename to sql/old/3.3.5a/2011_02_11_03_world_creature_involvedrelation.sql diff --git a/sql/updates/world/2011_02_11_4_world_game_event_npc_gossip.sql b/sql/old/3.3.5a/2011_02_11_04_world_game_event_npc_gossip.sql similarity index 100% rename from sql/updates/world/2011_02_11_4_world_game_event_npc_gossip.sql rename to sql/old/3.3.5a/2011_02_11_04_world_game_event_npc_gossip.sql diff --git a/sql/updates/world/2011_02_12_0_world_spell_script_names.sql b/sql/old/3.3.5a/2011_02_12_00_world_spell_script_names.sql similarity index 100% rename from sql/updates/world/2011_02_12_0_world_spell_script_names.sql rename to sql/old/3.3.5a/2011_02_12_00_world_spell_script_names.sql diff --git a/sql/updates/world/2011_02_15_0_world_sai.sql b/sql/old/3.3.5a/2011_02_15_00_world_sai.sql similarity index 100% rename from sql/updates/world/2011_02_15_0_world_sai.sql rename to sql/old/3.3.5a/2011_02_15_00_world_sai.sql diff --git a/sql/updates/world/2011_02_15_1_world_sai.sql b/sql/old/3.3.5a/2011_02_15_01_world_sai.sql similarity index 100% rename from sql/updates/world/2011_02_15_1_world_sai.sql rename to sql/old/3.3.5a/2011_02_15_01_world_sai.sql diff --git a/sql/updates/world/2011_02_15_2_world_game_event_liita.sql b/sql/old/3.3.5a/2011_02_15_02_world_game_event_liita.sql similarity index 100% rename from sql/updates/world/2011_02_15_2_world_game_event_liita.sql rename to sql/old/3.3.5a/2011_02_15_02_world_game_event_liita.sql diff --git a/sql/updates/world/2011_02_15_3_world_creature_template.sql b/sql/old/3.3.5a/2011_02_15_03_world_creature_template.sql similarity index 100% rename from sql/updates/world/2011_02_15_3_world_creature_template.sql rename to sql/old/3.3.5a/2011_02_15_03_world_creature_template.sql diff --git a/sql/updates/world/2011_02_15_3_world_creature_text.sql b/sql/old/3.3.5a/2011_02_15_03_world_creature_text.sql similarity index 100% rename from sql/updates/world/2011_02_15_3_world_creature_text.sql rename to sql/old/3.3.5a/2011_02_15_03_world_creature_text.sql diff --git a/sql/updates/world/2011_02_15_3_world_scriptname.sql b/sql/old/3.3.5a/2011_02_15_03_world_scriptname.sql similarity index 100% rename from sql/updates/world/2011_02_15_3_world_scriptname.sql rename to sql/old/3.3.5a/2011_02_15_03_world_scriptname.sql diff --git a/sql/updates/world/2011_02_15_3_world_spell_script_names.sql b/sql/old/3.3.5a/2011_02_15_03_world_spell_script_names.sql similarity index 100% rename from sql/updates/world/2011_02_15_3_world_spell_script_names.sql rename to sql/old/3.3.5a/2011_02_15_03_world_spell_script_names.sql diff --git a/sql/updates/world/2011_02_15_4_world_spell_linked_spell.sql b/sql/old/3.3.5a/2011_02_15_04_world_spell_linked_spell.sql similarity index 100% rename from sql/updates/world/2011_02_15_4_world_spell_linked_spell.sql rename to sql/old/3.3.5a/2011_02_15_04_world_spell_linked_spell.sql diff --git a/sql/updates/world/2011_02_15_4_world_spell_script_names.sql b/sql/old/3.3.5a/2011_02_15_04_world_spell_script_names.sql similarity index 100% rename from sql/updates/world/2011_02_15_4_world_spell_script_names.sql rename to sql/old/3.3.5a/2011_02_15_04_world_spell_script_names.sql diff --git a/sql/old/3.3.5a/2011_02_16_00_world_spell_script_names.sql b/sql/old/3.3.5a/2011_02_16_00_world_spell_script_names.sql new file mode 100644 index 0000000000000..e41542c33160d --- /dev/null +++ b/sql/old/3.3.5a/2011_02_16_00_world_spell_script_names.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_script_names` WHERE `spell_id`=70117 AND `ScriptName`='spell_sindragosa_collision_filter'; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(70117,'spell_sindragosa_collision_filter'); diff --git a/sql/old/3.3.5a/2011_02_16_01_world_conditions.sql b/sql/old/3.3.5a/2011_02_16_01_world_conditions.sql new file mode 100644 index 0000000000000..e42fd4006e4fb --- /dev/null +++ b/sql/old/3.3.5a/2011_02_16_01_world_conditions.sql @@ -0,0 +1,4 @@ +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry` IN (70360,72527); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(13,0,70360,0,18,1,37690,0,0, '', 'Mutated Abomination - Eat Ooze target'), +(13,0,72527,0,18,1,37690,0,0, '', 'Mutated Abomination - Eat Ooze target'); diff --git a/sql/old/3.3.5a/2011_02_18_00_world_creature.sql b/sql/old/3.3.5a/2011_02_18_00_world_creature.sql new file mode 100644 index 0000000000000..4f07781a2678a --- /dev/null +++ b/sql/old/3.3.5a/2011_02_18_00_world_creature.sql @@ -0,0 +1,6 @@ +SET @GUID := 137743; +DELETE FROM `creature` WHERE `id` IN (38471,38501,38551); +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`DeathState`,`MovementType`,`npcflag`,`unit_flags`,`dynamicflags`) VALUES +(@GUID+0,38471,631,15,1,0,0,-504.949,2184.24,62.3048,0.450047,86400,0,0,0,0,0,0,0,0,0), +(@GUID+1,38501,631,15,1,0,0,4247.040,2753.25,348.996,0.227759,86400,0,0,0,0,0,0,0,0,0), +(@GUID+2,38551,631,15,1,0,0,4466.260,2787.99,348.954,3.349720,86400,0,0,0,0,0,0,0,0,0); diff --git a/sql/old/3.3.5a/2011_02_18_00_world_creature_text.sql b/sql/old/3.3.5a/2011_02_18_00_world_creature_text.sql new file mode 100644 index 0000000000000..39d46f15fef76 --- /dev/null +++ b/sql/old/3.3.5a/2011_02_18_00_world_creature_text.sql @@ -0,0 +1,6 @@ +DELETE FROM `creature_text` WHERE `entry` IN (38472,38485); +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(38472,0,0, 'Die, intruders! None shall interfere with the Cult''s plans!',1,0,0,0,0,0, 'Darnavan - SAY_DARNAVAN_AGGRO'), +(38472,1,0, 'Wh- where am I...? What a nightmare I have had... But this is no time to reflect, I have much information to report!',0,0,0,0,0,0, 'Darnavan - SAY_DARNAVAN_RESCUED'), +(38485,0,0, 'Die, intruders! None shall interfere with the Cult''s plans!',1,0,0,0,0,0, 'Darnavan - SAY_DARNAVAN_AGGRO'), +(38485,1,0, 'Wh- where am I...? What a nightmare I have had... But this is no time to reflect, I have much information to report!',0,0,0,0,0,0, 'Darnavan - SAY_DARNAVAN_RESCUED'); diff --git a/sql/old/3.3.5a/2011_02_18_00_world_pool_quest.sql b/sql/old/3.3.5a/2011_02_18_00_world_pool_quest.sql new file mode 100644 index 0000000000000..6c386e8b77b77 --- /dev/null +++ b/sql/old/3.3.5a/2011_02_18_00_world_pool_quest.sql @@ -0,0 +1,28 @@ +-- ICC Quest pools (also deletes old pool data) +SET @pool := 5662; +DELETE FROM `pool_quest` WHERE `pool_entry` BETWEEN @pool+17 AND @pool+22; +INSERT INTO `pool_quest` (`entry`,`pool_entry`,`description`) VALUES +(24874,@pool+17, 'Blood Quickening (10)'), +(24869,@pool+17, 'Deprogramming (10)'), +(24873,@pool+17, 'Residue Rendezvous (10)'), +(24872,@pool+17, 'Respite for a Tormented Soul (10)'), +(24870,@pool+19, 'Securing the Ramparts HORDE (10)'), +(24871,@pool+19, 'Securing the Ramparts ALLY (10)'), +(24879,@pool+18, 'Blood Quickening (25)'), +(24875,@pool+18, 'Deprogramming (25)'), +(24878,@pool+18, 'Residue Rendezvous (25)'), +(24880,@pool+18, 'Respite for a Tormented Soul (25)'), +(24876,@pool+20, 'Securing the Ramparts ALLY (25)'), +(24877,@pool+20, 'Securing the Ramparts HORDE (25)'); + +DELETE FROM `pool_template` WHERE `entry` BETWEEN @pool+17 AND @pool+22; +INSERT INTO `pool_template` (`entry`,`max_limit`,`description`) VALUES +(@pool+17,1, 'ICC weeklies (10)'), +(@pool+18,1, 'ICC weeklies (25)'), +(@pool+19,2, 'Securing the Ramparts (10)'), +(@pool+20,2, 'Securing the Ramparts (25)'); + +DELETE FROM `pool_pool` WHERE `mother_pool` IN (@pool+17,@pool+18); +INSERT INTO `pool_pool` (`pool_id`,`mother_pool`,`chance`,`description`) VALUES +(@pool+19,@pool+17,0, 'Securing the Ramparts (10)'), +(@pool+20,@pool+18,0, 'Securing the Ramparts (25)'); diff --git a/sql/old/3.3.5a/2011_02_18_00_world_scriptname.sql b/sql/old/3.3.5a/2011_02_18_00_world_scriptname.sql new file mode 100644 index 0000000000000..3588fe7ae3ba0 --- /dev/null +++ b/sql/old/3.3.5a/2011_02_18_00_world_scriptname.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName`='npc_darnavan' WHERE `entry` IN (38472,38485); diff --git a/sql/old/3.3.5a/2011_02_18_00_world_spell_linked_spell.sql b/sql/old/3.3.5a/2011_02_18_00_world_spell_linked_spell.sql new file mode 100644 index 0000000000000..66ceb1b593c1a --- /dev/null +++ b/sql/old/3.3.5a/2011_02_18_00_world_spell_linked_spell.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=65940; +INSERT INTO `spell_linked_spell` (`spell_trigger`,`spell_effect`,`type`,`comment`) VALUES +(65940,65941,0, 'Trial of the Crusader: Shattering Throw'); diff --git a/sql/old/3.3.5a/2011_02_18_01_world_spell_linked_spell.sql b/sql/old/3.3.5a/2011_02_18_01_world_spell_linked_spell.sql new file mode 100644 index 0000000000000..5f5fbadfd2177 --- /dev/null +++ b/sql/old/3.3.5a/2011_02_18_01_world_spell_linked_spell.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=-11129; +INSERT INTO `spell_linked_spell` (`spell_trigger`,`spell_effect`,`type`,`comment`) VALUES +(-11129,-28682,0, 'Combustion'); diff --git a/sql/old/3.3.5a/2011_02_18_02_world_misc.sql b/sql/old/3.3.5a/2011_02_18_02_world_misc.sql new file mode 100644 index 0000000000000..8e2bc23586198 --- /dev/null +++ b/sql/old/3.3.5a/2011_02_18_02_world_misc.sql @@ -0,0 +1,36 @@ +-- Jeeves should be a vendor and a banker (to Engineers). +SET @Jeeves = 35642; +UPDATE `creature_template` SET `faction_A`=35,`faction_H`=35,`npcflag`=`npcflag`|4225|131072,`unit_flags`=`unit_flags`|768,`gossip_menu_id`=10667,`AIName`='' WHERE `entry`=@Jeeves; -- template updates +-- Jeeves gets the (player) faction of its summoner, 35 by default +UPDATE `creature_model_info` SET `bounding_radius`=0.31,`combat_reach`=0,`gender`=2 WHERE `modelid`=30076; -- addon data +DELETE FROM `creature_template_addon` WHERE `entry`=@Jeeves; +INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(@Jeeves,0,33554432,1,0, '68054 0'); -- Aura: Pressing Engagement, bytes1: hover mode + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=10667 AND `SourceEntry`=0; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(15,10667,0,0,7,202,350,0,0, '', 'Jeeves: Bank requires Engineering 350'); + +DELETE FROM `gossip_menu_option` WHERE `menu_id`=10667 AND `id` IN (0,1); +INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`option_id`,`npc_option_npcflag`) VALUES +(10667,0,6,'I would like to check my deposit box.',9,131072), -- banker +(10667,1,1,'Let me browse your goods.',3,128); -- vendor + +DELETE FROM `npc_vendor` WHERE `entry`=@Jeeves; +INSERT INTO `npc_vendor` (`entry`,`slot`,`item`,`maxcount`,`incrtime`,`ExtendedCost`) VALUES +(@Jeeves,1,41584,0,0,0), -- Frostbite Bullets +(@Jeeves,2,41586,0,0,0), -- Terrorshaft Arrow +(@Jeeves,3,44605,0,0,0), -- Wild Spineleaf +(@Jeeves,4,44614,0,0,0), -- Starleaf Seed +(@Jeeves,5,44615,0,0,0), -- Devout Candle +(@Jeeves,6,16583,0,0,0), -- Demonic Figurine +(@Jeeves,7,21177,0,0,0), -- Symbol of Kings +(@Jeeves,8,17020,0,0,0), -- Arcane Powder +(@Jeeves,9,37201,0,0,0), -- Corpse Dust +(@Jeeves,10,5565,0,0,0), -- Infernal Stone +(@Jeeves,11,17032,0,0,0), -- Rune of Portals +(@Jeeves,12,17030,0,0,0), -- Ankh +(@Jeeves,13,17033,0,0,0), -- Symbol of Divinity +(@Jeeves,14,17031,0,0,0); -- Rune of Teleportation + +DELETE FROM `creature_ai_scripts` WHERE `id`=3564201; -- remove unneed EventAI script diff --git a/sql/old/3.3.5a/2011_02_18_03_world_loot_template.sql b/sql/old/3.3.5a/2011_02_18_03_world_loot_template.sql new file mode 100644 index 0000000000000..4e9523fa758cc --- /dev/null +++ b/sql/old/3.3.5a/2011_02_18_03_world_loot_template.sql @@ -0,0 +1,2 @@ +-- Fix wrong loot being dropped by ICC trash +UPDATE `reference_loot_template` SET `item`=50450 WHERE `item`=50775 AND `entry`=35071; diff --git a/sql/old/3.3.5a/2011_02_18_04_world_eai.sql b/sql/old/3.3.5a/2011_02_18_04_world_eai.sql new file mode 100644 index 0000000000000..3dd091465ed52 --- /dev/null +++ b/sql/old/3.3.5a/2011_02_18_04_world_eai.sql @@ -0,0 +1,2 @@ +-- Correction for Obsidian Eradicator EAI +UPDATE `creature_ai_scripts` SET `action1_param1`=23 WHERE `id`=1526201 AND `creature_id`=15262; diff --git a/sql/old/3.3.5a/2011_02_18_05_world_sai.sql b/sql/old/3.3.5a/2011_02_18_05_world_sai.sql new file mode 100644 index 0000000000000..e06f5a067c000 --- /dev/null +++ b/sql/old/3.3.5a/2011_02_18_05_world_sai.sql @@ -0,0 +1,80 @@ +-- Bonesunder SAI (Converted from EAI) +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=27006; +DELETE FROM `smart_scripts` WHERE `entryorguid`=27006; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=27006; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(27006,0,0,0,0,0,100,0,5000,11000,16000,25000,11,52080,1,0,0,0,0,2,0,0,0,0,0,0,0,'Bonesunder - Cast Bonecrack'); + +-- Surge Needle Sorcerer SAI +SET @ELMGUID := 113473; +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=26257; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (26257,-109558,-109559,-109560,-109561,-109563,-109564,-109565,-109569,-109570,-109571,-109572,-109578); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(26257,0,2,0,0,0,100,0,3000,4000,3000,5000,11,51797,0,0,0,0,0,2,0,0,0,0,0,0,0,'Cast Arcane Blast on victim'), +(-109558,0,0,0,1,0,100,1,1000,1000,1000,1000,11,46906,2,0,0,0,0,10,@ELMGUID,26298,0,0,0,0,0,'Cast Surge Needle Beam when spawned'), +(-109558,0,1,0,21,0,100,0,0,0,0,0,11,46906,2,0,0,0,0,10,@ELMGUID,26298,0,0,0,0,0,'Cast Surge Needle Beam when reach home'), +(-109558,0,2,0,0,0,100,0,3000,4000,3000,5000,11,51797,0,0,0,0,0,2,0,0,0,0,0,0,0,'Cast Arcane Blast on victim'), +(-109559,0,0,0,1,0,100,1,1000,1000,1000,1000,11,46906,2,0,0,0,0,10,@ELMGUID,26298,0,0,0,0,0,'Cast Surge Needle Beam when spawned'), +(-109559,0,1,0,21,0,100,0,0,0,0,0,11,46906,2,0,0,0,0,10,@ELMGUID,26298,0,0,0,0,0,'Cast Surge Needle Beam when reach home'), +(-109559,0,2,0,0,0,100,0,3000,4000,3000,5000,11,51797,0,0,0,0,0,2,0,0,0,0,0,0,0,'Cast Arcane Blast on victim'), +(-109560,0,0,0,1,0,100,1,1000,1000,1000,1000,11,46906,2,0,0,0,0,10,@ELMGUID,26298,0,0,0,0,0,'Cast Surge Needle Beam when spawned'), +(-109560,0,1,0,21,0,100,0,0,0,0,0,11,46906,2,0,0,0,0,10,@ELMGUID,26298,0,0,0,0,0,'Cast Surge Needle Beam when reach home'), +(-109560,0,2,0,0,0,100,0,3000,4000,3000,5000,11,51797,0,0,0,0,0,2,0,0,0,0,0,0,0,'Cast Arcane Blast on victim'), +(-109561,0,0,0,1,0,100,1,1000,1000,1000,1000,11,46906,2,0,0,0,0,10,@ELMGUID,26298,0,0,0,0,0,'Cast Surge Needle Beam when spawned'), +(-109561,0,1,0,21,0,100,0,0,0,0,0,11,46906,2,0,0,0,0,10,@ELMGUID,26298,0,0,0,0,0,'Cast Surge Needle Beam when reach home'), +(-109561,0,2,0,0,0,100,0,3000,4000,3000,5000,11,51797,0,0,0,0,0,2,0,0,0,0,0,0,0,'Cast Arcane Blast on victim'), +(-109563,0,0,0,1,0,100,1,1000,1000,1000,1000,11,46906,2,0,0,0,0,10,@ELMGUID,26298,0,0,0,0,0,'Cast Surge Needle Beam when spawned'), +(-109563,0,1,0,21,0,100,0,0,0,0,0,11,46906,2,0,0,0,0,10,@ELMGUID,26298,0,0,0,0,0,'Cast Surge Needle Beam when reach home'), +(-109563,0,2,0,0,0,100,0,3000,4000,3000,5000,11,51797,0,0,0,0,0,2,0,0,0,0,0,0,0,'Cast Arcane Blast on victim'), +(-109564,0,0,0,1,0,100,1,1000,1000,1000,1000,11,46906,2,0,0,0,0,10,@ELMGUID,26298,0,0,0,0,0,'Cast Surge Needle Beam when spawned'), +(-109564,0,1,0,21,0,100,0,0,0,0,0,11,46906,2,0,0,0,0,10,@ELMGUID,26298,0,0,0,0,0,'Cast Surge Needle Beam when reach home'), +(-109564,0,2,0,0,0,100,0,3000,4000,3000,5000,11,51797,0,0,0,0,0,2,0,0,0,0,0,0,0,'Cast Arcane Blast on victim'), +(-109565,0,0,0,1,0,100,1,1000,1000,1000,1000,11,46906,2,0,0,0,0,10,@ELMGUID,26298,0,0,0,0,0,'Cast Surge Needle Beam when spawned'), +(-109565,0,1,0,21,0,100,0,0,0,0,0,11,46906,2,0,0,0,0,10,@ELMGUID,26298,0,0,0,0,0,'Cast Surge Needle Beam when reach home'), +(-109565,0,2,0,0,0,100,0,3000,4000,3000,5000,11,51797,0,0,0,0,0,2,0,0,0,0,0,0,0,'Cast Arcane Blast on victim'), +(-109569,0,0,0,1,0,100,1,1000,1000,1000,1000,11,46906,2,0,0,0,0,10,@ELMGUID,26298,0,0,0,0,0,'Cast Surge Needle Beam when spawned'), +(-109569,0,1,0,21,0,100,0,0,0,0,0,11,46906,2,0,0,0,0,10,@ELMGUID,26298,0,0,0,0,0,'Cast Surge Needle Beam when reach home'), +(-109569,0,2,0,0,0,100,0,3000,4000,3000,5000,11,51797,0,0,0,0,0,2,0,0,0,0,0,0,0,'Cast Arcane Blast on victim'), +(-109570,0,0,0,1,0,100,1,1000,1000,1000,1000,11,46906,2,0,0,0,0,10,@ELMGUID,26298,0,0,0,0,0,'Cast Surge Needle Beam when spawned'), +(-109570,0,1,0,21,0,100,0,0,0,0,0,11,46906,2,0,0,0,0,10,@ELMGUID,26298,0,0,0,0,0,'Cast Surge Needle Beam when reach home'), +(-109570,0,2,0,0,0,100,0,3000,4000,3000,5000,11,51797,0,0,0,0,0,2,0,0,0,0,0,0,0,'Cast Arcane Blast on victim'), +(-109571,0,0,0,1,0,100,1,1000,1000,1000,1000,11,46906,2,0,0,0,0,10,@ELMGUID,26298,0,0,0,0,0,'Cast Surge Needle Beam when spawned'), +(-109571,0,1,0,21,0,100,0,0,0,0,0,11,46906,2,0,0,0,0,10,@ELMGUID,26298,0,0,0,0,0,'Cast Surge Needle Beam when reach home'), +(-109571,0,2,0,0,0,100,0,3000,4000,3000,5000,11,51797,0,0,0,0,0,2,0,0,0,0,0,0,0,'Cast Arcane Blast on victim'), +(-109572,0,0,0,1,0,100,1,1000,1000,1000,1000,11,46906,2,0,0,0,0,10,@ELMGUID,26298,0,0,0,0,0,'Cast Surge Needle Beam when spawned'), +(-109572,0,1,0,21,0,100,0,0,0,0,0,11,46906,2,0,0,0,0,10,@ELMGUID,26298,0,0,0,0,0,'Cast Surge Needle Beam when reach home'), +(-109572,0,2,0,0,0,100,0,3000,4000,3000,5000,11,51797,0,0,0,0,0,2,0,0,0,0,0,0,0,'Cast Arcane Blast on victim'), +(-109578,0,0,0,1,0,100,1,1000,1000,1000,1000,11,46906,2,0,0,0,0,10,@ELMGUID,26298,0,0,0,0,0,'Cast Surge Needle Beam when spawned'), +(-109578,0,1,0,21,0,100,0,0,0,0,0,11,46906,2,0,0,0,0,10,@ELMGUID,26298,0,0,0,0,0,'Cast Surge Needle Beam when reach home'), +(-109578,0,2,0,0,0,100,0,3000,4000,3000,5000,11,51797,0,0,0,0,0,2,0,0,0,0,0,0,0,'Cast Arcane Blast on victim'); + +-- Goramosh SAI +SET @ELMGUID := 113473; +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=26349; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (26349); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(26349,0,0,0,1,0,100,1,1000,1000,1000,1000,11,46906,2,0,0,0,0,10,@ELMGUID,26298,0,0,0,0,0,'Cast Surge Needle Beam when spawned'), +(26349,0,1,0,21,0,100,0,0,0,0,0,11,46906,2,0,0,0,0,10,@ELMGUID,26298,0,0,0,0,0,'Cast Surge Needle Beam when reach home'), +(26349,0,2,0,2,0,100,1,0,50,0,0,11,20828,0,0,0,0,0,2,0,0,0,0,0,0,0,'Cast Cone of Cold on victim at 50% health'), +(26349,0,3,0,0,0,100,0,3500,3500,3500,3500,11,9672,0,0,0,0,0,2,0,0,0,0,0,0,0,'Cast Frost Bolt on victim'); + +-- Arcanimus SAI +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=26370; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (26370); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(26370,0,0,0,1,0,100,1,2000,2000,2000,2000,45,0,1,0,0,0,0,10,113473,26298,0,0,0,0,0, 'Set data 0 = 1 on bunny 2 sec after reset'), +(26370,0,1,0,1,0,100,1,0,0,0,0,11,46934,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Arcanimus - Add Cosmetic - Arcane Force Shield (Blue x2) Aura on spawn & reset'), +(26370,0,2,3,4,0,100,0,0,0,0,0,28,46934,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Arcanimus - Remove Cosmetic - Arcane Force Shield (Blue x2) Aura on aggro'), +(26370,0,3,0,61,0,100,0,0,0,0,0,28,46906,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Arcanimus - Remove Cosmetic - Surge Needle Beam on aggro'), +(26370,0,4,0,2,0,100,1,71,80,0,0,11,51820,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Arcanimus - at 80% health cast Arcane Explosion on self'), +(26370,0,5,0,2,0,100,1,41,60,0,0,11,51820,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Arcanimus - at 60% health cast Arcane Explosion on self'), +(26370,0,6,0,2,0,100,1,21,40,0,0,11,51820,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Arcanimus - at 40% health cast Arcane Explosion on self'), +(26370,0,7,0,2,0,100,1,1,20,0,0,11,51820,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Arcanimus - at 20% health cast Arcane Explosion on self'); + +-- ELM General Purpose Bunny (scale x0.01) Large SAI +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=26298; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (-113473); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(-113473,0,0,0,11,0,100,0,0,0,0,0,11,32566,2,0,0,0,0,1,0,0,0,0,0,0,0,'Cast Purple Banish State aura on self when spawned'), +(-113473,0,1,2,38,0,100,0,0,1,0,0,45,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'reset data 0 = 0'), +(-113473,0,2,0,61,0,100,0,0,0,0,0,11,46906,2,0,0,0,0,10,96298,26370,0,0,0,0,0, 'cast Surge Needle Beam on Arcanimus'); diff --git a/sql/old/3.3.5a/2011_02_19_00_world_conditions.sql b/sql/old/3.3.5a/2011_02_19_00_world_conditions.sql new file mode 100644 index 0000000000000..23ca7bb57669a --- /dev/null +++ b/sql/old/3.3.5a/2011_02_19_00_world_conditions.sql @@ -0,0 +1,4 @@ +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry` IN (72155,72162); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(13,0,72155,0,18,1,0,0,0, '', 'Harvest Blight Specimen - player target'), +(13,0,72162,0,18,1,0,0,0, '', 'Harvest Blight Specimen - player target'); diff --git a/sql/old/3.3.5a/2011_02_19_00_world_creature_template.sql b/sql/old/3.3.5a/2011_02_19_00_world_creature_template.sql new file mode 100644 index 0000000000000..edfa570115af0 --- /dev/null +++ b/sql/old/3.3.5a/2011_02_19_00_world_creature_template.sql @@ -0,0 +1,2 @@ +UPDATE `creature_template` SET `difficulty_entry_1`=38717 WHERE `entry`=38501; +UPDATE `creature_template` SET `minlevel`=80,`maxlevel`=80,`exp`=2,`unit_class`=1,`faction_A`=2070,`faction_H`=2070,`npcflag`=2,`dynamicflags`=8,`unit_flags`=33280,`unit_class`=8 WHERE `entry`=38717; -- Alchemist Adrianna (1) diff --git a/sql/old/3.3.5a/2011_02_19_00_world_scriptname.sql b/sql/old/3.3.5a/2011_02_19_00_world_scriptname.sql new file mode 100644 index 0000000000000..4901cb763ae67 --- /dev/null +++ b/sql/old/3.3.5a/2011_02_19_00_world_scriptname.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName`='npc_alchemist_adrianna' WHERE `entry`=38501; diff --git a/sql/old/3.3.5a/2011_02_19_00_world_spell_script_names.sql b/sql/old/3.3.5a/2011_02_19_00_world_spell_script_names.sql new file mode 100644 index 0000000000000..709344ae76def --- /dev/null +++ b/sql/old/3.3.5a/2011_02_19_00_world_spell_script_names.sql @@ -0,0 +1,22 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_icc_harvest_blight_specimen'; +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_festergut_gaseous_blight'; +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_rotface_slime_spray'; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(72155,'spell_icc_harvest_blight_specimen'), +(72162,'spell_icc_harvest_blight_specimen'), +(69159,'spell_festergut_gaseous_blight'), +(70135,'spell_festergut_gaseous_blight'), +(70136,'spell_festergut_gaseous_blight'), +(70137,'spell_festergut_gaseous_blight'), +(69161,'spell_festergut_gaseous_blight'), +(70138,'spell_festergut_gaseous_blight'), +(70139,'spell_festergut_gaseous_blight'), +(70140,'spell_festergut_gaseous_blight'), +(69163,'spell_festergut_gaseous_blight'), +(70468,'spell_festergut_gaseous_blight'), +(70469,'spell_festergut_gaseous_blight'), +(70470,'spell_festergut_gaseous_blight'), +(69507,'spell_rotface_slime_spray'), +(71213,'spell_rotface_slime_spray'), +(73189,'spell_rotface_slime_spray'), +(73190,'spell_rotface_slime_spray'); diff --git a/sql/old/3.3.5a/2011_02_19_01_world_instance_icecrown_citadel.sql b/sql/old/3.3.5a/2011_02_19_01_world_instance_icecrown_citadel.sql new file mode 100644 index 0000000000000..1c42bfdb544e5 --- /dev/null +++ b/sql/old/3.3.5a/2011_02_19_01_world_instance_icecrown_citadel.sql @@ -0,0 +1,109 @@ +-- delete custom templates +DELETE FROM `creature_template` WHERE `entry` IN (3678902,3678903,3712602,3712603,3712702,3712703,3713202,3713203,3713302,3713303,3713402,3713403,3812501,3812502,3812503); +DELETE FROM `creature_onkill_reputation` WHERE `creature_id` IN (3678902,3678903,3712602,3712603); +DELETE FROM `creature_loot_template` WHERE `entry` IN (3712602,3712603); + +-- Spire Frostwyrm +UPDATE `creature` SET `spawnMask`=15 WHERE `id`=37528; + +-- equip templates +SET @EQUIP := 2422; +DELETE FROM `creature_equip_template` WHERE `entry`=@EQUIP; +INSERT INTO `creature_equip_template` (`entry`,`equipentry1`,`equipentry2`,`equipentry3`) VALUES +(@EQUIP,39381,0,45872); + +-- creature template updates +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=36789; -- Valithria Dreamwalker +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=37126; -- Sister Svalna +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=37127; -- Ymirjar Frostbinder +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=37132; -- Ymirjar Battle-Maiden +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=37133; -- Ymirjar Warlord +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=37134; -- Ymirjar Huntress +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=38125; -- Ymirjar Deathbringer +UPDATE `creature_template` SET `minlevel`=83,`maxlevel`=83,`unit_class`=1,`faction_A`=1665,`faction_H`=1665,`unit_flags`=0x20000000,`baseattacktime`=2000,`scale`=1,`RegenHealth`=0 WHERE `entry` IN (36789,38174); -- Valithria Dreamwalker +UPDATE `creature_template` SET `minlevel`=81,`maxlevel`=81,`unit_class`=2,`faction_A`=16,`faction_H`=16,`unit_flags`=0,`baseattacktime`=2000,`scale`=1 WHERE `entry` IN (37868,38167,38725,38735); -- Risen Archmage +UPDATE `creature_template` SET `minlevel`=60,`maxlevel`=60,`unit_class`=1,`faction_A`=14,`faction_H`=14,`unit_flags`=0x2000000,`baseattacktime`=2000,`scale`=1 WHERE `entry`=38752; -- Green Dragon Combat Trigger +UPDATE `creature_template` SET `minlevel`=82,`maxlevel`=82,`unit_class`=2,`faction_A`=2209,`faction_H`=2209,`unit_flags`=0x0040,`dynamicflags`=8,`baseattacktime`=2000,`equipment_id`=10084,`scale`=1,`speed_run`=2.285714,`speed_walk`=1.6,`InhabitType`=7 WHERE `entry` IN (37126,38258); -- Sister Svalna +UPDATE `creature_template` SET `minlevel`=80,`maxlevel`=80,`unit_class`=8,`faction_A`=2209,`faction_H`=2209,`unit_flags`=0x8040,`dynamicflags`=8,`baseattacktime`=2000,`equipment_id`=93,`scale`=1 WHERE `entry` IN (37127,38126); -- Ymirjar Frostbinder +UPDATE `creature_template` SET `minlevel`=80,`maxlevel`=80,`unit_class`=1,`faction_A`=2209,`faction_H`=2209,`unit_flags`=0x8040,`dynamicflags`=8,`baseattacktime`=2000,`equipment_id`=10128,`scale`=1,`speed_walk`=1.2 WHERE `entry` IN (37132,38132); -- Ymirjar Battle-Maiden +UPDATE `creature_template` SET `minlevel`=80,`maxlevel`=80,`unit_class`=1,`faction_A`=2209,`faction_H`=2209,`unit_flags`=0x8040,`dynamicflags`=8,`baseattacktime`=2000,`equipment_id`=358,`scale`=1,`speed_run`=1.428571 WHERE `entry` IN (37133,38133); -- Ymirjar Warlord +UPDATE `creature_template` SET `minlevel`=80,`maxlevel`=80,`unit_class`=2,`faction_A`=2209,`faction_H`=2209,`unit_flags`=0x8040,`dynamicflags`=8,`baseattacktime`=2000,`equipment_id`=@EQUIP,`scale`=1,`speed_run`=1.285714 WHERE `entry` IN (37134,38131); -- Ymirjar Huntress +UPDATE `creature_template` SET `minlevel`=80,`maxlevel`=80,`unit_class`=2,`faction_A`=2209,`faction_H`=2209,`unit_flags`=0x8000,`dynamicflags`=8,`baseattacktime`=2000,`equipment_id`=93,`scale`=1 WHERE `entry` IN (38125,38130); -- Ymirjar Deathbringer +UPDATE `creature_template` SET `minlevel`=80,`maxlevel`=80,`unit_class`=1,`faction_A`=2209,`faction_H`=2209,`baseattacktime`=2000,`scale`=1 WHERE `entry`=38154; -- Warhawk + +-- model updates +UPDATE `creature_model_info` SET `bounding_radius`=2,`combat_reach`=20,`gender`=2 WHERE `modelid`=30318; -- Valithria Dreamwalker +UPDATE `creature_model_info` SET `bounding_radius`=1.5,`combat_reach`=2.25,`gender`=0 WHERE `modelid`=7919; -- Risen Archmage +UPDATE `creature_model_info` SET `bounding_radius`=0.93,`combat_reach`=12,`gender`=1 WHERE `modelid`=30521; -- Sister Svalna +UPDATE `creature_model_info` SET `bounding_radius`=0.403,`combat_reach`=1.3,`gender`=1 WHERE `modelid`=27548; -- Ymirjar Frostbinder +UPDATE `creature_model_info` SET `bounding_radius`=0.403,`gender`=1 WHERE `modelid`=27549; -- Ymirjar Battle-Maiden +UPDATE `creature_model_info` SET `bounding_radius`=0.465,`combat_reach`=1.5, `gender`=0 WHERE `modelid`=26623; -- Ymirjar Warlord +UPDATE `creature_model_info` SET `bounding_radius`=0.31,`combat_reach`=1,`gender`=1 WHERE `modelid`=25771; -- Ymirjar Warlord +UPDATE `creature_model_info` SET `bounding_radius`=0.403,`combat_reach`=1.3, `gender`=1 WHERE `modelid`=27548; -- Ymirjar Deathbringer + +-- Gunship Armory (delete wrong spawn) +DELETE FROM `gameobject` WHERE `id`=202178; + +-- Mode specific objects (instance portal) reused deleted guids +DELETE FROM `gameobject` WHERE `id` IN (202315,202316,202317,202318); +INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES +(150308,202318,631,5,1,82.1685,2211.82,33.0959,3.14159,0,0,1,0,6000,100,1), +(150310,202316,631,10,1,82.1685,2211.82,33.0959,3.14159,0,0,1,0,6000,100,1), +(150321,202317,631,5,1,82.1685,2211.82,33.0959,3.14159,0,0,1,0,6000,100,1), +(150326,202315,631,10,1,82.1685,2211.82,33.0959,3.14159,0,0,1,0,6000,100,1); + +UPDATE `gameobject_template` SET `faction`=114,`flags`=0x00000020 WHERE entry IN (202181,202182,202183,201919,201920); +UPDATE `gameobject` SET `state`=0,animprogress=255 WHERE `id` IN (202181,202182,202183,201919,201920); +UPDATE `gameobject` SET `spawnMask`=15 WHERE `id` IN (201825,201583,201374,201911,201880,202211,201777,201772,201774,201771,201814,201816,202220,201811,201812,202079,202223,202235,202242,202243,202244,202245,202246); + +SET @GUID := 137746; +DELETE FROM `creature` WHERE (`position_x` BETWEEN 4330 AND 4380) AND (`position_y` BETWEEN 2470 AND 2650) AND `position_z` > 350; +DELETE FROM `creature` WHERE `guid` BETWEEN @GUID AND @GUID+37; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`DeathState`,`MovementType`,`npcflag`,`unit_flags`,`dynamicflags`) VALUES +(@GUID+00,36789,631,05,1,0,0,4203.65,2483.89,364.961,5.5152400,604800,0,0,06000003,0,0,0,0,0,0), -- Valithria Dreamwalker +(@GUID+01,36789,631,10,1,0,0,4203.65,2483.89,364.961,5.5152400,604800,0,0,17999997,0,0,0,0,0,0), -- Valithria Dreamwalker +(@GUID+02,37868,631,15,1,0,0,4222.86,2504.58,364.960,3.9095400,604800,0,0,0,0,0,0,0,0,0), -- Risen Archmage +(@GUID+03,37868,631,15,1,0,0,4223.40,2465.11,364.952,2.3911000,604800,0,0,0,0,0,0,0,0,0), -- Risen Archmage +(@GUID+04,37868,631,15,1,0,0,4230.44,2478.56,364.953,2.9321500,604800,0,0,0,0,0,0,0,0,0), -- Risen Archmage +(@GUID+05,37868,631,15,1,0,0,4230.53,2490.22,364.957,3.3684900,604800,0,0,0,0,0,0,0,0,0), -- Risen Archmage +(@GUID+06,38752,631,15,1,0,0,4203.89,2484.23,364.956,0.0000000,604800,0,0,0,0,0,0,0,0,0), -- Green Dragon Combat Trigger +(@GUID+07,37126,631,15,1,0,0,4356.71,2484.33,371.531,1.5708000,604800,0,0,0,0,0,0,0,0,0), -- Sister Svalna +(@GUID+08,37127,631,15,1,0,0,4346.72,2607.90,351.101,3.2342600,7200,0,0,0,0,0,0,0,0,0), -- Ymirjar Frostbinder +(@GUID+09,37127,631,15,1,0,0,4371.41,2570.52,351.101,0.0808906,7200,0,0,0,0,0,0,0,0,0), -- Ymirjar Frostbinder +(@GUID+10,37132,631,15,1,0,0,4349.24,2624.60,351.101,1.5592400,7200,0,0,0,0,0,0,0,0,0), -- Ymirjar Battle-Maiden +(@GUID+11,37132,631,15,1,0,0,4365.26,2624.06,351.101,1.6023200,7200,0,0,0,0,0,0,0,0,0), -- Ymirjar Battle-Maiden +(@GUID+12,37132,631,15,1,0,0,4347.20,2637.91,351.100,1.3406800,7200,0,0,0,0,0,0,0,0,0), -- Ymirjar Battle-Maiden +(@GUID+13,37132,631,15,1,0,0,4367.90,2638.14,351.100,1.7765700,7200,0,0,0,0,0,0,0,0,0), -- Ymirjar Battle-Maiden +(@GUID+14,37132,631,15,1,0,0,4345.88,2577.64,351.101,1.5299500,7200,0,0,0,0,0,0,0,0,0), -- Ymirjar Battle-Maiden +(@GUID+15,37132,631,15,1,0,0,4368.03,2578.97,351.101,1.6909600,7200,0,0,0,0,0,0,0,0,0), -- Ymirjar Battle-Maiden +(@GUID+16,37132,631,15,1,0,0,4369.26,2525.06,358.433,1.7891300,7200,0,0,0,0,0,0,0,0,0), -- Ymirjar Battle-Maiden +(@GUID+17,37132,631,15,1,0,0,4343.78,2525.43,358.433,1.2629100,7200,0,0,0,0,0,0,0,0,0), -- Ymirjar Battle-Maiden +(@GUID+18,37133,631,15,1,0,0,4366.83,2510.30,358.518,1.6231600,7200,0,0,0,0,0,0,0,0,0), -- Ymirjar Warlord +(@GUID+19,37133,631,15,1,0,0,4356.85,2636.39,351.101,1.5692200,7200,0,0,0,0,0,0,0,0,0), -- Ymirjar Warlord +(@GUID+20,37133,631,15,1,0,0,4346.98,2512.75,358.441,1.3571600,7200,0,0,0,0,0,0,0,0,0), -- Ymirjar Warlord +(@GUID+21,37133,631,15,1,0,0,4356.77,2524.27,358.433,1.5024600,7200,0,0,0,0,0,0,0,0,0), -- Ymirjar Warlord +(@GUID+22,37134,631,15,1,0,0,4351.66,2642.95,351.100,1.4035100,7200,0,0,0,0,0,0,0,0,0), -- Ymirjar Huntress +(@GUID+23,37134,631,15,1,0,0,4362.18,2642.97,351.100,1.5331000,7200,0,0,0,0,0,0,0,0,0), -- Ymirjar Huntress +(@GUID+24,37134,631,15,1,0,0,4363.48,2585.09,351.101,1.5849300,7200,0,0,0,0,0,0,0,0,0), -- Ymirjar Huntress +(@GUID+25,37134,631,15,1,0,0,4349.36,2584.54,351.101,1.6084900,7200,0,0,0,0,0,0,0,0,0), -- Ymirjar Huntress +(@GUID+26,37134,631,15,1,0,0,4350.65,2528.31,358.433,1.5299500,7200,0,0,0,0,0,0,0,0,0), -- Ymirjar Huntress +(@GUID+27,37134,631,15,1,0,0,4362.76,2527.67,358.433,1.4828200,7200,0,0,0,0,0,0,0,0,0), -- Ymirjar Huntress +(@GUID+28,38125,631,15,1,0,0,4369.75,2606.94,351.101,6.2462700,7200,0,0,0,0,0,0,0,0,0), -- Ymirjar Deathbringer +(@GUID+29,38125,631,15,1,0,0,4340.83,2572.01,351.101,3.1439400,7200,0,0,0,0,0,0,0,0,0), -- Ymirjar Deathbringer +(@GUID+30,38154,631,15,1,0,0,4360.11,2644.49,351.100,1.5880800,7200,0,0,0,0,0,0,0,0,0), -- Warhawk +(@GUID+31,38154,631,15,1,0,0,4355.22,2644.43,351.100,1.5841500,7200,0,0,0,0,0,0,0,0,0), -- Warhawk +(@GUID+32,38154,631,15,1,0,0,4359.36,2587.74,351.101,1.6477600,7200,0,0,0,0,0,0,0,0,0), -- Warhawk +(@GUID+33,38154,631,15,1,0,0,4354.53,2587.01,351.101,1.6438300,7200,0,0,0,0,0,0,0,0,0), -- Warhawk +(@GUID+34,38229,631,15,1,0,0,4358.06,2608.39,351.184,2.8626600,3600,5,0,0,0,0,1,0,0,0), -- Frozen Insect +(@GUID+35,38229,631,15,1,0,0,4351.09,2488.49,358.441,1.9373600,3600,5,0,0,0,0,1,0,0,0), -- Frozen Insect +(@GUID+36,38229,631,15,1,0,0,4356.68,2525.39,358.432,1.6956800,3600,5,0,0,0,0,1,0,0,0), -- Frozen Insect +(@GUID+37,38229,631,15,1,0,0,4352.72,2610.13,351.101,2.8266300,3600,5,0,0,0,0,1,0,0,0); -- Frozen Insect + +-- creature addon +DELETE FROM `creature_addon` WHERE `guid` IN (131604,@GUID+7,@GUID+18,@GUID+19,@GUID+20,@GUID+21); +INSERT INTO `creature_addon` (`guid`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(@GUID+07,0x3000000,0x0000001,0, '70203 0'), -- Sister Svalna +(@GUID+18,0x0000000,0x0000001,0, '71244 0'), -- Ymirjar Warlord +(@GUID+19,0x0000000,0x0000001,0, '71244 0'), -- Ymirjar Warlord +(@GUID+20,0x0000000,0x0000001,0, '71244 0'), -- Ymirjar Warlord +(@GUID+21,0x0000000,0x0000001,0, '71244 0'); -- Ymirjar Warlord diff --git a/sql/old/3.3.5a/2011_02_20_00_world_smart_scripts.sql b/sql/old/3.3.5a/2011_02_20_00_world_smart_scripts.sql new file mode 100644 index 0000000000000..4838863220250 --- /dev/null +++ b/sql/old/3.3.5a/2011_02_20_00_world_smart_scripts.sql @@ -0,0 +1,7 @@ +ALTER TABLE `smart_scripts` CHANGE `entryorguid` `entryorguid` INT(32) NOT NULL; +ALTER TABLE `smart_scripts` MODIFY `action_param1` INT(32) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `smart_scripts` MODIFY `action_param2` INT(32) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `smart_scripts` MODIFY `action_param3` INT(32) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `smart_scripts` MODIFY `action_param4` INT(32) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `smart_scripts` MODIFY `action_param5` INT(32) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `smart_scripts` MODIFY `action_param6` INT(32) UNSIGNED NOT NULL DEFAULT 0; diff --git a/sql/old/3.3.5a/2011_02_20_01_world_smart_scripts.sql b/sql/old/3.3.5a/2011_02_20_01_world_smart_scripts.sql new file mode 100644 index 0000000000000..236c66cdb1ece --- /dev/null +++ b/sql/old/3.3.5a/2011_02_20_01_world_smart_scripts.sql @@ -0,0 +1,24 @@ +ALTER TABLE `smart_scripts` CHANGE `entryorguid` `entryorguid` INT(11) NOT NULL; +ALTER TABLE `smart_scripts` MODIFY `source_type` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `smart_scripts` MODIFY `id` SMALLINT(5) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `smart_scripts` MODIFY `link` SMALLINT(5) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `smart_scripts` MODIFY `event_type` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `smart_scripts` MODIFY `event_phase_mask` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `smart_scripts` MODIFY `event_chance` TINYINT(3) UNSIGNED NOT NULL DEFAULT 100; +ALTER TABLE `smart_scripts` MODIFY `event_flags` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `smart_scripts` MODIFY `event_param1` INT(10) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `smart_scripts` MODIFY `event_param2` INT(10) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `smart_scripts` MODIFY `event_param3` INT(10) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `smart_scripts` MODIFY `event_param4` INT(10) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `smart_scripts` MODIFY `action_type` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `smart_scripts` MODIFY `action_param1` INT(10) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `smart_scripts` MODIFY `action_param2` INT(10) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `smart_scripts` MODIFY `action_param3` INT(10) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `smart_scripts` MODIFY `action_param4` INT(10) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `smart_scripts` MODIFY `action_param5` INT(10) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `smart_scripts` MODIFY `action_param6` INT(10) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `smart_scripts` MODIFY `target_type` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `smart_scripts` MODIFY `target_param1` INT(10) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `smart_scripts` MODIFY `target_param2` INT(10) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `smart_scripts` MODIFY `target_param3` INT(10) UNSIGNED NOT NULL DEFAULT 0; +ALTER TABLE `smart_scripts` MODIFY `comment` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'Event Comment'; diff --git a/sql/old/3.3.5a/2011_02_20_02_world_instance_icecrown_citadel.sql b/sql/old/3.3.5a/2011_02_20_02_world_instance_icecrown_citadel.sql new file mode 100644 index 0000000000000..b41ab10d6f555 --- /dev/null +++ b/sql/old/3.3.5a/2011_02_20_02_world_instance_icecrown_citadel.sql @@ -0,0 +1,61 @@ +SET @GUID := 137746; +DELETE FROM `creature` WHERE `guid` BETWEEN @GUID+30 AND @GUID+33; +DELETE FROM `linked_respawn` WHERE `linkedGuid` IN (@GUID+06,@GUID+07) AND `linkType`=0; +INSERT INTO `linked_respawn` (`guid`,`linkedGuid`,`linkType`) VALUES +(@GUID+00,@GUID+06,0), -- Valithria Dreamwalker +(@GUID+01,@GUID+06,0), -- Valithria Dreamwalker +(@GUID+02,@GUID+06,0), -- Risen Archmage +(@GUID+03,@GUID+06,0), -- Risen Archmage +(@GUID+04,@GUID+06,0), -- Risen Archmage +(@GUID+05,@GUID+06,0), -- Risen Archmage +(@GUID+06,@GUID+06,0), -- Green Dragon Combat Trigger +(@GUID+07,@GUID+07,0), -- Sister Svalna +(@GUID+08,@GUID+07,0), -- Ymirjar Frostbinder +(@GUID+09,@GUID+07,0), -- Ymirjar Frostbinder +(@GUID+10,@GUID+07,0), -- Ymirjar Battle-Maiden +(@GUID+11,@GUID+07,0), -- Ymirjar Battle-Maiden +(@GUID+12,@GUID+07,0), -- Ymirjar Battle-Maiden +(@GUID+13,@GUID+07,0), -- Ymirjar Battle-Maiden +(@GUID+14,@GUID+07,0), -- Ymirjar Battle-Maiden +(@GUID+15,@GUID+07,0), -- Ymirjar Battle-Maiden +(@GUID+16,@GUID+07,0), -- Ymirjar Battle-Maiden +(@GUID+17,@GUID+07,0), -- Ymirjar Battle-Maiden +(@GUID+18,@GUID+07,0), -- Ymirjar Warlord +(@GUID+19,@GUID+07,0), -- Ymirjar Warlord +(@GUID+20,@GUID+07,0), -- Ymirjar Warlord +(@GUID+21,@GUID+07,0), -- Ymirjar Warlord +(@GUID+22,@GUID+07,0), -- Ymirjar Huntress +(@GUID+23,@GUID+07,0), -- Ymirjar Huntress +(@GUID+24,@GUID+07,0), -- Ymirjar Huntress +(@GUID+25,@GUID+07,0), -- Ymirjar Huntress +(@GUID+26,@GUID+07,0), -- Ymirjar Huntress +(@GUID+27,@GUID+07,0), -- Ymirjar Huntress +(@GUID+28,@GUID+07,0), -- Ymirjar Deathbringer +(@GUID+29,@GUID+07,0), -- Ymirjar Deathbringer +(151761,@GUID+07,0), -- Captain Arnath +(151762,@GUID+07,0), -- Captain Brandon +(151763,@GUID+07,0), -- Captain Grondel +(151764,@GUID+07,0), -- Captain Rupert +(151767,@GUID+07,0); -- Crok Scourgebane + +SET @EQUIP := 2423; +DELETE FROM `creature_equip_template` WHERE `entry` BETWEEN @EQUIP AND @EQUIP+3; +INSERT INTO `creature_equip_template` (`entry`,`equipentry1`,`equipentry2`,`equipentry3`) VALUES +(@EQUIP+0,45128,0,0), +(@EQUIP+1,47519,0,0), +(@EQUIP+2,45075,0,0), +(@EQUIP+3,48025,0,47521); + +DELETE FROM `creature_template` WHERE `entry` IN (3712202,3712203,3712302,3712303,3712402,3712403,3712502,3712503,3712902,3712903); +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=37122; -- Captain Arnath +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=37123; -- Captain Brandon +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=37124; -- Captain Grondel +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=37125; -- Captain Rupert +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=37129; -- Crok Scourgebane + +UPDATE `creature_template` SET `baseattacktime`=1500,`equipment_id`=@EQUIP+0 WHERE `entry` IN (37122,38298); -- Captain Arnath +UPDATE `creature_template` SET `baseattacktime`=1500,`equipment_id`=@EQUIP+1 WHERE `entry` IN (37123,38299); -- Captain Brandon +UPDATE `creature_template` SET `baseattacktime`=1500,`equipment_id`=@EQUIP+2 WHERE `entry` IN (37124,38303); -- Captain Grondel +UPDATE `creature_template` SET `baseattacktime`=1500,`equipment_id`=@EQUIP+3 WHERE `entry` IN (37125,38304); -- Captain Rupert +UPDATE `creature_template` SET `baseattacktime`=2000,`equipment_id`=2050 WHERE `entry` IN (37129,38000); -- Crok Scourgebane +UPDATE `creature_template` SET `flags_extra`=`flags_extra`|128 WHERE `entry`=38752; -- Green Dragon Combat Trigger diff --git a/sql/old/3.3.5a/2011_02_22_00_world_scriptname.sql b/sql/old/3.3.5a/2011_02_22_00_world_scriptname.sql new file mode 100644 index 0000000000000..0199d796ece05 --- /dev/null +++ b/sql/old/3.3.5a/2011_02_22_00_world_scriptname.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName`='' WHERE `entry` IN(32933,32934); \ No newline at end of file diff --git a/sql/old/3.3.5a/2011_02_22_01_world_spell_script_names.sql b/sql/old/3.3.5a/2011_02_22_01_world_spell_script_names.sql new file mode 100644 index 0000000000000..d0b20794f962f --- /dev/null +++ b/sql/old/3.3.5a/2011_02_22_01_world_spell_script_names.sql @@ -0,0 +1,8 @@ +DELETE FROM `spell_script_names` WHERE `spell_id` IN(63633,65594,62056,63985,64224,64225); +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(63633,'spell_ulduar_rubble_summon'), +(65594,'spell_ulduar_cancel_stone_grip'), +(62056,'spell_ulduar_stone_grip'), +(63985,'spell_ulduar_stone_grip'), +(64224,'spell_ulduar_stone_grip_absorb'), +(64225,'spell_ulduar_stone_grip_absorb'); diff --git a/sql/old/3.3.5a/2011_02_22_02_world_conditions.sql b/sql/old/3.3.5a/2011_02_22_02_world_conditions.sql new file mode 100644 index 0000000000000..93328d671cc61 --- /dev/null +++ b/sql/old/3.3.5a/2011_02_22_02_world_conditions.sql @@ -0,0 +1,3 @@ +DELETE FROM `conditions` WHERE `SourceEntry`=65594 AND `ConditionTypeOrReference`=18; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`Comment`) VALUES +(13,0,65594,18,1,0,'Cancel Stone Grip Target'); \ No newline at end of file diff --git a/sql/old/3.3.5a/2011_02_22_03_world_creature_template.sql b/sql/old/3.3.5a/2011_02_22_03_world_creature_template.sql new file mode 100644 index 0000000000000..38064813aa1a9 --- /dev/null +++ b/sql/old/3.3.5a/2011_02_22_03_world_creature_template.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `flags_extra`= `flags_extra`&~1 WHERE `entry` IN(32933,32934); diff --git a/sql/old/3.3.5a/2011_02_22_04_world_vehicle_accessory.sql b/sql/old/3.3.5a/2011_02_22_04_world_vehicle_accessory.sql new file mode 100644 index 0000000000000..3d23f85c76aab --- /dev/null +++ b/sql/old/3.3.5a/2011_02_22_04_world_vehicle_accessory.sql @@ -0,0 +1,3 @@ +ALTER TABLE `vehicle_accessory` +ADD `summontype` TINYINT(3) UNSIGNED NOT NULL DEFAULT 6 COMMENT "see enum TempSummonType", +ADD `summontimer` INT(10) UNSIGNED NOT NULL DEFAULT 30000 COMMENT "timer, only relevant for certain summontypes"; diff --git a/sql/old/3.3.5a/2011_02_23_01_world_creature_template.sql b/sql/old/3.3.5a/2011_02_23_01_world_creature_template.sql new file mode 100644 index 0000000000000..95e366cc9623e --- /dev/null +++ b/sql/old/3.3.5a/2011_02_23_01_world_creature_template.sql @@ -0,0 +1,5 @@ +-- Correct run speed, models, and trigger flag +UPDATE `creature_template` SET `speed_run`=5.5/7, `modelid1`=1126, `modelid2`=11686, `flags_extra`= `flags_extra`|128 WHERE `entry` IN(33632,33802); + +-- NullAI for semi-triggers (flags_extra|128 would make them unattackable by certain spells needed for the encounter) +UPDATE `creature_template` SET `AIName`='NullAI' WHERE `entry` IN(33742,33809,33942); \ No newline at end of file diff --git a/sql/old/3.3.5a/2011_02_23_02_world_conditions.sql b/sql/old/3.3.5a/2011_02_23_02_world_conditions.sql new file mode 100644 index 0000000000000..1819855eced3c --- /dev/null +++ b/sql/old/3.3.5a/2011_02_23_02_world_conditions.sql @@ -0,0 +1,8 @@ +DELETE FROM `conditions` WHERE `SourceEntry` IN(63676,63702,63629,63979,63766,63983) AND `ConditionTypeOrReference`=18; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`Comment`) VALUES +(13,0,63676,18,1,32930,'Focused Eyebeam Visual (Left) Target'), +(13,0,63702,18,1,32930,'Focused Eyebeam Visual (Right) Target'), +(13,0,63629,18,1,32930,'Arm Dead Damage Kologarn (10m) Target'), +(13,0,63979,18,1,32930,'Arm Dead Damage Kologarn (25m) Target'), +(13,0,63766,18,1,33661,'Arm Sweep (10m) Target'), +(13,0,63983,18,1,33661,'Arm Sweep (25m) Target'); diff --git a/sql/old/3.3.5a/2011_02_23_03_world_vehicle_accessory.sql b/sql/old/3.3.5a/2011_02_23_03_world_vehicle_accessory.sql new file mode 100644 index 0000000000000..5d56e0c4fab42 --- /dev/null +++ b/sql/old/3.3.5a/2011_02_23_03_world_vehicle_accessory.sql @@ -0,0 +1 @@ +UPDATE `vehicle_accessory` SET `summontype`=8, `summontimer`=0 WHERE `entry`=32930; diff --git a/sql/old/3.3.5a/2011_02_23_04_world_spell_script_names.sql b/sql/old/3.3.5a/2011_02_23_04_world_spell_script_names.sql new file mode 100644 index 0000000000000..2812c89024de8 --- /dev/null +++ b/sql/old/3.3.5a/2011_02_23_04_world_spell_script_names.sql @@ -0,0 +1,4 @@ +DELETE FROM `spell_script_names` WHERE `spell_id` IN(62166,63981); +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(62166, 'spell_ulduar_stone_grip_cast_target'), +(63981, 'spell_ulduar_stone_grip_cast_target'); diff --git a/sql/old/3.3.5a/2011_02_23_05_world_creature_template.sql b/sql/old/3.3.5a/2011_02_23_05_world_creature_template.sql new file mode 100644 index 0000000000000..8066d1da43891 --- /dev/null +++ b/sql/old/3.3.5a/2011_02_23_05_world_creature_template.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `AIName`='', `flags_extra`=`flags_extra`|2 WHERE `entry` IN(33742,33809,33942); diff --git a/sql/old/3.3.5a/2011_02_23_06_world_creatures.sql b/sql/old/3.3.5a/2011_02_23_06_world_creatures.sql new file mode 100644 index 0000000000000..16a9947afe66b --- /dev/null +++ b/sql/old/3.3.5a/2011_02_23_06_world_creatures.sql @@ -0,0 +1,40 @@ +-- Fixup Enslaved Netherwing drake in Shadowmoon Valley +UPDATE `creature` SET `spawndist`=0,`MovementType`=0 WHERE `id`=21722; +UPDATE `creature_template` SET `InhabitType`=1 WHERE `entry`=21722; + +-- Fixup Dragonmaw Drake-Riders in Shadowmoon Valley +UPDATE `creature` SET `position_x`=-4155.54932,`position_y`=386.6152,`position_z`=141.4012,`orientation`=1.20427716 WHERE `guid`=75786; +UPDATE `creature` SET `spawndist`=0,`MovementType`=0 WHERE `id`=21719; +UPDATE `creature_template` SET `InhabitType`=1 WHERE `entry`=21719; + +-- fix walk speed for several npc's +UPDATE `creature_template` SET `speed_walk`=1 WHERE `entry` IN +(19449, -- Thunderlord Grunt +17855); -- Expedition Warden + +-- Inquisitor Salrand shouldn't have random movement & fix inhabit type +UPDATE `creature` SET `spawndist`=0,`MovementType`=0 WHERE `id`=25584; +UPDATE `creature_template` SET `InhabitType`=7 WHERE `entry`=25584; +-- Beryl Point InvisMan shouldn't have random movement, set as a trigger & fix inhabit type +UPDATE `creature` SET `modelid`=0,`spawndist`=0,`MovementType`=0 WHERE `id`=25594; +UPDATE `creature_template` SET `flags_extra`=`flags_extra`|128,`InhabitType`=7 WHERE `entry`=25594; + +-- Surristrasz proper state +DELETE FROM `creature_template_addon` WHERE `entry`=24795; +INSERT INTO `creature_template_addon` (`entry`,`bytes1`) VALUES (24795,3); + +-- Grand Magus Telestra shouldn't have random movement +UPDATE `creature` SET `spawndist`=0,`MovementType`=0 WHERE `id`=26832; +UPDATE `creature_template` SET `InhabitType`=7 WHERE `entry`=26832; + +-- Remove spawned Savannah Cubs +-- Savannah Cubs are spawned in EAI +DELETE FROM `creature_addon` WHERE `guid` IN (SELECT `guid` FROM `creature` WHERE `id`=5766); +DELETE FROM `creature` WHERE `id`=5766; + +-- Set ELM General Purpose Bunny (scale x0.01) as a trigger +UPDATE `creature` SET `modelid`=0 WHERE `id`=24021; +UPDATE `creature_template` SET `flags_extra`=`flags_extra`|128 WHERE `entry`=24021; +-- Set ELM General Purpose Bunny (scale x0.01) Large as a trigger +UPDATE `creature` SET `modelid`=0 WHERE `id`=26298; +UPDATE `creature_template` SET `flags_extra`=`flags_extra`|128 WHERE `entry`=26298; diff --git a/sql/old/3.3.5a/2011_02_23_07_world_misc.sql b/sql/old/3.3.5a/2011_02_23_07_world_misc.sql new file mode 100644 index 0000000000000..a2ca5207b334e --- /dev/null +++ b/sql/old/3.3.5a/2011_02_23_07_world_misc.sql @@ -0,0 +1,76 @@ +-- SAI for Neltharaku +SET @ENTRY := 21657; +UPDATE `creature_template` SET `speed_run`=2.5,`ScriptName`='',`AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,1,62,0,100,0,8396,0,0,0,26,10814,0,1,0,0,0,7,0,0,0,0,0,0,0,'Neltharaku - On Gossip option - Quest credit'), +(@ENTRY,0,1,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Neltharaku - On Gossip option - Close gossip'); +-- Waypoints for Neltharaku from sniff +SET @NPC := 75654; +SET @PATH := @NPC*10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=-4147.188,`position_y`=852.9213,`position_z`=112.449 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +DELETE FROM `creature_template_addon` WHERE `entry`=@ENTRY; +INSERT INTO `creature_template_addon` (`entry`,`path_id`,`bytes2`) VALUES (@ENTRY,@PATH,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,-4149.083,816.8467,102.0771,0,0,0,100,0), +(@PATH,2,-4148.741,817.7864,102.0771,0,0,0,100,0), +(@PATH,3,-4150.894,819.7193,112.4489,0,0,0,100,0), +(@PATH,4,-4147.188,852.9213,112.449,0,0,0,100,0), +(@PATH,5,-4126.215,897.6987,112.449,0,0,0,100,0), +(@PATH,6,-4113.534,926.0124,112.449,0,0,0,100,0), +(@PATH,7,-4098.13,963.6712,112.449,0,0,0,100,0), +(@PATH,8,-4063.067,1046.515,112.449,0,0,0,100,0), +(@PATH,9,-4008.534,1081.363,112.449,0,0,0,100,0), +(@PATH,10,-3926.171,1057.316,112.449,0,0,0,100,0), +(@PATH,11,-3914.31,958.3683,114.7823,0,0,0,100,0), +(@PATH,12,-3930.769,894.2169,114.2545,0,0,0,100,0), +(@PATH,13,-3991.642,763.9112,112.449,0,0,0,100,0), +(@PATH,14,-4060.605,579.9987,112.449,0,0,0,100,0), +(@PATH,15,-4085.638,468.8222,173.4489,0,0,0,100,0), +(@PATH,16,-4097.893,416.0321,177.8378,0,0,0,100,0), +(@PATH,17,-4110.39,374.4871,174.2545,0,0,0,100,0), +(@PATH,18,-4135.225,331.1968,174.7545,0,0,0,100,0), +(@PATH,19,-4203.078,269.2113,172.4767,0,0,0,100,0), +(@PATH,20,-4239.532,280.7727,169.0878,0,0,0,100,0), +(@PATH,21,-4278.137,304.6405,169.1989,0,0,0,100,0), +(@PATH,22,-4295.682,340.7838,173.9212,0,0,0,100,0), +(@PATH,23,-4297.044,383.0331,169.0878,0,0,0,100,0), +(@PATH,24,-4267.532,404.9037,169.0878,0,0,0,100,0), +(@PATH,25,-4225.749,416.8825,169.0878,0,0,0,100,0), +(@PATH,26,-4193.994,418.2155,169.0878,0,0,0,100,0), +(@PATH,27,-4176.15,444.5788,158.2545,0,0,0,100,0), +(@PATH,28,-4163.389,480.9925,149.6712,0,0,0,100,0), +(@PATH,29,-4157.379,548.4786,145.2823,0,0,0,100,0), +(@PATH,30,-4178.163,628.6951,101.0601,0,0,0,100,0), +(@PATH,31,-4182.795,656.5566,97.31005,0,0,0,100,0), +(@PATH,32,-4184.389,678.5916,98.50452,0,0,0,100,0), +(@PATH,33,-4182.358,726.181,102.5323,0,0,0,100,0), +(@PATH,34,-4175.015,753.1885,103.2545,0,0,0,100,0), +(@PATH,35,-4160.292,781.7564,107.8656,0,0,0,100,0), +(@PATH,36,-4150.894,819.7193,112.4489,0,0,0,100,0), +(@PATH,37,-4147.188,852.9213,112.449,0,0,0,100,0); + +-- Gossip Menu insert from sniff +DELETE FROM `gossip_menu` WHERE `entry`=8394 AND `text_id`=10614; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (8394,10614); +DELETE FROM `gossip_menu` WHERE `entry`=8395 AND `text_id`=10615; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (8395,10615); +DELETE FROM `gossip_menu` WHERE `entry`=8396 AND `text_id`=10616; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (8396,10616); +-- Creature Gossip_menu_id Update from sniff +UPDATE `creature_template` SET `gossip_menu_id`=6944 WHERE `entry`=19352; +UPDATE `creature_template` SET `gossip_menu_id`=9563 WHERE `entry`=27575; +-- Creature Gossip_menu_option Update from sniff +DELETE FROM `gossip_menu_option` WHERE `id`=0 AND `menu_id` IN (8013,8397,8394,8395,8396); +INSERT INTO `gossip_menu_option` (`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`) VALUES +(8013,0,0, 'I see.',1,1,8014,0,0,0,0, ''), +(8397,0,0, 'I am listening, dragon.',1,1,8394,0,0,0,0, ''), +(8394,0,0, 'But you are dragons! How could orcs do this to you?',1,1,8395,0,0,0,0, ''), +(8395,0,0, 'Your mate?',1,1,8396,0,0,0,0, ''), +(8396,0,0, 'I have battled many beasts, dragon. I will help you.',1,1,0,0,0,0,0, ''); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=8397; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(15,8397,0,0,9,10814,0,0,0,'','Show gossip option 0 if player has quest 10814'); diff --git a/sql/old/3.3.5a/2011_02_23_07_world_scriptname.sql b/sql/old/3.3.5a/2011_02_23_07_world_scriptname.sql new file mode 100644 index 0000000000000..87b90aaf5dd9c --- /dev/null +++ b/sql/old/3.3.5a/2011_02_23_07_world_scriptname.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName`='' WHERE `entry`=21657; -- Neltharaku diff --git a/sql/old/3.3.5a/2011_02_23_08_world_sai.sql b/sql/old/3.3.5a/2011_02_23_08_world_sai.sql new file mode 100644 index 0000000000000..3633d2b334c5e --- /dev/null +++ b/sql/old/3.3.5a/2011_02_23_08_world_sai.sql @@ -0,0 +1,106 @@ + /* Quest/Barrens Horde - Counterattack! */ +SET @Counterattack = 4021; + +-- Vars +SET @Gossip = 21253; +-- NPCs +SET @Deathgate = 3389; -- Regthar Deathgate (quest giver) +SET @Kromzar = 9456; -- Warlord Krom'zar (abilities: 11976 Strike) +SET @Stormseer = 9523; -- Kolkar Stormseer (abilities: 9532 Lighting Bolt; 6535 Lightning Cloud) +SET @Invader = 9524; -- Kolkar Invader (abilities: 8014 Tetatuns, 11976 Strike, 6268 Rushing Charge) +SET @Thrower = 9458; -- Horde Axe Thrower +SET @Defender = 9457; -- Horde Defender (abilities: 10277 Throw) +-- Spells +SET @CreateBanner = 13965; -- Create Krom'zar's Banner + +DELETE FROM `gossip_menu` WHERE `entry` IN (@Gossip,@Gossip+1); +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES +(@Gossip+0,2533), +(@Gossip+1,2534); + +DELETE FROM `gossip_menu_option` WHERE `menu_id`=@Gossip AND `id`=0; +INSERT INTO `gossip_menu_option` (`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`) VALUES +(@Gossip,0,0, 'Where is Warlord Krom''zar?',1,1,@Gossip+1,0,0,0,0,NULL); + +DELETE FROM `creature_text` WHERE `entry` IN (@Deathgate,@Invader,@Thrower,@Kromzar); +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@Deathgate,0,0,'Beware, $N! Look to the west!',0,0,100,1,0,0,'Regthar Deathgate: quest start'), +(@Deathgate,1,0,'A defender has fallen!',0,0,100,1,0,0,'Regthar Deathgate: Horde Defender death'), +(@Invader,0,0,'Kolkar Invader charges!',2,0,100,0,0,0,'Kolkar Invader: aggro'), +(@Thrower,0,0,'Defend the bunkers!',0,0,100,0,0,0,'Kolkar Axe Thrower'), +(@Thrower,0,1,'Our foes will fail!',0,0,100,0,0,0,'Kolkar Axe Thrower'), +(@Thrower,0,2,'For the Horde',0,0,100,0,0,0,'Kolkar Axe Thrower'), +(@Kromzar,0,0,'The Kolkar are the strongest!',1,0,100,0,0,0,'Warlord Krom''zar: spawn'); + +UPDATE `creature_template` SET `AIName`='SmartAI', `MovementType`=1 WHERE `entry` IN (@Kromzar,@Invader,@Stormseer,@Thrower,@Defender); +UPDATE `creature_template` SET `AIName`='SmartAI', `gossip_menu_id`=@Gossip WHERE `entry`=@Deathgate; + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=@Gossip; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`Comment`) VALUES +(15,@Gossip,0,0,9,@Counterattack,0,0,0, 'Regthar Deathgate: Counterattack!: gossip: has quest'), +(15,@Gossip,0,0,26,11227,0,0,0, 'Regthar Deathgate: Counterattack!: gossip: does not have item Piece Banner'); + +DELETE FROM `smart_scripts` WHERE (`entryorguid`=@Kromzar AND `source_type`=0); +DELETE FROM `smart_scripts` WHERE (`entryorguid`=@Deathgate AND `source_type`=0); +DELETE FROM `smart_scripts` WHERE (`entryorguid`=@Invader AND `source_type`=0); +DELETE FROM `smart_scripts` WHERE (`entryorguid`=@Stormseer AND `source_type`=0); +DELETE FROM `smart_scripts` WHERE (`entryorguid`=@Thrower AND `source_type`=0); +DELETE FROM `smart_scripts` WHERE (`entryorguid`=@Deathgate*100 AND `source_type`=9); +DELETE FROM `smart_scripts` WHERE (`entryorguid`=@Defender AND `source_type`=0); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@Kromzar,0,0,0,0,0,100,0,0,1000,4000,6000,11,11976,0,0,0,0,0,2,0,0,0,0,0,0,0,'Warlord Krom''Zar: In combat cast Strike every 4 to 6 seconds'), +(@Kromzar,0,1,0,6,0,100,1,0,1000,5000,8000,11,@CreateBanner,2,0,0,0,0,0,0,0,0,0,0,0,0,'Warlord Krom''Zar: On death cast Create Krom''zar''s Banner'), +(@Kromzar,0,4,0,11,0,100,0,0,0,0,0,89,5,0,0,0,0,0,1,0,0,0,0,0,0,0,'Warlord Krom''Zar: On spawn set random movement'), +(@Kromzar,0,5,0,11,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Warlord Krom''Zar: On spawn say text 0'), +(@Invader,0,0,0,4,0,100,0,0,0,0,0,11,6268,0,0,0,0,0,2,0,0,0,0,0,0,0,'Kolkar Invader: On aggro cast Rushing Charge'), +(@Invader,0,1,0,4,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Kolkar Invader: On aggro say text 0'), +(@Invader,0,2,0,0,0,100,0,0,1000,4000,6000,11,11976,0,0,0,0,0,2,0,0,0,0,0,0,0,'Kolkar Invader: In combat cast Strike every 4 to 6 seconds'), +(@Invader,0,3,0,0,0,100,0,1000,2000,20000,20000,11,8014,0,0,0,0,0,2,0,0,0,0,0,0,0,'Kolkar Invader: In combat cast Tetanus every 20 seconds'), +(@Invader,0,4,0,11,0,100,0,0,0,0,0,89,5,0,0,0,0,0,1,0,0,0,0,0,0,0,'Kolkar Invader: On spawn set random movement'), +(@Stormseer,0,0,0,11,0,100,0,0,0,0,0,58,1,9532,3500,6000,30,15,1,0,0,0,0,0,0,0,'Kolkar Stormseer: On respawn install AI template caster for Lighting Bolt'), +(@Stormseer,0,1,0,0,0,100,0,3000,4000,10000,10000,11,6535,1,0,0,0,0,2,0,0,0,0,0,0,0,'Kolkar Stormseer: In combat cast Lightning Cloud every 10 seconds'), +(@Stormseer,0,2,0,11,0,100,0,0,0,0,0,89,5,0,0,0,0,0,1,0,0,0,0,0,0,0,'Kolkar Stormseer: On spawn set random movement'), +(@Thrower,0,0,0,11,0,100,0,0,0,0,0,58,2,10277,35,0,0,0,1,0,0,0,0,0,0,0,'Horde Axe Thrower: On respawn install AI template turret for Throw'), +(@Thrower,0,1,0,6,0,100,0,0,0,0,0,12,@Thrower,1,450000,0,0,0,8,0,0,0,-293.212,-1912.51,91.6673,1.42794,'Horde Axe Thrower: On death summon Horde Axe Thrower'), +(@Thrower,0,2,0,11,0,100,0,0,0,0,0,89,5,0,0,0,0,0,1,0,0,0,0,0,0,0,'Horde Axe Thower: On spawn set random movement'), +(@Thrower,0,3,0,60,0,100,0,20000,25000,30000,40000,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Horde Axe Thower: Say text 0 every 30 to 40 seconds'), +(@Defender,0,0,0,6,0,100,0,0,0,0,0,1,1,0,0,0,0,0,9,@Deathgate,0,300,0,0,0,0,'Horde Axe Thrower: On death Regthar Deathgate say text 1'), +(@Defender,0,1,0,6,0,100,0,0,0,0,0,12,@Defender,1,450000,0,0,0,8,0,0,0,-280.703,-1908.01,91.6668,1.77351,'Horde Defender: On death summon Horde Defender'), +(@Defender,0,2,0,11,0,100,0,0,0,0,0,89,5,0,0,0,0,0,1,0,0,0,0,0,0,0,'Horde Defender: On spawn set random movement'), +(@Deathgate,0,0,0,11,0,100,0,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Regthar Deathgate: On respawn set phase 1 (p0)'), +(@Deathgate,0,1,0,19,1,100,0,@Counterattack,0,0,0,1,0,0,0,0,0,0,18,15,0,0,0,0,0,0,'Regthar Deathgate: On quest accept say text 0 (p1)'), +(@Deathgate,0,2,0,19,1,100,0,@Counterattack,0,0,0,22,2,0,0,0,0,0,0,0,0,0,0,0,0,0,'Regthar Deathgate: On quest accept set event phase 2 (p1)'), +(@Deathgate,0,3,0,19,2,100,0,@Counterattack,0,0,0,80,@Deathgate*100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Regthar Deathgate: On quest accept call main script (p2)'), +(@Deathgate,0,4,0,62,1,100,0,@Gossip,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'Regthar Deathgate: On gossip select say text 0 (p1)'), +(@Deathgate,0,5,0,62,4,100,0,@Gossip,0,0,0,80,@Deathgate*100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Regthar Deathgate: On gossip select call main script (p4)'), +(@Deathgate*100,9,0,0,0,0,100,0,0,0,0,0,12,@Defender,1,450000,0,0,0,8,0,0,0,-280.703,-1908.01,91.6668,1.77351,'Counterattack!: Summon Horde Axe Thrower 1'), +(@Deathgate*100,9,1,0,0,0,100,0,0,0,0,0,12,@Defender,1,450000,0,0,0,8,0,0,0,-286.384,-1910.99,91.6668,1.59444,'Counterattack!: Summon Horde Defender 2'), +(@Deathgate*100,9,2,0,0,0,100,0,0,0,0,0,12,@Defender,1,450000,0,0,0,8,0,0,0,-297.373,-1917.11,91.6746,1.81435,'Counterattack!: Summon Horde Defender 3'), +(@Deathgate*100,9,3,0,0,0,100,0,0,0,0,0,12,@Thrower,1,450000,0,0,0,8,0,0,0,-293.212,-1912.51,91.6673,1.42794,'Counterattack!: Summon Horde Axe Thrower 1'), +(@Deathgate*100,9,4,0,0,0,100,0,0,0,0,0,12,@Invader,1,450000,0,0,0,8,0,0,0,-280.037,-1888.35,92.2549,2.28087,'Counterattack!: Summon Kolkar Invader'), +(@Deathgate*100,9,5,0,0,0,100,0,0,0,0,0,12,@Invader,1,450000,0,0,0,8,0,0,0,-292.107,-1899.54,91.667,4.78158,'Counterattack!: Summon Kolkar Invader'), +(@Deathgate*100,9,6,0,0,0,100,0,0,0,0,0,12,@Invader,1,450000,0,0,0,8,0,0,0,-305.57,-1869.88,92.7754,2.45131,'Counterattack!: Summon Kolkar Invader'), +(@Deathgate*100,9,7,0,0,0,100,0,0,0,0,0,12,@Invader,1,450000,0,0,0,8,0,0,0,-289.972,-1882.76,92.5714,3.43148,'Counterattack!: Summon Kolkar Invader'), +(@Deathgate*100,9,8,0,0,0,100,0,0,0,0,0,12,@Invader,1,450000,0,0,0,8,0,0,0,-277.454,-1873.39,92.7773,4.75724,'Counterattack!: Summon Kolkar Invader'), +(@Deathgate*100,9,9,0,0,0,100,0,0,0,0,0,12,@Invader,1,450000,0,0,0,8,0,0,0,-271.581,-1847.51,93.4329,4.39124,'Counterattack!: Summon Kolkar Invader'), +(@Deathgate*100,9,10,0,0,0,100,0,0,0,0,0,12,@Invader,1,450000,0,0,0,8,0,0,0,-269.982,-1828.6,92.4754,4.68655,'Counterattack!: Summon Kolkar Invader'), +(@Deathgate*100,9,11,0,0,0,100,0,0,0,0,0,12,@Stormseer,1,450000,0,0,0,8,0,0,0,-279.267,-1827.92,92.3128,1.35332,'Counterattack!: Summon Kolkar Stormseer'), +(@Deathgate*100,9,12,0,0,0,100,0,0,0,0,0,12,@Stormseer,1,450000,0,0,0,8,0,0,0,-297.42,-1847.41,93.2295,5.80967,'Counterattack!: Summon Kolkar Stormseer'), +(@Deathgate*100,9,13,0,0,0,100,0,0,0,0,0,12,@Stormseer,1,450000,0,0,0,8,0,0,0,-310.607,-1831.89,95.9363,0.371571,'Counterattack!: Summon Kolkar Stormseer'), +(@Deathgate*100,9,14,0,0,0,100,0,0,0,0,0,12,@Stormseer,1,450000,0,0,0,8,0,0,0,-329.177,-1842.43,95.3891,0.516085,'Counterattack!: Summon Kolkar Stormseer'), +(@Deathgate*100,9,15,0,0,0,100,0,0,0,0,0,12,@Stormseer,1,450000,0,0,0,8,0,0,0,-324.448,-1860.63,94.3221,4.97793,'Counterattack!: Summon Kolkar Stormseer'), +(@Deathgate*100,9,16,0,0,0,100,0,20000,30000,0,0,12,@Invader,1,250000,0,0,0,8,0,0,0,-290.588,-1858,92.5026,4.14698,'Counterattack!: Summon Kolkar Invader'), +(@Deathgate*100,9,17,0,0,0,100,0,20000,30000,0,0,12,@Stormseer,1,250000,0,0,0,8,0,0,0,-286.103,-1846.18,92.544,6.11047,'Counterattack!: Summon Kolkar Stormseer'), +(@Deathgate*100,9,18,0,0,0,100,0,20000,30000,0,0,12,@Invader,1,250000,0,0,0,8,0,0,0,-304.978,-1844.7,94.4432,1.61721,'Counterattack!: Summon Kolkar Invader'), +(@Deathgate*100,9,19,0,0,0,100,0,20000,30000,0,0,12,@Stormseer,1,250000,0,0,0,8,0,0,0,-308.105,-1859.08,93.8039,2.80709,'Counterattack!: Summon Kolkar Stormseer'), +(@Deathgate*100,9,20,0,0,0,100,0,20000,30000,0,0,12,@Invader,1,250000,0,0,0,8,0,0,0,-297.089,-1867.68,92.5601,2.21804,'Counterattack!: Summon Kolkar Invader'), +(@Deathgate*100,9,21,0,0,0,100,0,20000,30000,0,0,12,@Stormseer,1,250000,0,0,0,8,0,0,0,-286.988,-1876.47,92.7447,1.39494,'Counterattack!: Summon Kolkar Stormseer'), +(@Deathgate*100,9,22,0,0,0,100,0,20000,30000,0,0,12,@Invader,1,250000,0,0,0,8,0,0,0,-291.86,-1893.04,92.0213,1.96121,'Counterattack!: Summon Kolkar Invader'), +(@Deathgate*100,9,23,0,0,0,100,0,20000,30000,0,0,12,@Invader,1,250000,0,0,0,8,0,0,0,-298.297,-1846.85,93.3672,4.97792,'Counterattack!: Summon Kolkar Invader'), +(@Deathgate*100,9,24,0,0,0,100,0,0,0,0,0,12,@Invader,1,250000,0,0,0,8,0,0,0,-294.942,-1845.88,93.0999,4.86797,'Counterattack!: Summon Kolkar Invader'), +(@Deathgate*100,9,25,0,0,0,100,0,0,0,0,0,12,@Kromzar,1,250000,0,0,0,8,0,0,0,-296.718,-1846.38,93.2334,5.02897,'Counterattack!: Summon Warlord Kromzar'), +(@Deathgate*100,9,26,0,0,0,100,0,20000,20000,0,0,22,4,1,450000,0,0,0,1,0,0,0,0,0,0,0,'Regthar Deathgate: set phase 4'), -- if player does not finish this quest this time s/he can come back later' +(@Deathgate*100,9,27,0,0,0,100,0,2*3600*1000,2*3600*1000,0,0,22,1,1,450000,0,0,0,1,0,0,0,0,0,0,0,'Regthar Deathgate: set phase 1'), -- after 2 hours reset everything (event start on quest accept)' +(@Deathgate,0,7,0,20,10,100,0,@Counterattack,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Regthar Deathgate: On quest reward set phase 1'); + +DELETE FROM `creature_ai_scripts` WHERE `creature_id` IN (@Deathgate,@Kromzar,@Stormseer,@Invader,@Thrower,@Defender ); -- 16 EAI scripts diff --git a/sql/old/3.3.5a/2011_02_23_09_world_spell_linked_spell.sql b/sql/old/3.3.5a/2011_02_23_09_world_spell_linked_spell.sql new file mode 100644 index 0000000000000..8a636b3b58908 --- /dev/null +++ b/sql/old/3.3.5a/2011_02_23_09_world_spell_linked_spell.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_linked_spell` WHERE `spell_trigger` = 55814 AND `spell_effect` = 55817 ; +INSERT INTO `spell_linked_spell` (`spell_trigger`,`spell_effect`,`type`,`comment`) VALUES +(55814, 55817, 1, 'Eck Residue'); diff --git a/sql/old/3.3.5a/2011_02_24_00_characters_account_data.sql b/sql/old/3.3.5a/2011_02_24_00_characters_account_data.sql new file mode 100644 index 0000000000000..b4a8ed25e8d25 --- /dev/null +++ b/sql/old/3.3.5a/2011_02_24_00_characters_account_data.sql @@ -0,0 +1 @@ +ALTER TABLE `account_data` CHANGE COLUMN `account` `accountId` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Account Identifier'; diff --git a/sql/old/3.3.5a/2011_02_24_01_characters_character_tutorial.sql b/sql/old/3.3.5a/2011_02_24_01_characters_character_tutorial.sql new file mode 100644 index 0000000000000..b5e3594f5b05f --- /dev/null +++ b/sql/old/3.3.5a/2011_02_24_01_characters_character_tutorial.sql @@ -0,0 +1,2 @@ +RENAME TABLE `character_tutorial` TO `account_tutorial`; +ALTER TABLE `account_tutorial` CHANGE COLUMN `account` `accountId` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Account Identifier'; diff --git a/sql/old/3.3.5a/2011_02_25_00_world_creatures.sql b/sql/old/3.3.5a/2011_02_25_00_world_creatures.sql new file mode 100644 index 0000000000000..d2e49048865dd --- /dev/null +++ b/sql/old/3.3.5a/2011_02_25_00_world_creatures.sql @@ -0,0 +1,8 @@ +-- Correct bounding radius and combat reach for Right Arm and Left Arm +UPDATE `creature_model_info` SET `bounding_radius`=0.31, `combat_reach`=25 WHERE `modelid` IN(28821,28822); + +-- Remove static spawns that are spawned by the encounter script and vehicle_accessory table +DELETE FROM `creature` WHERE `id` IN(32933,32934); + +-- Update spawn data +UPDATE `creature` SET `unit_flags`=33554432, `deathstate`= 1, `MovementType`=0 WHERE `id`=34297; diff --git a/sql/old/3.3.5a/2011_02_25_01_world_spell_script_names.sql b/sql/old/3.3.5a/2011_02_25_01_world_spell_script_names.sql new file mode 100644 index 0000000000000..ae57aad0e93f0 --- /dev/null +++ b/sql/old/3.3.5a/2011_02_25_01_world_spell_script_names.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_script_names` WHERE `spell_id`=64702; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(64702, 'spell_ulduar_squeezed_lifeless'); diff --git a/sql/old/3.3.5a/2011_02_25_02_world_spell_proc_event.sql b/sql/old/3.3.5a/2011_02_25_02_world_spell_proc_event.sql new file mode 100644 index 0000000000000..aad58f50e306d --- /dev/null +++ b/sql/old/3.3.5a/2011_02_25_02_world_spell_proc_event.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_proc_event` WHERE entry = 54646; +INSERT INTO `spell_proc_event` (`entry`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `procFlags`, `procEx`, `ppmRate`, `CustomChance`, `Cooldown`) VALUES +(54646, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0); diff --git a/sql/old/3.3.5a/2011_02_26_00_world_sai.sql b/sql/old/3.3.5a/2011_02_26_00_world_sai.sql new file mode 100644 index 0000000000000..5aa62b4d2c692 --- /dev/null +++ b/sql/old/3.3.5a/2011_02_26_00_world_sai.sql @@ -0,0 +1,35 @@ +-- SAI for Gor'drek +-- This will remove 2 waypoint scripts that were spamming errors +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=21117; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=21117; +DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid` IN (2111700,2111701); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +-- AI +(21117,0,0,0,23,0,100,0,12550,0,2000,2000,11,12550,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Gor''drek - Add Lightning Shield Aura'), +(21117,0,1,0,11,0,100,0,0,0,0,0,53,0,21117,1,0,0,0,1,0,0,0,0,0,0,0, 'Gor''drek - Start WP movement'), +(21117,0,2,0,40,0,100,0,2,21117,0,0,80,2111700,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Gor''drek - Load script at WP 2'), +(21117,0,3,0,40,0,100,0,4,21117,0,0,80,2111701,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Gor''drek - Load script at WP 4'), +-- Script 1 +(2111700,9,0,0,0,0,100,0,0,0,0,0,54,128000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Gor''drek - Pause at WP 2'), +(2111700,9,1,0,0,0,100,0,1000,1000,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,5.654867, 'Gor''drek - Turn to 5.654867'), +(2111700,9,2,0,0,0,100,0,2000,2000,0,0,11,28892,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Gor''drek - Cast 42837'), +(2111700,9,3,0,0,0,100,0,120000,120000,0,0,92,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Gor''drek - Stop Casting 42837'), +-- Script 2 +(2111701,9,0,0,0,0,100,0,0,0,0,0,54,128000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Gor''drek - Pause at WP 2'), +(2111701,9,1,0,0,0,100,0,1000,1000,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,4.677482, 'Gor''drek - Turn to 4.677482'), +(2111701,9,2,0,0,0,100,0,2000,2000,0,0,11,28892,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Gor''drek - Cast 42837'), +(2111701,9,3,0,0,0,100,0,120000,120000,0,0,92,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Gor''drek - Stop Casting 42837'); +-- Update position and remove path for Gor'drek +UPDATE `creature` SET `position_x`=2313.006,`position_y`=6004.879,`position_z`=142.8264,`orientation`=4.677482,`MovementType`=0 WHERE `guid`=74168; +UPDATE `creature_addon` SET `path_id`=0 WHERE `guid`=74168; +DELETE FROM `waypoint_data` WHERE `id`=741680; +DELETE FROM `waypoint_scripts` WHERE `id` IN (224,225); +-- Remove EAI +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=21117; +-- Proper waypoints for Gor'drek from sniff +DELETE FROM `waypoints` WHERE `entry`=21117; +INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES +(21117,1,2319.757,6007.015,142.7014,'Gor''drek WP 1'), +(21117,2,2325.909,6010.899,142.5764,'Gor''drek WP 2'), +(21117,3,2319.757,6007.015,142.7014,'Gor''drek WP 3'), +(21117,4,2313.006,6004.879,142.8264,'Gor''drek WP 4'); diff --git a/sql/old/3.3.5a/2011_02_26_01_world_sai.sql b/sql/old/3.3.5a/2011_02_26_01_world_sai.sql new file mode 100644 index 0000000000000..6735f217dd169 --- /dev/null +++ b/sql/old/3.3.5a/2011_02_26_01_world_sai.sql @@ -0,0 +1,9 @@ +SET @Fairmount = 3393; -- Captain Fairmount +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@Fairmount; -- three scripts +DELETE FROM `smart_scripts` WHERE (`entryorguid`=@Fairmount AND `source_type`=0); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@Fairmount,0,0,0,4,0,100,0,0,0,0,0,11,9128,0,0,0,0,0,1,0,0,0,0,0,0,0,'Captain Fairmount: On aggro cast Battle Shout self'), +(@Fairmount,0,1,0,2,0,100,1,0,30,0,0,11,19134,0,0,0,0,0,2,0,0,0,0,0,0,0,'Captain Fairmount: At 30% hp cast Frightening Shout'), +(@Fairmount,0,2,0,13,0,100,0,5000,5000,0,0,11,12555,0,0,0,0,0,2,0,0,0,0,0,0,0,'Captain Fairmount: On enemy casting cast Pummel'); +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@Fairmount; +UPDATE `creature_model_info` SET `modelid_other_gender`=0 WHERE `modelid`=1855; -- correct wrong model data, thanks Kaelima diff --git a/sql/old/3.3.5a/2011_02_26_02_world_sai.sql b/sql/old/3.3.5a/2011_02_26_02_world_sai.sql new file mode 100644 index 0000000000000..89ac05757c4f3 --- /dev/null +++ b/sql/old/3.3.5a/2011_02_26_02_world_sai.sql @@ -0,0 +1,117 @@ +-- Quest 11344 "Anguish of Nifflevar" +-- Spawn King Ymiron & Ancient Citizens of Nifflevar (24322,24323) +SET @GUID := 151840; -- 53 required +DELETE FROM `creature` WHERE `id` IN (24321,24322,24323); +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`DeathState`,`MovementType`,`npcflag`,`unit_flags`,`dynamicflags`) VALUES +(@GUID,24321,571,1,2,0,0,913.322571,-5580.623535,201.560135,1.169371,300,0,0,1,0,0,0,0,0,0), +(@GUID+1,24322,571,1,2,0,0,911.649536,-5561.338867,193.473511,4.799655,300,0,0,1,0,0,0,0,0,0), +(@GUID+2,24322,571,1,2,0,0,907.117493,-5537.400879,192.382034,4.869469,300,0,0,1,0,0,0,0,0,0), +(@GUID+3,24322,571,1,2,0,0,918.257690,-5544.248535,189.321060,4.572762,300,0,0,1,0,0,0,0,0,0), +(@GUID+4,24322,571,1,2,0,0,914.562317,-5522.900391,194.128143,4.677482,300,0,0,1,0,0,0,0,0,0), +(@GUID+5,24322,571,1,2,0,0,918.760193,-5563.743652,190.615295,4.398230,300,0,0,1,0,0,0,0,0,0), +(@GUID+6,24322,571,1,2,0,0,907.657227,-5558.532715,194.031952,4.974188,300,0,0,1,0,0,0,0,0,0), +(@GUID+7,24322,571,1,2,0,0,919.950439,-5557.877441,190.155640,4.433136,300,0,0,1,0,0,0,0,0,0), +(@GUID+8,24322,571,1,2,0,0,901.456604,-5555.405762,194.423370,5.148721,300,0,0,1,0,0,0,0,0,0), +(@GUID+9,24322,571,1,2,0,0,917.626770,-5553.712402,190.210724,4.555309,300,0,0,1,0,0,0,0,0,0), +(@GUID+10,24322,571,1,2,0,0,917.515747,-5529.253418,192.039810,4.625123,300,0,0,1,0,0,0,0,0,0), +(@GUID+11,24322,571,1,2,0,0,929.798828,-5579.141113,184.931671,3.263766,300,0,0,1,0,0,0,0,0,0), +(@GUID+12,24322,571,1,2,0,0,925.442383,-5571.049316,187.266571,3.839724,300,0,0,1,0,0,0,0,0,0), +(@GUID+13,24322,571,1,2,0,0,922.322693,-5531.354492,189.792633,4.520403,300,0,0,1,0,0,0,0,0,0), +(@GUID+14,24322,571,1,2,0,0,914.473938,-5533.336426,192.314362,4.677482,300,0,0,1,0,0,0,0,0,0), +(@GUID+15,24322,571,1,2,0,0,898.829895,-5539.486816,193.249542,5.061455,300,0,0,1,0,0,0,0,0,0), +(@GUID+16,24322,571,1,2,0,0,934.146912,-5528.458496,187.373657,4.328416,300,0,0,1,0,0,0,0,0,0), +(@GUID+17,24322,571,1,2,0,0,951.450745,-5546.908691,185.516861,3.857178,300,0,0,1,0,0,0,0,0,0), +(@GUID+18,24322,571,1,2,0,0,937.627197,-5573.079590,186.163086,3.455752,300,0,0,1,0,0,0,0,0,0), +(@GUID+19,24322,571,1,2,0,0,951.077820,-5562.566895,184.759872,3.595378,300,0,0,1,0,0,0,0,0,0), +(@GUID+20,24322,571,1,2,0,0,933.675659,-5544.941895,186.067123,4.188790,300,0,0,1,0,0,0,0,0,0), +(@GUID+21,24322,571,1,2,0,0,937.109619,-5553.085938,185.877472,3.996804,300,0,0,1,0,0,0,0,0,0), +(@GUID+22,24322,571,1,2,0,0,949.577271,-5571.852539,185.366730,3.385939,300,0,0,1,0,0,0,0,0,0), +(@GUID+23,24322,571,1,2,0,0,936.470398,-5562.455566,186.809601,3.822271,300,0,0,1,0,0,0,0,0,0), +(@GUID+24,24322,571,1,2,0,0,938.413879,-5547.399902,185.824203,4.066617,300,0,0,1,0,0,0,0,0,0), +(@GUID+25,24322,571,1,2,0,0,955.932312,-5541.443848,185.481186,3.892084,300,0,0,1,0,0,0,0,0,0), +(@GUID+26,24322,571,1,2,0,0,943.289490,-5552.288086,185.451431,3.909538,300,0,0,1,0,0,0,0,0,0), +(@GUID+27,24322,571,1,2,0,0,945.767151,-5536.810547,187.226501,4.066617,300,0,0,1,0,0,0,0,0,0), +(@GUID+28,24322,571,1,2,0,0,936.005432,-5533.506348,187.474640,4.258604,300,0,0,1,0,0,0,0,0,0), +(@GUID+29,24322,571,1,2,0,0,940.907532,-5562.951660,186.208282,3.717551,300,0,0,1,0,0,0,0,0,0), +(@GUID+30,24323,571,1,2,0,0,913.934875,-5540.195801,190.576599,4.694936,300,0,0,1,0,0,0,0,0,0), +(@GUID+31,24323,571,1,2,0,0,911.285278,-5528.675293,193.913025,4.764749,300,0,0,1,0,0,0,0,0,0), +(@GUID+32,24323,571,1,2,0,0,908.860596,-5550.749512,192.935822,4.869469,300,0,0,1,0,0,0,0,0,0), +(@GUID+33,24323,571,1,2,0,0,926.252625,-5554.952637,188.244858,4.241150,300,0,0,1,0,0,0,0,0,0), +(@GUID+34,24323,571,1,2,0,0,927.767273,-5549.813477,187.309235,4.276057,300,0,0,1,0,0,0,0,0,0), +(@GUID+35,24323,571,1,2,0,0,924.092590,-5543.457520,187.883835,4.433136,300,0,0,1,0,0,0,0,0,0), +(@GUID+36,24323,571,1,2,0,0,926.421143,-5563.162598,188.220581,4.084070,300,0,0,1,0,0,0,0,0,0), +(@GUID+37,24323,571,1,2,0,0,931.465698,-5537.858887,187.133362,4.310963,300,0,0,1,0,0,0,0,0,0), +(@GUID+38,24323,571,1,2,0,0,903.491638,-5545.229004,192.859741,4.991642,300,0,0,1,0,0,0,0,0,0), +(@GUID+39,24323,571,1,2,0,0,914.416138,-5547.484375,190.819977,4.677482,300,0,0,1,0,0,0,0,0,0), +(@GUID+40,24323,571,1,2,0,0,932.521729,-5568.607910,187.107620,3.717551,300,0,0,1,0,0,0,0,0,0), +(@GUID+41,24323,571,1,2,0,0,932.666260,-5559.350098,187.348434,3.979351,300,0,0,1,0,0,0,0,0,0), +(@GUID+42,24323,571,1,2,0,0,913.796448,-5555.000488,192.018814,4.694936,300,0,0,1,0,0,0,0,0,0), +(@GUID+43,24323,571,1,2,0,0,932.566406,-5549.750977,186.291962,4.153883,300,0,0,1,0,0,0,0,0,0), +(@GUID+44,24323,571,1,2,0,0,921.767151,-5549.706543,188.552811,4.450590,300,0,0,1,0,0,0,0,0,0), +(@GUID+45,24323,571,1,2,0,0,910.815247,-5543.295410,191.321259,4.782202,300,0,0,1,0,0,0,0,0,0), +(@GUID+46,24323,571,1,2,0,0,927.373047,-5532.523926,188.151520,4.415683,300,0,0,1,0,0,0,0,0,0), +(@GUID+47,24323,571,1,2,0,0,945.812073,-5543.786621,186.478867,3.996804,300,0,0,1,0,0,0,0,0,0), +(@GUID+48,24323,571,1,2,0,0,941.300110,-5580.629395,186.328186,3.159046,300,0,0,1,0,0,0,0,0,0), +(@GUID+49,24323,571,1,2,0,0,944.829895,-5566.057617,185.812531,3.577925,300,0,0,1,0,0,0,0,0,0), +(@GUID+50,24323,571,1,2,0,0,950.293091,-5554.961914,184.850952,3.752458,300,0,0,1,0,0,0,0,0,0), +(@GUID+51,24323,571,1,2,0,0,940.116882,-5538.732910,187.230682,4.136430,300,0,0,1,0,0,0,0,0,0), +(@GUID+52,24323,571,1,2,0,0,944.395813,-5558.648438,185.427444,3.752458,300,0,0,1,0,0,0,0,0,0); + +-- SAI for King Ymiron & Ancient Citizen of Nifflevar (24322,24323) +UPDATE `creature_template` SET `unit_flags`=`unit_flags`|768,`AIName`= 'SmartAI' WHERE `entry` IN (24321,24322,24323); +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid` IN (24321,24322,24323); +DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid` IN (2432100); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(24321,0,0,0,1,0,100,0,15000,15000,120000,120000,80,2432100,0,0,0,0,0,1,0,0,0,0,0,0,0, 'King Ymiron - Run script every 2 min'), +(24321,0,1,0,11,0,100,0,0,0,0,0,8,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'King Ymiron - Set React State civilian'), +(2432100,9,0,0,0,0,100,0,1000,1000,0,0,1,0,0,0,0,0,0,10,@GUID+34,24323,0,0,0,0,0, 'Ancient Citizen of Nifflevar Say text 0'), +(2432100,9,1,0,0,0,100,0,8000,8000,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Say text 0'), +(2432100,9,2,0,0,0,100,0,1000,1000,0,0,1,0,0,0,0,0,0,10,@GUID+8,24322,0,0,0,0,0, 'Ancient Citizen of Nifflevar Say text 0'), +(2432100,9,3,0,0,0,100,0,4000,4000,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Say text 1'), +(2432100,9,4,0,0,0,100,0,5000,5000,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Say text 2'), +(2432100,9,5,0,0,0,100,0,5000,5000,0,0,1,3,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Say text 3'), +(2432100,9,6,0,0,0,100,0,5000,5000,0,0,1,4,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Say text 4'), +(2432100,9,7,0,0,0,100,0,4000,4000,0,0,5,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'emote say'), +(2432100,9,8,0,0,0,100,0,4000,4000,0,0,1,5,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Say text 5'), +(2432100,9,9,0,0,0,100,0,4000,4000,0,0,5,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'emote say'), +(2432100,9,10,0,0,0,100,0,4000,4000,0,0,1,6,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Say text 6'), +(2432100,9,11,0,0,0,100,0,4000,4000,0,0,5,6,0,0,0,0,0,1,0,0,0,0,0,0,0, 'emote question'), +(2432100,9,12,0,0,0,100,0,4000,4000,0,0,1,7,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Say text 7'), +(2432100,9,13,0,0,0,100,0,3000,3000,0,0,1,8,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Say text 8'), +(2432100,9,14,0,0,0,100,0,2000,2000,0,0,1,9,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Say text 9'), +(2432100,9,15,0,0,0,100,0,3000,3000,0,0,5,53,0,0,0,0,0,1,0,0,0,0,0,0,0, 'emote battleroar'), +(2432100,9,16,0,0,0,100,0,9000,9000,0,0,1,10,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Say text 10'), +(2432100,9,17,0,0,0,100,0,3000,3000,0,0,5,53,0,0,0,0,0,1,0,0,0,0,0,0,0, 'emote battleroar'), +(2432100,9,18,0,0,0,100,0,5000,5000,0,0,1,1,0,0,0,0,0,10,@GUID+26,24322,0,0,0,0,0, 'Ancient Citizen of Nifflevar Say text 1'), +(2432100,9,19,0,0,0,100,0,0,0,0,0,11,43468,2,0,0,0,0,1,0,0,0,0,0,0,0, 'Cast Secrets of Nifflevar'), +(2432100,9,20,0,0,0,100,0,4000,4000,0,0,1,2,0,0,0,0,0,10,@GUID+5,24322,0,0,0,0,0, 'Ancient Citizen of Nifflevar Say text 2'), +(2432100,9,21,0,0,0,100,0,2000,2000,0,0,1,1,0,0,0,0,0,10,@GUID+41,24323,0,0,0,0,0, 'Ancient Citizen of Nifflevar Say text 1'), +(24322,0,0,0,11,0,100,0,0,0,0,0,8,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Ancient Citizen of Nifflevar (24322) - Set React State civilian'), +(24322,0,1,0,1,0,100,0,1000,10000,8000,10000,10,4,53,113,397,0,0,1,0,0,0,0,0,0,0, 'Ancient Citizen of Nifflevar (24322) - Play random emote'), +(24323,0,0,0,11,0,100,0,0,0,0,0,8,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Ancient Citizen of Nifflevar (24323) - Set React State civilian'), +(24323,0,1,0,1,0,100,0,1000,10000,8000,10000,10,4,53,113,397,0,0,1,0,0,0,0,0,0,0, 'Ancient Citizen of Nifflevar (24323) - Play random emote'); + +-- Spell Condition for 43468 +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry` IN (43468); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(13,0,43468,0,18,1,0,0,0, '', 'Spell 43468 target player'); + +-- NPC talk text insert from sniff for King Ymiron & Ancient Citizens of Nifflevar +DELETE FROM `creature_text` WHERE `entry` IN (24321,24322,24323); +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(24321,0,0,'%s motions for silence.',2,0,100,397,0,0, 'King Ymiron emote'), +(24321,1,0,'Vrykul, your king implores you to listen!',1,0,100,22,0,0, 'King Ymiron yell'), +(24321,2,0,'The crowd gasps in horror.',2,0,100,53,0,0, 'King Ymiron emote'), +(24321,3,0,'Even now, in our darkest hour, they mock us!',1,0,100,22,0,0, 'King Ymiron yell'), +(24321,4,0,'Where are the titans in our time of greatest need? Our women birth abberations - disfigured runts unable to even stand on their own! Weak and ugly... Useless...',1,0,100,22,0,0, 'King Ymiron yell'), +(24321,5,0,'Ymiron has toiled. Long have I sat upon my throne and thought hard of our plight. There is only one answer... one reason...',1,0,100,22,0,0, 'King Ymiron yell'), +(24321,6,0,'For who but the titans themselves could bestow such a curse? What could have such power?',1,0,100,1,0,0, 'King Ymiron yell'), +(24321,7,0,'And the answer is nothing... For it is the titans that have cursed us!',1,0,100,53,0,0, 'King Ymiron yell'), +(24321,8,0,'The crowd cheers.',2,0,100,0,0,0, 'King Ymiron'), +(24321,9,0,'On this day all Vrykul will shed their old beliefs! We denounce our old gods! All Vrykul will pledge their allegiance to Ymiron! Ymiron will protect our noble race!',1,0,100,53,0,0, 'King Ymiron yell'), +(24321,10,0,'And now my first decree upon the Vrykul! All malformed infants born of Vrykul mother and father are to be destroyed upon birth! Our blood must remain pure always! Those found in violation of Ymiron''s decree will be taken to Gjalerbron for execution!',1,0,100,1,0,0, 'King Ymiron yell'), +(24322,0,0,'Silence!',1,0,100,1,0,0, 'Ancient Citizen of Nifflevar yell'), +(24322,1,0,'Show them mercy, my king! They are of our flesh and blood!',1,0,100,53,0,0, 'Ancient Citizen of Nifflevar yell'), +(24322,2,0,'All hail our glorious king, Ymiron!',1,0,100,53,0,0, 'Ancient Citizen of Nifflevar yell'), +(24323,0,0,'Show the abberations no mercy, Ymiron!',1,0,100,1,0,0, 'Ancient Citizen of Nifflevar yell'), +(24323,1,0,'They weaken us! Our strength is dilluted by their very existence! Destroy them all!',1,0,100,113,0,0, 'Ancient Citizen of Nifflevar yell'); diff --git a/sql/old/3.3.5a/2011_02_26_03_world_creatures.sql b/sql/old/3.3.5a/2011_02_26_03_world_creatures.sql new file mode 100644 index 0000000000000..b8dc70fea7d91 --- /dev/null +++ b/sql/old/3.3.5a/2011_02_26_03_world_creatures.sql @@ -0,0 +1,2 @@ +UPDATE `creature` SET `spawndist`=0 WHERE `guid`=137582; +DELETE FROM `creature_addon` WHERE `guid` IN (136768,136769); diff --git a/sql/old/3.3.5a/2011_02_26_04_world_spell_linked_spell.sql b/sql/old/3.3.5a/2011_02_26_04_world_spell_linked_spell.sql new file mode 100644 index 0000000000000..fe15af01a64d4 --- /dev/null +++ b/sql/old/3.3.5a/2011_02_26_04_world_spell_linked_spell.sql @@ -0,0 +1,8 @@ +DELETE FROM `spell_linked_spell` WHERE `spell_effect`=55475; +INSERT INTO `spell_linked_spell` (`spell_trigger`,`spell_effect`,`type`,`comment`) VALUES +(55428,55475,0, 'Lifeblood (Rank 1)'), +(55480,55475,0, 'Lifeblood (Rank 2)'), +(55500,55475,0, 'Lifeblood (Rank 3)'), +(55501,55475,0, 'Lifeblood (Rank 4)'), +(55502,55475,0, 'Lifeblood (Rank 5)'), +(55503,55475,0, 'Lifeblood (Rank 6)'); diff --git a/sql/old/3.3.5a/2011_02_26_05_world_npc_spellclick_spells.sql b/sql/old/3.3.5a/2011_02_26_05_world_npc_spellclick_spells.sql new file mode 100644 index 0000000000000..f19aca71b243c --- /dev/null +++ b/sql/old/3.3.5a/2011_02_26_05_world_npc_spellclick_spells.sql @@ -0,0 +1,68 @@ +UPDATE `creature_template` SET `npcflag`=`npcflag`|16777216 WHERE `entry` IN (SELECT `npc_entry` FROM `npc_spellclick_spells`); + +DELETE FROM `npc_spellclick_spells` WHERE `npc_entry` IN (32640,32633,31861,31862,25743,27661,27258,27755,27756,27692,40725,32286,29929,29602,29709,27626,28851, +34120,30403,26813,26523,27496,27714,27996,28605,28606,28607,28833,30066,32930,28312,32627,33060,33067,33062,33109,34994,30234,27629,27924,28061,28192,28669, +28670,28817,28864,2914,29460,29679,29918,30468,30470,35064,30585,30645,33217,33319,33321,33519,33844,33845,39714); +INSERT INTO `npc_spellclick_spells` (`npc_entry`,`spell_id`,`quest_start`,`quest_start_active`,`quest_end`,`cast_flags`,`aura_required`,`aura_forbidden`,`user_type`) VALUES +(32640,61424,0,0,0,1,0,0,0), -- Traveler's Tundra Mammoth +(32633,61424,0,0,0,1,0,0,0), -- Traveler's Tundra Mammoth +(31861,61466,0,0,0,1,0,0,0), -- Grand Black War Mammoth +(31862,61466,0,0,0,1,0,0,0), -- Grand Black War Mammoth +(25743,46260,0,0,0,1,0,0,0), -- Wooly Mammoth Bull +(27661,48365,0,0,0,1,0,0,0), -- Wintergarde Gryphon +(27258,48365,0,0,0,1,0,0,0), -- Wintergarde Gryphoworldn +(27755,49460,0,0,0,1,0,0,0), -- Amber Drake +(27756,49464,0,0,0,1,0,0,0), -- Ruby Drake +(27692,49346,0,0,0,1,0,0,0), -- Emerald Drake +(40725,75953,0,0,0,1,0,0,0), -- X-53 Touring Rocket +(32286,61666,0,0,0,1,0,0,0), -- Mekgineer's Chopper +(29929,58961,0,0,0,1,0,0,0), -- Mechano-hog +(29602,54908,0,0,0,1,0,0,0), -- Icefang +(29709,55029,0,0,0,1,0,0,0), -- Freed Proto-Drake +(27626,49138,0,0,0,1,0,0,0), -- Tatjana's Horse +(28851,52600,0,0,0,1,0,0,0), -- Enraged Mammoth +(34120,55089,0,0,0,1,0,0,0), -- Brann's Flying Machine +(30403,56699,0,0,0,1,0,0,0), -- Nergeld +(26813,47424,0,0,0,1,0,0,0), -- Kor'kron War Rider +(26523,48296,0,0,0,1,0,0,0), -- Forsaken Blight Spreader +(27496,48881,0,0,0,1,0,0,0), -- Refurbished Shredder +(27714,49584,0,0,0,1,0,0,0), -- 7th Legion Chain Gun +(27996,50343,0,0,0,1,0,0,0), -- Wyrmrest Vanquisher +(28605,52263,0,0,0,1,0,0,0), -- Havenshire Stallion +(28606,52263,0,0,0,1,0,0,0), -- Havenshire Mare +(28607,52263,0,0,0,1,0,0,0), -- Havenshire Colt +(28833,52447,0,0,0,1,0,0,0), -- Scarlet Cannon +(30066,56678,0,0,0,1,0,0,0), -- Argent Skytalon +(28312,60968,0,0,0,1,0,0,0), -- Wintergrasp Siege Engine +(32627,60968,0,0,0,1,0,0,0), -- Wintergrasp Siege Engine +(33060,65031,0,0,0,1,0,0,0), -- Salvaged Siege Engine +(33067,65031,0,0,0,1,0,0,0), -- Salvaged Siege Turret +(33062,65030,0,0,0,1,0,0,0), -- Salvaged Chopper +(33109,62309,0,0,0,1,0,0,0), -- Salvaged Demolisher +(34944,68458,0,0,0,1,0,0,0), -- Keep Cannon +-- These use a 'proxy' cast. They summon a similar creature with SummonProperties.category = 4 +(30234,56378,0,0,0,1,0,0,0), -- Hover Disk +(27629,49207,0,0,0,1,0,0,0), -- Wyrmrest Defender +(27924,50007,0,0,0,1,0,0,0), -- Dragonflayer Harpoon +(28061,50557,0,0,0,1,0,0,0), -- Wintergarde Gryphon +(28192,50860,0,0,0,1,0,0,0), -- Archmage Pentarus' Flying Machine +(28669,52190,0,0,0,1,0,0,0), -- Flying Fiend +(28670,53173,0,0,0,1,0,0,0), -- Frostblood Vanquisher +(28817,52462,0,0,0,1,0,0,0), -- Mine Car +(28864,52589,0,0,0,1,0,0,0), -- Scourge Gryphon +(29414,18277,0,0,0,1,0,0,0), -- Bone Gryphon +(29460,54513,0,0,0,1,0,0,0), -- Frigit Proto-Drake +(29679,54952,0,0,0,1,0,0,0), -- Hyldsmeet Proto-Drake +(29918,54301,0,0,0,1,0,0,0), -- Warbear Matriarch +(30468,56795,0,0,0,1,0,0,0), -- Harnessed Icemaw Matriarch +(30470,56839,0,0,0,1,0,0,0), -- Skybreaker Cloudbuster +(30564,57401,0,0,0,1,0,0,0), -- Njorndar Proto-Drake +(30585,57418,0,0,0,1,0,0,0), -- Hammerhead +(30645,57612,0,0,0,1,0,0,0), -- Water Terror +(33217,62774,0,0,0,1,0,0,0), -- Stormwind Steed +(33319,62782,0,0,0,1,0,0,0), -- Darnassian Nightsaber +(33321,62784,0,0,0,1,0,0,0), -- Darkspear Raptor +(33519,63163,0,0,0,1,0,0,0), -- Black Knight's Gryphon +(33844,63791,0,0,0,1,0,0,0), -- Sunreaver Hawkstrider +(33845,63792,0,0,0,1,0,0,0), -- Quel'dorei Steed +(39714,74205,0,0,0,1,0,0,0); -- Shooting Mechano-Tank diff --git a/sql/old/3.3.5a/2011_02_27_00_world_creature_template.sql b/sql/old/3.3.5a/2011_02_27_00_world_creature_template.sql new file mode 100644 index 0000000000000..76871b9d53495 --- /dev/null +++ b/sql/old/3.3.5a/2011_02_27_00_world_creature_template.sql @@ -0,0 +1,29 @@ +-- Some vehicle updates +UPDATE `creature_template` SET `vehicleid`=25 WHERE `entry`=29144; -- Refurbished Steam Tank +UPDATE `creature_template` SET `unit_flags`=`unit_flags`|264,`vehicleid`=51 WHERE `entry`=27409; -- Ducal's Horse +UPDATE `creature_template` SET `npcflag`=`npcflag`|16777216,`unit_flags`=`unit_flags`|33600,`vehicleid`=212 WHERE `entry`=30021; -- Enormos +UPDATE `creature_template` SET `npcflag`=`npcflag`|55957,`unit_flags`=`unit_flags`|8,`speed_walk`=2.8,`vehicleid`=217 WHERE `entry`=30124; -- Snorri +UPDATE `creature_template` SET `npcflag`=`npcflag`|16777216,`speed_run`=1,`vehicleid`=354 WHERE `entry`=33357; -- "Spectral Tiger" +UPDATE `creature_template` SET `vehicleid`=291 WHERE `entry`=32227; -- Skybreaker Suppression Turret +UPDATE `creature_template` SET `exp`=0,`baseattacktime`=2000,`unit_flags`=`unit_flags`|33570816,`speed_walk`=1.6,`speed_run`=2.4285714285714,`vehicleid`=471 WHERE `entry`=35336; -- Horde Boat +UPDATE `creature_template` SET `exp`=0,`baseattacktime`=2000,`unit_flags`=`unit_flags`|33570816,`speed_walk`=1.6,`speed_run`=2.4285714285714,`vehicleid`=472 WHERE `entry`=35335; -- Alliance Boat + +DELETE FROM `creature_template_addon` WHERE `entry` IN (29144,27409,30021,30124,32227,33357,35336,35335); +INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(29144,0,0,1,0, NULL), -- Refurbished Steam Tank +(27409,0,0,1,0, NULL), -- Ducal's Horse +(30021,0,0,1,0, NULL), -- Enormos +(30124,0,0,257,0, NULL), -- Snorri +(32227,0,0,1,0, NULL), -- Skybreaker Suppression Turret +(33357,0,0,1,0, NULL), -- "Spectral Tiger" +(35336,0,50331648,257,0, NULL), -- Horde Boat +(35335,0,50331648,257,0, NULL); -- Alliance Boat + +UPDATE `creature_model_info` SET `bounding_radius`=0.248,`combat_reach`=4.8,`gender`=0 WHERE `modelid`=26772; -- Snorri +UPDATE `creature_model_info` SET `bounding_radius`=0.3,`combat_reach`=0,`gender`=2 WHERE `modelid`=28811; -- "Spectral Tiger" +UPDATE `creature_model_info` SET `bounding_radius`=4,`combat_reach`=0,`gender`=2 WHERE `modelid`=29771; -- Horde Boat +UPDATE `creature_model_info` SET `bounding_radius`=5,`combat_reach`=0,`gender`=2 WHERE `modelid`=29766; -- Alliance Boat + +DELETE FROM `npc_spellclick_spells` WHERE `npc_entry`=33357 AND `spell_id`=75648; +INSERT INTO `npc_spellclick_spells` (`npc_entry`,`spell_id`,`quest_start`,`quest_start_active`,`quest_end`,`cast_flags`,`aura_required`,`aura_forbidden`,`user_type`) VALUES +(33357,75648,0,0,0,1,0,0,0); -- "Spectral Tiger" diff --git a/sql/old/3.3.5a/2011_02_27_01_world_creature_template.sql b/sql/old/3.3.5a/2011_02_27_01_world_creature_template.sql new file mode 100644 index 0000000000000..6813dd8d0145f --- /dev/null +++ b/sql/old/3.3.5a/2011_02_27_01_world_creature_template.sql @@ -0,0 +1,66 @@ +-- Template updates +UPDATE `creature_template` SET `dynamicflags`=`dynamicflags`|32 WHERE `entry`=33063; -- Wrecked Siege Engine +UPDATE `creature_template` SET `dynamicflags`=`dynamicflags`|32 WHERE `entry`=33059; -- Wrecked Demolisher +UPDATE `creature_template` SET `exp`=1 WHERE `entry`=33662; -- Kirin Tor Battle-Mage +UPDATE `creature_template` SET `exp`=0 WHERE `entry`=33377; -- Mortar Targetting Device +UPDATE `creature_template` SET `npcflag`=`npcflag`|1 WHERE `entry`=33686; -- Lore Keeper of Norgannon +UPDATE `creature_template` SET `exp`=1 WHERE `entry`=33626; -- Hired Engineer +UPDATE `creature_template` SET `exp`=1 WHERE `entry`=33627; -- Hired Demolitionist +UPDATE `creature_template` SET `npcflag`=`npcflag`|1 WHERE `entry`=33624; -- Archmage Pentarus +UPDATE `creature_template` SET `exp`=0 WHERE `entry`=33571; -- Ulduar Gauntlet Generator + +-- Model data +UPDATE `creature_model_info` SET `bounding_radius`=3,`combat_reach`=2.25,`gender`=2 WHERE `modelid`=27658; -- Wrecked Demolisher +UPDATE `creature_model_info` SET `bounding_radius`=0.5,`combat_reach`=1,`gender`=2 WHERE `modelid`=11686; -- Mortar Targetting Device +UPDATE `creature_model_info` SET `bounding_radius`=0.5,`combat_reach`=1,`gender`=2 WHERE `modelid`=11686; -- Mortar Targetting Device +UPDATE `creature_model_info` SET `bounding_radius`=0.5,`combat_reach`=1,`gender`=2 WHERE `modelid`=11686; -- Mortar Targetting Device +UPDATE `creature_model_info` SET `bounding_radius`=1.4288,`combat_reach`=2.4,`gender`=0 WHERE `modelid`=28781; -- Demolisher Engineer Blastwrench +UPDATE `creature_model_info` SET `bounding_radius`=0.2625,`combat_reach`=1.5,`gender`=0 WHERE `modelid`=6589; -- Lore Keeper of Norgannon +UPDATE `creature_model_info` SET `bounding_radius`=0.434,`combat_reach`=1.4,`gender`=0 WHERE `modelid`=28739; -- Goran Steelbreaker +UPDATE `creature_model_info` SET `bounding_radius`=0.434,`combat_reach`=1.4,`gender`=0 WHERE `modelid`=28739; -- Goran Steelbreaker +UPDATE `creature_model_info` SET `bounding_radius`=0.372,`combat_reach`=1.2,`gender`=0 WHERE `modelid`=26662; -- Earthen Stoneshaper +UPDATE `creature_model_info` SET `bounding_radius`=0.3,`combat_reach`=1,`gender`=0 WHERE `modelid`=28581; -- Steelforged Defender +UPDATE `creature_model_info` SET `bounding_radius`=0.3,`combat_reach`=1,`gender`=0 WHERE `modelid`=28580; -- Steelforged Defender +UPDATE `creature_model_info` SET `bounding_radius`=0.5,`combat_reach`=1.5,`gender`=1 WHERE `modelid`=5233; -- Spirit Healer + +-- Addon data +DELETE FROM `creature_template_addon` WHERE `entry` IN +(33059,33063,33662,33672,33167,33626,33060,33377,33062,33067,33579,33669,33214,33109,33666,33701,33686,33696,33622,33627,33779,33620 +,32780,33624,33218,33629,33721,34234,33236,33571); +INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(33059,0,0,257,0, '29266 0 29266 1'), -- Wrecked Demolisher; Auras: Permanent Feign Death +(33063,0,0,257,0, '29266 0 29266 1'), -- Wrecked Siege Engine; Aura: Permanent Feign Death +(33060,0,0,257,0, NULL), -- Salvaged Siege Engine +(33662,0,0,1,0, NULL), -- Kirin Tor Battle-Mage +(33672,0,0,1,0, NULL), -- Kirin Tor Mage +(33167,0,0,257,0, NULL), -- Salvaged Demolisher Mechanic Seat +(33626,0,0,1,0, NULL), -- Hired Engineer +(33627,0,0,1,0, NULL), -- Hired Demolitionist +(33377,0,0,1,0, NULL), -- Mortar Targetting Device +(33062,0,0,257,0, NULL), -- Salvaged Chopper +(33067,0,0,257,0, NULL), -- Salvaged Siege Turret +(33579,0,0,1,0, NULL), -- Brann Bronzebeard +(33669,0,0,257,0, NULL), -- Demolisher Engineer Blastwrench +(33214,0,50331648,1,0, NULL), -- Mechanolift 304-A +(33109,0,0,257,0, NULL), -- Salvaged Demolisher +(33666,0,0,257,0, NULL), -- Demolisher Engineer Blastwrench +(33701,0,0,1,0, NULL), -- High Explorer Dellorah +(33686,0,0,1,0, NULL), -- Lore Keeper of Norgannon +(33696,0,0,1,0, NULL), -- Archmage Rhydian +(33622,0,0,1,0, NULL), -- Goran Steelbreaker +(33779,0,0,1,0, NULL), -- Ulduar Shield Bunny +(33620,0,0,1,0, NULL), -- Earthen Stoneshaper +(32780,0,0,1,0, NULL), -- Invisible Stalker (All Phases) +(33624,0,0,1,0, NULL), -- Archmage Pentarus +(33218,0,0,1,0, NULL), -- Pyrite Safety Container +(33629,14374,0,257,0, NULL), -- Weslex Quickwrench +(33721,0,50331648,1,0, NULL), -- Lore Keeper Projection Unit +(34234,0,0,1,0, NULL), -- Runeforged Sentry +(33236,0,0,1,27, NULL), -- Steelforged Defender +(33571,0,0,1,0, NULL); -- Ulduar Gauntlet Generator + +-- Addon data for creature 6491 (Spirit Healer) +UPDATE `creature_template_addon` SET `bytes1`=65536,`bytes2`=1,`mount`=0,`emote`=0,`auras`='10848 0' WHERE `entry`=6491; -- Spirit Healer + +DELETE FROM `creature_addon` WHERE `guid` IN (136245,136246,136247,136248,136249); -- Wrecked Siege Engine +DELETE FROM `creature_addon` WHERE `guid` IN (136073,136074,136087,136088,136089,136090); -- Wrecked Siege Engine diff --git a/sql/old/3.3.5a/2011_02_27_02_world_npc_spellclick_spells.sql b/sql/old/3.3.5a/2011_02_27_02_world_npc_spellclick_spells.sql new file mode 100644 index 0000000000000..dd08b5c182146 --- /dev/null +++ b/sql/old/3.3.5a/2011_02_27_02_world_npc_spellclick_spells.sql @@ -0,0 +1,11 @@ +DELETE FROM `npc_spellclick_spells` WHERE `npc_entry` IN(28781,27894,32627,32629,28366,28312,28319,28094,27881); +INSERT INTO `npc_spellclick_spells` (`npc_entry`,`spell_id`,`quest_start`,`quest_start_active`,`quest_end`,`cast_flags`,`aura_required`,`aura_forbidden`,`user_type`) VALUES +(28781,60683,0,0,0,1,0,0,0), -- Battleground Demolisher +(27894,60682,0,0,0,1,0,0,0), -- Antipersonnel Cannon +(32627,60968,0,0,0,1,0,0,0), -- Wintergrasp Siege Engine +(32629,46598,0,0,0,1,0,0,0), -- Wintergrasp Siege Turret +(28366,60962,0,0,0,1,0,0,0), -- Wintergrasp Tower Cannon +(28312,46598,0,0,0,1,0,0,0), -- Wintergrasp Siege Engine +(28319,46598,0,0,0,1,0,0,0), -- Wintergrasp Siege Turret +(28094,60968,0,0,0,1,0,0,0), -- Wintergrasp Demolisher +(27881,60968,0,0,0,1,0,0,0); -- Wintergrasp Catapult diff --git a/sql/old/3.3.5a/2011_02_27_03_world_npc_spellclick_spells.sql b/sql/old/3.3.5a/2011_02_27_03_world_npc_spellclick_spells.sql new file mode 100644 index 0000000000000..e4f2c51ea012a --- /dev/null +++ b/sql/old/3.3.5a/2011_02_27_03_world_npc_spellclick_spells.sql @@ -0,0 +1,3 @@ +DELETE FROM `npc_spellclick_spells` WHERE `npc_entry`=28366 AND `spell_id`=60962; -- Wintergrasp Tower Cannon, duplicate from previous rev +INSERT INTO `npc_spellclick_spells` (`npc_entry`,`spell_id`,`quest_start`,`quest_start_active`,`quest_end`,`cast_flags`,`aura_required`,`aura_forbidden`,`user_type`) VALUES +(28366,60962,0,0,0,1,0,0,0); -- Wintergrasp Tower Cannon' diff --git a/sql/old/3.3.5a/2011_02_27_04_world_creature_template.sql b/sql/old/3.3.5a/2011_02_27_04_world_creature_template.sql new file mode 100644 index 0000000000000..61f568a156ee4 --- /dev/null +++ b/sql/old/3.3.5a/2011_02_27_04_world_creature_template.sql @@ -0,0 +1,75 @@ +SET @EQUIP := 2427; + +UPDATE `creature_template` SET `baseattacktime`=2000,`speed_run`=1.7142857142857 WHERE `entry`=36808; -- Deathspeaker Zealot +UPDATE `creature_template` SET `baseattacktime`=2000,`speed_run`=1.1428571428571 WHERE `entry`=37012; -- Ancient Skeletal Soldier +UPDATE `creature_template` SET `baseattacktime`=1000,`unit_flags`=`unit_flags`|33587520,`speed_walk`=2,`speed_run`=1.4285714285714 WHERE `entry`=37007; -- Deathbound Ward +UPDATE `creature_template` SET `exp`=2,`minlevel`=82,`maxlevel`=82,`baseattacktime`=2000,`unit_class`=2,`speed_walk`=2,`speed_run`=1.5873 WHERE `entry`=37528; -- Spire Frostwyrm (Ambient) +UPDATE `creature_template` SET `exp`=2,`minlevel`=80,`maxlevel`=80,`baseattacktime`=2000,`speed_run`=0.99206285714286 WHERE `entry`=37947; -- Deathwhisper Spawn Stalker +UPDATE `creature_template` SET `baseattacktime`=2000,`equipment_id`=@EQUIP,`speed_run`=1.1428571428571 WHERE `entry`=37149; -- Kor'kron Necrolyte +UPDATE `creature_template` SET `faction_A`=83,`faction_H`=83,`baseattacktime`=2000,`unit_flags`=`unit_flags`|32832,`equipment_id`=@EQUIP+1,`speed_run`=1.1428571428571 WHERE `entry`=37034; -- Kor'kron Templar +UPDATE `creature_template` SET `baseattacktime`=2000,`equipment_id`=10065,`speed_run`=1.1428571428571 WHERE `entry`=37031; -- Kor'kron Oracle +UPDATE `creature_template` SET `baseattacktime`=2000,`equipment_id`=10064,`speed_run`=1.1428571428571 WHERE `entry`=37033; -- Kor'kron Invoker +UPDATE `creature_template` SET `baseattacktime`=2000,`equipment_id`=10057,`speed_run`=1.1428571428571 WHERE `entry`=37030; -- Kor'kron Primalist +UPDATE `creature_template` SET `baseattacktime`=2000,`equipment_id`=10058,`speed_run`=1.1428571428571 WHERE `entry`=37016; -- Skybreaker Luminary +UPDATE `creature_template` SET `baseattacktime`=2000,`equipment_id`=10069,`speed_run`=1.1428571428571 WHERE `entry`=37148; -- Skybreaker Summoner +UPDATE `creature_template` SET `baseattacktime`=2000,`equipment_id`=10057,`speed_run`=1.1428571428571 WHERE `entry`=37027; -- Skybreaker Hierophant +UPDATE `creature_template` SET `baseattacktime`=2000,`equipment_id`=10060,`speed_run`=1.1428571428571 WHERE `entry`=37026; -- Skybreaker Sorcerer +UPDATE `creature_template` SET `baseattacktime`=2000,`equipment_id`=10062,`speed_run`=1.1428571428571 WHERE `entry`=37003; -- Skybreaker Vindicator +UPDATE `creature_template` SET `baseattacktime`=2000,`equipment_id`=10068,`speed_run`=1.1428571428571 WHERE `entry`=37035; -- Kor'kron Vanquisher +UPDATE `creature_template` SET `baseattacktime`=1000,`equipment_id`=@EQUIP+2,`speed_run`=1.1428571428571 WHERE `entry`=37146; -- Kor'kron Sniper +UPDATE `creature_template` SET `baseattacktime`=2000,`equipment_id`=10063,`speed_run`=1.1428571428571 WHERE `entry`=37032; -- Kor'kron Defender +UPDATE `creature_template` SET `baseattacktime`=2000,`equipment_id`=10067,`unit_class`=4,`speed_run`=1.1428571428571 WHERE `entry`=37028; -- Kor'kron Stalker +UPDATE `creature_template` SET `baseattacktime`=2000,`equipment_id`=@EQUIP+3,`speed_run`=1.1428571428571 WHERE `entry`=37029; -- Kor'kron Reaver +UPDATE `creature_template` SET `baseattacktime`=2000,`unit_flags`=`unit_flags`|559168,`speed_walk`=0.8,`speed_run`=0.99205714285714 WHERE `entry`=37545; -- Spire Minion + +DELETE FROM `creature_template_addon` WHERE `entry` IN (37012,36808,37528,37007,37947,37030,37146,37032,37029,37027,37149,37031,37034,37016,37148,37026,37028,37003,37033,37035,37545); +INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(37012,0,0,1,333, NULL), -- Ancient Skeletal Soldier +(36808,0,8,1,0, NULL), -- Deathspeaker Zealot +(37528,0,50331648,1,0, NULL), -- Spire Frostwyrm (Ambient) +(37007,0,0,0,417, NULL), -- Deathbound Ward +(37947,0,0,1,0, NULL), -- Deathwhisper Spawn Stalker +(37030,0,0,1,0, NULL), -- Kor'kron Primalist +(37146,0,0,1,0, NULL), -- Kor'kron Sniper +(37032,0,0,1,0, NULL), -- Kor'kron Defender +(37029,0,0,1,0, NULL), -- Kor'kron Reaver +(37027,0,0,1,0, NULL), -- Skybreaker Hierophant +(37149,0,0,1,0, NULL), -- Kor'kron Necrolyte +(37031,0,0,1,0, NULL), -- Kor'kron Oracle +(37034,0,0,1,0, NULL), -- Kor'kron Templar +(37016,0,0,1,0, NULL), -- Skybreaker Luminary +(37148,0,0,1,0, NULL), -- Skybreaker Summoner +(37026,0,0,1,0, NULL), -- Skybreaker Sorcerer +(37028,0,0,1,0, NULL), -- Kor'kron Stalker +(37003,0,0,1,0, NULL), -- Skybreaker Vindicator +(37033,0,0,1,0, NULL), -- Kor'kron Invoker +(37035,0,0,1,0, NULL), -- Kor'kron Vanquisher +(37545,0,0,1,0, NULL); -- Spire Minion + +UPDATE `creature_model_info` SET `bounding_radius`=0.45,`combat_reach`=0.45,`gender`=0 WHERE `modelid`=31124; -- Bone Spike +UPDATE `creature_model_info` SET `bounding_radius`=0.347222,`combat_reach`=1.5,`gender`=0 WHERE `modelid`=30616; -- Ancient Skeletal Soldier +UPDATE `creature_model_info` SET `bounding_radius`=1.388888,`combat_reach`=6,`gender`=0 WHERE `modelid`=30459; -- Deathbound Ward +UPDATE `creature_model_info` SET `bounding_radius`=1.5,`combat_reach`=2.25,`gender`=1 WHERE `modelid`=30463; -- Skybreaker Luminary +UPDATE `creature_model_info` SET `bounding_radius`=1.46205,`combat_reach`=6.075,`gender`=0 WHERE `modelid`=30481; -- Kor'kron Primalist +UPDATE `creature_model_info` SET `bounding_radius`=0.459,`combat_reach`=2.25,`gender`=1 WHERE `modelid`=30531; -- Kor'kron Sniper +UPDATE `creature_model_info` SET `bounding_radius`=0.5745,`combat_reach`=2.25,`gender`=1 WHERE `modelid`=30482; -- Kor'kron Reaver +UPDATE `creature_model_info` SET `bounding_radius`=0.558,`combat_reach`=2.25,`gender`=0 WHERE `modelid`=30475; -- Kor'kron Defender +UPDATE `creature_model_info` SET `bounding_radius`=0.354,`combat_reach`=2.25,`gender`=1 WHERE `modelid`=30486; -- Kor'kron Stalker +UPDATE `creature_model_info` SET `bounding_radius`=0.459,`combat_reach`=2.25,`gender`=0 WHERE `modelid`=30453; -- Skybreaker Vindicator +UPDATE `creature_model_info` SET `bounding_radius`=0.5835,`combat_reach`=2.25,`gender`=0 WHERE `modelid`=30472; -- Skybreaker Hierophant +UPDATE `creature_model_info` SET `bounding_radius`=0.52785,`combat_reach`=2.5875,`gender`=1 WHERE `modelid`=30470; -- Skybreaker Sorcerer +UPDATE `creature_model_info` SET `bounding_radius`=0.459,`combat_reach`=2.25,`gender`=0 WHERE `modelid`=30476; -- Kor'kron Invoker +UPDATE `creature_model_info` SET `bounding_radius`=0.5745,`combat_reach`=2.25,`gender`=0 WHERE `modelid`=30534; -- Kor'kron Necrolyte +UPDATE `creature_model_info` SET `bounding_radius`=0.459,`combat_reach`=2.25,`gender`=1 WHERE `modelid`=30478; -- Kor'kron Oracle +UPDATE `creature_model_info` SET `bounding_radius`=0.5745,`combat_reach`=2.25,`gender`=1 WHERE `modelid`=30487; -- Kor'kron Templar +UPDATE `creature_model_info` SET `bounding_radius`=0.312,`combat_reach`=2.25,`gender`=1 WHERE `modelid`=30536; -- Skybreaker Summoner +UPDATE `creature_model_info` SET `bounding_radius`=0.5745,`combat_reach`=2.25,`gender`=0 WHERE `modelid`=30489; -- Kor'kron Vanquisher +UPDATE `creature_model_info` SET `bounding_radius`=0.62,`combat_reach`=2,`gender`=2 WHERE `modelid`=30656; -- Spire Minion + + +DELETE FROM `creature_equip_template` WHERE `entry` IN (@EQUIP,@EQUIP+1,@EQUIP+2,@EQUIP+3); +INSERT INTO `creature_equip_template` (`entry`,`equipentry1`,`equipentry2`,`equipentry3`) VALUES +(@EQUIP,49764,0,0), +(@EQUIP+1,49736,0,0), +(@EQUIP+2,0,0,49762), +(@EQUIP+3,49733,0,0); diff --git a/sql/old/3.3.5a/2011_02_28_00_world_npc_spellclick_spells.sql b/sql/old/3.3.5a/2011_02_28_00_world_npc_spellclick_spells.sql new file mode 100644 index 0000000000000..753ebf6cd5d0a --- /dev/null +++ b/sql/old/3.3.5a/2011_02_28_00_world_npc_spellclick_spells.sql @@ -0,0 +1,13 @@ +DELETE FROM `npc_spellclick_spells` WHERE `npc_entry` IN (29625,29433,29555,25460,33778,28614,33687,30330,32189,30895,30337); +INSERT INTO `npc_spellclick_spells` (`npc_entry`,`spell_id`,`quest_start`,`quest_start_active`,`quest_end`,`cast_flags`,`aura_required`,`aura_forbidden`,`user_type`) VALUES +(29625,46598,0,0,0,1,0,0,0), -- Hyldsmeet Proto-Drake +(29433,47020,0,0,0,1,0,0,0), -- Goblin Sapper +(29555,47020,0,0,0,1,0,0,0), -- Goblin Sapper +(25460,46598,0,0,0,1,0,0,0), -- Amazing Flying Carpet +(33778,43671,0,0,0,1,0,0,0), -- Tournament Hippogryph +(28614,46598,0,0,0,1,0,0,0), -- Scarlet Gryphon +(33687,46598,0,0,0,1,0,0,0), -- Chillmaw +(30330,46598,0,0,0,1,0,0,0), -- Jotunheim Proto-Drake +(32189,46598,0,0,0,1,0,0,0), -- Skybreaker Recon Fighter +(30895,46598,0,0,0,1,0,0,0), -- Lithe Stalker +(30337,43671,13069,1,13069,1,0,0,0); -- Jotunheim Rapid-Fire Harpoon diff --git a/sql/old/3.3.5a/2011_02_28_01_world_quest_start_scripts.sql b/sql/old/3.3.5a/2011_02_28_01_world_quest_start_scripts.sql new file mode 100644 index 0000000000000..760312edd6f72 --- /dev/null +++ b/sql/old/3.3.5a/2011_02_28_01_world_quest_start_scripts.sql @@ -0,0 +1,2 @@ +-- Fix spawn position for Zuluhed The Whacked +UPDATE `quest_start_scripts` SET `x`=-4204.937,`y`=316.3974,`z`=122.5078,`o`=1.308997 WHERE id=10866; diff --git a/sql/old/3.3.5a/2011_02_28_02_world_sai.sql b/sql/old/3.3.5a/2011_02_28_02_world_sai.sql new file mode 100644 index 0000000000000..7da507367d011 --- /dev/null +++ b/sql/old/3.3.5a/2011_02_28_02_world_sai.sql @@ -0,0 +1,31 @@ +-- Quest 11314 "The Fallen Sisters" +-- Chill Nymph SAI +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=23678; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (23678,2367800); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(23678,0,0,0,2,0,100,1,0,30,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Do text emote on health 30%'), +(23678,0,1,0,0,0,75,0,2000,3000,2000,2000,11,9739,0,0,0,0,0,2,0,0,0,0,0,0,0,'Cast Wrath on victim'), +(23678,0,2,3,8,0,100,0,43340,0,0,0,66,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'On Spell hit 43340 face player'), +(23678,0,3,4,61,0,100,0,0,0,0,0,21,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'stop combat movement'), +(23678,0,4,5,61,0,100,0,0,0,0,0,24,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'evade'), +(23678,0,5,6,61,0,100,0,0,0,0,0,2,35,0,0,0,0,0,1,0,0,0,0,0,0,0,'set faction 35'), +(23678,0,6,7,61,0,100,0,0,0,0,0,33,24117,0,0,0,0,0,7,0,0,0,0,0,0,0,'quest credit'), +(23678,0,7,0,61,0,100,0,0,0,0,0,80,2367800,0,0,0,0,0,1,0,0,0,0,0,0,0,'load script'), +(23678,0,8,0,40,0,100,0,1,23678,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'On reach waypoint 1 despawn'), +(2367800,9,0,0,0,0,100,0,2000,2000,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Say text 1'), +(2367800,9,1,0,0,0,100,0,1000,1000,0,0,53,1,23678,0,0,0,0,1,0,0,0,0,0,0,0, 'start waypoint movement'); +-- NPC talk text insert +DELETE FROM `creature_text` WHERE `entry`=23678; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(23678,0,0, 'Chill Nymph appears weak!',2,0,100,0,0,0, 'Chill Nymph'), +(23678,1,0, 'I knew Lurielle would send help! Thank you friend, and give Lurielle my thanks as well!',0,7,100,1,0,0, 'Chill Nymph'), +(23678,1,1, 'Where am I? What happened to me? You... you freed me?',0,7,100,1,0,0, 'Chill Nymph'), +(23678,1,2, 'Thank you. I thought I would die without seeing my sisters again!',0,7,100,1,0,0, 'Chill Nymph'); +-- Chill Nymph Path +DELETE FROM `waypoints` WHERE `entry`=23678; +INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES +(23678,1,2063,-4666,217,'Chill Nymph point 1'); +-- Add condition for Item 33606 "Lurielle''s Pendant" to only target Chill Nymph 23678 +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=18 AND `SourceEntry`=33606; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(18,0,33606,0,24,1,23678,0,63,'','Item 33606 Lurielle''s Pendant targets Chill Nymph 23678'); diff --git a/sql/old/3.3.5a/2011_02_28_03_world_sai.sql b/sql/old/3.3.5a/2011_02_28_03_world_sai.sql new file mode 100644 index 0000000000000..5ecf98abfda5c --- /dev/null +++ b/sql/old/3.3.5a/2011_02_28_03_world_sai.sql @@ -0,0 +1,65 @@ +-- SAI for Thoralius the Wise +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=23975; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=23975; +DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid` IN (2397500,2397501,2397502,2397503); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +-- AI Section +(23975,0,0,1,1,0,100,0,60000,120000,300000,300000,91,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Thoralius the Wise - every 5 min Stand'), +(23975,0,1,0,61,0,100,0,0,0,0,0,53,0,23975,0,0,0,0,1,0,0,0,0,0,0,0, 'Thoralius the Wise - Start WP'), +(23975,0,2,0,40,0,100,0,2,23975,0,0,80,2397500,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Thoralius the Wise - Load script 1 at WP 2'), +(23975,0,3,0,40,0,100,0,4,23975,0,0,80,2397501,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Thoralius the Wise - Load script 2 at WP 4'), +(23975,0,4,0,40,0,100,0,7,23975,0,0,80,2397502,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Thoralius the Wise - Load script 3 at WP 7'), +(23975,0,5,0,40,0,100,0,8,23975,0,0,80,2397503,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Thoralius the Wise - Load script 4 at WP 8'), +-- Script 1 +(2397500,9,0,0,0,0,100,0,0,0,0,0,54,4000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Thoralius the Wise - Pause at WP 2'), +(2397500,9,1,0,0,0,100,0,0,0,0,0,11,42837,3,0,0,0,0,1,0,0,0,0,0,0,0, 'Thoralius the Wise - Cast 42837'), +(2397500,9,2,0,0,0,100,0,1000,1000,0,0,66,0,0,0,0,0,0,19,24046,0,0,0,0,0,0, 'Thoralius the Wise - Turn to face spirit Totem (Fire)'), +(2397500,9,3,0,0,0,100,0,500,500,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Thoralius the Wise - say text 0'), +-- Script 2 +(2397501,9,0,0,0,0,100,0,0,0,0,0,54,4000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Thoralius the Wise - Pause at WP 4'), +(2397501,9,1,0,0,0,100,0,0,0,0,0,11,42838,3,0,0,0,0,1,0,0,0,0,0,0,0, 'Thoralius the Wise - Cast 42838'), +(2397501,9,2,0,0,0,100,0,1000,1000,0,0,66,0,0,0,0,0,0,19,24045,0,0,0,0,0,0, 'Thoralius the Wise - Turn to face spirit Totem (Water)'), +(2397501,9,3,0,0,0,100,0,500,500,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Thoralius the Wise - Say text 1'), +-- Script 3 +(2397502,9,0,0,0,0,100,0,0,0,0,0,54,53000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Thoralius the Wise - Pause at WP 7'), +(2397502,9,1,0,0,0,100,0,0,0,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Thoralius the Wise - Do text 2'), +(2397502,9,2,0,0,0,100,0,1000,1000,0,0,17,64,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Thoralius the Wise - do emote state STATE_STUN'), +(2397502,9,3,0,0,0,100,0,45000,45000,0,0,17,26,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Thoralius the Wise - do emote state STATE_STAND'), +(2397502,9,4,0,0,0,100,0,2000,2000,0,0,1,3,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Thoralius the Wise - Do text 3'), +-- Script 4 +(2397503,9,0,0,0,0,100,0,8,23975,0,0,55,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Thoralius the Wise - Stop at WP 8'), +(2397503,9,1,0,0,0,100,0,500,500,0,0,66,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Thoralius the Wise - Reset heading at WP 8'), +(2397503,9,2,0,0,0,100,0,500,500,0,0,90,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Thoralius the Wise - sit at WP 8'); + +-- NPC talk text insert +DELETE FROM `creature_text` WHERE `entry`=23975; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(23975,0,0, 'Fire grant me vision...',0,7,100,20,0,0, 'Thoralius the Wise'), +(23975,1,0, 'Water grant me serenity...',0,7,100,20,0,0, 'Thoralius the Wise'), +(23975,2,0, '%s inhales the wispy smoke tendrils emanating from the burner.',2,7,100,0,0,0, 'Thoralius the Wise'), +(23975,3,0, 'Thank you, spirits.',0,7,100,2,0,0, 'Thoralius the Wise'); + +-- Waypoints for Thoralius the Wise from sniff +DELETE FROM `waypoints` WHERE `entry`=23975; +INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES +(23975,1,637.177,-5011.109,4.653919,'Thoralius the Wise WP 1'), +(23975,2,634.8372,-5010.296,4.528919,'Thoralius the Wise WP 2'), +(23975,3,637.9232,-5015.031,4.528919,'Thoralius the Wise WP 3'), +(23975,4,636.0419,-5016.675,4.153919,'Thoralius the Wise WP 4'), +(23975,5,638.2552,-5013.186,4.653919,'Thoralius the Wise WP 5'), +(23975,6,637.7585,-5013.268,4.653919,'Thoralius the Wise WP 6'), +(23975,7,636.8245,-5013.386,4.528919,'Thoralius the Wise WP 7'), +(23975,8,638.2552,-5013.186,4.653919,'Thoralius the Wise WP 8'); + +-- Add spell target positions +DELETE FROM `spell_target_position` WHERE `id` IN (42837,42838); +INSERT INTO `spell_target_position` (`id`,`target_map`,`target_position_x`,`target_position_y`,`target_position_z`,`target_orientation`) VALUES +(42837,571,634.094,-5010.67,4.419494,2.807002), +(42838,571,635.081,-5016.87,4.138474,3.859472); + +-- Ascented Mage Hunter SAI +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=25724; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (25724); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(25724,0,0,0,11,0,100,0,0,0,0,0,8,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Ascented Mage Hunter - On reset - Set react state passive'), +(25724,0,1,0,1,0,100,1,1000,1000,1000,1000,11,45940,0,0,0,0,0,9,25594,0,10,0,0,0,0,'Ascented Mage Hunter - On reset - Cast Evanor''s Prison Chains'); \ No newline at end of file diff --git a/sql/old/3.3.5a/2011_02_28_04_world_sai.sql b/sql/old/3.3.5a/2011_02_28_04_world_sai.sql new file mode 100644 index 0000000000000..fda69483394b7 --- /dev/null +++ b/sql/old/3.3.5a/2011_02_28_04_world_sai.sql @@ -0,0 +1,55 @@ +-- c27842 Fenrick Barlowe +-- ================================ +SET @ENTRY := 27842; +SET @SCRIPT1 := 2784201; +SET @SCRIPT2 := 2784202; +-- ================================ +-- take random movement off of npc (smartAI will control pathing) +UPDATE `creature` SET `spawndist`=0, `MovementType`=0 WHERE `guid`=114186; +-- * create text into the DB +DELETE FROM `creature_text` WHERE `entry`=@ENTRY; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@ENTRY,0,0, 'Bat gizzards again for the gnomes tonight...',0,0,100,1,0,0, 'Fenrick Barlowe text'), +(@ENTRY,0,1, 'What do they expect, making the bats come in at that angle? Broken necks and gamey bat stew, that''s what they get.',0,0,100,1,0,0, 'Fenrick Barlowe text'), +(@ENTRY,0,2, '''We like trees, Fenrick. They provide cover.'' They won''t let me chop them down, either.',0,0,100,1,0,0, 'Fenrick Barlowe text'), +(@ENTRY,0,3, 'I wonder how many reinforcements need to suffer injury before they allows us to chop down these idiotic trees. They''re costing us a fortune in bats. Maybe I''ll rig a harness or two...',0,0,100,1,0,0, 'Fenrick Barlowe text'); +-- create path +-- point 8 reposition to face bat, do text - kneel for 10 seconds +-- point 5 do text - kneel for 10 seconds +DELETE FROM `waypoints` WHERE `entry`=@ENTRY; +INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES +(@ENTRY,1,3246.2,-642.609,165.239, 'Fenrick Barlowe path'), +(@ENTRY,2,3240.42,-645.154,165.399, 'Fenrick Barlowe path'), +(@ENTRY,3,3245.75,-664.935,166.789, 'Fenrick Barlowe path'), +(@ENTRY,4,3250.1,-663.819,166.789, 'Fenrick Barlowe path'), +(@ENTRY,5,3254.69,-661.435,167.188, 'Fenrick Barlowe path - kneel here - do text'), +(@ENTRY,6,3252.36,-659.146,167.118, 'Fenrick Barlowe path'), +(@ENTRY,7,3252.63,-648.746,165.904, 'Fenrick Barlowe path'), +(@ENTRY,8,3249.21,-647.163,165.7, 'Fenrick Barlowe path - kneel here - do text'); +-- set SAI to npc +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +-- create scripts for random text, emotes, and pathing +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid` IN (@SCRIPT1,@SCRIPT2); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +-- AI +(@ENTRY,0,0,0,11,0,100,0,0,0,0,0,53,0,@ENTRY,1,0,0,0,1,0,0,0,0,0,0,0, 'on spawn start path'), +(@ENTRY,0,1,0,40,0,100,0,5,@ENTRY,0,0,80,@SCRIPT1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'at wp 5 run script1'), +(@ENTRY,0,2,0,40,0,100,0,8,@ENTRY,0,0,80,@SCRIPT2,0,0,0,0,0,1,0,0,0,0,0,0,0, 'at wp 8 run script2'), +-- script 1 +(@SCRIPT1,9,0,0,0,0,100,0,0,0,0,0,54,13000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'pause pathing'), +(@SCRIPT1,9,1,0,0,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'say random text'), +(@SCRIPT1,9,2,0,0,0,100,0,0,0,0,0,90,8,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Set bytes1=8 kneel'), +(@SCRIPT1,9,3,0,0,0,100,0,11000,11000,0,0,91,8,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Set bytes1=0 stand up'), +-- script 2 +(@SCRIPT2,9,0,0,0,0,100,0,0,0,0,0,54,14000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'pause pathing'), +(@SCRIPT2,9,1,0,40,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'say random text'), +(@SCRIPT2,9,2,0,0,0,100,0,1000,1000,0,0,66,0,0,0,0,0,0,10,108509,27787,0,0,0,0,0, 'face bat'), +(@SCRIPT2,9,3,0,0,0,100,0,1000,1000,0,0,90,8,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Set bytes1=8 kneel'), +(@SCRIPT2,9,4,0,0,0,100,0,11000,11000,0,0,91,8,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Set bytes1=0 stand up'); +-- need the following fix also +-- c27787 Venomspite Riding Bat +UPDATE `creature` SET `unit_flags`=`unit_flags`|570688256,`dynamicflags`=`dynamicflags`|32 WHERE `guid` IN (108508,108509); +DELETE FROM `creature_addon` WHERE `guid` IN (108508,108509); +INSERT INTO `creature_addon` (`guid`,`bytes2`,`auras`) VALUES +(108508,1, '29266 0 29266 1'),(108509,1, '29266 0 29266 1'); diff --git a/sql/old/3.3.5a/2011_02_28_05_world_vehicles.sql b/sql/old/3.3.5a/2011_02_28_05_world_vehicles.sql new file mode 100644 index 0000000000000..9ef6e21cb3b14 --- /dev/null +++ b/sql/old/3.3.5a/2011_02_28_05_world_vehicles.sql @@ -0,0 +1,129 @@ +-- Argent Tournament mounts implementation +SET @GUID = 151783; +UPDATE `creature_template` SET `npcflag`=`npcflag`|16777216,`speed_run`=1.5714285714286 WHERE `entry`=33870; -- Stabled Argent Warhorse +UPDATE `creature_template` SET `npcflag`=`npcflag`|16777216,`speed_run`=1.5714285714286 WHERE `entry`=33790; -- Stabled Exodar Elekk +UPDATE `creature_template` SET `npcflag`=`npcflag`|16777216,`speed_run`=1.5714285714286 WHERE `entry`=33791; -- Stabled Silvermoon Hawkstrider +UPDATE `creature_template` SET `npcflag`=`npcflag`|16777216,`speed_run`=1.5714285714286 WHERE `entry`=33792; -- Stabled Thunder Bluff Kodo +UPDATE `creature_template` SET `npcflag`=`npcflag`|16777216,`speed_run`=1.5714285714286 WHERE `entry`=33793; -- Stabled Gnomeregan Mechanostrider +UPDATE `creature_template` SET `npcflag`=`npcflag`|16777216,`speed_run`=1.5714285714286 WHERE `entry`=33794; -- Stabled Darnassian Nightsaber +UPDATE `creature_template` SET `npcflag`=`npcflag`|16777216,`speed_run`=1.5714285714286 WHERE `entry`=33795; -- Stabled Ironforge Ram +UPDATE `creature_template` SET `npcflag`=`npcflag`|16777216,`speed_run`=1.5714285714286 WHERE `entry`=33796; -- Stabled Darkspear Raptor +UPDATE `creature_template` SET `npcflag`=`npcflag`|16777216,`speed_run`=1.5714285714286 WHERE `entry`=33798; -- Stabled Forsaken Warhorse +UPDATE `creature_template` SET `npcflag`=`npcflag`|16777216,`speed_run`=1.5714285714286 WHERE `entry`=33799; -- Stabled Orgrimmar Wolf +UPDATE `creature_template` SET `npcflag`=`npcflag`|16777216,`speed_run`=1.5714285714286 WHERE `entry`=33800; -- Stabled Stormwind Steed +UPDATE `creature_template` SET `npcflag`=`npcflag`|16777216,`speed_run`=1.5714285714286 WHERE `entry`=33842; -- Stabled Sunreaver Hawkstrider +UPDATE `creature_template` SET `npcflag`=`npcflag`|16777216,`speed_run`=1.5714285714286 WHERE `entry`=33843; -- Stabled Quel'dorei Steed + +UPDATE `creature_model_info` SET `bounding_radius`=1,`combat_reach`=1,`gender`=0 WHERE `modelid`=29255; -- Stabled Exodar Elekk +UPDATE `creature_model_info` SET `bounding_radius`=1.185,`combat_reach`=2.25,`gender`=0 WHERE `modelid`=29256; -- Stabled Darnassian Nightsaber +UPDATE `creature_model_info` SET `bounding_radius`=0.818,`combat_reach`=2,`gender`=0 WHERE `modelid`=29258; -- Stabled Ironforge Ram +UPDATE `creature_model_info` SET `bounding_radius`=0.35,`combat_reach`=1.5,`gender`=0 WHERE `modelid`=29261; -- Stabled Darkspear Raptor +UPDATE `creature_model_info` SET `bounding_radius`=0,`combat_reach`=1,`gender`=2 WHERE `modelid`=28918; -- Stabled Argent Warhorse + +DELETE FROM `creature_template_addon` WHERE `entry` IN (33870,33790,33791,33792,33793,33794,33795,33796,33798,33799,33800,33842,33843); +INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(33870,0,0,1,0, NULL), -- Stabled Argent Warhorse +(33790,0,0,1,0, NULL), -- Stabled Exodar Elekk +(33791,0,0,1,0, NULL), -- Stabled Silvermoon Hawkstrider +(33792,0,0,1,0, NULL), -- Stabled Thunder Bluff Kodo +(33793,0,0,1,0, NULL), -- Stabled Gnomeregan Mechanostrider +(33794,0,0,1,0, NULL), -- Stabled Darnassian Nightsaber +(33795,0,0,1,0, NULL), -- Stabled Ironforge Ram +(33796,0,0,1,0, NULL), -- Stabled Darkspear Raptor +(33798,0,0,1,0, NULL), -- Stabled Forsaken Warhorse +(33799,0,0,1,0, NULL), -- Stabled Orgrimmar Wolf +(33800,0,0,1,0, NULL), -- Stabled Stormwind Steed +(33842,0,0,1,0, NULL), -- Stabled Sunreaver Hawkstrider +(33843,0,0,1,0, NULL); -- Stabled Quel'dorei Steed + +UPDATE `creature_template` SET `npcflag`=`npcflag`|16777216,`unit_flags`=0,`speed_run`=1.5714285714286,`vehicleid`=349 WHERE `entry`=33782; -- Argent Warhorse +UPDATE `creature_template` SET `npcflag`=`npcflag`|16777216,`faction_A`=35,`faction_H`=35,`unit_flags`=0,`speed_run`=1.5714285714286,`vehicleid`=349 WHERE `entry`=33318; -- Exodar Elekk +UPDATE `creature_template` SET `npcflag`=`npcflag`|16777216,`unit_flags`=0,`speed_run`=1.5714285714286,`vehicleid`=349 WHERE `entry`=33323; -- Silvermoon Hawkstrider +UPDATE `creature_template` SET `npcflag`=`npcflag`|16777216,`unit_flags`=0,`speed_run`=1.5714285714286,`vehicleid`=349 WHERE `entry`=33322; -- Thunder Bluff Kodo +UPDATE `creature_template` SET `npcflag`=`npcflag`|16777216,`faction_A`=35,`faction_H`=35,`unit_flags`=0,`speed_run`=1.5714285714286,`vehicleid`=349 WHERE `entry`=33317; -- Gnomeregan Mechanostrider +UPDATE `creature_template` SET `npcflag`=`npcflag`|16777216,`faction_A`=35,`faction_H`=35,`unit_flags`=0,`speed_run`=1.5714285714286,`vehicleid`=349 WHERE `entry`=33319; -- Darnassian Nightsaber +UPDATE `creature_template` SET `npcflag`=`npcflag`|16777216,`unit_flags`=0,`speed_run`=1.5714285714286,`vehicleid`=349 WHERE `entry`=33316; -- Ironforge Ram +UPDATE `creature_template` SET `npcflag`=`npcflag`|16777216,`unit_flags`=0,`speed_run`=1.5714285714286,`vehicleid`=349 WHERE `entry`=33321; -- Darkspear Raptor +UPDATE `creature_template` SET `npcflag`=`npcflag`|16777216,`unit_flags`=0,`speed_run`=1.5714285714286,`vehicleid`=349 WHERE `entry`=33324; -- Forsaken Warhorse +UPDATE `creature_template` SET `npcflag`=`npcflag`|16777216,`unit_flags`=0,`speed_run`=1.5714285714286,`vehicleid`=349 WHERE `entry`=33320; -- Orgrimmar Wolf +UPDATE `creature_template` SET `npcflag`=`npcflag`|16777216,`faction_A`=35,`faction_H`=35,`unit_flags`=0,`speed_run`=1.5714285714286,`vehicleid`=349 WHERE `entry`=33845; -- Quel'dorei Steed +UPDATE `creature_template` SET `npcflag`=`npcflag`|16777216,`unit_flags`=0,`speed_run`=1.5714285714286,`vehicleid`=349 WHERE `entry`=33844; -- Sunreaver Hawkstrider +UPDATE `creature_template` SET `npcflag`=`npcflag`|16777216,`unit_flags`=0,`speed_run`=1.5714285714286,`vehicleid`=349 WHERE `entry`=33217; -- Stormwind Steed + +UPDATE `creature_template` SET +`spell1`=62544, -- Thurst +`spell2`=62575, -- Shield-Breaker +`spell3`=62960, -- Charge +`spell4`=62552, -- Defend +`spell5`=64077, -- Refresh Mount +`spell6`=62863, -- Duel +`spell7`=63034 -- Player On Tournament Mount (aura) +WHERE `vehicleid`=349; + +DELETE FROM `npc_spellclick_spells` WHERE `npc_entry` IN (33870,33790,33791,33792,33793,33794,33795,33796,33798,33799,33800,33842,33843); +INSERT INTO `npc_spellclick_spells` (`npc_entry`,`spell_id`,`quest_start`,`quest_start_active`,`quest_end`,`cast_flags`,`aura_required`,`aura_forbidden`,`user_type`) VALUES +(33870,63663,13664,1,1,1,62853,0,0), -- Stabled Argent Warhorse - Summon Tournament Argent Charger - requires quest The Black Knight's Fall (shall not be completed nor rewarded) +(33790,62781,13690,0,0,1,62853,0,0), -- Stabled Exodar Elekk - Summon Tournament Elekk - requires quest A Valiant Of The Exodar +(33791,62786,13696,0,0,1,62853,0,0), -- Stabled Silvermoon Hawkstrider - Summon Tournament Hawkstrider - requires quest A Valiant Of Silvermoon +(33792,62785,13694,0,0,1,62853,0,0), -- Stabled Thunder Bluff Kodo - Summon Tournament Kodo - requires quest A Valiant Of Thunder Bluff +(33793,62780,13688,0,0,1,62853,0,0), -- Stabled Gnomeregan Mechanostrider - Summon Tournament Mechanostrider - requires quest A Valiant Of Gnomeregan +(33794,62782,13689,0,0,1,62853,0,0), -- Stabled Darnassian Nightsaber - Summon Tournament Nightsaber - requires quest A Valiant Of Darnassus +(33795,62779,13685,0,0,1,62853,0,0), -- Stabled Ironforge Ram - Summon Tournament Ram - requires quest A Valiant Of Ironforge +(33796,62784,13693,0,0,1,62853,0,0), -- Stabled Darkspear Raptor - Summon Tournament Raptor - requires quest A Valiant Of Sen'jin +(33798,62787,13695,0,0,1,62853,0,0), -- Stabled Forsaken Warhorse - Summon Tournament Warhorse - requires quest A Valiant Of Undercity +(33799,62783,13691,0,0,1,62853,0,0), -- Stabled Orgrimmar Wolf - Summon Tournament Wolf - requires quest A Valiant Of Orgrimmar +(33800,62774,13684,0,0,1,62853,0,0), -- Stabled Stormwind Steed - Summon Tournament Charger - requires quest A Valiant Of Stormwind +(33842,63791,13668,0,0,1,62853,0,0), -- Stabled Sunreaver Hawkstrider - Summon Tournament Hawkstrider (Aspirant) - requires quest The Argent Tournament (H/Argent Aspiration) +(33843,63792,13667,0,0,1,62853,0,0); -- Stabled Quel'dorei Steed - Summon Tournament Steed (Aspirant) - requires quest The Argent Tournament (A/Argent Aspiration) +-- Note: spell 62853 (Lance Equipped) is required for all vehicles. + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=16 AND `ConditionTypeOrReference`=1 AND `ConditionValue1`=64373; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +-- dismount in wrong zones condition +(16,0,33782,0,1,64373,0,0,0,'', 'Vehicle Argent Warhorse requires aura Armistice'), +(16,0,33318,0,1,64373,0,0,0,'', 'Vehicle Exodar Elekk requires aura Armistice'), +(16,0,33323,0,1,64373,0,0,0,'', 'Vehicle Silvermoon Hawkstrider requires aura Armistice'), +(16,0,33322,0,1,64373,0,0,0,'', 'Vehicle Thunder Bluff Kodo requires aura Armistice'), +(16,0,33317,0,1,64373,0,0,0,'', 'Vehicle Gnomeregan Mechanostrider requires aura Armistice'), +(16,0,33319,0,1,64373,0,0,0,'', 'Vehicle Darnassian Nightsaber requires aura Armistice'), +(16,0,33316,0,1,64373,0,0,0,'', 'Vehicle Ironforge Ram requires aura Armistice'), +(16,0,33321,0,1,64373,0,0,0,'', 'Vehicle Darkspear Raptor requires aura Armistice'), +(16,0,33324,0,1,64373,0,0,0,'', 'Vehicle Forsaken Warhorse requires aura Armistice'), +(16,0,33320,0,1,64373,0,0,0,'', 'Vehicle Orgrimmar Wolf requires aura Armistice'), +(16,0,33845,0,1,64373,0,0,0,'', 'Vehicle Quel''dorei Steed requires aura Armistice'), +(16,0,33844,0,1,64373,0,0,0,'', 'Vehicle Sunreaver Hawkstrider requires aura Armistice'), +(16,0,33217,0,1,64373,0,0,0,'', 'Vehicle Stormwind Steed requires aura Armistice'); +-- race conditions + +DELETE FROM `creature_template_addon` WHERE `entry` IN (33782,33318,33323,33322,33317,33319,33316,33321,33324,33320,33845,33844,33217); +INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(33782,0,0,2305,0, NULL), -- Argent Warhorse +(33318,0,0,2305,0, NULL), -- Exodar Elekk +(33323,0,0,2305,0, NULL), -- Silvermoon Hawkstrider +(33322,0,0,2305,0, NULL), -- Thunder Bluff Kodo +(33317,0,0,2305,0, NULL), -- Gnomeregan Mechanostrider +(33319,0,0,2305,0, NULL), -- Darnassian Nightsaber +(33316,0,0,2305,0, NULL), -- Ironforge Ram +(33321,0,0,2305,0, NULL), -- Darkspear Raptor +(33324,0,0,2305,0, NULL), -- Forsaken Warhorse +(33320,0,0,2305,0, NULL), -- Orgrimmar Wolf +(33845,0,0,2305,0, NULL), -- Quel''dorei Steed +(33844,0,0,2305,0, NULL), -- Sunreaver Hawkstrider +(33217,0,0,2305,0, NULL); -- Stormwind Steed + +UPDATE `creature_model_info` SET `bounding_radius`=1,`combat_reach`=1,`gender`=0 WHERE `modelid`=29255; -- Exodar Elekk +UPDATE `creature_model_info` SET `bounding_radius`=1.185,`combat_reach`=2.25,`gender`=0 WHERE `modelid`=29256; -- Darnassian Nightsaber +UPDATE `creature_model_info` SET `bounding_radius`=2,`combat_reach`=0,`gender`=0 WHERE `modelid`=29258; -- Ironforge Ram +UPDATE `creature_model_info` SET `bounding_radius`=0.35,`combat_reach`=1.5,`gender`=0 WHERE `modelid`=29261; -- Darkspear Raptor + +-- Add more Tournament Stables to enable the use of all spawned vehicles +UPDATE `gameobject` SET `rotation0`=0,`rotation1`=0,`rotation2`=0,`rotation3`=0,`spawntimesecs`=300,`animprogress`=0 WHERE `id`=300008; -- equal field values for all the entries +DELETE FROM `gameobject` WHERE `guid` BETWEEN @GUID AND @GUID+6 AND `id`=300008; -- TEMP Tournament Stables +INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES +(@GUID+0,300008,571,1,1,8569.54,670.423,547.397,5.96851,0,0,0.156691,-0.987648,300,0,1), +(@GUID+1,300008,571,1,1,8569.74,658.995,547.453,6.07846,0,0,0.102183,-0.994766,300,0,1), +(@GUID+2,300008,571,1,1,8409.89,707.879,547.314,3.5212,0,0,0.982041,-0.188668,300,0,1), +(@GUID+3,300008,571,1,1,8421.63,707.685,547.37,4.31917,0,0,0.831614,-0.555354,300,0,1), +(@GUID+4,300008,571,1,1,8488.82,920.117,547.293,5.78943,0,0,0.244376,-0.969681,300,0,1), +(@GUID+5,300008,571,1,1,8486.61,935.808,547.293,5.73289,0,0,0.271691,-0.962385,300,0,1), +(@GUID+6,300008,571,1,1,8490.55,953.448,547.293,4.61212,0,0,0.741653,-0.670784,300,0,1); diff --git a/sql/old/3.3.5a/2011_02_28_06_world_gameobject.sql b/sql/old/3.3.5a/2011_02_28_06_world_gameobject.sql new file mode 100644 index 0000000000000..37fddc83ce61c --- /dev/null +++ b/sql/old/3.3.5a/2011_02_28_06_world_gameobject.sql @@ -0,0 +1 @@ +DELETE FROM `gameobject` WHERE `guid` BETWEEN 200000 AND 200000+6 AND `id`=300008; -- Wrong GUIDs for Tournament Stables diff --git a/sql/old/3.3.5a/2011_02_28_07_world_creature_template.sql b/sql/old/3.3.5a/2011_02_28_07_world_creature_template.sql new file mode 100644 index 0000000000000..03d8922005296 --- /dev/null +++ b/sql/old/3.3.5a/2011_02_28_07_world_creature_template.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `npcflag`=`npcflag`|16777216 WHERE `entry` IN (31748,32795,32796,34045); -- Dificully entries diff --git a/sql/old/3.3.5a/2011_03_01_01_world_conditions.sql b/sql/old/3.3.5a/2011_03_01_01_world_conditions.sql new file mode 100644 index 0000000000000..c113740004009 --- /dev/null +++ b/sql/old/3.3.5a/2011_03_01_01_world_conditions.sql @@ -0,0 +1,6 @@ +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=36325; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(13,0,36325,0,18,1,21182,0,0,'','Spell 36325 target creature 21182'), +(13,0,36325,0,18,1,22401,0,0,'','Spell 36325 target creature 22401'), +(13,0,36325,0,18,1,22402,0,0,'','Spell 36325 target creature 22402'), +(13,0,36325,0,18,1,22403,0,0,'','Spell 36325 target creature 22403'); \ No newline at end of file diff --git a/sql/old/3.3.5a/2011_03_01_02_world_creature_template.sql b/sql/old/3.3.5a/2011_03_01_02_world_creature_template.sql new file mode 100644 index 0000000000000..b799e54617e70 --- /dev/null +++ b/sql/old/3.3.5a/2011_03_01_02_world_creature_template.sql @@ -0,0 +1,3 @@ +UPDATE `creature_template` SET `npcflag`=`npcflag`|16777216 WHERE `entry` IN (27894,28781,30234,33062); -- match npcflag with diffentries (that got updated on 2011_02_28_7) +UPDATE `creature_template` SET `VehicleId`=335 WHERE `entry`=34045; -- Salvaged Chopper (1) +UPDATE `creature_template` SET `VehicleId`=335 WHERE `entry`=31748; -- Hover Disk (1) diff --git a/sql/old/3.3.5a/2011_03_01_03_world_sai.sql b/sql/old/3.3.5a/2011_03_01_03_world_sai.sql new file mode 100644 index 0000000000000..37a4afdf06ce2 --- /dev/null +++ b/sql/old/3.3.5a/2011_03_01_03_world_sai.sql @@ -0,0 +1,31 @@ +-- Quest 9303 "Inoculation" +SET @OWL := 16518; -- Nestlewood Owlkin +SET @IOWL := 16534; -- Inoculated Nestlewood Owlkin +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=@OWL; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@OWL; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND`entryorguid`=@OWL; +DELETE FROM `smart_scripts` WHERE `source_type`=9 AND`entryorguid`=@OWL*100; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@OWL,0,0,0,8,0,100,0,29528,0,3000,3000,80,@OWL*100,0,0,0,0,0,1,0,0,0,0,0,0,0, 'on spellhit run script'), +(@OWL*100,9,0,0,0,0,100,0,3000,3000,0,0,66,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'face player'), +(@OWL*100,9,1,0,0,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'say random text from groupid 0'), +(@OWL*100,9,2,0,0,0,100,0,0,0,0,0,36,@IOWL,0,0,0,0,0,1,0,0,0,0,0,0,0,'morph to entry'), +(@OWL*100,9,3,0,0,0,100,0,0,0,0,0,18,33024,0,0,0,0,0,1,0,0,0,0,0,0,0,'change unitflags'), +(@OWL*100,9,4,0,0,0,100,0,300,300,0,0,33,@IOWL,0,0,0,0,0,7,0,0,0,0,0,0,0,'give quest credit'), +(@OWL*100,9,5,0,0,0,100,0,500,500,0,0,89,15,0,0,0,0,0,1,0,0,0,0,0,0,0,'random movement'), +(@OWL*100,9,6,0,0,0,100,0,9000,9000,0,0,36,@OWL,0,0,0,0,0,1,0,0,0,0,0,0,0,'change entry back'), +(@OWL*100,9,7,0,0,0,100,0,0,0,0,0,19,256,0,0,0,0,0,1,0,0,0,0,0,0,0,'change unitflags back'), +(@OWL*100,9,8,0,0,0,100,0,0,0,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'despawn'); + +-- NPC talk text insert from sniff +DELETE FROM `creature_text` WHERE `entry`=16518; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(16518,0,0, 'The %s seems overjoyed.',2,0,100,0,0,0, 'Inoculated Nestlewood Owlkin'), +(16518,0,1, 'The %s seems disoriented.',2,0,100,0,0,0, 'Inoculated Nestlewood Owlkin'), +(16518,0,2, 'The %s doesn''t look like it minds the crystal''s effects.',2,0,100,0,0,0, 'Inoculated Nestlewood Owlkin'), +(16518,0,3, 'The %s didn''t like what just happened.',2,0,100,0,0,0, 'Inoculated Nestlewood Owlkin'), +(16518,0,4, 'The %s looks confused.',2,0,100,0,0,0, 'Inoculated Nestlewood Owlkin'), +(16518,0,5, 'The %s nods appreciatively.',2,0,100,0,0,0, 'Inoculated Nestlewood Owlkin'); + +-- spell does not target the innoculated owlkin and it is not spawned, so take spell requirement out of equation +UPDATE `quest_template` SET `ReqSpellCast1`=0 WHERE `entry`=9303; diff --git a/sql/old/3.3.5a/2011_03_01_03_world_scriptname.sql b/sql/old/3.3.5a/2011_03_01_03_world_scriptname.sql new file mode 100644 index 0000000000000..3bd548577441b --- /dev/null +++ b/sql/old/3.3.5a/2011_03_01_03_world_scriptname.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName`='' WHERE `entry`=16518; diff --git a/sql/old/3.3.5a/2011_03_01_04_world_sai.sql b/sql/old/3.3.5a/2011_03_01_04_world_sai.sql new file mode 100644 index 0000000000000..05772307157a8 --- /dev/null +++ b/sql/old/3.3.5a/2011_03_01_04_world_sai.sql @@ -0,0 +1,159 @@ +-- Apothecary Enith Fixup for quest 9164 "Captives at Deatholme" +-- add gossip_id to npc and fix stand state +UPDATE `creature_template` SET `gossip_menu_id`=7182,`unit_flags`=33024 WHERE `entry`=16208; +DELETE FROM `creature_template_addon` WHERE `entry`=16208; +INSERT INTO `creature_template_addon` (`entry`,`bytes1`) VALUES (16208,7); +-- add gossip menu items +DELETE FROM `gossip_menu` WHERE `entry` IN (7182,7179); +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES +(7182,8459), +(7179,8460); +-- add gossip menu options +DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (7182,7179); +INSERT INTO `gossip_menu_option` (`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`) VALUES +(7182,0,0,'',1,1,7179,0,0,0,0,''), +(7179,0,0,'A bit ungrateful, aren''t we? The way out is clear, flee quickly!',1,1,0,0,0,0,0,''); +-- add condition for gossip option +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=7182; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(15,7182,0,0,2,22628,1,0,0,'','Show gossip option 0 if player has Renzithen''s Restorative Draught'); +-- Apothecary Enith SAI +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=16208; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (16208,1620800); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(16208,0,0,0,62,0,100,0,7179,0,0,0,80,1620800,0,0,0,0,0,1,0,0,0,0,0,0,0, 'On gossip option select run script'), +(16208,0,1,0,40,0,100,0,5,16208,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'On reach waypoint 5 despawn'), +(1620800,9,0,0,0,0,100,0,0,0,0,0,81,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Turn off Gossip flag'), +(1620800,9,1,0,0,0,100,0,0,0,0,0,91,7,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Set bytes1 stand'), +(1620800,9,2,0,0,0,100,0,0,0,0,0,66,0,0,0,0,0,0,7,0,0,0,0,0,0,0, 'turn to envoker'), +(1620800,9,3,0,0,0,100,0,1000,1000,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Say text 0'), +(1620800,9,4,0,0,0,100,0,2000,2000,0,0,33,16208,0,0,0,0,0,7,0,0,0,0,0,0,0, 'give quest credit'), +(1620800,9,5,0,0,0,100,0,1000,1000,0,0,53,1,16208,0,0,0,0,1,0,0,0,0,0,0,0, 'start waypoint movement'); +-- NPC talk text insert from sniff +DELETE FROM `creature_text` WHERE `entry`=16208; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(16208,0,0, 'Thanks, I should''ve never left Silverpine Forest.',0,0,100,6,0,0, 'Apothecary Enith'); +-- Apothecary Enith Path +DELETE FROM `waypoints` WHERE `entry`=16208; +INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES +(16208,1,6647.83,-6344.92,9.13345,'Apothecary Enith point 1'), +(16208,2,6657.92,-6345.96,15.3468,'Apothecary Enith point 2'), +(16208,3,6661.58,-6342.65,15.4309,'Apothecary Enith point 3'), +(16208,4,6662.35,-6334.64,20.8803,'Apothecary Enith point 4'), +(16208,5,6662.63,-6331.85,20.8924,'Apothecary Enith point 5'); + +-- Ranger Vedoran Fixup for quest 9164 "Captives at Deatholme" +-- add gossip_id to npc and fix stand state +UPDATE `creature_template` SET `gossip_menu_id`=7177 WHERE `entry`=16209; +-- add gossip menu items +DELETE FROM `gossip_menu` WHERE `entry` IN (7177,7176); +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES +(7177,8457), +(7176,8456); +-- add gossip menu options +DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (7177,7176); +INSERT INTO `gossip_menu_option` (`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`) VALUES +(7177,0,0,'',1,1,7176,0,0,0,0,''), +(7176,0,0,'You''re free to go now. The way out is safe.',1,1,0,0,0,0,0,''); +-- add condition for gossip option +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=7177; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(15,7177,0,0,2,22628,1,0,0,'','Show gossip option 0 if player has Renzithen''s Restorative Draught'); +-- Ranger Vedoran SAI +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=16209; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (16209,1620900); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(16209,0,0,0,62,0,100,0,7176,0,0,0,80,1620900,0,0,0,0,0,1,0,0,0,0,0,0,0, 'On gossip option select run script'), +(16209,0,1,0,40,0,100,0,7,16209,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'On reach waypoint 7 despawn'), +(1620900,9,0,0,0,0,100,0,0,0,0,0,81,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Turn off Gossip flag'), +(1620900,9,1,0,0,0,100,0,0,0,0,0,91,7,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Set bytes1 stand'), +(1620900,9,2,0,0,0,100,0,0,0,0,0,66,0,0,0,0,0,0,7,0,0,0,0,0,0,0, 'turn to envoker'), +(1620900,9,3,0,0,0,100,0,1000,1000,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Say text 0'), +(1620900,9,4,0,0,0,100,0,2000,2000,0,0,33,16209,0,0,0,0,0,7,0,0,0,0,0,0,0, 'give quest credit'), +(1620900,9,5,0,0,0,100,0,1000,1000,0,0,53,1,16209,0,0,0,0,1,0,0,0,0,0,0,0, 'start waypoint movement'); +-- NPC talk text insert from sniff +DELETE FROM `creature_text` WHERE `entry`=16209; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(16209,0,0, 'You have my thanks!',0,0,100,0,0,0, 'Ranger Vedoran'); +-- Ranger Vedoran Path +DELETE FROM `waypoints` WHERE `entry`=16209; +INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES +(16209,1,6290.21,-6366.1,78.0195,'Ranger Vedoran point 1'), +(16209,2,6301.65,-6364.06,78.0238,'Ranger Vedoran point 2'), +(16209,3,6305.82,-6360.2,78.0782,'Ranger Vedoran point 3'), +(16209,4,6310.5,-6356.76,80.6154,'Ranger Vedoran point 4'), +(16209,5,6314.06,-6360.67,82.6096,'Ranger Vedoran point 5'), +(16209,6,6317.35,-6365.34,82.7124,'Ranger Vedoran point 6'), +(16209,7,6326.85,-6366.82,82.7090,'Ranger Vedoran point 7'); + +-- Apprentice Varnis Fixup for quest 9164 "Captives at Deatholme" +-- add gossip_id to npc and fix stand state +UPDATE `creature_template` SET `gossip_menu_id`=7185 WHERE `entry`=16206; +-- add gossip menu items +DELETE FROM `gossip_menu` WHERE `entry` IN (7185,7186); +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES +(7185,8461), +(7186,8463); +-- add gossip menu options +DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (7185,7186); +INSERT INTO `gossip_menu_option` (`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`) VALUES +(7185,0,0,'',1,1,7186,0,0,0,0,''), +(7186,0,0,'You''re free to go now. The way out is safe.',1,1,0,0,0,0,0,''); +-- add condition for gossip option +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=7185; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(15,7185,0,0,2,22628,1,0,0,'','Show gossip option 0 if player has Renzithen''s Restorative Draught'); +-- Apprentice Varnis SAI +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=16206; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (16206,1620600); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(16206,0,0,0,62,0,100,0,7186,0,0,0,80,1620600,0,0,0,0,0,1,0,0,0,0,0,0,0, 'On gossip option select run script'), +(16206,0,1,0,40,0,100,0,7,16206,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'On reach waypoint 7 despawn'), +(1620600,9,0,0,0,0,100,0,0,0,0,0,81,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Turn off Gossip flag'), +(1620600,9,1,0,0,0,100,0,0,0,0,0,91,7,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Set bytes1 stand'), +(1620600,9,2,0,0,0,100,0,0,0,0,0,66,0,0,0,0,0,0,7,0,0,0,0,0,0,0, 'turn to envoker'), +(1620600,9,3,0,0,0,100,0,1000,1000,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Say text 0'), +(1620600,9,4,0,0,0,100,0,2000,2000,0,0,33,16206,0,0,0,0,0,7,0,0,0,0,0,0,0, 'give quest credit'), +(1620600,9,5,0,0,0,100,0,1000,1000,0,0,53,1,16206,0,0,0,0,1,0,0,0,0,0,0,0, 'start waypoint movement'); +-- NPC talk text insert from sniff +DELETE FROM `creature_text` WHERE `entry`=16206; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(16206,0,0, 'Thank you. I thought I was going to die.',0,0,100,0,0,0, 'Apprentice Varnis'); +-- Apprentice Varnis Path +DELETE FROM `waypoints` WHERE `entry`=16206; +INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES +(16206,1,6436.87,-6633.02,107.432,'Apprentice Varnis point 1'), +(16206,2,6435.63,-6620.86,107.436,'Apprentice Varnis point 2'), +(16206,3,6429.88,-6618.29,108.128,'Apprentice Varnis point 3'), +(16206,4,6426.7,-6614.82,110.159,'Apprentice Varnis point 4'), +(16206,5,6428.75,-6611.21,111.905,'Apprentice Varnis point 5'), +(16206,6,6432.83,-6606.89,112.126,'Apprentice Varnis point 6'), +(16206,7,6431.51,-6597.97,112.113,'Apprentice Varnis point 7'); + +-- Gossip update Ghostlands +UPDATE `creature_template` SET `gossip_menu_id`=7242, `npcflag`=`npcflag`|1 WHERE `entry`=16204; -- Magister Idonis +UPDATE `creature_template` SET `gossip_menu_id`=7397, `npcflag`=`npcflag`|1 WHERE `entry`=16239; -- Magister Kaendris +UPDATE `creature_template` SET `gossip_menu_id`=7194, `npcflag`=`npcflag`|1 WHERE `entry`=16291; -- Magister Quallestis +UPDATE `creature_template` SET `gossip_menu_id`=7190, `npcflag`=`npcflag`|1 WHERE `entry`=16240; -- Arcanist Janeda +UPDATE `creature_template` SET `gossip_menu_id`=7187 WHERE `entry`=16198; -- Apothecary Renzithen +DELETE FROM `gossip_menu` WHERE `entry`=7242 AND `text_id`=8548; +DELETE FROM `gossip_menu` WHERE `entry`=7397 AND `text_id`=8860; +DELETE FROM `gossip_menu` WHERE `entry`=7194 AND `text_id`=8474; +DELETE FROM `gossip_menu` WHERE `entry`=7190 AND `text_id`=8470; +DELETE FROM `gossip_menu` WHERE `entry`=7187 AND `text_id`=8464; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES +(7242,8548),(7397,8860),(7194,8474),(7190,8470),(7187,8464); +-- Gossip menu option +DELETE FROM `gossip_menu_option` WHERE `menu_id`=7187; +INSERT INTO `gossip_menu_option` (`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`) VALUES +(7187,0,0,'I seek a sample of your restorative draught, apothecary.',1,1,0,0,0,0,0,''); +-- Gossip menu option condition +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=7187; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(15,7187,0,0,9,9164,0,0,0,'','Show gossip option 0 if player has quest 9164'); +-- Smart AI +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=16198; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=16198; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(16198,0,0,1,62,0,100,0,7187,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0, 'On gossip option select close gossip'), +(16198,0,1,0,61,0,100,0,0,0,0,0,11,28149,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Cast Create Restorative Draught on player '); diff --git a/sql/old/3.3.5a/2011_03_01_05_world_npc_trainer.sql b/sql/old/3.3.5a/2011_03_01_05_world_npc_trainer.sql new file mode 100644 index 0000000000000..ae9a533b620b2 --- /dev/null +++ b/sql/old/3.3.5a/2011_03_01_05_world_npc_trainer.sql @@ -0,0 +1,2 @@ +-- Set new tailoring requirement to learn crafting of Flying Carpet (based on 3.3.0 patch) +UPDATE `npc_trainer` SET `spellcost`=105000,`reqskillvalue`=300 WHERE `spell`=60969; diff --git a/sql/old/3.3.5a/2011_03_02_00_world_creature_template.sql b/sql/old/3.3.5a/2011_03_02_00_world_creature_template.sql new file mode 100644 index 0000000000000..b7ae2e1da4ebb --- /dev/null +++ b/sql/old/3.3.5a/2011_03_02_00_world_creature_template.sql @@ -0,0 +1,2 @@ +UPDATE `creature_template` SET `VehicleId`=283 WHERE `entry`=31748; -- Hover Disk (1) +UPDATE `creature_template` SET `VehicleId`=223 WHERE `entry`=31749; -- Hover Disk (1) diff --git a/sql/old/3.3.5a/2011_03_02_01_world_achievement_reward.sql b/sql/old/3.3.5a/2011_03_02_01_world_achievement_reward.sql new file mode 100644 index 0000000000000..2afcce64f7bad --- /dev/null +++ b/sql/old/3.3.5a/2011_03_02_01_world_achievement_reward.sql @@ -0,0 +1,5 @@ +-- Send in-game mail when player completes achievements Emblematic +DELETE FROM `achievement_reward` WHERE `entry` IN (4784,4785); +INSERT INTO `achievement_reward` (`entry`,`title_A`,`title_H`,`item`,`sender`,`subject`,`text`) VALUES +(4784,0,0,0,37942, 'Emblem Quartermasters in Dalaran''s Silver Enclave', 'Your achievements in Northrend have not gone unnoticed, friend.$B$BThe Emblems you have earned may be used to purchase equipment from the various Emblem Quartermasters in Dalaran.$B$BYou may find us there, in the Silver Enclave, where each variety of Emblem has its own quartermaster.$B$BWe look forward to your arrival!'), +(4785,0,0,0,37941, 'Emblem Quartermasters in Dalaran''s Sunreaver Sanctuary', 'Your achievements in Northrend have not gone unnoticed, friend.$B$BThe Emblems you have earned may be used to purchase equipment from the various Emblem Quartermasters in Dalaran.$B$BYou may find us there, in the Sunreaver Sanctuary, where each variety of Emblem has its own quartermaster.$B$BWe look forward to your arrival!'); diff --git a/sql/old/3.3.5a/2011_03_02_02_world_waypoint_data.sql b/sql/old/3.3.5a/2011_03_02_02_world_waypoint_data.sql new file mode 100644 index 0000000000000..baccd34f0ee69 --- /dev/null +++ b/sql/old/3.3.5a/2011_03_02_02_world_waypoint_data.sql @@ -0,0 +1,312 @@ +-- Remove some waypoint errors +UPDATE `creature` SET `MovementType`=0 WHERE `guid` IN (57763,57764,57765,57766); +UPDATE `creature_addon` SET `path_id`=0 WHERE `guid` IN (57763,57764,57765,57766); +DELETE FROM `waypoint_data` WHERE `id` IN (577630,577640,577650,577660); +DELETE FROM `waypoint_scripts` WHERE `id` IN (48,49,50,51); + +-- Mature Netherwing Drake Pathing From sniff 1 added. +SET @NPC := 75541; +SET @PATH := @NPC*10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=-4134.369,`position_y`=850.2852,`position_z`=61.26378 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,-4120.351,883.5854,61.26378,0,0,0,100,0), +(@PATH,2,-4085.13,900.4695,61.26378,0,0,0,100,0), +(@PATH,3,-4048.586,884.7811,61.26378,0,0,0,100,0), +(@PATH,4,-4033.683,852.1551,61.26378,0,0,0,100,0), +(@PATH,5,-4050.652,818.6749,61.26378,0,0,0,100,0), +(@PATH,6,-4085.118,799.5022,61.26378,0,0,0,100,0), +(@PATH,7,-4117.451,815.256,61.26378,0,0,0,100,0), +(@PATH,8,-4134.369,850.2852,61.26378,0,0,0,100,0); + +SET @NPC := 75542; +SET @PATH := @NPC*10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=-4066.473,`position_y`=752.3994,`position_z`=43.04424 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,-4083.436,721.6484,43.04424,0,0,0,100,0), +(@PATH,2,-4109.103,700.2794,43.04424,0,0,0,100,0), +(@PATH,3,-4114.49,699.9313,43.04424,0,0,0,100,0), +(@PATH,4,-4149.18,716.9812,43.04424,0,0,0,100,0), +(@PATH,5,-4164.394,749.7984,44.87757,0,0,0,100,0), +(@PATH,6,-4147.782,783.0017,46.62758,0,0,0,100,0), +(@PATH,7,-4117.128,799.6888,51.93314,0,0,0,100,0), +(@PATH,8,-4082.698,785.6704,50.3498,0,0,0,100,0), +(@PATH,9,-4066.473,752.3994,43.04424,0,0,0,100,0); + +SET @NPC := 75543; +SET @PATH := @NPC*10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=-4148.391,`position_y`=766.8653,`position_z`=66.01289 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,-4183.416,753.0403,72.09624,0,0,0,100,0), +(@PATH,2,-4199.977,716.2882,82.67956,0,0,0,100,0), +(@PATH,3,-4183.724,684.1388,70.56844,0,0,0,100,0), +(@PATH,4,-4148.917,666.9986,63.51288,0,0,0,100,0), +(@PATH,5,-4116.004,684.5375,61.51288,0,0,0,100,0), +(@PATH,6,-4099.94,716.4078,62.09623,0,0,0,100,0), +(@PATH,7,-4116.647,749.6686,61.59621,0,0,0,100,0), +(@PATH,8,-4148.391,766.8653,66.01289,0,0,0,100,0); + +SET @NPC := 75544; +SET @PATH := @NPC*10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=-4084.089,`position_y`=683.0483,`position_z`=59.55887 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,-4067.996,652.302,59.55887,0,0,0,100,0), +(@PATH,2,-4084.038,618.9259,59.55887,0,0,0,100,0), +(@PATH,3,-4117.386,599.9404,59.55887,0,0,0,100,0), +(@PATH,4,-4149.88,616.7292,59.55887,0,0,0,100,0), +(@PATH,5,-4165.804,652.2473,59.55887,0,0,0,100,0), +(@PATH,6,-4150.054,685.6966,59.55887,0,0,0,100,0), +(@PATH,7,-4118.107,699.7501,59.55887,0,0,0,100,0), +(@PATH,8,-4084.089,683.0483,59.55887,0,0,0,100,0); + +SET @NPC := 75545; +SET @PATH := @NPC*10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=-4083.681,`position_y`=848.0616,`position_z`=58.43416 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,-4117.843,866.6574,58.43417,0,0,0,100,0), +(@PATH,2,-4149.746,851.1995,68.6286,0,0,0,100,0), +(@PATH,3,-4167.114,815.8797,74.48971,0,0,0,100,0), +(@PATH,4,-4150.918,786.3128,65.07306,0,0,0,100,0), +(@PATH,5,-4116.956,766.7995,70.51749,0,0,0,100,0), +(@PATH,6,-4085.521,784.5572,76.90639,0,0,0,100,0), +(@PATH,7,-4067.243,818.4576,64.35083,0,0,0,100,0), +(@PATH,8,-4083.681,848.0616,58.43416,0,0,0,100,0); + +SET @NPC := 75546; +SET @PATH := @NPC*10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=-4133.319,`position_y`=918.6325,`position_z`=70.3725 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,-4117.341,884.8878,62.09472,0,0,0,100,0), +(@PATH,2,-4084.125,867.1631,52.70584,0,0,0,100,0), +(@PATH,3,-4050.462,883.2648,46.84472,0,0,0,100,0), +(@PATH,4,-4033.427,917.2786,54.8725,0,0,0,100,0), +(@PATH,5,-4049.515,951.7986,62.20583,0,0,0,100,0), +(@PATH,6,-4082.625,966.6864,69.48361,0,0,0,100,0), +(@PATH,7,-4116.243,949.7843,72.2614,0,0,0,100,0), +(@PATH,8,-4133.319,918.6325,70.3725,0,0,0,100,0); + +SET @NPC := 75547; +SET @PATH := @NPC*10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=-4000.944,`position_y`=650.089,`position_z`=84.74791 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,-4015.128,680.8443,72.16458,0,0,0,100,0), +(@PATH,2,-4047.654,700.2465,60.27572,0,0,0,100,0), +(@PATH,3,-4082.378,686.9391,58.8868,0,0,0,100,0), +(@PATH,4,-4099.23,649.127,67.30346,0,0,0,100,0), +(@PATH,5,-4083.47,615.1847,74.74792,0,0,0,100,0), +(@PATH,6,-4047.911,600.5391,92.52572,0,0,0,100,0), +(@PATH,7,-4016.922,616.1044,98.47014,0,0,0,100,0), +(@PATH,8,-4000.944,650.089,84.74791,0,0,0,100,0); + +SET @NPC := 75548; +SET @PATH := @NPC*10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=-4052.34,`position_y`=716.3079,`position_z`=48.66938 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,-4019.384,700.1765,47.08604,0,0,0,100,0), +(@PATH,2,-3983.657,716.8768,52.75271,0,0,0,100,0), +(@PATH,3,-3967.16,750.4713,65.47495,0,0,0,100,0), +(@PATH,4,-3982.856,783.4985,67.83604,0,0,0,100,0), +(@PATH,5,-4017.322,800.1605,65.75271,0,0,0,100,0), +(@PATH,6,-4048.333,784.6697,60.58604,0,0,0,100,0), +(@PATH,7,-4067.148,750.3481,53.25271,0,0,0,100,0), +(@PATH,8,-4052.34,716.3079,48.66938,0,0,0,100,0); + +SET @NPC := 75549; +SET @PATH := @NPC*10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=-3949.365,`position_y`=819.178,`position_z`=51.50261 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,-3933.805,784.3923,51.50261,0,0,0,100,0), +(@PATH,2,-3951.698,751.0433,51.50261,0,0,0,100,0), +(@PATH,3,-3980.543,733.1439,58.86372,0,0,0,100,0), +(@PATH,4,-4016.032,747.1483,64.55817,0,0,0,100,0), +(@PATH,5,-4032.366,782.211,60.08595,0,0,0,100,0), +(@PATH,6,-4017.203,816.9814,53.30817,0,0,0,100,0), +(@PATH,7,-3985.723,832.2205,51.50261,0,0,0,100,0), +(@PATH,8,-3949.365,819.178,51.50261,0,0,0,100,0); + +SET @NPC := 75550; +SET @PATH := @NPC*10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=-3916.397,`position_y`=883.2978,`position_z`=81.9971 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,-3948.779,899.8286,68.13598,0,0,0,100,0), +(@PATH,2,-3982.235,885.5906,61.1082,0,0,0,100,0), +(@PATH,3,-3999.414,851.4448,62.69153,0,0,0,100,0), +(@PATH,4,-3983.74,817.0834,58.96931,0,0,0,100,0), +(@PATH,5,-3950.159,800.5572,63.10819,0,0,0,100,0), +(@PATH,6,-3918.94,815.5467,72.46931,0,0,0,100,0), +(@PATH,7,-3900.264,851.1897,81.30264,0,0,0,100,0), +(@PATH,8,-3916.397,883.2978,81.9971,0,0,0,100,0); + +SET @NPC := 75551; +SET @PATH := @NPC*10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=-4084.883,`position_y`=914.0491,`position_z`=72.2939 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,-4099.644,950.2539,69.2939,0,0,0,100,0), +(@PATH,2,-4086.421,983.3143,71.12724,0,0,0,100,0), +(@PATH,3,-4050.086,1000.082,74.32168,0,0,0,100,0), +(@PATH,4,-4018.68,983.5675,74.32168,0,0,0,100,0), +(@PATH,5,-4001.11,950.1692,74.32168,0,0,0,100,0), +(@PATH,6,-4016.584,917.4998,74.32168,0,0,0,100,0), +(@PATH,7,-4048.498,899.8286,74.32168,0,0,0,100,0), +(@PATH,8,-4084.883,914.0491,72.2939,0,0,0,100,0); + +SET @NPC := 75552; +SET @PATH := @NPC*10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=-3915.657,`position_y`=833.4163,`position_z`=47.38418 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,-3948.898,849.9359,47.38418,0,0,0,100,0), +(@PATH,2,-3964.938,879.6131,47.38418,0,0,0,100,0), +(@PATH,3,-3948.945,916.1858,47.38418,0,0,0,100,0), +(@PATH,4,-3916.809,932.6107,48.16196,0,0,0,100,0), +(@PATH,5,-3886.793,916.5725,53.96752,0,0,0,100,0), +(@PATH,6,-3866.807,883.3404,60.02308,0,0,0,100,0), +(@PATH,7,-3884.739,849.9593,54.30085,0,0,0,100,0), +(@PATH,8,-3915.657,833.4163,47.38418,0,0,0,100,0); + +SET @NPC := 75553; +SET @PATH := @NPC*10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=-4047.742,`position_y`=1066.566,`position_z`=106.1299 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,-4082.141,1050.517,104.5466,0,0,0,100,0), +(@PATH,2,-4099.718,1017.106,98.4355,0,0,0,100,0), +(@PATH,3,-4082.201,985.4608,87.46328,0,0,0,100,0), +(@PATH,4,-4048.188,966.8837,78.15773,0,0,0,100,0), +(@PATH,5,-4017.819,980.5856,72.37994,0,0,0,100,0), +(@PATH,6,-4000.326,1016.784,86.21326,0,0,0,100,0), +(@PATH,7,-4014.791,1050.645,97.40771,0,0,0,100,0), +(@PATH,8,-4047.742,1066.566,106.1299,0,0,0,100,0); + +SET @NPC := 75554; +SET @PATH := @NPC*10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=-3900.323,`position_y`=984.7424,`position_z`=60.60864 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,-3918.999,953.8466,58.96975,0,0,0,100,0), +(@PATH,2,-3950.793,934.2088,58.96975,0,0,0,100,0), +(@PATH,3,-3982.866,950.2649,58.96975,0,0,0,100,0), +(@PATH,4,-4000.046,985.8019,61.02531,0,0,0,100,0), +(@PATH,5,-3981.982,1017.846,58.96975,0,0,0,100,0), +(@PATH,6,-3949.962,1033.053,56.85864,0,0,0,100,0), +(@PATH,7,-3918.825,1014.746,58.33086,0,0,0,100,0), +(@PATH,8,-3900.323,984.7424,60.60864,0,0,0,100,0); + +SET @NPC := 75555; +SET @PATH := @NPC*10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=-3950.083,`position_y`=985.4277,`position_z`=83.53654 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,-3965.832,952.775,76.7032,0,0,0,100,0), +(@PATH,2,-3951.587,918.8143,71.53653,0,0,0,100,0), +(@PATH,3,-3916.848,899.7321,72.39764,0,0,0,100,0), +(@PATH,4,-3885.93,916.5598,83.34209,0,0,0,100,0), +(@PATH,5,-3867.241,951.6891,90.39765,0,0,0,100,0), +(@PATH,6,-3882.38,983.3097,81.48098,0,0,0,100,0), +(@PATH,7,-3915.022,1000.09,72.17542,0,0,0,100,0), +(@PATH,8,-3950.083,985.4277,83.53654,0,0,0,100,0); + +SET @NPC := 75556; +SET @PATH := @NPC*10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=-3966.719,`position_y`=1048.378,`position_z`=69.52766 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,-3983.504,1016.722,67.94434,0,0,0,100,0), +(@PATH,2,-4015.046,1002.573,69.52766,0,0,0,100,0), +(@PATH,3,-4049.708,1017.723,72.13878,0,0,0,100,0), +(@PATH,4,-4066.48,1048.968,72.66656,0,0,0,100,0), +(@PATH,5,-4048.204,1083.848,71.19434,0,0,0,100,0), +(@PATH,6,-4016.47,1100.259,72.47211,0,0,0,100,0), +(@PATH,7,-3985.822,1082.684,70.97211,0,0,0,100,0), +(@PATH,8,-3966.719,1048.378,69.52766,0,0,0,100,0); + +SET @NPC := 75557; +SET @PATH := @NPC*10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=-3950.767,`position_y`=1000.512,`position_z`=87.49402 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,-3918.137,1015.368,90.16069,0,0,0,100,0), +(@PATH,2,-3900.402,1050.901,91.7718,0,0,0,100,0), +(@PATH,3,-3917.262,1083.885,99.32737,0,0,0,100,0), +(@PATH,4,-3949.68,1100.575,106.7718,0,0,0,100,0), +(@PATH,5,-3981.045,1082.341,107.8829,0,0,0,100,0), +(@PATH,6,-3999.798,1048.804,99.57736,0,0,0,100,0), +(@PATH,7,-3985.399,1018.346,91.7718,0,0,0,100,0), +(@PATH,8,-3950.767,1000.512,87.49402,0,0,0,100,0); + +SET @NPC := 75558; +SET @PATH := @NPC*10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=-4066.473,`position_y`=752.3994,`position_z`=43.04424 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,-4083.436,721.6484,43.04424,0,0,0,100,0), +(@PATH,2,-4109.103,700.2794,43.04424,0,0,0,100,0), +(@PATH,3,-4114.49,699.9313,43.04424,0,0,0,100,0), +(@PATH,4,-4149.18,716.9812,43.04424,0,0,0,100,0), +(@PATH,5,-4164.394,749.7984,44.87757,0,0,0,100,0), +(@PATH,6,-4147.782,783.0017,46.62758,0,0,0,100,0), +(@PATH,7,-4117.128,799.6888,51.93314,0,0,0,100,0), +(@PATH,8,-4082.698,785.6704,50.3498,0,0,0,100,0), +(@PATH,9,-4066.473,752.3994,43.04424,0,0,0,100,0); + +SET @NPC := 86103; +SET @PATH := @NPC*10; +UPDATE `creature` SET `id`=21648,`spawndist`=0,`MovementType`=2,`position_x`=-3981.939,`position_y`=1200.395,`position_z`=108.2629 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,-4015.405,1186.572,107.8463,0,0,0,100,0), +(@PATH,2,-4032.093,1150.835,100.8185,0,0,0,100,0), +(@PATH,3,-4016.442,1117.503,95.84628,0,0,0,100,0), +(@PATH,4,-3982.193,1100.35,95.62405,0,0,0,100,0), +(@PATH,5,-3950.59,1116.853,99.12405,0,0,0,100,0), +(@PATH,6,-3933.569,1150.704,103.263,0,0,0,100,0), +(@PATH,7,-3949.776,1184.953,106.8185,0,0,0,100,0), +(@PATH,8,-3981.939,1200.395,108.2629,0,0,0,100,0); diff --git a/sql/old/3.3.5a/2011_03_02_03_world_gossip_menu.sql b/sql/old/3.3.5a/2011_03_02_03_world_gossip_menu.sql new file mode 100644 index 0000000000000..6669edd49292b --- /dev/null +++ b/sql/old/3.3.5a/2011_03_02_03_world_gossip_menu.sql @@ -0,0 +1,31 @@ +-- Gossip Menu insert +DELETE FROM `gossip_menu` WHERE `entry`=3067 AND `text_id`=3801; +DELETE FROM `gossip_menu` WHERE `entry`=3481 AND `text_id`=4953; +DELETE FROM `gossip_menu` WHERE `entry`=4061 AND `text_id`=4954; +DELETE FROM `gossip_menu` WHERE `entry`=4062 AND `text_id`=4955; +DELETE FROM `gossip_menu` WHERE `entry`=4063 AND `text_id`=4956; +DELETE FROM `gossip_menu` WHERE `entry`=4064 AND `text_id`=4957; +DELETE FROM `gossip_menu` WHERE `entry`=4065 AND `text_id`=4958; +DELETE FROM `gossip_menu` WHERE `entry`=6627 AND `text_id`=7881; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES +(3067,3801), +(3481,4953), +(4061,4954), +(4062,4955), +(4063,4956), +(4064,4957), +(4065,4958), +(6627,7881); +-- Creature Gossip_menu_id Update +UPDATE `creature_template` SET `gossip_menu_id`=4573 WHERE `entry`=4091; +UPDATE `creature_template` SET `gossip_menu_id`=3067 WHERE `entry`=7866; +UPDATE `creature_template` SET `gossip_menu_id`=3481 WHERE `entry`=11548; +UPDATE `creature_template` SET `gossip_menu_id`=6944 WHERE `entry`=12577; +-- Creature Gossip_menu_option Update +DELETE FROM `gossip_menu_option` WHERE `menu_id`=3481; +INSERT INTO `gossip_menu_option` (`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`) VALUES +(3481,0,0, 'The land of Azshara.',1,1,4061,0,0,0,0, ''), +(3481,1,0, 'The Ruins of Eldarath.',1,1,4062,0,0,0,0, ''), +(3481,2,0, 'The mage tower to the north.',1,1,4063,0,0,0,0, ''), +(3481,3,0, 'The Timbermaw furbolgs.',1,1,4064,0,0,0,0, ''), +(3481,4,0, 'The presence of blue dragons.',1,1,4065,0,0,0,0, ''); diff --git a/sql/old/3.3.5a/2011_03_02_04_world_waypoint_data.sql b/sql/old/3.3.5a/2011_03_02_04_world_waypoint_data.sql new file mode 100644 index 0000000000000..e2413c0f6ffd2 --- /dev/null +++ b/sql/old/3.3.5a/2011_03_02_04_world_waypoint_data.sql @@ -0,0 +1,164 @@ +-- Waypoints for Vilewing Chimaera +SET @NPC := 84613; +SET @PATH := @NPC*10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=-3495.376,`position_y`=2654.514,`position_z`=85.14965 WHERE `guid`=@NPC; +DELETE FROM `creature` WHERE `guid` IN (84611,84490); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,-3513.771,2667.212,85.87186,0,0,0,100,0), +(@PATH,2,-3527.99,2668.341,87.39961,0,0,0,100,0), +(@PATH,3,-3568.938,2660.981,87.3718,0,0,0,100,0), +(@PATH,4,-3605.726,2631.423,89.09409,0,0,0,100,0), +(@PATH,5,-3606.994,2590.197,89.01077,0,0,0,100,0), +(@PATH,6,-3624.849,2552.972,89.84412,0,0,0,100,0), +(@PATH,7,-3632.875,2523.194,90.78855,0,0,0,100,0), +(@PATH,8,-3623.275,2498.775,93.42754,0,0,0,100,0), +(@PATH,9,-3594.59,2497.109,91.81643,0,0,0,100,0), +(@PATH,10,-3571.224,2522.083,89.76082,0,0,0,100,0), +(@PATH,11,-3555.303,2550.05,88.20523,0,0,0,100,0), +(@PATH,12,-3546.012,2576.069,86.67743,0,0,0,100,0), +(@PATH,13,-3533.117,2604.753,86.59406,0,0,0,100,0), +(@PATH,14,-3505.657,2622.679,86.03844,0,0,0,100,0), +(@PATH,15,-3495.376,2654.514,85.14965,0,0,0,100,0); + +SET @NPC := 84632; +SET @PATH := @NPC*10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=-3051.686,`position_y`=1036.492,`position_z`=18.42691 WHERE `guid`=@NPC; +DELETE FROM `creature` WHERE `guid` IN (84629,84630); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,-3078.817,1034.035,19.28807,0,0,0,100,0), +(@PATH,2,-3088.495,1066.141,25.0936,0,0,0,100,0), +(@PATH,3,-3087.413,1099.35,30.84361,0,0,0,100,0), +(@PATH,4,-3067.319,1113.823,27.62129,0,0,0,100,0), +(@PATH,5,-3035.007,1131.8,22.48246,0,0,0,100,0), +(@PATH,6,-3022.366,1165.862,21.28805,0,0,0,100,0), +(@PATH,7,-3028.652,1200.958,24.2047,0,0,0,100,0), +(@PATH,8,-3053.869,1219.137,31.12142,0,0,0,100,0), +(@PATH,9,-3098.912,1230.556,38.8714,0,0,0,100,0), +(@PATH,10,-3120.39,1233.38,42.48251,0,0,0,100,0), +(@PATH,11,-3155.853,1240.664,47.03807,0,0,0,100,0), +(@PATH,12,-3184.486,1256.954,49.17699,0,0,0,100,0), +(@PATH,13,-3200.051,1273.893,49.17699,0,0,0,100,0), +(@PATH,14,-3198.467,1300.309,47.56586,0,0,0,100,0), +(@PATH,15,-3180.189,1312.811,46.51028,0,0,0,100,0), +(@PATH,16,-3166.775,1318.915,44.56582,0,0,0,100,0), +(@PATH,17,-3133.76,1306.827,33.8992,0,0,0,100,0), +(@PATH,18,-3107.957,1267.029,29.7603,0,0,0,100,0), +(@PATH,19,-3102.756,1234.923,31.56591,0,0,0,100,0), +(@PATH,20,-3081.735,1200.232,34.76027,0,0,0,100,0), +(@PATH,21,-3064.895,1171.269,31.59359,0,0,0,100,0), +(@PATH,22,-3032.818,1161.913,24.92694,0,0,0,100,0), +(@PATH,23,-2998.293,1162.476,17.28803,0,0,0,100,0), +(@PATH,24,-2989.174,1125.52,23.26031,0,0,0,100,0), +(@PATH,25,-3019.696,1108.528,28.37141,0,0,0,100,0), +(@PATH,26,-3030.191,1069.277,24.06586,0,0,0,100,0), +(@PATH,27,-3051.686,1036.492,18.42691,0,0,0,100,0); + +SET @NPC := 84594; +SET @PATH := @NPC*10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=-3306.025,`position_y`=2329.368,`position_z`=83.54176 WHERE `guid`=@NPC; +DELETE FROM `creature` WHERE `guid` IN (84609,84610); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,-3306.578,2358.007,83.95837,0,0,0,100,0), +(@PATH,2,-3312.279,2366.838,84.12508,0,0,0,100,0), +(@PATH,3,-3339.576,2384.215,85.01395,0,0,0,100,0), +(@PATH,4,-3375.194,2400.308,84.79176,0,0,0,100,0), +(@PATH,5,-3413.535,2413.8,83.40285,0,0,0,100,0), +(@PATH,6,-3449.745,2447.95,84.59732,0,0,0,100,0), +(@PATH,7,-3484.88,2475.859,87.48625,0,0,0,100,0), +(@PATH,8,-3516.799,2470.339,88.65293,0,0,0,100,0), +(@PATH,9,-3551.302,2449.093,88.65293,0,0,0,100,0), +(@PATH,10,-3577.611,2417.917,88.65293,0,0,0,100,0), +(@PATH,11,-3587.224,2394.964,88.65293,0,0,0,100,0), +(@PATH,12,-3578.091,2358.175,91.01408,0,0,0,100,0), +(@PATH,13,-3542.674,2341.767,90.73628,0,0,0,100,0), +(@PATH,14,-3508.299,2338.776,88.65293,0,0,0,100,0), +(@PATH,15,-3480.534,2321.327,85.20841,0,0,0,100,0), +(@PATH,16,-3438.703,2328.433,84.01396,0,0,0,100,0), +(@PATH,17,-3402.306,2319.822,84.06959,0,0,0,100,0), +(@PATH,18,-3367.927,2320.204,83.40282,0,0,0,100,0), +(@PATH,19,-3336.193,2315.693,83.7084,0,0,0,100,0), +(@PATH,20,-3306.025,2329.368,83.54176,0,0,0,100,0); + +SET @NPC := 84597; +SET @PATH := @NPC*10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=-3679.033,`position_y`=1980.171,`position_z`=95.40069 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,-3694.715,1971.449,97.03951,0,0,0,100,0), +(@PATH,2,-3698.604,1961.438,97.51176,0,0,0,100,0), +(@PATH,3,-3703.094,1932.741,93.09521,0,0,0,100,0), +(@PATH,4,-3710.8,1898.883,95.06728,0,0,0,100,0), +(@PATH,5,-3706.167,1855.215,94.65068,0,0,0,100,0), +(@PATH,6,-3730.437,1822.595,97.15064,0,0,0,100,0), +(@PATH,7,-3764.347,1786.201,103.5396,0,0,0,100,0), +(@PATH,8,-3806.215,1765.616,104.6232,0,0,0,100,0), +(@PATH,9,-3831.599,1734.274,106.4841,0,0,0,100,0), +(@PATH,10,-3845.836,1700.599,104.7896,0,0,0,100,0), +(@PATH,11,-3860.267,1667.299,102.9841,0,0,0,100,0), +(@PATH,12,-3878.303,1634.768,97.234,0,0,0,100,0), +(@PATH,13,-3905.483,1624.397,96.40066,0,0,0,100,0), +(@PATH,14,-3934.358,1629.903,95.78949,0,0,0,100,0), +(@PATH,15,-3941.387,1653.258,102.4008,0,0,0,100,0), +(@PATH,16,-3933.618,1681.023,107.5399,0,0,0,100,0), +(@PATH,17,-3911.209,1703.6,110.7342,0,0,0,100,0), +(@PATH,18,-3870.417,1717.617,111.4286,0,0,0,100,0), +(@PATH,19,-3851.412,1733.487,109.7619,0,0,0,100,0), +(@PATH,20,-3832.467,1767.414,108.4843,0,0,0,100,0), +(@PATH,21,-3821.692,1801.011,106.7619,0,0,0,100,0), +(@PATH,22,-3804.742,1833.069,104.3174,0,0,0,100,0), +(@PATH,23,-3771.966,1852.2,103.0675,0,0,0,100,0), +(@PATH,24,-3733.195,1857.556,99.8175,0,0,0,100,0), +(@PATH,25,-3700.392,1874.681,91.92853,0,0,0,100,0), +(@PATH,26,-3669.671,1899.899,86.984,0,0,0,100,0), +(@PATH,27,-3657.474,1933.845,83.78937,0,0,0,100,0), +(@PATH,28,-3665.441,1967.769,90.26167,0,0,0,100,0), +(@PATH,29,-3679.033,1980.171,95.40069,0,0,0,100,0); + +SET @NPC := 84488; +SET @PATH := @NPC*10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=-3642.398,`position_y`=2282.843,`position_z`=101.388 WHERE `guid`=@NPC; +DELETE FROM `creature` WHERE `guid` IN (84604); +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`) VALUES (@NPC,@PATH,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,-3669.035,2270.016,101.6381,0,0,0,100,0), +(@PATH,2,-3678.18,2255.654,102.6103,0,0,0,100,0), +(@PATH,3,-3670.328,2221.352,101.9714,0,0,0,100,0), +(@PATH,4,-3643.312,2194.72,101.7492,0,0,0,100,0), +(@PATH,5,-3616.062,2171.167,100.7214,0,0,0,100,0), +(@PATH,6,-3592.527,2149.246,97.38798,0,0,0,100,0), +(@PATH,7,-3565.214,2111.288,91.72128,0,0,0,100,0), +(@PATH,8,-3539.711,2073.035,90.72137,0,0,0,100,0), +(@PATH,9,-3525.445,2044.541,86.11011,0,0,0,100,0), +(@PATH,10,-3525.761,2011.65,86.47135,0,0,0,100,0), +(@PATH,11,-3542.677,1995.357,88.47128,0,0,0,100,0), +(@PATH,12,-3561.439,2002.938,85.02679,0,0,0,100,0), +(@PATH,13,-3575.933,2019.746,82.88785,0,0,0,100,0), +(@PATH,14,-3575.169,2047.138,81.36017,0,0,0,100,0), +(@PATH,15,-3573.451,2072.323,84.91569,0,0,0,100,0), +(@PATH,16,-3564.493,2102.465,90.33241,0,0,0,100,0), +(@PATH,17,-3536.419,2134.583,97.94351,0,0,0,100,0), +(@PATH,18,-3500.938,2154.613,104.3325,0,0,0,100,0), +(@PATH,19,-3468.633,2165.143,101.9992,0,0,0,100,0), +(@PATH,20,-3451.676,2176.575,102.9714,0,0,0,100,0), +(@PATH,21,-3440.866,2214.563,102.4992,0,0,0,100,0), +(@PATH,22,-3464.083,2240.168,96.19363,0,0,0,100,0), +(@PATH,23,-3503.83,2238.953,96.88795,0,0,0,100,0), +(@PATH,24,-3532.543,2227.365,98.52686,0,0,0,100,0), +(@PATH,25,-3557.896,2223.087,99.74914,0,0,0,100,0), +(@PATH,26,-3585.39,2233.091,100.4992,0,0,0,100,0), +(@PATH,27,-3605.955,2248.527,99.88802,0,0,0,100,0), +(@PATH,28,-3615.812,2270.33,99.72134,0,0,0,100,0), +(@PATH,29,-3642.398,2282.843,101.388,0,0,0,100,0); diff --git a/sql/old/3.3.5a/2011_03_02_05_world_sai.sql b/sql/old/3.3.5a/2011_03_02_05_world_sai.sql new file mode 100644 index 0000000000000..d318dc466a330 --- /dev/null +++ b/sql/old/3.3.5a/2011_03_02_05_world_sai.sql @@ -0,0 +1,37 @@ +-- Pathing for Thulrin SAI +-- Remove old waypoint data and scripts +UPDATE `creature` SET `spawndist`=0,`MovementType`=0,`position_x`=2352.691,`position_y`=5268.956,`position_z`=7.668962 WHERE `guid`=110115; +UPDATE `creature_addon` SET `path_id`=0 WHERE `guid`=110115; +DELETE FROM `waypoint_data` WHERE `id`=1101150; +DELETE FROM waypoint_scripts WHERE `id` BETWEEN 1117 AND 1119; +-- SAI for Thulrin +UPDATE `creature_template` SET `AIName`='SmartAI',`equipment_id`=0 WHERE `entry`=25239; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=25239; +DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid` IN (2523900,2523901); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +-- AI +(25239,0,0,0,11,0,100,0,0,0,0,0,53,0,25239,1,0,0,0,1,0,0,0,0,0,0,0, 'Thulrin - Start WP movement'), +(25239,0,1,0,40,0,100,0,4,25239,0,0,80,2523900,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Thulrin - Load script 1 at WP 4'), +(25239,0,2,0,40,0,100,0,9,25239,0,0,80,2523901,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Thulrin - Load script 2 at WP 9'), +-- Script 1 +(2523900,9,0,0,0,0,100,0,0,0,0,0,54,1500,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Thulrin - Pause at WP 4'), +(2523900,9,1,0,0,0,100,0,0,0,0,0,5,16,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Thulrin - Emote ONESHOT_KNEEL'), +(2523900,9,2,0,0,0,100,0,1000,1000,0,0,71,344,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Thulrin - Equip sword'), +-- Script 2 +(2523901,9,0,0,0,0,100,0,0,0,0,0,54,51000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Thulrin - Pause at WP 9'), +(2523901,9,1,0,0,0,100,0,500,500,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,2.984513, 'Thulrin - Turn to pos'), +(2523901,9,2,0,0,0,100,0,1000,1000,0,0,17,133,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Thulrin - Emote STATE_USESTANDING_NOSHEATHE'), +(2523901,9,3,0,0,0,100,0,48000,48000,0,0,71,10000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Thulrin - Equip nothing'), +(2523901,9,4,0,0,0,100,0,0,0,0,0,17,26,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Thulrin - Emote STATE_STAND'); +-- Waypoints for Thulrin from sniff +DELETE FROM `waypoints` WHERE `entry`=25239; +INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES +(25239,1,2347.805,5265.343,7.630844, 'Thulrin WP 1'), +(25239,2,2344.542,5267.178,7.668962, 'Thulrin WP 2'), +(25239,3,2340.221,5270.315,7.668962, 'Thulrin WP 3'), +(25239,4,2336.553,5273.868,7.793962, 'Thulrin WP 4'), +(25239,5,2339.075,5271.176,7.668962, 'Thulrin WP 5'), +(25239,6,2346.919,5265.093,7.630844, 'Thulrin WP 6'), +(25239,7,2351.8,5266.425,7.630844, 'Thulrin WP 7'), +(25239,8,2352.691,5268.956,7.668962, 'Thulrin WP 8'), +(25239,9,2352.691,5268.956,7.668962, 'Thulrin WP 9'); diff --git a/sql/old/3.3.5a/2011_03_02_06_world_sai.sql b/sql/old/3.3.5a/2011_03_02_06_world_sai.sql new file mode 100644 index 0000000000000..ed81ade61a9fc --- /dev/null +++ b/sql/old/3.3.5a/2011_03_02_06_world_sai.sql @@ -0,0 +1,47 @@ +-- SAI for Crust Burster +SET @ENTRY := 16844; +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +UPDATE `creature` SET `spawndist`=20,`MovementType`=1 WHERE `id`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,1,1,0,100,1,0,0,0,0,11,34038,0,0,0,0,0,1,0,0,0,0,0,0,0,'Crust Burster - OOC - Cast Submerge Visual'), +(@ENTRY,0,1,0,61,0,100,1,0,0,0,0,18,33554434,0,0,0,0,0,1,0,0,0,0,0,0,0,'Crust Burster - OOC - Set Unselectable and Unattackable Flags'), +(@ENTRY,0,2,3,0,0,100,1,0,0,0,0,28,34038,0,0,0,0,0,1,0,0,0,0,0,0,0,'Crust Burster - On Aggro - Remove Submerge Visual'), +(@ENTRY,0,3,4,61,0,100,0,0,0,0,0,19,33554434,0,0,0,0,0,1,0,0,0,0,0,0,0,'Crust Burster - On Aggro - Remove Unselectable and Unattackable Flags'), +(@ENTRY,0,4,5,61,0,100,0,0,0,0,0,21,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Crust Burster - On Aggro - Prevent Combat Movement'), +(@ENTRY,0,5,0,61,0,100,0,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Crust Burster - On Aggro - Set Phase 1'), +(@ENTRY,0,6,7,0,1,100,0,1000,1000,2100,4500,11,31747,1,0,0,0,0,2,0,0,0,0,0,0,0,'Crust Burster - Combat - Cast Poison (Phase 1)'), +(@ENTRY,0,7,0,61,1,100,0,0,0,0,0,21,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Crust Burster - Combat - Prevent Combat Movement (Phase 1)'), +(@ENTRY,0,8,0,0,1,100,0,20400,20400,45000,50000,11,32738,1,0,0,0,0,2,0,0,0,0,0,0,0,'Crust Burster - Combat - Cast Bore (Phase 1)'), +(@ENTRY,0,9,10,9,1,100,0,20,60,0,0,11,34038,0,0,0,0,0,1,0,0,0,0,0,0,0,'Crust Burster - At 20 - 60 Yards Range - Cast Submerge Visual (Phase 1)'), +(@ENTRY,0,10,11,61,1,100,0,0,0,0,0,21,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Crust Burster - At 20 - 60 Yards Range - Allow Combat Movement (Phase 1)'), +(@ENTRY,0,11,0,61,1,100,0,0,0,0,0,22,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Crust Burster - At 20 - 60 Yards Range - Set Phase 2 (Phase 1)'), +(@ENTRY,0,12,13,9,2,100,0,0,8,0,0,28,34038,0,0,0,0,0,1,0,0,0,0,0,0,0,'Crust Burster - At 0 - 8 Yards - Remove Submerge Visual (Phase 2)'), +(@ENTRY,0,13,14,61,2,100,0,0,0,0,0,21,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Crust Burster - Combat - Prevent Combat Movement (Phase 2)'), +(@ENTRY,0,14,15,61,2,100,0,0,8,0,0,19,33554434,0,0,0,0,0,1,0,0,0,0,0,0,0,'Crust Burster - At 0 - 8 Yards - Remove Unselectable and Unattackable Flags (Phase 2)'), +(@ENTRY,0,15,0,61,2,100,0,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Crust Burster - At 20 - 60 Yards Range - Set Phase 1 (Phase 2)'); + +-- SAI for Marading Crust Burster +SET @ENTRY := 16857; +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +UPDATE `creature` SET `spawndist`=20,`MovementType`=1 WHERE `id`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,1,1,0,100,1,0,0,0,0,11,34038,0,0,0,0,0,1,0,0,0,0,0,0,0,'Crust Burster - OOC - Cast Submerge Visual'), +(@ENTRY,0,1,0,61,0,100,1,0,0,0,0,18,33554434,0,0,0,0,0,1,0,0,0,0,0,0,0,'Crust Burster - OOC - Set Unselectable and Unattackable Flags'), +(@ENTRY,0,2,3,0,0,100,1,0,0,0,0,28,34038,0,0,0,0,0,1,0,0,0,0,0,0,0,'Crust Burster - On Aggro - Remove Submerge Visual'), +(@ENTRY,0,3,4,61,0,100,0,0,0,0,0,19,33554434,0,0,0,0,0,1,0,0,0,0,0,0,0,'Crust Burster - On Aggro - Remove Unselectable and Unattackable Flags'), +(@ENTRY,0,4,5,61,0,100,0,0,0,0,0,21,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Crust Burster - On Aggro - Prevent Combat Movement'), +(@ENTRY,0,5,0,61,0,100,0,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Crust Burster - On Aggro - Set Phase 1'), +(@ENTRY,0,6,7,0,1,100,0,1000,1000,2100,4500,11,31747,1,0,0,0,0,2,0,0,0,0,0,0,0,'Crust Burster - Combat - Cast Poison (Phase 1)'), +(@ENTRY,0,7,0,61,1,100,0,0,0,0,0,21,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Crust Burster - Combat - Prevent Combat Movement (Phase 1)'), +(@ENTRY,0,8,0,0,1,100,0,20400,20400,45000,50000,11,32738,1,0,0,0,0,2,0,0,0,0,0,0,0,'Crust Burster - Combat - Cast Bore (Phase 1)'), +(@ENTRY,0,9,10,9,1,100,0,20,60,0,0,11,34038,0,0,0,0,0,1,0,0,0,0,0,0,0,'Crust Burster - At 20 - 60 Yards Range - Cast Submerge Visual (Phase 1)'), +(@ENTRY,0,10,11,61,1,100,0,0,0,0,0,21,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Crust Burster - At 20 - 60 Yards Range - Allow Combat Movement (Phase 1)'), +(@ENTRY,0,11,0,61,1,100,0,0,0,0,0,22,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Crust Burster - At 20 - 60 Yards Range - Set Phase 2 (Phase 1)'), +(@ENTRY,0,12,13,9,2,100,0,0,8,0,0,28,34038,0,0,0,0,0,1,0,0,0,0,0,0,0,'Crust Burster - At 0 - 8 Yards - Remove Submerge Visual (Phase 2)'), +(@ENTRY,0,13,14,61,2,100,0,0,0,0,0,21,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Crust Burster - Combat - Prevent Combat Movement (Phase 2)'), +(@ENTRY,0,14,15,61,2,100,0,0,8,0,0,19,33554434,0,0,0,0,0,1,0,0,0,0,0,0,0,'Crust Burster - At 0 - 8 Yards - Remove Unselectable and Unattackable Flags (Phase 2)'), +(@ENTRY,0,15,0,61,2,100,0,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Crust Burster - At 20 - 60 Yards Range - Set Phase 1 (Phase 2)'); diff --git a/sql/old/3.3.5a/2011_03_04_00_world_skill_discovery_template.sql b/sql/old/3.3.5a/2011_03_04_00_world_skill_discovery_template.sql new file mode 100644 index 0000000000000..f1840b0db8fee --- /dev/null +++ b/sql/old/3.3.5a/2011_03_04_00_world_skill_discovery_template.sql @@ -0,0 +1,2 @@ +-- Debug spell, set reqSkillValue because it does not belong to any skilline +UPDATE `skill_discovery_template` SET `reqSkillValue`=0 WHERE `reqSpell`=61756; diff --git a/sql/old/3.3.5a/2011_03_04_01_world_npc_spellclick_spells.sql b/sql/old/3.3.5a/2011_03_04_01_world_npc_spellclick_spells.sql new file mode 100644 index 0000000000000..f4a5825225cef --- /dev/null +++ b/sql/old/3.3.5a/2011_03_04_01_world_npc_spellclick_spells.sql @@ -0,0 +1,3 @@ +DELETE FROM `npc_spellclick_spells` WHERE `npc_entry`=32930; +INSERT INTO `npc_spellclick_spells` (`npc_entry`,`spell_id`,`quest_start`,`quest_start_active`,`quest_end`,`cast_flags`,`aura_required`,`aura_forbidden`,`user_type`) VALUES +(32930,65343,0,0,0,0,0,0,0); -- Ride Vehicle Kologarn Arms diff --git a/sql/old/3.3.5a/2011_03_04_01_world_vehicle_accessory.sql b/sql/old/3.3.5a/2011_03_04_01_world_vehicle_accessory.sql new file mode 100644 index 0000000000000..53cb37d43f1ab --- /dev/null +++ b/sql/old/3.3.5a/2011_03_04_01_world_vehicle_accessory.sql @@ -0,0 +1 @@ +UPDATE `vehicle_accessory` SET `minion`=1 WHERE `entry` IN(32640,32633); diff --git a/sql/old/3.3.5a/2011_03_04_02_world_spell_script_names.sql b/sql/old/3.3.5a/2011_03_04_02_world_spell_script_names.sql new file mode 100644 index 0000000000000..db399ebd042ba --- /dev/null +++ b/sql/old/3.3.5a/2011_03_04_02_world_spell_script_names.sql @@ -0,0 +1,8 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_gen_profession_research'; +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_item_book_of_glyph_mastery'; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(60893, 'spell_gen_profession_research'), +(61177, 'spell_gen_profession_research'), +(61288, 'spell_gen_profession_research'), +(61756, 'spell_gen_profession_research'), +(64323, 'spell_item_book_of_glyph_mastery'); diff --git a/sql/old/3.3.5a/2011_03_04_03_world_gameobject.sql b/sql/old/3.3.5a/2011_03_04_03_world_gameobject.sql new file mode 100644 index 0000000000000..68cef6a1b5301 --- /dev/null +++ b/sql/old/3.3.5a/2011_03_04_03_world_gameobject.sql @@ -0,0 +1,2 @@ +-- Delete MO_TRANSPORT spawns +DELETE FROM `gameobject` WHERE `guid` IN (150163,150171); diff --git a/sql/old/3.3.5a/2011_03_04_04_world_scriptname.sql b/sql/old/3.3.5a/2011_03_04_04_world_scriptname.sql new file mode 100644 index 0000000000000..01ee9d252c6b9 --- /dev/null +++ b/sql/old/3.3.5a/2011_03_04_04_world_scriptname.sql @@ -0,0 +1,2 @@ +UPDATE `item_template` SET `ScriptName`='' WHERE `ScriptName`='item_harvesters_gift'; +UPDATE `item_template` SET `ScriptName`='' WHERE `ScriptName`='item_flying_machine'; diff --git a/sql/old/3.3.5a/2011_03_04_04_world_spell_script_names.sql b/sql/old/3.3.5a/2011_03_04_04_world_spell_script_names.sql new file mode 100644 index 0000000000000..140d4eb8e1d48 --- /dev/null +++ b/sql/old/3.3.5a/2011_03_04_04_world_spell_script_names.sql @@ -0,0 +1,5 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_item_gift_of_the_harvester'; +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_dk_death_gate'; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(52481, 'spell_item_gift_of_the_harvester'), +(52751, 'spell_dk_death_gate'); diff --git a/sql/old/3.3.5a/2011_03_05_00_world_waypoint_data.sql b/sql/old/3.3.5a/2011_03_05_00_world_waypoint_data.sql new file mode 100644 index 0000000000000..f340c55304efc --- /dev/null +++ b/sql/old/3.3.5a/2011_03_05_00_world_waypoint_data.sql @@ -0,0 +1,208 @@ +-- Dragonmaw Skybreaker Pathing From sniff +UPDATE `creature_template` SET `speed_walk`=1,`speed_run`=1.2125 WHERE `entry`=22274; +DELETE FROM `creature` WHERE `guid`=132538; +DELETE FROM `creature_addon` WHERE `guid`=132538; + +SET @NPC := 78291; +SET @PATH := @NPC*10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=-4919.375,`position_y`=764.9185,`position_z`=115.8213 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes2`) VALUES (@NPC,@PATH,20684,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,-4899.598,731.2864,115.8213,0,0,0,100,0), +(@PATH,2,-4897.536,699.804,115.8213,0,0,0,100,0), +(@PATH,3,-4907.958,682.649,115.8213,0,0,0,100,0), +(@PATH,4,-4928.547,677.3654,115.8213,0,0,0,100,0), +(@PATH,5,-4957.558,679.2119,115.8213,0,0,0,100,0), +(@PATH,6,-4979.058,694.0054,115.8213,0,0,0,100,0), +(@PATH,7,-5001.202,695.435,115.8213,0,0,0,100,0), +(@PATH,8,-5045.799,679.8455,115.8213,0,0,0,100,0), +(@PATH,9,-5082.077,674.1318,115.8213,0,0,0,100,0), +(@PATH,10,-5105.458,688.3859,126.0714,0,0,0,100,0), +(@PATH,11,-5124.419,708.7602,115.8213,0,0,0,100,0), +(@PATH,12,-5131.542,743.6093,115.8213,0,0,0,100,0), +(@PATH,13,-5122.893,762.6793,115.8213,0,0,0,100,0), +(@PATH,14,-5109.942,776.4905,127.7102,0,0,0,100,0), +(@PATH,15,-5082.581,787.4044,140.2658,0,0,0,100,0), +(@PATH,16,-5048.687,787.3963,129.2936,0,0,0,100,0), +(@PATH,17,-5029.247,794.6903,105.6824,0,0,0,100,0), +(@PATH,18,-5004.71,788.2552,111.238,0,0,0,100,0), +(@PATH,19,-4974.424,775.7346,115.8213,0,0,0,100,0), +(@PATH,20,-4944.215,765.6434,115.8213,0,0,0,100,0), +(@PATH,21,-4919.375,764.9185,115.8213,0,0,0,100,0); + +SET @NPC := 78292; +SET @PATH := @NPC*10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=-4914.272,`position_y`=182.6655,`position_z`=105.3898 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes2`) VALUES (@NPC,@PATH,20684,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,-4927.019,212.1301,105.3898,0,0,0,100,0), +(@PATH,2,-4948.965,230.0244,105.3898,0,0,0,100,0), +(@PATH,3,-4975.733,226.1698,105.3898,0,0,0,100,0), +(@PATH,4,-4991.351,199.1344,103.001,0,0,0,100,0), +(@PATH,5,-5005.696,153.1891,116.7409,0,0,0,100,0), +(@PATH,6,-4998.949,135.7159,116.7409,0,0,0,100,0), +(@PATH,7,-4970.921,115.2041,116.7409,0,0,0,100,0), +(@PATH,8,-4920.846,153.8924,105.3898,0,0,0,100,0), +(@PATH,9,-4914.272,182.6655,105.3898,0,0,0,100,0); + +SET @NPC := 78293; +SET @PATH := @NPC*10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=-5001.053,`position_y`=507.8676,`position_z`=125.1893 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes2`) VALUES (@NPC,@PATH,20684,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,-4976.919,535.0216,125.1893,0,0,0,100,0), +(@PATH,2,-4945.772,544.8293,125.1893,0,0,0,100,0), +(@PATH,3,-4916.477,541.136,125.1893,0,0,0,100,0), +(@PATH,4,-4894.755,534.1898,125.1893,0,0,0,100,0), +(@PATH,5,-4878.672,517.9357,125.1893,0,0,0,100,0), +(@PATH,6,-4867.688,472.2867,125.1893,0,0,0,100,0), +(@PATH,7,-4866.018,440.9231,125.1893,0,0,0,100,0), +(@PATH,8,-4884.331,411.0111,125.1893,0,0,0,100,0), +(@PATH,9,-4909.612,389.5723,125.1893,0,0,0,100,0), +(@PATH,10,-4945.339,386.204,125.1893,0,0,0,100,0), +(@PATH,11,-4967.832,409.3968,125.1893,0,0,0,100,0), +(@PATH,12,-4986.726,443.7907,125.1893,0,0,0,100,0), +(@PATH,13,-4997.688,466.8292,125.1893,0,0,0,100,0), +(@PATH,14,-5001.053,507.8676,125.1893,0,0,0,100,0); + +SET @NPC := 78294; +SET @PATH := @NPC*10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=-4957.768,`position_y`=-85.91428,`position_z`=117.7407 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes2`) VALUES (@NPC,@PATH,20684,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,-4979.801,-54.69292,117.2962,0,0,0,100,0), +(@PATH,2,-4973.231,-17.18837,111.824,0,0,0,100,0), +(@PATH,3,-4911.041,4.472439,118.324,0,0,0,100,0), +(@PATH,4,-4873.144,-22.93349,119.0185,0,0,0,100,0), +(@PATH,5,-4870.32,-65.83746,122.9629,0,0,0,100,0), +(@PATH,6,-4885.412,-99.36697,120.2129,0,0,0,100,0), +(@PATH,7,-4918.261,-108.4286,117.824,0,0,0,100,0), +(@PATH,8,-4957.768,-85.91428,117.7407,0,0,0,100,0); + +SET @NPC := 78295; +SET @PATH := @NPC*10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=-4989.571,`position_y`=277.2158,`position_z`=129.4455 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes2`) VALUES (@NPC,@PATH,20684,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,-4981.606,252.022,129.4455,0,0,0,100,0), +(@PATH,2,-4961.62,234.8766,129.4455,0,0,0,100,0), +(@PATH,3,-4923.01,242.2214,129.4455,0,0,0,100,0), +(@PATH,4,-4900.703,257.2026,129.4455,0,0,0,100,0), +(@PATH,5,-4879.407,279.7445,129.4455,0,0,0,100,0), +(@PATH,6,-4865.226,310.3156,129.4455,0,0,0,100,0), +(@PATH,7,-4859.635,335.26,129.4455,0,0,0,100,0), +(@PATH,8,-4863.772,361.1568,129.4455,0,0,0,100,0), +(@PATH,9,-4897.918,374.3784,129.4455,0,0,0,100,0), +(@PATH,10,-4935.554,362.9577,129.4455,0,0,0,100,0), +(@PATH,11,-4956.634,339.5631,129.4455,0,0,0,100,0), +(@PATH,12,-4972.443,308.4228,129.4455,0,0,0,100,0), +(@PATH,13,-4989.571,277.2158,129.4455,0,0,0,100,0); + +SET @NPC := 78296; +SET @PATH := @NPC*10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=-5013.096,`position_y`=529.8334,`position_z`=147.466 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes2`) VALUES (@NPC,@PATH,20684,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,-5034.7,530.1956,147.466,0,0,0,100,0), +(@PATH,2,-5058.567,549.2531,147.466,0,0,0,100,0), +(@PATH,3,-5077.942,585.5693,147.466,0,0,0,100,0), +(@PATH,4,-5085.871,616.8538,147.466,0,0,0,100,0), +(@PATH,5,-5073.225,640.2809,147.466,0,0,0,100,0), +(@PATH,6,-5046.584,656.348,147.466,0,0,0,100,0), +(@PATH,7,-5016.901,662.3196,147.466,0,0,0,100,0), +(@PATH,8,-4990.232,642.3178,147.466,0,0,0,100,0), +(@PATH,9,-4965.018,595.1047,147.466,0,0,0,100,0), +(@PATH,10,-4970.888,561.2855,147.466,0,0,0,100,0), +(@PATH,11,-4988.07,544.9948,147.466,0,0,0,100,0), +(@PATH,12,-5013.096,529.8334,147.466,0,0,0,100,0); + +SET @NPC := 78297; +SET @PATH := @NPC*10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=-5115.668,`position_y`=15.1122,`position_z`=156.0377 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes2`) VALUES (@NPC,@PATH,20684,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,-5081.034,3.025608,156.0377,0,0,0,100,0), +(@PATH,2,-5054.209,-29.95432,156.0377,0,0,0,100,0), +(@PATH,3,-5044.757,-53.49219,156.0377,0,0,0,100,0), +(@PATH,4,-5063.791,-87.67003,156.0377,0,0,0,100,0), +(@PATH,5,-5100.97,-101.5627,156.0377,0,0,0,100,0), +(@PATH,6,-5139.875,-93.61002,156.0377,0,0,0,100,0), +(@PATH,7,-5157.834,-72.95584,158.5654,0,0,0,100,0), +(@PATH,8,-5150.443,-50.55273,150.9543,0,0,0,100,0), +(@PATH,9,-5154.681,-12.24284,156.0377,0,0,0,100,0), +(@PATH,10,-5139.686,8.807183,156.0377,0,0,0,100,0), +(@PATH,11,-5115.668,15.1122,156.0377,0,0,0,100,0); + +SET @NPC := 78298; +SET @PATH := @NPC*10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=-5128.899,`position_y`=485.1413,`position_z`=149.4686 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes2`) VALUES (@NPC,@PATH,20684,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,-5096.786,491.9447,149.4686,0,0,0,100,0), +(@PATH,2,-5081.393,520.9803,149.5797,0,0,0,100,0), +(@PATH,3,-5082.821,560.8444,149.4686,0,0,0,100,0), +(@PATH,4,-5081.688,587.3782,149.4686,0,0,0,100,0), +(@PATH,5,-5096.75,614.0341,149.4686,0,0,0,100,0), +(@PATH,6,-5121.846,626.2573,149.4686,0,0,0,100,0), +(@PATH,7,-5143.037,616.5057,149.4686,0,0,0,100,0), +(@PATH,8,-5162.803,600.3235,149.4686,0,0,0,100,0), +(@PATH,9,-5175.979,585.7052,149.4686,0,0,0,100,0), +(@PATH,10,-5191.311,553.0349,149.4686,0,0,0,100,0), +(@PATH,11,-5182.97,516.0972,149.4686,0,0,0,100,0), +(@PATH,12,-5169.338,495.5091,149.4686,0,0,0,100,0), +(@PATH,13,-5128.899,485.1413,149.4686,0,0,0,100,0); + +SET @NPC := 78299; +SET @PATH := @NPC*10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=-5203.09,`position_y`=230.2053,`position_z`=125.2333 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes2`) VALUES (@NPC,@PATH,20684,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,-5200.994,194.2652,125.2333,0,0,0,100,0), +(@PATH,2,-5209.843,162.355,125.2333,0,0,0,100,0), +(@PATH,3,-5223.84,126.7766,125.2333,0,0,0,100,0), +(@PATH,4,-5254.94,108.4594,125.2333,0,0,0,100,0), +(@PATH,5,-5272.563,119.1082,125.2333,0,0,0,100,0), +(@PATH,6,-5293.776,154.223,125.2333,0,0,0,100,0), +(@PATH,7,-5298.729,171.8369,125.2333,0,0,0,100,0), +(@PATH,8,-5300.312,208.0347,125.2333,0,0,0,100,0), +(@PATH,9,-5283.916,251.8668,125.2333,0,0,0,100,0), +(@PATH,10,-5241.004,262.8554,125.2333,0,0,0,100,0), +(@PATH,11,-5203.09,230.2053,125.2333,0,0,0,100,0); + +SET @NPC := 78300; +SET @PATH := @NPC*10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=-5234.025,`position_y`=262.7202,`position_z`=131.392 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes2`) VALUES (@NPC,@PATH,20684,1); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,-5255.758,267.988,131.392,0,0,0,100,0), +(@PATH,2,-5280.832,303.0705,131.392,0,0,0,100,0), +(@PATH,3,-5282.729,322.4258,131.392,0,0,0,100,0), +(@PATH,4,-5269.899,354.7595,131.392,0,0,0,100,0), +(@PATH,5,-5244.224,370.2118,131.392,0,0,0,100,0), +(@PATH,6,-5201.63,377.0772,131.392,0,0,0,100,0), +(@PATH,7,-5186.241,362.2412,131.392,0,0,0,100,0), +(@PATH,8,-5178.872,334.1438,131.392,0,0,0,100,0), +(@PATH,9,-5178.549,305.8703,131.392,0,0,0,100,0), +(@PATH,10,-5190.308,282.2744,131.392,0,0,0,100,0), +(@PATH,11,-5208.153,267.4322,131.392,0,0,0,100,0), +(@PATH,12,-5234.025,262.7202,131.392,0,0,0,100,0); diff --git a/sql/scripts/world_scripts_full.sql b/sql/scripts/world_scripts_full.sql index 068994db9dbcb..a9a7ed93c56fd 100644 --- a/sql/scripts/world_scripts_full.sql +++ b/sql/scripts/world_scripts_full.sql @@ -9,7 +9,7 @@ UPDATE `gameobject_template` SET `ScriptName`=''; UPDATE `outdoorpvp_template` SET `ScriptName`=''; /* AREA TRIGGERS */ -DELETE FROM `areatrigger_scripts` WHERE `entry` IN (822,5284,5285,5286,5287,4871,4872,4873,5108,5332,5338,5334,5340,5369,5423,5633,5604,5698,5649); +DELETE FROM `areatrigger_scripts` WHERE `entry` IN (822,5284,5285,5286,5287,4871,4872,4873,5108,5332,5338,5334,5340,5369,5423,5633,5604,5698,5649,5729); DELETE FROM `areatrigger_scripts` WHERE `entry` BETWEEN 1726 AND 1740; INSERT INTO `areatrigger_scripts` (`entry`,`ScriptName`) VALUES (822, 'at_map_chamber'), @@ -45,7 +45,8 @@ INSERT INTO `areatrigger_scripts` (`entry`,`ScriptName`) VALUES (5633, 'at_tyrannus_event_starter'), (5604, 'at_sindragosa_lair'), (5698, 'at_icc_saurfang_portal'), -(5649, 'at_icc_shutdown_traps'); +(5649, 'at_icc_shutdown_traps'), +(5729, 'at_icc_start_blood_quickening'); /* WORLD BOSS */ UPDATE `creature_template` SET `ScriptName`='boss_ysondre' WHERE `entry`=14887; @@ -111,7 +112,6 @@ UPDATE `creature_template` SET `ScriptName`='npc_innkeeper' WHERE `entry` IN /* ITEM */ UPDATE `item_template` SET `ScriptName`='item_draenei_fishing_net' WHERE `entry`=23654; -UPDATE `item_template` SET `ScriptName`='item_flying_machine' WHERE `entry` IN (34060,34061); UPDATE `item_template` SET `ScriptName`='item_gor_dreks_ointment' WHERE `entry`=30175; UPDATE `item_template` SET `ScriptName`='item_nether_wraith_beacon' WHERE `entry`=31742; UPDATE `item_template` SET `ScriptName`='item_tainted_core' WHERE `entry`=31088; @@ -119,7 +119,6 @@ UPDATE `item_template` SET `ScriptName`='item_only_for_flight' WHERE `entry` IN UPDATE `item_template` SET `ScriptName`='item_incendiary_explosives' WHERE (`entry`=35704); UPDATE `item_template` SET `ScriptName`='item_mysterious_egg' WHERE `entry` IN(39878); UPDATE `item_template` SET `ScriptName`='item_disgusting_jar' WHERE `entry` IN(44717); -UPDATE `item_template` SET `ScriptName`='item_harvesters_gift' WHERE `entry`=39253; UPDATE `item_template` SET `ScriptName`='item_petrov_cluster_bombs' WHERE `entry`=33098; UPDATE `item_template` SET `ScriptName`='item_Trident_of_Nazjan' WHERE `entry`=35850; UPDATE `item_template` SET `ScriptName`='item_captured_frog' WHERE `entry`=53510; @@ -276,7 +275,6 @@ UPDATE `creature_template` SET `ScriptName`='npc_engineer_spark_overgrind' WHERE UPDATE `creature_template` SET `ScriptName`='npc_injured_draenei' WHERE `entry`=16971; UPDATE `creature_template` SET `ScriptName`='npc_magwin' WHERE `entry`=17312; 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; @@ -599,6 +597,9 @@ UPDATE `creature_template` SET `ScriptName`='npc_narm_faulk' WHERE `entry`=6177; /* DUROTAR */ UPDATE `creature_template` SET `ScriptName`='npc_lazy_peon' WHERE `entry`=10556; +UPDATE `creature_template` SET `ScriptName`= 'npc_tiger_matriarch_credit' WHERE `entry`=40301; +UPDATE `creature_template` SET `ScriptName`= 'npc_tiger_matriarch' WHERE `entry`=40312; +UPDATE `creature_template` SET `ScriptName`= 'npc_troll_volunteer' WHERE `entry` IN (40260,40264); /* DUSKWOOD */ DELETE FROM `areatrigger_scripts` WHERE `entry`=4017; @@ -632,6 +633,16 @@ UPDATE `creature_template` SET `ScriptName`='npc_apprentice_mirveda' WHERE `entr UPDATE `creature_template` SET `ScriptName`='npc_infused_crystal' WHERE `entry`=16364; UPDATE `gameobject_template` SET `ScriptName`='go_second_trial' WHERE `entry` IN (182052); +/* EYE OF ETERNITY */ +UPDATE `instance_template` SET `script`='instance_eye_of_eternity' WHERE `map`=616; +UPDATE `creature_template` SET `ScriptName`='boss_malygos' WHERE `entry`=28859; +UPDATE `creature_template` SET `ScriptName`='npc_power_spark' WHERE `entry`=30084; +UPDATE `creature_template` SET `ScriptName`='npc_portal_eoe' WHERE `entry`=30118; +UPDATE `creature_template` SET `ScriptName`='npc_hover_disk' WHERE `entry` IN (30234,30248); +UPDATE `creature_template` SET `ScriptName`='npc_arcane_overload' WHERE `entry`=30282; +UPDATE `creature_template` SET `ScriptName`='npc_wyrmrest_skytalon' WHERE `entry`=30161; +UPDATE `creature_template` SET `ScriptName`='npc_alexstrasza_eoe' WHERE `entry`=32295; + /* FELWOOD */ UPDATE `creature_template` SET `ScriptName`='npcs_riverbreeze_and_silversky' WHERE `entry` IN (9528,9529); @@ -836,6 +847,7 @@ UPDATE `creature_template` SET `ScriptName`='npc_guardian_pavilion' WHERE `entry /* ICECROWN CITADEL */ UPDATE `instance_template` SET `script`='instance_icecrown_citadel' WHERE `map`=631; UPDATE `gameobject_template` SET `ScriptName`='icecrown_citadel_teleport' WHERE `entry` IN (202223,202235,202242,202243,202244,202245,202246); +UPDATE `creature_template` SET `ScriptName`='npc_highlord_tirion_fordring_lh' WHERE `entry`=37119; UPDATE `creature_template` SET `ScriptName`='boss_lord_marrowgar' WHERE `entry`=36612; UPDATE `creature_template` SET `ScriptName`='npc_coldflame' WHERE `entry`=36672; UPDATE `creature_template` SET `ScriptName`='npc_bone_spike' WHERE `entry` IN (36619,38711,38712); @@ -843,12 +855,14 @@ UPDATE `creature_template` SET `ScriptName`='boss_lady_deathwhisper' WHERE `entr UPDATE `creature_template` SET `ScriptName`='npc_cult_fanatic' WHERE `entry` IN (37890,38009,38135); UPDATE `creature_template` SET `ScriptName`='npc_cult_adherent' WHERE `entry` IN(37949,38010,38136); UPDATE `creature_template` SET `ScriptName`='npc_vengeful_shade' WHERE `entry`=38222; +UPDATE `creature_template` SET `ScriptName`='npc_darnavan' WHERE `entry` IN (38472,38485); UPDATE `creature_template` SET `ScriptName`='npc_rotting_frost_giant' WHERE `entry` IN (38490,38494); UPDATE `creature_template` SET `ScriptName`='boss_deathbringer_saurfang' WHERE `entry`=37813; UPDATE `creature_template` SET `ScriptName`='npc_high_overlord_saurfang_icc' WHERE `entry`=37187; UPDATE `creature_template` SET `ScriptName`='npc_muradin_bronzebeard_icc' WHERE `entry`=37200; UPDATE `creature_template` SET `ScriptName`='npc_saurfang_event' WHERE `entry` IN (37920,37830); UPDATE `creature_template` SET `ScriptName`='npc_frost_freeze_trap' WHERE `entry`=37744; +UPDATE `creature_template` SET `ScriptName`='npc_alchemist_adrianna' WHERE `entry`=38501; UPDATE `creature_template` SET `ScriptName`='boss_festergut' WHERE `entry`=36626; UPDATE `creature_template` SET `ScriptName`='npc_stinky_icc' WHERE `entry`=37025; UPDATE `creature_template` SET `ScriptName`='boss_rotface' WHERE `entry`=36627; @@ -1170,7 +1184,6 @@ UPDATE `creature_template` SET `ScriptName`='npc_drake_dealer_hurlunk' WHERE `en UPDATE `creature_template` SET `ScriptName`='npc_invis_legion_teleporter' WHERE `entry`=21807; UPDATE `creature_template` SET `ScriptName`='npcs_flanis_swiftwing_and_kagrosh' WHERE `entry` IN (21725,21727); UPDATE `creature_template` SET `ScriptName`='npc_murkblood_overseer' WHERE `entry`=23309; -UPDATE `creature_template` SET `ScriptName`='npc_neltharaku' WHERE `entry`=21657; UPDATE `creature_template` SET `ScriptName`='npc_oronok_tornheart' WHERE `entry`=21183; UPDATE `creature_template` SET `ScriptName`='mob_mature_netherwing_drake' WHERE `entry`=21648; UPDATE `creature_template` SET `ScriptName`='mob_enslaved_netherwing_drake' WHERE `entry`=21722; @@ -1507,12 +1520,15 @@ UPDATE `creature_template` SET `AIName`='TurretAI',`ScriptName`='' WHERE `entry` UPDATE `creature_template` SET `ScriptName`='boss_flame_leviathan_seat' WHERE `entry`=33114; UPDATE `creature_template` SET `ScriptName`='boss_flame_leviathan_defense_turret' WHERE `entry`=33142; UPDATE `creature_template` SET `ScriptName`='boss_flame_leviathan_overload_device' WHERE `entry`=33143; +UPDATE `creature_template` SET `ScriptName`='boss_flame_leviathan_defense_cannon' WHERE `entry`=33139; UPDATE `creature_template` SET `ScriptName`='npc_colossus' WHERE `entry`=33237; UPDATE `creature_template` SET `ScriptName`='spell_pool_of_tar' WHERE `entry`=33090; UPDATE `creature_template` SET `ScriptName`='boss_ignis' WHERE `entry`=33118; UPDATE `creature_template` SET `ScriptName`='npc_iron_construct' WHERE `entry`=33121; UPDATE `creature_template` SET `ScriptName`='npc_scorch_ground' WHERE `entry`=33221; UPDATE `creature_template` SET `ScriptName`='boss_razorscale' WHERE `entry`=33186; +UPDATE `creature_template` SET `ScriptName`='boss_razorscale_controller' WHERE `entry`=33233; +UPDATE `gameobject_template` SET `ScriptName`='go_razorscale_harpoon' WHERE `entry` IN(194519,194541,194542,194543); UPDATE `creature_template` SET `ScriptName`='npc_devouring_flame' WHERE `entry`=34188; UPDATE `creature_template` SET `ScriptName`='npc_mole_machine_trigger' WHERE `entry`=33245; UPDATE `creature_template` SET `ScriptName`='npc_expedition_commander' WHERE `entry`=33210; @@ -1533,8 +1549,6 @@ UPDATE `creature_template` SET `ScriptName`='mob_lightning_elemental' WHERE `ent UPDATE `creature_template` SET `ScriptName`='mob_rune_of_summoning' WHERE `entry`=33051; UPDATE `creature_template` SET `ScriptName`= 'mob_rune_of_power' WHERE entry = 33705; UPDATE `creature_template` SET `ScriptName`='boss_kologarn' WHERE `entry`=32930; -UPDATE `creature_template` SET `ScriptName`='npc_right_arm' WHERE `entry`=32934; -UPDATE `creature_template` SET `ScriptName`='npc_left_arm' WHERE `entry`=32933; UPDATE `creature_template` SET `ScriptName`='boss_general_vezax' WHERE `entry`=33271; UPDATE `creature_template` SET `ScriptName`='npc_saronite_vapors' WHERE `entry`=33488; UPDATE `creature_template` SET `ScriptName`='npc_saronite_animus' WHERE `entry`=33524; @@ -1763,7 +1777,7 @@ UPDATE `outdoorpvp_template` SET `ScriptName`='outdoorpvp_si' WHERE `TypeId`=5; UPDATE `outdoorpvp_template` SET `ScriptName`='outdoorpvp_ep' WHERE `TypeId`=6; /* ACHIEVEMENTS */ -DELETE FROM `achievement_criteria_data` WHERE `criteria_id` IN (3693,6641,6642,6643,6644,3804,3805,3806,3807,3808,3809,3810,3811,3812,3813,1234,1239,5605,5606,12778,13036,13035,13037,12977,12967,12986,12982,12993,12780,13012,13011,13013,12062,12063,12064,12065,12183,12068,12060,12061,12822,12996,12972,12989) AND `type` IN (0,11); +DELETE FROM `achievement_criteria_data` WHERE `criteria_id` IN (3693,6641,6642,6643,6644,3804,3805,3806,3807,3808,3809,3810,3811,3812,3813,1234,1239,5605,5606,12778,13036,13035,13037,12977,12967,12986,12982,12993,12780,13012,13011,13013,12062,12063,12064,12065,12183,12068,12060,12061,12822,12996,12972,12989,10062,10063,10054,10055,10046,10047,10048,10049,10050,10051,10044,10045) AND `type` IN (0,11); INSERT INTO `achievement_criteria_data` (`criteria_id`,`type`,`value1`,`value2`,`ScriptName`) VALUES (3693,11,0,0, 'achievement_storm_glory'), (6641,11,0,0, 'achievement_school_of_hard_knocks'), @@ -1808,7 +1822,19 @@ INSERT INTO `achievement_criteria_data` (`criteria_id`,`type`,`value1`,`value2`, (12822,11,0,0, 'achievement_all_you_can_eat'), (12996,11,0,0, 'achievement_all_you_can_eat'), (12972,11,0,0, 'achievement_all_you_can_eat'), -(12989,11,0,0, 'achievement_all_you_can_eat'); +(12989,11,0,0, 'achievement_all_you_can_eat'), +(10044,11,0,0, 'achievement_unbroken'), +(10045,11,0,0, 'achievement_unbroken'), +(10054,11,0,0, 'achievement_shutout'), +(10055,11,0,0, 'achievement_shutout'), +(10046,11,0,0, 'achievement_three_car_garage_chopper'), +(10047,11,0,0, 'achievement_three_car_garage_siege'), +(10048,11,0,0, 'achievement_three_car_garage_demolisher'), +(10049,11,0,0, 'achievement_three_car_garage_chopper'), +(10050,11,0,0, 'achievement_three_car_garage_siege'), +(10051,11,0,0, 'achievement_three_car_garage_demolisher'), +(10062,11,0,0, 'achievement_quick_shave'), +(10063,11,0,0, 'achievement_quick_shave'); /* SPELLS */ INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES @@ -1849,6 +1875,10 @@ INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES ( 72706, 'spell_gen_dungeon_credit'), ( 72830, 'spell_gen_dungeon_credit'), ( 72959, 'spell_gen_dungeon_credit'), +( 60893, 'spell_gen_profession_research'), +( 61177, 'spell_gen_profession_research'), +( 61288, 'spell_gen_profession_research'), +( 61756, 'spell_gen_profession_research'), -- instances -- Black Temple ( 41475, 'spell_boss_lady_malande_shield'), @@ -1914,6 +1944,8 @@ INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES ( 72444, 'spell_deathbringer_mark_of_the_fallen_champion'), ( 72445, 'spell_deathbringer_mark_of_the_fallen_champion'), ( 72446, 'spell_deathbringer_mark_of_the_fallen_champion'), +( 72155, 'spell_icc_harvest_blight_specimen'), +( 72162, 'spell_icc_harvest_blight_specimen'), ( 71123, 'spell_stinky_precious_decimate'), ( 73032, 'spell_festergut_pungent_blight'), ( 73031, 'spell_festergut_pungent_blight'), @@ -1927,6 +1959,18 @@ INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES ( 71222, 'spell_festergut_blighted_spores'), ( 73033, 'spell_festergut_blighted_spores'), ( 73034, 'spell_festergut_blighted_spores'), +( 69159, 'spell_festergut_gaseous_blight'), +( 70135, 'spell_festergut_gaseous_blight'), +( 70136, 'spell_festergut_gaseous_blight'), +( 70137, 'spell_festergut_gaseous_blight'), +( 69161, 'spell_festergut_gaseous_blight'), +( 70138, 'spell_festergut_gaseous_blight'), +( 70139, 'spell_festergut_gaseous_blight'), +( 70140, 'spell_festergut_gaseous_blight'), +( 69163, 'spell_festergut_gaseous_blight'), +( 70468, 'spell_festergut_gaseous_blight'), +( 70469, 'spell_festergut_gaseous_blight'), +( 70470, 'spell_festergut_gaseous_blight'), ( 69782, 'spell_rotface_ooze_flood'), ( 69796, 'spell_rotface_ooze_flood'), ( 69798, 'spell_rotface_ooze_flood'), @@ -1937,6 +1981,10 @@ INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES ( 69839, 'spell_rotface_unstable_ooze_explosion_init'), ( 69832, 'spell_rotface_unstable_ooze_explosion'), ( 71441, 'spell_rotface_unstable_ooze_explosion_suicide'), +( 69507, 'spell_rotface_slime_spray'), +( 71213, 'spell_rotface_slime_spray'), +( 73189, 'spell_rotface_slime_spray'), +( 73190, 'spell_rotface_slime_spray'), ( 70701, 'spell_putricide_expunged_gas'), ( 70343, 'spell_putricide_slime_puddle'), ( 70351, 'spell_putricide_unstable_experiment'), @@ -2018,6 +2066,7 @@ INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES ( 72528, 'spell_sindragosa_collision_filter'), ( 72529, 'spell_sindragosa_collision_filter'), ( 72530, 'spell_sindragosa_collision_filter'), +( 70117, 'spell_sindragosa_collision_filter'), ( 70117, 'spell_sindragosa_icy_grip'), -- Isle of Conquest ( 66630, 'spell_gen_gunship_portal'), @@ -2038,11 +2087,27 @@ INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES ( 68646, 'spell_gen_leeching_swarm'), ( 68647, 'spell_gen_leeching_swarm'), -- Ulduar +( 63308, 'spell_razorscale_devouring_flame'), ( 62717, 'spell_ignis_slag_pot'), ( 63477, 'spell_ignis_slag_pot'), ( 62521, 'spell_attuned_to_nature_dose_reduction'), ( 62524, 'spell_attuned_to_nature_dose_reduction'), ( 62525, 'spell_attuned_to_nature_dose_reduction'), +( 63633, 'spell_ulduar_rubble_summon'), +( 65594, 'spell_ulduar_cancel_stone_grip'), +( 62056, 'spell_ulduar_stone_grip'), +( 63985, 'spell_ulduar_stone_grip'), +( 64224, 'spell_ulduar_stone_grip_absorb'), +( 64225, 'spell_ulduar_stone_grip_absorb'), +( 62166, 'spell_ulduar_stone_grip_cast_target'), +( 63981, 'spell_ulduar_stone_grip_cast_target'), +( 64702, 'spell_ulduar_squeezed_lifeless'), +-- Eye Of Eternity +( 56105, 'spell_malygos_vortex_dummy'), +( 55873, 'spell_malygos_vortex_visual'), +-- Zalazane's Fall +( 75420, 'spell_mount_check'), +( 75102, 'spell_voljin_war_drums'), -- quest ( 8913, 'spell_q55_sacred_cleansing'), ( 17271, 'spell_q5206_test_fetid_skull'), @@ -2077,6 +2142,9 @@ INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES ( 71905, 'spell_item_shadowmourne'), ( 67533, 'spell_item_red_rider_air_rifle'), ( 26678, 'spell_item_create_heart_candy'), +( 64323, 'spell_item_book_of_glyph_mastery'), +( 52481, 'spell_item_gift_of_the_harvester'), +( 45853, 'spell_item_map_of_the_geyser_fields'), -- warrior ( 12975, 'spell_warr_last_stand'), ( 59725, 'spell_warr_improved_spell_reflection'), @@ -2121,6 +2189,7 @@ INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES (-49145, 'spell_dk_spell_deflection'), (-52284, 'spell_dk_will_of_the_necropolis'), ( 48743, 'spell_dk_death_pact'), +( 52751, 'spell_dk_death_gate'), -- shaman (-51474, 'spell_sha_astral_shift'), ( 39610, 'spell_sha_mana_tide_totem'), diff --git a/sql/updates/auth_char/2011_03_11_00_characters_channels.sql b/sql/updates/auth_char/2011_03_11_00_characters_channels.sql new file mode 100644 index 0000000000000..8c399617998a0 --- /dev/null +++ b/sql/updates/auth_char/2011_03_11_00_characters_channels.sql @@ -0,0 +1,7 @@ +ALTER TABLE `channels` CHANGE COLUMN `m_name` `name` varchar(128) NOT NULL, + CHANGE COLUMN `m_team` `team` int(10) unsigned NOT NULL, + CHANGE COLUMN `m_announce` `announce` tinyint(3) unsigned NOT NULL DEFAULT '1', + CHANGE COLUMN `m_ownership` `ownership` tinyint(3) unsigned NOT NULL DEFAULT '1', + CHANGE COLUMN `m_password` `password` varchar(32) DEFAULT NULL, + CHANGE COLUMN `BannedList` `bannedList` text, + CHANGE COLUMN `last_used` `lastUsed` int(10) unsigned NOT NULL; diff --git a/sql/updates/auth_char/2011_03_17_00_characters_corpse.sql b/sql/updates/auth_char/2011_03_17_00_characters_corpse.sql new file mode 100644 index 0000000000000..d9464f53f49c2 --- /dev/null +++ b/sql/updates/auth_char/2011_03_17_00_characters_corpse.sql @@ -0,0 +1 @@ +ALTER TABLE `corpse` CHANGE COLUMN `phaseMask` `phaseMask` smallint(5) unsigned NOT NULL DEFAULT '1'; diff --git a/sql/updates/auth_char/2011_03_18_00_characters_game_event_misc.sql b/sql/updates/auth_char/2011_03_18_00_characters_game_event_misc.sql new file mode 100644 index 0000000000000..cc2772a31ac25 --- /dev/null +++ b/sql/updates/auth_char/2011_03_18_00_characters_game_event_misc.sql @@ -0,0 +1,19 @@ +-- Create temporary table that holds the entry conversion data. (See corresponding world db update) +CREATE TABLE `game_event_temp` ( + `entryOld` TINYINT(3) UNSIGNED NOT NULL, + `entryNew` TINYINT(3) UNSIGNED NOT NULL +) ENGINE=INNODB DEFAULT CHARSET=utf8; + +-- Renumbered entry data +INSERT INTO `game_event_temp` (`entryOld`,`entryNew`) VALUES +(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),(14,14),(15,15),(16,16),(17,17),(18,18),(19,19),(20,20),(21,21),(22,22), +(23,23),(26,24),(27,25),(28,26),(29,27),(30,28),(31,29),(32,30),(33,31),(34,32),(35,33),(36,34),(37,35),(38,36),(39,37),(40,38),(41,39),(42,40),(43,41),(44,42), +(45,43),(46,44),(47,45),(48,46),(49,47),(50,48),(51,49),(52,50),(53,51),(54,52),(124,53),(125,54),(126,55),(127,56),(128,57),(129,58),(130,59),(131,60); + +-- Update game_event_save +UPDATE `game_event_save`, `game_event_temp` SET `game_event_save`.`event_id` = `game_event_temp`.`entryNew` WHERE `game_event_save`.`event_id` = `game_event_temp`.`entryOld`; +ALTER TABLE `game_event_save` CHANGE `event_id` `eventEntry` TINYINT(3) UNSIGNED NOT NULL; + +-- Update game_event_condition_save +UPDATE `game_event_condition_save`, `game_event_temp` SET `game_event_condition_save`.`event_id` = `game_event_temp`.`entryNew` WHERE `game_event_condition_save`.`event_id` = `game_event_temp`.`entryOld`; +ALTER TABLE `game_event_condition_save` CHANGE `event_id` `eventEntry` TINYINT(3) UNSIGNED NOT NULL; diff --git a/sql/updates/auth_char/2011_03_18_01_characters_game_event_misc.sql b/sql/updates/auth_char/2011_03_18_01_characters_game_event_misc.sql new file mode 100644 index 0000000000000..85dc9cb2d5bc3 --- /dev/null +++ b/sql/updates/auth_char/2011_03_18_01_characters_game_event_misc.sql @@ -0,0 +1,2 @@ +-- Remove temporary table +DROP TABLE `game_event_temp`; \ No newline at end of file diff --git a/sql/updates/world/2011_03_05_01_world_spell_proc_event.sql b/sql/updates/world/2011_03_05_01_world_spell_proc_event.sql new file mode 100644 index 0000000000000..22412fcb8eccb --- /dev/null +++ b/sql/updates/world/2011_03_05_01_world_spell_proc_event.sql @@ -0,0 +1,4 @@ +DELETE FROM `spell_proc_event` WHERE `entry` IN (71880,71892); +INSERT INTO `spell_proc_event` (`entry`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `procFlags`, `procEx`, `ppmRate`, `CustomChance`, `Cooldown`) VALUES +(71880,0x00,0,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,1,0,0), -- Item - Icecrown 25 Normal Dagger Proc +(71892,0x00,0,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,1,0,0); -- Item - Icecrown 25 Heroic Dagger Proc diff --git a/sql/updates/world/2011_03_05_02_world_creatures.sql b/sql/updates/world/2011_03_05_02_world_creatures.sql new file mode 100644 index 0000000000000..4c593672dc73b --- /dev/null +++ b/sql/updates/world/2011_03_05_02_world_creatures.sql @@ -0,0 +1,79 @@ +-- Vehicle updates +UPDATE `creature_template` SET `speed_run`=1 WHERE `entry`=25765; -- Fizzcrank Bomber +UPDATE `creature_template` SET `speed_run`=3.42857 WHERE `entry`=26572; -- Kor'kron War Rider +UPDATE `creature_template` SET `speed_run`=1.71429 WHERE `entry`=29500; -- Brunnhildar Warbear +UPDATE `creature_template` SET `speed_run`=1.71429 WHERE `entry`=30174; -- Hyldsmeet Warbear +UPDATE `creature_template` SET `unit_flags`=`unit_flags`|32768,`speed_walk`=1.444444,`speed_run`=1.5873 WHERE `entry`=30228; -- Argent Skytalon +UPDATE `creature_template` SET `exp`=0,`speed_run`=1.38571 WHERE `entry`=31269; -- Kor'kron Battle Wyvern +UPDATE `creature_template` SET `speed_run`=1 WHERE `entry`=31881; -- Kor'kron Troop Transport +UPDATE `creature_template` SET `speed_walk`=2.8,`speed_run`=1.71429 WHERE `entry`=29351; -- Niffelem Frost Giant +UPDATE `creature_template` SET `speed_walk`=2.8,`speed_run`=1.71429 WHERE `entry`=29358; -- Frostworg +UPDATE `creature_template` SET `speed_run`=0.99206 WHERE `entry`=29931; -- Drakkari Rhino +UPDATE `creature_template` SET `unit_flags`=`unit_flags`|33587200,`speed_walk`=2,`speed_run`=1.71429 WHERE `entry`=30204; -- Forgotten Depths Ambusher +UPDATE `creature_template` SET `speed_walk`=1.444444 WHERE `entry`=36891; -- Iceborn Proto-Drake +UPDATE `creature_template` SET `exp`=0,`baseattacktime`=2000,`speed_run`=1.38571 WHERE `entry`=38500; -- Argent Warhorse + +UPDATE `creature_model_info` SET `bounding_radius`=0.15,`combat_reach`=2.5,`gender`=0 WHERE `modelid`=31187; -- Argent Skytalon +UPDATE `creature_model_info` SET `bounding_radius`=0.825,`combat_reach`=4.125,`gender`=0 WHERE `modelid`=26388; -- Brunnhildar Warbear +UPDATE `creature_model_info` SET `bounding_radius`=0.31,`combat_reach`=1,`gender`=0 WHERE `modelid`=17722; -- Kor'kron Battle Wyvern +UPDATE `creature_model_info` SET `bounding_radius`=1.68025,`combat_reach`=4.125,`gender`=0 WHERE `modelid`=26323; -- Injured Icemaw Matriarch +UPDATE `creature_model_info` SET `bounding_radius`=0.31,`combat_reach`=6,`gender`=0 WHERE `modelid`=24531; -- Niffelem Frost Giant +UPDATE `creature_model_info` SET `bounding_radius`=3,`combat_reach`=0,`gender`=0 WHERE `modelid`=26331; -- Frostworg +UPDATE `creature_model_info` SET `bounding_radius`=0.465,`combat_reach`=2.25,`gender`=0 WHERE `modelid`=25729; -- Forgotten Depths Ambusher + +DELETE FROM `creature_template_addon` WHERE `entry` IN (24418,25765,26572,27761,28054,29500,30013,30174,30228,31269,31881,29563,29351,29358,29931,30204,36476,36794,36891,36896,38500); +INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(24418,0,33554433,1,0, NULL), -- Steel Gate Flying Machine +(25765,0,0,1,0, NULL), -- Fizzcrank Bomber +(26572,0,0,1,0, NULL), -- Kor'kron War Rider +(27761,0,65536,1,0, NULL), -- Fordragon Battle Steed +(28054,0,4,257,0, NULL), -- Lucky Wilhelm +(29500,0,0,1,0, NULL), -- Brunnhildar Warbear +(30013,0,50331648,1,0, NULL), -- Stormcrest Eagle +(30174,0,0,1,0, NULL), -- Hyldsmeet Warbear +(30228,0,50331648,1,0, NULL), -- Argent Skytalon +(31269,0,50331648,1,0, NULL), -- Kor'kron Battle Wyvern +(31881,0,50331649,1,0, NULL), -- Kor'kron Troop Transport +(29563,0,7,1,0, NULL), -- Injured Icemaw Matriarch +(29351,0,0,1,0, NULL), -- Niffelem Frost Giant +(29358,0,0,1,0, NULL), -- Frostworg +(29931,0,0,1,0, NULL), -- Drakkari Rhino +(30204,0,0,1,0, '56422 0'), -- Forgotten Depths Ambusher, Auras: Nerubian Submerge +(36476,0,0,1,0, NULL), -- Ick +(36794,0,0,1,0, NULL), -- Scourgelord Tyrannus +(36891,0,0,1,0, NULL), -- Iceborn Proto-Drake +(36896,0,0,1,0, NULL), -- Stonespine Gargoyle +(38500,0,0,1,0, NULL); -- Argent Warhorse + +DELETE FROM `npc_spellclick_spells` WHERE `npc_entry` IN (24418,25765,26572,27761,28054,29500,30013,30174,30228,31269,31269,29563,28222,24750,27241,28018,29351,29358,29698,29931,30204,36477,36794,36891,36896,38500); +INSERT INTO `npc_spellclick_spells` (`npc_entry`,`spell_id`,`quest_start`,`quest_start_active`,`quest_end`,`cast_flags`,`aura_required`,`aura_forbidden`,`user_type`) VALUES +(24418,43768,0,0,0,3,0,0,0), -- Steel Gate Flying Machine - Flying Machine Controls +(25765,43671,0,0,0,1,0,0,0), -- Fizzcrank Bomber - Ride Vehicle +(26572,46598,0,0,0,1,0,0,0), -- Kor'kron War Rider - Ride Vehicle Hardcoded +(27761,43671,0,0,0,1,0,0,0), -- Fordragon Battle Steed - Ride Vehicle +(28054,50556,0,0,0,1,0,0,0), -- Lucky Wilhelm - Ride Wilhelm +(29500,46598,0,0,0,1,0,0,0), -- Brunnhildar Warbear - Ride Vehicle Hardcoded +(30013,43671,0,0,0,1,0,0,0), -- Stormcrest Eagle - Ride Vehicle +(30174,46598,0,0,0,1,0,0,0), -- Hyldsmeet Warbear - Ride Vehicle Hardcoded +(30228,56678,0,0,0,1,0,0,0), -- Argent Skytalon - Command Argent Skytalon +(31269,46598,0,0,0,1,0,0,0), -- Kor'kron Battle Wyvern - Ride Vehicle Hardcoded +(31269,46598,0,0,0,1,0,0,0), -- Kor'kron Troop Transport - Ride Vehicle Hardcoded +(29563,56795,12983,1,1,2,0,0,0), -- Injured Icemaw Matriarch - Harnessed Icemaw Matriarch +(28222,52082,0,0,0,1,0,0,0), -- The Etymidian - The Etymidian's Call +(24750,46598,0,0,0,1,0,0,0), -- Hidalgo the Master Falconer - Ride Vehicle Hardcoded +(27241,46598,0,0,0,1,0,0,0), -- Risen Gryphon - Ride Vehicle Hardcoded +(28018,46598,0,0,0,1,0,0,0), -- Thiassi the Lightning Bringer - Ride Vehicle Hardcoded +(29351,46598,0,0,0,1,0,0,0), -- Niffelem Frost Giant - Ride Vehicle Hardcoded +(29358,46598,0,0,0,1,0,0,0), -- Frostworg - Ride Vehicle Hardcoded +(29698,46598,0,0,0,1,0,0,0), -- Drakuru Raptor - Ride Vehicle Hardcoded +(29931,46598,0,0,0,1,0,0,0), -- Drakkari Rhino - Ride Vehicle Hardcoded +(30204,46598,0,0,0,1,0,0,0), -- Forgotten Depths Ambusher - Ride Vehicle Hardcoded +(36477,46598,0,0,0,0,0,0,0), -- Krick - Ride Vehicle Hardcoded +(36794,46598,0,0,0,1,0,0,0), -- Scourgelord Tyrannus - Ride Vehicle Hardcoded +(36891,46598,0,0,0,1,0,0,0), -- Iceborn Proto-Drake - Ride Vehicle Hardcoded +(36896,46598,0,0,0,1,0,0,0), -- Stonespine Gargoyle - Ride Vehicle Hardcoded +(38500,46598,0,0,0,1,0,0,0); -- Argent Warhorse - Ride Vehicle Hardcoded + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=43768; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`Comment`) VALUES +(13,0,43768,0,18,1,24418,0, 'Steel Gate Flying Machine'); diff --git a/sql/updates/world/2011_03_05_03_world_spell_area.sql b/sql/updates/world/2011_03_05_03_world_spell_area.sql new file mode 100644 index 0000000000000..b7efd814e3e6c --- /dev/null +++ b/sql/updates/world/2011_03_05_03_world_spell_area.sql @@ -0,0 +1,4 @@ +-- Dragonmaw Fel Orc illusion for Netherwing Mines area after Netherwing quest chain for reputation is complete +DELETE FROM `spell_area` WHERE `spell`=40214 AND `area`=3965; +INSERT INTO `spell_area` (`spell`, `area`, `quest_start`, `quest_start_active`, `quest_end`, `aura_spell`, `racemask`, `gender`, `autocast`) VALUES +(40214,3965,11013,1,0,0,0,2,1); diff --git a/sql/updates/world/2011_03_05_04_world_creatures.sql b/sql/updates/world/2011_03_05_04_world_creatures.sql new file mode 100644 index 0000000000000..1ee645a097e09 --- /dev/null +++ b/sql/updates/world/2011_03_05_04_world_creatures.sql @@ -0,0 +1,133 @@ +-- Some Dalran and Area Updates (sniff) +-- Template updates +UPDATE `creature_template` SET `exp`=0,`npcflag`=`npcflag`|640 WHERE `entry`=32415; -- Hamaka +UPDATE `creature_template` SET `exp`=0,`npcflag`=`npcflag`|130 WHERE `entry`=31031; -- Misensi +UPDATE `creature_template` SET `unit_flags`=`unit_flags`|768 WHERE `entry`=35826; -- Kaye Toogie +UPDATE `creature_template` SET `dynamicflags`=`dynamicflags`|4 WHERE `entry`=32428; -- Underbelly Rat +UPDATE `creature_template` SET `npcflag`=`npcflag`|3 WHERE `entry`=36670; -- Magister Hathorel +UPDATE `creature_template` SET `exp`=2,`minlevel`=82,`maxlevel`=82,`baseattacktime`=2000,`unit_flags`=`unit_flags`|33555200 WHERE `entry`=37858; -- Razorscale Image +UPDATE `creature_template` SET `exp`=0 WHERE `entry`=32328; -- [DND] Dalaran Sewer Arena - Controller - Death +UPDATE `creature_template` SET `exp`=0 WHERE `entry`=32339; -- [DND] Dalaran Sewer Arena - Controller +UPDATE `creature_template` SET `minlevel`=75,`maxlevel`=75,`npcflag`=`npcflag`|4224,`unit_flags`=`unit_flags`|768 WHERE `entry`=33938; -- Zom Bocom +UPDATE `creature_template` SET `minlevel`=75,`maxlevel`=75,`npcflag`=`npcflag`|4224,`unit_flags`=`unit_flags`|768 WHERE `entry`=33937; -- Xazi Smolderpipe +UPDATE `creature_template` SET `minlevel`=75,`maxlevel`=75,`npcflag`=`npcflag`|4224,`unit_flags`=`unit_flags`|512 WHERE `entry`=33936; -- Nargle Lashcord +UPDATE `creature_template` SET `npcflag`=`npcflag`|4224,`unit_flags`=`unit_flags`|512 WHERE `entry`=34095; -- Trapjaw Rix +UPDATE `creature_template` SET `baseattacktime`=2000,`unit_flags`=`unit_flags`|33544 WHERE `entry`=42078; -- Mini Thor +UPDATE `creature_template` SET `exp`=0 WHERE `entry`=32322; -- Gold Warrior +UPDATE `creature_template` SET `exp`=0 WHERE `entry`=32325; -- Gold Priest + +-- Model data +UPDATE `creature_model_info` SET `bounding_radius`=1.05,`combat_reach`=1.05,`gender`=0 WHERE `modelid`=10957; -- Dappled Stag +UPDATE `creature_model_info` SET `bounding_radius`=0.236,`combat_reach`=1.5,`gender`=0 WHERE `modelid`=27957; -- Hamaka +UPDATE `creature_model_info` SET `bounding_radius`=1,`combat_reach`=1,`gender`=2 WHERE `modelid`=1141; -- Underbelly Rat +UPDATE `creature_model_info` SET `bounding_radius`=0.5,`combat_reach`=0.75,`gender`=0 WHERE `modelid`=4449; -- Imp +UPDATE `creature_model_info` SET `bounding_radius`=0.09,`combat_reach`=1.5,`gender`=1 WHERE `modelid`=30806; -- Razorscale Image +UPDATE `creature_model_info` SET `bounding_radius`=0.75,`combat_reach`=1.5,`gender`=0 WHERE `modelid`=27766; -- [DND] Dalaran Sewer Arena - Controller +UPDATE `creature_model_info` SET `bounding_radius`=0.09,`combat_reach`=0,`gender`=2 WHERE `modelid`=32670; -- Mini Thor + +-- Addon data +DELETE FROM `creature_template_addon` WHERE `entry` IN (417,31233,31228,33778,34244,31236,29631,32692,32687,30352,31085,30755,31081,28671,28160,31031,28674,31238,29238,31229, +32596,32415,32419,32418,32253,32412,32602,32732,31439,35826,32428,36670,32251,32252,32420,30659,32730,28991,32470,27047,29497,29534,31851,29493,28989,29533,32686,32683, +29325,31080,20735,28742,29496,32265,31517,29499,37858,29156,29476,28993,32691,32675,30885,32328,32339,32743,23472,33938,33937,33936,34095,29527,28956,28691,28332,28994,28692, +42078,29494,35497,29523,35500,28992,32683,29763,29764,29765,29766,37776,32509,29529,29529,28776,30726,28774,29528,32601,32710,32752, +32322,32325); +INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(32322,0,0,1,0, NULL), -- Gold Warrior +(32325,0,0,1,0, NULL), -- Gold Priest +(32752,0,0,1,0, NULL), -- Tabitha +(32710,0,0,1,0, NULL), -- Garl Grimgrizzle +(29763,0,0,1,0, NULL), -- Cosmetic Totem Alliance Air +(29764,0,0,1,0, NULL), -- Cosmetic Totem Alliance Earth +(29765,0,0,1,0, NULL), -- Cosmetic Totem Alliance Fire +(29766,0,0,1,0, NULL), -- Cosmetic Totem Alliance Water +(37776,0,0,1,0, NULL), -- Apprentice Nelphi +(32509,0,0,257,0, NULL), -- Brammold Deepmine +(29528,0,0,257,0, NULL), -- Debbi Moore +(29529,0,0,257,0, NULL), -- Ninsianna +(28776,0,0,257,0, NULL), -- Elizabeth Ross +(30726,0,0,257,0, NULL), -- Archivist Betha +(28774,0,0,257,0, NULL), -- Andrew Matthews +(42078,0,0,1,0, NULL), -- Mini Thor +(29494,0,0,257,0, NULL), -- Shen Kang Cheng +(35497,0,0,257,0, NULL), -- Rafael Langrom +(29523,0,0,257,0, NULL), -- Bragund Brightlink +(35500,0,0,257,0, NULL), -- Matilda Brightlink +(28992,0,0,257,0, NULL), -- Valerie Langrom +(32683,0,0,257,0, NULL), -- Grezla the Hag +(32686,0,0,257,0, NULL), -- Crafticus Mindbender +(28692,0,0,257,0, NULL), -- "Red" Jack Findle +(28994,0,0,257,0, NULL), -- Abra Cadabra +(28332,0,0,1,0, NULL), -- Generic Trigger LAB (Large AOI) +(28691,0,0,257,0, NULL), -- Susana Averoy +(30885,0,0,1,0, NULL), -- Blazik Fireclaw +(32328,0,0,1,0, NULL), -- [DND] Dalaran Sewer Arena - Controller - Death +(32339,0,0,1,0, NULL), -- [DND] Dalaran Sewer Arena - Controller +(32743,0,1,1,0, NULL), -- Willard Blauvelt +(23472,0,0,1,0, NULL), -- World Trigger (Large AOI, Not Immune PC/NPC) +(33938,0,0,1,0, NULL), -- Zom Bocom +(33937,0,0,1,0, NULL), -- Xazi Smolderpipe +(33936,0,0,1,0, NULL), -- Nargle Lashcord +(34095,0,0,1,0, NULL), -- Trapjaw Rix +(29527,0,0,257,0, NULL), -- Orton Bennet +(28956,0,0,257,0, NULL), -- Warcaster Fanoraithe +(29534,0,0,1,0, NULL), -- "Baroness" Llana +(31851,0,65536,1,0, NULL), -- Wooly Mammoth +(29493,0,0,257,0, NULL), -- Jarold Puller +(28989,0,0,258,0, NULL), -- Aemara +(29533,0,0,1,0, NULL), -- Schembari "Uncle Sal" Shearbolt +(32675,0,0,257,0, NULL), -- Babagahnoosh the Grumpy +(32691,0,0,257,0, NULL), -- Magus Fansy Goodbringer +(28993,0,0,1,0, NULL), -- Aerith Primrose +(29476,0,0,258,0, NULL), -- Dagna Flintlock +(29156,0,0,257,0, NULL), -- Archmage Celindra +(37858,0,50331648,0,0, NULL), -- Razorscale Image +(32265,0,50331648,1,0, NULL), -- Northrend Daily Dungeon Image Bunny +(31517,0,0,1,0, NULL), -- Dalaran Fountain Invis Stalker +(29499,0,0,257,0, NULL), -- Bartram Haller +(31228,0,0,1,0, NULL), -- Grove Walker +(33778,0,1,1,0, NULL), -- Tournament Hippogryph +(34244,0,0,1,0, NULL), -- Jean Pierre Poulain +(31236,0,0,1,0, NULL), -- Dappled Stag +(29631,0,0,1,0, NULL), -- Awilo Lon'gomba +(32692,0,0,257,0, NULL), -- Arcanist Alec +(32687,0,0,257,0, NULL), -- Linda Ann Kastinglow +(30352,0,0,256,0, NULL), -- Skybreaker Marine +(31085,0,0,1,0, NULL), -- Sky-Reaver Klum +(30755,0,0,256,0, NULL), -- Kor'kron Reaver +(31081,0,0,1,0, NULL), -- Officer Van Rossem +(28160,0,0,257,0, NULL), -- Archmage Pentarus +(28674,0,0,257,0, NULL), -- Aludane Whitecloud +(31031,0,0,1,69, NULL), -- Misensi +(31238,27525,0,257,0, NULL), -- Hira Snowdawn +(29238,0,0,1,0, NULL), -- Scourge Haunt +(31229,0,0,1,0, NULL), -- Ancient Watcher +(32596,0,0,257,0, NULL), -- Dalaran Visitor +(32602,25833,0,257,0, NULL), -- Dalaran Visitor +(32601,22471,0,257,0, NULL), -- Dalaran Visitor +(32415,0,0,1,0, NULL), -- Hamaka +(32419,0,0,1,0, NULL), -- Umbiwa +(32418,0,0,1,0, NULL), -- Abohba +(32253,0,0,2,0, NULL), -- Kyunghee +(32412,0,0,1,0, NULL), -- Mato +(32732,0,0,257,0, NULL), -- Dorfus Alphamage +(31439,0,0,1,0, NULL), -- Archmage Timear +(35826,0,1,1,0, NULL), -- Kaye Toogie +(32428,0,0,1,0, NULL), -- Underbelly Rat +(36670,0,0,1,0, NULL), -- Magister Hathorel +(32251,0,0,2,0, NULL), -- Shokavis +(32252,0,0,2,0, NULL), -- Wanathan +(32420,0,0,1,10, NULL), -- Mimbihi +(30659,0,0,1,333, NULL), -- Violet Hold Guard +(32730,0,0,257,0, NULL), -- Goldlilly Gleamingfell +(28991,0,0,257,0, NULL), -- Valaden Silverblade +(32470,0,0,1,0, NULL), -- Sewer Frog +(27047,0,0,1,0, NULL), -- Invisible Stalker (Floating Only) +(29497,0,0,257,0, NULL), -- Walther Whiteford +(29325,0,0,1,379, NULL), -- Torgo the Younger +(31080,0,0,1,0, NULL), -- Warden Alturas +(20735,0,0,1,0, NULL), -- Archmage Lan'dalock +(28742,0,0,257,0, NULL), -- Marcia Chase +(29496,0,0,257,0, NULL); -- Kerta the Bold + +-- Template updates for gameobject +UPDATE `gameobject_template` SET `faction`=0 WHERE `entry`=35591; -- Fishing Bobber diff --git a/sql/updates/world/2011_03_05_05_world_creatures.sql b/sql/updates/world/2011_03_05_05_world_creatures.sql new file mode 100644 index 0000000000000..6eb520e6f0ab7 --- /dev/null +++ b/sql/updates/world/2011_03_05_05_world_creatures.sql @@ -0,0 +1,58 @@ +-- Dalaran Violet Citadel/Purple Parlor - npc scripts +SET @CGuid = 151893; -- Set by TDB team + +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=32739; -- Baroness Zildjia +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=32736; -- Scribe Whitman +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=32741; -- Conjurer Weinhaus +UPDATE `creature_template` SET `exp`=0 WHERE `entry`=32631; -- Alfred Copperworth +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=32734; -- Arcanist Ginsberg +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=32735; -- Alchemist Burroughs + +DELETE FROM `creature` WHERE `id`=32741; -- Conjurer Weinhaus +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`DeathState`,`MovementType`,`npcflag`,`unit_flags`,`dynamicflags`) VALUES +(@CGuid+0,32741,571,1,1,0,0,5871.94,852.655,846.336,6.21344,300,0,0,1,0,0,0,0,0,0); +DELETE FROM `creature_template_addon` WHERE `entry` IN (31848,32287,32739,32736,32631,32737,32734,32735); +INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(31848,0,0,1,0, NULL), -- Zidormi +(32287,0,0,257,0, NULL), -- Archmage Alvareaux +(32739,0,0,257,0, NULL), -- Baroness Zildjia +(32736,0,0,257,0, NULL), -- Scribe Whitman +(32631,0,0,1,0, NULL), -- Alfred Copperworth +(32737,0,0,257,0, NULL), -- Archmage John Nicholas +(32734,0,0,257,0, NULL), -- Arcanist Ginsberg +(32735,0,0,257,0, NULL); -- Alchemist Burroughs +UPDATE `creature_model_info` SET `bounding_radius`=0.208,`combat_reach`=1,`gender`=1 WHERE `modelid`=27756; -- Zidormi +UPDATE `creature_model_info` SET `bounding_radius`=0.3672,`combat_reach`=1,`gender`=0 WHERE `modelid`=27886; -- Archmage Alvareaux +UPDATE `creature_model_info` SET `bounding_radius`=0.383,`combat_reach`=1,`gender`=1 WHERE `modelid`=28176; -- Baroness Zildjia +UPDATE `creature_model_info` SET `bounding_radius`=0.3519,`combat_reach`=1,`gender`=0 WHERE `modelid`=28179; -- Scribe Whitman +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=28119; -- Alfred Copperworth +UPDATE `creature_model_info` SET `bounding_radius`=0.383,`combat_reach`=1,`gender`=0 WHERE `modelid`=28174; -- Archmage John Nicholas +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=28173; -- Arcanist Ginsberg +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=28172; -- Alchemist Burroughs +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=19284; -- Archmage Vargoth + +-- Add teleport to gossip option "Teleport me to Caverns of Time." - Zidormi +UPDATE `gossip_menu_option` SET `action_script_id`=10131 WHERE `menu_id`=10131 AND `id`=0; +DELETE FROM `gossip_scripts` WHERE `id`=10131; +INSERT INTO `gossip_scripts` (`id`,`delay`,`command`,`datalong`,`datalong2`,`dataint`,`x`,`y`,`z`,`o`) VALUES +(10131,0,6,1,0,0,-8167.24,-4766.05,33.8599,1.74123); +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=10131 AND `SourceEntry`=0; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(15,10131,0,0,27,65,3,0,0, '', 'Zidormi - Teleport to CoT level restriction'); -- Zidormi + +-- Talk events for Baroness Zildjia, Scribe Whitman and Conjurer Weinhaus +DELETE FROM `creature_text` WHERE `entry` IN (32739,32736,32741) AND `groupid`=0; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(32739,0,0, 'The view up here is amazing!',0,0,0,5,0,0, 'Baroness Zildjia'), -- Baroness Zildjia +(32739,0,1, 'Too bad I left my light feathers at home... Slow Fall would work perfect here!',0,0,0,1,0,0, 'Baroness Zildjia'), -- Baroness Zildjia +(32736,0,0, 'The view up here is amazing!',0,0,0,5,0,0, 'Scribe Whitman'), -- Scribe Whitman +(32736,0,1, 'Too bad I left my light feathers at home... Slow Fall would work perfect here!',0,0,0,1,0,0, 'Scribe Whitman'), -- Scribe Whitman +(32741,0,0, 'The view up here is amazing!',0,0,0,5,0,0, 'Conjurer Weinhaus'), -- Conjurer Weinhaus +(32741,0,1, 'Too bad I left my light feathers at home... Slow Fall would work perfect here!',0,0,0,1,0,0, 'Conjurer Weinhaus'); -- Conjurer Weinhaus +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (32739,32736,32741,32734,32735) AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(32739,0,0,0,1,0,100,0,0,0,420000,1000000,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Baroness Zildjia: Say rand text every 7-14 minutes'), -- Baroness Zildjia +(32736,0,0,0,1,0,100,0,0,0,300000,840000,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Scribe Whitman: Say rand text every 5-14 minutes'), -- Scribe Whitman +(32741,0,0,0,1,0,100,0,0,0,400000,520000,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Conjurer Weinhaus: Say rand text every 5-7 minutes'), -- Conjurer Weinhaus +(32734,0,0,0,1,0,100,0,0,0,5000,30000,10,274,1,11,0,0,0,1,0,0,0,0,0,0,0, 'Arcanist Ginsberg: Random emote every 5-30 seconds'), -- Arcanist Ginsberg +(32735,0,0,0,1,0,100,0,0,0,5000,30000,10,274,1,11,0,0,0,1,0,0,0,0,0,0,0, 'Alchemist Burroughs: Random emote every 5-30 seconds'); -- Alchemist Burroughs diff --git a/sql/updates/world/2011_03_06_00_world_creatures.sql b/sql/updates/world/2011_03_06_00_world_creatures.sql new file mode 100644 index 0000000000000..2e5c8ba2aa603 --- /dev/null +++ b/sql/updates/world/2011_03_06_00_world_creatures.sql @@ -0,0 +1 @@ +UPDATE `creature` SET `modelid`=0,`equipment_id`=0 WHERE `map`=631; diff --git a/sql/updates/world/2011_03_06_01_world_loot_template.sql b/sql/updates/world/2011_03_06_01_world_loot_template.sql new file mode 100644 index 0000000000000..4681bd9ca9675 --- /dev/null +++ b/sql/updates/world/2011_03_06_01_world_loot_template.sql @@ -0,0 +1,392 @@ +-- Trashloot for ICC/FoS/PoS/HoR +-- Generic +SET @ICC_TrashGenericGrey := 35063; -- Set by TDB (need x) +SET @ICC_TrashGenericWhite := @ICC_TrashGenericGrey+1; +SET @ICC_TrashGenericScroll := @ICC_TrashGenericGrey+2; +SET @ICC_TrashGenericGreen := @ICC_TrashGenericGrey+3; +SET @ICC_TrashGenericBlue := @ICC_TrashGenericGrey+4; +SET @ICC_TrashGenericPurpleICC := @ICC_TrashGenericGrey+5; +SET @ICC_TrashCitadelFinal := @ICC_TrashGenericGrey+6; +SET @ICC_TrashGenericPurpleDUNN := @ICC_TrashGenericGrey+7; +SET @ICC_TrashDungeonNFinal := @ICC_TrashGenericGrey+8; +SET @ICC_TrashGenericPurpleDUNH := @ICC_TrashGenericGrey+9; +SET @ICC_TrashDungeonHFinal := @ICC_TrashGenericGrey+10; + +DELETE FROM `reference_loot_template` WHERE `entry` BETWEEN @ICC_TrashGenericGrey AND @ICC_TrashGenericGrey+10; +DELETE FROM `reference_loot_template` WHERE `entry` BETWEEN 35063 AND 35076; -- cleanup OLD loot +INSERT INTO reference_loot_template (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- grey items (45) +(@ICC_TrashGenericGrey,33430,0,1,1,1,1), -- Abandoned Greatsword +(@ICC_TrashGenericGrey,33426,0,1,1,1,1), -- Chipped Timber Axe +(@ICC_TrashGenericGrey,33424,0,1,1,1,1), -- Cracked Iron Staff +(@ICC_TrashGenericGrey,33428,0,1,1,1,1), -- Dulled SHiv +(@ICC_TrashGenericGrey,33397,0,1,1,1,1), -- Frigid Mail Armor +(@ICC_TrashGenericGrey,33398,0,1,1,1,1), -- Frigid Mail Belt +(@ICC_TrashGenericGrey,33399,0,1,1,1,1), -- Frigid Mail Boots +(@ICC_TrashGenericGrey,33400,0,1,1,1,1), -- Frigid Mail Bracers +(@ICC_TrashGenericGrey,33433,0,1,1,1,1), -- Frigid Mail Circlet +(@ICC_TrashGenericGrey,33401,0,1,1,1,1), -- Frigid Mail Gloves +(@ICC_TrashGenericGrey,33402,0,1,1,1,1), -- Frigid Mail Pants +(@ICC_TrashGenericGrey,33403,0,1,1,1,1), -- Frigid Mail Shoulderpads +(@ICC_TrashGenericGrey,33427,0,1,1,1,1), -- Frost-Encrusted Rifle +(@ICC_TrashGenericGrey,33365,0,1,1,1,1), -- Frost-Rimed Cloth Belt +(@ICC_TrashGenericGrey,33366,0,1,1,1,1), -- Frost-Rimed Cloth Boots +(@ICC_TrashGenericGrey,33367,0,1,1,1,1), -- Frost-Rimed Cloth Bracers +(@ICC_TrashGenericGrey,33368,0,1,1,1,1), -- Frost-Rimed Cloth Gloves +(@ICC_TrashGenericGrey,33346,0,1,1,1,1), -- Frost-Rimed Cloth Hat +(@ICC_TrashGenericGrey,33369,0,1,1,1,1), -- Frost-Rimed Cloth Pants +(@ICC_TrashGenericGrey,33370,0,1,1,1,1), -- Frost-Rimed Cloth Shoulderpads +(@ICC_TrashGenericGrey,33371,0,1,1,1,1), -- Frost-Rimed Cloth Vest +(@ICC_TrashGenericGrey,33412,0,1,1,1,1), -- Frost-Worn Plate Belt +(@ICC_TrashGenericGrey,33413,0,1,1,1,1), -- Frost-Worn Plate Boots +(@ICC_TrashGenericGrey,33414,0,1,1,1,1), -- Frost-Worn Plate Bracers +(@ICC_TrashGenericGrey,33415,0,1,1,1,1), -- Frost-Worn Plate Chestpiece +(@ICC_TrashGenericGrey,33416,0,1,1,1,1), -- Frost-Worn Plate Gloves +(@ICC_TrashGenericGrey,33435,0,1,1,1,1), -- Frost-Worn Plate Helmet +(@ICC_TrashGenericGrey,33417,0,1,1,1,1), -- Frost-Worn Plate Pants +(@ICC_TrashGenericGrey,33419,0,1,1,1,1), -- Frost-Worn Plate Shoulderpads +(@ICC_TrashGenericGrey,33379,0,1,1,1,1), -- Frozen Armor +(@ICC_TrashGenericGrey,33380,0,1,1,1,1), -- Frozen Belt +(@ICC_TrashGenericGrey,33381,0,1,1,1,1), -- Frozen Boots +(@ICC_TrashGenericGrey,33382,0,1,1,1,1), -- Frozen Bracers +(@ICC_TrashGenericGrey,33383,0,1,1,1,1), -- Frozen Gloves +(@ICC_TrashGenericGrey,33434,0,1,1,1,1), -- Frozen Leather Helmet +(@ICC_TrashGenericGrey,33384,0,1,1,1,1), -- Frozen Pants +(@ICC_TrashGenericGrey,33385,0,1,1,1,1), -- Frozen Shoulderpads +(@ICC_TrashGenericGrey,33429,0,1,1,1,1), -- Ice Cleaver +(@ICC_TrashGenericGrey,33425,0,1,1,1,1), -- Ice-Pitted Blade +(@ICC_TrashGenericGrey,33431,0,1,1,1,1), -- Icesmashing Mace +(@ICC_TrashGenericGrey,33423,0,1,1,1,1), -- Rime-Covered Mace +(@ICC_TrashGenericGrey,33422,0,1,1,1,1), -- Shattered Bow +(@ICC_TrashGenericGrey,43852,70,1,1,1,1), -- Thick Fur Clothing Scraps (drops more often) +-- white items +(@ICC_TrashGenericWhite,33470,0,1,1,2,7), -- Frostweave Cloth +(@ICC_TrashGenericWhite,33445,0,1,1,1,1), -- Honeymint Tea +(@ICC_TrashGenericWhite,33454,0,1,1,1,1), -- Salted Venison +(@ICC_TrashGenericWhite,35947,0,1,1,1,1), -- Sparkling Frostcap +(@ICC_TrashGenericWhite,33447,0,1,1,1,1), -- Runic Healing Potion +(@ICC_TrashGenericWhite,33448,0,1,1,1,1), -- Runic Mana Potion +-- Scroll items +(@ICC_TrashGenericScroll,43463,0,1,1,1,1), -- Scroll of Agility VII +(@ICC_TrashGenericScroll,37091,0,1,1,1,1), -- Scroll of Intellect VII +(@ICC_TrashGenericScroll,37093,0,1,1,1,1), -- Scroll of Stamina VII +(@ICC_TrashGenericScroll,43465,0,1,1,1,1), -- Scroll of Strength VII +(@ICC_TrashGenericScroll,37097,0,1,1,1,1), -- Scroll of Spirit VII +(@ICC_TrashGenericScroll,43464,0,1,1,1,1), -- Scroll of Agility VIII +(@ICC_TrashGenericScroll,37092,0,1,1,1,1), -- Scroll of Intellect VIII +(@ICC_TrashGenericScroll,37094,0,1,1,1,1), -- Scroll of Stamina VIII +(@ICC_TrashGenericScroll,43466,0,1,1,1,1), -- Scroll of Strength VIII +(@ICC_TrashGenericScroll,37098,0,1,1,1,1), -- Scroll of Spirit VIII +-- green items (166) +(@ICC_TrashGenericGreen,36609,0,1,1,1,1), -- Abandoned Spear +(@ICC_TrashGenericGreen,36497,0,1,1,1,1), -- Adamant Mallet +(@ICC_TrashGenericGreen,36511,0,1,1,1,1), -- Artic War Hammer +(@ICC_TrashGenericGreen,36694,0,1,1,1,1), -- Beatific Mace +(@ICC_TrashGenericGreen,36527,0,1,1,1,1), -- Blackened Blade +(@ICC_TrashGenericGreen,36611,0,1,1,1,1), -- Black Scythe +(@ICC_TrashGenericGreen,36638,0,1,1,1,1), -- Bloody Crossbow +(@ICC_TrashGenericGreen,36428,0,1,1,1,1), -- Bouquet Ring +(@ICC_TrashGenericGreen,36639,0,1,1,1,1), -- Brutal Ballista +(@ICC_TrashGenericGreen,36707,0,1,1,1,1), -- Cascading Water Staff +(@ICC_TrashGenericGreen,36539,0,1,1,1,1), -- Chilled Warblade +(@ICC_TrashGenericGreen,36723,0,1,1,1,1), -- Clawed Shuriken +(@ICC_TrashGenericGreen,36035,0,1,1,1,1), -- Condor Belt +(@ICC_TrashGenericGreen,36042,0,1,1,1,1), -- Condor Bindings +(@ICC_TrashGenericGreen,36038,0,1,1,1,1), -- Condor Gloves +(@ICC_TrashGenericGreen,36039,0,1,1,1,1), -- Condor Headpiece +(@ICC_TrashGenericGreen,36040,0,1,1,1,1), -- Condor Pants +(@ICC_TrashGenericGreen,36037,0,1,1,1,1), -- Condor Robe +(@ICC_TrashGenericGreen,36036,0,1,1,1,1), -- Condor Sandals +(@ICC_TrashGenericGreen,36041,0,1,1,1,1), -- Condor Shoulderpads +(@ICC_TrashGenericGreen,36266,0,1,1,1,1), -- Cormorant Bracelets +(@ICC_TrashGenericGreen,36261,0,1,1,1,1), -- Cormorant Chain Vest +(@ICC_TrashGenericGreen,36260,0,1,1,1,1), -- Cormorant Footwraps +(@ICC_TrashGenericGreen,36262,0,1,1,1,1), -- Cormorant Gloves +(@ICC_TrashGenericGreen,36263,0,1,1,1,1), -- Cormorant Helm +(@ICC_TrashGenericGreen,36264,0,1,1,1,1), -- Cormorant Leggings +(@ICC_TrashGenericGreen,36265,0,1,1,1,1), -- Cormorant Mantle +(@ICC_TrashGenericGreen,36259,0,1,1,1,1), -- Cormorant Waistband +(@ICC_TrashGenericGreen,36525,0,1,1,1,1), -- Craggy Machete +(@ICC_TrashGenericGreen,36709,0,1,1,1,1), -- Crystal Woodstaff +(@ICC_TrashGenericGreen,36050,0,1,1,1,1), -- Crystalsong Bracelets +(@ICC_TrashGenericGreen,36047,0,1,1,1,1), -- Crystalsong Crown +(@ICC_TrashGenericGreen,36046,0,1,1,1,1), -- Crystalsong Gloves +(@ICC_TrashGenericGreen,36048,0,1,1,1,1), -- Crystalsong Leggings +(@ICC_TrashGenericGreen,36049,0,1,1,1,1), -- Crystalsong Mantle +(@ICC_TrashGenericGreen,36045,0,1,1,1,1), -- Crystalsong Robe +(@ICC_TrashGenericGreen,36043,0,1,1,1,1), -- Crystalsong Sash +(@ICC_TrashGenericGreen,36044,0,1,1,1,1), -- Crystalsong Slippers +(@ICC_TrashGenericGreen,36554,0,1,1,1,1), -- Cursed Staff +(@ICC_TrashGenericGreen,43297,0,1,1,1,1), -- Damaged Necklace +(@ICC_TrashGenericGreen,36553,0,1,1,1,1), -- Desecrated Staff +(@ICC_TrashGenericGreen,36695,0,1,1,1,1), -- Dogmatic Scepter +(@ICC_TrashGenericGreen,36721,0,1,1,1,1), -- Dragon's Teeth +(@ICC_TrashGenericGreen,36413,0,1,1,1,1), -- Dyed Taffeta Cape +(@ICC_TrashGenericGreen,36427,0,1,1,1,1), -- Engraved Ring +(@ICC_TrashGenericGreen,36484,0,1,1,1,1), -- Etched Dagger +(@ICC_TrashGenericGreen,36499,0,1,1,1,1), -- Frigid War-Mace +(@ICC_TrashGenericGreen,36470,0,1,1,1,1), -- Gilded Scepter +(@ICC_TrashGenericGreen,36381,0,1,1,1,1), -- Golem Breastplate +(@ICC_TrashGenericGreen,36382,0,1,1,1,1), -- Golem Gauntlets +(@ICC_TrashGenericGreen,36379,0,1,1,1,1), -- Golem Girdle +(@ICC_TrashGenericGreen,36383,0,1,1,1,1), -- Golem Helmet +(@ICC_TrashGenericGreen,36384,0,1,1,1,1), -- Golem Legplates +(@ICC_TrashGenericGreen,36385,0,1,1,1,1), -- Golem Pauldrons +(@ICC_TrashGenericGreen,36380,0,1,1,1,1), -- Golem Sabatons +(@ICC_TrashGenericGreen,36386,0,1,1,1,1), -- Golem Vambraces +(@ICC_TrashGenericGreen,36623,0,1,1,1,1), -- Harnessed Longbow +(@ICC_TrashGenericGreen,36568,0,1,1,1,1), -- Hollowed Bone Knuckles +(@ICC_TrashGenericGreen,36637,0,1,1,1,1), -- Horrific Crossbow +(@ICC_TrashGenericGreen,36471,0,1,1,1,1), -- Ice Crystal +(@ICC_TrashGenericGreen,36582,0,1,1,1,1), -- Ice Pick +(@ICC_TrashGenericGreen,36597,0,1,1,1,1), -- Ice-Splintering Axe +(@ICC_TrashGenericGreen,36456,0,1,1,1,1), -- Ice Kite Shield +(@ICC_TrashGenericGreen,36457,0,1,1,1,1), -- Ivory Shield +(@ICC_TrashGenericGreen,36373,0,1,1,1,1), -- Kraken Breastplate +(@ICC_TrashGenericGreen,36377,0,1,1,1,1), -- Kraken Epaulets +(@ICC_TrashGenericGreen,36374,0,1,1,1,1), -- Kraken Gauntlets +(@ICC_TrashGenericGreen,36371,0,1,1,1,1), -- Kraken Girdle +(@ICC_TrashGenericGreen,36372,0,1,1,1,1), -- Kraken Greaves +(@ICC_TrashGenericGreen,36375,0,1,1,1,1), -- Kraken Helm +(@ICC_TrashGenericGreen,36376,0,1,1,1,1), -- Kraken Legplates +(@ICC_TrashGenericGreen,36378,0,1,1,1,1), -- Kraken Vambraces +(@ICC_TrashGenericGreen,36469,0,1,1,1,1), -- Lidless Orb +(@ICC_TrashGenericGreen,36513,0,1,1,1,1), -- Lode-Headed Hammer +(@ICC_TrashGenericGreen,36414,0,1,1,1,1), -- Mammoth Fur Cloack +(@ICC_TrashGenericGreen,36483,0,1,1,1,1), -- Mandible Edge +(@ICC_TrashGenericGreen,36625,0,1,1,1,1), -- Massive Recurved Bow +(@ICC_TrashGenericGreen,36555,0,1,1,1,1), -- Minion Staff +(@ICC_TrashGenericGreen,36651,0,1,1,1,1), -- Muzzled Musket +(@ICC_TrashGenericGreen,36680,0,1,1,1,1), -- Mystic Fang +(@ICC_TrashGenericGreen,36498,0,1,1,1,1), -- Nerubian Mace +(@ICC_TrashGenericGreen,36512,0,1,1,1,1), -- Onerous Mallet +(@ICC_TrashGenericGreen,36441,0,1,1,1,1), -- Pearl Woven Choker +(@ICC_TrashGenericGreen,36540,0,1,1,1,1), -- Petrified Sword +(@ICC_TrashGenericGreen,36610,0,1,1,1,1), -- Plagued Pike +(@ICC_TrashGenericGreen,36595,0,1,1,1,1), -- Planate Broadaxe +(@ICC_TrashGenericGreen,36455,0,1,1,1,1), -- Plated Bulwark +(@ICC_TrashGenericGreen,36443,0,1,1,1,1), -- Platinum Medallion +(@ICC_TrashGenericGreen,36666,0,1,1,1,1), -- Polar Wand +(@ICC_TrashGenericGreen,36653,0,1,1,1,1), -- Precipice Longrifle +(@ICC_TrashGenericGreen,36147,0,1,1,1,1), -- Pygmy Belt +(@ICC_TrashGenericGreen,36154,0,1,1,1,1), -- Pygmy Bindings +(@ICC_TrashGenericGreen,36148,0,1,1,1,1), -- Pygmy Boots +(@ICC_TrashGenericGreen,36150,0,1,1,1,1), -- Pygmy Gloves +(@ICC_TrashGenericGreen,36151,0,1,1,1,1), -- Pygmy Helmet +(@ICC_TrashGenericGreen,36152,0,1,1,1,1), -- Pygmy Pants +(@ICC_TrashGenericGreen,36153,0,1,1,1,1), -- Pygmy Shoulders +(@ICC_TrashGenericGreen,36149,0,1,1,1,1), -- Pygmy Tunic +(@ICC_TrashGenericGreen,36722,0,1,1,1,1), -- Pyramid Throwing Star +(@ICC_TrashGenericGreen,36389,0,1,1,1,1), -- Revenant Armor +(@ICC_TrashGenericGreen,36387,0,1,1,1,1), -- Revenant Belt +(@ICC_TrashGenericGreen,36394,0,1,1,1,1), -- Revenant Bracers +(@ICC_TrashGenericGreen,36393,0,1,1,1,1), -- Revenant Epaulets +(@ICC_TrashGenericGreen,36390,0,1,1,1,1), -- Revenant Gauntlets +(@ICC_TrashGenericGreen,36388,0,1,1,1,1), -- Revenant Greaves +(@ICC_TrashGenericGreen,36391,0,1,1,1,1), -- Revenant Helmet +(@ICC_TrashGenericGreen,36392,0,1,1,1,1), -- Revenant Legguards +(@ICC_TrashGenericGreen,36596,0,1,1,1,1), -- Rupturing Axe +(@ICC_TrashGenericGreen,36569,0,1,1,1,1), -- Savage Talons +(@ICC_TrashGenericGreen,36693,0,1,1,1,1), -- Serene Hammer +(@ICC_TrashGenericGreen,36624,0,1,1,1,1), -- Shrieking Bow +(@ICC_TrashGenericGreen,36442,0,1,1,1,1), -- Silken Cord Amulet +(@ICC_TrashGenericGreen,36679,0,1,1,1,1), -- Singing Dagger +(@ICC_TrashGenericGreen,36485,0,1,1,1,1), -- Sinuous Keris +(@ICC_TrashGenericGreen,36567,0,1,1,1,1), -- Six-Fingered Claws +(@ICC_TrashGenericGreen,36583,0,1,1,1,1), -- Skeletal Hacker +(@ICC_TrashGenericGreen,36526,0,1,1,1,1), -- SLeeted Longsword +(@ICC_TrashGenericGreen,36708,0,1,1,1,1), -- Snow Blossom Staff +(@ICC_TrashGenericGreen,36667,0,1,1,1,1), -- Solid Ice Wand +(@ICC_TrashGenericGreen,36275,0,1,1,1,1), -- Spiderlord Belt +(@ICC_TrashGenericGreen,36276,0,1,1,1,1), -- Spiderlord Boots +(@ICC_TrashGenericGreen,36282,0,1,1,1,1), -- Spiderlord Bracers +(@ICC_TrashGenericGreen,36277,0,1,1,1,1), -- Spiderlord Chestpiece +(@ICC_TrashGenericGreen,36278,0,1,1,1,1), -- Spiderlord Gauntlets +(@ICC_TrashGenericGreen,36279,0,1,1,1,1), -- Spiderlord Helm +(@ICC_TrashGenericGreen,36280,0,1,1,1,1), -- Spiderlord Legguards +(@ICC_TrashGenericGreen,36281,0,1,1,1,1), -- Spiderlord Spaulders +(@ICC_TrashGenericGreen,36429,0,1,1,1,1), -- Spur Ring +(@ICC_TrashGenericGreen,36652,0,1,1,1,1), -- Stocky Shotgun +(@ICC_TrashGenericGreen,36274,0,1,1,1,1), -- Ulduar Bracers +(@ICC_TrashGenericGreen,36269,0,1,1,1,1), -- Ulduar Breastplate +(@ICC_TrashGenericGreen,36270,0,1,1,1,1), -- Ulduar Gauntlets +(@ICC_TrashGenericGreen,36267,0,1,1,1,1), -- Ulduar Girdle +(@ICC_TrashGenericGreen,36268,0,1,1,1,1), -- Ulduar Greaves +(@ICC_TrashGenericGreen,36271,0,1,1,1,1), -- Ulduar Helm +(@ICC_TrashGenericGreen,36272,0,1,1,1,1), -- Ulduar Legguards +(@ICC_TrashGenericGreen,36273,0,1,1,1,1), -- Ulduar Shoulderguards +(@ICC_TrashGenericGreen,36415,0,1,1,1,1), -- Vintage Satin Cloak +(@ICC_TrashGenericGreen,36058,0,1,1,1,1), -- Vizier Bracelets +(@ICC_TrashGenericGreen,36054,0,1,1,1,1), -- Vizier Gloves +(@ICC_TrashGenericGreen,36055,0,1,1,1,1), -- Vizier Hood +(@ICC_TrashGenericGreen,36056,0,1,1,1,1), -- Vizier Leggings +(@ICC_TrashGenericGreen,36057,0,1,1,1,1), -- Vizier Mantle +(@ICC_TrashGenericGreen,36053,0,1,1,1,1), -- Vizier Robe +(@ICC_TrashGenericGreen,36051,0,1,1,1,1), -- Vizier Sash +(@ICC_TrashGenericGreen,36052,0,1,1,1,1), -- Vizier SLippers +(@ICC_TrashGenericGreen,36665,0,1,1,1,1), -- Wasteland Wand +(@ICC_TrashGenericGreen,36170,0,1,1,1,1), -- Webspinner Bindings +(@ICC_TrashGenericGreen,36164,0,1,1,1,1), -- Webspinner Boots +(@ICC_TrashGenericGreen,36163,0,1,1,1,1), -- Webspinner Cord +(@ICC_TrashGenericGreen,36166,0,1,1,1,1), -- Webspinner Gloves +(@ICC_TrashGenericGreen,36167,0,1,1,1,1), -- Webspinner Hood +(@ICC_TrashGenericGreen,36168,0,1,1,1,1), -- Webspinner Leggings +(@ICC_TrashGenericGreen,36169,0,1,1,1,1), -- Webspinner Shoulderguards +(@ICC_TrashGenericGreen,36165,0,1,1,1,1), -- Webspinner Vest +(@ICC_TrashGenericGreen,36162,0,1,1,1,1), -- Wendigo Bands +(@ICC_TrashGenericGreen,36156,0,1,1,1,1), -- Wendigo Boots +(@ICC_TrashGenericGreen,36157,0,1,1,1,1), -- Wendigo Chestpiece +(@ICC_TrashGenericGreen,36155,0,1,1,1,1), -- Wendigo Girdle +(@ICC_TrashGenericGreen,36158,0,1,1,1,1), -- Wendigo Gloves +(@ICC_TrashGenericGreen,36159,0,1,1,1,1), -- Wendigo Hood +(@ICC_TrashGenericGreen,36160,0,1,1,1,1), -- Wendigo Legguards +(@ICC_TrashGenericGreen,36161,0,1,1,1,1), -- Wendigo Pauldrons +(@ICC_TrashGenericGreen,36541,0,1,1,1,1), -- Wintry Claymore +(@ICC_TrashGenericGreen,36681,0,1,1,1,1), -- Wisdom Carver +(@ICC_TrashGenericGreen,36581,0,1,1,1,1), -- Wolvar Handaxe +-- blue items +(@ICC_TrashGenericBlue,37792,0,1,1,1,1), -- Agin's Crushing Carapace +(@ICC_TrashGenericBlue,37770,0,1,1,1,1), -- Bulge-Concealing Breastplate +(@ICC_TrashGenericBlue,37780,0,1,1,1,1), -- Condor-Bone Chestguard +(@ICC_TrashGenericBlue,37760,0,1,1,1,1), -- Cracklefire Wristguards +(@ICC_TrashGenericBlue,37781,0,1,1,1,1), -- Grips of the Warming Heart +(@ICC_TrashGenericBlue,37824,0,1,1,1,1), -- Gwyneth's Runed Dragonwand +(@ICC_TrashGenericBlue,37761,0,1,1,1,1), -- Shimmerthread Girdle +(@ICC_TrashGenericBlue,37793,0,1,1,1,1), -- Skullcage of Eternal Terror +(@ICC_TrashGenericBlue,37794,0,1,1,1,1), -- Torta's Oversized Choker +(@ICC_TrashGenericBlue,37822,0,1,1,1,1), -- Twisted Puzzle-Ring +(@ICC_TrashGenericBlue,37771,0,1,1,1,1), -- Wristguard of Verdant Recovery +-- Designs +(@ICC_TrashGenericBlue,41788,0,1,1,1,1), -- Design: Beaming Earthsiege Diamond +(@ICC_TrashGenericBlue,41780,0,1,1,1,1), -- Design: Champion's Monarch Topaz +(@ICC_TrashGenericBlue,41786,0,1,1,1,1), -- Design: Destructive Skyflare Diamond +(@ICC_TrashGenericBlue,41777,0,1,1,1,1), -- Design: Etched Monarch Topaz +(@ICC_TrashGenericBlue,41789,0,1,1,1,1), -- Design: Inscribed Monarch Topaz +(@ICC_TrashGenericBlue,41781,0,1,1,1,1), -- Design: Misty Forest Emerald +(@ICC_TrashGenericBlue,41783,0,1,1,1,1), -- Design: Purified Twilight Opal +(@ICC_TrashGenericBlue,41778,0,1,1,1,1), -- Design: Resolute MOnarch Topaz +(@ICC_TrashGenericBlue,41782,0,1,1,1,1), -- Design: Shining Forest Emerald +(@ICC_TrashGenericBlue,41784,0,1,1,1,1), -- Design: Sovereign Twilight Opal +(@ICC_TrashGenericBlue,41779,0,1,1,1,1), -- Design: Stalwart Monarch Topaz +(@ICC_TrashGenericBlue,41785,0,1,1,1,1), -- Design: Tenuous Twilight Opal +(@ICC_TrashGenericBlue,41787,0,1,1,1,1), -- Design: Thundering Skyflare Diamond +-- tailoring +(@ICC_TrashGenericBlue,43876,0,1,1,1,1), -- A Guide to Northern Cloth Scavenging +-- purple items icc (8) +(@ICC_TrashGenericPurpleICC,44311,0,1,1,1,1), -- Avool's Sword of Jin +(@ICC_TrashGenericPurpleICC,37835,0,1,1,1,1), -- Je'Tze's Bell +(@ICC_TrashGenericPurpleICC,44310,0,1,1,1,1), -- Namlak's Supernumerary Sticker +(@ICC_TrashGenericPurpleICC,44309,0,1,1,1,1), -- Sash of Jordan +(@ICC_TrashGenericPurpleICC,44308,0,1,1,1,1), -- Signet of Edward the Odd +(@ICC_TrashGenericPurpleICC,37254,0,1,1,1,1), -- Super Simian Sphere +(@ICC_TrashGenericPurpleICC,44312,0,1,1,1,1), -- Wapach's Spaulders of Solidarity +(@ICC_TrashGenericPurpleICC,44313,0,1,1,1,1), -- Zom's Crackling Bulwark +(@ICC_TrashGenericPurpleICC,50444,0,1,1,1,1), -- Rowan's Rifle of Silver Bullets +(@ICC_TrashGenericPurpleICC,50451,0,1,1,1,1), -- Belt of the Lonely Noble +(@ICC_TrashGenericPurpleICC,50775,0,1,1,1,1), -- Leggings of Dubious Charms +(@ICC_TrashGenericPurpleICC,50449,0,1,1,1,1), -- Stiffened Corpse Shoulderpads +(@ICC_TrashGenericPurpleICC,50453,0,1,1,1,1), -- Ring of Rotting Sinew +(@ICC_TrashGenericPurpleICC,50447,0,1,1,1,1), -- Harbinger's Bone Band +(@ICC_TrashGenericPurpleICC,50452,0,1,1,1,1), -- Wodin's Lucky Necklace +-- purple items dungeon_N (8) +(@ICC_TrashGenericPurpleDUNN,44311,0,1,1,1,1), -- Avool's Sword of Jin +(@ICC_TrashGenericPurpleDUNN,37835,0,1,1,1,1), -- Je'Tze's Bell +(@ICC_TrashGenericPurpleDUNN,44310,0,1,1,1,1), -- Namlak's Supernumerary Sticker +(@ICC_TrashGenericPurpleDUNN,44309,0,1,1,1,1), -- Sash of Jordan +(@ICC_TrashGenericPurpleDUNN,44308,0,1,1,1,1), -- Signet of Edward the Odd +(@ICC_TrashGenericPurpleDUNN,37254,0,1,1,1,1), -- Super Simian Sphere +(@ICC_TrashGenericPurpleDUNN,44312,0,1,1,1,1), -- Wapach's Spaulders of Solidarity +(@ICC_TrashGenericPurpleDUNN,44313,0,1,1,1,1), -- Zom's Crackling Bulwark +(@ICC_TrashGenericPurpleDUNN,49852,0,1,1,1,1), -- Coffin Nail +(@ICC_TrashGenericPurpleDUNN,49855,0,1,1,1,1), -- Plated Grips of Korth'azz +(@ICC_TrashGenericPurpleDUNN,49853,0,1,1,1,1), -- Titanium Links of Lore +(@ICC_TrashGenericPurpleDUNN,49854,0,1,1,1,1), -- Mantle of Tattered Feathers +-- purple items dungeon_H (8) +(@ICC_TrashGenericPurpleDUNH,44311,0,1,1,1,1), -- Avool's Sword of Jin +(@ICC_TrashGenericPurpleDUNH,37835,0,1,1,1,1), -- Je'Tze's Bell +(@ICC_TrashGenericPurpleDUNH,44310,0,1,1,1,1), -- Namlak's Supernumerary Sticker +(@ICC_TrashGenericPurpleDUNH,44309,0,1,1,1,1), -- Sash of Jordan +(@ICC_TrashGenericPurpleDUNH,44308,0,1,1,1,1), -- Signet of Edward the Odd +(@ICC_TrashGenericPurpleDUNH,37254,0,1,1,1,1), -- Super Simian Sphere +(@ICC_TrashGenericPurpleDUNH,44312,0,1,1,1,1), -- Wapach's Spaulders of Solidarity +(@ICC_TrashGenericPurpleDUNH,44313,0,1,1,1,1), -- Zom's Crackling Bulwark +(@ICC_TrashGenericPurpleDUNH,50319,0,1,1,1,1), -- Unsharpened Ice Razor +(@ICC_TrashGenericPurpleDUNH,50315,0,1,1,1,1), -- Seven-Fingered Claws +(@ICC_TrashGenericPurpleDUNH,50318,0,1,1,1,1), -- Ghostly Wristwraps +-- final output icc +(@ICC_TrashCitadelFinal,1,40,1,0,-@ICC_TrashGenericGrey,1), -- 1 grey loot (40%) +(@ICC_TrashCitadelFinal,2,40,1,0,-@ICC_TrashGenericGrey,1), -- 1 grey loot (40%) +(@ICC_TrashCitadelFinal,3,20,1,0,-@ICC_TrashGenericWhite,1), -- 1 white loot (20%) +(@ICC_TrashCitadelFinal,4,7,1,0,-@ICC_TrashGenericScroll,1), -- 1 scroll loot (7%) +(@ICC_TrashCitadelFinal,5,10,1,0,-@ICC_TrashGenericGreen,1), -- 1 green loot (10%) +(@ICC_TrashCitadelFinal,6,3,1,0,-@ICC_TrashGenericBlue,1), -- 1 blue loot (3%) +(@ICC_TrashCitadelFinal,7,1,1,0,-@ICC_TrashGenericPurpleICC,1), -- 1 purple loot (1%) +-- final output dungeon_n +(@ICC_TrashDungeonNFinal,1,40,1,0,-@ICC_TrashGenericGrey,1), -- 1 grey loot (40%) +(@ICC_TrashDungeonNFinal,2,40,1,0,-@ICC_TrashGenericGrey,1), -- 1 grey loot (40%) +(@ICC_TrashDungeonNFinal,3,20,1,0,-@ICC_TrashGenericWhite,1), -- 1 white loot (20%) +(@ICC_TrashDungeonNFinal,4,7,1,0,-@ICC_TrashGenericScroll,1), -- 1 scroll loot (7%) +(@ICC_TrashDungeonNFinal,5,10,1,0,-@ICC_TrashGenericGreen,1), -- 1 green loot (10%) +(@ICC_TrashDungeonNFinal,6,3,1,0,-@ICC_TrashGenericBlue,1), -- 1 blue loot (3%) +(@ICC_TrashDungeonNFinal,7,1,1,0,-@ICC_TrashGenericPurpleDUNN,1), -- 1 purple loot (1%) +-- final output dungeon_h +(@ICC_TrashDungeonHFinal,1,40,1,0,-@ICC_TrashGenericGrey,1), -- 1 grey loot (40%) +(@ICC_TrashDungeonHFinal,2,40,1,0,-@ICC_TrashGenericGrey,1), -- 1 grey loot (40%) +(@ICC_TrashDungeonHFinal,3,20,1,0,-@ICC_TrashGenericWhite,1), -- 1 white loot (20%) +(@ICC_TrashDungeonHFinal,4,7,1,0,-@ICC_TrashGenericScroll,1), -- 1 scroll loot (7%) +(@ICC_TrashDungeonHFinal,5,10,1,0,-@ICC_TrashGenericGreen,1), -- 1 green loot (10%) +(@ICC_TrashDungeonHFinal,6,3,1,0,-@ICC_TrashGenericBlue,1), -- 1 blue loot (3%) +(@ICC_TrashDungeonHFinal,7,1,1,0,-@ICC_TrashGenericPurpleDUNH,1); -- 1 purple loot (1%) + +-- -------------------------------- +-- -- Apply Trash Loot Dungeon_N -- +-- -------------------------------- +SET @LootDUNGEON_N := 100000; -- needs official entry designated +UPDATE `creature_template` SET `lootid`=@LootDUNGEON_N WHERE `entry` IN (36522,36620,36516,36564,36499,36478,36666); -- FoS +UPDATE `creature_template` SET `lootid`=@LootDUNGEON_N WHERE `entry` IN (36896,36842,36830,36879,37711,36788,37712,37713); -- PoS +UPDATE `creature_template` SET `lootid`=@LootDUNGEON_N WHERE `entry` IN (38176,38177,38173,38172,38175,36723); -- HoR +DELETE FROM `creature_loot_template` WHERE `entry` IN (36522,36620,36516,36564,36499,36478,36666,36896,36842,36830,36879,37711,36788,37712,37713,38176,38177,38173,38172,38175,36723,@LootDUNGEON_N); +INSERT INTO `creature_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +(@LootDUNGEON_N,1,100,1,0,-@ICC_TrashDungeonNFinal,2); -- 2 selection from reference + +-- -------------------------------- +-- -- Apply Trash Loot Dungeon_H -- +-- -------------------------------- +SET @LootDUNGEON_H := 100001; -- needs official entry designated +UPDATE `creature_template` SET `lootid`=@LootDUNGEON_H WHERE `entry` IN (37569,37568,37567,37565,38193,37566,37563); -- FoS +UPDATE `creature_template` SET `lootid`=@LootDUNGEON_H WHERE `entry` IN (37609,37638,37637,37635,37636,38249,38025,38026); -- PoS +UPDATE `creature_template` SET `lootid`=@LootDUNGEON_H WHERE `entry` IN (37720,38524,38525,38563,38544,38564); -- HoR +DELETE FROM `creature_loot_template` WHERE `entry` IN (37569,37568,37567,37565,38193,37566,37563,37609,37638,37637,37635,37636,38249,38025,38026,37720,38524,38525,38563,38544,38564,@LootDUNGEON_H); +INSERT INTO `creature_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +(@LootDUNGEON_H,1,100,1,0,-@ICC_TrashDungeonHFinal,2); -- 2 selection from reference + +-- -------------------------- +-- -- Apply Trash Loot ICC -- +-- -------------------------- +SET @LootRAID := 100002; -- needs official entry designated +UPDATE `creature_template` SET `lootid`=@LootRAID WHERE `entry` IN(37012,37022,37571,37664,37595,37662,37665,37663,37666,37007,36811,36807,36829,36805,36808,36880,37546,37531,37229,37228,36725,37501,37502,37023,10404,38494,38490,36724,37126,37544,37545,37098,37038); +DELETE FROM `creature_loot_template` WHERE `entry` IN(37012,37022,37571,37664,37595,37662,37665,37663,37666,37007,36811,36807,36829,36805,36808,36880,37546,37531,37229,37228,36725,37501,37502,37023,10404,38494,38490,36724,37126,37544,37545,37098,37038,@LootRAID); +INSERT INTO `creature_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +(@LootRAID,1,100,1,0,-@ICC_TrashCitadelFinal,2); -- 2 selection from reference + +-- -------------------- +-- -- Special Cases: -- +-- -------------------- +-- Specialids +CALL `sp_set_npc_lootid_bylist` ('37217,37025,37230,37532,36891',NULL); +-- Loot +DELETE FROM `creature_loot_template` WHERE `entry` IN (37217,37025,37230,37532,36891); +INSERT INTO `creature_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- Precious +(37217,1,100,1,0,-@ICC_TrashCitadelFinal,2), -- 2 selection from reference +(37217,52019,30,1,0,1,1), -- Precious Ribbon +-- Stinky +(37025,1,100,1,0,-@ICC_TrashCitadelFinal,2), -- 2 selection from reference +-- Dragons (Spire Frostwyrm) +(37230,1,100,1,0,-@ICC_TrashCitadelFinal,2), -- 2 selection from reference +(37230,33631,65,1,1,2,3), -- Frosted Claw +(37230,33632,35,1,1,2,3), -- Icicle Fang +(37532,33631,65,1,1,2,3), -- Frosted Claw +(37532,33632,35,1,1,2,3), -- Icicle Fang +(36891,33631,65,1,1,2,3), -- Frosted Claw +(36891,33632,35,1,1,2,3); -- Icicle Fang diff --git a/sql/updates/world/2011_03_06_02_world_creatures.sql b/sql/updates/world/2011_03_06_02_world_creatures.sql new file mode 100644 index 0000000000000..5058a3d0921d2 --- /dev/null +++ b/sql/updates/world/2011_03_06_02_world_creatures.sql @@ -0,0 +1,64 @@ +-- Template updates +UPDATE `creature_template` SET `speed_walk`=1,`speed_run`=2 WHERE `entry`=28782; -- Acherus Deathcharger +UPDATE `creature_template` SET `speed_walk`=1.2,`speed_run`=0.71429 WHERE `entry`=33113; -- Flame Leviathan +UPDATE `creature_template` SET `baseattacktime`=1500,`unit_flags`=`unit_flags`|33554688 WHERE `entry`=36678; -- Professor Putricide +UPDATE `creature_template` SET `faction_A`=14,`faction_H`=14,`baseattacktime`=2000,`unit_flags`=`unit_flags`|33587456,`speed_run`=1.38571 WHERE `entry`=35637; -- Marshal Jacob Alerius' Mount +UPDATE `creature_template` SET `faction_A`=14,`faction_H`=14,`baseattacktime`=2000,`unit_flags`=`unit_flags`|33587456,`speed_run`=1.38571 WHERE `entry`=35633; -- Ambrose Boltspark's Mount +UPDATE `creature_template` SET `faction_A`=14,`faction_H`=14,`baseattacktime`=2000,`unit_flags`=`unit_flags`|33587456,`speed_run`=1.38571 WHERE `entry`=35768; -- Colosos' Mount +UPDATE `creature_template` SET `faction_A`=14,`faction_H`=14,`baseattacktime`=2000,`unit_flags`=`unit_flags`|33587456,`speed_run`=1.38571 WHERE `entry`=34658; -- Jaelyne Evensong's Mount +UPDATE `creature_template` SET `faction_A`=14,`faction_H`=14,`baseattacktime`=2000,`unit_flags`=`unit_flags`|33587456,`speed_run`=1.38571 WHERE `entry`=35636; -- Lana Stouthammer's Mount +UPDATE `creature_template` SET `faction_A`=14,`faction_H`=14,`baseattacktime`=2000,`unit_flags`=`unit_flags`|33587456,`speed_run`=1.38571 WHERE `entry`=35638; -- Mokra the Skullcrusher's Mount +UPDATE `creature_template` SET `faction_A`=14,`faction_H`=14,`baseattacktime`=2000,`unit_flags`=`unit_flags`|33587456,`speed_run`=1.38571,`VehicleId`=480 WHERE `entry`=35635; -- Eressea Dawnsinger's Mount +UPDATE `creature_template` SET `faction_A`=14,`faction_H`=14,`baseattacktime`=2000,`unit_flags`=`unit_flags`|33587456,`speed_run`=1.38571 WHERE `entry`=35640; -- Runok Wildmane's Mount +UPDATE `creature_template` SET `faction_A`=126,`faction_H`=126,`baseattacktime`=2000,`unit_flags`=`unit_flags`|33587456,`speed_run`=1.38571,`VehicleId`=485 WHERE `entry`=35641; -- Zul'tore's Mount +UPDATE `creature_template` SET `faction_A`=14,`faction_H`=14,`baseattacktime`=2000,`unit_flags`=`unit_flags`|33587456,`speed_run`=1.28968 WHERE `entry`=35634; -- Deathstalker Visceri's Mount + +-- Addon data +UPDATE `creature_template_addon` SET `bytes1`=0,`bytes2`=1,`mount`=0,`emote`=69,`auras`=NULL WHERE `entry`=36678; -- Professor Putricide +DELETE FROM `creature_template_addon` WHERE `entry` IN (28782,33113,35637,35633,35768,34658,35636,35638,35635,35640,35641,35634,36661); +INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(28782,0,0,1,0, NULL), -- Acherus Deathcharger +(33113,0,0,1,0, NULL), -- Flame Leviathan +(35637,0,0,1,0, '67870 0'), -- Marshal Jacob Alerius' Mount, Auras: Trample +(35633,0,0,1,0, '67870 0'), -- Ambrose Boltspark's Mount +(35768,0,0,1,0, '67870 0'), -- Colosos' Mount +(34658,0,0,1,0, '67870 0'), -- Jaelyne Evensong's Mount +(35636,0,0,1,0, '67870 0'), -- Lana Stouthammer's Mount +(35638,0,0,1,0, '67870 0'), -- Mokra the Skullcrusher's Mount +(35635,0,0,1,0, '67870 0'), -- Eressea Dawnsinger's Mount +(35640,0,0,1,0, '67870 0'), -- Runok Wildmane's Mount +(35641,0,0,1,0, '67870 0'), -- Zul'tore's Mount +(35634,0,0,1,0, '67870 0'), -- Deathstalker Visceri's Mount +(36661,0,0,1,0, NULL); -- Rimefang + +-- Spellclick +DELETE FROM `npc_spellclick_spells` WHERE `npc_entry` IN (24418,33113,36678,33214,35637,35633,35768,34658,35636,35638,35635,35640,35641,35634,33669,36476,36661) AND `spell_id`=46598; +INSERT INTO `npc_spellclick_spells` (`npc_entry`,`spell_id`,`quest_start`,`quest_start_active`,`quest_end`,`cast_flags`,`aura_required`,`aura_forbidden`,`user_type`) VALUES +(24418,46598,0,0,0,1,0,0,0), -- Acherus Deathcharger - Ride Vehicle Hardcoded +(33113,46598,0,0,0,1,0,0,0), -- Flame Leviathan - Ride Vehicle Hardcoded +(36678,46598,0,0,0,1,0,0,0), -- Professor Putricide - Ride Vehicle Hardcoded +(33214,46598,0,0,0,1,0,0,0), -- Mechanolift 304-A - Ride Vehicle Hardcoded +(35637,46598,0,0,0,1,0,0,0), -- Marshal Jacob Alerius' Mount - Ride Vehicle Hardcoded +(35633,46598,0,0,0,1,0,0,0), -- Ambrose Boltspark's Mount - Ride Vehicle Hardcoded +(35768,46598,0,0,0,1,0,0,0), -- Colosos' Mount - Ride Vehicle Hardcoded +(34658,46598,0,0,0,1,0,0,0), -- Jaelyne Evensong's Mount - Ride Vehicle Hardcoded +(35636,46598,0,0,0,1,0,0,0), -- Lana Stouthammer's Evensong's Mount - Ride Vehicle Hardcoded +(35638,46598,0,0,0,1,0,0,0), -- Mokra the Skullcrusher's Mount - Ride Vehicle Hardcoded +(35635,46598,0,0,0,1,0,0,0), -- Eressea Dawnsinger's Mount - Ride Vehicle Hardcoded +(35640,46598,0,0,0,1,0,0,0), -- Runok Wildmane's Mount - Ride Vehicle Hardcoded +(35641,46598,0,0,0,1,0,0,0), -- Zul'tore's Mount - Ride Vehicle Hardcoded +(35634,46598,0,0,0,1,0,0,0), -- Deathstalker Visceri's Mount - Ride Vehicle Hardcoded +(33669,46598,0,0,0,1,0,0,0), -- Demolisher Engineer Blastwrench - Ride Vehicle Hardcoded +(36476,46598,0,0,0,1,0,0,0), -- Ick - Ride Vehicle Hardcoded +(36661,46598,0,0,0,1,0,0,0); -- Rimefang - Ride Vehicle Hardcoded + +-- Model data +UPDATE `creature_model_info` SET `bounding_radius`=0.93,`combat_reach`=2,`gender`=2 WHERE `modelid`=28875; -- Flame Leviathan +UPDATE `creature_model_info` SET `bounding_radius`=1.209,`combat_reach`=7.8,`gender`=0 WHERE `modelid`=30881; -- Professor Putricide +UPDATE `creature_model_info` SET `bounding_radius`=0,`combat_reach`=1,`gender`=0 WHERE `modelid`=29255; -- Colosos' Mount +UPDATE `creature_model_info` SET `bounding_radius`=0.525,`combat_reach`=2.25,`gender`=0 WHERE `modelid`=9991; -- Jaelyne Evensong's Mount +UPDATE `creature_model_info` SET `bounding_radius`=0.35,`combat_reach`=2,`gender`=0 WHERE `modelid`=2787; -- Lana Stouthammer's Mount +UPDATE `creature_model_info` SET `bounding_radius`=0.35,`combat_reach`=1.5,`gender`=2 WHERE `modelid`=29879; -- Mokra the Skullcrusher's Mount +UPDATE `creature_model_info` SET `bounding_radius`=1,`combat_reach`=1,`gender`=2 WHERE `modelid`=28607; -- Eressea Dawnsinger's Mount +UPDATE `creature_model_info` SET `bounding_radius`=0.34,`combat_reach`=1.5,`gender`=2 WHERE `modelid`=29880; -- Runok Wildmane's Mount +UPDATE `creature_model_info` SET `bounding_radius`=0.35,`combat_reach`=1.5,`gender`=2 WHERE `modelid`=10718; -- Deathstalker Visceri's Mount diff --git a/sql/updates/world/2011_03_06_03_world_creatures.sql b/sql/updates/world/2011_03_06_03_world_creatures.sql new file mode 100644 index 0000000000000..4b4ac5d53fd30 --- /dev/null +++ b/sql/updates/world/2011_03_06_03_world_creatures.sql @@ -0,0 +1,24 @@ +-- Spellclick +DELETE FROM `npc_spellclick_spells` WHERE `npc_entry` IN (30021,31748,32795,32796,34045,33782,33318,33323,33322,33317,33319,33316,33321,33324,33320,33845,33844,33217); +INSERT INTO `npc_spellclick_spells` (`npc_entry`,`spell_id`,`quest_start`,`quest_start_active`,`quest_end`,`cast_flags`,`aura_required`,`aura_forbidden`,`user_type`) VALUES +(30021,46598,0,0,0,1,0,0,0), -- Enormos - Ride Vehicle Hardcoded +(30021,55785,0,0,0,3,0,0,0), -- Enormos - Mammoth Jack +(31748,56378,0,0,0,1,0,0,0), -- Hover Disk (1)- Summon Disk +(32795,56378,0,0,0,1,0,0,0), -- Antipersonnel Cannon (1) - Ride Vehicle +(32796,60683,0,0,0,1,0,0,0), -- Battleground Demolisher (1) - Ride Vehicle +(34045,65030,0,0,0,1,0,0,0), -- Salvaged Chopper (1) - Ride Vehicle +(33782,63151,0,0,0,1,0,0,0), -- Argent Warhorse +(33318,63151,0,0,0,1,0,0,0), -- Exodar Elekk +(33323,63151,0,0,0,1,0,0,0), -- Silvermoon Hawkstrider +(33322,63151,0,0,0,1,0,0,0), -- Thunder Bluff Kodo +(33317,63151,0,0,0,1,0,0,0), -- Gnomeregan Mechanostrider +(33319,63151,0,0,0,1,0,0,0), -- Darnassian Nightsaber +(33316,63151,0,0,0,1,0,0,0), -- Ironforge Ram +(33321,63151,0,0,0,1,0,0,0), -- Darkspear Raptor +(33324,63151,0,0,0,1,0,0,0), -- Forsaken Warhorse +(33320,63151,0,0,0,1,0,0,0), -- Orgrimmar Wolf +(33845,63151,0,0,0,1,0,0,0), -- Quel''dorei Steed +(33844,63151,0,0,0,1,0,0,0), -- Sunreaver Hawkstrider +(33217,63151,0,0,0,1,0,0,0); -- Stormwind Steed +-- Template update +UPDATE `creature_template` SET `faction_A`=16,`faction_H`=16,`speed_walk`=0.666668,`speed_run`=2 WHERE `entry`=30021; -- Enormos diff --git a/sql/updates/world/2011_03_06_04_world_creatures.sql b/sql/updates/world/2011_03_06_04_world_creatures.sql new file mode 100644 index 0000000000000..4144ae712f3da --- /dev/null +++ b/sql/updates/world/2011_03_06_04_world_creatures.sql @@ -0,0 +1,53 @@ +-- Spellclick +UPDATE `npc_spellclick_spells` SET `spell_id`=60682 WHERE `npc_entry`=32795 AND `spell_id`=56378; -- typo +DELETE FROM `npc_spellclick_spells` WHERE `npc_entry` IN (33778,33687,32189,30330,29625,29433,29555,28614,35644,36558,27692,27756,27755); +INSERT INTO `npc_spellclick_spells` (`npc_entry`,`spell_id`,`quest_start`,`quest_start_active`,`quest_end`,`cast_flags`,`aura_required`,`aura_forbidden`,`user_type`) VALUES +(33778,43671,0,0,0,1,0,0,0), -- Tournament Hippogryph - Ride Vehicle +(33687,46598,0,0,0,1,0,0,0), -- Chillmaw - Ride Vehicle Hardcoded +(32189,46598,0,0,0,1,0,0,0), -- Skybreaker Recon Fighter - Ride Vehicle Hardcoded +(30330,46598,0,0,0,1,0,0,0), -- Jotunheim Proto-Drake - Ride Vehicle Hardcoded +(29625,46598,0,0,0,1,0,0,0), -- Hyldsmeet Proto-Drake - Ride Vehicle Hardcoded +(29433,47020,0,0,0,1,0,0,0), -- Goblin Sapper - Ride Vehicle +(29555,47020,0,0,0,1,0,0,0), -- Goblin Sapper - Ride Vehicle +(28614,46598,0,0,0,1,0,0,0), -- Scarlet Gryphon - Ride Vehicle Hardcoded +(35644,67830,0,0,0,1,0,0,0), -- Argent Warhorse - Ride Vehicle (guessed) +(36558,67830,0,0,0,1,0,0,0), -- Argent Battleworg - Ride Vehicle +(27692,49427,0,0,0,2,0,0,0), -- Emerald Drake +(27756,49463,0,0,0,2,0,0,0), -- Ruby Drake +(27755,49459,0,0,0,2,0,0,0); -- Amber Drake + +-- Template updates +UPDATE `creature_template` SET `speed_walk`=2,`speed_run`=1.5873 WHERE `entry`=33687; -- Chillmaw +UPDATE `creature_template` SET `speed_walk`=8 WHERE `entry`=32189; -- Skybreaker Recon Fighter +UPDATE `creature_template` SET `speed_walk`=6 WHERE `entry`=30330; -- Jotunheim Proto-Drake +UPDATE `creature_template` SET `speed_walk`=6,`speed_run`=3.14286 WHERE `entry`=29625; -- Hyldsmeet Proto-Drake +UPDATE `creature_template` SET `equipment_id`=57 WHERE `entry`=29555; -- Goblin Sapper +UPDATE `creature_template` SET `speed_walk`=1,`speed_run`=3.14286 WHERE `entry`=28614; -- Scarlet Gryphon +UPDATE `creature_template` SET `faction_A`=14,`faction_H`=14,`baseattacktime`=2000,`npcflag`=`npcflag`|16777216,`unit_flags`=`unit_flags`|256,`speed_run`=1.57143 WHERE `entry`=35644; -- Argent Warhorse +UPDATE `creature_template` SET `baseattacktime`=2000,`npcflag`=`npcflag`|16777216,`speed_run`=1.57143 WHERE `entry`=36558; -- Argent Battleworg + +-- Model info +UPDATE `creature_model_info` SET `bounding_radius`=0.2448,`combat_reach`=1.2,`gender`=1 WHERE `modelid`=28096; -- Goblin Sapper + +-- Addon data +DELETE FROM `creature_template_addon` WHERE `entry` IN (33687,32189,30330,29625,29433,29555,28614,35644,36558,27692,27756,27755); +INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(33687,0,50331648,1,0, NULL), -- Chillmaw +(32189,0,50397184,1,0, '60464 0 60464 1'), -- Skybreaker Recon Fighter, auras: Cloaked Alliance Peeps +(30330,0,0,1,0, NULL), -- Jotunheim Proto-Drake +(29625,0,50331648,1,0, NULL), -- Hyldsmeet Proto-Drake +(29433,0,0,1,0, NULL), -- Goblin Sapper +(29555,0,0,1,0, NULL), -- Goblin Sapper +(28614,0,0,1,0, '48356 0 48356 1'), -- Scarlet Gryphon, auras: See Wintergarde Invisibility +(35644,0,0,1,0, '67870 0'), -- Argent Warhorse, auras: Trample +(36558,0,0,257,0, '67865 0'), -- Argent Battleworg, auras: Trample +(27692,0,50331648,257,0, NULL), -- Emerald Drake +(27756,0,50331648,257,0, NULL), -- Ruby Drake +(27755,0,50331648,257,0, NULL); -- Amber Drake + +-- Conditions for spell_aura_control_vehicle +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry` IN (49346,49464,49460); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`Comment`) VALUES +(13,0,49346,0,18,1,27692,0, 'Emeral Drake'), +(13,0,49464,0,18,1,27756,0, 'Ruby Drake'), +(13,0,49460,0,18,1,27755,0, 'Amber Drake'); diff --git a/sql/updates/world/2011_03_06_05_world_vehicle_accessory.sql b/sql/updates/world/2011_03_06_05_world_vehicle_accessory.sql new file mode 100644 index 0000000000000..5e896d98412c5 --- /dev/null +++ b/sql/updates/world/2011_03_06_05_world_vehicle_accessory.sql @@ -0,0 +1,12 @@ +RENAME TABLE `vehicle_accessory` TO `vehicle_template_accessory`; + +CREATE TABLE IF NOT EXISTS `vehicle_accessory` ( + `guid` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0, + `accessory_entry` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT 0, + `seat_id` TINYINT(1) NOT NULL DEFAULT 0, + `minion` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, + `description` TEXT NOT NULL, + `summontype` TINYINT(3) UNSIGNED NOT NULL DEFAULT 6 COMMENT 'see enum TempSummonType', + `summontimer` INT(10) UNSIGNED NOT NULL DEFAULT 30000 COMMENT 'timer, only relevant for certain summontypes', + PRIMARY KEY (`guid`,`seat_id`) +) ENGINE=MYISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED; diff --git a/sql/updates/world/2011_03_07_00_world_misc.sql b/sql/updates/world/2011_03_07_00_world_misc.sql new file mode 100644 index 0000000000000..6e7b679a2775d --- /dev/null +++ b/sql/updates/world/2011_03_07_00_world_misc.sql @@ -0,0 +1,4 @@ +UPDATE `creature_template_addon` SET `auras`=NULL WHERE `entry` IN (36558,35644); -- Argent mounts inside ToC5 shouldn't have any aura (for now) +DELETE FROM `npc_spellclick_spells` WHERE `npc_entry`=36477; -- Krick isn't a vehicle +DELETE FROM `achievement_reward` WHERE `entry` IN (4784,4785); -- Revert Emblematic achiev rewards +UPDATE `creature_template` SET `faction_A`=35,`faction_H`=35 WHERE `entry`=35644; -- Argent Warhorse (faction depends on the players faction that starts ToC5 fight) diff --git a/sql/updates/world/2011_03_07_01_world_spell_proc_event.sql b/sql/updates/world/2011_03_07_01_world_spell_proc_event.sql new file mode 100644 index 0000000000000..7b49e63d4e8d1 --- /dev/null +++ b/sql/updates/world/2011_03_07_01_world_spell_proc_event.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_proc_event` WHERE `entry`=55681; +INSERT INTO `spell_proc_event` (`entry`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `procFlags`, `procEx`, `ppmRate`, `CustomChance`, `Cooldown`) VALUES +(55681,0x00,6,0x00008000,0x00000000,0x00000000,0x00000000,0x00000000,0,0,0); -- Glyph of Shadow Word: Pain diff --git a/sql/updates/world/2011_03_07_02_world_achievement.sql b/sql/updates/world/2011_03_07_02_world_achievement.sql new file mode 100644 index 0000000000000..3c3f1eb0f2be2 --- /dev/null +++ b/sql/updates/world/2011_03_07_02_world_achievement.sql @@ -0,0 +1,4 @@ +DELETE FROM `disables` WHERE `entry`=7622 AND `sourceType`=4; +DELETE FROM `achievement_criteria_data` WHERE `criteria_id`=7622; +INSERT INTO `achievement_criteria_data` (`criteria_id`,`type`,`value1`,`value2`,`ScriptName`) VALUES +(7622,0,0,0, ''); diff --git a/sql/updates/world/2011_03_07_03_world_creature_template.sql b/sql/updates/world/2011_03_07_03_world_creature_template.sql new file mode 100644 index 0000000000000..ecdb7fbb614c7 --- /dev/null +++ b/sql/updates/world/2011_03_07_03_world_creature_template.sql @@ -0,0 +1,4 @@ +UPDATE `creature_template_addon` SET `auras`=NULL WHERE `entry` IN (35637,35633,35768,34658,35636,35638,35635,35640,35641,35634); -- Vehicles inside ToC +UPDATE `creature_template` SET `ScriptName`='' WHERE `entry` IN ( +33870,33790,33791,33792,33793,33794,33795,33796,33798,33799,33800,33842,33843, -- AT stabled npcs +33782,33318,33323,33322,33317,33319,33316,33321,33324,33320,33845,33844,33217); -- AT vehicles (mounts) diff --git a/sql/updates/world/2011_03_07_04_world_command.sql b/sql/updates/world/2011_03_07_04_world_command.sql new file mode 100644 index 0000000000000..4e4ed52910722 --- /dev/null +++ b/sql/updates/world/2011_03_07_04_world_command.sql @@ -0,0 +1,4 @@ +DELETE FROM `command` WHERE `name` IN('reload vehicle_accessory','reload vehicle_template_accessory'); +INSERT INTO `command` (`name`,`security`,`help`) VALUES +('reload vehicle_accessory', 3, 'Syntax: .reload vehicle_accessory\n\nReloads GUID-based vehicle accessory definitions from the database.'), +('reload vehicle_template_accessory', 3, 'Syntax: .reload vehicle_template_accessory\n\nReloads entry-based vehicle accessory definitions from the database.'); diff --git a/sql/updates/world/2011_03_07_05_world_creatures.sql b/sql/updates/world/2011_03_07_05_world_creatures.sql new file mode 100644 index 0000000000000..4497f45e1fc85 --- /dev/null +++ b/sql/updates/world/2011_03_07_05_world_creatures.sql @@ -0,0 +1,40 @@ +SET @ENTRY := 28297; +SET @NPC := 151894; +SET @PATH := @NPC * 10; +-- Template update +UPDATE `creature_template` SET `unit_flags`=`unit_flags`|32768,`speed_run`=1.38571 WHERE `entry`=@ENTRY; -- Shango +-- Spawn +DELETE FROM `creature` WHERE `id`=@ENTRY; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`DeathState`,`MovementType`) VALUES +(@NPC,@ENTRY,571,1,1,0,0,6203.80664,5528.569,-51.8230972,2.62550282,120,0,0,1,0,0,2); +-- Addon data +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES +(@NPC,@PATH,1,0, NULL); -- Shango +DELETE FROM `creature_template_addon` WHERE `entry`=@ENTRY; +INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(@ENTRY,0,0,1,0, NULL); -- Shango +-- Pathing for Shango +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,6213.67,5522.98,-51.8231,0,0,0,100,0), +(@PATH,2,6221.91,5519.84,-50.9481,0,0,0,100,0), +(@PATH,3,6228.36,5517.6,-49.2341,0,0,0,100,0), +(@PATH,4,6237.21,5503.82,-44.4988,0,0,0,100,0), +(@PATH,5,6247.96,5494.78,-44.9726,0,0,0,100,0), +(@PATH,6,6260.08,5484.58,-45.4597,0,0,0,100,0), +(@PATH,7,6274.67,5480.42,-45.1359,0,0,0,100,0), +(@PATH,8,6288.82,5476,-46.3803,0,0,0,100,0), +(@PATH,9,6305.17,5470.43,-44.6878,0,0,0,100,0), +(@PATH,10,6311.82,5459.03,-48.2749,0,0,0,100,0), +(@PATH,11,6310.37,5444.21,-52.0538,0,0,0,100,0), +(@PATH,12,6294.56,5445.27,-54.3711,0,0,0,100,0), +(@PATH,13,6277.3,5459.18,-51.4723,0,0,0,100,0), +(@PATH,14,6260.51,5469.62,-51.1171,0,0,0,100,0), +(@PATH,15,6248.49,5480.35,-50.1687,0,0,0,100,0), +(@PATH,16,6235.66,5488.57,-51.2285,0,0,0,100,0), +(@PATH,17,6220.07,5498.48,-58.4601,0,0,0,100,0), +(@PATH,18,6211.14,5508.38,-58.7072,0,0,0,100,0), +(@PATH,19,6203.5,5519.82,-56.4056,0,0,0,100,0), +(@PATH,20,6204.61,5524.55,-53.8457,0,0,0,100,0), +(@PATH,21,6207.23,5525.67,-52.505,0,0,0,100,0); diff --git a/sql/updates/world/2011_03_07_06_world_spell_script_names.sql b/sql/updates/world/2011_03_07_06_world_spell_script_names.sql new file mode 100644 index 0000000000000..fa9ffbbfc9aa2 --- /dev/null +++ b/sql/updates/world/2011_03_07_06_world_spell_script_names.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_item_map_of_the_geyser_fields'; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(45853, 'spell_item_map_of_the_geyser_fields'); diff --git a/sql/updates/world/2011_03_08_00_world_sai.sql b/sql/updates/world/2011_03_08_00_world_sai.sql new file mode 100644 index 0000000000000..0bb809d42b265 --- /dev/null +++ b/sql/updates/world/2011_03_08_00_world_sai.sql @@ -0,0 +1,20 @@ +-- Fix for quests: +-- From Sniff: +SET @guid := 78; -- Set by TDB +DELETE FROM `creature` WHERE `id` IN (25664,25665,25666); +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`DeathState`,`MovementType`) VALUES +(@guid ,25664,571,1,1,0,0,3487.67456,4516.643,11.441596,2.18166161,120,0,0,1,0,0,0), -- South Killcredit +(@guid+1,25665,571,1,1,0,0,3645.95483,4551.105,12.4051342,0.715585,120,0,0,1,0,0,0), -- Northeast Killcredit +(@guid+2,25666,571,1,1,0,0,3649.16748,4744.338,12.3212109,0.8901179,120,0,0,1,0,0,0); -- Northwest Killcredit +-- template updates (if needed) +UPDATE `creature_template` SET `baseattacktime`=2000,`faction_A`=35,`faction_H`=35,`minlevel`=70,`maxlevel`=70,`scale`=1,`speed_run`=1.142857,`speed_walk`=1,`unit_flags`=`unit_flags`|512|33554432 WHERE `entry`=25664; +UPDATE `creature_template` SET `baseattacktime`=2000,`faction_A`=35,`faction_H`=35,`minlevel`=70,`maxlevel`=70,`scale`=1,`speed_run`=1.142857,`speed_walk`=1,`unit_flags`=`unit_flags`|512|33554432 WHERE `entry`=25665; +UPDATE `creature_template` SET `baseattacktime`=2000,`faction_A`=35,`faction_H`=35,`minlevel`=70,`maxlevel`=70,`scale`=1,`speed_run`=1.142857,`speed_walk`=1,`unit_flags`=`unit_flags`|512|33554432 WHERE `entry`=25666; + +-- SAI for the Killcredits: +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` IN (25664,25665,25666); +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (25664,25665,25666); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(25664,0,0,0,8,0,100,0,45853,1,0,0,33,25664,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Mark Sinkhole Killcredit: South'), +(25665,0,0,0,8,0,100,0,45853,1,0,0,33,25665,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Mark Sinkhole Killcredit: NorthEast'), +(25666,0,0,0,8,0,100,0,45853,1,0,0,33,25666,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Mark Sinkhole Killcredit: NorthWest'); diff --git a/sql/updates/world/2011_03_09_00_world_creature_addon.sql b/sql/updates/world/2011_03_09_00_world_creature_addon.sql new file mode 100644 index 0000000000000..e3ca476d684d4 --- /dev/null +++ b/sql/updates/world/2011_03_09_00_world_creature_addon.sql @@ -0,0 +1 @@ +DELETE FROM `creature_addon` WHERE `guid` IN (101966,102039); diff --git a/sql/updates/world/2011_03_09_01_world_misc.sql b/sql/updates/world/2011_03_09_01_world_misc.sql new file mode 100644 index 0000000000000..5570aa97a322d --- /dev/null +++ b/sql/updates/world/2011_03_09_01_world_misc.sql @@ -0,0 +1,74 @@ +-- SrcItemCount is not a WDB field (0/1). +UPDATE `quest_template` SET `SrcItemCount` = 1 WHERE `SrcItemId` != 0 AND `SrcItemCount` = 0; + +-- Missing items +DELETE FROM `item_template` WHERE `entry` IN (52274,52275,52276,52344,52562,52563,52565,52706,52707,52729,52835,53048,54516) AND `WDBVerified` < 0; +INSERT INTO `item_template` (`entry`,`class`,`subclass`,`unk0`,`name`,`displayid`,`Quality`,`Flags`,`FlagsExtra`,`BuyCount`,`BuyPrice`,`SellPrice`,`InventoryType`,`AllowableClass`,`AllowableRace`,`ItemLevel`,`RequiredLevel`,`RequiredSkill`,`RequiredSkillRank`,`requiredspell`,`requiredhonorrank`,`RequiredCityRank`,`RequiredReputationFaction`,`RequiredReputationRank`,`maxcount`,`stackable`,`ContainerSlots`,`StatsCount`,`stat_type1`,`stat_value1`,`stat_type2`,`stat_value2`,`stat_type3`,`stat_value3`,`stat_type4`,`stat_value4`,`stat_type5`,`stat_value5`,`stat_type6`,`stat_value6`,`stat_type7`,`stat_value7`,`stat_type8`,`stat_value8`,`stat_type9`,`stat_value9`,`stat_type10`,`stat_value10`,`ScalingStatDistribution`,`ScalingStatValue`,`dmg_min1`,`dmg_max1`,`dmg_type1`,`dmg_min2`,`dmg_max2`,`dmg_type2`,`armor`,`holy_res`,`fire_res`,`nature_res`,`frost_res`,`shadow_res`,`arcane_res`,`delay`,`ammo_type`,`RangedModRange`,`spellid_1`,`spelltrigger_1`,`spellcharges_1`,`spellppmRate_1`,`spellcooldown_1`,`spellcategory_1`,`spellcategorycooldown_1`,`spellid_2`,`spelltrigger_2`,`spellcharges_2`,`spellppmRate_2`,`spellcooldown_2`,`spellcategory_2`,`spellcategorycooldown_2`,`spellid_3`,`spelltrigger_3`,`spellcharges_3`,`spellppmRate_3`,`spellcooldown_3`,`spellcategory_3`,`spellcategorycooldown_3`,`spellid_4`,`spelltrigger_4`,`spellcharges_4`,`spellppmRate_4`,`spellcooldown_4`,`spellcategory_4`,`spellcategorycooldown_4`,`spellid_5`,`spelltrigger_5`,`spellcharges_5`,`spellppmRate_5`,`spellcooldown_5`,`spellcategory_5`,`spellcategorycooldown_5`,`bonding`,`description`,`PageText`,`LanguageID`,`PageMaterial`,`startquest`,`lockid`,`Material`,`sheath`,`RandomProperty`,`RandomSuffix`,`block`,`itemset`,`MaxDurability`,`area`,`Map`,`BagFamily`,`TotemCategory`,`socketColor_1`,`socketContent_1`,`socketColor_2`,`socketContent_2`,`socketColor_3`,`socketContent_3`,`socketBonus`,`GemProperties`,`RequiredDisenchantSkill`,`ArmorDamageModifier`,`Duration`,`ItemLimitCategory`,`HolidayId`,`ScriptName`,`DisenchantID`,`FoodType`,`minMoneyLoot`,`maxMoneyLoot`,`WDBVerified`) VALUES +(52274,15,0,-1,'Earthen Ring Supplies',21202,1,4,0,1,0,0,0,-1,-1,1,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,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,1,'',0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,0,'',0,0,0,0,-12340), +(52275,12,0,-1,'Tablets of the Earth',11185,1,198656,0,1,0,0,0,-1,-1,1,1,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,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,4,'',0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,0,'',0,0,0,0,-12340), +(52276,12,0,-1,'Tablets of Fire',11185,1,133120,0,1,0,0,0,-1,-1,1,1,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,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,4,'',0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,0,'',0,0,0,0,-12340), +(52344,15,0,-1,'Earthen Ring Supplies',21202,1,4,0,1,0,0,0,-1,-1,1,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,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,1,'',0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,0,'',0,0,0,0,-12340), +(52562,12,0,-1,'Elemental Fire for the Soul',34752,1,131072,0,1,0,0,0,-1,-1,1,1,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,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,4,'',3611,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,0,'',0,0,0,0,-12340), +(52563,12,0,-1,'What Does ''The End of All Things'' Mean for Me?',34751,1,196608,0,1,0,0,0,-1,-1,1,1,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,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,4,'',3612,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,0,'',0,0,0,0,-12340), +(52565,12,0,-1,'Finding Security and Comfort in a Doomed World',45202,1,131072,0,1,0,0,0,-1,-1,1,1,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,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,4,'',3613,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,0,'',0,0,0,0,-12340), +(52706,12,0,-1,'Warning Poster',65893,1,64,0,1,0,0,0,-1,-1,1,1,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,74033,0,0,0,1500,0,-1,0,5,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,4,'',0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,0,'',0,0,0,0,-12340), +(52707,12,0,-1,'Warning Poster',65893,1,64,0,1,0,0,0,-1,-1,1,1,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,74098,0,0,0,1500,0,-1,0,5,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,4,'',0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,0,'',0,0,0,0,-12340), +(52729,4,1,-1,'Recruit''s Robe',65920,1,0,0,1,0,0,20,-1,-1,1,1,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,74267,1,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,1,'',0,0,0,0,0,4,0,0,0,0,0,55,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,0,'',0,0,0,0,-12340), +(52835,12,0,-1,'Elemental Devices',23712,1,0,0,1,0,0,0,-1,-1,1,1,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,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,4,'Small, portable devices housing powerful elementals.',0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,0,'',0,0,0,0,-12340), +(53048,4,0,-1,'Doomsday Message',34752,1,0,0,1,0,0,16,-1,-1,1,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,74491,0,0,0,1500,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,4,'',0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,0,'',0,0,0,0,-12340), +(54516,15,0,-1,'Loot-Filled Pumpkin',67153,3,4,0,1,0,0,0,-1,-1,80,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,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,0,0,0,0,-1,0,-1,1,'',0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,0,'',0,0,0,0,-12340); + +-- Spells placeholders +DELETE FROM `spell_dbc` WHERE `Id` IN (38758,38788,46251,45140,45144,45148); +INSERT INTO `spell_dbc` (`Id`,`Comment`) VALUES +(38758, '[PH] Quest reward: Exorcising the Trees'), +(38788, '[PH] Quest reward: Spirit Calling'), +(46251, '[PH] Quest reward: Blood for Blood'), +(45140, '[PH] Quest reward: Making Ready / Don''t Stop Now....'), +(45144, '[PH] Quest reward: Disrupt the Greengill Coast'), +(45148, '[PH] Quest reward: Ata''mal Armaments'); + +DELETE FROM `disables` WHERE `sourceType`=1 AND `entry`=10850; -- Exorcising the Trees +DELETE FROM `disables` WHERE `sourceType`=1 AND `entry`=10853; -- Spirit Calling +DELETE FROM `disables` WHERE `sourceType`=1 AND `entry`=11466; -- Jack Likes His Drink +DELETE FROM `disables` WHERE `sourceType`=1 AND `entry`=11515; -- Blood for Blood +DELETE FROM `disables` WHERE `sourceType`=1 AND `entry`=11535; -- Making Ready (available before phase 3b in Isle of Quel'danas) +DELETE FROM `disables` WHERE `sourceType`=1 AND `entry`=11536; -- Don't Stop Now.... (available after phase 3b in Isle of Quel'danas) +DELETE FROM `disables` WHERE `sourceType`=1 AND `entry`=11541; -- Disrupt the Greengill Coast (available after phase 4 in Isle of Quel'danas) +DELETE FROM `disables` WHERE `sourceType`=1 AND `entry`=11544; -- Ata'mal Armaments (available after phase 3b in Isle of Quel'danas) +DELETE FROM `disables` WHERE `sourceType`=1 AND `entry`=12616; -- Chamber of Secrets (world event: Scourge Invasion) +DELETE FROM `disables` WHERE `sourceType`=1 AND `entry`=12734; -- Rejek: First Blood +DELETE FROM `disables` WHERE `sourceType`=1 AND `entry`=24869; -- Deprogramming (ICC) +DELETE FROM `disables` WHERE `sourceType`=1 AND `entry`=24879; -- Blood Quickening (ICC) +DELETE FROM `disables` WHERE `sourceType`=1 AND `entry`=24916; -- Jaina's Locket (ICC) +DELETE FROM `disables` WHERE `sourceType`=1 AND `entry`=24918; -- Sylvanas' Vengeance (ICC) +DELETE FROM `disables` WHERE `sourceType`=1 AND `entry`=24919; -- The Lightbringer's Redemption (ICC) +DELETE FROM `disables` WHERE `sourceType`=1 AND `entry`=25055; -- Subduing the Elements (world event: Elemental Unrest) +DELETE FROM `disables` WHERE `sourceType`=1 AND `entry`=25092; -- Subduing the Elements (world event: Elemental Unrest) +DELETE FROM `disables` WHERE `sourceType`=1 AND `entry`=25180; -- Tablets of the Earth (world event: Elemental Unrest) +DELETE FROM `disables` WHERE `sourceType`=1 AND `entry`=25181; -- Tablets of Fire (world event: Elemental Unrest) +DELETE FROM `disables` WHERE `sourceType`=1 AND `entry`=25228; -- Prophecies Of Doom (world event: Elemental Unrest) +DELETE FROM `disables` WHERE `sourceType`=1 AND `entry`=25253; -- Prophecies Of Doom (world event: Elemental Unrest) +DELETE FROM `disables` WHERE `sourceType`=1 AND `entry`=25254; -- Signs Of The Times (world event: Elemental Unrest) +DELETE FROM `disables` WHERE `sourceType`=1 AND `entry`=25282; -- Signs Of The Times (world event: Elemental Unrest) +DELETE FROM `disables` WHERE `sourceType`=1 AND `entry`=25347; -- The Doomsday Plan (world event: Elemental Unrest) +DELETE FROM `disables` WHERE `sourceType`=1 AND `entry`=25351; -- Alert Our Leaders (world event: Elemental Unrest) +DELETE FROM `disables` WHERE `sourceType`=1 AND `entry`=25380; -- Spreading The Word (world event: Elemental Unrest) +DELETE FROM `disables` WHERE `sourceType`=1 AND `entry`=25415; -- Spreading The Word (world event: Elemental Unrest) +DELETE FROM `disables` WHERE `sourceType`=1 AND `entry`=25417; -- The Doomsday Plan (world event: Elemental Unrest) +DELETE FROM `disables` WHERE `sourceType`=1 AND `entry`=25425; -- Warn King Wrynn (world event: Elemental Unrest) +DELETE FROM `disables` WHERE `sourceType`=1 AND `entry`=25212; -- Vent Horizon (world event: Operation: Gnomeregan) +DELETE FROM `disables` WHERE `sourceType`=1 AND `entry`=25229; -- A Few Good Gnomes (world event: Operation: Gnomeregan) +DELETE FROM `disables` WHERE `sourceType`=1 AND `entry`=25283; -- Prepping the Speech (world event: Operation: Gnomeregan) +DELETE FROM `disables` WHERE `sourceType`=1 AND `entry`=25286; -- Words for Delivery (world event: Operation: Gnomeregan) +DELETE FROM `disables` WHERE `sourceType`=1 AND `entry`=25287; -- Words for Delivery (world event: Operation: Gnomeregan) +DELETE FROM `disables` WHERE `sourceType`=1 AND `entry`=25393; -- Operation: Gnomeregan (world event: Operation: Gnomeregan) +DELETE FROM `disables` WHERE `sourceType`=1 AND `entry`=25500; -- Words for Delivery (world event: Operation: Gnomeregan) +DELETE FROM `disables` WHERE `sourceType`=1 AND `entry`=25444; -- Da Perfect Spies (world event: Zalazane's Fall) +DELETE FROM `disables` WHERE `sourceType`=1 AND `entry`=25445; -- Zalazane's Fall (world event: Zalazane's Fall) +DELETE FROM `disables` WHERE `sourceType`=1 AND `entry`=25446; -- Frogs Away! (world event: Zalazane's Fall) +DELETE FROM `disables` WHERE `sourceType`=1 AND `entry`=25461; -- Trollin' For Volunteers (world event: Zalazane's Fall) +DELETE FROM `disables` WHERE `sourceType`=1 AND `entry`=25480; -- Dance Of De Spirits (world event: Zalazane's Fall) +DELETE FROM `disables` WHERE `sourceType`=1 AND `entry`=25482; -- World Event Dungeon - Headless Horseman +DELETE FROM `disables` WHERE `sourceType`=1 AND `entry`=25483; -- World Event Dungeon - Coren Direbrew +-- DELETE FROM `disables` WHERE `sourceType`=1 AND `entry`=25485; -- World Event Dungeon - Hummel (missing item) diff --git a/sql/updates/world/2011_03_09_02_world_page_text.sql b/sql/updates/world/2011_03_09_02_world_page_text.sql new file mode 100644 index 0000000000000..00c9e0dab1cce --- /dev/null +++ b/sql/updates/world/2011_03_09_02_world_page_text.sql @@ -0,0 +1,11 @@ +DELETE FROM `page_text` WHERE `entry` IN (3611,3612,3613,3280,3281,3282) AND `WDBVerified`=1; +DELETE FROM `page_text` WHERE `entry`=9999; +INSERT INTO `page_text` (`entry`, `text`, `next_page`,`WDBVerified`) VALUES +(3611, 'When the flames consume Azeroth, where will you be?\r\n\r\nWe know that no one wants to dwell on their impending doom, but it''s worth thinking about where you''ll be spending the hereafter.\r\n\r\nOur sages have predicted that the end of the world is nigh, and only the prepared will survive. We can help you survive the raging inferno that will cleanse this world of the wicked. Isn''t it time you found some peace of mind?', 0,1), +(3612, 'You''ve no doubt heard the phrase "all good things must come to an end" and so it is with your life on Azeroth. It won''t be long before the world erupts into chaos as the elements reclaim their birthright.\r\n\r\nBut you don''t have to be afraid during these harrowing times. You don''t have to die. We can help you ascend to a new way of life, beyond death, beyond fear, and beyond the powerlessness of mortality. Join us today.', 0,1), +(3613, 'We live in tumultuous times. War, invasion, and famine have swept the world, but the real trial is yet to come: the end of Azeroth itself.\r\n\r\nHow will you cope with the loss and destruction of everything you hold dear? The answer is that you don''t have to. Bring your friends and family to one of our gatherings and learn how you can survive the apocalypse together, with us.', 0,1), +(3280, 'Long ago, when the North Wind ruled these peaks alone, a powerful Taunka Chieftain''s brother coveted these lands for himself.', 0,1), +(3281, 'The Chieftain''s brother, Stormhoof gathered all his strength and set out to conquer the Storm Peaks from its rightful ruler, the North Wind.', 0,1), +(3282, 'Stormhoof ambushed the North Wind in the heart of it''s domain, and nearly succeeded in his plot. But the North Wind survived Stormhoof''s treachery and executed the Taunka as punishment for his invasion.', 0,1); + +UPDATE `page_text` SET `text`='Missing WDB data.',`WDBVerified`=1 WHERE `entry` IN (3487,3469,3454,3403,3346,3079,3562,2822); diff --git a/sql/updates/world/2011_03_09_03_world_misc.sql b/sql/updates/world/2011_03_09_03_world_misc.sql new file mode 100644 index 0000000000000..0ce9593d779df --- /dev/null +++ b/sql/updates/world/2011_03_09_03_world_misc.sql @@ -0,0 +1,8 @@ +DELETE FROM `spell_dbc` WHERE `Id` IN (38758,38665); +INSERT INTO `spell_dbc` (`Id`,`Comment`) VALUES +(38758, '[PH] Quest reward: Nether Gas In a Fel Fire Engine'), +(38665, '[PH] Quest reward: Exorcising the Trees'); + +DELETE FROM `disables` WHERE `sourceType`=1 AND `entry` IN ( +10830, -- Exorcising the Trees +10850); -- Nether Gas In a Fel Fire Engine diff --git a/sql/updates/world/2011_03_10_00_world_creatures.sql b/sql/updates/world/2011_03_10_00_world_creatures.sql new file mode 100644 index 0000000000000..d68a13999bf60 --- /dev/null +++ b/sql/updates/world/2011_03_10_00_world_creatures.sql @@ -0,0 +1,10 @@ +UPDATE `creature_template` SET `flags_extra`=((`flags_extra`|128)&~2) WHERE `entry` IN (38153,26043,37181,37702,37183,36848,37547,37519,37215,38463,38319,38879); -- Various triggers in ICC + +-- Delete gunship spawns +DELETE FROM `creature` WHERE `id` IN (37547,37519,37215,36971,37227,36961,36969,36950,37116,36978,37540,37488); + +DELETE FROM `creature_template_addon` WHERE `entry`=38463; +INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(38463,0,0,1,0, '72100 0'); -- Empowering Orb Visual Stalker + +UPDATE `gameobject_template` SET `faction`=35, `flags`=16 WHERE `entry`=201741; -- Empowering Blood Orb diff --git a/sql/updates/world/2011_03_10_01_world_pool_quest.sql b/sql/updates/world/2011_03_10_01_world_pool_quest.sql new file mode 100644 index 0000000000000..34ebc7a9eab90 --- /dev/null +++ b/sql/updates/world/2011_03_10_01_world_pool_quest.sql @@ -0,0 +1,45 @@ +-- ICC Quest pools +SET @pool := 5679; +DELETE FROM `pool_quest` WHERE `pool_entry` BETWEEN @pool AND @pool+11; +DELETE FROM `pool_template` WHERE `entry` BETWEEN @pool AND @pool+11; +DELETE FROM `pool_pool` WHERE `mother_pool` IN (@pool,@pool+1); + +INSERT INTO `pool_quest` (`entry`,`pool_entry`,`description`) VALUES +(24874,@pool+02, 'Blood Quickening (10)'), +(24869,@pool+03, 'Deprogramming (10)'), +(24873,@pool+04, 'Residue Rendezvous (10)'), +(24872,@pool+05, 'Respite for a Tormented Soul (10)'), +(24870,@pool+06, 'Securing the Ramparts HORDE (10)'), +(24871,@pool+06, 'Securing the Ramparts ALLY (10)'), +(24879,@pool+07, 'Blood Quickening (25)'), +(24875,@pool+08, 'Deprogramming (25)'), +(24878,@pool+09, 'Residue Rendezvous (25)'), +(24880,@pool+10, 'Respite for a Tormented Soul (25)'), +(24876,@pool+11, 'Securing the Ramparts ALLY (25)'), +(24877,@pool+11, 'Securing the Ramparts HORDE (25)'); + +INSERT INTO `pool_template` (`entry`,`max_limit`,`description`) VALUES +(@pool+00,1, 'General ICC 10man pool'), +(@pool+01,1, 'General ICC 25man pool'), +(@pool+02,1, 'Blood Quickening (10)'), +(@pool+03,1, 'Deprogramming (10)'), +(@pool+04,1, 'Residue Rendezvous (10)'), +(@pool+05,1, 'Respite for a Tormented Soul (10)'), +(@pool+06,2, 'Securing the Ramparts (10)'), +(@pool+07,1, 'Blood Quickening (25)'), +(@pool+08,1, 'Deprogramming (25)'), +(@pool+09,1, 'Residue Rendezvous (25)'), +(@pool+10,1, 'Respite for a Tormented Soul (25)'), +(@pool+11,2, 'Securing the Ramparts (25)'); + +INSERT INTO `pool_pool` (`pool_id`,`mother_pool`,`chance`,`description`) VALUES +(@pool+02,@pool+00,0, 'Blood Quickening (10)'), +(@pool+03,@pool+00,0, 'Deprogramming (10)'), +(@pool+04,@pool+00,0, 'Residue Rendezvous (10)'), +(@pool+05,@pool+00,0, 'Respite for a Tormented Soul (10)'), +(@pool+06,@pool+00,0, 'Securing the Ramparts (10)'), +(@pool+07,@pool+01,0, 'Blood Quickening (25)'), +(@pool+08,@pool+01,0, 'Deprogramming (25)'), +(@pool+09,@pool+01,0, 'Residue Rendezvous (25)'), +(@pool+10,@pool+01,0, 'Respite for a Tormented Soul (25)'), +(@pool+11,@pool+01,0, 'Securing the Ramparts (25)'); diff --git a/sql/updates/world/2011_03_10_02_world_creature_template.sql b/sql/updates/world/2011_03_10_02_world_creature_template.sql new file mode 100644 index 0000000000000..6e509bfd3a2b0 --- /dev/null +++ b/sql/updates/world/2011_03_10_02_world_creature_template.sql @@ -0,0 +1,2 @@ +-- Overide AI +UPDATE `creature_template` SET `AIName`='AggressorAI' WHERE `entry`=27131; diff --git a/sql/updates/world/2011_03_10_03_world_creature_loot_template.sql b/sql/updates/world/2011_03_10_03_world_creature_loot_template.sql new file mode 100644 index 0000000000000..73aeb53038082 --- /dev/null +++ b/sql/updates/world/2011_03_10_03_world_creature_loot_template.sql @@ -0,0 +1,2 @@ +-- Use correct item for Tharon'ja quest item drop (Prophet's Enchanted Tiki) +UPDATE `creature_loot_template` SET `item`=43670 WHERE `entry`=31360 AND `item`=13249; diff --git a/sql/updates/world/2011_03_10_04_world_disables.sql b/sql/updates/world/2011_03_10_04_world_disables.sql new file mode 100644 index 0000000000000..875d02a08ba5a --- /dev/null +++ b/sql/updates/world/2011_03_10_04_world_disables.sql @@ -0,0 +1,7 @@ +-- disable untill it can be properly scripted +DELETE FROM `disables` WHERE `sourceType`=4 AND `entry` IN (7020,7021); +INSERT INTO `disables` +(`sourceType`,`entry`,`flags`,`params_0`,`params_1`,`comment`) +VALUES +(4,7020,0, '', '', 'disable Not In My House'), +(4,7021,0, '', '', 'disable Not In My House'); diff --git a/sql/updates/world/2011_03_10_05_world_creature_questrelation.sql b/sql/updates/world/2011_03_10_05_world_creature_questrelation.sql new file mode 100644 index 0000000000000..21f73f307523d --- /dev/null +++ b/sql/updates/world/2011_03_10_05_world_creature_questrelation.sql @@ -0,0 +1,4 @@ +-- Wrong start/end NPCs for Caverns of Time Chain: +-- Andormu(man) should be Andormu(child) +UPDATE `creature_involvedrelation` SET `id`=20130 WHERE `quest`IN(10285,10298); +UPDATE `creature_questrelation` SET `id`=20130 WHERE `quest`=10296; diff --git a/sql/updates/world/2011_03_10_06_world_conditions.sql b/sql/updates/world/2011_03_10_06_world_conditions.sql new file mode 100644 index 0000000000000..0c1fb9dddab77 --- /dev/null +++ b/sql/updates/world/2011_03_10_06_world_conditions.sql @@ -0,0 +1,5 @@ +-- condition for Faerie Fire bonus (only in bear form) +DELETE FROM `conditions` WHERE `SourceEntry` =60089; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(17,0,60089,0,1,5487,0,0,0, '', 'Faerie Fire - Bear Form'), +(17,0,60089,1,1,9634,0,0,0, '', 'Faerie Fire - Dire Bear Form'); diff --git a/sql/updates/world/2011_03_10_07_world_conditions.sql b/sql/updates/world/2011_03_10_07_world_conditions.sql new file mode 100644 index 0000000000000..fd5bc79146f42 --- /dev/null +++ b/sql/updates/world/2011_03_10_07_world_conditions.sql @@ -0,0 +1 @@ +DELETE FROM `conditions` WHERE `SourceGroup`=31360 AND `SourceEntry`=13249; diff --git a/sql/updates/world/2011_03_10_08_world_spell_script_names.sql b/sql/updates/world/2011_03_10_08_world_spell_script_names.sql new file mode 100644 index 0000000000000..28598e0d313a2 --- /dev/null +++ b/sql/updates/world/2011_03_10_08_world_spell_script_names.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_script_names` WHERE `spell_id`=48917; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(48917, 'spell_q10041_q10040_who_are_they'); diff --git a/sql/updates/world/2011_03_10_09_world_sai.sql b/sql/updates/world/2011_03_10_09_world_sai.sql new file mode 100644 index 0000000000000..e6e903d1ef74f --- /dev/null +++ b/sql/updates/world/2011_03_10_09_world_sai.sql @@ -0,0 +1,55 @@ +DELETE FROM `gossip_menu` WHERE `entry` IN (7757,7758,7759,7760,7761,7772,21253,7775,7776,7755,7774); +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES +(7757,9497), +(7758,9503), +(7759,9502), +(7760,9505), +(7761,9506), +(7772,9520), +(21253,9520), +(7775,9523), +(7776,9524), +(7755,9498), +(7774,9522); + +UPDATE `creature_template` SET `gossip_menu_id`=7774 WHERE `entry`=18712; +UPDATE `creature_template` SET `gossip_menu_id`=7775 WHERE `entry`=17088; +UPDATE `creature_template` SET `gossip_menu_id`=7776 WHERE `entry`=18720; +UPDATE `creature_template` SET `gossip_menu_id`=7775 WHERE `entry`=16519; +UPDATE `creature_template` SET `gossip_menu_id`=7772 WHERE `entry`=18714; +UPDATE `creature_template` SET `gossip_menu_id`=21253 WHERE `entry`=18715; +UPDATE `creature_template` SET `gossip_menu_id`=7759 WHERE `entry`=18716; +UPDATE `creature_template` SET `gossip_menu_id`=7757 WHERE `entry`=18717; +UPDATE `creature_template` SET `gossip_menu_id`=7760 WHERE `entry`=18719; + +DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (7772,21253,7757,7759,7760); +INSERT INTO `gossip_menu_option` (`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`) VALUES +(7772,0,0, 'Scout Neftis, I need another disguise.',1,1,0,0,0,0,0,NULL), +(21253,0,0, 'Private Weeks, I need another disguise.',1,1,0,0,0,0,0,NULL), +(7757,0,0, 'Why are you fixing all of this up?',1,1,7755,0,0,0,0,NULL), +(7759,0,0, 'What are you doing there?',1,1,7758,0,0,0,0,NULL), +(7760,0,0, 'Advisor, what''s the latest news?',1,1,7761,0,0,0,0,NULL); + +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry` IN (18714,18717,18716,18719,18715); +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (18714,18717,18716,18719,18715); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(18714,0,0,0,19,0,100,0,10041,0,0,0,11,48917,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Neftis - On Quest Accept - Cast spell 48917 on player'), +(18714,0,1,0,20,0,100,0,10041,0,0,0,28,32756,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Neftis - On Quest Reward - Remove spell 32756 on player'), +(18714,0,2,0,62,0,100,0,7772,0,0,0,11,48917,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Neftis - On Gossip option - Cast spell 48917 on player'), +(18715,0,0,0,19,0,100,0,10040,0,0,0,11,48917,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Private Weeks - On Quest Accept - Cast spell 48917 on player'), +(18715,0,1,0,20,0,100,0,10040,0,0,0,28,32756,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Private Weeks - On Quest Reward - Remove spell 32756 on player'), +(18715,0,2,0,62,0,100,0,21253,0,0,0,11,48917,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Private Week - On Gossip option - Cast spell 48917 on player'), +(18717,0,0,0,62,0,100,0,7757,0,0,0,11,47069,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Who Are They - Shadowy Laborer - On Gossip option - Cast spell 47069 on player'), +(18716,0,0,0,62,0,100,0,7759,0,0,0,11,47068,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Who Are They - Shadowy Initiate - On Gossip option - Cast spell 47068 on player'), +(18719,0,0,0,62,0,100,0,7760,0,0,0,11,47070,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Who Are They - Shadowy Advisor - On Gossip option - Cast spell 47070 on player'); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup` IN (7772,7757,7759,7760,21253); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`Comment`) VALUES +(15,21253,0,0,9,10040,0,0,0, 'Show gossip option 21253 if player has quest 10040'), +(15,7757,0,0,9,10040,0,0,0, 'Show gossip option 7757 if player has quest 10040'), +(15,7759,0,0,9,10040,0,0,0, 'Show gossip option 7759 if player has quest 10040'), +(15,7760,0,0,9,10040,0,0,0, 'Show gossip option 7760 if player has quest 10040'), +(15,7772,0,1,9,10041,0,0,0, 'Show gossip option 7772 if player has quest 10041'), +(15,7757,0,1,9,10041,0,0,0, 'Show gossip option 7757 if player has quest 10041'), +(15,7759,0,1,9,10041,0,0,0, 'Show gossip option 7759 if player has quest 10041'), +(15,7760,0,1,9,10041,0,0,0, 'Show gossip option 7760 if player has quest 10041'); diff --git a/sql/updates/world/2011_03_10_10_world_spell_linked_spell.sql b/sql/updates/world/2011_03_10_10_world_spell_linked_spell.sql new file mode 100644 index 0000000000000..4afe823783684 --- /dev/null +++ b/sql/updates/world/2011_03_10_10_world_spell_linked_spell.sql @@ -0,0 +1,5 @@ +-- Remove model aura when shadowy disguise is removed +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=-32756; +INSERT INTO `spell_linked_spell` (`spell_trigger`,`spell_effect`,`type`,`comment`) VALUES +(-32756,-38080,0, 'Shadowy Disguise: Remove model aura'), +(-32756,-38081,0, 'Shadowy Disguise: Remove model aura'); diff --git a/sql/updates/world/2011_03_11_00_world_sai.sql b/sql/updates/world/2011_03_11_00_world_sai.sql new file mode 100644 index 0000000000000..0d7e13da7cfe6 --- /dev/null +++ b/sql/updates/world/2011_03_11_00_world_sai.sql @@ -0,0 +1,27 @@ +DELETE FROM `creature` WHERE `guid`=201309; -- duplicate spawn +UPDATE `creature_template` SET `InhabitType`=7 WHERE `entry` IN (37181,37183); + +DELETE FROM `creature_text` WHERE `entry` IN (37119,37181,37183); +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(37119,0,0, 'This is our final stand. What happens here will echo through the ages. Regardless of outcome, they will know that we fought with honor. That we fought for the freedom and safety of our people!',1,0,0,22,0,16653, 'Highlord Tirion Fordring - SAY_TIRION_INTRO_1'), +(37119,1,0, 'Remember, heroes, fear is your greatest enemy in these befouled halls. Steel your heart and your soul will shine brighter than a thousand suns. The enemy will falter at the sight of you. They will fall as the light of righteousness envelops them!',1,0,0,22,0,16654, 'Highlord Tirion Fordring - SAY_TIRION_INTRO_2'), +(37119,2,0, 'Our march upon Icecrown Citadel begins now!',1,0,0,22,0,16655, 'Highlord Tirion Fordring - SAY_TIRION_INTRO_3'), +(37119,3,0, 'ARTHAS! I swore that I would see you dead and the Scourge dismantled! I''m going to finish what I started at Light''s Hope!',1,0,0,22,0,16656, 'Highlord Tirion Fordring - SAY_TIRION_INTRO_4'), +(37181,0,0, 'You now stand upon the hallowed ground of the Scourge. The Light won''t protect you here, paladin. Nothing will protect you...',1,0,0,0,0,17230, 'The Lich King - SAY_LK_INTRO_1'), +(37181,1,0, 'You could have been my greatest champion, Fordring: A force of darkness that would wash over this world and deliver it into a new age of strife.',1,0,0,0,0,17231, 'The Lich King - SAY_LK_INTRO_2'), +(37181,2,0, 'But that honor is no longer yours. Soon,I will have a new champion.',1,0,0,0,0,17232, 'The Lich King - SAY_LK_INTRO_3'), +(37181,3,0, 'The breaking of this one has been taxing. The atrocities I have committed upon his soul. He has resisted for so long, but he will bow down before his king soon.',1,0,0,0,0,17233, 'The Lich King - SAY_LK_INTRO_4'), +(37181,4,0, 'In the end, you will all serve me.',1,0,0,0,0,17234, 'The Lich King - SAY_LK_INTRO_5'), +(37183,0,0, 'NEVER! I... I will never... serve... you...',1,0,0,0,0,17078, 'Highlord Bolvar Fordragon - SAY_BOLVAR_INTRO_1'); + +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=37011; -- The Damned +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (-200966,-201066,37011); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(-201066,0,0,0,6,0,100,1,0,0,0,0,11,70961,3,0,0,0,0,1,0,0,0,0,0,0,0, 'The Damned - Cast Shattered Bones on death'), +(-201066,0,1,0,2,0,100,0,5,30,15000,20000,75,70960,0,0,0,0,0,1,0,0,0,0,0,0,0, 'The Damned - Cast Bone Flurry at 5-30%'), +(-201066,0,2,0,6,0,100,1,0,0,0,0,45,1,1,0,0,0,0,10,201466,0,0,0,0,0,0, 'The Damned - Set data for Highlord Tirion Fordring'), +(-200966,0,0,0,6,0,100,1,0,0,0,0,11,70961,3,0,0,0,0,1,0,0,0,0,0,0,0, 'The Damned - Cast Shattered Bones on death'), +(-200966,0,1,0,2,0,100,0,5,30,15000,20000,75,70960,0,0,0,0,0,1,0,0,0,0,0,0,0, 'The Damned - Cast Bone Flurry at 5-30%'), +(-200966,0,2,0,6,0,100,1,0,0,0,0,45,1,1,0,0,0,0,10,201466,0,0,0,0,0,0, 'The Damned - Set data for Highlord Tirion Fordring'), +(37011,0,0,0,6,0,100,1,0,0,0,0,11,70961,3,0,0,0,0,1,0,0,0,0,0,0,0, 'The Damned - Cast Shattered Bones on death'), +(37011,0,1,0,2,0,100,0,5,30,15000,20000,75,70960,0,0,0,0,0,1,0,0,0,0,0,0,0, 'The Damned - Cast Bone Flurry at 5-30%'); diff --git a/sql/updates/world/2011_03_11_00_world_scriptname.sql b/sql/updates/world/2011_03_11_00_world_scriptname.sql new file mode 100644 index 0000000000000..74f3d0f04ba26 --- /dev/null +++ b/sql/updates/world/2011_03_11_00_world_scriptname.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName`='npc_highlord_tirion_fordring_lh' WHERE `entry`=37119; diff --git a/sql/updates/world/2011_03_11_01_world_sai.sql b/sql/updates/world/2011_03_11_01_world_sai.sql new file mode 100644 index 0000000000000..ac4a83433c48c --- /dev/null +++ b/sql/updates/world/2011_03_11_01_world_sai.sql @@ -0,0 +1,45 @@ +UPDATE `creature_template` SET `InhabitType`=7 WHERE `entry`=38153; +UPDATE `creature_template` SET `npcflag`=0 WHERE `entry` IN (37187,37200); +UPDATE `creature` SET `npcflag`=0 WHERE `id` IN (37187,37200); +UPDATE `creature` SET `npcflag`=`npcflag`|1 WHERE `guid`=200982; -- Set gossip flag for spawn at Deathbringer's Rise + +DELETE FROM `creature_text` WHERE `entry`=37187 AND `groupid` BETWEEN 15 AND 18; +DELETE FROM `creature_text` WHERE `entry`=37200 AND `groupid` BETWEEN 13 AND 15; +DELETE FROM `creature_text` WHERE `entry`=37119 AND `groupid` IN (4,5); +DELETE FROM `creature_text` WHERE `entry`=37181 AND `groupid`=2; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(37187,15,0, 'The paladin still lives? Is it possible, Highlord? Could he have survived?',0,0,0,6,0,17107, 'High Overlord Saurfang - SAY_SAURFANG_INTRO_1'), +(37187,16,0, 'Then we must save him! If we rescue Bolvar Fordragon, we may quell the unrest between the Alliance and the Horde.',0,0,0,5,0,17108, 'High Overlord Saurfang - SAY_SAURFANG_INTRO_2'), +(37187,17,0, 'Our mission is now clear: The Lich King will answer for his crimes and we will save Highlord Bolvar Fordragon!',0,0,0,15,0,17109, 'High Overlord Saurfang - SAY_SAURFANG_INTRO_3'), +(37187,18,0, 'Kor''kron, prepare Orgrim''s Hammer for its final voyage! Champions, our gunship will find a point to dock on the upper reaches of the citadel. Meet us there!',1,0,0,22,0,17110, 'High Overlord Saurfang - SAY_SAURFANG_INTRO_4'), +(37119,4,0, 'The power of the Light knows no bounds, Saurfang. His soul is under great strain, but he lives - for now.',0,0,0,1,0,16658, 'Highlord Tirion Fordring - SAY_TIRION_INTRO_5'), +(37181,2,0, 'But that honor is no longer yours. Soon, I will have a new champion.',1,0,0,0,0,17232, 'The Lich King - SAY_LK_INTRO_3'), +(37200,13,0, 'Could it be, Lord Fordring? If Bolvar lives, mayhap there is hope fer peace between the Alliance and the Horde. We must reach the top o'' this cursed place and free the paladin!',0,0,0,6,0,16980, 'Muradin Bronzebeard - SAY_SAURFANG_INTRO_2'), +(37200,14,0, 'Prepare the Skybreaker fer an aerial assault on the citadel!',1,0,0,5,0,16981, 'Muradin Bronzebeard - SAY_SAURFANG_INTRO_3'), +(37200,15,0, 'Heroes, ye must fight yer way to a clear extraction point within Icecrown. We''ll try an'' rendezvous on the ramparts!',1,0,0,22,0,16982, 'Muradin Bronzebeard - SAY_SAURFANG_INTRO_4'), +(37119,5,0, 'By the Light, it must be so!',0,0,0,5,0,16657, 'Highlord Tirion Fordring - SAY_TIRION_INTRO_A_5'); + +SET @GUID := 200984; +SET @PATH_ID := @GUID*10; +DELETE FROM `waypoint_data` WHERE `id`=@PATH_ID; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH_ID,0,-39.2257,2211.269,27.90252,0,0,0,100,0), +(@PATH_ID,1,-27.3663,2211.575,30.11564,0,0,0,100,0), +(@PATH_ID,2,-15.8420,2211.618,30.11566,0,0,0,100,0), +(@PATH_ID,3,2.744797,2211.411,30.11566,0,0,0,100,0), +(@PATH_ID,4,24.05210,2211.306,30.11566,0,0,0,100,0), +(@PATH_ID,5,64.72570,2211.561,30.11567,0,0,0,100,0); + +DELETE FROM `creature_formations` WHERE `leaderGUID`=@GUID; +INSERT INTO `creature_formations` (`leaderGUID`,`memberGUID`,`dist`,`angle`,`groupAI`) VALUES +(@GUID,@GUID,0,0,0), +(@GUID,201185,2.72779,127.636,0), +(@GUID,200979,5.34512,256.1602,0), +(@GUID,200889,3.59949,206.7455,0); + +DELETE FROM `linked_respawn` WHERE `linkedGuid`=@GUID AND `linkType`=0; +INSERT INTO `linked_respawn` (`guid`,`linkedGuid`,`linkType`) VALUES +(201185,@GUID,0), +(200979,@GUID,0), +(200889,@GUID,0), +(@GUID,@GUID,0); diff --git a/sql/updates/world/2011_03_11_02_world_trinity_string.sql b/sql/updates/world/2011_03_11_02_world_trinity_string.sql new file mode 100644 index 0000000000000..925873f5d6fca --- /dev/null +++ b/sql/updates/world/2011_03_11_02_world_trinity_string.sql @@ -0,0 +1,6 @@ +UPDATE `trinity_string` SET `content_default` = 'Player selected NPC +DB GUID: %u, current GUID: %u. +Faction: %u. +npcFlags: %u. +Entry: %u. +DisplayID: %u (Native: %u).' WHERE `entry` = 539; diff --git a/sql/updates/world/2011_03_12_00_world_creature_template.sql b/sql/updates/world/2011_03_12_00_world_creature_template.sql new file mode 100644 index 0000000000000..4356a82443f6c --- /dev/null +++ b/sql/updates/world/2011_03_12_00_world_creature_template.sql @@ -0,0 +1,43 @@ +/* +1 0x0000 0001 MECHANIC_CHARM +2 0x0000 0002 MECHANIC_DISORIENTED +16 0x0000 0010 MECHANIC_FEAR +32 0x0000 0020 MECHANIC_GRIP +64 0x0000 0040 MECHANIC_ROOT +128 0x0000 0080 MECHANIC_PACIFY (0 spells use this mechanic) +256 0x0000 0100 MECHANIC_SILENCE +512 0x0000 0200 MECHANIC_SLEEP +1024 0x0000 0400 MECHANIC_SNARE +2048 0x0000 0800 MECHANIC_STUN +4096 0x0000 1000 MECHANIC_FREEZE +8192 0x0000 2000 MECHANIC_KNOCKOUT +65536 0x0001 0000 MECHANIC_POLYMORPH +131072 0x0002 0000 MECHANIC_BANISH +524288 0x0008 0000 MECHANIC_SHACKLE +4194304 0x0040 0000 MECHANIC_TURN +8388608 0x0080 0000 MECHANIC_HORROR +67108864 0x0400 0000 MECHANIC_DAZE +536870912 0x2000 0000 MECHANIC_SAPPED +*/ +-- Update Frozen Halls Immunities +UPDATE `creature_template` SET `mechanic_immune_mask`=`mechanic_immune_mask`|1|2|16|32|64|128|256|512|1024|2048|4096|8192|65536|131072|524288|4194304|8388608|67108864|536870912 WHERE `entry` IN ( +-- Halls of Reflection: +38112,-- Falric +38599,-- Falric (1) +38113,-- Marwyn +38603,-- Marwyn (1) +37226,-- Wrath of the Lich King +-- Pit of Saron: +36494,-- Forgemaster Garfrost +37613,-- Forgemaster Garfrost (1) +36476,-- Ick +37627,-- Ick (1) +36477,-- Krick +37629,-- Krick (1) +36658,-- Scourgelord Tyrannus +36938,-- Scourgelord Tyrannus (1) +-- The Forge of Souls: +36497,-- Bronjahm +36498,-- Bronjahm (1) +36502,-- Devourer of Souls +37677);-- Devourer of Souls (1) diff --git a/sql/updates/world/2011_03_13_00_world_scriptname.sql b/sql/updates/world/2011_03_13_00_world_scriptname.sql new file mode 100644 index 0000000000000..b68be3b739da9 --- /dev/null +++ b/sql/updates/world/2011_03_13_00_world_scriptname.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName`='boss_flame_leviathan_defense_cannon' WHERE `entry`=33139; diff --git a/sql/updates/world/2011_03_13_01_world_areatrigger_scripts.sql b/sql/updates/world/2011_03_13_01_world_areatrigger_scripts.sql new file mode 100644 index 0000000000000..098030021eeb9 --- /dev/null +++ b/sql/updates/world/2011_03_13_01_world_areatrigger_scripts.sql @@ -0,0 +1,3 @@ +DELETE FROM `areatrigger_scripts` WHERE `entry`=5729; +INSERT INTO `areatrigger_scripts` (`entry`,`ScriptName`) VALUES +(5729,'at_icc_start_blood_quickening'); diff --git a/sql/updates/world/2011_03_13_01_world_creatures.sql b/sql/updates/world/2011_03_13_01_world_creatures.sql new file mode 100644 index 0000000000000..860491ec79005 --- /dev/null +++ b/sql/updates/world/2011_03_13_01_world_creatures.sql @@ -0,0 +1,26 @@ +UPDATE `creature_template` SET `AIName`='SmartAI',`InhabitType`=7,`flags_extra`=`flags_extra`|128 WHERE `entry`=38557; +UPDATE `creature_template` SET `InhabitType`=7 WHERE `entry`=38558; + +SET @GUID := 137784; +DELETE FROM `creature` WHERE `guid` BETWEEN @GUID+0 AND @GUID+4; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`DeathState`,`MovementType`,`npcflag`,`unit_flags`,`dynamicflags`) VALUES +(@GUID+0,38558,631,15,1,0,0,4637.27,2786.25,424.639,3.57357,604800,0,0,0,0,0,0,0,0,0), -- Infiltrator Minchar +(@GUID+1,38557,631,15,1,0,0,4642.60,2771.61,412.227,0.00000,604800,0,0,0,0,0,0,0,0,0), -- left leg +(@GUID+2,38557,631,15,1,0,0,4630.34,2799.74,412.512,0.00000,604800,0,0,0,0,0,0,0,0,0), -- right leg +(@GUID+3,38557,631,15,1,0,0,4630.73,2802.02,437.672,0.00000,604800,0,0,0,0,0,0,0,0,0), -- right arm +(@GUID+4,38557,631,15,1,0,0,4645.42,2771.67,436.146,0.00000,604800,0,0,0,0,0,0,0,0,0); -- left arm + +DELETE FROM `smart_scripts` WHERE `entryorguid` BETWEEN -(@GUID+4) AND -(@GUID+1); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(-(@GUID+1),0,0,0,25,0,100,0,0,0,0,0,11,72302,3,0,0,0,0,10,@GUID,0,0,0,0,0,0, 'Minchar Beam Stalker - Channel beam'), +(-(@GUID+2),0,0,0,25,0,100,0,0,0,0,0,11,72301,3,0,0,0,0,10,@GUID,0,0,0,0,0,0, 'Minchar Beam Stalker - Channel beam'), +(-(@GUID+3),0,0,0,25,0,100,0,0,0,0,0,11,72304,3,0,0,0,0,10,@GUID,0,0,0,0,0,0, 'Minchar Beam Stalker - Channel beam'), +(-(@GUID+4),0,0,0,25,0,100,0,0,0,0,0,11,72303,3,0,0,0,0,10,@GUID,0,0,0,0,0,0, 'Minchar Beam Stalker - Channel beam'); + +DELETE FROM `creature_addon` WHERE `guid`=@GUID; +INSERT INTO `creature_addon` (`guid`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(@GUID,0,0x03000000,1,427, ''); -- Infiltrator Minchar + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=71322; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(13,0,71322,0,18,1,38558,0,0, '', 'Blood-Queen Lana''thel - Annihilate Minchar'); diff --git a/sql/updates/world/2011_03_16_00_world_creatures.sql b/sql/updates/world/2011_03_16_00_world_creatures.sql new file mode 100644 index 0000000000000..b3a4722d03bbd --- /dev/null +++ b/sql/updates/world/2011_03_16_00_world_creatures.sql @@ -0,0 +1,34 @@ +SET @EQUIP := 10137; + +UPDATE `creature_template` SET `faction_A`=1770,`faction_H`=1770,`baseattacktime`=2000,`npcflag`=3,`unit_flags`=33088,`dynamicflags`=0,`speed_run`=1,`flags_extra`=`flags_extra`|2 WHERE `entry`=37597; -- Lady Jaina Proudmoore +UPDATE `creature_template` SET `faction_A`=1770,`faction_H`=1770,`baseattacktime`=2000,`unit_flags`=33088,`equipment_id`=1221,`speed_run`=1,`flags_extra`=`flags_extra`|2 WHERE `entry`=38160; -- Lady Jaina Proudmoore +UPDATE `creature_template` SET `baseattacktime`=5000,`unit_class`=2,`speed_walk`=0.4,`speed_run`=1.1428571428571 WHERE `entry`=36967; -- Spiteful Apparition (Ambient) +UPDATE `creature_template` SET `baseattacktime`=2000,`speed_walk`=1.111112,`speed_run`=1.1428571428571 WHERE `entry`=36666; -- Spectral Warden +UPDATE `creature_template` SET `equipment_id`=637,`speed_run`=1.1428571428571,`flags_extra`=`flags_extra`|2 WHERE `entry`=37582; -- Archmage Koreln +UPDATE `creature_template` SET `faction_A`=1770,`faction_H`=1770,`baseattacktime`=2000,`unit_flags`=32832,`equipment_id`=637,`speed_run`=1.1428571428571,`flags_extra`=`flags_extra`|2 WHERE `entry`=37774; -- Archmage Elandra +UPDATE `creature_template` SET `faction_A`=534,`faction_H`=534,`baseattacktime`=2000,`unit_flags`=32832,`equipment_id`=@EQUIP,`speed_run`=1.1428571428571 WHERE `entry`=37496; -- Coliseum Champion +UPDATE `creature_template` SET `unit_flags`=`unit_flags`|32832,`speed_run`=1.1428571428571 WHERE `entry`=37779; -- Dark Ranger Loralen +UPDATE `creature_template` SET `baseattacktime`=2000,`npcflag`=`npcflag`|3,`dynamicflags`=0,`speed_run`=1.1428571428571,`flags_extra`=`flags_extra`|2 WHERE `entry`=37596; -- Lady Sylvanas Windrunner +UPDATE `creature_template` SET `baseattacktime`=2000,`speed_walk`=0.4,`speed_run`=1.1428571428571,`InhabitType`=7,`flags_extra`=`flags_extra`|128 WHERE `entry`=36508; -- Soulguard Beam Focus Target + +DELETE FROM `creature_equip_template` WHERE `entry`=@EQUIP; +INSERT INTO `creature_equip_template` (`entry`,`equipentry1`,`equipentry2`,`equipentry3`) VALUES +(@EQUIP,47814,46963,0); + +DELETE FROM `creature_template_addon` WHERE `entry` IN (36508,37583,37779); +INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(37779,0,0,1,433, NULL), -- Dark Ranger Loralen +(37583,0,0,2,0, NULL), -- Dark Ranger Kalira +(36508,0,33554432,1,0, NULL); -- Soulguard Beam Focus Target + +UPDATE `creature_model_info` SET `bounding_radius`=0.208,`combat_reach`=1.5,`gender`=1 WHERE `modelid`=30684; -- Archmage Elandra +UPDATE `creature_model_info` SET `bounding_radius`=0.347,`combat_reach`=1.5,`gender`=0 WHERE `modelid`=30638; -- Coliseum Champion +UPDATE `creature_model_info` SET `bounding_radius`=0.465,`combat_reach`=0,`gender`=1 WHERE `modelid`=30867; -- Lady Jaina Proudmoore +UPDATE `creature_model_info` SET `bounding_radius`=0.354,`combat_reach`=2.25,`gender`=1 WHERE `modelid`=30168; -- Soulguard Animator +UPDATE `creature_model_info` SET `bounding_radius`=0.465,`combat_reach`=1.5,`gender`=0 WHERE `modelid`=30270; -- Soulguard Bonecaster +UPDATE `creature_model_info` SET `bounding_radius`=0.459,`combat_reach`=2.25,`gender`=1 WHERE `modelid`=30240; -- Soulguard Adept +UPDATE `creature_model_info` SET `bounding_radius`=0.5,`combat_reach`=1,`gender`=2 WHERE `modelid`=25942; -- Spiteful Apparition (Ambient) +UPDATE `creature_model_info` SET `bounding_radius`=2.5,`combat_reach`=3.75,`gender`=0 WHERE `modelid`=30283; -- Spectral Warden +UPDATE `creature_model_info` SET `bounding_radius`=0.383,`combat_reach`=1.5,`gender`=0 WHERE `modelid`=30862; -- Ebon Blade Commander +UPDATE `creature_model_info` SET `bounding_radius`=0.372,`combat_reach`=1.2,`gender`=1 WHERE `modelid`=28213; -- Lady Sylvanas Windrunner +UPDATE `creature_model_info` SET `bounding_radius`=0.5,`combat_reach`=1,`gender`=2 WHERE `modelid`=11686; -- Soulguard Beam Focus Target \ No newline at end of file diff --git a/sql/updates/world/2011_03_17_00_world_sai.sql b/sql/updates/world/2011_03_17_00_world_sai.sql new file mode 100644 index 0000000000000..3fb85bbd2ac57 --- /dev/null +++ b/sql/updates/world/2011_03_17_00_world_sai.sql @@ -0,0 +1,297 @@ +-- Pathing for En'kilah Crypt Fiend Entry: 25386 +SET @NPC := 99939; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=3859.662,`position_y`=3393.562,`position_z`=67.97741 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3856.184,3393.872,68.60241,0,0,0,100,0), +(@PATH,2,3853.398,3388.785,70.60241,0,0,0,100,0), +(@PATH,3,3856.184,3393.872,68.60241,0,0,0,100,0), +(@PATH,4,3859.662,3393.562,67.97741,0,0,0,100,0), +(@PATH,5,3865.199,3400.655,64.67162,0,0,0,100,0), +(@PATH,6,3862.853,3407.01,64.17162,0,0,0,100,0), +(@PATH,7,3864.934,3414.912,64.17162,0,0,0,100,0), +(@PATH,8,3862.853,3407.01,64.17162,0,0,0,100,0), +(@PATH,9,3865.199,3400.655,64.67162,0,0,0,100,0), +(@PATH,10,3859.662,3393.562,67.97741,0,0,0,100,0); + +-- Pathing for En'kilah Crypt Fiend Entry: 25386 +SET @NPC := 100009; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=3896.402,`position_y`=3454.12,`position_z`=64.19093 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3890.689,3458.416,65.06593,0,0,0,100,0), +(@PATH,2,3878.707,3463.25,64.06593,0,0,0,100,0), +(@PATH,3,3865.527,3468.116,64.16493,0,0,0,100,0), +(@PATH,4,3867.453,3467.697,64.16493,0,0,0,100,0), +(@PATH,5,3878.97,3463.877,64.06593,0,0,0,100,0), +(@PATH,6,3896.402,3454.12,64.19093,0,0,0,100,0); + +-- Pathing for En'kilah Crypt Fiend Entry: 25386 +SET @NPC := 99955; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=3849.937,`position_y`=3440.836,`position_z`=64.08922 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3844.136,3430.625,64.17162,0,0,0,100,0), +(@PATH,2,3836.185,3415.533,67.29662,0,0,0,100,0), +(@PATH,3,3838.057,3414.41,67.17162,0,0,0,100,0), +(@PATH,4,3843.113,3427.501,64.29662,0,0,0,100,0), +(@PATH,5,3848.386,3439.262,64.08922,0,0,0,100,0), +(@PATH,6,3849.937,3440.836,64.08922,0,0,0,100,0); + +-- Pathing for En'kilah Crypt Fiend Entry: 25386 +SET @NPC := 99856; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=3944.872,`position_y`=3387.368,`position_z`=82.84169 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3958.746,3388.819,83.46669,0,0,0,100,0), +(@PATH,2,3939.345,3406.614,80.91746,0,0,0,100,0), +(@PATH,3,3932.713,3412.609,80.93697,0,0,0,100,0), +(@PATH,4,3931.988,3409.037,80.93697,0,0,0,100,0), +(@PATH,5,3940.203,3397.782,80.96669,0,0,0,100,0), +(@PATH,6,3944.872,3387.368,82.84169,0,0,0,100,0); + +-- Pathing for En'kilah Crypt Fiend Entry: 25386 +SET @NPC := 99853; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=3988.71,`position_y`=3389.023,`position_z`=84.59169 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3995.287,3398.66,83.21669,0,0,0,100,0), +(@PATH,2,3999.713,3411.761,84.47887,0,0,0,100,0), +(@PATH,3,3992.017,3414.793,83.10387,0,0,0,100,0), +(@PATH,4,3980.25,3399.608,80.96669,0,0,0,100,0), +(@PATH,5,3973.198,3392.127,81.21669,0,0,0,100,0), +(@PATH,6,3981.25,3389.583,83.71669,0,0,0,100,0), +(@PATH,7,3988.71,3389.023,84.59169,0,0,0,100,0); + +-- Pathing for En'kilah Crypt Fiend Entry: 25386 +SET @NPC := 100008; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=3961.064,`position_y`=3422.165,`position_z`=80.91746 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3958.62,3407.545,80.91746,0,0,0,100,0), +(@PATH,2,3959.292,3391.561,82.09169,0,0,0,100,0), +(@PATH,3,3959.987,3394.481,81.09169,0,0,0,100,0), +(@PATH,4,3961.145,3408.606,80.91746,0,0,0,100,0), +(@PATH,5,3963.867,3424.426,80.91746,0,0,0,100,0), +(@PATH,6,3961.064,3422.165,80.91746,0,0,0,100,0); +-- 0xF13000632A00102F .go 3958.62 3407.545 80.91746 + +-- Pathing for En'kilah Crypt Fiend Entry: 25386 +SET @NPC := 100011; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=3973.765,`position_y`=3685.582,`position_z`=63.20702 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3985.953,3658.16,62.64196,0,0,0,100,0), +(@PATH,2,3981.12,3655.121,62.51696,0,0,0,100,0), +(@PATH,3,3975.807,3676.29,63.20702,0,0,0,100,0), +(@PATH,4,3968.138,3708.388,63.14015,0,0,0,100,0), +(@PATH,5,3973.765,3685.582,63.20702,0,0,0,100,0); +-- 0xF53000632A016E01 .go 3985.953 3658.16 62.64196 + +-- Pathing for En'kilah Crypt Fiend Entry: 25386 +SET @NPC := 99855; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=3767.44,`position_y`=3483.963,`position_z`=64.18696 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3765.76,3473.853,64.31196,0,0,0,100,0), +(@PATH,2,3767.138,3500.103,64.0854,0,0,0,100,0), +(@PATH,3,3770.234,3518.467,64.0854,0,0,0,100,0), +(@PATH,4,3769.093,3509.577,64.0854,0,0,0,100,0), +(@PATH,5,3768.024,3494.981,64.18696,0,0,0,100,0), +(@PATH,6,3767.44,3483.963,64.18696,0,0,0,100,0); +-- 0xF53000632A017C11 .go 3765.76 3473.853 64.31196 + +-- Pathing for En'kilah Crypt Fiend Entry: 25386 +SET @NPC := 99939; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=3859.662,`position_y`=3393.562,`position_z`=67.97741 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3856.184,3393.872,68.60241,0,0,0,100,0), +(@PATH,2,3853.398,3388.785,70.60241,0,0,0,100,0), +(@PATH,3,3856.184,3393.872,68.60241,0,0,0,100,0), +(@PATH,4,3859.662,3393.562,67.97741,0,0,0,100,0), +(@PATH,5,3865.199,3400.655,64.67162,0,0,0,100,0), +(@PATH,6,3862.853,3407.01,64.17162,0,0,0,100,0), +(@PATH,7,3864.934,3414.912,64.17162,0,0,0,100,0), +(@PATH,8,3862.853,3407.01,64.17162,0,0,0,100,0), +(@PATH,9,3865.199,3400.655,64.67162,0,0,0,100,0), +(@PATH,10,3859.662,3393.562,67.97741,0,0,0,100,0); + +-- Pathing for En'kilah Crypt Fiend Entry: 25386 +SET @NPC := 100009; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=3896.402,`position_y`=3454.12,`position_z`=64.19093 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3890.689,3458.416,65.06593,0,0,0,100,0), +(@PATH,2,3878.707,3463.25,64.06593,0,0,0,100,0), +(@PATH,3,3865.527,3468.116,64.16493,0,0,0,100,0), +(@PATH,4,3867.453,3467.697,64.16493,0,0,0,100,0), +(@PATH,5,3878.97,3463.877,64.06593,0,0,0,100,0), +(@PATH,6,3896.402,3454.12,64.19093,0,0,0,100,0); + +-- Pathing for En'kilah Crypt Fiend Entry: 25386 +SET @NPC := 99955; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=3849.937,`position_y`=3440.836,`position_z`=64.08922 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3844.136,3430.625,64.17162,0,0,0,100,0), +(@PATH,2,3836.185,3415.533,67.29662,0,0,0,100,0), +(@PATH,3,3838.057,3414.41,67.17162,0,0,0,100,0), +(@PATH,4,3843.113,3427.501,64.29662,0,0,0,100,0), +(@PATH,5,3848.386,3439.262,64.08922,0,0,0,100,0), +(@PATH,6,3849.937,3440.836,64.08922,0,0,0,100,0); + +-- Pathing for En'kilah Crypt Fiend Entry: 25386 +SET @NPC := 99856; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=3944.872,`position_y`=3387.368,`position_z`=82.84169 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3958.746,3388.819,83.46669,0,0,0,100,0), +(@PATH,2,3939.345,3406.614,80.91746,0,0,0,100,0), +(@PATH,3,3932.713,3412.609,80.93697,0,0,0,100,0), +(@PATH,4,3931.988,3409.037,80.93697,0,0,0,100,0), +(@PATH,5,3940.203,3397.782,80.96669,0,0,0,100,0), +(@PATH,6,3944.872,3387.368,82.84169,0,0,0,100,0); + +-- Pathing for En'kilah Crypt Fiend Entry: 25386 +SET @NPC := 99853; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=3988.71,`position_y`=3389.023,`position_z`=84.59169 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3995.287,3398.66,83.21669,0,0,0,100,0), +(@PATH,2,3999.713,3411.761,84.47887,0,0,0,100,0), +(@PATH,3,3992.017,3414.793,83.10387,0,0,0,100,0), +(@PATH,4,3980.25,3399.608,80.96669,0,0,0,100,0), +(@PATH,5,3973.198,3392.127,81.21669,0,0,0,100,0), +(@PATH,6,3981.25,3389.583,83.71669,0,0,0,100,0), +(@PATH,7,3988.71,3389.023,84.59169,0,0,0,100,0); + +-- Pathing for En'kilah Crypt Fiend Entry: 25386 +SET @NPC := 100008; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=3961.064,`position_y`=3422.165,`position_z`=80.91746 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3958.62,3407.545,80.91746,0,0,0,100,0), +(@PATH,2,3959.292,3391.561,82.09169,0,0,0,100,0), +(@PATH,3,3959.987,3394.481,81.09169,0,0,0,100,0), +(@PATH,4,3961.145,3408.606,80.91746,0,0,0,100,0), +(@PATH,5,3963.867,3424.426,80.91746,0,0,0,100,0), +(@PATH,6,3961.064,3422.165,80.91746,0,0,0,100,0); + +-- Pathing for En'kilah Crypt Fiend Entry: 25386 +SET @NPC := 100011; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=3973.765,`position_y`=3685.582,`position_z`=63.20702 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3985.953,3658.16,62.64196,0,0,0,100,0), +(@PATH,2,3981.12,3655.121,62.51696,0,0,0,100,0), +(@PATH,3,3975.807,3676.29,63.20702,0,0,0,100,0), +(@PATH,4,3968.138,3708.388,63.14015,0,0,0,100,0), +(@PATH,5,3973.765,3685.582,63.20702,0,0,0,100,0); + +-- Pathing for En'kilah Crypt Fiend Entry: 25386 +SET @NPC := 99860; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=3736.829,`position_y`=3590.097,`position_z`=47.62042 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3740.556,3611.562,49.59578,0,0,0,100,0), +(@PATH,2,3743.815,3598.767,46.74542,0,0,0,100,0), +(@PATH,3,3750.231,3578.953,46.87042,0,0,0,100,0), +(@PATH,4,3744.763,3577.349,46.87042,0,0,0,100,0), +(@PATH,5,3736.829,3590.097,47.62042,0,0,0,100,0); + +-- Pathing for En'kilah Crypt Fiend Entry: 25386 +SET @NPC := 99861; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=3781.2,`position_y`=3555.762,`position_z`=47.13174 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3781.763,3556.428,47.13174,0,0,0,100,0), +(@PATH,2,3784.81,3570.215,46.82142,0,0,0,100,0), +(@PATH,3,3784.099,3579.592,48.19642,0,0,0,100,0), +(@PATH,4,3784.9,3578.852,48.32142,0,0,0,100,0), +(@PATH,5,3784.858,3565.897,46.63174,0,0,0,100,0), +(@PATH,6,3781.2,3555.762,47.13174,0,0,0,100,0); + +-- Pathing for En'kilah Crypt Fiend Entry: 25386 +SET @NPC := 99873; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=3795.21,`position_y`=3453.815,`position_z`=82.97263 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3789.819,3445.883,82.97262,0,0,0,100,0), +(@PATH,2,3785.635,3440.609,82.97261,0,0,0,100,0), +(@PATH,3,3780.893,3429.421,82.9726,0,0,0,100,0), +(@PATH,4,3785.635,3440.609,82.97261,0,0,0,100,0), +(@PATH,5,3789.819,3445.883,82.97262,0,0,0,100,0), +(@PATH,6,3795.21,3453.815,82.97263,0,0,0,100,0); + +-- Pathing for En'kilah Crypt Fiend Entry: 25386 +SET @NPC := 99871; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=3812.432,`position_y`=3443.979,`position_z`=82.97263 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3808.239,3432.998,82.97262,0,0,0,100,0), +(@PATH,2,3805.263,3425.894,82.97261,0,0,0,100,0), +(@PATH,3,3808.239,3432.998,82.97262,0,0,0,100,0), +(@PATH,4,3812.432,3443.979,82.97263,0,0,0,100,0); + +-- Remove 2 over spawns +DELETE FROM `creature` WHERE `guid` IN (99859,99858); +DELETE FROM `creature_addon` WHERE `guid` IN (99859,99858); + diff --git a/sql/updates/world/2011_03_17_01_world_sai.sql b/sql/updates/world/2011_03_17_01_world_sai.sql new file mode 100644 index 0000000000000..27a22d14aa81d --- /dev/null +++ b/sql/updates/world/2011_03_17_01_world_sai.sql @@ -0,0 +1,118 @@ +-- Pathing for Darkfallen Deathblade Entry: 26103 +SET @NPC := 119232; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=3657.896,`position_y`=3592.591,`position_z`=371.479 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3665.972,3599.461,371.4846,0,0,0,100,0), +(@PATH,2,3682.637,3610.097,371.4544,0,0,0,100,0), +(@PATH,3,3696.372,3619.76,371.3447,0,0,0,100,0), +(@PATH,4,3682.637,3610.097,371.4544,0,0,0,100,0), +(@PATH,5,3665.972,3599.461,371.4846,0,0,0,100,0), +(@PATH,6,3657.896,3592.591,371.479,0,0,0,100,0), +(@PATH,7,3651.491,3585.525,371.674,0,0,0,100,0), +(@PATH,8,3651.062,3578.088,371.551,0,0,0,100,0), +(@PATH,9,3656.478,3568.307,371.4457,0,0,0,100,0), +(@PATH,10,3665.993,3555.432,371.3665,0,0,0,100,0), +(@PATH,11,3656.478,3568.307,371.4457,0,0,0,100,0), +(@PATH,12,3651.062,3578.088,371.551,0,0,0,100,0), +(@PATH,13,3651.473,3585.204,371.6653,0,0,0,100,0), +(@PATH,14,3657.896,3592.591,371.479,0,0,0,100,0); + +-- Pathing for Darkfallen Deathblade Entry: 26103 +SET @NPC := 119253; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=3742.794,`position_y`=3604.008,`position_z`=346.2505 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3728.665,3600.99,345.8076,0,0,0,100,0), +(@PATH,2,3716.573,3595.571,346.0472,0,0,0,100,0), +(@PATH,3,3709.646,3587.291,345.7931,0,0,0,100,0), +(@PATH,4,3705.439,3578.289,345.9121,0,0,0,100,0), +(@PATH,5,3703.899,3570.889,345.8815,0,0,0,100,0), +(@PATH,6,3704.667,3561.633,345.6407,0,0,0,100,0), +(@PATH,7,3706.808,3553.582,345.8144,0,0,0,100,0), +(@PATH,8,3712.931,3543.78,345.7907,0,0,0,100,0), +(@PATH,9,3718.246,3537.947,345.8893,0,0,0,100,0), +(@PATH,10,3729.692,3532.638,345.8766,0,0,0,100,0), +(@PATH,11,3741.682,3531.879,345.7675,0,0,0,100,0), +(@PATH,12,3752.107,3533.592,345.952,0,0,0,100,0), +(@PATH,13,3762.405,3538.37,346.1658,0,0,0,100,0), +(@PATH,14,3772.811,3550.474,346.3304,0,0,0,100,0), +(@PATH,15,3776.353,3563.746,346.2406,0,0,0,100,0), +(@PATH,16,3774.419,3578.473,346.1627,0,0,0,100,0), +(@PATH,17,3768.748,3590.277,346.2671,0,0,0,100,0), +(@PATH,18,3755.322,3600.473,346.2415,0,0,0,100,0), +(@PATH,19,3742.794,3604.008,346.2505,0,0,0,100,0); + +-- Pathing for Darkfallen Deathblade Entry: 26103 +SET @NPC := 119306; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=3825.312,`position_y`=3561.968,`position_z`=371.449 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3828.243,3550.227,371.6633,0,0,0,100,0), +(@PATH,2,3821.141,3538.786,371.4709,0,0,0,100,0), +(@PATH,3,3810.434,3533.297,371.4811,0,0,0,100,0), +(@PATH,4,3797.684,3527.717,371.4747,0,0,0,100,0), +(@PATH,5,3788.295,3523.66,371.5133,0,0,0,100,0), +(@PATH,6,3797.684,3527.717,371.4747,0,0,0,100,0), +(@PATH,7,3810.434,3533.297,371.4811,0,0,0,100,0), +(@PATH,8,3821.141,3538.786,371.4709,0,0,0,100,0), +(@PATH,9,3828.243,3550.227,371.6633,0,0,0,100,0), +(@PATH,10,3825.312,3561.968,371.449,0,0,0,100,0), +(@PATH,11,3818.058,3572.063,371.4479,0,0,0,100,0), +(@PATH,12,3825.312,3561.968,371.449,0,0,0,100,0); + +-- Pathing for Darkfallen Deathblade Entry: 26103 +SET @NPC := 119344; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=3719.171,`position_y`=3634.032,`position_z`=371.4312 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3728.891,3640.265,371.399,0,0,0,100,0), +(@PATH,2,3744.495,3650.741,371.4715,0,0,0,100,0), +(@PATH,3,3754.314,3654.938,371.6409,0,0,0,100,0), +(@PATH,4,3762.468,3653.046,371.6256,0,0,0,100,0), +(@PATH,5,3769.032,3645.54,371.4821,0,0,0,100,0), +(@PATH,6,3779.281,3629.354,371.3682,0,0,0,100,0), +(@PATH,7,3769.032,3645.54,371.4821,0,0,0,100,0), +(@PATH,8,3762.468,3653.046,371.6256,0,0,0,100,0), +(@PATH,9,3754.314,3654.938,371.6409,0,0,0,100,0), +(@PATH,10,3744.495,3650.741,371.4715,0,0,0,100,0), +(@PATH,11,3728.891,3640.265,371.399,0,0,0,100,0), +(@PATH,12,3719.171,3634.032,371.4312,0,0,0,100,0), +(@PATH,13,3706.394,3625.895,371.3447,0,0,0,100,0), +(@PATH,14,3719.171,3634.032,371.4312,0,0,0,100,0); + +-- Pathing for Darkfallen Deathblade Entry: 26103 +SET @NPC := 119346; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=3757.834,`position_y`=3500.429,`position_z`=371.4323 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3744.604,3489.214,371.4503,0,0,0,100,0), +(@PATH,2,3731.337,3479.792,371.4355,0,0,0,100,0), +(@PATH,3,3724.038,3478.357,371.6531,0,0,0,100,0), +(@PATH,4,3716.938,3479.223,371.649,0,0,0,100,0), +(@PATH,5,3709.829,3487.23,371.4689,0,0,0,100,0), +(@PATH,6,3699.577,3504.449,371.358,0,0,0,100,0), +(@PATH,7,3709.829,3487.23,371.4689,0,0,0,100,0), +(@PATH,8,3716.938,3479.223,371.649,0,0,0,100,0), +(@PATH,9,3724.038,3478.357,371.6531,0,0,0,100,0), +(@PATH,10,3731.337,3479.792,371.4355,0,0,0,100,0), +(@PATH,11,3744.604,3489.214,371.4503,0,0,0,100,0), +(@PATH,12,3757.834,3500.429,371.4323,0,0,0,100,0), +(@PATH,13,3769.854,3508.61,371.3447,0,0,0,100,0), +(@PATH,14,3757.834,3500.429,371.4323,0,0,0,100,0); + diff --git a/sql/updates/world/2011_03_17_02_world_sai.sql b/sql/updates/world/2011_03_17_02_world_sai.sql new file mode 100644 index 0000000000000..19b4b7e4ea094 --- /dev/null +++ b/sql/updates/world/2011_03_17_02_world_sai.sql @@ -0,0 +1,78 @@ +-- Pathing for Fizzcrank Airman Entry: 26601 +SET @NPC := 117944; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=4120.091,`position_y`=5343.777,`position_z`=29.24856 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,4111.694,5334.971,28.74856,0,0,0,100,0), +(@PATH,2,4102.274,5325.254,28.6343,0,0,0,100,0), +(@PATH,3,4091.229,5314.824,29.10337,0,0,0,100,0), +(@PATH,4,4083.519,5306.313,28.47837,0,0,0,100,0), +(@PATH,5,4072.305,5295.377,28.82582,0,0,0,100,0), +(@PATH,6,4083.519,5306.313,28.47837,0,0,0,100,0), +(@PATH,7,4091.229,5314.824,29.10337,0,0,0,100,0), +(@PATH,8,4102.274,5325.254,28.6343,0,0,0,100,0), +(@PATH,9,4111.694,5334.971,28.74856,0,0,0,100,0), +(@PATH,10,4120.091,5343.777,29.24856,0,0,0,100,0); + +-- Pathing for Fizzcrank Airman Entry: 26601 +SET @NPC := 117922; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=4171.854,`position_y`=5364.676,`position_z`=29.09072 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,4162.717,5358.622,28.71572,0,0,0,100,0), +(@PATH,2,4171.854,5364.676,29.09072,0,0,0,100,0), +(@PATH,3,4175.919,5373.461,28.73422,0,0,0,100,0), +(@PATH,4,4180.79,5375.921,28.85922,0,0,0,100,0), +(@PATH,5,4189.647,5383.252,28.98422,0,0,0,100,0), +(@PATH,6,4196.353,5389.414,28.98422,0,0,0,100,0), +(@PATH,7,4205.784,5399.744,29.17458,0,0,0,100,0), +(@PATH,8,4175.919,5373.461,28.73422,0,0,0,100,0), +(@PATH,9,4171.854,5364.676,29.09072,0,0,0,100,0); + +-- Pathing for Fizzcrank Airman Entry: 26601 +SET @NPC := 117952; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=4114.012,`position_y`=5310.07,`position_z`=28.7593 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,4114.952,5312.266,28.7593,0,0,0,100,0), +(@PATH,2,4120.03,5314.749,28.8843,0,0,0,100,0), +(@PATH,3,4128.648,5324.809,28.7593,0,0,0,100,0), +(@PATH,4,4132.928,5329.057,28.7593,0,0,0,100,0), +(@PATH,5,4129.167,5323.958,28.7593,0,0,0,100,0), +(@PATH,6,4120.03,5314.749,28.8843,0,0,0,100,0), +(@PATH,7,4114.952,5312.266,28.7593,0,0,0,100,0), +(@PATH,8,4114.012,5310.07,28.7593,0,0,0,100,0), +(@PATH,9,4110.154,5305.583,28.7593,0,0,0,100,0), +(@PATH,10,4106.395,5299.221,29.22841,0,0,0,100,0), +(@PATH,11,4098.468,5291.356,29.32582,0,0,0,100,0), +(@PATH,12,4087.384,5281.144,29.20082,0,0,0,100,0), +(@PATH,13,4098.468,5291.356,29.32582,0,0,0,100,0), +(@PATH,14,4106.395,5299.221,29.22841,0,0,0,100,0), +(@PATH,15,4110.154,5305.583,28.7593,0,0,0,100,0), +(@PATH,16,4114.012,5310.07,28.7593,0,0,0,100,0); + +-- Pathing for Fizzcrank Airman Entry: 26601 +SET @NPC := 117951; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=4156.205,`position_y`=5379.297,`position_z`=28.60338 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,4145.584,5368.483,28.97838,0,0,0,100,0), +(@PATH,2,4137.288,5361.018,28.96572,0,0,0,100,0), +(@PATH,3,4145.584,5368.483,28.97838,0,0,0,100,0), +(@PATH,4,4156.205,5379.297,28.60338,0,0,0,100,0), +(@PATH,5,4165.664,5389.022,28.97838,0,0,0,100,0), +(@PATH,6,4175.249,5398.305,29.10922,0,0,0,100,0), +(@PATH,7,4165.664,5389.022,28.97838,0,0,0,100,0), +(@PATH,8,4156.205,5379.297,28.60338,0,0,0,100,0); diff --git a/sql/updates/world/2011_03_17_03_world_creature_template.sql b/sql/updates/world/2011_03_17_03_world_creature_template.sql new file mode 100644 index 0000000000000..6190390b4c628 --- /dev/null +++ b/sql/updates/world/2011_03_17_03_world_creature_template.sql @@ -0,0 +1,44 @@ +-- Razaani Light Orb Fixup +SET @ENTRY := 20635; -- NPC entry +UPDATE `creature` SET `modelid`=0 WHERE `id`=@ENTRY; +UPDATE `creature_template` SET `InhabitType`=7 WHERE `entry`=@ENTRY; +-- Blade's Edge - Orb Trigger 01 Fixup and set as trigger +SET @ENTRY := 20666; -- NPC entry +UPDATE `creature` SET `modelid`=0,`spawndist`=0,`MovementType`=0 WHERE `id`=@ENTRY; +UPDATE `creature_template` SET `InhabitType`=7,`flags_extra`=`flags_extra`|128 WHERE `entry`=@ENTRY; +-- Blade's Edge - Flesh Beast Zap Trigger Fixup and set as trigger +SET @ENTRY := 20670; -- NPC entry +UPDATE `creature` SET `modelid`=0,`spawndist`=0,`MovementType`=0 WHERE `id`=@ENTRY; +UPDATE `creature_template` SET `InhabitType`=7,`flags_extra`=`flags_extra`|128 WHERE `entry`=@ENTRY; +-- Razaani Light Orb - Mini Fixup and set as trigger +SET @ENTRY := 20771; -- NPC entry +UPDATE `creature` SET `modelid`=0,`spawndist`=0,`MovementType`=0 WHERE `id`=@ENTRY; +UPDATE `creature_template` SET `InhabitType`=7,`flags_extra`=`flags_extra`|128 WHERE `entry`=@ENTRY; +-- Blade's Edge - Deadsoul Orb Fixup and set as trigger +SET @ENTRY := 20845; -- NPC entry +UPDATE `creature` SET `modelid`=0,`spawndist`=0,`MovementType`=0 WHERE `id`=@ENTRY; +UPDATE `creature_template` SET `InhabitType`=7,`flags_extra`=`flags_extra`|128 WHERE `entry`=@ENTRY; +-- Blade's Edge - Deadsoul Orb Flight 01 Fixup and set as trigger +SET @ENTRY := 20851; -- NPC entry +UPDATE `creature` SET `modelid`=0,`spawndist`=0,`MovementType`=0 WHERE `id`=@ENTRY; +UPDATE `creature_template` SET `InhabitType`=7,`flags_extra`=`flags_extra`|128 WHERE `entry`=@ENTRY; +-- Blade's Edge - Deadsoul Orb Flight 02 Fixup and set as trigger +SET @ENTRY := 20852; -- NPC entry +UPDATE `creature` SET `modelid`=0,`spawndist`=0,`MovementType`=0 WHERE `id`=@ENTRY; +UPDATE `creature_template` SET `InhabitType`=7,`flags_extra`=`flags_extra`|128 WHERE `entry`=@ENTRY; +-- Blade's Edge - Deadsoul Orb Flight 03 Fixup and set as trigger +SET @ENTRY := 20853; -- NPC entry +UPDATE `creature` SET `modelid`=0,`spawndist`=0,`MovementType`=0 WHERE `id`=@ENTRY; +UPDATE `creature_template` SET `InhabitType`=7,`flags_extra`=`flags_extra`|128 WHERE `entry`=@ENTRY; +-- Blade's Edge - Deadsoul Orb Flight 04 Fixup and set as trigger +SET @ENTRY := 20855; -- NPC entry +UPDATE `creature` SET `modelid`=0,`spawndist`=0,`MovementType`=0 WHERE `id`=@ENTRY; +UPDATE `creature_template` SET `InhabitType`=7,`flags_extra`=`flags_extra`|128 WHERE `entry`=@ENTRY; +-- Blade's Edge - Deadsoul Orb Flight 05 Fixup and set as trigger +SET @ENTRY := 20856; -- NPC entry +UPDATE `creature` SET `modelid`=0,`spawndist`=0,`MovementType`=0 WHERE `id`=@ENTRY; +UPDATE `creature_template` SET `InhabitType`=7,`flags_extra`=`flags_extra`|128 WHERE `entry`=@ENTRY; +-- Blade's Edge - Nexus Prince Event - Orb01 Fixup and set as trigger +SET @ENTRY := 21025; -- NPC entry +UPDATE `creature` SET `modelid`=0,`spawndist`=0,`MovementType`=0 WHERE `id`=@ENTRY; +UPDATE `creature_template` SET `InhabitType`=7,`flags_extra`=`flags_extra`|128 WHERE `entry`=@ENTRY; diff --git a/sql/updates/world/2011_03_17_04_world_sai.sql b/sql/updates/world/2011_03_17_04_world_sai.sql new file mode 100644 index 0000000000000..8494c2c2649f1 --- /dev/null +++ b/sql/updates/world/2011_03_17_04_world_sai.sql @@ -0,0 +1,19 @@ +-- Lost Drakkari Spirit SAI +SET @ENTRY := 29129; +SET @AURA := 17327; +SET @SPELL1 := 37361; +SET @SPELL2 := 24050; +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,23,0,100,0,@AURA,0,2000,2000,11,@AURA,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Lost Drakkari Spirit - Aura Spirit Particles not present - Add Aura Spirit Particles'), +(@ENTRY,0,1,2,4,0,100,1,0,0,0,0,21,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Lost Drakkari Spirit - On Aggro - Prevent Combat Movement'), +(@ENTRY,0,2,0,61,0,100,0,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Lost Drakkari Spirit - On Aggro - Set Phase 1'), +(@ENTRY,0,3,0,0,1,100,0,0,0,1000,1000,11,@SPELL1,1,0,0,0,0,2,0,0,0,0,0,0,0,'Lost Drakkari Spirit - Combat - Cast Arcane Bolt (Phase 1)'), +(@ENTRY,0,4,5,3,1,100,0,15,0,0,0,21,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Lost Drakkari Spirit - Mana at 15% - Allow combat movement (Phase 1)'), +(@ENTRY,0,5,0,61,1,100,0,0,0,0,0,22,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Lost Drakkari Spirit - Mana at 15% - Set phase 2 (Phase 1)'), +(@ENTRY,0,6,0,9,1,100,0,35,80,0,0,21,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Lost Drakkari Spirit - At 35 yards - Allow combat movement (Phase 1)'), +(@ENTRY,0,7,0,9,1,100,0,0,15,0,0,21,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Lost Drakkari Spirit - Below 15 yards - Prevent combat movement (Phase 1)'), +(@ENTRY,0,8,0,3,2,100,0,100,30,100,100,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Lost Drakkari Spirit - Mana above 30% - Set phase 1 (Phase 2)'), +(@ENTRY,0,9,0,0,0,100,0,10000,16000,15000,18000,11,@SPELL2,1,0,0,0,0,2,0,0,0,0,0,0,0,'Lost Drakkari Spirit - Combat - Cast Spirit Burst'); diff --git a/sql/updates/world/2011_03_17_05_world_sai.sql b/sql/updates/world/2011_03_17_05_world_sai.sql new file mode 100644 index 0000000000000..7da7c189fe19b --- /dev/null +++ b/sql/updates/world/2011_03_17_05_world_sai.sql @@ -0,0 +1,29 @@ +-- Frozen Earth SAI +SET @ENTRY := 28411; -- NPC entry +SET @TARGET := 23837; -- ELM General Porpose Bunny +SET @SPELL1 := 54532; -- Ice Spike +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@ENTRY,-119784,-119944,-119945,-119947,-119949,-119951,-119968,-119991); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,0,0,100,0,1000,4000,10000,17000,11,@SPELL1,0,0,0,0,0,2,0,0,0,0,0,0,0,'Frozen Earth - Combat - Cast Ice Spike on victim'), +(-119784,0,0,0,1,0,100,0,1000,4000,4000,7000,11,51590,2,0,0,0,0,11,@TARGET,120,0,0,0,0,0,'Frozen Earth - OOC - Cast Toss Ice Boulder'), +(-119784,0,1,0,0,0,100,0,1000,4000,10000,17000,11,@SPELL1,0,0,0,0,0,2,0,0,0,0,0,0,0,'Frozen Earth - Combat - Cast Ice Spike on victim'), +(-119944,0,0,0,1,0,100,0,1000,4000,4000,7000,11,51590,2,0,0,0,0,11,@TARGET,120,0,0,0,0,0,'Frozen Earth - OOC - Cast Toss Ice Boulder'), +(-119944,0,1,0,0,0,100,0,1000,4000,10000,17000,11,@SPELL1,0,0,0,0,0,2,0,0,0,0,0,0,0,'Frozen Earth - Combat - Cast Ice Spike on victim'), +(-119945,0,0,0,1,0,100,0,1000,4000,4000,7000,11,51590,2,0,0,0,0,11,@TARGET,120,0,0,0,0,0,'Frozen Earth - OOC - Cast Toss Ice Boulder'), +(-119945,0,1,0,0,0,100,0,1000,4000,10000,17000,11,@SPELL1,0,0,0,0,0,2,0,0,0,0,0,0,0,'Frozen Earth - Combat - Cast Ice Spike on victim'), +(-119947,0,0,0,1,0,100,0,1000,4000,4000,7000,11,51590,2,0,0,0,0,11,@TARGET,120,0,0,0,0,0,'Frozen Earth - OOC - Cast Toss Ice Boulder'), +(-119947,0,1,0,0,0,100,0,1000,4000,10000,17000,11,@SPELL1,0,0,0,0,0,2,0,0,0,0,0,0,0,'Frozen Earth - Combat - Cast Ice Spike on victim'), +(-119949,0,0,0,1,0,100,0,1000,4000,4000,7000,11,51590,2,0,0,0,0,11,@TARGET,120,0,0,0,0,0,'Frozen Earth - OOC - Cast Toss Ice Boulder'), +(-119949,0,1,0,0,0,100,0,1000,4000,10000,17000,11,@SPELL1,0,0,0,0,0,2,0,0,0,0,0,0,0,'Frozen Earth - Combat - Cast Ice Spike on victim'), +(-119951,0,0,0,1,0,100,0,1000,4000,4000,7000,11,51590,2,0,0,0,0,11,@TARGET,120,0,0,0,0,0,'Frozen Earth - OOC - Cast Toss Ice Boulder'), +(-119951,0,1,0,0,0,100,0,1000,4000,10000,17000,11,@SPELL1,0,0,0,0,0,2,0,0,0,0,0,0,0,'Frozen Earth - Combat - Cast Ice Spike on victim'), +(-119968,0,0,0,1,0,100,0,1000,4000,4000,7000,11,51590,2,0,0,0,0,11,@TARGET,120,0,0,0,0,0,'Frozen Earth - OOC - Cast Toss Ice Boulder'), +(-119968,0,1,0,0,0,100,0,1000,4000,10000,17000,11,@SPELL1,0,0,0,0,0,2,0,0,0,0,0,0,0,'Frozen Earth - Combat - Cast Ice Spike on victim'), +(-119991,0,0,0,1,0,100,0,1000,4000,4000,7000,11,51590,2,0,0,0,0,11,@TARGET,120,0,0,0,0,0,'Frozen Earth - OOC - Cast Toss Ice Boulder'), +(-119991,0,1,0,0,0,100,0,1000,4000,10000,17000,11,@SPELL1,0,0,0,0,0,2,0,0,0,0,0,0,0,'Frozen Earth - Combat - Cast Ice Spike on victim'); +-- Fix Spell condition for Spell 51590 to only target ELM General Porpose Bunny +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=51590; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(13,0,51590,0,18,1,23837,0,0,'','Spell 51590 targets only ELM General Porpose Bunny'); diff --git a/sql/updates/world/2011_03_17_06_world_sai.sql b/sql/updates/world/2011_03_17_06_world_sai.sql new file mode 100644 index 0000000000000..f7eec6ea0c15f --- /dev/null +++ b/sql/updates/world/2011_03_17_06_world_sai.sql @@ -0,0 +1,8 @@ +-- Legion Fel Cannon SAI +SET @ENTRY := 21233; +SET @SPELL1 := 36238; -- Fel Cannon Blast +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,1,0,100,1,1000,1000,1000,1000,21,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Legion Fel Cannon - OOC - Prevent Combat Movement'), +(@ENTRY,0,1,0,0,0,100,0,0,1000,2500,2500,11,@SPELL1,1,0,0,0,0,2,0,0,0,0,0,0,0,'Legion Fel Cannon - Combat - Cast Fel Cannon Blast'); diff --git a/sql/updates/world/2011_03_17_07_world_sai.sql b/sql/updates/world/2011_03_17_07_world_sai.sql new file mode 100644 index 0000000000000..9d1ea279ebded --- /dev/null +++ b/sql/updates/world/2011_03_17_07_world_sai.sql @@ -0,0 +1,8 @@ +-- Fel Cannon MKI SAI +SET @ENTRY := 22461; +SET @SPELL1 := 36238; -- Fel Cannon Blast +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,1,0,100,1,1000,1000,1000,1000,21,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Fel Cannon MKI - OOC - Prevent Combat Movement'), +(@ENTRY,0,1,0,0,0,100,0,0,1000,2500,2500,11,@SPELL1,1,0,0,0,0,2,0,0,0,0,0,0,0,'Fel Cannon MKI - Combat - Cast Fel Cannon Blast'); diff --git a/sql/updates/world/2011_03_17_08_world_sai.sql b/sql/updates/world/2011_03_17_08_world_sai.sql new file mode 100644 index 0000000000000..03fa5a829a858 --- /dev/null +++ b/sql/updates/world/2011_03_17_08_world_sai.sql @@ -0,0 +1,11 @@ +-- High Priest Andorath SAI +SET @ENTRY := 25392; +SET @CHANNEL := 45491; -- Necrotic Purple Beam +SET @TARGET := 25534; -- En'kilah Blood Globe +UPDATE `creature_template` SET `speed_run`=1,`AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid`=@ENTRY*100; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,1,0,100,0,2000,6000,32000,32000,80,@ENTRY*100,0,0,0,0,0,1,0,0,0,0,0,0,0,'High Priest Andorath - OOC - Run Script every 32 sec'), +(@ENTRY*100,9,0,0,0,0,100,0,0,0,0,0,11,@CHANNEL,0,0,0,0,0,11,@TARGET,20,0,0,0,0,0, 'High Priest Andorath - script - Channel spell'), +(@ENTRY*100,9,1,0,0,0,100,0,23000,23000,0,0,92,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'High Priest Andorath - script - Stop Channeling'); diff --git a/sql/updates/world/2011_03_17_09_world_sai.sql b/sql/updates/world/2011_03_17_09_world_sai.sql new file mode 100644 index 0000000000000..62e5f4c1f6483 --- /dev/null +++ b/sql/updates/world/2011_03_17_09_world_sai.sql @@ -0,0 +1,7 @@ +-- Add aura to Zul'Drak Gateway Trigger if aura not present +SET @ENTRY := 28181; +SET @SPELL := 50795; +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,23,0,100,0,@SPELL,0,2000,2000,11,@SPELL,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Zul''Drak Gateway Trigger - Aura Zul''Drak Gateway not present - Add Aura Zul''Drak Gateway'); diff --git a/sql/updates/world/2011_03_17_10_world_sai.sql b/sql/updates/world/2011_03_17_10_world_sai.sql new file mode 100644 index 0000000000000..6979ddb472d67 --- /dev/null +++ b/sql/updates/world/2011_03_17_10_world_sai.sql @@ -0,0 +1,24 @@ +-- SAI for Nethermine Burster +SET @ENTRY := 23285; +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +UPDATE `creature` SET `spawndist`=20,`MovementType`=1 WHERE `id`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,1,1,0,100,1,0,0,0,0,11,29147,0,0,0,0,0,1,0,0,0,0,0,0,0,'Nethermine Burster - OOC - Cast Submerge Visual'), +(@ENTRY,0,1,0,61,0,100,1,0,0,0,0,18,33554434,0,0,0,0,0,1,0,0,0,0,0,0,0,'Nethermine Burster - OOC - Set Unselectable and Unattackable Flags'), +(@ENTRY,0,2,3,0,0,100,1,0,0,0,0,28,29147,0,0,0,0,0,1,0,0,0,0,0,0,0,'Nethermine Burster - On Aggro - Remove Submerge Visual'), +(@ENTRY,0,3,4,61,0,100,0,0,0,0,0,19,33554434,0,0,0,0,0,1,0,0,0,0,0,0,0,'Nethermine Burster - On Aggro - Remove Unselectable and Unattackable Flags'), +(@ENTRY,0,4,5,61,0,100,0,0,0,0,0,21,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Nethermine Burster - On Aggro - Prevent Combat Movement'), +(@ENTRY,0,5,0,61,0,100,0,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Nethermine Burster - On Aggro - Set Phase 1'), +(@ENTRY,0,6,7,0,1,100,0,1000,1000,2100,4500,11,31747,1,0,0,0,0,2,0,0,0,0,0,0,0,'Nethermine Burster - Combat - Cast Poison (Phase 1)'), +(@ENTRY,0,7,0,61,1,100,0,0,0,0,0,21,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Nethermine Burster - Combat - Prevent Combat Movement (Phase 1)'), +(@ENTRY,0,8,0,0,1,100,0,20400,20400,45000,50000,11,32738,1,0,0,0,0,2,0,0,0,0,0,0,0,'Nethermine Burster - Combat - Cast Bore (Phase 1)'), +(@ENTRY,0,9,10,9,1,100,0,20,60,0,0,11,29147,0,0,0,0,0,1,0,0,0,0,0,0,0,'Nethermine Burster - At 20 - 60 Yards Range - Cast Submerge Visual (Phase 1)'), +(@ENTRY,0,10,11,61,1,100,0,0,0,0,0,21,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Nethermine Burster - At 20 - 60 Yards Range - Allow Combat Movement (Phase 1)'), +(@ENTRY,0,11,0,61,1,100,0,0,0,0,0,22,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Nethermine Burster - At 20 - 60 Yards Range - Set Phase 2 (Phase 1)'), +(@ENTRY,0,12,13,9,2,100,0,0,8,0,0,28,29147,0,0,0,0,0,1,0,0,0,0,0,0,0,'Nethermine Burster - At 0 - 8 Yards - Remove Submerge Visual (Phase 2)'), +(@ENTRY,0,13,14,61,2,100,0,0,0,0,0,21,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Nethermine Burster - Combat - Prevent Combat Movement (Phase 2)'), +(@ENTRY,0,14,15,61,2,100,0,0,8,0,0,19,33554434,0,0,0,0,0,1,0,0,0,0,0,0,0,'Nethermine Burster - At 0 - 8 Yards - Remove Unselectable and Unattackable Flags (Phase 2)'), +(@ENTRY,0,15,0,61,2,100,0,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Nethermine Burster - At 20 - 60 Yards Range - Set Phase 1 (Phase 2)'), +(@ENTRY,0,16,0,2,0,100,1,0,10,0,0,11,32714,3,0,0,0,0,1,0,0,0,0,0,0,0,'Nethermine Burster - Health level - Cast Enrage self'); diff --git a/sql/updates/world/2011_03_18_00_world_game_event_misc.sql b/sql/updates/world/2011_03_18_00_world_game_event_misc.sql new file mode 100644 index 0000000000000..3856bb0c3db65 --- /dev/null +++ b/sql/updates/world/2011_03_18_00_world_game_event_misc.sql @@ -0,0 +1,93 @@ +-- Create temporary table that holds the entry conversion data. (Generating numbers by index and autoincrement is not used because +-- we need the same numbers to update the characters db and need to do that without cross db queries +CREATE TABLE `game_event_temp` ( + `entryOld` TINYINT(3) UNSIGNED NOT NULL, + `entryNew` TINYINT(3) UNSIGNED NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- Renumbered entry data +INSERT INTO `game_event_temp` (`entryOld`,`entryNew`) VALUES +(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),(14,14),(15,15),(16,16),(17,17),(18,18),(19,19),(20,20),(21,21),(22,22), +(23,23),(26,24),(27,25),(28,26),(29,27),(30,28),(31,29),(32,30),(33,31),(34,32),(35,33),(36,34),(37,35),(38,36),(39,37),(40,38),(41,39),(42,40),(43,41),(44,42), +(45,43),(46,44),(47,45),(48,46),(49,47),(50,48),(51,49),(52,50),(53,51),(54,52),(124,53),(125,54),(126,55),(127,56),(128,57),(129,58),(130,59),(131,60); + +-- Update game_event +ALTER TABLE `game_event` DROP PRIMARY KEY; +UPDATE `game_event`, `game_event_temp` SET `game_event`.`entry` = `game_event_temp`.`entryNew` WHERE `game_event`.`entry` = `game_event_temp`.`entryOld`; +ALTER TABLE `game_event` +CHANGE `entry` `eventEntry` TINYINT(3) UNSIGNED NOT NULL COMMENT 'Entry of the game event', +ADD PRIMARY KEY (`eventEntry`); + +-- Update game_event_battleground_holiday +ALTER TABLE `game_event_battleground_holiday` DROP PRIMARY KEY; +UPDATE `game_event_battleground_holiday`, `game_event_temp` SET `game_event_battleground_holiday`.`event` = `game_event_temp`.`entryNew` WHERE `game_event_battleground_holiday`.`event` = `game_event_temp`.`entryOld`; +ALTER TABLE `game_event_battleground_holiday` +CHANGE `event` `eventEntry` TINYINT(3) UNSIGNED NOT NULL COMMENT 'Entry of the game event' FIRST, +ADD PRIMARY KEY (`eventEntry`); + +-- Update game_event_condition +ALTER TABLE `game_event_condition` DROP PRIMARY KEY; +UPDATE `game_event_condition`, `game_event_temp` SET `game_event_condition`.`event_id` = `game_event_temp`.`entryNew` WHERE `game_event_condition`.`event_id` = `game_event_temp`.`entryOld`; +ALTER TABLE `game_event_condition` +CHANGE `event_id` `eventEntry` TINYINT(3) UNSIGNED NOT NULL COMMENT 'Entry of the game event' FIRST, +ADD PRIMARY KEY (`eventEntry`, `condition_id`); + +-- Update game_event_creature +UPDATE `game_event_creature`, `game_event_temp` SET `game_event_creature`.`event` = `game_event_temp`.`entryNew` WHERE `game_event_creature`.`event` = `game_event_temp`.`entryOld`; +ALTER TABLE `game_event_creature` CHANGE `event` `eventEntry` TINYINT(3) NOT NULL COMMENT 'Entry of the game event. Put negative entry to remove during event.' FIRST; + +-- Update game_event_creature_quest +UPDATE `game_event_creature_quest`, `game_event_temp` SET `game_event_creature_quest`.`event` = `game_event_temp`.`entryNew` WHERE `game_event_creature_quest`.`event` = `game_event_temp`.`entryOld`; +ALTER TABLE `game_event_creature_quest` CHANGE `event` `eventEntry` TINYINT(3) UNSIGNED NOT NULL COMMENT 'Entry of the game event.' FIRST; + +-- Update game_event_gameobject +UPDATE `game_event_gameobject`, `game_event_temp` SET `game_event_gameobject`.`event` = `game_event_temp`.`entryNew` WHERE `game_event_gameobject`.`event` = `game_event_temp`.`entryOld`; +ALTER TABLE `game_event_gameobject` CHANGE `event` `eventEntry` TINYINT(3) NOT NULL COMMENT 'Entry of the game event. Put negative entry to remove during event.' FIRST; + +-- Update game_event_gameobject_quest +ALTER TABLE `game_event_gameobject_quest` DROP PRIMARY KEY; +UPDATE `game_event_gameobject_quest`, `game_event_temp` SET `game_event_gameobject_quest`.`event` = `game_event_temp`.`entryNew` WHERE `game_event_gameobject_quest`.`event` = `game_event_temp`.`entryOld`; +ALTER TABLE `game_event_gameobject_quest` +CHANGE `event` `eventEntry` TINYINT(3) UNSIGNED NOT NULL COMMENT 'Entry of the game event' FIRST, +ADD PRIMARY KEY (`id`, `quest`, `eventEntry`); + +-- Update game_event_model_equip +UPDATE `game_event_model_equip`, `game_event_temp` SET `game_event_model_equip`.`event` = `game_event_temp`.`entryNew` WHERE `game_event_model_equip`.`event` = `game_event_temp`.`entryOld`; +ALTER TABLE `game_event_model_equip` CHANGE `event` `eventEntry` TINYINT(3) NOT NULL COMMENT 'Entry of the game event.' FIRST; + +-- Update game_event_npc_vendor +UPDATE `game_event_npc_vendor`, `game_event_temp` SET `game_event_npc_vendor`.`event` = `game_event_temp`.`entryNew` WHERE `game_event_npc_vendor`.`event` = `game_event_temp`.`entryOld`; +ALTER TABLE `game_event_npc_vendor` CHANGE `event` `eventEntry` TINYINT(3) NOT NULL COMMENT 'Entry of the game event.' FIRST; + +-- Update game_event_npcflag +ALTER TABLE `game_event_npcflag` DROP PRIMARY KEY; +UPDATE `game_event_npcflag`, `game_event_temp` SET `game_event_npcflag`.`event_id` = `game_event_temp`.`entryNew` WHERE `game_event_npcflag`.`event_id` = `game_event_temp`.`entryOld`; +ALTER TABLE `game_event_npcflag` +CHANGE `event_id` `eventEntry` TINYINT(3) UNSIGNED NOT NULL COMMENT 'Entry of the game event' FIRST, +ADD PRIMARY KEY (`guid`, `eventEntry`); + +-- Update game_event_pool +UPDATE `game_event_pool`, `game_event_temp` SET `game_event_pool`.`event` = `game_event_temp`.`entryNew` WHERE `game_event_pool`.`event` = `game_event_temp`.`entryOld`; +ALTER TABLE `game_event_pool` CHANGE `event` `eventEntry` TINYINT(3) NOT NULL COMMENT 'Entry of the game event. Put negative entry to remove during event.' FIRST; + +-- Update game_event_prerequisite +ALTER TABLE `game_event_prerequisite` DROP PRIMARY KEY; +UPDATE `game_event_prerequisite`, `game_event_temp` SET `game_event_prerequisite`.`event_id` = `game_event_temp`.`entryNew` WHERE `game_event_prerequisite`.`event_id` = `game_event_temp`.`entryOld`; +ALTER TABLE `game_event_prerequisite` +CHANGE `event_id` `eventEntry` TINYINT(3) UNSIGNED NOT NULL COMMENT 'Entry of the game event' FIRST, +ADD PRIMARY KEY (`eventEntry`, `prerequisite_event`); + +-- Update game_event_quest_condition +UPDATE `game_event_quest_condition`, `game_event_temp` SET `game_event_quest_condition`.`event_id` = `game_event_temp`.`entryNew` WHERE `game_event_quest_condition`.`event_id` = `game_event_temp`.`entryOld`; +ALTER TABLE `game_event_quest_condition` CHANGE `event_id` `eventEntry` TINYINT(3) UNSIGNED NOT NULL COMMENT 'Entry of the game event.' FIRST; + +-- Update season_linked_event +ALTER TABLE `season_linked_event` DROP PRIMARY KEY; +UPDATE `season_linked_event`, `game_event_temp` SET `season_linked_event`.`event` = `game_event_temp`.`entryNew` WHERE `season_linked_event`.`event` = `game_event_temp`.`entryOld`; +ALTER TABLE season_linked_event +RENAME TO `game_event_arena_seasons`, +CHANGE `event` `eventEntry` TINYINT(3) UNSIGNED NOT NULL COMMENT 'Entry of the game event' FIRST, +CHANGE `season` `season` TINYINT(3) UNSIGNED NOT NULL COMMENT 'Arena season number'; + +-- Remove temporary table +DROP TABLE `game_event_temp`; diff --git a/sql/updates/world/2011_03_18_01_world_instance_pit_of_saron.sql b/sql/updates/world/2011_03_18_01_world_instance_pit_of_saron.sql new file mode 100644 index 0000000000000..64ec58fc31581 --- /dev/null +++ b/sql/updates/world/2011_03_18_01_world_instance_pit_of_saron.sql @@ -0,0 +1,39 @@ +DELETE FROM `creature_questrelation` WHERE `quest` IN (24510,24499,24498,24710,24711,24506,24511,24682,24507,24712,24713); +DELETE FROM `creature_involvedrelation` WHERE `quest` IN (24510,24499,24498,24710,24711,24506,24511,24682,24507,24712,24713); +INSERT INTO `creature_questrelation` (`id`,`quest`) VALUES +-- alliance +(37776,24510), +(37597,24499), +(38160,24683), +(36993,24498), +(37591,24710), +(38188,24711), +-- horde +(37780,24506), +(37596,24511), +(38161,24682), +(36990,24507), +(37592,24712), +(38189,24713); +INSERT INTO `creature_involvedrelation` (`id`,`quest`) VALUES +-- alliance +(37597,24510), +(38160,24499), +(36993,24683), +(37591,24498), +(38188,24710), +(37221,24711), +-- horde +(37596,24506), +(38161,24511), +(36990,24682), +(37592,24507), +(38189,24712), +(37223,24713); + +SET @GOBJ := 201969; -- ball and chain +UPDATE `gameobject_template` SET `AIName`='SmartGameObjectAI' WHERE `entry`=@GOBJ; +DELETE FROM `smart_scripts` WHERE `source_type`=1 AND `entryorguid`=@GOBJ; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@GOBJ,1,0,0,64,0,100,0,0,0,0,0,33,36764,0,0,0,0,0,7,0,0,0,0,0,0,0, 'credit on gossip hello - alliance'), +(@GOBJ,1,1,0,64,0,100,0,0,0,0,0,33,36770,0,0,0,0,0,7,0,0,0,0,0,0,0, 'credit on gossip hello - horde'); diff --git a/sql/updates/world/2011_03_18_02_world_creatures.sql b/sql/updates/world/2011_03_18_02_world_creatures.sql new file mode 100644 index 0000000000000..61eea9523860f --- /dev/null +++ b/sql/updates/world/2011_03_18_02_world_creatures.sql @@ -0,0 +1,8 @@ +SET @GUID := 137789; +DELETE FROM `creature` WHERE `guid` BETWEEN @GUID AND @GUID+4; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`DeathState`,`MovementType`,`npcflag`,`unit_flags`,`dynamicflags`) VALUES +(@GUID+0,16980,631,15,1,0,0,4203.70,2484.83,364.956,3.14159,604800,0,0,0,0,0,0,0,0,0), -- The Lich King +(@GUID+1,22515,631,15,1,0,0,4241.19,2557.49,364.952,4.72984,120,0,0,0,0,0,0,0,0,0), -- World Trigger +(@GUID+2,22515,631,15,1,0,0,4241.34,2411.52,364.952,1.57080,120,0,0,0,0,0,0,0,0,0), -- World Trigger +(@GUID+3,22515,631,10,1,0,0,4166.02,2557.49,364.952,4.72984,120,0,0,0,0,0,0,0,0,0), -- World Trigger +(@GUID+4,22515,631,10,1,0,0,4241.34,2411.52,364.952,1.57080,120,0,0,0,0,0,0,0,0,0); -- World Trigger diff --git a/sql/updates/world/2011_03_19_00_world_spell_proc_event.sql b/sql/updates/world/2011_03_19_00_world_spell_proc_event.sql new file mode 100644 index 0000000000000..a0537fd6dd6a7 --- /dev/null +++ b/sql/updates/world/2011_03_19_00_world_spell_proc_event.sql @@ -0,0 +1,7 @@ +DELETE FROM `spell_proc_event` WHERE `entry` IN (11213,12574,12575,12576,12577); +INSERT INTO `spell_proc_event` (`entry`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `procFlags`, `procEx`, `ppmRate`, `CustomChance`, `Cooldown`) VALUES +(11213,0x00,3,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0,0,0), -- Arcane Concentration (Rank 1) +(12574,0x00,3,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0,0,0), -- Arcane Concentration (Rank 2) +(12575,0x00,3,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0,0,0), -- Arcane Concentration (Rank 3) +(12576,0x00,3,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0,0,0), -- Arcane Concentration (Rank 4) +(12577,0x00,3,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0,0,0); -- Arcane Concentration (Rank 5) diff --git a/sql/updates/world/2011_03_20_00_world_game_event.sql b/sql/updates/world/2011_03_20_00_world_game_event.sql new file mode 100644 index 0000000000000..ebee67b8d36fc --- /dev/null +++ b/sql/updates/world/2011_03_20_00_world_game_event.sql @@ -0,0 +1,2 @@ +UPDATE `game_event` SET `holiday`=400 WHERE `eventEntry`=53; -- Call to Arms: Strand of the Ancients! +UPDATE `game_event` SET `holiday`=420 WHERE `eventEntry`=54; -- Call to Arms: Isle of Conquest! diff --git a/sql/updates/world/2011_03_21_00_world_sai.sql b/sql/updates/world/2011_03_21_00_world_sai.sql new file mode 100644 index 0000000000000..cddb08883afce --- /dev/null +++ b/sql/updates/world/2011_03_21_00_world_sai.sql @@ -0,0 +1,3 @@ +-- Lost Drakkari Spirit SAI fix +UPDATE `smart_scripts` SET `event_param1`=0,`event_param2`=15 WHERE `entryorguid`=29129 AND `id`=4; +UPDATE `smart_scripts` SET `event_param1`=30,`event_param2`=100 WHERE `entryorguid`=29129 AND `id`=8; diff --git a/sql/updates/world/2011_03_21_01_world_creature_template.sql b/sql/updates/world/2011_03_21_01_world_creature_template.sql new file mode 100644 index 0000000000000..628619b25f9b6 --- /dev/null +++ b/sql/updates/world/2011_03_21_01_world_creature_template.sql @@ -0,0 +1,2 @@ +UPDATE `creature_template` SET `difficulty_entry_1`=0 WHERE `entry`=37596; +DELETE FROM `creature_template` WHERE `entry`=3759601; diff --git a/sql/updates/world/2011_03_21_02_world_creature_template.sql b/sql/updates/world/2011_03_21_02_world_creature_template.sql new file mode 100644 index 0000000000000..960d96663c009 --- /dev/null +++ b/sql/updates/world/2011_03_21_02_world_creature_template.sql @@ -0,0 +1,2 @@ +-- Remove beast lore info from all creatures +UPDATE `creature_template` SET `dynamicflags`=`dynamicflags`&~16; diff --git a/sql/updates/world/2011_03_21_03_world_achievement_criteria_data.sql b/sql/updates/world/2011_03_21_03_world_achievement_criteria_data.sql new file mode 100644 index 0000000000000..2a95cb5720657 --- /dev/null +++ b/sql/updates/world/2011_03_21_03_world_achievement_criteria_data.sql @@ -0,0 +1,32 @@ +-- Fix Achievements related to Trial of the Crusader +DELETE FROM `achievement_criteria_data` WHERE `criteria_id` IN ( +11684,11685,11686,11687,11688, -- 10 Player +11679,11680,11681,11682,11683, -- 25 Player +11689,11690,11691,11692,11693, -- 10 Player +11542,11546,11547,11549,11678 -- 25 Player +) AND `type` IN (0,12); +INSERT INTO `achievement_criteria_data` (`criteria_id`, `type`, `value1`, `value2`, `ScriptName`) VALUES +-- Call of the Crusade (10 player) +(11684,12,0,0, ''), +(11685,12,0,0, ''), +(11686,12,0,0, ''), +(11687,12,0,0, ''), +(11688,12,0,0, ''), +-- Call of the Crusade (25 player) +(11679,12,1,0, ''), +(11680,12,1,0, ''), +(11681,12,1,0, ''), +(11682,12,1,0, ''), +(11683,12,1,0, ''), +-- Call of the Grand Crusade (10 player) +(11689,12,2,0, ''), +(11690,12,2,0, ''), +(11691,12,2,0, ''), +(11692,12,2,0, ''), +(11693,12,2,0, ''), +-- Call of the Grand Crusade (25 player) +(11542,12,3,0, ''), +(11546,12,3,0, ''), +(11547,12,3,0, ''), +(11549,12,3,0, ''), +(11678,12,3,0, ''); diff --git a/sql/updates/world/2011_03_21_04_world_spell_required.sql b/sql/updates/world/2011_03_21_04_world_spell_required.sql new file mode 100644 index 0000000000000..38e3a4b59a848 --- /dev/null +++ b/sql/updates/world/2011_03_21_04_world_spell_required.sql @@ -0,0 +1,3 @@ +-- Dire Bear form should require Bear Form +DELETE FROM `spell_required` WHERE `spell_id`=9634; +INSERT INTO `spell_required` (`spell_id`,`req_spell`) VALUES (9634,5487); diff --git a/sql/updates/world/2011_03_21_05_world_spell_ranks.sql b/sql/updates/world/2011_03_21_05_world_spell_ranks.sql new file mode 100644 index 0000000000000..9d39c4effd8b4 --- /dev/null +++ b/sql/updates/world/2011_03_21_05_world_spell_ranks.sql @@ -0,0 +1,6 @@ +DELETE FROM `spell_ranks` WHERE `first_spell_id` IN (5487,33943); +INSERT INTO `spell_ranks` (`first_spell_id`,`spell_id`,`rank`) VALUES +(5487,5487,1), +(5487,9634,2), +(33943,33943,1), +(33943,40120,2); diff --git a/sql/updates/world/2011_03_21_06_world_creature.sql b/sql/updates/world/2011_03_21_06_world_creature.sql new file mode 100644 index 0000000000000..22de14493b324 --- /dev/null +++ b/sql/updates/world/2011_03_21_06_world_creature.sql @@ -0,0 +1,16 @@ +SET @GUID := 95035 ; -- set guid by TDB + +-- Spawn for Rotting Frost Giant in 25 man instances +DELETE FROM `creature` WHERE `id`=38494; +INSERT INTO `creature` +(`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`DeathState`,`MovementType`,`npcflag`,`unit_flags`,`dynamicflags`) +VALUES +(@GUID,38494,631,10,1,0,0,-452.366,2354.51,191.242,0.778178,86400,0,0,1,0,0,2,0,0,0); + +-- Correct spawn mask for Rotting Frost Giant in 10 man instances (10/10 Heroic) +UPDATE `creature` SET `spawnmask`=5 WHERE `id`=38490; + +-- add a path to the creature +DELETE FROM `creature_addon` WHERE `guid`=@GUID; +INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(@GUID,2087860,0,0,0,0, ''); diff --git a/sql/updates/world/2011_03_21_07_world_spell_required.sql b/sql/updates/world/2011_03_21_07_world_spell_required.sql new file mode 100644 index 0000000000000..e76c4801dd100 --- /dev/null +++ b/sql/updates/world/2011_03_21_07_world_spell_required.sql @@ -0,0 +1 @@ +DELETE FROM `spell_required` WHERE `spell_id`=9634; diff --git a/sql/updates/world/2011_03_21_08_world_spell_required.sql b/sql/updates/world/2011_03_21_08_world_spell_required.sql new file mode 100644 index 0000000000000..1c6e207127b10 --- /dev/null +++ b/sql/updates/world/2011_03_21_08_world_spell_required.sql @@ -0,0 +1 @@ +DELETE FROM `spell_required` WHERE `spell_id`=40120; diff --git a/sql/updates/world/2011_03_22_00_world_sai.sql b/sql/updates/world/2011_03_22_00_world_sai.sql new file mode 100644 index 0000000000000..8b6ac8d9fe914 --- /dev/null +++ b/sql/updates/world/2011_03_22_00_world_sai.sql @@ -0,0 +1,22 @@ +-- Necro Overlord Mezhen SAI +SET @GUID := 95036; -- 1 Required for ELM General Purpose Bunny +SET @ENTRY := 24018; -- NPC entry +SET @CHANNEL := 43151; -- Necrolord: Purple Beam +SET @TARGET := 24021; -- ELM General Purpose Bunny (scale x0.01) +SET @SPELL1 := 32862; -- Drain Soul +SET @SPELL2 := 43559; -- Raise Dead +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,1,0,100,1,1000,1000,1000,1000,11,@CHANNEL,2,0,0,0,0,11,@TARGET,30,0,0,0,0,0, 'Necro Overlord Mezhen - On spawn & reset - Channel Necrolord: Purple Beam'); + +-- Fix Spell condition for Spell 43151 to only target ELM General Purpose Bunny (scale x0.01) +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=43151; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(13,0,43151,0,18,1,24021,0,0,'','Spell 43151 targets only ELM General Purpose Bunny (scale x0.01)'); +-- Add missing ELM General Purpose Bunny (scale x0.01) +DELETE FROM `creature` WHERE `guid`=@GUID; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`DeathState`,`MovementType`) VALUES +(@GUID,24021,571,1,1,0,0,2597.148,-3735.499,261.9468,0.2094395,120,0,0,1,0,0,0); +-- ELM General Purpose Bunny (scale x0.01) fix InhabitType +UPDATE `creature_template` SET `InhabitType`=7 WHERE entry=24021; diff --git a/sql/updates/world/2011_03_22_01_world_sai.sql b/sql/updates/world/2011_03_22_01_world_sai.sql new file mode 100644 index 0000000000000..974b24f8cbd8a --- /dev/null +++ b/sql/updates/world/2011_03_22_01_world_sai.sql @@ -0,0 +1,83 @@ +-- Add missing Invisible Stalker (Floating) +SET @GUID := 85175; -- 2 Required +DELETE FROM `creature` WHERE `guid` BETWEEN @GUID AND @GUID+1; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`DeathState`,`MovementType`) VALUES +(@GUID,23033,571,1,1,0,0,3799.331,3428.748,92.80447,3.804818,120,0,0,1,0,0,0), +(@GUID+1,23033,571,1,1,0,0,3789.681,3434.306,92.37619,4.764749,120,0,0,1,0,0,0); +-- High Priest Talet-Kha Fixup +SET @ENTRY := 26073; -- NPC entry +SET @SPELL1 := 45492; -- Shadow Nova +SET @SPELL2 := 11640; -- Renew cast once below 45% +SET @SPELL3 := 15587; -- Mind Blast cast below 45% after renew +UPDATE `creature` SET `modelid`=0,`spawndist`=0,`MovementType`=0 WHERE `id`=@ENTRY; +DELETE FROM `creature_addon` WHERE `guid`=85240; +DELETE FROM `creature_template_addon` WHERE `entry`=26073; +INSERT INTO `creature_template_addon` (`entry`,`bytes1`,`bytes2`) VALUES (26073,1,1); +-- SAI for High Priest Talet-Kha +UPDATE `creature_template` SET `speed_run`=1,`faction_H`=21,`InhabitType`=7,`AIName`= 'SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid`=@ENTRY*100; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,1,0,100,1,0,0,0,0,8,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'High Priest Talet-Kha - On spawn - Set React State civilian'), +(@ENTRY,0,1,2,1,0,100,1,1000,1000,1000,1000,70,0,0,0,0,0,0,10,85098,25422,0,0,0,0,0, 'High Priest Talet-Kha - OOC - Respawn Mystical Webbing'), +(@ENTRY,0,2,3,61,0,100,0,0,0,0,0,45,0,1,0,0,0,0,10,85098,25422,0,0,0,0,0, 'High Priest Talet-Kha - OOC - Set data Mystical Webbing'), +(@ENTRY,0,3,4,61,0,100,0,0,0,0,0,70,0,0,0,0,0,0,10,85118,25422,0,0,0,0,0, 'High Priest Talet-Kha - OOC - Respawn Mystical Webbing'), +(@ENTRY,0,4,5,61,0,100,0,0,0,0,0,45,0,1,0,0,0,0,10,85118,25422,0,0,0,0,0, 'High Priest Talet-Kha - OOC - Set data Mystical Webbing'), +(@ENTRY,0,5,6,61,0,100,0,0,0,0,0,45,0,1,0,0,0,0,10,85175,23033,0,0,0,0,0, 'High Priest Talet-Kha - OOC - Set data Invisible Stalker'), +(@ENTRY,0,6,0,61,0,100,0,0,0,0,0,45,0,1,0,0,0,0,10,85176,23033,0,0,0,0,0, 'High Priest Talet-Kha - OOC - Set data Invisible Stalker'), +(@ENTRY,0,7,0,1,0,100,0,3000,3000,3000,3000,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'High Priest Talet-Kha - OOC - Set phase 1'), +(@ENTRY,0,8,0,23,1,100,1,45497,0,0,0,80,@ENTRY*100,0,0,0,0,0,1,0,0,0,0,0,0,0, 'High Priest Talet-Kha - On Aura missing - Run Script (Phase 1)'), +(@ENTRY,0,9,10,2,1,100,0,0,45,0,0,11,11640,1,0,0,0,0,1,0,0,0,0,0,0,0, 'High Priest Talet-Kha - Health 45% - Cast Renew on self'), +(@ENTRY,0,10,0,61,1,100,0,0,0,0,0,22,2,0,0,0,0,0,1,0,0,0,0,0,0,0, 'High Priest Talet-Kha - OOC - Set phase 2'), +(@ENTRY,0,11,0,0,2,100,0,1500,1500,1500,1500,11,15587,0,0,0,0,0,2,0,0,0,0,0,0,0, 'High Priest Talet-Kha - Combat - Cast Mind Blast on victim (Phase 2)'), +(@ENTRY*100,9,0,0,0,0,100,0,3000,3000,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'High Priest Talet-Kha - script - Text 0'), +(@ENTRY*100,9,1,0,0,0,100,0,500,500,0,0,69,0,0,0,0,0,0,1,0,0,0,3788.444,3418.249,85.05618,0, 'High Priest Talet-Kha - script - Move to'), +(@ENTRY*100,9,2,0,0,0,100,0,500,500,0,0,66,0,0,0,0,0,0,1,0,0,0,0,0,0,1.1672, 'High Priest Talet-Kha - script - turn to'), +(@ENTRY*100,9,3,0,0,0,100,0,1500,1500,0,0,91,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'High Priest Talet-Kha - script - Bytes1 set to 0'), +(@ENTRY*100,9,4,0,0,0,100,0,100,100,0,0,19,33555200,0,0,0,0,0,1,0,0,0,0,0,0,0, 'High Priest Talet-Kha - script - Remove unitflags'), +(@ENTRY*100,9,5,0,0,0,100,0,100,100,0,0,8,2,0,0,0,0,0,1,0,0,0,0,0,0,0, 'High Priest Talet-Kha - script - Set React State Hostile'), +(@ENTRY*100,9,6,0,0,0,100,0,100,100,0,0,11,@SPELL1,1,0,0,0,0,1,0,0,0,0,0,0,0, 'High Priest Talet-Kha - script - Aura self'); +-- NPC talk text insert from sniff +DELETE FROM `creature_text` WHERE `entry` IN (26073); +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(26073,0,0, 'Who disturbs my meditation?!',1,7,100,15,0,0, 'High Priest Talet-Kha'); +-- SAI for Mystical Webbing +SET @ENTRY := 25422; -- NPC entry +SET @CHANNEL := 45497; -- Web Beam +SET @TARGET := 26073; -- High Priest Talet-Kha +UPDATE `creature_template` SET `faction_H`=21,`AIName`= 'SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid` IN (-85098,-85118); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(-85098,0,0,0,11,0,100,0,0,0,0,0,8,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Mystical Webbing - On spawn - Set React State civilian'), +(-85098,0,1,0,1,0,100,1,1000,1000,1000,1000,11,@CHANNEL,2,0,0,0,0,11,@TARGET,40,0,0,0,0,0, 'Mystical Webbing - On spawn & reset - Web Beam'), +(-85098,0,2,0,6,0,100,1,0,0,0,0,45,0,2,0,0,0,0,10,85176,23033,0,0,0,0,0, 'Mystical Webbing - On death - set data 0 2 Invisible Stalker'), +(-85098,0,3,4,38,0,100,0,0,1,0,0,45,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Invisible Stalker (Floating) - On dataset 0 1 - set data 0 0'), +(-85098,0,4,0,61,0,100,0,0,0,0,0,70,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Invisible Stalker (Floating) - On dataset 0 1 - reset AI'), +(-85118,0,0,0,11,0,100,0,0,0,0,0,8,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Mystical Webbing - On spawn - Set React State civilian'), +(-85118,0,1,0,1,0,100,1,1000,1000,1000,1000,11,@CHANNEL,2,0,0,0,0,11,@TARGET,40,0,0,0,0,0, 'Mystical Webbing - On spawn & reset - Web Beam'), +(-85118,0,2,0,6,0,100,1,0,0,0,0,45,0,2,0,0,0,0,10,85175,23033,0,0,0,0,0, 'Mystical Webbing - On death - set data 0 2 Invisible Stalker'), +(-85118,0,3,4,38,0,100,0,0,1,0,0,45,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Invisible Stalker (Floating) - On dataset 0 1 - set data 0 0'), +(-85118,0,4,0,61,0,100,0,0,0,0,0,70,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Invisible Stalker (Floating) - On dataset 0 1 - reset AI'); +-- SAI for Invisible Stalker (Floating) +SET @ENTRY := 23033; -- NPC entry +SET @CHANNEL := 45497; -- Web Beam +SET @TARGET := 26073; -- High Priest Talet-Kha +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid` IN (-85175,-85176); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +-- Invisible Stalker (Floating) +(-85175,0,0,0,38,0,100,0,0,1,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Invisible Stalker (Floating) - On dataset 0 1 - Set Phase 1'), +(-85175,0,1,0,38,0,100,0,0,2,0,0,22,2,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Invisible Stalker (Floating) - On dataset 0 2 - Set Phase 2'), +(-85175,0,2,3,1,1,100,0,0,0,0,0,11,@CHANNEL,2,0,0,0,0,11,@TARGET,40,0,0,0,0,0, 'Invisible Stalker (Floating) - OOC - Cast Web Beam on target (Phase 1)'), +(-85175,0,3,4,61,1,100,0,0,0,0,0,45,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Invisible Stalker (Floating) - OOC - Set data 0 0 (Phase 1)'), +(-85175,0,4,0,61,1,100,0,0,0,0,0,22,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Invisible Stalker (Floating) - OOC - Set Phase 0 (Phase 1)'), +(-85175,0,5,6,1,2,100,0,0,0,0,0,92,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Invisible Stalker (Floating) - OOC - Stop casting (Phase 2)'), +(-85175,0,6,0,61,2,100,0,0,0,0,0,22,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Invisible Stalker (Floating) - OOC - Set Phase 0 (Phase 2)'), +-- Invisible Stalker (Floating) +(-85176,0,0,0,38,0,100,0,0,1,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Invisible Stalker (Floating) - On dataset 0 1 - Set Phase 1'), +(-85176,0,1,0,38,0,100,0,0,2,0,0,22,2,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Invisible Stalker (Floating) - On dataset 0 2 - Set Phase 2'), +(-85176,0,2,3,1,1,100,0,0,0,0,0,11,@CHANNEL,2,0,0,0,0,11,@TARGET,40,0,0,0,0,0, 'Invisible Stalker (Floating) - OOC - Cast Web Beam on target (Phase 1)'), +(-85176,0,3,4,61,1,100,0,0,0,0,0,45,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Invisible Stalker (Floating) - OOC - Set data 0 0 (Phase 1)'), +(-85176,0,4,0,61,1,100,0,0,0,0,0,22,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Invisible Stalker (Floating) - OOC - Set Phase 0 (Phase 1)'), +(-85176,0,5,6,1,2,100,0,0,0,0,0,92,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Invisible Stalker (Floating) - OOC - Stop casting (Phase 2)'), +(-85176,0,6,0,61,2,100,0,0,0,0,0,22,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Invisible Stalker (Floating) - OOC - Set Phase 0 (Phase 2)'); diff --git a/sql/updates/world/2011_03_22_02_world_sai.sql b/sql/updates/world/2011_03_22_02_world_sai.sql new file mode 100644 index 0000000000000..9f01eb8358313 --- /dev/null +++ b/sql/updates/world/2011_03_22_02_world_sai.sql @@ -0,0 +1,121 @@ +-- Pathing for Stormfleet Deckhand SAI +SET @ENTRY := 25234; +SET @PATH1 := @ENTRY*100; +SET @PATH2 := @ENTRY*100+1; +SET @PATH3 := @ENTRY*100+2; +SET @PATH4 := @ENTRY*100+3; +-- Remove old waypoint data and scripts +UPDATE `creature` SET `spawndist`=0,`MovementType`=0,`position_x`=2265.704,`position_y`=5314.686,`position_z`=22.43809 WHERE `guid`=109653; +UPDATE `creature` SET `spawndist`=0,`MovementType`=0,`position_x`=2253.791,`position_y`=5252.389,`position_z`=35.69936 WHERE `guid`=109654; +UPDATE `creature` SET `spawndist`=0,`MovementType`=0,`position_x`=2220.033,`position_y`=5292.010,`position_z`=10.70095 WHERE `guid`=109652; +UPDATE `creature` SET `spawndist`=0,`MovementType`=0,`position_x`=2233.497,`position_y`=5291.667,`position_z`=11.21773 WHERE `guid`=109655; +UPDATE `creature_addon` SET `path_id`=0 WHERE `guid` IN (109653,109654,109652,109655); +DELETE FROM `waypoint_data` WHERE `id` IN (1096530,1096540,1096520,1096550); +DELETE FROM `waypoint_scripts` WHERE `id` IN (1057,1058,1059,1060,1061,1130,1131,1132,1133); +-- SAI for Stormfleet Deckhand +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid` IN (-109653,-109654,-109652,-109655); +DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid` IN (@ENTRY*100,@ENTRY*100+1,@ENTRY*100+2); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(-109653,0,0,0,11,0,100,0,0,0,0,0,53,0,@PATH1,1,0,0,0,1,0,0,0,0,0,0,0, 'Stormfleet Deckhand - On spawn - Start WP movement'), +(-109653,0,1,2,40,0,100,0,4,@PATH1,0,0,54,10000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Stormfleet Deckhand - Reach wp 4 - pause wp'), +(-109653,0,2,0,61,0,100,0,0,0,0,0,80,@ENTRY*100,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Stormfleet Deckhand - Reach wp 4 - run script'), +(-109653,0,3,4,40,0,100,0,8,@PATH1,0,0,54,21000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Stormfleet Deckhand - Reach wp 8 - pause wp'), +(-109653,0,4,5,61,0,100,0,0,0,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,5.794493, 'Stormfleet Deckhand - Reach wp 8 - turn to'), +(-109653,0,5,0,61,0,100,0,0,0,0,0,80,@ENTRY*100+1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Stormfleet Deckhand - Reach wp 8 - run script'), +(-109654,0,0,0,11,0,100,0,0,0,0,0,53,0,@PATH2,1,0,0,0,1,0,0,0,0,0,0,0, 'Stormfleet Deckhand - On spawn - Start WP movement'), +(-109654,0,1,2,40,0,100,0,6,@PATH2,0,0,54,10000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Stormfleet Deckhand - Reach wp 6 - pause wp'), +(-109654,0,2,0,61,0,100,0,0,0,0,0,80,@ENTRY*100,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Stormfleet Deckhand - Reach wp 6 - run script'), +(-109654,0,3,4,40,0,100,0,13,@PATH2,0,0,54,21000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Stormfleet Deckhand - Reach wp 13 - pause wp'), +(-109654,0,4,0,61,0,100,0,0,0,0,0,80,@ENTRY*100+1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Stormfleet Deckhand - Reach wp 13 - run script'), +(-109652,0,0,0,11,0,100,0,0,0,0,0,53,0,@PATH3,1,0,0,0,1,0,0,0,0,0,0,0, 'Stormfleet Deckhand - On spawn - Start WP movement'), +(-109652,0,1,2,40,0,100,0,17,@PATH3,0,0,54,10000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Stormfleet Deckhand - Reach wp 17 - pause wp'), +(-109652,0,2,0,61,0,100,0,0,0,0,0,80,@ENTRY*100,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Stormfleet Deckhand - Reach wp 17 - run script'), +(-109652,0,3,4,40,0,100,0,9,@PATH3,0,0,54,21000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Stormfleet Deckhand - Reach wp 9 - pause wp'), +(-109652,0,4,0,61,0,100,0,0,0,0,0,80,@ENTRY*100+1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Stormfleet Deckhand - Reach wp 9 - run script'), +(-109655,0,0,0,11,0,100,0,0,0,0,0,53,0,@PATH4,1,0,0,0,1,0,0,0,0,0,0,0, 'Stormfleet Deckhand - On spawn - Start WP movement'), +(-109655,0,1,2,40,0,100,0,3,@PATH4,0,0,54,11000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Stormfleet Deckhand - Reach wp 3 - pause wp'), +(-109655,0,2,0,61,0,100,0,0,0,0,0,80,@ENTRY*100+2,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Stormfleet Deckhand - Reach wp 3 - run script'), +(-109655,0,3,4,40,0,100,0,13,@PATH4,0,0,54,11000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Stormfleet Deckhand - Reach wp 13 - pause wp'), +(-109655,0,4,0,61,0,100,0,0,0,0,0,80,@ENTRY*100+2,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Stormfleet Deckhand - Reach wp 13 - run script'), +(-109655,0,5,6,40,0,100,0,16,@PATH4,0,0,54,11000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Stormfleet Deckhand - Reach wp 16 - pause wp'), +(-109655,0,6,0,61,0,100,0,0,0,0,0,80,@ENTRY*100+2,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Stormfleet Deckhand - Reach wp 16 - run script'), +(-109655,0,7,8,40,0,100,0,25,@PATH4,0,0,54,11000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Stormfleet Deckhand - Reach wp 25 - pause wp'), +(-109655,0,8,9,61,0,100,0,0,0,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,5.969026, 'Stormfleet Deckhand - Reach wp 25 - turn to'), +(-109655,0,9,0,61,0,100,0,0,0,0,0,80,@ENTRY*100+2,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Stormfleet Deckhand - Reach wp 25 - run script'), +(@ENTRY*100,9,0,0,0,0,100,0,0,0,0,0,90,8,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Stormfleet Deckhand - script - set bytes1'), +(@ENTRY*100,9,1,0,0,0,100,0,10000,10000,0,0,91,8,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Stormfleet Deckhand - script - remove bytes1'), +(@ENTRY*100+1,9,0,0,0,0,100,0,3000,3000,0,0,5,22,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Stormfleet Deckhand - script - emote'), +(@ENTRY*100+1,9,1,0,0,0,100,0,6000,6000,0,0,5,70,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Stormfleet Deckhand - script - emote'), +(@ENTRY*100+1,9,2,0,0,0,100,0,6000,6000,0,0,5,22,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Stormfleet Deckhand - script - emote'), +(@ENTRY*100+2,9,0,0,0,0,100,0,1000,1000,0,0,17,69,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Stormfleet Deckhand - script - set state STATE_USESTANDING'), +(@ENTRY*100+2,9,1,0,0,0,100,0,8000,8000,0,0,17,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Stormfleet Deckhand - script - set state NONE'), +(@ENTRY*100+2,9,2,0,0,0,100,0,0,0,0,0,90,2,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Stormfleet Deckhand - script - set bytes1'), +(@ENTRY*100+2,9,3,0,0,0,100,0,2000,2000,0,0,91,2,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Stormfleet Deckhand - script - remove bytes1'); +-- Waypoints for Stormfleet Deckhand from sniff +DELETE FROM `waypoints` WHERE `entry` IN (@PATH1,@PATH2,@PATH3,@PATH4); +INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES +(@PATH1,1,2261.388,5305.248,21.68184, 'Stormfleet Deckhand'), +(@PATH1,2,2259.963,5295.583,20.08975, 'Stormfleet Deckhand'), +(@PATH1,3,2260.002,5286.996,15.49093, 'Stormfleet Deckhand'), +(@PATH1,4,2257.711,5281.927,12.09341, 'Stormfleet Deckhand'), +(@PATH1,5,2261.763,5286.725,15.76729, 'Stormfleet Deckhand'), +(@PATH1,6,2260.902,5294.649,19.95268, 'Stormfleet Deckhand'), +(@PATH1,7,2263.460,5304.816,21.72922, 'Stormfleet Deckhand'), +(@PATH1,8,2265.704,5314.686,22.43809, 'Stormfleet Deckhand'), +(@PATH2,1,2248.875,5255.391,36.45885, 'Stormfleet Deckhand'), +(@PATH2,2,2246.625,5256.641,37.20885, 'Stormfleet Deckhand'), +(@PATH2,3,2244.625,5258.641,36.45885, 'Stormfleet Deckhand'), +(@PATH2,4,2241.625,5258.391,37.20885, 'Stormfleet Deckhand'), +(@PATH2,5,2238.625,5259.391,36.45885, 'Stormfleet Deckhand'), +(@PATH2,6,2232.960,5260.392,35.71835, 'Stormfleet Deckhand'), +(@PATH2,7,2235.375,5260.141,36.20885, 'Stormfleet Deckhand'), +(@PATH2,8,2239.375,5259.141,36.45885, 'Stormfleet Deckhand'), +(@PATH2,9,2241.625,5258.641,37.20885, 'Stormfleet Deckhand'), +(@PATH2,10,2244.625,5258.641,36.45885, 'Stormfleet Deckhand'), +(@PATH2,11,2247.125,5256.391,37.20885, 'Stormfleet Deckhand'), +(@PATH2,12,2249.125,5255.391,36.45885, 'Stormfleet Deckhand'), +(@PATH2,13,2253.791,5252.389,35.69936, 'Stormfleet Deckhand'), +(@PATH3,1,2212.298,5281.927,10.82595, 'Stormfleet Deckhand'), +(@PATH3,2,2211.701,5275.361,10.82595, 'Stormfleet Deckhand'), +(@PATH3,3,2224.383,5268.124,7.166187, 'Stormfleet Deckhand'), +(@PATH3,4,2235.353,5264.704,8.606246, 'Stormfleet Deckhand'), +(@PATH3,5,2244.243,5262.414,11.81635, 'Stormfleet Deckhand'), +(@PATH3,6,2248.373,5259.464,11.78494, 'Stormfleet Deckhand'), +(@PATH3,7,2247.781,5252.418,11.96684, 'Stormfleet Deckhand'), +(@PATH3,8,2246.383,5249.14,15.53435, 'Stormfleet Deckhand'), +(@PATH3,9,2243.871,5243.415,21.4974, 'Stormfleet Deckhand'), +(@PATH3,10,2245.975,5248.252,16.51618, 'Stormfleet Deckhand'), +(@PATH3,11,2248.437,5255.79,11.86939, 'Stormfleet Deckhand'), +(@PATH3,12,2248.403,5261.318,11.747, 'Stormfleet Deckhand'), +(@PATH3,13,2228.012,5267.475,7.16457, 'Stormfleet Deckhand'), +(@PATH3,14,2215.574,5274.178,11.13563, 'Stormfleet Deckhand'), +(@PATH3,15,2213.556,5283.097,10.82595, 'Stormfleet Deckhand'), +(@PATH3,16,2218.244,5291.424,10.70095, 'Stormfleet Deckhand'), +(@PATH3,17,2224.214,5293.65,10.82595, 'Stormfleet Deckhand'), +(@PATH3,18,2220.033,5292.01,10.70095, 'Stormfleet Deckhand'), +(@PATH4,1,2232.031,5289.312,11.11433, 'Stormfleet Deckhand'), +(@PATH4,2,2229.514,5285.923,11.22073, 'Stormfleet Deckhand'), +(@PATH4,3,2231.239,5285.13,11.22661, 'Stormfleet Deckhand'), +(@PATH4,4,2229.854,5285.705,11.22414, 'Stormfleet Deckhand'), +(@PATH4,5,2228.48,5291.178,11.13671, 'Stormfleet Deckhand'), +(@PATH4,6,2226.165,5291.41,10.95095, 'Stormfleet Deckhand'), +(@PATH4,7,2223.731,5291.465,10.82595, 'Stormfleet Deckhand'), +(@PATH4,8,2218.564,5293.642,10.70095, 'Stormfleet Deckhand'), +(@PATH4,9,2213.531,5285.789,10.70095, 'Stormfleet Deckhand'), +(@PATH4,10,2208.855,5275.448,10.82595, 'Stormfleet Deckhand'), +(@PATH4,11,2206.379,5260.244,10.58918, 'Stormfleet Deckhand'), +(@PATH4,12,2211.11,5256.537,10.71418, 'Stormfleet Deckhand'), +(@PATH4,13,2219.187,5252.958,11.33607, 'Stormfleet Deckhand'), +(@PATH4,14,2216.945,5251.284,11.26102, 'Stormfleet Deckhand'), +(@PATH4,15,2215.487,5248.678,11.44615, 'Stormfleet Deckhand'), +(@PATH4,16,2217.447,5248.063,11.4383, 'Stormfleet Deckhand'), +(@PATH4,17,2213.407,5251.713,10.96418, 'Stormfleet Deckhand'), +(@PATH4,18,2207.356,5257.069,10.71418, 'Stormfleet Deckhand'), +(@PATH4,19,2205.434,5262.277,10.58918, 'Stormfleet Deckhand'), +(@PATH4,20,2208.177,5274.885,10.82595, 'Stormfleet Deckhand'), +(@PATH4,21,2214.61,5286.973,10.82595, 'Stormfleet Deckhand'), +(@PATH4,22,2219.416,5292.909,10.70095, 'Stormfleet Deckhand'), +(@PATH4,23,2224.719,5291.44,10.82595, 'Stormfleet Deckhand'), +(@PATH4,24,2228.346,5291.136,10.95095, 'Stormfleet Deckhand'), +(@PATH4,25,2233.497,5291.667,11.21773, 'Stormfleet Deckhand'); diff --git a/sql/updates/world/2011_03_22_03_world_creature_template.sql b/sql/updates/world/2011_03_22_03_world_creature_template.sql new file mode 100644 index 0000000000000..5769c93c1d843 --- /dev/null +++ b/sql/updates/world/2011_03_22_03_world_creature_template.sql @@ -0,0 +1,8 @@ +-- Template updates for creature 33778 (Tournament Hippogryph) +UPDATE `creature_template` SET `vehicleid`=108,`InhabitType`=4 WHERE `entry`=33778; -- Tournament Hippogryph +-- Model data 22471 (creature 33778 (Tournament Hippogryph)) +UPDATE `creature_model_info` SET `bounding_radius`=0,`combat_reach`=0,`gender`=2 WHERE `modelid`=22471; -- Tournament Hippogryph +-- Addon data for creature 33778 (Tournament Hippogryph) +DELETE FROM `creature_template_addon` WHERE `entry`=33778; +INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(33778,0,1,1,0, NULL); -- Tournament Hippogryph diff --git a/sql/updates/world/2011_03_23_00_world_conditions.sql b/sql/updates/world/2011_03_23_00_world_conditions.sql new file mode 100644 index 0000000000000..e881797493950 --- /dev/null +++ b/sql/updates/world/2011_03_23_00_world_conditions.sql @@ -0,0 +1,3 @@ +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=18 AND `SourceEntry`=33581; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceEntry`,`ConditionTypeOrReference`, `ConditionValue1`, `ConditionValue2`, `Comment`) VALUES +(18,33581,24,1,24238, 'Only use Insult on Bjorn Halgurdsson'); diff --git a/sql/updates/world/2011_03_23_01_world_creature_template.sql b/sql/updates/world/2011_03_23_01_world_creature_template.sql new file mode 100644 index 0000000000000..ddc7e9c4cbcdf --- /dev/null +++ b/sql/updates/world/2011_03_23_01_world_creature_template.sql @@ -0,0 +1,874 @@ +-- Updates for (mostly) HoR creatures/GOs +-- Gameobject updates +UPDATE `gameobject_template` SET `flags`=`flags`|32 WHERE `entry`=202443; -- Dedication of Honor +UPDATE `gameobject_template` SET `flags`=`flags`|32 WHERE `entry`=201761; -- The Pit of Saron Portcullis +UPDATE `gameobject_template` SET `flags`=`flags`|32 WHERE `entry`=201759; -- The Forge of Souls Portcullis +UPDATE `gameobject_template` SET `flags`=`flags`|32 WHERE `entry`=201760; -- The Halls of Reflection Gate +UPDATE `gameobject_template` SET `flags`=`flags`|32,`faction`=114 WHERE `entry`=201976; -- Doodad_IceCrown_Door_04 +UPDATE `gameobject_template` SET `flags`=`flags`|32,`faction`=114 WHERE `entry`=202236; -- Frostmourne Altar +UPDATE `gameobject_template` SET `flags`=`flags`|32,`faction`=114 WHERE `entry`=202302; -- Frostmourne +UPDATE `gameobject_template` SET `flags`=`flags`|32,`faction`=1375 WHERE `entry`=197341; -- Impenetrable Door +UPDATE `gameobject_template` SET `flags`=`flags`|32,`faction`=1375 WHERE `entry`=197343; -- Doodad_IceCrown_Door_03 +UPDATE `gameobject_template` SET `flags`=`flags`|32,`faction`=1375 WHERE `entry`=197342; -- Doodad_IceCrown_Door_02 +UPDATE `gameobject_template` SET `faction`=16 WHERE `entry`=164639; -- Frost Trap + +SET @Equip=10137; -- equipment_id +-- Template updates +UPDATE `creature_template` SET `equipment_id`=@Equip+0 WHERE `entry`=17252; -- Felguard +UPDATE `creature_template` SET `baseattacktime`=1800 WHERE `entry`=38112; -- Falric +UPDATE `creature_template` SET `baseattacktime`=2000 WHERE `entry`=14881; -- Spider +UPDATE `creature_template` SET `dynamicflags`=`dynamicflags`|4 WHERE `entry`=1412; -- Squirrel +UPDATE `creature_template` SET `dynamicflags`=`dynamicflags`|4 WHERE `entry`=32428; -- Underbelly Rat +UPDATE `creature_template` SET `dynamicflags`=`dynamicflags`|4,`unit_class`=4 WHERE `entry`=36774; -- Silver Covenant Agent +UPDATE `creature_template` SET `equipment_id`=1221 WHERE `entry`=37221; -- Lady Jaina Proudmoore +UPDATE `creature_template` SET `equipment_id`=637 WHERE `entry`=37582; -- Archmage Koreln +UPDATE `creature_template` SET `exp`=0 WHERE `entry`=32206; -- Armored Brown Bear +UPDATE `creature_template` SET `exp`=0 WHERE `entry`=32322; -- Gold Warrior +UPDATE `creature_template` SET `exp`=0 WHERE `entry`=32328; -- [DND] Dalaran Sewer Arena - Controller - Death +UPDATE `creature_template` SET `exp`=0 WHERE `entry`=32339; -- [DND] Dalaran Sewer Arena - Controller +UPDATE `creature_template` SET `exp`=0 WHERE `entry`=32425; -- Galkara the Assassin +UPDATE `creature_template` SET `exp`=0 WHERE `entry`=32435; -- Vern +UPDATE `creature_template` SET `exp`=0 WHERE `entry`=32441; -- Underbelly Croc +UPDATE `creature_template` SET `exp`=0 WHERE `entry`=32664; -- Segacedi +UPDATE `creature_template` SET `exp`=0,`npcflag`=`npcflag`|130 WHERE `entry`=31032; -- Derek Odds +UPDATE `creature_template` SET `exp`=0,`npcflag`=`npcflag`|3 WHERE `entry`=31081; -- Officer Van Rossem +UPDATE `creature_template` SET `exp`=0,`npcflag`=`npcflag`|640 WHERE `entry`=32416; -- Stefen Cotter +UPDATE `creature_template` SET `exp`=0,`unit_flags`=`unit_flags`|526592 WHERE `entry`=32321; -- Green Warrior +UPDATE `creature_template` SET `exp`=0,`unit_flags`=`unit_flags`|526592 WHERE `entry`=32340; -- Gold Shaman +UPDATE `creature_template` SET `exp`=0,`unit_flags`=`unit_flags`|526592 WHERE `entry`=32342; -- Green Paladin +UPDATE `creature_template` SET `exp`=2 WHERE `entry`=37704; -- Frostmourne Altar Bunny (Quel'Delar) +UPDATE `creature_template` SET `exp`=2,`minlevel`=82,`maxlevel`=82,`unit_flags`=`unit_flags`|33555200 WHERE `entry`=37849; -- Sartharion Image +UPDATE `creature_template` SET `exp`=0,`unit_flags`=`unit_flags`|32768 WHERE `entry`=30755; -- Kor'kron Reaver +UPDATE `creature_template` SET `minlevel`=60,`maxlevel`=60,`unit_flags`=`unit_flags`|33555200 WHERE `entry`=34984; -- World Trigger (Not Floating) +UPDATE `creature_template` SET `minlevel`=75,`maxlevel`=75,`npcflag`=`npcflag`|4224,`unit_flags`=`unit_flags`|512 WHERE `entry`=33936; -- Nargle Lashcord +UPDATE `creature_template` SET `minlevel`=75,`maxlevel`=75,`npcflag`=`npcflag`|4224,`unit_flags`=`unit_flags`|768 WHERE `entry`=33937; -- Xazi Smolderpipe +UPDATE `creature_template` SET `minlevel`=75,`maxlevel`=75,`npcflag`=`npcflag`|4224,`unit_flags`=`unit_flags`|768 WHERE `entry`=33938; -- Zom Bocom +UPDATE `creature_template` SET `unit_class`=4 WHERE `entry`=26125; -- Risen Ghoul +UPDATE `creature_template` SET `unit_class`=8 WHERE `entry`=416; -- Imp +UPDATE `creature_template` SET `npcflag`=`npcflag`|1 WHERE `entry`=28690; -- Tassia Whisperglen +UPDATE `creature_template` SET `npcflag`=`npcflag`|1 WHERE `entry`=28708; -- Kizi Copperclip +UPDATE `creature_template` SET `npcflag`=`npcflag`|1 WHERE `entry`=28956; -- Warcaster Fanoraithe +UPDATE `creature_template` SET `npcflag`=`npcflag`|1 WHERE `entry`=28958; -- Jessa Weaver +UPDATE `creature_template` SET `npcflag`=`npcflag`|1 WHERE `entry`=29660; -- Grand Marauder Sai +UPDATE `creature_template` SET `npcflag`=`npcflag`|1 WHERE `entry`=29665; -- Pazik "The Pick" Prylock +UPDATE `creature_template` SET `npcflag`=`npcflag`|1 WHERE `entry`=30104; -- Adamman the Trader +UPDATE `creature_template` SET `npcflag`=`npcflag`|1 WHERE `entry`=30726; -- Archivist Betha +UPDATE `creature_template` SET `npcflag`=`npcflag`|1 WHERE `entry`=31136; -- High Warlord Uro +UPDATE `creature_template` SET `npcflag`=`npcflag`|1 WHERE `entry`=32169; -- Arcanist Braedin +UPDATE `creature_template` SET `npcflag`=`npcflag`|1 WHERE `entry`=32170; -- Magister Surdiel +UPDATE `creature_template` SET `npcflag`=`npcflag`|1 WHERE `entry`=32676; -- Grindle Firespark +UPDATE `creature_template` SET `npcflag`=`npcflag`|1 WHERE `entry`=32677; -- Whirt the All-Knowing +UPDATE `creature_template` SET `npcflag`=`npcflag`|1 WHERE `entry`=32678; -- Emeline Fizzlefry +UPDATE `creature_template` SET `npcflag`=`npcflag`|1 WHERE `entry`=32679; -- Darthalia Ebonscorch +UPDATE `creature_template` SET `npcflag`=`npcflag`|1 WHERE `entry`=32680; -- Fabioso the Fabulous +UPDATE `creature_template` SET `npcflag`=`npcflag`|1 WHERE `entry`=32681; -- The Magnificent Merleaux +UPDATE `creature_template` SET `npcflag`=`npcflag`|1 WHERE `entry`=32683; -- Grezla the Hag +UPDATE `creature_template` SET `npcflag`=`npcflag`|1 WHERE `entry`=32684; -- Mona Everspring +UPDATE `creature_template` SET `npcflag`=`npcflag`|1 WHERE `entry`=32685; -- Kitz Proudbreeze +UPDATE `creature_template` SET `npcflag`=`npcflag`|1 WHERE `entry`=32686; -- Crafticus Mindbender +UPDATE `creature_template` SET `npcflag`=`npcflag`|1 WHERE `entry`=32687; -- Linda Ann Kastinglow +UPDATE `creature_template` SET `npcflag`=`npcflag`|1 WHERE `entry`=32688; -- Archmage Tenaj +UPDATE `creature_template` SET `npcflag`=`npcflag`|1 WHERE `entry`=32689; -- Adorean Lew +UPDATE `creature_template` SET `npcflag`=`npcflag`|1 WHERE `entry`=32690; -- Bitty Frostflinger +UPDATE `creature_template` SET `npcflag`=`npcflag`|1 WHERE `entry`=32691; -- Magus Fansy Goodbringer +UPDATE `creature_template` SET `npcflag`=`npcflag`|1 WHERE `entry`=32692; -- Arcanist Alec +UPDATE `creature_template` SET `npcflag`=`npcflag`|1 WHERE `entry`=32693; -- Sabriana Sorrowgaze +UPDATE `creature_template` SET `npcflag`=`npcflag`|1 WHERE `entry`=32726; -- The Chooch +UPDATE `creature_template` SET `npcflag`=`npcflag`|1 WHERE `entry`=32727; -- Natalie Tootiblare +UPDATE `creature_template` SET `npcflag`=`npcflag`|1 WHERE `entry`=32728; -- Illusionist Karina +UPDATE `creature_template` SET `npcflag`=`npcflag`|1 WHERE `entry`=32729; -- Lofwyr Le'Fleur +UPDATE `creature_template` SET `npcflag`=`npcflag`|1 WHERE `entry`=32730; -- Goldlilly Gleamingfell +UPDATE `creature_template` SET `npcflag`=`npcflag`|1 WHERE `entry`=32731; -- Metopious Loreseeker +UPDATE `creature_template` SET `npcflag`=`npcflag`|1 WHERE `entry`=32732; -- Dorfus Alphamage +UPDATE `creature_template` SET `npcflag`=`npcflag`|1 WHERE `entry`=32733; -- Joboba Mezbreaker +UPDATE `creature_template` SET `npcflag`=`npcflag`|1 WHERE `entry`=33031; -- Sebastian Bower +UPDATE `creature_template` SET `npcflag`=`npcflag`|1 WHERE `entry`=36856; -- Shandy Glossgleam +UPDATE `creature_template` SET `npcflag`=`npcflag`|1,`unit_flags`=`unit_flags`|768 WHERE `entry`=35594; -- Brassbolt Mechawrench +UPDATE `creature_template` SET `npcflag`=`npcflag`|1048577 WHERE `entry`=14990; -- Defilers Emissary +UPDATE `creature_template` SET `npcflag`=`npcflag`|1048577 WHERE `entry`=14991; -- League of Arathor Emissary +UPDATE `creature_template` SET `npcflag`=`npcflag`|1048577 WHERE `entry`=29533; -- Schembari "Uncle Sal" Shearbolt +UPDATE `creature_template` SET `npcflag`=`npcflag`|1048577 WHERE `entry`=29568; -- "Techs" Rickard Rustbolt +UPDATE `creature_template` SET `npcflag`=`npcflag`|1048577 WHERE `entry`=29667; -- Warsong Gulch Portal +UPDATE `creature_template` SET `npcflag`=`npcflag`|1048577 WHERE `entry`=29668; -- Arathi Basin Portal +UPDATE `creature_template` SET `npcflag`=`npcflag`|1048577 WHERE `entry`=29669; -- Alterac Valley Portal +UPDATE `creature_template` SET `npcflag`=`npcflag`|1048577 WHERE `entry`=29670; -- Eye of the Storm Portal +UPDATE `creature_template` SET `npcflag`=`npcflag`|1048577 WHERE `entry`=29671; -- Strand of the Ancients Portal +UPDATE `creature_template` SET `npcflag`=`npcflag`|1048577 WHERE `entry`=29673; -- Arathi Basin Portal +UPDATE `creature_template` SET `npcflag`=`npcflag`|1048577 WHERE `entry`=29675; -- Eye of the Storm Portal +UPDATE `creature_template` SET `npcflag`=`npcflag`|1048577 WHERE `entry`=32330; -- Minzi the Minx +UPDATE `creature_template` SET `npcflag`=`npcflag`|1048577 WHERE `entry`=32332; -- Ramik Slamwrench +UPDATE `creature_template` SET `npcflag`=`npcflag`|1048577 WHERE `entry`=32333; -- "Dapper" Danik Blackshaft +UPDATE `creature_template` SET `npcflag`=`npcflag`|1048577 WHERE `entry`=34952; -- Isle of Conquest Portal +UPDATE `creature_template` SET `npcflag`=`npcflag`|1048577 WHERE `entry`=34953; -- Isle of Conquest Portal +UPDATE `creature_template` SET `npcflag`=`npcflag`|1154 WHERE `entry`=29535; -- Alchemist Cinesra +UPDATE `creature_template` SET `npcflag`=`npcflag`|128 WHERE `entry`=28692; -- "Red" Jack Findle +UPDATE `creature_template` SET `npcflag`=`npcflag`|128 WHERE `entry`=28707; -- Angelo Pescatore +UPDATE `creature_template` SET `npcflag`=`npcflag`|128 WHERE `entry`=28715; -- Endora Moorehead +UPDATE `creature_template` SET `npcflag`=`npcflag`|128 WHERE `entry`=28721; -- Tiffany Cartier +UPDATE `creature_template` SET `npcflag`=`npcflag`|128 WHERE `entry`=28723; -- Larana Drome +UPDATE `creature_template` SET `npcflag`=`npcflag`|128 WHERE `entry`=28725; -- Patricia Egan +UPDATE `creature_template` SET `npcflag`=`npcflag`|128 WHERE `entry`=28726; -- Dominique Stefano +UPDATE `creature_template` SET `npcflag`=`npcflag`|128 WHERE `entry`=28727; -- Edward Egan +UPDATE `creature_template` SET `npcflag`=`npcflag`|128 WHERE `entry`=28728; -- Dorian Fines +UPDATE `creature_template` SET `npcflag`=`npcflag`|128 WHERE `entry`=28951; -- Breanni +UPDATE `creature_template` SET `npcflag`=`npcflag`|128 WHERE `entry`=28993; -- Aerith Primrose +UPDATE `creature_template` SET `npcflag`=`npcflag`|128 WHERE `entry`=28994; -- Abra Cadabra +UPDATE `creature_template` SET `npcflag`=`npcflag`|128 WHERE `entry`=29491; -- Karandonna +UPDATE `creature_template` SET `npcflag`=`npcflag`|128 WHERE `entry`=29495; -- Norvin Alderman +UPDATE `creature_template` SET `npcflag`=`npcflag`|128 WHERE `entry`=29510; -- Linna Bruder +UPDATE `creature_template` SET `npcflag`=`npcflag`|128 WHERE `entry`=29511; -- Lalla Brightweave +UPDATE `creature_template` SET `npcflag`=`npcflag`|128 WHERE `entry`=29512; -- Ainderu Summerleaf +UPDATE `creature_template` SET `npcflag`=`npcflag`|128 WHERE `entry`=29528; -- Debbi Moore +UPDATE `creature_template` SET `npcflag`=`npcflag`|128 WHERE `entry`=29529; -- Ninsianna +UPDATE `creature_template` SET `npcflag`=`npcflag`|128 WHERE `entry`=29548; -- Aimee +UPDATE `creature_template` SET `npcflag`=`npcflag`|128 WHERE `entry`=29628; -- Angelique Butler +UPDATE `creature_template` SET `npcflag`=`npcflag`|128 WHERE `entry`=29702; -- Chameli Banaphash +UPDATE `creature_template` SET `npcflag`=`npcflag`|128 WHERE `entry`=29703; -- Sheddle Glossgleam +UPDATE `creature_template` SET `npcflag`=`npcflag`|128 WHERE `entry`=29716; -- Clockwork Assistant +UPDATE `creature_template` SET `npcflag`=`npcflag`|128 WHERE `entry`=30885; -- Blazik Fireclaw +UPDATE `creature_template` SET `npcflag`=`npcflag`|128 WHERE `entry`=31579; -- Arcanist Adurin +UPDATE `creature_template` SET `npcflag`=`npcflag`|128 WHERE `entry`=31580; -- Arcanist Ivrenne +UPDATE `creature_template` SET `npcflag`=`npcflag`|128 WHERE `entry`=32172; -- Harold Winston +UPDATE `creature_template` SET `npcflag`=`npcflag`|128 WHERE `entry`=32216; -- Mei Francis +UPDATE `creature_template` SET `npcflag`=`npcflag`|128 WHERE `entry`=32334; -- Nixi Fireclaw +UPDATE `creature_template` SET `npcflag`=`npcflag`|128 WHERE `entry`=32509; -- Brammold Deepmine +UPDATE `creature_template` SET `npcflag`=`npcflag`|128 WHERE `entry`=32514; -- Vanessa Sellers +UPDATE `creature_template` SET `npcflag`=`npcflag`|128 WHERE `entry`=33027; -- Jessica Sellers +UPDATE `creature_template` SET `npcflag`=`npcflag`|128 WHERE `entry`=33964; -- Arcanist Firael +UPDATE `creature_template` SET `npcflag`=`npcflag`|128 WHERE `entry`=37942; -- Arcanist Uovril +UPDATE `creature_template` SET `npcflag`=`npcflag`|128 WHERE `entry`=40160; -- Frozo the Renowned +UPDATE `creature_template` SET `npcflag`=`npcflag`|128,`unit_flags`=`unit_flags`|32768 WHERE `entry`=35790; -- Usuri Brightcoin +UPDATE `creature_template` SET `npcflag`=`npcflag`|128,`unit_flags`=`unit_flags`|768 WHERE `entry`=35494; -- Arcanist Miluria +UPDATE `creature_template` SET `npcflag`=`npcflag`|128,`unit_flags`=`unit_flags`|768 WHERE `entry`=35507; -- Enchanter Isian +UPDATE `creature_template` SET `npcflag`=`npcflag`|129 WHERE `entry`=28776; -- Elizabeth Ross +UPDATE `creature_template` SET `npcflag`=`npcflag`|129 WHERE `entry`=29478; -- Jepetto Joybuzz +UPDATE `creature_template` SET `npcflag`=`npcflag`|130 WHERE `entry`=28718; -- Ranid Glowergold +UPDATE `creature_template` SET `npcflag`=`npcflag`|130 WHERE `entry`=29527; -- Orton Bennet +UPDATE `creature_template` SET `npcflag`=`npcflag`|130 WHERE `entry`=32337; -- Christi Stockton +UPDATE `creature_template` SET `npcflag`=`npcflag`|130 WHERE `entry`=32515; -- Braeg Stoutbeard +UPDATE `creature_template` SET `npcflag`=`npcflag`|131,`unit_flags`=`unit_flags`|320 WHERE `entry`=15351; -- Alliance Brigadier General +UPDATE `creature_template` SET `npcflag`=`npcflag`|131072 WHERE `entry`=29530; -- Binzik Goldbook +UPDATE `creature_template` SET `npcflag`=`npcflag`|131072 WHERE `entry`=30604; -- Teller Almeida +UPDATE `creature_template` SET `npcflag`=`npcflag`|131072 WHERE `entry`=30605; -- Teller Gee +UPDATE `creature_template` SET `npcflag`=`npcflag`|131072 WHERE `entry`=30607; -- Teller Plushner +UPDATE `creature_template` SET `npcflag`=`npcflag`|147 WHERE `entry`=28701; -- Timothy Jones +UPDATE `creature_template` SET `npcflag`=`npcflag`|16 WHERE `entry`=28693; -- Enchanter Nalthanis +UPDATE `creature_template` SET `npcflag`=`npcflag`|16 WHERE `entry`=28697; -- Timofey Oshenko +UPDATE `creature_template` SET `npcflag`=`npcflag`|16 WHERE `entry`=28702; -- Professor Pallin +UPDATE `creature_template` SET `npcflag`=`npcflag`|16 WHERE `entry`=28704; -- Dorothy Egan +UPDATE `creature_template` SET `npcflag`=`npcflag`|16 WHERE `entry`=29509; -- Namha Moonwater +UPDATE `creature_template` SET `npcflag`=`npcflag`|16 WHERE `entry`=29513; -- Didi the Wrench +UPDATE `creature_template` SET `npcflag`=`npcflag`|16 WHERE `entry`=29514; -- Findle Whistlesteam +UPDATE `creature_template` SET `npcflag`=`npcflag`|19 WHERE `entry`=28699; -- Charles Worth +UPDATE `creature_template` SET `npcflag`=`npcflag`|19 WHERE `entry`=28703; -- Linzy Blackbolt +UPDATE `creature_template` SET `npcflag`=`npcflag`|2 WHERE `entry`=30115; -- Vereesa Windrunner +UPDATE `creature_template` SET `npcflag`=`npcflag`|2 WHERE `entry`=30116; -- Archmage Aethas Sunreaver +UPDATE `creature_template` SET `npcflag`=`npcflag`|2 WHERE `entry`=30137; -- Shifty Vickers +UPDATE `creature_template` SET `npcflag`=`npcflag`|2 WHERE `entry`=30490; -- Rin Duoctane +UPDATE `creature_template` SET `npcflag`=`npcflag`|2 WHERE `entry`=31080; -- Warden Alturas +UPDATE `creature_template` SET `npcflag`=`npcflag`|2 WHERE `entry`=32516; -- Washed-Up Mage +UPDATE `creature_template` SET `npcflag`=`npcflag`|2 WHERE `entry`=36506; -- Daros Moonlance +UPDATE `creature_template` SET `npcflag`=`npcflag`|2 WHERE `entry`=37776; -- Apprentice Nelphi +UPDATE `creature_template` SET `npcflag`=`npcflag`|2 WHERE `entry`=37780; -- Dark Ranger Vorel +UPDATE `creature_template` SET `npcflag`=`npcflag`|2,`unit_flags`=`unit_flags`|768 WHERE `entry`=35471; -- Sorn Proudmane +UPDATE `creature_template` SET `npcflag`=`npcflag`|2176 WHERE `entry`=28714; -- Ildine Sorrowspear +UPDATE `creature_template` SET `npcflag`=`npcflag`|2176 WHERE `entry`=29537; -- Darahir +UPDATE `creature_template` SET `npcflag`=`npcflag`|2176 WHERE `entry`=29636; -- Hagatha Moorehead +UPDATE `creature_template` SET `npcflag`=`npcflag`|262145 WHERE `entry`=29534; -- "Baroness" Llana +UPDATE `creature_template` SET `npcflag`=`npcflag`|262145 WHERE `entry`=32329; -- Kanika Goldwell +UPDATE `creature_template` SET `npcflag`=`npcflag`|3 WHERE `entry`=16128; -- Rhonin +UPDATE `creature_template` SET `npcflag`=`npcflag`|3 WHERE `entry`=20735; -- Archmage Lan'dalock +UPDATE `creature_template` SET `npcflag`=`npcflag`|3 WHERE `entry`=28160; -- Archmage Pentarus +UPDATE `creature_template` SET `npcflag`=`npcflag`|3 WHERE `entry`=29156; -- Archmage Celindra +UPDATE `creature_template` SET `npcflag`=`npcflag`|3 WHERE `entry`=31439; -- Archmage Timear +UPDATE `creature_template` SET `npcflag`=`npcflag`|3 WHERE `entry`=36669; -- Arcanist Tybalin +UPDATE `creature_template` SET `npcflag`=`npcflag`|384 WHERE `entry`=28691; -- Susana Averoy +UPDATE `creature_template` SET `npcflag`=`npcflag`|384 WHERE `entry`=29493; -- Jarold Puller +UPDATE `creature_template` SET `npcflag`=`npcflag`|4224 WHERE `entry`=28716; -- Palja Amboss +UPDATE `creature_template` SET `npcflag`=`npcflag`|4224 WHERE `entry`=28722; -- Bryan Landers +UPDATE `creature_template` SET `npcflag`=`npcflag`|4224 WHERE `entry`=28989; -- Aemara +UPDATE `creature_template` SET `npcflag`=`npcflag`|4224 WHERE `entry`=28990; -- Anthony Durain +UPDATE `creature_template` SET `npcflag`=`npcflag`|4224 WHERE `entry`=28991; -- Valaden Silverblade +UPDATE `creature_template` SET `npcflag`=`npcflag`|4224 WHERE `entry`=28992; -- Valerie Langrom +UPDATE `creature_template` SET `npcflag`=`npcflag`|4224 WHERE `entry`=28995; -- Paldesse +UPDATE `creature_template` SET `npcflag`=`npcflag`|4224 WHERE `entry`=28997; -- Griselda Hunderland +UPDATE `creature_template` SET `npcflag`=`npcflag`|4224 WHERE `entry`=29476; -- Dagna Flintlock +UPDATE `creature_template` SET `npcflag`=`npcflag`|4224 WHERE `entry`=29494; -- Shen Kang Cheng +UPDATE `creature_template` SET `npcflag`=`npcflag`|4224 WHERE `entry`=29496; -- Kerta the Bold +UPDATE `creature_template` SET `npcflag`=`npcflag`|4224 WHERE `entry`=29497; -- Walther Whiteford +UPDATE `creature_template` SET `npcflag`=`npcflag`|4224 WHERE `entry`=29499; -- Bartram Haller +UPDATE `creature_template` SET `npcflag`=`npcflag`|4224 WHERE `entry`=29523; -- Bragund Brightlink +UPDATE `creature_template` SET `npcflag`=`npcflag`|4224 WHERE `entry`=29538; -- Hexil Garrot +UPDATE `creature_template` SET `npcflag`=`npcflag`|4224 WHERE `entry`=34252; -- Dubin Clay +UPDATE `creature_template` SET `npcflag`=`npcflag`|4224 WHERE `entry`=35497; -- Rafael Langrom +UPDATE `creature_template` SET `npcflag`=`npcflag`|4224 WHERE `entry`=35500; -- Matilda Brightlink +UPDATE `creature_template` SET `npcflag`=`npcflag`|4224,`unit_flags`=`unit_flags`|512 WHERE `entry`=34095; -- Trapjaw Rix +UPDATE `creature_template` SET `npcflag`=`npcflag`|4224,`unit_flags`=`unit_flags`|512 WHERE `entry`=35496; -- Rueben Lauren +UPDATE `creature_template` SET `npcflag`=`npcflag`|4224,`unit_flags`=`unit_flags`|512 WHERE `entry`=35498; -- Horace Hunderland +UPDATE `creature_template` SET `npcflag`=`npcflag`|640 WHERE `entry`=28682; -- Inzi Charmlight +UPDATE `creature_template` SET `npcflag`=`npcflag`|640 WHERE `entry`=28685; -- Narisa Redgold +UPDATE `creature_template` SET `npcflag`=`npcflag`|640 WHERE `entry`=29547; -- Applebough +UPDATE `creature_template` SET `npcflag`=`npcflag`|640 WHERE `entry`=29714; -- Lucian Trias +UPDATE `creature_template` SET `npcflag`=`npcflag`|640 WHERE `entry`=29715; -- Fialla Sweetberry +UPDATE `creature_template` SET `npcflag`=`npcflag`|640 WHERE `entry`=32403; -- Sandra Bartan +UPDATE `creature_template` SET `npcflag`=`npcflag`|640 WHERE `entry`=32421; -- Marcella Bloom +UPDATE `creature_template` SET `npcflag`=`npcflag`|640 WHERE `entry`=32424; -- Laire Brewgold +UPDATE `creature_template` SET `npcflag`=`npcflag`|640 WHERE `entry`=32426; -- Coira Longrifle +UPDATE `creature_template` SET `npcflag`=`npcflag`|640 WHERE `entry`=33026; -- Sarah Brady +UPDATE `creature_template` SET `npcflag`=`npcflag`|642 WHERE `entry`=29049; -- Arille Azuregaze +UPDATE `creature_template` SET `npcflag`=`npcflag`|65536 WHERE `entry`=28686; -- Caliel Brightwillow +UPDATE `creature_template` SET `npcflag`=`npcflag`|65536 WHERE `entry`=32411; -- Afsaneh Asrar +UPDATE `creature_template` SET `npcflag`=`npcflag`|66177 WHERE `entry`=28687; -- Amisi Azuregaze +UPDATE `creature_template` SET `npcflag`=`npcflag`|66177 WHERE `entry`=31557; -- Uda the Beast +UPDATE `creature_template` SET `npcflag`=`npcflag`|66177 WHERE `entry`=32413; -- Isirami Fairwind +UPDATE `creature_template` SET `npcflag`=`npcflag`|66179 WHERE `entry`=29532; -- Ajay Green +UPDATE `creature_template` SET `npcflag`=`npcflag`|723 WHERE `entry`=28742; -- Marcia Chase +UPDATE `creature_template` SET `npcflag`=`npcflag`|7296 WHERE `entry`=32641; -- Drix Blackwrench +UPDATE `creature_template` SET `npcflag`=`npcflag`|786433 WHERE `entry`=28774; -- Andrew Matthews +UPDATE `creature_template` SET `npcflag`=`npcflag`|80 WHERE `entry`=28694; -- Alard Schmied +UPDATE `creature_template` SET `npcflag`=`npcflag`|80 WHERE `entry`=28698; -- Jedidiah Handers +UPDATE `creature_template` SET `npcflag`=`npcflag`|80 WHERE `entry`=29505; -- Imindril Spearsong +UPDATE `creature_template` SET `npcflag`=`npcflag`|80 WHERE `entry`=29506; -- Orland Schaeffer +UPDATE `creature_template` SET `npcflag`=`npcflag`|82 WHERE `entry`=28706; -- Olisarra the Kind +UPDATE `creature_template` SET `npcflag`=`npcflag`|83 WHERE `entry`=28705; -- Katherine Lee +UPDATE `creature_template` SET `npcflag`=`npcflag`|896 WHERE `entry`=32642; -- Mojodishu +UPDATE `creature_template` SET `unit_class`=4 WHERE `entry`=36774; -- Silver Covenant Agent +UPDATE `creature_template` SET `unit_class`=4 WHERE `entry`=36776; -- Sunreaver Agent +UPDATE `creature_template` SET `unit_flags`=`unit_flags`|32832,`equipment_id`=1819 WHERE `entry`=37225; -- Uther the Lightbringer +UPDATE `creature_template` SET `unit_flags`=`unit_flags`|33555200 WHERE `entry`=35608; -- [DND] Dalaran Argent Tournament Herald Bunny +UPDATE `creature_template` SET `unit_flags`=`unit_flags`|33555200 WHERE `entry`=37906; -- Imprisoned Soul +UPDATE `creature_template` SET `unit_flags`=`unit_flags`|768 WHERE `entry`=34330; -- Jones +UPDATE `creature_template` SET `unit_flags`=`unit_flags`|768 WHERE `entry`=35826; -- Kaye Toogie + +-- Equipments +DELETE FROM `creature_equip_template` WHERE `entry` IN (@Equip,@Equip+1); +INSERT INTO `creature_equip_template` (`entry`,`equipentry1`,`equipentry2`,`equipentry3`) VALUES +(@Equip+0,22199,0,0), +(@Equip+1,50771,50781,0); + +-- Creature addon updates +DELETE FROM `creature_template_addon` WHERE `entry` IN (15351,16128,20735,23472,25171,26043,26119,27047,27870,28160,28332,28682,28685,28686,28687,28691,28692,28693,28694,28697,28698,28699,28701,28702,28703,28704,28705,28706,28707,28708,28714,28715,28716,28718,28721,28722,28723,28725,28726,28727,28728,28742,28774,28776,28956,28958,28989,28990,28991,28992,28993,28994,28995,28997,29049,29156,29238,29254,29255,29261,29325,29476,29478,29491,29493,29494,29495,29496,29497,29499,29505,29506,29509,29510,29511,29512,29513,29514,29523,29527,29528,29529,29530,29532,29533,29534,29535,29537,29538,29547,29548,29568,29628,29636,29640,29641,29660,29665,29667,29668,29669,29670,29671,29673,29675,29702,29703,29714,29715,29716,29763,29764,29765,29766,29777,29780,29781,29782,29783,29784,29785,29802,29807,29812,30094,30095,30104,30115,30116,30117,30137,30164,30352,30490,30604,30605,30607,30659,30726,30755,30885,31032,31080,31081,31228,31236,31439,31517,31557,31580,31643,31730,32169,32170,32172,32216,32249,32265,32321,32322,32328,32329,32330,32332,32333,32334,32337,32339,32340,32342,32403,32411,32413,32416,32421,32424,32425,32426,32428,32435,32441,32450,32451,32466,32470,32509,32514,32515,32516,32606,32641,32650,32651,32652,32653,32664,32668,32669,32675,32676,32677,32678,32679,32680,32681,32683,32684,32685,32686,32687,32688,32689,32690,32691,32692,32693,32709,32711,32721,32722,32723,32724,32725,32726,32727,32728,32729,32730,32731,32732,32733,32743,32744,32745,32746,32747,32749,32751,32843,32844,33026,33027,33422,33778,33936,33937,33938,33964,34095,34252,34330,34952,34953,34984,35471,35494,35496,35497,35498,35500,35507,35608,35790,35826,36506,36669,36774,36776,36851,36856,37221,37225,37226,37582,37704,37776,37780,37849,37906,37942,38112,38113,38172,38173,38175,38176,38177,38567,40160,7549); +INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(15351,0,0,1,0, NULL), -- Alliance Brigadier General +(16128,0,0,1,0, NULL), -- Rhonin +(20735,0,0,1,0, NULL), -- Archmage Lan'dalock +(23472,0,0,1,0, NULL), -- World Trigger (Large AOI, Not Immune PC/NPC) +(25171,0,0,1,0, NULL), -- Invisible Stalker (Scale x0.5) +(26043,0,0,1,0, NULL), -- Steam Burst +(26119,0,0,1,0, NULL), -- Phoenix Hatchling +(27047,0,0,1,0, NULL), -- Invisible Stalker (Floating Only) +(27870,0,0,1,0, NULL), -- Wild Flower +(28160,0,0,257,0, NULL), -- Archmage Pentarus +(28332,0,0,1,0, NULL), -- Generic Trigger LAB (Large AOI) +(28682,0,0,1,0, NULL), -- Inzi Charmlight +(28685,0,0,1,0, NULL), -- Narisa Redgold +(28686,0,0,1,0, NULL), -- Caliel Brightwillow +(28687,0,0,257,0, NULL), -- Amisi Azuregaze +(28691,0,0,257,0, NULL), -- Susana Averoy +(28692,0,0,257,0, NULL), -- "Red" Jack Findle +(28693,0,0,257,0, NULL), -- Enchanter Nalthanis +(28694,0,0,257,0, NULL), -- Alard Schmied +(28697,0,0,257,0, NULL), -- Timofey Oshenko +(28698,0,0,257,0, NULL), -- Jedidiah Handers +(28699,0,0,257,0, NULL), -- Charles Worth +(28701,0,0,257,0, NULL), -- Timothy Jones +(28702,0,0,257,0, NULL), -- Professor Pallin +(28703,0,0,257,0, NULL), -- Linzy Blackbolt +(28704,0,0,257,0, NULL), -- Dorothy Egan +(28705,0,0,1,0, NULL), -- Katherine Lee +(28706,0,0,257,0, NULL), -- Olisarra the Kind +(28707,0,0,257,0, NULL), -- Angelo Pescatore +(28708,0,0,257,0, NULL), -- Kizi Copperclip +(28714,0,0,257,0, NULL), -- Ildine Sorrowspear +(28715,0,0,257,0, NULL), -- Endora Moorehead +(28716,0,0,257,0, NULL), -- Palja Amboss +(28718,0,0,257,0, NULL), -- Ranid Glowergold +(28721,0,0,257,0, NULL), -- Tiffany Cartier +(28722,0,0,257,0, NULL), -- Bryan Landers +(28723,0,0,257,0, NULL), -- Larana Drome +(28725,0,0,257,0, NULL), -- Patricia Egan +(28726,0,0,257,0, NULL), -- Dominique Stefano +(28727,0,0,257,0, NULL), -- Edward Egan +(28728,0,0,257,0, NULL), -- Dorian Fines +(28742,0,0,257,0, NULL), -- Marcia Chase +(28774,0,0,257,0, NULL), -- Andrew Matthews +(28776,0,0,257,0, NULL), -- Elizabeth Ross +(28956,0,0,257,0, NULL), -- Warcaster Fanoraithe +(28958,0,0,257,0, NULL), -- Jessa Weaver +(28989,0,0,258,0, NULL), -- Aemara +(28990,0,0,257,0, NULL), -- Anthony Durain +(28991,0,0,257,0, NULL), -- Valaden Silverblade +(28992,0,0,257,0, NULL), -- Valerie Langrom +(28993,0,0,1,0, NULL), -- Aerith Primrose +(28994,0,0,257,0, NULL), -- Abra Cadabra +(28995,0,0,257,0, NULL), -- Paldesse +(28997,0,0,257,0, NULL), -- Griselda Hunderland +(29049,0,0,1,0, NULL), -- Arille Azuregaze +(29156,0,0,257,0, NULL), -- Archmage Celindra +(29238,0,0,1,0, NULL), -- Scourge Haunt +(29254,0,0,1,0, NULL), -- Silver Covenant Guardian Mage +(29255,0,0,1,0, NULL), -- Sunreaver Guardian Mage +(29261,0,0,2,0, NULL), -- Windle Sparkshine +(29325,0,0,1,379, NULL), -- Torgo the Younger +(29476,0,0,258,0, NULL), -- Dagna Flintlock +(29478,0,0,257,0, NULL), -- Jepetto Joybuzz +(29491,0,0,257,0, NULL), -- Karandonna +(29493,0,0,257,0, NULL), -- Jarold Puller +(29494,0,0,257,0, NULL), -- Shen Kang Cheng +(29495,0,0,257,0, NULL), -- Norvin Alderman +(29496,0,0,257,0, NULL), -- Kerta the Bold +(29497,0,0,257,69, NULL), -- Walther Whiteford +(29499,0,0,257,0, NULL), -- Bartram Haller +(29505,0,0,257,233, NULL), -- Imindril Spearsong +(29506,0,0,257,0, NULL), -- Orland Schaeffer +(29509,0,0,257,0, NULL), -- Namha Moonwater +(29510,0,0,257,0, NULL), -- Linna Bruder +(29511,0,0,257,0, NULL), -- Lalla Brightweave +(29512,0,0,257,69, NULL), -- Ainderu Summerleaf +(29513,0,0,257,0, NULL), -- Didi the Wrench +(29514,0,0,257,0, NULL), -- Findle Whistlesteam +(29523,0,0,257,0, NULL), -- Bragund Brightlink +(29527,0,0,257,0, NULL), -- Orton Bennet +(29528,0,0,257,0, NULL), -- Debbi Moore +(29529,0,0,257,0, NULL), -- Ninsianna +(29530,0,0,257,0, NULL), -- Binzik Goldbook +(29532,0,0,257,0, NULL), -- Ajay Green +(29533,0,0,1,0, NULL), -- Schembari "Uncle Sal" Shearbolt +(29534,0,0,1,0, NULL), -- "Baroness" Llana +(29535,0,0,257,0, NULL), -- Alchemist Cinesra +(29537,0,0,257,0, NULL), -- Darahir +(29538,0,0,257,0, NULL), -- Hexil Garrot +(29547,0,0,257,0, NULL), -- Applebough +(29548,0,0,257,0, NULL), -- Aimee +(29568,0,0,1,0, NULL), -- "Techs" Rickard Rustbolt +(29628,0,0,257,0, NULL), -- Angelique Butler +(29636,0,0,257,0, NULL), -- Hagatha Moorehead +(29640,0,0,257,0, NULL), -- Josie Birch +(29641,0,0,257,0, NULL), -- Theresa Wolf +(29660,0,0,1,0, NULL), -- Grand Marauder Sai +(29665,0,0,1,0, NULL), -- Pazik "The Pick" Prylock +(29667,0,0,1,0, NULL), -- Warsong Gulch Portal +(29668,0,0,1,0, NULL), -- Arathi Basin Portal +(29669,0,0,1,0, NULL), -- Alterac Valley Portal +(29670,0,0,1,0, NULL), -- Eye of the Storm Portal +(29671,0,0,1,0, NULL), -- Strand of the Ancients Portal +(29673,0,0,1,0, NULL), -- Arathi Basin Portal +(29675,0,0,1,0, NULL), -- Eye of the Storm Portal +(29702,0,0,257,0, NULL), -- Chameli Banaphash +(29703,0,0,257,0, NULL), -- Sheddle Glossgleam +(29714,0,0,1,0, NULL), -- Lucian Trias +(29715,0,0,257,0, NULL), -- Fialla Sweetberry +(29716,0,0,257,0, NULL), -- Clockwork Assistant +(29763,0,0,1,0, NULL), -- Cosmetic Totem Alliance Air +(29764,0,0,1,0, NULL), -- Cosmetic Totem Alliance Earth +(29765,0,0,1,0, NULL), -- Cosmetic Totem Alliance Fire +(29766,0,0,1,0, NULL), -- Cosmetic Totem Alliance Water +(29777,0,0,1,0, NULL), -- Cosmetic Mechanical Gorilla +(29780,0,0,1,0, NULL), -- Cosmetic Mechanical Chicken +(29781,0,0,1,0, NULL), -- Cosmetic Mechanical Squirrel +(29782,0,0,1,0, NULL), -- Cosmetic Mechanical Sheep +(29783,0,0,1,0, NULL), -- Cosmetic Clockwork Robot +(29784,0,0,1,0, NULL), -- Cosmetic Clockwork Robot (Blue) +(29785,0,0,1,0, NULL), -- Cosmetic Clockwork Robot (Red) +(29802,0,0,1,0, NULL), -- Cosmetic Toy Plane +(29807,0,0,1,0, NULL), -- [DND] Dalaran Toy Store Plane String Hook +(29812,0,0,1,0, NULL), -- [DND] Dalaran Toy Store Plane String Bunny +(30094,0,0,1,0, NULL), -- Dalaran Sewer Rat +(30095,0,0,1,0, NULL), -- Dalaran Sewer Turtle +(30104,0,1,257,0, NULL), -- Adamman the Trader +(30115,0,0,2,0, NULL), -- Vereesa Windrunner +(30116,0,0,1,0, NULL), -- Archmage Aethas Sunreaver +(30117,0,0,1,0, NULL), -- Archmage Modera +(30137,0,0,1,0, NULL), -- Shifty Vickers +(30164,0,0,133121,0, NULL), -- Cavedweller Worg +(30352,0,0,256,0, NULL), -- Skybreaker Marine +(30490,0,0,1,0, NULL), -- Rin Duoctane +(30604,0,0,257,0, NULL), -- Teller Almeida +(30605,0,0,257,0, NULL), -- Teller Gee +(30607,0,0,257,0, NULL), -- Teller Plushner +(30659,0,0,1,0, NULL), -- Violet Hold Guard +(30726,0,0,257,0, NULL), -- Archivist Betha +(30755,0,0,256,0, NULL), -- Kor'kron Reaver +(30885,0,0,1,0, NULL), -- Blazik Fireclaw +(31032,0,0,1,0, NULL), -- Derek Odds +(31080,0,0,1,0, NULL), -- Warden Alturas +(31081,0,0,1,0, NULL), -- Officer Van Rossem +(31228,0,0,1,0, NULL), -- Grove Walker +(31236,0,0,1,0, NULL), -- Dappled Stag +(31439,0,0,1,0, NULL), -- Archmage Timear +(31517,0,0,1,0, NULL), -- Dalaran Fountain Invis Stalker +(31557,0,0,1,0, NULL), -- Uda the Beast +(31580,0,0,1,0, NULL), -- Arcanist Ivrenne +(31643,0,0,1,0, NULL), -- Dalaran Well Teleport Bunny +(31730,0,0,1,0, NULL), -- Cosmetic Frog +(32169,0,0,1,0, NULL), -- Arcanist Braedin +(32170,0,0,1,0, NULL), -- Magister Surdiel +(32172,0,0,257,0, NULL), -- Harold Winston +(32216,0,0,257,0, NULL), -- Mei Francis +(32249,0,0,1,0, NULL), -- Worg Pup +(32265,0,50331648,1,0, NULL), -- Northrend Daily Dungeon Image Bunny +(32321,0,0,1,0, NULL), -- Green Warrior +(32322,0,0,1,0, NULL), -- Gold Warrior +(32328,0,0,1,0, NULL), -- [DND] Dalaran Sewer Arena - Controller - Death +(32329,0,0,1,0, NULL), -- Kanika Goldwell +(32330,0,0,1,0, NULL), -- Minzi the Minx +(32332,0,0,1,0, NULL), -- Ramik Slamwrench +(32333,0,0,1,0, NULL), -- "Dapper" Danik Blackshaft +(32334,0,0,1,0, NULL), -- Nixi Fireclaw +(32337,0,0,257,0, NULL), -- Christi Stockton +(32339,0,0,1,0, NULL), -- [DND] Dalaran Sewer Arena - Controller +(32340,0,0,1,0, NULL), -- Gold Shaman +(32342,0,0,1,0, NULL), -- Green Paladin +(32403,0,0,1,0, NULL), -- Sandra Bartan +(32411,0,0,257,0, NULL), -- Afsaneh Asrar +(32413,0,0,1,0, NULL), -- Isirami Fairwind +(32416,0,0,1,0, NULL), -- Stefen Cotter +(32421,0,0,1,0, NULL), -- Marcella Bloom +(32424,0,0,1,0, NULL), -- Laire Brewgold +(32425,0,0,1,0, NULL), -- Galkara the Assassin +(32426,0,0,1,0, NULL), -- Coira Longrifle +(32428,0,0,1,0, NULL), -- Underbelly Rat +(32435,0,0,1,0, NULL), -- Vern +(32441,0,0,1,0, NULL), -- Underbelly Croc +(32450,0,3,1,0, NULL), -- Badluck +(32451,0,0,257,0, NULL), -- Dalaran Citizen +(32466,0,0,1,0, NULL), -- Monstrous Underbelly Rat +(32470,0,0,1,0, NULL), -- Sewer Frog +(32509,0,0,257,0, NULL), -- Brammold Deepmine +(32514,0,0,257,0, NULL), -- Vanessa Sellers +(32515,0,0,257,0, NULL), -- Braeg Stoutbeard +(32516,0,3,257,0, NULL), -- Washed-Up Mage +(32606,0,0,1,0, NULL), -- [DND] Cosmetic Book +(32641,0,0,1,0, NULL), -- Drix Blackwrench +(32650,0,3,1,0, NULL), -- Wounded Dalaran Protector +(32651,0,7,1,0, NULL), -- Wounded Dalaran Shield Guard +(32652,0,3,1,0, NULL), -- Wounded Dalaran Watcher +(32653,0,7,1,0, NULL), -- Wounded Dalaran Serpent +(32664,0,0,1,0, NULL), -- Segacedi +(32668,0,0,257,0, NULL), -- Emi +(32669,0,0,257,0, NULL), -- Colin +(32675,0,0,257,0, NULL), -- Babagahnoosh the Grumpy +(32676,0,0,257,0, NULL), -- Grindle Firespark +(32677,0,0,257,0, NULL), -- Whirt the All-Knowing +(32678,0,0,257,0, NULL), -- Emeline Fizzlefry +(32679,0,0,257,0, NULL), -- Darthalia Ebonscorch +(32680,0,0,257,0, NULL), -- Fabioso the Fabulous +(32681,0,0,257,0, NULL), -- The Magnificent Merleaux +(32683,0,0,257,0, NULL), -- Grezla the Hag +(32684,0,0,257,0, NULL), -- Mona Everspring +(32685,0,0,257,0, NULL), -- Kitz Proudbreeze +(32686,0,0,257,0, NULL), -- Crafticus Mindbender +(32687,0,0,257,0, NULL), -- Linda Ann Kastinglow +(32688,0,0,257,0, NULL), -- Archmage Tenaj +(32689,0,0,257,0, NULL), -- Adorean Lew +(32690,0,0,257,0, NULL), -- Bitty Frostflinger +(32691,0,0,257,0, NULL), -- Magus Fansy Goodbringer +(32692,0,0,257,0, NULL), -- Arcanist Alec +(32693,0,0,257,0, NULL), -- Sabriana Sorrowgaze +(32709,0,0,1,0, NULL), -- Hunaka Greenhoof +(32711,0,0,1,0, NULL), -- Warp-Huntress Kula +(32721,0,0,1,0, NULL), -- Felcaster Virim +(32722,0,0,1,0, NULL), -- Warmage Lukems +(32723,0,0,257,0, NULL), -- Warmage Kath'leen +(32724,0,0,1,0, NULL), -- Warmage Mumplina +(32725,0,0,1,0, NULL), -- Warmage Silva +(32726,0,0,257,0, NULL), -- The Chooch +(32727,0,0,257,0, NULL), -- Natalie Tootiblare +(32728,0,0,257,0, NULL), -- Illusionist Karina +(32729,0,0,257,0, NULL), -- Lofwyr Le'Fleur +(32730,0,0,257,0, NULL), -- Goldlilly Gleamingfell +(32731,0,0,257,0, NULL), -- Metopious Loreseeker +(32732,0,0,257,0, NULL), -- Dorfus Alphamage +(32733,0,0,257,0, NULL), -- Joboba Mezbreaker +(32743,0,1,1,0, NULL), -- Willard Blauvelt +(32744,0,0,1,0, NULL), -- Bakor the Gangly +(32745,0,0,1,0, NULL), -- Amera Sky +(32746,0,0,1,0, NULL), -- Geffon the Unruly +(32747,0,0,1,0, NULL), -- Mendez Nightshadow +(32749,0,1,1,0, NULL), -- Tuff Gorehoof +(32751,0,0,1,0, NULL), -- Backbiter +(32843,0,0,1,0, NULL), -- Tabea +(32844,0,0,1,0, NULL), -- Apollo +(33026,0,0,1,0, NULL), -- Sarah Brady +(33027,0,0,257,0, NULL), -- Jessica Sellers +(33422,0,0,1,0, NULL), -- Unbound Seer +(33778,0,1,1,0, NULL), -- Tournament Hippogryph +(33936,0,0,1,0, NULL), -- Nargle Lashcord +(33937,0,0,1,0, NULL), -- Xazi Smolderpipe +(33938,0,0,1,0, NULL), -- Zom Bocom +(33964,0,0,1,0, NULL), -- Arcanist Firael +(34095,0,0,1,0, NULL), -- Trapjaw Rix +(34252,0,0,257,0, NULL), -- Dubin Clay +(34330,0,3,1,0, NULL), -- Jones +(34952,0,0,1,0, NULL), -- Isle of Conquest Portal +(34953,0,0,1,0, NULL), -- Isle of Conquest Portal +(34984,0,0,1,0, NULL), -- World Trigger (Not Floating) +(35471,0,0,1,0, NULL), -- Sorn Proudmane +(35494,0,0,1,0, NULL), -- Arcanist Miluria +(35496,0,0,257,0, NULL), -- Rueben Lauren +(35497,0,0,257,0, NULL), -- Rafael Langrom +(35498,0,0,257,0, NULL), -- Horace Hunderland +(35500,0,0,257,0, NULL), -- Matilda Brightlink +(35507,0,0,1,0, NULL), -- Enchanter Isian +(35608,0,0,1,0, NULL), -- [DND] Dalaran Argent Tournament Herald Bunny +(35790,0,0,257,0, NULL), -- Usuri Brightcoin +(35826,0,1,1,0, NULL), -- Kaye Toogie +(36506,0,0,1,0, NULL), -- Daros Moonlance +(36669,0,0,1,0, NULL), -- Arcanist Tybalin +(36774,0,0,1,0, NULL), -- Silver Covenant Agent +(36776,0,0,1,0, NULL), -- Sunreaver Agent +(36851,0,0,1,0, NULL), -- Aquanos +(36856,0,0,1,0, NULL), -- Shandy Glossgleam +(37221,0,0,1,0, NULL), -- Lady Jaina Proudmoore +(37225,0,0,0,0, NULL), -- Uther the Lightbringer +(37226,0,0,1,0, NULL), -- The Lich King +(37582,0,0,1,0, NULL), -- Archmage Koreln +(37704,0,0,1,0, NULL), -- Frostmourne Altar Bunny (Quel'Delar) +(37776,0,0,1,0, NULL), -- Apprentice Nelphi +(37780,0,0,2,0, NULL), -- Dark Ranger Vorel +(37849,0,50331648,0,0, NULL), -- Sartharion Image +(37906,0,50331648,1,0, NULL), -- Imprisoned Soul +(37942,0,0,1,0, NULL), -- Arcanist Uovril +(38112,0,0,1,0, NULL), -- Falric +(38113,0,0,1,0, NULL), -- Marwyn +(38172,0,0,1,0, NULL), -- Phantom Mage +(38173,0,0,1,0, NULL), -- Spectral Footman +(38175,0,0,1,0, NULL), -- Ghostly Priest +(38176,0,0,1,0, NULL), -- Tortured Rifleman +(38177,0,0,1,0, NULL), -- Shadowy Mercenary +(38567,0,0,1,0, NULL), -- Phantom Hallucination +(40160,31837,0,257,0, NULL), -- Frozo the Renowned +(7549,0,0,1,0, NULL); -- Tree Frog + +-- Model updates +UPDATE `creature_model_info` SET `bounding_radius`=0,`combat_reach`=0,`gender`=2 WHERE `modelid`=22471; -- Tournament Hippogryph +UPDATE `creature_model_info` SET `bounding_radius`=0,`combat_reach`=0,`gender`=2 WHERE `modelid`=26484; -- Alterac Valley Portal +UPDATE `creature_model_info` SET `bounding_radius`=0,`combat_reach`=0,`gender`=2 WHERE `modelid`=26495; -- Arathi Basin Portal +UPDATE `creature_model_info` SET `bounding_radius`=0,`combat_reach`=0,`gender`=2 WHERE `modelid`=26496; -- Arathi Basin Portal +UPDATE `creature_model_info` SET `bounding_radius`=0,`combat_reach`=0,`gender`=2 WHERE `modelid`=26499; -- Eye of the Storm Portal +UPDATE `creature_model_info` SET `bounding_radius`=0,`combat_reach`=0,`gender`=2 WHERE `modelid`=26501; -- Eye of the Storm Portal +UPDATE `creature_model_info` SET `bounding_radius`=0,`combat_reach`=0,`gender`=2 WHERE `modelid`=26502; -- Warsong Gulch Portal +UPDATE `creature_model_info` SET `bounding_radius`=0,`combat_reach`=0,`gender`=2 WHERE `modelid`=26504; -- Strand of the Ancients Portal +UPDATE `creature_model_info` SET `bounding_radius`=0,`combat_reach`=0,`gender`=2 WHERE `modelid`=29743; -- Isle of Conquest Portal +UPDATE `creature_model_info` SET `bounding_radius`=0,`combat_reach`=0,`gender`=2 WHERE `modelid`=29744; -- Isle of Conquest Portal +UPDATE `creature_model_info` SET `bounding_radius`=0,`combat_reach`=1,`gender`=0 WHERE `modelid`=251; -- Colin +UPDATE `creature_model_info` SET `bounding_radius`=0,`combat_reach`=1,`gender`=1 WHERE `modelid`=21270; -- Dalaran Visitor +UPDATE `creature_model_info` SET `bounding_radius`=0,`combat_reach`=1,`gender`=1 WHERE `modelid`=80; -- Emi +UPDATE `creature_model_info` SET `bounding_radius`=0,`combat_reach`=1,`gender`=2 WHERE `modelid`=2176; -- Cosmetic Rat +UPDATE `creature_model_info` SET `bounding_radius`=0,`combat_reach`=1,`gender`=2 WHERE `modelid`=25870; -- Mekgineer's Chopper +UPDATE `creature_model_info` SET `bounding_radius`=0,`combat_reach`=2,`gender`=2 WHERE `modelid`=26759; -- Dalaran Sewer Rat +UPDATE `creature_model_info` SET `bounding_radius`=0,`combat_reach`=4,`gender`=2 WHERE `modelid`=27243; -- Wooly Mammoth +UPDATE `creature_model_info` SET `bounding_radius`=0,`combat_reach`=4,`gender`=2 WHERE `modelid`=27972; -- Monstrous Underbelly Rat +UPDATE `creature_model_info` SET `bounding_radius`=0.00235,`combat_reach`=0,`gender`=2 WHERE `modelid`=7804; -- [DND] Dalaran Argent Tournament Herald Bunny +UPDATE `creature_model_info` SET `bounding_radius`=0.03,`combat_reach`=0,`gender`=2 WHERE `modelid`=26557; -- Cosmetic Toy Plane +UPDATE `creature_model_info` SET `bounding_radius`=0.0937,`combat_reach`=0,`gender`=2 WHERE `modelid`=26530; -- Cosmetic Clockwork Robot (Blue) +UPDATE `creature_model_info` SET `bounding_radius`=0.0937,`combat_reach`=0,`gender`=2 WHERE `modelid`=26531; -- Cosmetic Clockwork Robot (Red) +UPDATE `creature_model_info` SET `bounding_radius`=0.0937,`combat_reach`=0,`gender`=2 WHERE `modelid`=26547; -- Cosmetic Clockwork Robot +UPDATE `creature_model_info` SET `bounding_radius`=0.1,`combat_reach`=0,`gender`=2 WHERE `modelid`=24897; -- Wild Flower +UPDATE `creature_model_info` SET `bounding_radius`=0.1,`combat_reach`=0,`gender`=2 WHERE `modelid`=24898; -- Wild Flower +UPDATE `creature_model_info` SET `bounding_radius`=0.12,`combat_reach`=0,`gender`=2 WHERE `modelid`=24895; -- Wild Flower +UPDATE `creature_model_info` SET `bounding_radius`=0.125,`combat_reach`=0,`gender`=2 WHERE `modelid`=17188; -- Invisible Stalker (Scale x0.5) +UPDATE `creature_model_info` SET `bounding_radius`=0.125,`combat_reach`=0,`gender`=2 WHERE `modelid`=17200; -- Northrend Daily Dungeon Image Bunny +UPDATE `creature_model_info` SET `bounding_radius`=0.15,`combat_reach`=0,`gender`=2 WHERE `modelid`=23574; -- Phoenix Hatchling +UPDATE `creature_model_info` SET `bounding_radius`=0.175,`combat_reach`=0,`gender`=2 WHERE `modelid`=23501; -- Steam Burst +UPDATE `creature_model_info` SET `bounding_radius`=0.18,`combat_reach`=1,`gender`=2 WHERE `modelid`=30799; -- Sartharion Image +UPDATE `creature_model_info` SET `bounding_radius`=0.186,`combat_reach`=0,`gender`=2 WHERE `modelid`=28212; -- Backbiter +UPDATE `creature_model_info` SET `bounding_radius`=0.187,`combat_reach`=0,`gender`=2 WHERE `modelid`=1160; -- Spider +UPDATE `creature_model_info` SET `bounding_radius`=0.187,`combat_reach`=0,`gender`=2 WHERE `modelid`=2536; -- Spider +UPDATE `creature_model_info` SET `bounding_radius`=0.2,`combat_reach`=0,`gender`=2 WHERE `modelid`=26517; -- Cosmetic Totem Alliance Air +UPDATE `creature_model_info` SET `bounding_radius`=0.2,`combat_reach`=0,`gender`=2 WHERE `modelid`=26518; -- Cosmetic Totem Alliance Earth +UPDATE `creature_model_info` SET `bounding_radius`=0.2,`combat_reach`=0,`gender`=2 WHERE `modelid`=26519; -- Cosmetic Totem Alliance Fire +UPDATE `creature_model_info` SET `bounding_radius`=0.2,`combat_reach`=0,`gender`=2 WHERE `modelid`=26521; -- Cosmetic Totem Alliance Water +UPDATE `creature_model_info` SET `bounding_radius`=0.208,`combat_reach`=1,`gender`=1 WHERE `modelid`=15253; -- League of Arathor Emissary +UPDATE `creature_model_info` SET `bounding_radius`=0.208,`combat_reach`=1,`gender`=1 WHERE `modelid`=25605; -- Amisi Azuregaze +UPDATE `creature_model_info` SET `bounding_radius`=0.208,`combat_reach`=1,`gender`=1 WHERE `modelid`=25608; -- Susana Averoy +UPDATE `creature_model_info` SET `bounding_radius`=0.208,`combat_reach`=1,`gender`=1 WHERE `modelid`=25620; -- Dorothy Egan +UPDATE `creature_model_info` SET `bounding_radius`=0.208,`combat_reach`=1,`gender`=1 WHERE `modelid`=25621; -- Katherine Lee +UPDATE `creature_model_info` SET `bounding_radius`=0.208,`combat_reach`=1,`gender`=1 WHERE `modelid`=25636; -- Endora Moorehead +UPDATE `creature_model_info` SET `bounding_radius`=0.208,`combat_reach`=1,`gender`=1 WHERE `modelid`=25637; -- Palja Amboss +UPDATE `creature_model_info` SET `bounding_radius`=0.208,`combat_reach`=1,`gender`=1 WHERE `modelid`=25645; -- Tiffany Cartier +UPDATE `creature_model_info` SET `bounding_radius`=0.208,`combat_reach`=1,`gender`=1 WHERE `modelid`=25647; -- Larana Drome +UPDATE `creature_model_info` SET `bounding_radius`=0.208,`combat_reach`=1,`gender`=1 WHERE `modelid`=25648; -- Patricia Egan +UPDATE `creature_model_info` SET `bounding_radius`=0.208,`combat_reach`=1,`gender`=1 WHERE `modelid`=25649; -- Dominique Stefano +UPDATE `creature_model_info` SET `bounding_radius`=0.208,`combat_reach`=1,`gender`=1 WHERE `modelid`=25655; -- Marcia Chase +UPDATE `creature_model_info` SET `bounding_radius`=0.208,`combat_reach`=1,`gender`=1 WHERE `modelid`=25674; -- Elizabeth Ross +UPDATE `creature_model_info` SET `bounding_radius`=0.208,`combat_reach`=1,`gender`=1 WHERE `modelid`=25807; -- Jessa Weaver +UPDATE `creature_model_info` SET `bounding_radius`=0.208,`combat_reach`=1,`gender`=1 WHERE `modelid`=25878; -- Valerie Langrom +UPDATE `creature_model_info` SET `bounding_radius`=0.208,`combat_reach`=1,`gender`=1 WHERE `modelid`=25880; -- Abra Cadabra +UPDATE `creature_model_info` SET `bounding_radius`=0.208,`combat_reach`=1,`gender`=1 WHERE `modelid`=25881; -- Griselda Hunderland +UPDATE `creature_model_info` SET `bounding_radius`=0.208,`combat_reach`=1,`gender`=1 WHERE `modelid`=25983; -- Aerith Primrose +UPDATE `creature_model_info` SET `bounding_radius`=0.208,`combat_reach`=1,`gender`=1 WHERE `modelid`=26311; -- Kerta the Bold +UPDATE `creature_model_info` SET `bounding_radius`=0.208,`combat_reach`=1,`gender`=1 WHERE `modelid`=26377; -- Linna Bruder +UPDATE `creature_model_info` SET `bounding_radius`=0.208,`combat_reach`=1,`gender`=1 WHERE `modelid`=26390; -- Angelique Butler +UPDATE `creature_model_info` SET `bounding_radius`=0.208,`combat_reach`=1,`gender`=1 WHERE `modelid`=26396; -- Debbi Moore +UPDATE `creature_model_info` SET `bounding_radius`=0.208,`combat_reach`=1,`gender`=1 WHERE `modelid`=26397; -- Hagatha Moorehead +UPDATE `creature_model_info` SET `bounding_radius`=0.208,`combat_reach`=1,`gender`=1 WHERE `modelid`=26398; -- Josie Birch +UPDATE `creature_model_info` SET `bounding_radius`=0.208,`combat_reach`=1,`gender`=1 WHERE `modelid`=26414; -- Grand Marauder Sai +UPDATE `creature_model_info` SET `bounding_radius`=0.208,`combat_reach`=1,`gender`=1 WHERE `modelid`=26438; -- Chameli Banaphash +UPDATE `creature_model_info` SET `bounding_radius`=0.208,`combat_reach`=1,`gender`=1 WHERE `modelid`=26440; -- Christi Stockton +UPDATE `creature_model_info` SET `bounding_radius`=0.208,`combat_reach`=1,`gender`=1 WHERE `modelid`=27287; -- Archivist Betha +UPDATE `creature_model_info` SET `bounding_radius`=0.208,`combat_reach`=1,`gender`=1 WHERE `modelid`=27782; -- Theresa Wolf +UPDATE `creature_model_info` SET `bounding_radius`=0.208,`combat_reach`=1,`gender`=1 WHERE `modelid`=27822; -- Mei Francis +UPDATE `creature_model_info` SET `bounding_radius`=0.208,`combat_reach`=1,`gender`=1 WHERE `modelid`=27944; -- Warmage Mumplina +UPDATE `creature_model_info` SET `bounding_radius`=0.208,`combat_reach`=1,`gender`=1 WHERE `modelid`=27952; -- Sandra Bartan +UPDATE `creature_model_info` SET `bounding_radius`=0.208,`combat_reach`=1,`gender`=1 WHERE `modelid`=27954; -- Afsaneh Asrar +UPDATE `creature_model_info` SET `bounding_radius`=0.208,`combat_reach`=1,`gender`=1 WHERE `modelid`=27962; -- Marcella Bloom +UPDATE `creature_model_info` SET `bounding_radius`=0.208,`combat_reach`=1,`gender`=1 WHERE `modelid`=27999; -- Vanessa Sellers +UPDATE `creature_model_info` SET `bounding_radius`=0.208,`combat_reach`=1,`gender`=1 WHERE `modelid`=28125; -- Wounded Dalaran Watcher +UPDATE `creature_model_info` SET `bounding_radius`=0.208,`combat_reach`=1,`gender`=1 WHERE `modelid`=28150; -- Grezla the Hag +UPDATE `creature_model_info` SET `bounding_radius`=0.208,`combat_reach`=1,`gender`=1 WHERE `modelid`=28155; -- Linda Ann Kastinglow +UPDATE `creature_model_info` SET `bounding_radius`=0.208,`combat_reach`=1,`gender`=1 WHERE `modelid`=28166; -- Illusionist Karina +UPDATE `creature_model_info` SET `bounding_radius`=0.208,`combat_reach`=1,`gender`=1 WHERE `modelid`=28202; -- Amera Sky +UPDATE `creature_model_info` SET `bounding_radius`=0.208,`combat_reach`=1,`gender`=1 WHERE `modelid`=28317; -- Tabea +UPDATE `creature_model_info` SET `bounding_radius`=0.208,`combat_reach`=1,`gender`=1 WHERE `modelid`=28433; -- Jessica Sellers +UPDATE `creature_model_info` SET `bounding_radius`=0.208,`combat_reach`=1,`gender`=1 WHERE `modelid`=30764; -- Apprentice Nelphi +UPDATE `creature_model_info` SET `bounding_radius`=0.2288,`combat_reach`=1,`gender`=1 WHERE `modelid`=24916; -- Warmage Kath'leen +UPDATE `creature_model_info` SET `bounding_radius`=0.2288,`combat_reach`=1,`gender`=1 WHERE `modelid`=25947; -- Archmage Celindra +UPDATE `creature_model_info` SET `bounding_radius`=0.236,`combat_reach`=1,`gender`=1 WHERE `modelid`=27333; -- Kor'kron Reaver +UPDATE `creature_model_info` SET `bounding_radius`=0.236,`combat_reach`=1,`gender`=1 WHERE `modelid`=28185; -- Warp-Huntress Kula +UPDATE `creature_model_info` SET `bounding_radius`=0.236,`combat_reach`=1,`gender`=1 WHERE `modelid`=28208; -- Galkara the Assassin +UPDATE `creature_model_info` SET `bounding_radius`=0.2429,`combat_reach`=1,`gender`=2 WHERE `modelid`=850; -- Felhunter +UPDATE `creature_model_info` SET `bounding_radius`=0.25,`combat_reach`=0,`gender`=2 WHERE `modelid`=16259; -- Dalaran Sewer Turtle +UPDATE `creature_model_info` SET `bounding_radius`=0.25,`combat_reach`=0,`gender`=2 WHERE `modelid`=5448; -- Cosmetic Cat Set 2/2 +UPDATE `creature_model_info` SET `bounding_radius`=0.25,`combat_reach`=0,`gender`=2 WHERE `modelid`=5554; -- Jones +UPDATE `creature_model_info` SET `bounding_radius`=0.25,`combat_reach`=0,`gender`=2 WHERE `modelid`=5556; -- Badluck +UPDATE `creature_model_info` SET `bounding_radius`=0.25,`combat_reach`=0,`gender`=2 WHERE `modelid`=5966; -- Wounded Dalaran Serpent +UPDATE `creature_model_info` SET `bounding_radius`=0.26,`combat_reach`=1,`gender`=1 WHERE `modelid`=26771; -- Archmage Modera +UPDATE `creature_model_info` SET `bounding_radius`=0.2625,`combat_reach`=0,`gender`=2 WHERE `modelid`=26524; -- Cosmetic Mechanical Gorilla +UPDATE `creature_model_info` SET `bounding_radius`=0.263347,`combat_reach`=0,`gender`=2 WHERE `modelid`=16885; -- Ravager Specimen +UPDATE `creature_model_info` SET `bounding_radius`=0.275,`combat_reach`=0,`gender`=2 WHERE `modelid`=28318; -- Apollo +UPDATE `creature_model_info` SET `bounding_radius`=0.2912,`combat_reach`=2,`gender`=1 WHERE `modelid`=30977; -- Phantom Hallucination +UPDATE `creature_model_info` SET `bounding_radius`=0.2912,`combat_reach`=2,`gender`=1 WHERE `modelid`=30977; -- Phantom Mage +UPDATE `creature_model_info` SET `bounding_radius`=0.3,`combat_reach`=0,`gender`=2 WHERE `modelid`=27720; -- Cosmetic Worg Pup +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=23337; -- Warmage Silva +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=24607; -- Sebastian Bower +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=25166; -- Archmage Pentarus +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=25609; -- "Red" Jack Findle +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=25611; -- Alard Schmied +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=25613; -- Timofey Oshenko +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=25614; -- Jedidiah Handers +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=25615; -- Charles Worth +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=25623; -- Angelo Pescatore +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=25646; -- Bryan Landers +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=25650; -- Edward Egan +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=25651; -- Dorian Fines +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=25673; -- Andrew Matthews +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=25876; -- Anthony Durain +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=26075; -- Timothy Jones +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=26138; -- Torgo the Younger +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=26307; -- Jarold Puller +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=26309; -- Shen Kang Cheng +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=26310; -- Norvin Alderman +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=26312; -- Walther Whiteford +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=26313; -- Bartram Haller +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=26338; -- Orland Schaeffer +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=26362; -- Schembari "Uncle Sal" Shearbolt +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=26372; -- Binzik Goldbook +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=26373; -- Ajay Green +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=26391; -- "Techs" Rickard Rustbolt +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=26395; -- Orton Bennet +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=26417; -- Pazik "The Pick" Prylock +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=26444; -- Hexil Garrot +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=26445; -- Alchemist Cinesra +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=26463; -- Nargle Lashcord +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=26465; -- Zom Bocom +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=26766; -- Adamman the Trader +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=26779; -- Shifty Vickers +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=26997; -- Skybreaker Marine +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=26998; -- Skybreaker Marine +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=27068; -- Rin Duoctane +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=27157; -- Teller Almeida +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=27158; -- Teller Gee +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=27160; -- Teller Plushner +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=27334; -- Kor'kron Reaver +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=27398; -- Blazik Fireclaw +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=27449; -- Derek Odds +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=27799; -- Harold Winston +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=27910; -- Ramik Slamwrench +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=27911; -- "Dapper" Danik Blackshaft +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=27915; -- Lucian Trias +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=27958; -- Stefen Cotter +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=28006; -- Washed-Up Mage +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=28120; -- Drix Blackwrench +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=28123; -- Wounded Dalaran Protector +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=28124; -- Wounded Dalaran Shield Guard +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=28145; -- Whirt the All-Knowing +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=28149; -- The Magnificent Merleaux +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=28154; -- Crafticus Mindbender +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=28159; -- Adorean Lew +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=28161; -- Magus Fansy Goodbringer +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=28164; -- The Chooch +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=28203; -- Geffon the Unruly +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=29833; -- Horace Hunderland +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=29835; -- Rafael Langrom +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=29836; -- Rueben Lauren +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=30685; -- Archmage Koreln +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=1 WHERE `modelid`=25955; -- Kizi Copperclip +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=1 WHERE `modelid`=26335; -- Namha Moonwater +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=1 WHERE `modelid`=26347; -- Ninsianna +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=1 WHERE `modelid`=26375; -- Didi the Wrench +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=1 WHERE `modelid`=26386; -- "Baroness" Llana +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=1 WHERE `modelid`=26464; -- Xazi Smolderpipe +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=1 WHERE `modelid`=27908; -- Kanika Goldwell +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=1 WHERE `modelid`=27909; -- Minzi the Minx +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=1 WHERE `modelid`=27912; -- Nixi Fireclaw +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=1 WHERE `modelid`=29921; -- Usuri Brightcoin +UPDATE `creature_model_info` SET `bounding_radius`=0.3068,`combat_reach`=1,`gender`=1 WHERE `modelid`=27616; -- Uda the Beast +UPDATE `creature_model_info` SET `bounding_radius`=0.3366,`combat_reach`=1,`gender`=0 WHERE `modelid`=27215; -- Violet Hold Guard +UPDATE `creature_model_info` SET `bounding_radius`=0.3366,`combat_reach`=1,`gender`=0 WHERE `modelid`=27216; -- Violet Hold Guard +UPDATE `creature_model_info` SET `bounding_radius`=0.3366,`combat_reach`=1,`gender`=0 WHERE `modelid`=27217; -- Violet Hold Guard +UPDATE `creature_model_info` SET `bounding_radius`=0.3366,`combat_reach`=1,`gender`=0 WHERE `modelid`=29076; -- Trapjaw Rix +UPDATE `creature_model_info` SET `bounding_radius`=0.347,`combat_reach`=1,`gender`=0 WHERE `modelid`=21273; -- Dalaran Visitor +UPDATE `creature_model_info` SET `bounding_radius`=0.347,`combat_reach`=1,`gender`=0 WHERE `modelid`=25644; -- Ranid Glowergold +UPDATE `creature_model_info` SET `bounding_radius`=0.347,`combat_reach`=1,`gender`=0 WHERE `modelid`=26321; -- Bragund Brightlink +UPDATE `creature_model_info` SET `bounding_radius`=0.347,`combat_reach`=1,`gender`=0 WHERE `modelid`=27332; -- Skybreaker Marine +UPDATE `creature_model_info` SET `bounding_radius`=0.347,`combat_reach`=1,`gender`=0 WHERE `modelid`=27998; -- Brammold Deepmine +UPDATE `creature_model_info` SET `bounding_radius`=0.347,`combat_reach`=1,`gender`=0 WHERE `modelid`=28000; -- Braeg Stoutbeard +UPDATE `creature_model_info` SET `bounding_radius`=0.347,`combat_reach`=1,`gender`=0 WHERE `modelid`=28170; -- Dorfus Alphamage +UPDATE `creature_model_info` SET `bounding_radius`=0.347,`combat_reach`=1,`gender`=0 WHERE `modelid`=29145; -- Dubin Clay +UPDATE `creature_model_info` SET `bounding_radius`=0.347,`combat_reach`=1,`gender`=1 WHERE `modelid`=26299; -- Dagna Flintlock +UPDATE `creature_model_info` SET `bounding_radius`=0.347,`combat_reach`=1,`gender`=1 WHERE `modelid`=27963; -- Laire Brewgold +UPDATE `creature_model_info` SET `bounding_radius`=0.347,`combat_reach`=1,`gender`=1 WHERE `modelid`=27965; -- Coira Longrifle +UPDATE `creature_model_info` SET `bounding_radius`=0.347,`combat_reach`=1,`gender`=1 WHERE `modelid`=29834; -- Matilda Brightlink +UPDATE `creature_model_info` SET `bounding_radius`=0.3519,`combat_reach`=1,`gender`=0 WHERE `modelid`=25618; -- Professor Pallin +UPDATE `creature_model_info` SET `bounding_radius`=0.3519,`combat_reach`=1,`gender`=0 WHERE `modelid`=26078; -- Windle Sparkshine +UPDATE `creature_model_info` SET `bounding_radius`=0.3519,`combat_reach`=1,`gender`=0 WHERE `modelid`=26300; -- Jepetto Joybuzz +UPDATE `creature_model_info` SET `bounding_radius`=0.3519,`combat_reach`=1,`gender`=0 WHERE `modelid`=26374; -- Findle Whistlesteam +UPDATE `creature_model_info` SET `bounding_radius`=0.3519,`combat_reach`=1,`gender`=0 WHERE `modelid`=26437; -- Sheddle Glossgleam +UPDATE `creature_model_info` SET `bounding_radius`=0.3519,`combat_reach`=1,`gender`=0 WHERE `modelid`=27465; -- Warden Alturas +UPDATE `creature_model_info` SET `bounding_radius`=0.3519,`combat_reach`=1,`gender`=0 WHERE `modelid`=28143; -- Babagahnoosh the Grumpy +UPDATE `creature_model_info` SET `bounding_radius`=0.3519,`combat_reach`=1,`gender`=0 WHERE `modelid`=28144; -- Grindle Firespark +UPDATE `creature_model_info` SET `bounding_radius`=0.3519,`combat_reach`=1,`gender`=0 WHERE `modelid`=28162; -- Arcanist Alec +UPDATE `creature_model_info` SET `bounding_radius`=0.3519,`combat_reach`=1,`gender`=0 WHERE `modelid`=28167; -- Lofwyr Le'Fleur +UPDATE `creature_model_info` SET `bounding_radius`=0.3519,`combat_reach`=1,`gender`=0 WHERE `modelid`=28199; -- Bakor the Gangly +UPDATE `creature_model_info` SET `bounding_radius`=0.3519,`combat_reach`=1,`gender`=0 WHERE `modelid`=30358; -- Shandy Glossgleam +UPDATE `creature_model_info` SET `bounding_radius`=0.3519,`combat_reach`=1,`gender`=1 WHERE `modelid`=25602; -- Inzi Charmlight +UPDATE `creature_model_info` SET `bounding_radius`=0.3519,`combat_reach`=1,`gender`=1 WHERE `modelid`=25619; -- Linzy Blackbolt +UPDATE `creature_model_info` SET `bounding_radius`=0.3519,`combat_reach`=1,`gender`=1 WHERE `modelid`=26378; -- Lalla Brightweave +UPDATE `creature_model_info` SET `bounding_radius`=0.3519,`combat_reach`=1,`gender`=1 WHERE `modelid`=28146; -- Emeline Fizzlefry +UPDATE `creature_model_info` SET `bounding_radius`=0.3519,`combat_reach`=1,`gender`=1 WHERE `modelid`=28160; -- Bitty Frostflinger +UPDATE `creature_model_info` SET `bounding_radius`=0.3519,`combat_reach`=1,`gender`=1 WHERE `modelid`=28165; -- Natalie Tootiblare +UPDATE `creature_model_info` SET `bounding_radius`=0.3519,`combat_reach`=1,`gender`=1 WHERE `modelid`=28171; -- Joboba Mezbreaker +UPDATE `creature_model_info` SET `bounding_radius`=0.3519,`combat_reach`=1,`gender`=1 WHERE `modelid`=28432; -- Sarah Brady +UPDATE `creature_model_info` SET `bounding_radius`=0.3672,`combat_reach`=1,`gender`=0 WHERE `modelid`=27587; -- Officer Van Rossem +UPDATE `creature_model_info` SET `bounding_radius`=0.3672,`combat_reach`=1,`gender`=0 WHERE `modelid`=27592; -- Archmage Timear +UPDATE `creature_model_info` SET `bounding_radius`=0.3672,`combat_reach`=1,`gender`=1 WHERE `modelid`=28118; -- Mojodishu +UPDATE `creature_model_info` SET `bounding_radius`=0.372,`combat_reach`=1,`gender`=0 WHERE `modelid`=27328; -- Kor'kron Reaver +UPDATE `creature_model_info` SET `bounding_radius`=0.372,`combat_reach`=1,`gender`=0 WHERE `modelid`=28194; -- Willard Blauvelt +UPDATE `creature_model_info` SET `bounding_radius`=0.3817,`combat_reach`=1,`gender`=0 WHERE `modelid`=27154; -- Alliance Brigadier General +UPDATE `creature_model_info` SET `bounding_radius`=0.383,`combat_reach`=1,`gender`=0 WHERE `modelid`=25604; -- Caliel Brightwillow +UPDATE `creature_model_info` SET `bounding_radius`=0.383,`combat_reach`=1,`gender`=0 WHERE `modelid`=25610; -- Enchanter Nalthanis +UPDATE `creature_model_info` SET `bounding_radius`=0.383,`combat_reach`=1,`gender`=0 WHERE `modelid`=25806; -- Warcaster Fanoraithe +UPDATE `creature_model_info` SET `bounding_radius`=0.383,`combat_reach`=1,`gender`=0 WHERE `modelid`=25877; -- Valaden Silverblade +UPDATE `creature_model_info` SET `bounding_radius`=0.383,`combat_reach`=1,`gender`=0 WHERE `modelid`=25882; -- Arille Azuregaze +UPDATE `creature_model_info` SET `bounding_radius`=0.383,`combat_reach`=1,`gender`=0 WHERE `modelid`=26067; -- Silver Covenant Guardian Mage +UPDATE `creature_model_info` SET `bounding_radius`=0.383,`combat_reach`=1,`gender`=0 WHERE `modelid`=26068; -- Silver Covenant Guardian Mage +UPDATE `creature_model_info` SET `bounding_radius`=0.383,`combat_reach`=1,`gender`=0 WHERE `modelid`=26072; -- Sunreaver Guardian Mage +UPDATE `creature_model_info` SET `bounding_radius`=0.383,`combat_reach`=1,`gender`=0 WHERE `modelid`=26443; -- Darahir +UPDATE `creature_model_info` SET `bounding_radius`=0.383,`combat_reach`=1,`gender`=0 WHERE `modelid`=27509; -- High Warlord Uro +UPDATE `creature_model_info` SET `bounding_radius`=0.383,`combat_reach`=1,`gender`=0 WHERE `modelid`=27559; -- Arcanist Adurin +UPDATE `creature_model_info` SET `bounding_radius`=0.383,`combat_reach`=1,`gender`=0 WHERE `modelid`=27800; -- Arcanist Braedin +UPDATE `creature_model_info` SET `bounding_radius`=0.383,`combat_reach`=1,`gender`=0 WHERE `modelid`=27801; -- Magister Surdiel +UPDATE `creature_model_info` SET `bounding_radius`=0.383,`combat_reach`=1,`gender`=0 WHERE `modelid`=27949; -- Warmage Lukems +UPDATE `creature_model_info` SET `bounding_radius`=0.383,`combat_reach`=1,`gender`=0 WHERE `modelid`=28148; -- Fabioso the Fabulous +UPDATE `creature_model_info` SET `bounding_radius`=0.383,`combat_reach`=1,`gender`=0 WHERE `modelid`=28151; -- Dalaran Citizen +UPDATE `creature_model_info` SET `bounding_radius`=0.383,`combat_reach`=1,`gender`=0 WHERE `modelid`=28156; -- Archmage Tenaj +UPDATE `creature_model_info` SET `bounding_radius`=0.383,`combat_reach`=1,`gender`=0 WHERE `modelid`=28169; -- Metopious Loreseeker +UPDATE `creature_model_info` SET `bounding_radius`=0.383,`combat_reach`=1,`gender`=0 WHERE `modelid`=28198; -- Felcaster Virim +UPDATE `creature_model_info` SET `bounding_radius`=0.383,`combat_reach`=1,`gender`=0 WHERE `modelid`=28755; -- Arcanist Tybalin +UPDATE `creature_model_info` SET `bounding_radius`=0.383,`combat_reach`=1,`gender`=0 WHERE `modelid`=28987; -- Arcanist Firael +UPDATE `creature_model_info` SET `bounding_radius`=0.383,`combat_reach`=1,`gender`=0 WHERE `modelid`=29830; -- Enchanter Isian +UPDATE `creature_model_info` SET `bounding_radius`=0.383,`combat_reach`=1,`gender`=0 WHERE `modelid`=30310; -- Silver Covenant Agent +UPDATE `creature_model_info` SET `bounding_radius`=0.383,`combat_reach`=1,`gender`=0 WHERE `modelid`=30439; -- Sunreaver Agent +UPDATE `creature_model_info` SET `bounding_radius`=0.383,`combat_reach`=1,`gender`=0 WHERE `modelid`=30842; -- Arcanist Uovril +UPDATE `creature_model_info` SET `bounding_radius`=0.383,`combat_reach`=1,`gender`=1 WHERE `modelid`=15242; -- Defilers Emissary +UPDATE `creature_model_info` SET `bounding_radius`=0.383,`combat_reach`=1,`gender`=1 WHERE `modelid`=25594; -- Paldesse +UPDATE `creature_model_info` SET `bounding_radius`=0.383,`combat_reach`=1,`gender`=1 WHERE `modelid`=25603; -- Narisa Redgold +UPDATE `creature_model_info` SET `bounding_radius`=0.383,`combat_reach`=1,`gender`=1 WHERE `modelid`=25622; -- Olisarra the Kind +UPDATE `creature_model_info` SET `bounding_radius`=0.383,`combat_reach`=1,`gender`=1 WHERE `modelid`=25635; -- Ildine Sorrowspear +UPDATE `creature_model_info` SET `bounding_radius`=0.383,`combat_reach`=1,`gender`=1 WHERE `modelid`=25875; -- Aemara +UPDATE `creature_model_info` SET `bounding_radius`=0.383,`combat_reach`=1,`gender`=1 WHERE `modelid`=25879; -- Karandonna +UPDATE `creature_model_info` SET `bounding_radius`=0.383,`combat_reach`=1,`gender`=1 WHERE `modelid`=26069; -- Silver Covenant Guardian Mage +UPDATE `creature_model_info` SET `bounding_radius`=0.383,`combat_reach`=1,`gender`=1 WHERE `modelid`=26070; -- Silver Covenant Guardian Mage +UPDATE `creature_model_info` SET `bounding_radius`=0.383,`combat_reach`=1,`gender`=1 WHERE `modelid`=26073; -- Sunreaver Guardian Mage +UPDATE `creature_model_info` SET `bounding_radius`=0.383,`combat_reach`=1,`gender`=1 WHERE `modelid`=26074; -- Sunreaver Guardian Mage +UPDATE `creature_model_info` SET `bounding_radius`=0.383,`combat_reach`=1,`gender`=1 WHERE `modelid`=26330; -- Aimee +UPDATE `creature_model_info` SET `bounding_radius`=0.383,`combat_reach`=1,`gender`=1 WHERE `modelid`=26339; -- Imindril Spearsong +UPDATE `creature_model_info` SET `bounding_radius`=0.383,`combat_reach`=1,`gender`=1 WHERE `modelid`=26441; -- Fialla Sweetberry +UPDATE `creature_model_info` SET `bounding_radius`=0.383,`combat_reach`=1,`gender`=1 WHERE `modelid`=27556; -- Arcanist Ivrenne +UPDATE `creature_model_info` SET `bounding_radius`=0.383,`combat_reach`=1,`gender`=1 WHERE `modelid`=27956; -- Isirami Fairwind +UPDATE `creature_model_info` SET `bounding_radius`=0.383,`combat_reach`=1,`gender`=1 WHERE `modelid`=28147; -- Darthalia Ebonscorch +UPDATE `creature_model_info` SET `bounding_radius`=0.383,`combat_reach`=1,`gender`=1 WHERE `modelid`=28152; -- Mona Everspring +UPDATE `creature_model_info` SET `bounding_radius`=0.383,`combat_reach`=1,`gender`=1 WHERE `modelid`=28153; -- Kitz Proudbreeze +UPDATE `creature_model_info` SET `bounding_radius`=0.383,`combat_reach`=1,`gender`=1 WHERE `modelid`=28163; -- Sabriana Sorrowgaze +UPDATE `creature_model_info` SET `bounding_radius`=0.383,`combat_reach`=1,`gender`=1 WHERE `modelid`=28168; -- Goldlilly Gleamingfell +UPDATE `creature_model_info` SET `bounding_radius`=0.383,`combat_reach`=1,`gender`=1 WHERE `modelid`=29832; -- Arcanist Miluria +UPDATE `creature_model_info` SET `bounding_radius`=0.383,`combat_reach`=1,`gender`=1 WHERE `modelid`=30042; -- Kaye Toogie +UPDATE `creature_model_info` SET `bounding_radius`=0.383,`combat_reach`=1,`gender`=1 WHERE `modelid`=30311; -- Silver Covenant Agent +UPDATE `creature_model_info` SET `bounding_radius`=0.385,`combat_reach`=1,`gender`=1 WHERE `modelid`=25005; -- Dreadsaber +UPDATE `creature_model_info` SET `bounding_radius`=0.3875,`combat_reach`=1,`gender`=0 WHERE `modelid`=28618; -- Unbound Seer +UPDATE `creature_model_info` SET `bounding_radius`=0.389,`combat_reach`=1,`gender`=0 WHERE `modelid`=26376; -- Ainderu Summerleaf +UPDATE `creature_model_info` SET `bounding_radius`=0.389,`combat_reach`=1,`gender`=0 WHERE `modelid`=28204; -- Mendez Nightshadow +UPDATE `creature_model_info` SET `bounding_radius`=0.389,`combat_reach`=1,`gender`=0 WHERE `modelid`=30156; -- Daros Moonlance +UPDATE `creature_model_info` SET `bounding_radius`=0.3978,`combat_reach`=1,`gender`=0 WHERE `modelid`=26847; -- Dalaran Visitor +UPDATE `creature_model_info` SET `bounding_radius`=0.4,`combat_reach`=0,`gender`=2 WHERE `modelid`=26526; -- Cosmetic Mechanical Sheep +UPDATE `creature_model_info` SET `bounding_radius`=0.4,`combat_reach`=0,`gender`=2 WHERE `modelid`=9563; -- Worg Pup +UPDATE `creature_model_info` SET `bounding_radius`=0.4131,`combat_reach`=2,`gender`=0 WHERE `modelid`=16024; -- Rhonin +UPDATE `creature_model_info` SET `bounding_radius`=0.4185,`combat_reach`=1,`gender`=0 WHERE `modelid`=27820; -- Armored Brown Bear +UPDATE `creature_model_info` SET `bounding_radius`=0.4213,`combat_reach`=1,`gender`=0 WHERE `modelid`=19744; -- Archmage Lan'dalock +UPDATE `creature_model_info` SET `bounding_radius`=0.42228,`combat_reach`=2,`gender`=0 WHERE `modelid`=31713; -- Frozo the Renowned +UPDATE `creature_model_info` SET `bounding_radius`=0.4284,`combat_reach`=2,`gender`=0 WHERE `modelid`=30978; -- Spectral Footman +UPDATE `creature_model_info` SET `bounding_radius`=0.4284,`combat_reach`=2,`gender`=0 WHERE `modelid`=30981; -- Shadowy Mercenary +UPDATE `creature_model_info` SET `bounding_radius`=0.44045,`combat_reach`=1,`gender`=1 WHERE `modelid`=30686; -- Dark Ranger Vorel +UPDATE `creature_model_info` SET `bounding_radius`=0.465,`combat_reach`=0,`gender`=1 WHERE `modelid`=30867; -- Lady Jaina Proudmoore +UPDATE `creature_model_info` SET `bounding_radius`=0.465,`combat_reach`=1,`gender`=2 WHERE `modelid`=28282; -- Brassbolt Mechawrench +UPDATE `creature_model_info` SET `bounding_radius`=0.4685,`combat_reach`=0,`gender`=2 WHERE `modelid`=26442; -- Clockwork Assistant +UPDATE `creature_model_info` SET `bounding_radius`=0.47875,`combat_reach`=1,`gender`=0 WHERE `modelid`=26770; -- Archmage Aethas Sunreaver +UPDATE `creature_model_info` SET `bounding_radius`=0.47875,`combat_reach`=1,`gender`=1 WHERE `modelid`=28222; -- Vereesa Windrunner +UPDATE `creature_model_info` SET `bounding_radius`=0.4858,`combat_reach`=2,`gender`=0 WHERE `modelid`=30980; -- Tortured Rifleman +UPDATE `creature_model_info` SET `bounding_radius`=0.5,`combat_reach`=0,`gender`=0 WHERE `modelid`=4449; -- Imp +UPDATE `creature_model_info` SET `bounding_radius`=0.5,`combat_reach`=1,`gender`=2 WHERE `modelid`=11686; -- Dalaran Fountain Invis Stalker +UPDATE `creature_model_info` SET `bounding_radius`=0.5355,`combat_reach`=2,`gender`=0 WHERE `modelid`=30821; -- Uther the Lightbringer +UPDATE `creature_model_info` SET `bounding_radius`=0.5362,`combat_reach`=2,`gender`=0 WHERE `modelid`=30979; -- Ghostly Priest +UPDATE `creature_model_info` SET `bounding_radius`=0.5392,`combat_reach`=1,`gender`=2 WHERE `modelid`=1041; -- Stabled Hunter Pet +UPDATE `creature_model_info` SET `bounding_radius`=0.54,`combat_reach`=0,`gender`=2 WHERE `modelid`=20833; -- Stabled Hunter Pet +UPDATE `creature_model_info` SET `bounding_radius`=0.59823,`combat_reach`=2,`gender`=1 WHERE `modelid`=27917; -- Gold Warrior +UPDATE `creature_model_info` SET `bounding_radius`=0.6,`combat_reach`=0,`gender`=2 WHERE `modelid`=27681; -- Cosmetic Pig +UPDATE `creature_model_info` SET `bounding_radius`=0.6,`combat_reach`=1,`gender`=2 WHERE `modelid`=12200; -- Segacedi +UPDATE `creature_model_info` SET `bounding_radius`=0.60725,`combat_reach`=3,`gender`=2 WHERE `modelid`=1988; -- Grove Walker +UPDATE `creature_model_info` SET `bounding_radius`=0.6324,`combat_reach`=2,`gender`=0 WHERE `modelid`=27919; -- Green Warrior +UPDATE `creature_model_info` SET `bounding_radius`=0.6511,`combat_reach`=2,`gender`=0 WHERE `modelid`=27930; -- Green Paladin +UPDATE `creature_model_info` SET `bounding_radius`=0.6721,`combat_reach`=1,`gender`=2 WHERE `modelid`=31094; -- Arcturis +UPDATE `creature_model_info` SET `bounding_radius`=0.75,`combat_reach`=0,`gender`=2 WHERE `modelid`=26064; -- Scourge Haunt +UPDATE `creature_model_info` SET `bounding_radius`=0.75,`combat_reach`=1,`gender`=0 WHERE `modelid`=27766; -- [DND] Dalaran Sewer Arena - Controller +UPDATE `creature_model_info` SET `bounding_radius`=0.75,`combat_reach`=1,`gender`=2 WHERE `modelid`=17612; -- Frostmourne Altar Bunny (Quel'Delar) +UPDATE `creature_model_info` SET `bounding_radius`=0.765,`combat_reach`=3,`gender`=0 WHERE `modelid`=30972; -- Falric +UPDATE `creature_model_info` SET `bounding_radius`=0.765,`combat_reach`=3,`gender`=0 WHERE `modelid`=30973; -- Marwyn +UPDATE `creature_model_info` SET `bounding_radius`=0.8,`combat_reach`=0,`gender`=2 WHERE `modelid`=27700; -- Stabled Hunter Pet +UPDATE `creature_model_info` SET `bounding_radius`=0.8725,`combat_reach`=3,`gender`=0 WHERE `modelid`=28183; -- Hunaka Greenhoof +UPDATE `creature_model_info` SET `bounding_radius`=0.9,`combat_reach`=1,`gender`=2 WHERE `modelid`=14255; -- Felguard +UPDATE `creature_model_info` SET `bounding_radius`=0.9747,`combat_reach`=4,`gender`=0 WHERE `modelid`=28207; -- Tuff Gorehoof +UPDATE `creature_model_info` SET `bounding_radius`=0.9747,`combat_reach`=4,`gender`=0 WHERE `modelid`=29820; -- Sorn Proudmane +UPDATE `creature_model_info` SET `bounding_radius`=1.05,`combat_reach`=1,`gender`=0 WHERE `modelid`=10957; -- Dappled Stag +UPDATE `creature_model_info` SET `bounding_radius`=1.05,`combat_reach`=1,`gender`=2 WHERE `modelid`=27726; -- Stabled Hunter Pet +UPDATE `creature_model_info` SET `bounding_radius`=1.1,`combat_reach`=1,`gender`=2 WHERE `modelid`=26532; -- Cosmetic Mechanical Squirrel +UPDATE `creature_model_info` SET `bounding_radius`=1.122,`combat_reach`=0,`gender`=2 WHERE `modelid`=368; -- Black Widow Hatchling +UPDATE `creature_model_info` SET `bounding_radius`=1.18065,`combat_reach`=2,`gender`=2 WHERE `modelid`=833; -- Underbelly Croc +UPDATE `creature_model_info` SET `bounding_radius`=1.2,`combat_reach`=0,`gender`=0 WHERE `modelid`=24235; -- Sinewy Wolf +UPDATE `creature_model_info` SET `bounding_radius`=1.3,`combat_reach`=1,`gender`=2 WHERE `modelid`=134; -- Squirrel +UPDATE `creature_model_info` SET `bounding_radius`=1.5,`combat_reach`=0,`gender`=0 WHERE `modelid`=22003; -- Nargut +UPDATE `creature_model_info` SET `bounding_radius`=1.5,`combat_reach`=0,`gender`=0 WHERE `modelid`=27019; -- Rhukah +UPDATE `creature_model_info` SET `bounding_radius`=1.7,`combat_reach`=2,`gender`=1 WHERE `modelid`=27931; -- Gold Shaman +UPDATE `creature_model_info` SET `bounding_radius`=2.75,`combat_reach`=5,`gender`=0 WHERE `modelid`=30721; -- The Lich King + +-- Template addon updates +UPDATE `creature_template_addon` SET `bytes1`=0,`bytes2`=1,`mount`=0,`emote`=0,`auras`=NULL WHERE `entry`=1412; -- Squirrel +UPDATE `creature_template_addon` SET `bytes1`=0,`bytes2`=1,`mount`=0,`emote`=0,`auras`=NULL WHERE `entry`=14881; -- Spider +UPDATE `creature_template_addon` SET `bytes1`=0,`bytes2`=1,`mount`=0,`emote`=0,`auras`=NULL WHERE `entry`=14990; -- Defilers Emissary +UPDATE `creature_template_addon` SET `bytes1`=0,`bytes2`=1,`mount`=0,`emote`=0,`auras`=NULL WHERE `entry`=14991; -- League of Arathor Emissary +UPDATE `creature_template_addon` SET `bytes1`=0,`bytes2`=1,`mount`=0,`emote`=0,`auras`=NULL WHERE `entry`=17213; -- Broom +UPDATE `creature_template_addon` SET `bytes1`=0,`bytes2`=1,`mount`=0,`emote`=0,`auras`=NULL WHERE `entry`=32642; -- Mojodishu +UPDATE `creature_template_addon` SET `bytes1`=0,`bytes2`=1,`mount`=0,`emote`=0,`auras`=NULL WHERE `entry`=4075; -- Rat +UPDATE `creature_template_addon` SET `bytes1`=0,`bytes2`=1,`mount`=0,`emote`=0,`auras`=NULL WHERE `entry`=721; -- Rabbit +UPDATE `creature_template_addon` SET `bytes1`=3,`bytes2`=1,`mount`=0,`emote`=0,`auras`=NULL WHERE `entry`=31885; -- Rhukah +UPDATE `creature_template_addon` SET `bytes1`=3,`bytes2`=1,`mount`=0,`emote`=0,`auras`=NULL WHERE `entry`=31886; -- Nargut diff --git a/sql/updates/world/2011_03_23_02_world_creature_transport.sql b/sql/updates/world/2011_03_23_02_world_creature_transport.sql new file mode 100644 index 0000000000000..05c94518d8320 --- /dev/null +++ b/sql/updates/world/2011_03_23_02_world_creature_transport.sql @@ -0,0 +1,3 @@ +DELETE FROM `creature_transport` WHERE `transport_entry`=192242 AND `npc_entry`=31261; +INSERT INTO `creature_transport` (`transport_entry`,`npc_entry`,`TransOffsetX`,`TransOffsetY`,`TransOffsetZ`,`TransOffsetO`,`emote`) VALUES +(192242,31261,-46.16626,12.04395,13.22064,1.437376,0); -- Brother Keltan abord the Skybreaker diff --git a/sql/updates/world/2011_03_23_03_world_creature.sql b/sql/updates/world/2011_03_23_03_world_creature.sql new file mode 100644 index 0000000000000..ca0ccdc93c90e --- /dev/null +++ b/sql/updates/world/2011_03_23_03_world_creature.sql @@ -0,0 +1 @@ +UPDATE `creature` SET `id`=15105 WHERE `guid` BETWEEN 208382 AND 208393 AND `id`=15102; diff --git a/sql/updates/world/2011_03_23_04_world_creature.sql b/sql/updates/world/2011_03_23_04_world_creature.sql new file mode 100644 index 0000000000000..9d9edec645218 --- /dev/null +++ b/sql/updates/world/2011_03_23_04_world_creature.sql @@ -0,0 +1,42 @@ +-- Spawn Missing Argent Crusaders +-- Redid Exisiting to make Adding simpler +SET @GUID=54706; +DELETE FROM `creature` WHERE id IN (28029,28026); +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`DeathState`,`MovementType`,`npcflag`,`unit_flags`,`dynamicflags`) VALUES +(107427,28029,571,1,1,26231,0,5514,-2398.25,292.502,1.5708,300,0,0,9572,3561,0,0,0,0,0), +(107428,28029,571,1,1,26228,0,5485.95,-2500.14,292.433,0.934353,300,0,0,9572,3561,0,0,0,0,0), +(107429,28029,571,1,1,26229,0,5495.16,-2439.33,292.498,5.44414,300,0,0,9572,3561,0,0,0,0,0), +(107430,28029,571,1,1,26230,0,5490.07,-2495.2,292.429,3.93988,300,0,0,9572,3561,0,0,0,0,0), +(107431,28029,571,1,1,26230,0,5496.85,-2383.57,292.502,2.30383,300,0,0,9572,3561,0,0,0,0,0), +(@GUID+0,28029,571,1,1,0,0,5442.812,-2554.325,297.783,1.554819,300,0,0,1,1,0,0,0,0,0), +(@GUID+1,28029,571,1,1,0,0,5451.548,-2516.311,292.445,0.1570796,300,0,0,1,1,0,0,0,0,0), +(@GUID+2,28029,571,1,1,0,0,5445.436,-2513.325,292.5019,1.64061,300,0,0,1,1,0,0,0,0,0), +(@GUID+3,28029,571,1,1,0,0,5384.553,-2402.976,292.5019,0.8726646,300,0,0,1,1,0,0,0,0,0), +(@GUID+4,28029,571,1,1,0,0,5386.06,-2421.43,292.5019,1.53589,300,0,0,1,1,0,0,0,0,0), +(@GUID+5,28029,571,1,1,0,0,5383.483,-2472.9,292.5019,1.570796,300,0,0,1,1,0,0,0,0,0), +(@GUID+6,28029,571,1,1,0,0,5400.021,-2448.991,292.5019,2.321288,300,0,0,1,1,0,0,0,0,0), +(@GUID+7,28029,571,1,1,0,0,5369.318,-2443.405,292.5019,0.9424778,300,0,0,1,1,0,0,0,0,0), +(@GUID+8,28029,571,1,1,0,0,5409.107,-2361.323,292.5019,0.6283185,300,0,0,1,1,0,0,0,0,0), +(@GUID+9,28029,571,1,1,0,0,5464.651,-2496.451,292.5019,1.48353,300,0,0,1,1,0,0,0,0,0), +(@GUID+10,28029,571,1,1,0,0,5435.183,-2513.578,292.445,0.918852,300,0,0,1,1,0,0,0,0,0), +(@GUID+11,28029,571,1,1,0,0,5400.03,-2506.189,292.5019,1.553343,300,0,0,1,1,0,0,0,0,0), +(@GUID+12,28029,571,1,1,0,0,5450.897,-2457.951,292.5019,1.553343,300,0,0,1,1,0,0,0,0,0), +-- rampaging Geist +(107193,28026,571,1,1,25286,0,5497.21,-2080.43,240.865,0.857485,300,5,0,10635,0,0,1,0,0,0), +(107194,28026,571,1,1,25402,0,5511.68,-2358.28,292.441,2.71292,300,5,0,10635,0,0,1,0,0,0), +(107195,28026,571,1,1,25402,0,5512.46,-2455.17,292.424,2.97264,300,5,0,10635,0,0,1,0,0,0), +(107196,28026,571,1,1,25286,0,5519.86,-2423.45,292.473,3.83817,300,5,0,10635,0,0,1,0,0,0), +(107197,28026,571,1,1,25286,0,5488.13,-2497.19,292.429,3.93989,300,5,0,10635,0,0,1,0,0,0), +(32067,28026,571,1,1,0,0,5429.262,-2486.59,292.5296,2.737376,300,5,0,10635,0,0,1,0,0,0), +(32068,28026,571,1,1,0,0,5408.888,-2479.563,292.5296,0.7370623,300,5,0,10635,0,0,1,0,0,0), +(32070,28026,571,1,1,0,0,5419.276,-2505.731,292.5433,4.015942,300,5,0,10635,0,0,1,0,0,0), +(32071,28026,571,1,1,0,0,5384.713,-2463.133,292.843,2.721308,300,5,0,10635,0,0,1,0,0,0), +(32073,28026,571,1,1,0,0,5383.064,-2413.345,292.5399,6.069617,300,5,0,10635,0,0,1,0,0,0), +(32074,28026,571,1,1,0,0,5394.180,-2442.885,292.468,2.731286,300,5,0,10635,0,0,1,0,0,0), +(518,28026,571,1,1,0,0,5452.489,-2447.378,292.5435,0.3663993,300,5,0,10635,0,0,1,0,0,0); + +-- Addon data +DELETE FROM `creature_template_addon` WHERE `entry` IN (28029,28026); +INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(28029,0,0,1,375, NULL), -- Argent Crusader +(28026,0,0,1,0, NULL); -- Rampaging Geist diff --git a/sql/updates/world/2011_03_23_06_world_quest_template.sql b/sql/updates/world/2011_03_23_06_world_quest_template.sql new file mode 100644 index 0000000000000..1b100325ae48d --- /dev/null +++ b/sql/updates/world/2011_03_23_06_world_quest_template.sql @@ -0,0 +1,2 @@ +-- Update Vile Familiars, Burning Blade Medallion and Report to Sen'jin Village required races (Horde) +UPDATE `quest_template` SET `RequiredRaces`=690 WHERE `entry` IN (792,794,805); diff --git a/sql/updates/world/2011_03_23_07_world_creatureinvolvedrelation.sql b/sql/updates/world/2011_03_23_07_world_creatureinvolvedrelation.sql new file mode 100644 index 0000000000000..1a8e09c07270c --- /dev/null +++ b/sql/updates/world/2011_03_23_07_world_creatureinvolvedrelation.sql @@ -0,0 +1,4 @@ +-- Battle to Undercity should be turned in to Bragor Bloodfist +DELETE FROM `creature_involvedrelation` WHERE `quest` IN (14351,550); +DELETE FROM `creature_questrelation` WHERE `quest` IN (14351,550); +INSERT INTO `creature_involvedrelation` (`id`,`quest`) VALUES (36273,14351); diff --git a/sql/updates/world/2011_03_23_08_world_gameobject_template.sql b/sql/updates/world/2011_03_23_08_world_gameobject_template.sql new file mode 100644 index 0000000000000..8db2ac8f11703 --- /dev/null +++ b/sql/updates/world/2011_03_23_08_world_gameobject_template.sql @@ -0,0 +1,8 @@ +DELETE FROM `gameobject_template` WHERE `entry`=300149; +INSERT INTO `gameobject_template` (`entry`,`type`,`displayId`,`name`,`IconName`,`castBarCaption`,`unk1`,`faction`,`flags`,`size`,`questItem1`,`questItem2`,`questItem3`,`questItem4`,`questItem5`,`questItem6`,`data0`,`data1`,`data2`,`data3`,`data4`,`data5`,`data6`,`data7`,`data8`,`data9`,`data10`,`data11`,`data12`,`data13`,`data14`,`data15`,`data16`,`data17`,`data18`,`data19`,`data20`,`data21`,`data22`,`data23`,`AIName`,`ScriptName`,`WDBVerified`) VALUES +(300149,8,1287, 'TEMP Wrathscale Lair Fountain', '', '', '',0,0,1,0,0,0,0,0,0,223,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, '', '',1); + +-- NEEDS VISUAL (apart form Ruins of Stardust, its MISSING!) +DELETE FROM `gameobject` WHERE `id`=300149; +INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES +(1160,300149,530,1,1,-2186.4,-12340.5,56.2888,5.31,0,0,0.121294,-0.992617,-300,0,1); diff --git a/sql/updates/world/2011_03_23_09_world_creature.sql b/sql/updates/world/2011_03_23_09_world_creature.sql new file mode 100644 index 0000000000000..11aad5a0466b1 --- /dev/null +++ b/sql/updates/world/2011_03_23_09_world_creature.sql @@ -0,0 +1,132 @@ +-- create missing spawns: +SET @GUID := 151895; -- SET BY TDB + +DELETE FROM `creature` WHERE `id`IN(18695,18697,18689,18686,18698,18678,17144,18692,18677,18693,18683,18679); +INSERT INTO creature +(`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`DeathState`,`MovementType`) +VALUES +-- Ambassador Jerrikar +(@GUID,18695,530,1,1,0,0,-4455.05,1694.55,161.278,1.93093,28800,0,0,13522,0,0,0), +(@GUID+1,18695,530,1,1,0,0,-4203.43,344.462,115.416,4.161,28800,0,0,13522,0,0,0), +(@GUID+2,18695,530,1,1,0,0,-3815.24,2689.31,100.581,5.38433,28800,5,0,13522,0,0,1), +(@GUID+3,18695,530,1,1,0,0,-3082.38,1867.38,139.906,1.53194,28800,5,0,13522,0,0,1), +(@GUID+4,18695,530,1,1,0,0,-3076.35,1020.61,-2.88056,3.73969,28800,5,0,13522,0,0,1), +-- Chief Engineer Lorthander +(@GUID+5,18697,530,1,1,0,0,4092.53,4001.75,117.282,4.650480,28800,0,0,10818,15400,0,0), +(@GUID+6,18697,530,1,1,0,0,2293.31,2821.12,130.917,4.422730,28800,5,0,10818,15400,0,1), +(@GUID+7,18697,530,1,1,0,0,2954.82,2147.42,165.328,0.753333,28800,5,0,10818,15400,0,1), +-- Crippler +(@GUID+8,18689,530,1,1,0,0,-3005.68,5037.76,-23.7032,4.12334,28800,30,0,11828,0,0,1), -- only have one for him :( +-- Doomsayer Jurim +(@GUID+9,18686,530,1,1,0,0,-2537.44,5147.04,9.05971,5.82974,28800,0,0,9144,13525,0,0), +(@GUID+10,18686,530,1,1,0,0,-1874.09,4663.57,10.9095,3.87017,28800,5,0,9144,13525,0,1), +(@GUID+11,18686,530,1,1,0,0,-2172.31,4091.34,3.00316,4.21182,28800,5,0,9144,13525,0,1), +(@GUID+12,18686,530,1,1,0,0,-3001.44,3297.82,0.537389,4.35947,28800,5,0,9144,13525,0,1), +(@GUID+13,18686,530,1,1,0,0,-3540.43,4051.46,66.3999,2.6905,28800,5,0,9144,13525,0,1), +-- Ever-Core the Punisher +(@GUID+14,18698,530,1,1,0,0,3014.36,4025.81,144.105,2.90805,28800,5,0,10466,5982,0,1), +(@GUID+15,18698,530,1,1,0,0,3835.65,3835.2,103.641,5.80224,28800,5,0,10466,5982,0,1), +(@GUID+16,18698,530,1,1,0,0,4824.65,2738.08,88.9073,0.75999,28800,5,0,10466,5982,0,1), +(@GUID+17,18698,530,1,1,0,0,4113.73,1677.64,130.749,0.237701,28800,5,0,10466,5982,0,1), +-- Fulgorge (should be 3 i think) +(@GUID+18,18678,530,1,1,0,0,-565.303,4343,49.9107,6.05994,28800,0,0,10682,0,0,0), +(@GUID+19,18678,530,1,1,0,0,-632.339,3908.47,28.9953,4.74599,28800,0,0,10682,0,0,0), +(@GUID+38,18678,530,1,1,0,0,-634.201,3795.52,28.99509,1.162743,28800,0,0,10682,0,0,0), +-- Goretooth +(@GUID+20,17144,530,1,1,0,0,-1762.6,8066.57,-104.023,1.86887,28800,0,0,11828,0,0,0), +(@GUID+21,17144,530,1,1,0,0,-1840.51,8450.93,-64.6652,4.69754,28800,0,0,11828,0,0,0), +(@GUID+22,17144,530,1,1,0,0,-1025.68,7114.78,2.37478,0.256121,28800,0,0,11828,0,0,0), +(@GUID+23,17144,530,1,1,0,0,-2876.55,6078.57,-4.24251,1.15226,28800,0,0,11828,0,0,0), +-- Hemathion +(@GUID+24,18692,530,1,1,0,0,2116.26,7250.19,365.147,2.86924,28800,0,0,13084,0,0,0), +(@GUID+25,18692,530,1,1,0,0,2699.59,7237.5,366.064,3.30389,28800,0,0,13084,0,0,0), +-- Mekthorg the Wild +(@GUID+26,18677,530,1,1,0,0,-575.456,3240.77,5.76784,4.69623,28800,0,0,10316,0,0,0), +(@GUID+27,18677,530,1,1,0,0,-1084.3,2014.46,67.6811,0.947525,28800,5,0,10316,0,0,1), +-- Speaker Mar'grom +(@GUID+28,18693,530,1,1,0,0,2365.59,6544.67,3.4638,1.66658,28800,0,0,10466,8973,0,0), +(@GUID+29,18693,530,1,1,0,0,1599.44,6433.12,-10.4082,0.215986,28800,0,0,10466,8973,0,0), +(@GUID+30,18693,530,1,1,0,0,1607.56,6423.05,-10.3477,0.577269,28800,5,0,10466,8973,0,1), +(@GUID+31,18693,530,1,1,0,0,2915.68,6000.98,-4.1535,4.87572,28800,5,0,10466,8973,0,1), +(@GUID+32,18693,530,1,1,0,0,3636.49,5349.23,-20.7,4.57491,28800,5,0,10466,8973,0,1), +-- Voidhunter Yar (1 spawn. circular pathing) +(@GUID+33,18683,530,1,1,0,0,-2422.61,8206.15,-38.3408,0.177212,28800,0,0,10466,11964,0,0), +-- Vorakem Doomspeaker +(@GUID+34,18679,530,1,1,0,0,175.918,1720.29,34.4088,3.26023,28800,0,0,8548,2568,0,0), +(@GUID+35,18679,530,1,1,0,0,-444.675,1851.37,78.3747,5.77743,28800,5,0,8548,2568,0,1), +(@GUID+36,18679,530,1,1,0,0,399.416,2204.89,118.365,0.918177,28800,5,0,8548,2568,0,1), +(@GUID+37,18679,530,1,1,0,0,362.142,3354.43,64.1364,1.86458,28800,5,0,8548,2568,0,1); + +-- DefiningPooling_templates +DELETE FROM `pool_template` WHERE `entry` BETWEEN 1073 AND 1085; +INSERT INTO pool_template (`entry`,`max_limit`,`description`) VALUES +(1073,1, 'Okrek Rare Spawn (1 out 4)'), +(1074,1, 'Ambassador Jerrikar Rare Spawn (1 out 5)'), +(1075,1, 'Okrek Rare Spawn (1 out 3)'), +(1076,1, 'Crippler Rare Spawn (1 out 1)'), +(1077,1, 'Doomsayer Jurim Rare Spawn (1 out 5)'), +(1078,1, 'Ever-Core the Punisher Rare Spawn (1 out 4)'), +(1079,1, 'Fulgore Rare Spawn (1 out 3)'), +(1080,1, 'Goretooth Rare Spawn (1 out 4)'), +(1081,1, 'Hemathion Rare Spawn (1 out 2)'), +(1082,1, 'Mekthorg the Wild Rare Spawn (1 out 2)'), +(1083,1, 'Speaker Margrom Rare Spawn (1 out 5)'), +(1084,1, 'Voidhunter Yar Rare Spawn (1 out 1)'), +(1085,1, 'Vorakem Doomspeaker Rare Spawn (1 out 4)'); + +-- Pooling the Spawns +DELETE FROM `pool_creature` WHERE `pool_entry` BETWEEN 1073 AND 1085; +INSERT INTO pool_creature(`guid`,`pool_entry`,`chance`,`description`) VALUES +(85382,1073,25, 'Okrek - Spawnlocation 1'), +(85405,1073,25, 'Okrek - Spawnlocation 2'), +(85564,1073,25, 'Okrek - Spawnlocation 3'), +(85565,1073,25, 'Okrek - Spawnlocation 4'), +(@GUID,1074,20, 'Ambassador Jerrikar - Spawnlocation 1'), +(@GUID+1,1074,20, 'Ambassador Jerrikar - Spawnlocation 2'), +(@GUID+2,1074,20, 'Ambassador Jerrikar - Spawnlocation 3'), +(@GUID+3,1074,20, 'Ambassador Jerrikar - Spawnlocation 4'), +(@GUID+4,1074,20, 'Ambassador Jerrikar - Spawnlocation 5'), +(@GUID+5,1075,33, 'Chief Engineer Lorthander - Spawnlocation 1'), +(@GUID+6,1075,33, 'Chief Engineer Lorthander - Spawnlocation 2'), +(@GUID+7,1075,34, 'Chief Engineer Lorthander - Spawnlocation 3'), +(@GUID+8,1076,100, 'Crippler - Spawnlocation 1'), +(@GUID+9,1077,20, 'Doomsayer Jurim Spawnlocation 1'), +(@GUID+10,1077,20, 'Doomsayer Jurim Spawnlocation 2'), +(@GUID+11,1077,20, 'Doomsayer Jurim Spawnlocation 3'), +(@GUID+12,1077,20, 'Doomsayer Jurim Spawnlocation 4'), +(@GUID+13,1077,20, 'Doomsayer Jurim Spawnlocation 5'), +(@GUID+14,1078,25, 'Ever-Core the Punisher Spawnlocation 1'), +(@GUID+15,1078,25, 'Ever-Core the Punisher Spawnlocation 2'), +(@GUID+16,1078,25, 'Ever-Core the Punisher Spawnlocation 3'), +(@GUID+17,1078,25, 'Ever-Core the Punisher Spawnlocation 4'), +(@GUID+18,1079,33, 'Fulgore Spawnlocation 1'), +(@GUID+19,1079,33, 'Fulgore Spawnlocation 2'), +(@GUID+38,1079,33, 'Fulgore Spawnlocation 2'), +(@GUID+20,1080,25, 'Goretooth Spawnlocation 1'), +(@GUID+21,1080,25, 'Goretooth Spawnlocation 2'), +(@GUID+22,1080,25, 'Goretooth Spawnlocation 3'), +(@GUID+23,1080,25, 'Goretooth Spawnlocation 4'), +(@GUID+24,1081,50, 'Hemathion Spawnlocation 1'), +(@GUID+25,1081,50, 'Hemathion Spawnlocation 2'), +(@GUID+26,1082,50, 'Mekthorg the Wild Spawnlocation 1'), +(@GUID+27,1082,50, 'Mekthorg the Wild Spawnlocation 2'), +(@GUID+28,1083,20, 'Speaker Margrom Spawnlocation 1'), +(@GUID+29,1083,20, 'Speaker Margrom Spawnlocation 2'), +(@GUID+30,1083,20, 'Speaker Margrom Spawnlocation 3'), +(@GUID+31,1083,20, 'Speaker Margrom Spawnlocation 4'), +(@GUID+32,1083,20, 'Speaker Margrom Spawnlocation 5'), +(@GUID+33,1084,100, 'Voidhunter Yar Spawnlocation 1'), +(@GUID+34,1085,25, 'Vorakem Doomspeaker Spawnlocation 1'), +(@GUID+35,1085,25, 'Vorakem Doomspeaker Spawnlocation 2'), +(@GUID+36,1085,25, 'Vorakem Doomspeaker Spawnlocation 3'), +(@GUID+37,1085,25, 'Vorakem Doomspeaker Spawnlocation 4'); + +-- Chief Engineer Lorthander (sniffed) +SET @EquiEntry = 1807; -- (creature_equip_template.entry - need 1) +UPDATE `creature_template` SET `faction_A`=1701,`faction_H`=1701,`equipment_id`=@EquiEntry,`speed_walk`=1 WHERE `entry`=18697; +DELETE FROM `creature_equip_template` WHERE `entry`=@EquiEntry; +INSERT INTO `creature_equip_template` (`entry`,`equipentry1`,`equipentry2`,`equipentry3`) VALUES +(@EquiEntry,31301,32768,0); +DELETE FROM `creature_template_addon` WHERE `entry`=18697; +INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(18697,0,0,1,0, NULL); diff --git a/sql/updates/world/2011_03_23_10_world_gameobject.sql b/sql/updates/world/2011_03_23_10_world_gameobject.sql new file mode 100644 index 0000000000000..aa44b110caa87 --- /dev/null +++ b/sql/updates/world/2011_03_23_10_world_gameobject.sql @@ -0,0 +1,3 @@ +-- Delete uneed made up GO template +UPDATE `gameobject` SET `id`=202275 WHERE `id`=300149; -- TEMP Wrathscale Lair Fountain -> Wrathscale Fountain +DELETE FROM `gameobject_template` WHERE `entry`=300149; diff --git a/sql/updates/world/2011_03_23_11_world_game_event_arena_seasons.sql b/sql/updates/world/2011_03_23_11_world_game_event_arena_seasons.sql new file mode 100644 index 0000000000000..ee7a545a67e82 --- /dev/null +++ b/sql/updates/world/2011_03_23_11_world_game_event_arena_seasons.sql @@ -0,0 +1,3 @@ +-- Delete wrongly assigned Arena Seasons game events +DELETE FROM `game_event_arena_seasons` WHERE `eventEntry`=53 AND `season`=1; -- Call to Arms: Strand of the Ancients! +DELETE FROM `game_event_arena_seasons` WHERE `eventEntry`=54 AND `season`=2; -- Call to Arms: Isle of Conquest! diff --git a/sql/updates/world/2011_03_23_12_world_misc.sql b/sql/updates/world/2011_03_23_12_world_misc.sql new file mode 100644 index 0000000000000..115e3da6ca4fe --- /dev/null +++ b/sql/updates/world/2011_03_23_12_world_misc.sql @@ -0,0 +1,9 @@ +-- DB Startup errors +DELETE FROM `conditions` WHERE `SourceEntry`=43151 AND `SourceTypeOrReferenceId`=13; -- Delete uneed/wrong conditions. Assigned SAI will take care of targeting the right creature +UPDATE `pool_creature` SET `chance`=0 WHERE `pool_entry`=1079; -- 3 creatures, 33.3333..% (repeating, of course) chance; there is no need to hardcode the value +-- Delete wrong equip template and revert the one that shouldn't have been changed +UPDATE `creature_template` SET `equipment_id`=2431 WHERE `entry`=18697; +DELETE FROM `creature_equip_template` WHERE `entry` IN (1807,2431); +INSERT INTO `creature_equip_template` (`entry`,`equipentry1`,`equipentry2`,`equipentry3`) VALUES +(1807,50757,0,0), +(2431,31301,0,0); diff --git a/sql/updates/world/2011_03_23_13_world_misc.sql b/sql/updates/world/2011_03_23_13_world_misc.sql new file mode 100644 index 0000000000000..6c80b37b40c9d --- /dev/null +++ b/sql/updates/world/2011_03_23_13_world_misc.sql @@ -0,0 +1,475 @@ +-- Pathing for Chief Engineer Galpen Rolltie SAI +SET @ENTRY := 26600; +-- Remove old waypoint data and scripts +UPDATE `creature` SET `spawndist`=0,`MovementType`=0,`position_x`=4136.725,`position_y`=5316.553,`position_z`=28.726,`orientation`=0.3286853 WHERE `guid`=117890; +-- SAI for Chief Engineer Galpen Rolltie +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid` IN (@ENTRY*100,@ENTRY*100+1,@ENTRY*100+2); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +-- AI +(@ENTRY,0,0,0,11,0,100,0,0,0,0,0,53,0,@ENTRY,1,0,0,0,1,0,0,0,0,0,0,0, 'Chief Engineer Galpen Rolltie - On spawn - Start WP movement'), +(@ENTRY,0,1,2,40,0,100,0,1,@ENTRY,0,0,54,16000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Chief Engineer Galpen Rolltie - Reach wp 1 - pause path'), +(@ENTRY,0,2,0,61,0,100,0,0,0,0,0,17,233,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Chief Engineer Galpen Rolltie - Reach wp 1 - STATE_WORK_MINING'), +(@ENTRY,0,3,4,40,0,100,0,7,@ENTRY,0,0,54,9000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Chief Engineer Galpen Rolltie - Reach wp 7 - pause path'), +(@ENTRY,0,4,0,61,0,100,0,0,0,0,0,17,233,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Chief Engineer Galpen Rolltie - Reach wp 7 - STATE_WORK_MINING'), +(@ENTRY,0,5,6,40,0,100,0,15,@ENTRY,0,0,54,14000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Chief Engineer Galpen Rolltie - Reach wp 15 - pause path'), +(@ENTRY,0,6,0,61,0,100,0,0,0,0,0,17,233,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Chief Engineer Galpen Rolltie - Reach wp 15 - STATE_WORK_MINING'); +-- Waypoints for Chief Engineer Galpen Rolltie from sniff +DELETE FROM `waypoints` WHERE `entry`=@ENTRY; +INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES +(@ENTRY,1,4138.141,5318.302,28.81850, 'Chief Engineer Galpen Rolltie'), +(@ENTRY,2,4140.475,5319.229,29.29604, 'Chief Engineer Galpen Rolltie'), +(@ENTRY,3,4141.725,5323.979,29.04604, 'Chief Engineer Galpen Rolltie'), +(@ENTRY,4,4139.975,5327.229,29.29604, 'Chief Engineer Galpen Rolltie'), +(@ENTRY,5,4136.975,5328.229,29.29604, 'Chief Engineer Galpen Rolltie'), +(@ENTRY,6,4134.975,5327.229,29.29604, 'Chief Engineer Galpen Rolltie'), +(@ENTRY,7,4135.308,5325.655,28.77358, 'Chief Engineer Galpen Rolltie'), +(@ENTRY,8,4135.063,5327.819,29.27233, 'Chief Engineer Galpen Rolltie'), +(@ENTRY,9,4140.063,5327.819,29.27233, 'Chief Engineer Galpen Rolltie'), +(@ENTRY,10,4143.313,5325.319,29.27233, 'Chief Engineer Galpen Rolltie'), +(@ENTRY,11,4141.313,5317.819,29.77233, 'Chief Engineer Galpen Rolltie'), +(@ENTRY,12,4137.063,5314.819,29.02233, 'Chief Engineer Galpen Rolltie'), +(@ENTRY,13,4132.313,5316.569,29.02233, 'Chief Engineer Galpen Rolltie'), +(@ENTRY,14,4130.313,5319.819,29.27233, 'Chief Engineer Galpen Rolltie'), +(@ENTRY,15,4131.816,5320.484,28.77108, 'Chief Engineer Galpen Rolltie'), +(@ENTRY,16,4130.521,5321.019,29.24854, 'Chief Engineer Galpen Rolltie'), +(@ENTRY,17,4131.021,5317.769,29.24854, 'Chief Engineer Galpen Rolltie'), +(@ENTRY,18,4133.771,5315.769,28.99854, 'Chief Engineer Galpen Rolltie'), +(@ENTRY,19,4136.725,5316.553,28.72600, 'Chief Engineer Galpen Rolltie'); + +-- Pathing for Willis Wobblewheel SAI +SET @ENTRY := 26599; +-- Remove old waypoint data and scripts +UPDATE `creature` SET `spawndist`=0,`MovementType`=0,`position_x`=4135.779,`position_y`=5282.234,`position_z`=25.11416,`orientation`=1.19467 WHERE `guid`=117866; +-- SAI for Willis Wobblewheel +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid` IN (@ENTRY*100,@ENTRY*100+1); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,11,0,100,0,0,0,0,0,53,0,@ENTRY,1,0,0,0,1,0,0,0,0,0,0,0, 'Willis Wobblewheel - On spawn - Start WP movement'), +(@ENTRY,0,1,2,40,0,100,0,1,@ENTRY,0,0,54,17000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Willis Wobblewheel - Reach wp 1 - pause path'), +(@ENTRY,0,2,0,61,0,100,0,0,0,0,0,17,233,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Willis Wobblewheel - Reach wp 1 - STATE_WORK_MINING'), +(@ENTRY,0,3,4,40,0,100,0,3,@ENTRY,0,0,54,16000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Willis Wobblewheel - Reach wp 3 - pause path'), +(@ENTRY,0,4,5,61,0,100,0,0,0,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,5.288348, 'Willis Wobblewheel - Reach wp 3 - turn to'), +(@ENTRY,0,5,0,61,0,100,0,0,0,0,0,17,69,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Willis Wobblewheel - Reach wp 1 - STATE_USESTANDING'); +-- Waypoints for Willis Wobblewheel from sniff +DELETE FROM `waypoints` WHERE `entry`=@ENTRY; +INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES +(@ENTRY,1,4137.04,5285.097,25.23916, 'Willis Wobblewheel'), +(@ENTRY,2,4135.779,5282.234,25.11416, 'Willis Wobblewheel'), +(@ENTRY,3,4135.004,5281.168,25.11416, 'Willis Wobblewheel'), +(@ENTRY,4,4135.779,5282.234,25.11416, 'Willis Wobblewheel'); + +-- Pathing for Fizzcrank Watcher Rupert Keeneye SAI +SET @ENTRY := 26634; +-- Remove old waypoint data and scripts +UPDATE `creature` SET `spawndist`=0,`MovementType`=0,`position_x`=4183.354,`position_y`=5318.837,`position_z`=58.1593 WHERE `guid`=97336; +-- SAI for Fizzcrank Watcher Rupert Keeneye +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid` IN (@ENTRY*100,@ENTRY*100+1); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,11,0,100,0,0,0,0,0,53,0,@ENTRY,1,0,0,0,1,0,0,0,0,0,0,0, 'Fizzcrank Watcher Rupert Keeneye - On spawn - Start WP movement'), +(@ENTRY,0,1,0,40,0,100,0,2,@ENTRY,0,0,54,30000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Fizzcrank Watcher Rupert Keeneye - Reach wp 2 - pause path'), +(@ENTRY,0,2,3,40,0,100,0,6,@ENTRY,0,0,54,30000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Fizzcrank Watcher Rupert Keeneye - Reach wp 6 - pause path'), +(@ENTRY,0,3,0,61,0,100,0,0,0,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,0.8901179, 'Fizzcrank Watcher Rupert Keeneye - Reach wp 6 - turn to'); +-- Waypoints for Fizzcrank Watcher Rupert Keeneye from sniff +DELETE FROM `waypoints` WHERE `entry`=@ENTRY; +INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES +(@ENTRY,1,4186.929,5321.105,58.13441, 'Fizzcrank Watcher Rupert Keeneye'), +(@ENTRY,2,4185.132,5318.713,58.1639, 'Fizzcrank Watcher Rupert Keeneye'), +(@ENTRY,3,4186.515,5316.936,58.15049, 'Fizzcrank Watcher Rupert Keeneye'), +(@ENTRY,4,4186.929,5321.105,58.13441, 'Fizzcrank Watcher Rupert Keeneye'), +(@ENTRY,5,4191.268,5319.607,58.12418, 'Fizzcrank Watcher Rupert Keeneye'), +(@ENTRY,6,4189.929,5324.715,58.08976, 'Fizzcrank Watcher Rupert Keeneye'), +(@ENTRY,7,4184.381,5325.549,58.05596, 'Fizzcrank Watcher Rupert Keeneye'), +(@ENTRY,8,4183.354,5318.837,58.1593, 'Fizzcrank Watcher Rupert Keeneye'); +-- Fizzcrank Watcher Rupert Keeneye dupe spawn +DELETE FROM `creature` WHERE `guid`=97346; +DELETE FROM `creature_addon` WHERE `guid`=97346; + +-- Pathing for Fizzcrank Engineering Crew SAI +SET @ENTRY := 26645; +SET @PATH := @ENTRY*100; +SET @PATH2 := @ENTRY*100+1; +-- Remove old waypoint data and scripts +UPDATE `creature` SET `spawndist`=0,`MovementType`=0,`position_x`=4153.918,`position_y`=5347.379,`position_z`=29.03030 WHERE `guid`=98042; +UPDATE `creature` SET `spawndist`=0,`MovementType`=0,`position_x`=4145.670,`position_y`=5329.370,`position_z`=28.68240 WHERE `guid`=98043; +-- SAI for Fizzcrank Engineering Crew +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid` IN (-98042,-98043); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(-98042,0,0,0,11,0,100,0,0,0,0,0,53,0,@PATH,1,0,0,0,1,0,0,0,0,0,0,0, 'Fizzcrank Engineering Crew - On spawn - Start WP movement'), +(-98042,0,1,2,40,0,100,0,1,@PATH,0,0,54,16000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Fizzcrank Engineering Crew - Reach wp 1 - pause path'), +(-98042,0,2,0,61,0,100,0,0,0,0,0,17,69,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Fizzcrank Engineering Crew - Reach wp 1 - STATE_USESTANDING'), +(-98042,0,3,4,40,0,100,0,6,@PATH,0,0,54,19000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Fizzcrank Engineering Crew - Reach wp 6 - pause path'), +(-98042,0,4,0,61,0,100,0,0,0,0,0,17,69,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Fizzcrank Engineering Crew - Reach wp 6 - STATE_USESTANDING'), +(-98042,0,5,6,40,0,100,0,10,@PATH,0,0,54,16000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Fizzcrank Engineering Crew - Reach wp 10 - pause path'), +(-98042,0,6,0,61,0,100,0,0,0,0,0,17,69,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Fizzcrank Engineering Crew - Reach wp 10 - STATE_USESTANDING'), +(-98042,0,7,8,40,0,100,0,14,@PATH,0,0,54,24000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Fizzcrank Engineering Crew - Reach wp 14 - pause path'), +(-98042,0,8,0,61,0,100,0,0,0,0,0,17,69,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Fizzcrank Engineering Crew - Reach wp 14 - STATE_USESTANDING'), +(-98043,0,0,0,11,0,100,0,0,0,0,0,53,0,@PATH2,1,0,0,0,1,0,0,0,0,0,0,0, 'Fizzcrank Engineering Crew - On spawn - Start WP movement'), +(-98043,0,1,2,40,0,100,0,5,@PATH2,0,0,54,20000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Fizzcrank Engineering Crew - Reach wp 5 - pause path'), +(-98043,0,2,0,61,0,100,0,0,0,0,0,17,69,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Fizzcrank Engineering Crew - Reach wp 5 - STATE_USESTANDING'), +(-98043,0,3,4,40,0,100,0,10,@PATH2,0,0,54,23000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Fizzcrank Engineering Crew - Reach wp 10 - pause path'), +(-98043,0,4,0,61,0,100,0,0,0,0,0,17,233,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Fizzcrank Engineering Crew - Reach wp 10 - STATE_WORK_MINING'), +(-98043,0,5,6,40,0,100,0,18,@PATH2,0,0,54,25000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Fizzcrank Engineering Crew - Reach wp 18 - pause path'), +(-98043,0,6,0,61,0,100,0,0,0,0,0,17,233,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Fizzcrank Engineering Crew - Reach wp 18 - STATE_WORK_MINING'), +(-98043,0,7,8,40,0,100,0,24,@PATH2,0,0,54,25000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Fizzcrank Engineering Crew - Reach wp 24 - pause path'), +(-98043,0,8,0,61,0,100,0,0,0,0,0,17,69,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Fizzcrank Engineering Crew - Reach wp 24 - STATE_USESTANDING'); +-- Waypoints for Fizzcrank Engineering Crew from sniff +DELETE FROM `waypoints` WHERE `entry` IN (@PATH,@PATH2); +INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES +(@PATH,1,4153.728,5344.668,29.34072, 'Fizzcrank Engineering Crew wp 1'), +(@PATH,2,4152.786,5345.597,29.62969, 'Fizzcrank Engineering Crew wp 1'), +(@PATH,3,4157.786,5346.597,29.62969, 'Fizzcrank Engineering Crew wp 1'), +(@PATH,4,4160.786,5343.097,30.37969, 'Fizzcrank Engineering Crew wp 1'), +(@PATH,5,4158.286,5341.347,29.62969, 'Fizzcrank Engineering Crew wp 1'), +(@PATH,6,4156.344,5341.525,29.41866, 'Fizzcrank Engineering Crew wp 1'), +(@PATH,7,4158.535,5340.623,29.56693, 'Fizzcrank Engineering Crew wp 1'), +(@PATH,8,4159.285,5338.123,29.06693, 'Fizzcrank Engineering Crew wp 1'), +(@PATH,9,4157.035,5336.123,29.06693, 'Fizzcrank Engineering Crew wp 1'), +(@PATH,10,4152.727,5336.721,28.71519, 'Fizzcrank Engineering Crew wp 1'), +(@PATH,11,4152.224,5335.373,29.05804, 'Fizzcrank Engineering Crew wp 1'), +(@PATH,12,4150.224,5335.873,29.05804, 'Fizzcrank Engineering Crew wp 1'), +(@PATH,13,4148.974,5337.873,29.30804, 'Fizzcrank Engineering Crew wp 1'), +(@PATH,14,4149.720,5343.525,28.90088, 'Fizzcrank Engineering Crew wp 1'), +(@PATH,15,4148.819,5340.952,29.46559, 'Fizzcrank Engineering Crew wp 1'), +(@PATH,16,4149.319,5336.702,29.21559, 'Fizzcrank Engineering Crew wp 1'), +(@PATH,17,4154.319,5334.202,29.21559, 'Fizzcrank Engineering Crew wp 1'), +(@PATH,18,4158.569,5336.702,28.96559, 'Fizzcrank Engineering Crew wp 1'), +(@PATH,19,4160.819,5343.202,30.21559, 'Fizzcrank Engineering Crew wp 1'), +(@PATH,20,4158.069,5347.202,29.71559, 'Fizzcrank Engineering Crew wp 1'), +(@PATH,21,4153.918,5347.379,29.03030, 'Fizzcrank Engineering Crew wp 1'), +(@PATH2,1,4147.00,5327.734,29.32715, 'Fizzcrank Engineering Crew wp 2'), +(@PATH2,2,4149.25,5326.734,29.07715, 'Fizzcrank Engineering Crew wp 2'), +(@PATH2,3,4151.50,5329.484,29.32715, 'Fizzcrank Engineering Crew wp 2'), +(@PATH2,4,4150.25,5330.734,29.32715, 'Fizzcrank Engineering Crew wp 2'), +(@PATH2,5,4148.829,5329.599,28.9719, 'Fizzcrank Engineering Crew wp 2'), +(@PATH2,6,4150.054,5331.477,29.32324, 'Fizzcrank Engineering Crew wp 2'), +(@PATH2,7,4152.054,5333.477,29.07324, 'Fizzcrank Engineering Crew wp 2'), +(@PATH2,8,4150.804,5335.727,29.07324, 'Fizzcrank Engineering Crew wp 2'), +(@PATH2,9,4147.554,5336.477,29.07324, 'Fizzcrank Engineering Crew wp 2'), +(@PATH2,10,4143.779,5335.355,28.67457, 'Fizzcrank Engineering Crew wp 2'), +(@PATH2,11,4146.732,5336.823,29.20758, 'Fizzcrank Engineering Crew wp 2'), +(@PATH2,12,4150.982,5335.573,29.20758, 'Fizzcrank Engineering Crew wp 2'), +(@PATH2,13,4153.232,5331.323,28.95758, 'Fizzcrank Engineering Crew wp 2'), +(@PATH2,14,4150.482,5326.823,28.70758, 'Fizzcrank Engineering Crew wp 2'), +(@PATH2,15,4144.732,5324.573,29.45758, 'Fizzcrank Engineering Crew wp 2'), +(@PATH2,16,4141.482,5326.823,29.20758, 'Fizzcrank Engineering Crew wp 2'), +(@PATH2,17,4139.686,5329.791,28.74058, 'Fizzcrank Engineering Crew wp 2'), +(@PATH2,18,4141.878,5331.735,28.69350, 'Fizzcrank Engineering Crew wp 2'), +(@PATH2,19,4141.274,5330.552,29.18795, 'Fizzcrank Engineering Crew wp 2'), +(@PATH2,20,4141.774,5328.302,29.18795, 'Fizzcrank Engineering Crew wp 2'), +(@PATH2,21,4142.774,5326.052,29.18795, 'Fizzcrank Engineering Crew wp 2'), +(@PATH2,22,4145.524,5326.052,29.43795, 'Fizzcrank Engineering Crew wp 2'), +(@PATH2,23,4146.774,5328.052,29.18795, 'Fizzcrank Engineering Crew wp 2'), +(@PATH2,24,4145.670,5329.370,28.68240, 'Fizzcrank Engineering Crew wp 2'); +-- Fizzcrank Engineering Crew dupe spawn +DELETE FROM `creature` WHERE `guid`=98029; +DELETE FROM `creature_addon` WHERE `guid`=98029; + +-- Pathing for Fizzcrank bomber Entry: 25765 +SET @NPC := 111360; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=4235.847,`position_y`=5353.55,`position_z`=81.03476 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,4222.374,5370.328,72.03476,0,1,0,100,0), +(@PATH,2,4193.999,5364.787,66.81252,0,1,0,100,0), +(@PATH,3,4161.166,5319.937,66.81252,0,1,0,100,0), +(@PATH,4,4149.038,5289.545,66.81252,0,1,0,100,0), +(@PATH,5,4158.851,5255.303,66.81252,0,1,0,100,0), +(@PATH,6,4193.628,5230.504,79.17356,0,1,0,100,0), +(@PATH,7,4259.787,5211.473,79.20131,0,1,0,100,0), +(@PATH,8,4293.693,5221.593,80.20133,0,1,0,100,0), +(@PATH,9,4296.654,5282.716,82.20137,0,1,0,100,0), +(@PATH,10,4261.68,5314.814,89.8682,0,1,0,100,0), +(@PATH,11,4224.254,5366.333,98.86811,0,1,0,100,0), +(@PATH,12,4174.309,5345.78,98.86811,0,1,0,100,0), +(@PATH,13,4150.472,5287.501,98.86811,0,1,0,100,0), +(@PATH,14,4188.47,5251.628,102.757,0,1,0,100,0), +(@PATH,15,4241.055,5236.796,102.757,0,1,0,100,0), +(@PATH,16,4280.259,5260.132,105.6182,0,1,0,100,0), +(@PATH,17,4271.736,5301.975,105.6182,0,1,0,100,0), +(@PATH,18,4235.847,5353.55,81.03476,0,1,0,100,0); +-- Fizzcrank bomber dupe spawn +DELETE FROM `creature` WHERE `guid` IN (111361,111426); +DELETE FROM `creature_addon` WHERE `guid` IN (111361,111426); + +-- Rig Hauler AC-9 SAI +SET @ENTRY := 25766; +UPDATE `creature` SET `position_x`=4170.335,`position_y`=5359.113,`position_z`=30.06447,`orientation`=2.740167 WHERE `guid`=111472; +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid` IN (@ENTRY*100); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,1,0,100,0,5000,10000,210000,210000,80,@ENTRY*100,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Rig Hauler AC-9 - OOC 3.5 min - start script 1'), +(@ENTRY,0,1,0,40,0,100,0,1,@ENTRY,0,0,45,0,1,0,0,0,0,11,25765,20,0,0,0,0,0, 'Rig Hauler AC-9 - Reach wp 1 - dataset 0 1 nearest Fizzcrank Bomber'), +(@ENTRY,0,2,3,40,0,100,0,5,@ENTRY,0,0,54,5000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Rig Hauler AC-9 - Reach wp 5 - pause wp'), +(@ENTRY,0,3,0,61,0,100,0,0,0,0,0,92,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Rig Hauler AC-9 - Reach wp 5 - INTERRUPT_SPELL'), +(@ENTRY,0,4,0,40,0,100,0,6,@ENTRY,0,0,45,0,1,0,0,0,0,10,106069,15214,0,0,0,0,0, 'Rig Hauler AC-9 - Reach wp 6 - dataset 0 1 Invisable Stalker'), +(@ENTRY,0,5,0,40,0,100,0,25,@ENTRY,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,2.740167, 'Rig Hauler AC-9 - Reach wp 25 - turn to'), +-- Script +(@ENTRY*100,9,0,0,0,0,100,0,0,0,0,0,12,25765,3,360000,0,0,0,8,0,0,0,4165.76,5354.39,30.1116,2.35619, 'Rig Hauler AC-9 - script - summon 25765'), +(@ENTRY*100,9,1,0,0,0,100,0,6000,6000,0,0,11,45967,0,0,0,0,0,11,25765,10,0,0,0,0,0, 'Rig Hauler AC-9 - script - cast 45967'), +(@ENTRY*100,9,2,0,0,0,100,0,3000,3000,0,0,53,0,@ENTRY,0,0,0,0,1,0,0,0,0,0,0,0, 'Rig Hauler AC-9 - script - Start WP movement'); +-- Waypoints for Rig Hauler AC-9 from sniff +DELETE FROM `waypoints` WHERE `entry`=@ENTRY; +INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES +(@ENTRY,1,4149.316,5357.732,29.11953, 'Rig Hauler AC-9'), +(@ENTRY,2,4136.816,5345.482,29.11953, 'Rig Hauler AC-9'), +(@ENTRY,3,4125.566,5333.982,29.11953, 'Rig Hauler AC-9'), +(@ENTRY,4,4115.297,5323.852,28.67458, 'Rig Hauler AC-9'), +(@ENTRY,5,4108.158,5316.849,28.75930, 'Rig Hauler AC-9'), +(@ENTRY,6,4111.660,5313.279,28.75930, 'Rig Hauler AC-9'), +(@ENTRY,7,4112.747,5314.946,29.16189, 'Rig Hauler AC-9'), +(@ENTRY,8,4116.997,5314.946,29.16189, 'Rig Hauler AC-9'), +(@ENTRY,9,4118.997,5316.946,29.16189, 'Rig Hauler AC-9'), +(@ENTRY,10,4125.247,5323.196,29.16189, 'Rig Hauler AC-9'), +(@ENTRY,11,4127.247,5325.196,29.16189, 'Rig Hauler AC-9'), +(@ENTRY,12,4129.497,5326.696,29.16189, 'Rig Hauler AC-9'), +(@ENTRY,13,4131.497,5328.446,29.16189, 'Rig Hauler AC-9'), +(@ENTRY,14,4133.497,5328.446,29.16189, 'Rig Hauler AC-9'), +(@ENTRY,15,4134.747,5329.446,29.16189, 'Rig Hauler AC-9'), +(@ENTRY,16,4135.747,5333.696,29.16189, 'Rig Hauler AC-9'), +(@ENTRY,17,4141.997,5337.196,29.16189, 'Rig Hauler AC-9'), +(@ENTRY,18,4143.997,5341.946,29.16189, 'Rig Hauler AC-9'), +(@ENTRY,19,4145.997,5344.946,29.16189, 'Rig Hauler AC-9'), +(@ENTRY,20,4147.247,5346.196,29.16189, 'Rig Hauler AC-9'), +(@ENTRY,21,4150.247,5348.196,29.16189, 'Rig Hauler AC-9'), +(@ENTRY,22,4152.247,5350.196,29.16189, 'Rig Hauler AC-9'), +(@ENTRY,23,4162.747,5356.196,29.66189, 'Rig Hauler AC-9'), +(@ENTRY,24,4166.997,5358.696,30.41189, 'Rig Hauler AC-9'), +(@ENTRY,25,4170.335,5359.113,30.06447, 'Rig Hauler AC-9'); +-- Rig Hauler AC-9 dupe spawn +DELETE FROM `creature` WHERE `guid`=111501; +DELETE FROM `creature_addon` WHERE `guid`=111501; + +-- Fizzcrank Bomber SAI +SET @ENTRY := 25765; +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,1,38,0,100,0,0,1,0,0,45,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Fizzcrank Bomber - on dataset 0 1 - dataset 0 0'), +(@ENTRY,0,1,0,61,0,100,0,0,0,0,0,53,0,@ENTRY,0,0,0,0,1,0,0,0,0,0,0,0, 'Fizzcrank Bomber - on dataset 0 1 - Start WP movement'), +(@ENTRY,0,2,3,40,0,100,0,22,@ENTRY,0,0,54,45000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Fizzcrank Bomber - Reach wp 22 - pause wp'), +(@ENTRY,0,3,0,61,0,100,0,0,0,0,0,59,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Fizzcrank Bomber - Reach wp 22 - Set Speed run'), +(@ENTRY,0,4,5,40,0,100,0,74,@ENTRY,0,0,11,47460,3,0,0,0,0,11,26817,5,0,0,0,0,0, 'Fizzcrank Bomber - Reach wp 74 - cast 47460 on Fizzcrank fighter'), +(@ENTRY,0,5,0,61,0,100,0,0,0,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Fizzcrank Bomber - Reach wp 74 - despawn'); +-- Waypoints for Fizzcrank Bomber from sniff +DELETE FROM `waypoints` WHERE `entry`=@ENTRY; +INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES +(@ENTRY,1,4164.758,5354.723,30.19215, 'Fizzcrank Bomber wp 1'), +(@ENTRY,2,4162.034,5355.368,30.09748, 'Fizzcrank Bomber wp 1'), +(@ENTRY,3,4159.190,5355.827,30.01153, 'Fizzcrank Bomber wp 1'), +(@ENTRY,4,4156.273,5356.132,29.94405, 'Fizzcrank Bomber wp 1'), +(@ENTRY,5,4154.659,5355.736,29.91132, 'Fizzcrank Bomber wp 1'), +(@ENTRY,6,4152.153,5354.786,29.86976, 'Fizzcrank Bomber wp 1'), +(@ENTRY,7,4149.633,5353.545,29.83581, 'Fizzcrank Bomber wp 1'), +(@ENTRY,8,4147.138,5352.081,29.80874, 'Fizzcrank Bomber wp 1'), +(@ENTRY,9,4144.689,5350.449,29.78749, 'Fizzcrank Bomber wp 1'), +(@ENTRY,10,4142.290,5348.694,29.77098, 'Fizzcrank Bomber wp 1'), +(@ENTRY,11,4139.963,5346.840,29.76581, 'Fizzcrank Bomber wp 1'), +(@ENTRY,12,4137.673,5344.909,29.76182, 'Fizzcrank Bomber wp 1'), +(@ENTRY,13,4135.418,5342.924,29.75874, 'Fizzcrank Bomber wp 1'), +(@ENTRY,14,4133.194,5340.901,29.75638, 'Fizzcrank Bomber wp 1'), +(@ENTRY,15,4130.993,5338.848,29.75706, 'Fizzcrank Bomber wp 1'), +(@ENTRY,16,4128.794,5336.785,29.75758, 'Fizzcrank Bomber wp 1'), +(@ENTRY,17,4126.612,5334.716,29.75798, 'Fizzcrank Bomber wp 1'), +(@ENTRY,18,4124.430,5332.629,29.75829, 'Fizzcrank Bomber wp 1'), +(@ENTRY,19,4121.542,5329.849,29.75858, 'Fizzcrank Bomber wp 1'), +(@ENTRY,20,4118.184,5326.597,29.75881, 'Fizzcrank Bomber wp 1'), +(@ENTRY,21,4116.024,5324.498,29.75892, 'Fizzcrank Bomber wp 1'), +(@ENTRY,22,4113.869,5322.398,29.75901, 'Fizzcrank Bomber wp 1'), +(@ENTRY,23,4090.109,5298.56,29.70082, 'Fizzcrank Bomber wp 1'), +(@ENTRY,24,4079.459,5287.617,29.8968, 'Fizzcrank Bomber wp 1'), +(@ENTRY,25,4066.779,5274.603,31.53571, 'Fizzcrank Bomber wp 1'), +(@ENTRY,26,4041.215,5249.248,31.45236, 'Fizzcrank Bomber wp 1'), +(@ENTRY,27,4020.432,5218.824,29.8968, 'Fizzcrank Bomber wp 1'), +(@ENTRY,28,4002.392,5190.421,29.8968, 'Fizzcrank Bomber wp 1'), +(@ENTRY,29,4000.105,5146.331,29.8968, 'Fizzcrank Bomber wp 1'), +(@ENTRY,30,3993.002,5119.754,29.8968, 'Fizzcrank Bomber wp 1'), +(@ENTRY,31,3976.405,5093.208,29.8968, 'Fizzcrank Bomber wp 1'), +(@ENTRY,32,3983.637,5055.651,29.8968, 'Fizzcrank Bomber wp 1'), +(@ENTRY,33,3990.106,5011.049,29.8968, 'Fizzcrank Bomber wp 1'), +(@ENTRY,34,3992.433,4984.051,29.8968, 'Fizzcrank Bomber wp 1'), +(@ENTRY,35,3988.744,4946.948,29.8968, 'Fizzcrank Bomber wp 1'), +(@ENTRY,36,3975.796,4912.274,29.8968, 'Fizzcrank Bomber wp 1'), +(@ENTRY,37,3958.111,4895.366,29.8968, 'Fizzcrank Bomber wp 1'), +(@ENTRY,38,3928.622,4858.76,29.8968, 'Fizzcrank Bomber wp 1'), +(@ENTRY,39,3921.781,4825.03,29.8968, 'Fizzcrank Bomber wp 1'), +(@ENTRY,40,3935.435,4790.436,29.8968, 'Fizzcrank Bomber wp 1'), +(@ENTRY,41,3966.323,4756.983,29.8968, 'Fizzcrank Bomber wp 1'), +(@ENTRY,42,3987.75,4763.042,29.8968, 'Fizzcrank Bomber wp 1'), +(@ENTRY,43,4025.366,4755.083,29.8968, 'Fizzcrank Bomber wp 1'), +(@ENTRY,44,4050.189,4787.045,29.8968, 'Fizzcrank Bomber wp 1'), +(@ENTRY,45,4082.41,4825.174,29.8968, 'Fizzcrank Bomber wp 1'), +(@ENTRY,46,4084.739,4845.887,29.8968, 'Fizzcrank Bomber wp 1'), +(@ENTRY,47,4082.781,4879.066,29.8968, 'Fizzcrank Bomber wp 1'), +(@ENTRY,48,4075.255,4897.705,29.8968, 'Fizzcrank Bomber wp 1'), +(@ENTRY,49,4063.763,4936.532,29.8968, 'Fizzcrank Bomber wp 1'), +(@ENTRY,50,4066.78,4968.409,29.8968, 'Fizzcrank Bomber wp 1'), +(@ENTRY,51,4082.993,4997.696,29.8968, 'Fizzcrank Bomber wp 1'), +(@ENTRY,52,4110.507,5030.572,29.8968, 'Fizzcrank Bomber wp 1'), +(@ENTRY,53,4141.148,5060.043,29.8968, 'Fizzcrank Bomber wp 1'), +(@ENTRY,54,4164.455,5087.176,29.8968, 'Fizzcrank Bomber wp 1'), +(@ENTRY,55,4189.664,5124.69,29.8968, 'Fizzcrank Bomber wp 1'), +(@ENTRY,56,4214.33,5154.247,29.8968, 'Fizzcrank Bomber wp 1'), +(@ENTRY,57,4237.962,5194.166,29.8968, 'Fizzcrank Bomber wp 1'), +(@ENTRY,58,4228.307,5238.578,42.11903, 'Fizzcrank Bomber wp 1'), +(@ENTRY,59,4200.375,5271.218,46.75792, 'Fizzcrank Bomber wp 1'), +(@ENTRY,60,4211.719,5318.444,47.13599, 'Fizzcrank Bomber wp 1'), +(@ENTRY,61,4229.69,5356.218,47.13599, 'Fizzcrank Bomber wp 1'), +(@ENTRY,62,4229.779,5396.165,53.08044, 'Fizzcrank Bomber wp 1'), +(@ENTRY,63,4231.299,5419.959,53.71933, 'Fizzcrank Bomber wp 1'), +(@ENTRY,64,4228.378,5466.135,57.13599, 'Fizzcrank Bomber wp 1'), +(@ENTRY,65,4249.183,5490.759,47.13599, 'Fizzcrank Bomber wp 1'), +(@ENTRY,66,4282.767,5500.858,48.85822, 'Fizzcrank Bomber wp 1'), +(@ENTRY,67,4300.521,5486.341,48.386, 'Fizzcrank Bomber wp 1'), +(@ENTRY,68,4291.369,5470.349,48.91378, 'Fizzcrank Bomber wp 1'), +(@ENTRY,69,4277.046,5454.25,47.13599, 'Fizzcrank Bomber wp 1'), +(@ENTRY,70,4253.641,5434.851,47.13599, 'Fizzcrank Bomber wp 1'), +(@ENTRY,71,4227.768,5423.928,47.13599, 'Fizzcrank Bomber wp 1'), +(@ENTRY,72,4204.012,5411.217,37.52486, 'Fizzcrank Bomber wp 1'), +(@ENTRY,73,4194.847,5402.538,32.41374, 'Fizzcrank Bomber wp 1'), +(@ENTRY,74,4178.285,5386.063,30.94151, 'Fizzcrank Bomber wp 1'); +-- Remove Fizzcrank Bomber spawn +DELETE FROM `creature` WHERE `guid`=111452; +DELETE FROM `creature_addon` WHERE `guid`=111452; + +-- Invisable Stalker SAI +SET @ENTRY := 15214; +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=-106069; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(-106069,0,0,1,38,0,100,0,0,1,0,0,45,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Invisable Stalker - on dataset 0 1 - dataset 0 0'), +(-106069,0,1,0,61,0,100,0,0,0,0,0,11,47453,3,0,0,0,0,11,25766,200,0,0,0,0,0, 'Invisable Stalker - on dataset 0 1 - Cast 47453 on Rig Hauler AC-9'); + +-- Fizzcrank Fighter SAI +SET @ENTRY := 26817; +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,11,0,100,0,0,0,0,0,53,0,@ENTRY,0,0,0,0,1,0,0,0,0,0,0,0, 'Fizzcrank Fighter - on spawn - start wp'), +(@ENTRY,0,1,0,1,0,100,1,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Fizzcrank Fighter - on spawn - say text 0'), +(@ENTRY,0,2,0,40,0,100,0,15,@ENTRY,0,0,11,43671,3,0,0,0,0,11,25765,20,0,0,0,0,0, 'Fizzcrank Fighter - Reach wp 15 - cast 43671 on Fizzcrank Bomber'); +-- NPC talk text for Fizzcrank Fighter +DELETE FROM `creature_text` WHERE `entry`=@ENTRY; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@ENTRY,0,0, 'I''ll blast those gnomish wannabes back to the scrap heap!',0,7,100,0,0,0, 'Fizzcrank Fighter'), +(@ENTRY,0,1, 'You''re sending me back there?!',0,7,100,0,0,0, 'Fizzcrank Fighter'); +-- Waypoints for Fizzcrank Fighter from sniff +DELETE FROM `waypoints` WHERE `entry`=@ENTRY; +INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES +(@ENTRY,1,4176.501,5280.566,27.17445, 'Fizzcrank Fighter'), +(@ENTRY,2,4167.001,5282.066,27.17445, 'Fizzcrank Fighter'), +(@ENTRY,3,4164.751,5282.566,26.92445, 'Fizzcrank Fighter'), +(@ENTRY,4,4162.655,5282.681,26.48916, 'Fizzcrank Fighter'), +(@ENTRY,5,4158.462,5280.628,26.26419, 'Fizzcrank Fighter'), +(@ENTRY,6,4155.712,5279.378,25.76419, 'Fizzcrank Fighter'), +(@ENTRY,7,4154.958,5278.939,24.86416, 'Fizzcrank Fighter'), +(@ENTRY,8,4147.710,5281.817,24.86416, 'Fizzcrank Fighter'), +(@ENTRY,9,4144.757,5295.502,25.61416, 'Fizzcrank Fighter'), +(@ENTRY,10,4142.652,5300.067,26.94346, 'Fizzcrank Fighter'), +(@ENTRY,11,4137.876,5308.749,27.94350, 'Fizzcrank Fighter'), +(@ENTRY,12,4135.610,5310.586,28.93834, 'Fizzcrank Fighter'), +(@ENTRY,13,4131.433,5312.564,28.75930, 'Fizzcrank Fighter'), +(@ENTRY,14,4123.820,5317.622,28.75930, 'Fizzcrank Fighter'), +(@ENTRY,15,4115.430,5321.649,28.75930, 'Fizzcrank Fighter'); +-- Remove Fizzcrank Fighter spawns +DELETE FROM `creature` WHERE `guid` IN (114142,114143,114165); +DELETE FROM `creature_addon` WHERE `guid` IN (114142,114143,114165); + +-- Pathing for Crafty Wobblesprocket SAI +SET @ENTRY := 25477; +UPDATE `creature` SET `spawndist`=0,`MovementType`=0,`position_x`=4172.788,`position_y`=5254.925,`position_z`=26.12851 WHERE `guid`=108021; +-- SAI for Crafty Wobblesprocket +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid` IN (@ENTRY*100,@ENTRY*100+1); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,11,0,100,0,0,0,0,0,53,0,@ENTRY,1,0,0,0,1,0,0,0,0,0,0,0, 'Crafty Wobblesprocket - On spawn - Start WP movement'), +(@ENTRY,0,1,2,40,0,100,0,1,@ENTRY,0,0,54,45000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Crafty Wobblesprocket - Reach wp 1 - pause path'), +(@ENTRY,0,2,0,61,0,100,0,0,0,0,0,17,69,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Crafty Wobblesprocket - Reach wp 1 - STATE_USESTANDING'), +(@ENTRY,0,3,4,40,0,100,0,6,@ENTRY,0,0,54,35000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Crafty Wobblesprocket - Reach wp 6 - pause path'), +(@ENTRY,0,4,5,61,0,100,0,0,0,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,0.4712389, 'Crafty Wobblesprocket - Reach wp 6 - turn to'), +(@ENTRY,0,5,0,61,0,100,0,0,0,0,0,17,233,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Crafty Wobblesprocket - Reach wp 6 - STATE_WORK_MINING'); +-- Waypoints for Crafty Wobblesprocket from sniff +DELETE FROM `waypoints` WHERE `entry`=@ENTRY; +INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES +(@ENTRY,1,4179.099,5251.51,26.37851, 'Crafty Wobblesprocket'), +(@ENTRY,2,4177.94,5250.202,26.87851, 'Crafty Wobblesprocket'), +(@ENTRY,3,4181.048,5243.429,24.87851, 'Crafty Wobblesprocket'), +(@ENTRY,4,4182.067,5222.448,25.00868, 'Crafty Wobblesprocket'), +(@ENTRY,5,4193.037,5217.233,25.13368, 'Crafty Wobblesprocket'), +(@ENTRY,6,4193.037,5217.233,25.13368, 'Crafty Wobblesprocket'), +(@ENTRY,7,4190.718,5217.938,25.25868, 'Crafty Wobblesprocket'), +(@ENTRY,8,4176.049,5229.444,24.50868, 'Crafty Wobblesprocket'), +(@ENTRY,9,4166.732,5248.798,24.75351, 'Crafty Wobblesprocket'), +(@ENTRY,10,4172.788,5254.925,26.12851, 'Crafty Wobblesprocket'); +-- Remove Crafty Wobblesprocket dupe spawn +DELETE FROM `creature` WHERE `guid`=108025; +DELETE FROM `creature_addon` WHERE `guid`=108025; +-- Fix addon for Crafty Wobblesprocket +DELETE FROM `creature_addon` WHERE `guid`=108021; +DELETE FROM `creature_template_addon` WHERE `entry`=25477; +INSERT INTO `creature_template_addon` (`entry`,`bytes2`) VALUES (25477,257); + +-- SAI for ELM General Purpose Bunny +SET @ENTRY := 23837; +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid` IN (-98575,-98576); +DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid` IN (@ENTRY*100); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(-98575,0,0,0,1,0,100,0,10000,20000,90000,105000,11,45931,3,0,0,0,0,10,98576,23837,0,0,0,0,0, 'ELM General Purpose Bunny - OOC timed - cast 45931 on target'), +(-98576,0,0,0,8,0,100,0,45931,0,0,0,80,@ENTRY*100,0,0,0,0,0,1,0,0,0,0,0,0,0, 'ELM General Purpose Bunny - On spellhit - run script'), +(@ENTRY*100,9,0,0,0,0,100,0,4000,4000,0,0,12,25783,3,60000,0,0,0,8,0,0,0,4181.491,5258.655,27.19127,3.857178, 'ELM General Purpose Bunny - script - summon 25783'), +(@ENTRY*100,9,1,0,0,0,100,0,1000,1000,0,0,5,5,0,0,0,0,0,11,25747,10,0,0,0,0,0, 'ELM General Purpose Bunny - script - send emote to 25747'), +(@ENTRY*100,9,2,0,0,0,100,0,4000,4000,0,0,45,0,1,0,0,0,0,11,25783,10,0,0,0,0,0, 'ELM General Purpose Bunny - script - set data 0 1 on 25783'); + +-- SAI for Fizzcrank Airstrip Survivor +SET @ENTRY := 25783; +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,1,0,100,1,0,0,0,0,11,34427,3,0,0,0,0,1,0,0,0,0,0,0,0, 'Fizzcrank Airstrip Survivor - on spawn - cast 34427 on self'), +(@ENTRY,0,1,0,1,0,100,1,1000,1000,1000,1000,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Fizzcrank Airstrip Survivor - on spawn - say text 0'), +(@ENTRY,0,2,3,38,0,100,0,0,1,0,0,45,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Fizzcrank Airstrip Survivor - on dataset 0 1 - dataset 0 0'), +(@ENTRY,0,3,0,61,0,100,0,0,0,0,0,53,0,@ENTRY,0,0,0,0,1,0,0,0,0,0,0,0, 'Fizzcrank Airstrip Survivor - on dataset 0 1 - Start WP movement'), +(@ENTRY,0,4,0,40,0,100,0,6,@ENTRY,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Fizzcrank Airstrip Survivor - Reach wp 6 - despawn'); +-- Waypoints for Fizzcrank Airstrip Survivor from sniff +DELETE FROM `waypoints` WHERE `entry`=@ENTRY; +INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES +(@ENTRY,1,4168.529,5251.933,24.87851, 'Fizzcrank Airstrip Survivor'), +(@ENTRY,2,4156.656,5256.007,24.62325, 'Fizzcrank Airstrip Survivor'), +(@ENTRY,3,4151.527,5268.997,25.36416, 'Fizzcrank Airstrip Survivor'), +(@ENTRY,4,4159.549,5281.078,26.23916, 'Fizzcrank Airstrip Survivor'), +(@ENTRY,5,4173.898,5280.844,26.69306, 'Fizzcrank Airstrip Survivor'), +(@ENTRY,6,4179.473,5282.701,26.69306, 'Fizzcrank Airstrip Survivor'); +-- Remove Fizzcrank Airstrip Survivor spawn +DELETE FROM `creature` WHERE `guid` IN (88109); +DELETE FROM `creature_addon` WHERE `guid` IN (88109); +-- NPC talk text for Fizzcrank Survivor +DELETE FROM `creature_text` WHERE `entry`=@ENTRY; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@ENTRY,0,0, 'I''m flesh and blood again. That''s all that matters!',0,7,100,5,0,0, 'Fizzcrank Survivor'); + +-- Model and creature addon info (Nay) +UPDATE `creature_model_info` SET `bounding_radius`=0.3694949,`combat_reach`=1.81125,`gender`=1 WHERE `modelid`=23967; -- Chief Engineer Galpen Rolltie +UPDATE `creature_model_info` SET `bounding_radius`=0.3694949,`combat_reach`=1.81125,`gender`=1 WHERE `modelid`=23220; -- Crafty Wobblesprocket +-- Addon data for creature 26600 (Chief Engineer Galpen Rolltie) +DELETE FROM `creature_template_addon` WHERE `entry` IN (26600,26599,26634,26645,25766,15214,26817,23837,25783); +INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(26600,0,0,257,0, NULL), -- Chief Engineer Galpen Rolltie +(26599,0,0,257,0, NULL), -- Willis Wobblewheel +(26634,0,0,257,0, NULL), -- Fizzcrank Watcher Rupert Keeneye +(26645,0,0,257,0, NULL), -- Fizzcrank Engineering Crew +(25766,0,0,1,0, NULL), -- Rig Hauler AC-9 +(15214,0,0,1,0, NULL), -- Invisible Stalker +(26817,0,0,257,0, NULL), -- Fizzcrank Fighter +(23837,0,0,1,0, NULL), -- ELM General Purpose Bunny +(25783,0,0,257,0, NULL); -- Fizzcrank Airstrip Survivor diff --git a/sql/updates/world/2011_03_23_14_world_conditions.sql b/sql/updates/world/2011_03_23_14_world_conditions.sql new file mode 100644 index 0000000000000..c374bdd8fc604 --- /dev/null +++ b/sql/updates/world/2011_03_23_14_world_conditions.sql @@ -0,0 +1,11 @@ +DELETE FROM `conditions` WHERE `SourceEntry` IN (63317,62505,63524,63657,63658,63659); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) +VALUES +(13,0,63317,0,18,1,33453,0,0,'','Flame Breath - Dark Rune Watcher'), +(13,0,63317,0,18,1,33846,0,0,'','Flame Breath - Dark Rune Sentinel'), +(13,0,63317,0,18,1,33388,0,0,'','Flame Breath - Dark Rune Guardian'), +(13,0,62505,0,18,1,33186,0,0,'','Harpoon Trigger - Razorscale'), +(13,0,63524,0,18,1,33233,0,0,'','Harpoon Shot - Razorscale'), +(13,0,63657,0,18,1,33233,0,0,'','Harpoon Shot - Razorscale'), +(13,0,63658,0,18,1,33233,0,0,'','Harpoon Shot - Razorscale'), +(13,0,63659,0,18,1,33233,0,0,'','Harpoon Shot - Razorscale'); diff --git a/sql/updates/world/2011_03_23_14_world_creature_template.sql b/sql/updates/world/2011_03_23_14_world_creature_template.sql new file mode 100644 index 0000000000000..ff9569bb8fac5 --- /dev/null +++ b/sql/updates/world/2011_03_23_14_world_creature_template.sql @@ -0,0 +1,9 @@ +UPDATE `creature_template` SET `ScriptName` = 'boss_razorscale_controller' WHERE `entry` = 33233; +UPDATE `creature_template` SET `ScriptName` = 'boss_razorscale' WHERE `entry` = 33186; +UPDATE `creature_template` SET `ScriptName` = 'npc_darkrune_watcher' WHERE `entry` = 33453; +UPDATE `creature_template` SET `ScriptName` = 'npc_darkrune_sentinel' WHERE `entry` = 33846; +UPDATE `creature_template` SET `ScriptName` = 'npc_darkrune_guardian' WHERE `entry` = 33388; +UPDATE `creature_template` SET `ScriptName` = 'npc_devouring_flame' WHERE `entry` = 34188; +UPDATE `creature_template` SET `ScriptName` = 'npc_expedition_commander' WHERE `entry` = 33210; +UPDATE `creature_template` SET `ScriptName` = 'npc_mole_machine_trigger' WHERE `entry` IN (33282, 33245); +UPDATE `creature_template` SET `flags_extra`=`flags_extra`|2 WHERE `entry` IN (33210,33287,33259,33233); diff --git a/sql/updates/world/2011_03_23_14_world_creatures.sql b/sql/updates/world/2011_03_23_14_world_creatures.sql new file mode 100644 index 0000000000000..18d1655f4e39d --- /dev/null +++ b/sql/updates/world/2011_03_23_14_world_creatures.sql @@ -0,0 +1,11 @@ +SET @GUID :=48304; +DELETE FROM `creature` WHERE `guid` BETWEEN @GUID AND @GUID+6; +INSERT INTO `creature` (`guid`, `id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`DeathState`,`MovementType`) +VALUES +(@GUID,33233,603,1,1,0,0,560.1334,-143.035431,393.822632,0,120,0,0,1,0,0,0), +(@GUID+1,33233,603,1,1,0,0,572.410645,-138.656357,393.904419,0,120,0,0,1,0,0,0), +(@GUID+2,33233,603,1,1,0,0,585.9284,-146.587509,391.6004,0,120,0,0,1,0,0,0), +(@GUID+3,33233,603,1,1,0,0,589.7287,-137.1148,393.9011,0,120,0,0,1,0,0,0), +(@GUID+4,33233,603,1,1,0,0,605.9284,-140.108887,393.7972,0,120,0,0,1,0,0,0), +(@GUID+5,33233,603,1,1,0,0,630.2436,-276.259064,392.3122,0,120,0,0,1,0,0,0), +(@GUID+6,33233,603,1,1,0,0,638.241638,-272.1735,392.135132,0,120,0,0,1,0,0,0); diff --git a/sql/updates/world/2011_03_23_14_world_gameobject_template.sql b/sql/updates/world/2011_03_23_14_world_gameobject_template.sql new file mode 100644 index 0000000000000..00c40de627630 --- /dev/null +++ b/sql/updates/world/2011_03_23_14_world_gameobject_template.sql @@ -0,0 +1 @@ +UPDATE `gameobject_template` SET `ScriptName`='go_razorscale_harpoon' WHERE `entry` IN (194519,194541,194542,194543); diff --git a/sql/updates/world/2011_03_23_14_world_spell_script_names.sql b/sql/updates/world/2011_03_23_14_world_spell_script_names.sql new file mode 100644 index 0000000000000..c91c5273f9c4d --- /dev/null +++ b/sql/updates/world/2011_03_23_14_world_spell_script_names.sql @@ -0,0 +1,4 @@ +DELETE FROM `spell_script_names` WHERE `spell_id`=63308; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) +VALUES +(63308,'spell_razorscale_devouring_flame'); diff --git a/sql/updates/world/2011_03_24_00_world_creature_template.sql b/sql/updates/world/2011_03_24_00_world_creature_template.sql new file mode 100644 index 0000000000000..d1dd1653f3321 --- /dev/null +++ b/sql/updates/world/2011_03_24_00_world_creature_template.sql @@ -0,0 +1,69 @@ +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=10404; -- Pustulating Horror +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=34606; -- Frost Sphere +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=36724; -- Servant of the Throne +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=36725; -- Nerub'ar Broodkeeper +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=36805; -- Deathspeaker Servant +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=36807; -- Deathspeaker Disciple +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=36808; -- Deathspeaker Zealot +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=36811; -- Deathspeaker Attendant +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=36829; -- Deathspeaker High Priest +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=36839; -- Horde Gunship Cannon +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=36844; -- Risen Deathspeaker Servant +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=36998; -- Skybreaker Protector +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=37003; -- Skybreaker Vindicator +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=37004; -- Skybreaker Dreadblade +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=37007; -- Deathbound Ward +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=37011; -- The Damned +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=37012; -- Ancient Skeletal Soldier +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=37016; -- Skybreaker Luminary +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=37017; -- Skybreaker Assassin +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=37021; -- Skybreaker Vicar +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=37027; -- Skybreaker Hierophant +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=37030; -- Kor'kron Primalist +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=37031; -- Kor'kron Oracle +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=37032; -- Kor'kron Defender +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=37033; -- Kor'kron Invoker +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=37035; -- Kor'kron Vanquisher +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=37144; -- Skybreaker Marksman +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=37146; -- Kor'kron Sniper +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=37148; -- Skybreaker Summoner +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=37149; -- Kor'kron Necrolyte +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=37230; -- Spire Frostwyrm +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=37544; -- Spire Gargoyle +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=37545; -- Spire Minion +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=37546; -- Frenzied Abomination +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=36880; -- Decaying Colossus +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=36897; -- Little Ooze +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=36899; -- Big Ooze +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=37022; -- Blighted Abomination +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=37023; -- Plague Scientist +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=37025; -- Stinky +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=37038; -- Vengeful Fleshreaper +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=37098; -- Val'kyr Herald +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=37217; -- Precious +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=37571; -- Darkfallen Advisor +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=37595; -- Darkfallen Blood Knight +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=37662; -- Darkfallen Commander +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=37663; -- Darkfallen Noble +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=37664; -- Darkfallen Archmage +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=37665; -- Darkfallen Lieutenant +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=37666; -- Darkfallen Tactician +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=37782; -- Flesh-eating Insect +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=37901; -- Vampiric Fiend +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=38104; -- Plagued Zombie +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=38410; -- Severed Essence +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=37034; -- Kor'kron Templar +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=37501; -- Nerub'ar Champion +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=37502; -- Nerub'ar Webweaver +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=38184; -- Corrupted Ymirjar +UPDATE `creature_template` SET `difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=37232; -- Nerub'ar Broodling +UPDATE `creature_template` SET `difficulty_entry_1`=0,`difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=36990; -- Lady Sylvanas Windrunner +UPDATE `creature_template` SET `difficulty_entry_1`=0,`difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=37068; -- Spiritual Reflection +UPDATE `creature_template` SET `difficulty_entry_1`=0,`difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=37107; -- Spiritual Reflection +UPDATE `creature_template` SET `difficulty_entry_1`=0,`difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=37920; -- Kor'kron Reaver +UPDATE `creature_template` SET `difficulty_entry_1`=0,`difficulty_entry_2`=0,`difficulty_entry_3`=0 WHERE `entry`=38456; -- Frozen Orb + +-- Delete all the fake/temp diffentry templates +DELETE FROM `creature_template` WHERE `entry` BETWEEN 3460602 AND 3845601 OR `entry` IN (1040402,1040403); +DELETE FROM `creature_loot_template` WHERE `entry` IN (3672402,3672403,3672502,3672503,3680502,3680503,3680702,3680703,3680802,3680803,3681102,3681103,3682902,3682903,3688002,3688003,3699802,3699803,3700302,3700303,3700402,3700403,3700702,3700703,3701102,3701103,3701202,3701203,3701602,3701603,3701702,3701703,3702102,3702103,3702202,3702203,3702302,3702303,3702502,3702503,3702702,3702703,3703002,3703003,3703102,3703103,3703202,3703203,3703302,3703303,3703402,3703403,3703502,3703503,3703802,3703803,3709802,3709803,3714402,3714403,3714602,3714603,3714802,3714803,3714902,3714903,3721702,3721703,3723002,3723003,3750102,3750103,3750202,3750203,3754402,3754403,3754502,3754503,3754602,3754603,3757102,3757103,3759502,3759503,3766202,3766203,3766302,3766303,3766402,3766403,3766502,3766503,3766602,3766603); +DELETE FROM `creature_onkill_reputation` WHERE `creature_id` BETWEEN 3460602 AND 3845601 OR `creature_id` IN (1040402,1040403); diff --git a/sql/updates/world/2011_03_24_01_world_loot_template.sql b/sql/updates/world/2011_03_24_01_world_loot_template.sql new file mode 100644 index 0000000000000..a039b5d193334 --- /dev/null +++ b/sql/updates/world/2011_03_24_01_world_loot_template.sql @@ -0,0 +1,382 @@ +-- Trashloot for ICC/FoS/PoS/HoR +-- Generic +SET @ICC_TrashGenericGrey := 35063; -- Set by TDB (need x) +SET @ICC_TrashGenericWhite := @ICC_TrashGenericGrey+1; +SET @ICC_TrashGenericScroll := @ICC_TrashGenericGrey+2; +SET @ICC_TrashGenericGreen := @ICC_TrashGenericGrey+3; +SET @ICC_TrashGenericBlue := @ICC_TrashGenericGrey+4; +SET @ICC_TrashGenericPurpleICC := @ICC_TrashGenericGrey+5; +SET @ICC_TrashCitadelFinal := @ICC_TrashGenericGrey+6; +SET @ICC_TrashGenericPurpleDUNN := @ICC_TrashGenericGrey+7; +SET @ICC_TrashDungeonNFinal := @ICC_TrashGenericGrey+8; +SET @ICC_TrashGenericPurpleDUNH := @ICC_TrashGenericGrey+9; +SET @ICC_TrashDungeonHFinal := @ICC_TrashGenericGrey+10; +SET @ICC_TrashGenericPurple := @ICC_TrashGenericGrey+11; + +DELETE FROM `reference_loot_template` WHERE `entry` BETWEEN @ICC_TrashGenericGrey AND @ICC_TrashGenericGrey+11; +DELETE FROM `reference_loot_template` WHERE `entry` BETWEEN 35063 AND 35076; -- cleanup OLD loot +INSERT INTO reference_loot_template (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- grey items (45) +(@ICC_TrashGenericGrey,33430,0,1,1,1,1), -- Abandoned Greatsword +(@ICC_TrashGenericGrey,33426,0,1,1,1,1), -- Chipped Timber Axe +(@ICC_TrashGenericGrey,33424,0,1,1,1,1), -- Cracked Iron Staff +(@ICC_TrashGenericGrey,33428,0,1,1,1,1), -- Dulled SHiv +(@ICC_TrashGenericGrey,33397,0,1,1,1,1), -- Frigid Mail Armor +(@ICC_TrashGenericGrey,33398,0,1,1,1,1), -- Frigid Mail Belt +(@ICC_TrashGenericGrey,33399,0,1,1,1,1), -- Frigid Mail Boots +(@ICC_TrashGenericGrey,33400,0,1,1,1,1), -- Frigid Mail Bracers +(@ICC_TrashGenericGrey,33433,0,1,1,1,1), -- Frigid Mail Circlet +(@ICC_TrashGenericGrey,33401,0,1,1,1,1), -- Frigid Mail Gloves +(@ICC_TrashGenericGrey,33402,0,1,1,1,1), -- Frigid Mail Pants +(@ICC_TrashGenericGrey,33403,0,1,1,1,1), -- Frigid Mail Shoulderpads +(@ICC_TrashGenericGrey,33427,0,1,1,1,1), -- Frost-Encrusted Rifle +(@ICC_TrashGenericGrey,33365,0,1,1,1,1), -- Frost-Rimed Cloth Belt +(@ICC_TrashGenericGrey,33366,0,1,1,1,1), -- Frost-Rimed Cloth Boots +(@ICC_TrashGenericGrey,33367,0,1,1,1,1), -- Frost-Rimed Cloth Bracers +(@ICC_TrashGenericGrey,33368,0,1,1,1,1), -- Frost-Rimed Cloth Gloves +(@ICC_TrashGenericGrey,33346,0,1,1,1,1), -- Frost-Rimed Cloth Hat +(@ICC_TrashGenericGrey,33369,0,1,1,1,1), -- Frost-Rimed Cloth Pants +(@ICC_TrashGenericGrey,33370,0,1,1,1,1), -- Frost-Rimed Cloth Shoulderpads +(@ICC_TrashGenericGrey,33371,0,1,1,1,1), -- Frost-Rimed Cloth Vest +(@ICC_TrashGenericGrey,33412,0,1,1,1,1), -- Frost-Worn Plate Belt +(@ICC_TrashGenericGrey,33413,0,1,1,1,1), -- Frost-Worn Plate Boots +(@ICC_TrashGenericGrey,33414,0,1,1,1,1), -- Frost-Worn Plate Bracers +(@ICC_TrashGenericGrey,33415,0,1,1,1,1), -- Frost-Worn Plate Chestpiece +(@ICC_TrashGenericGrey,33416,0,1,1,1,1), -- Frost-Worn Plate Gloves +(@ICC_TrashGenericGrey,33435,0,1,1,1,1), -- Frost-Worn Plate Helmet +(@ICC_TrashGenericGrey,33417,0,1,1,1,1), -- Frost-Worn Plate Pants +(@ICC_TrashGenericGrey,33419,0,1,1,1,1), -- Frost-Worn Plate Shoulderpads +(@ICC_TrashGenericGrey,33379,0,1,1,1,1), -- Frozen Armor +(@ICC_TrashGenericGrey,33380,0,1,1,1,1), -- Frozen Belt +(@ICC_TrashGenericGrey,33381,0,1,1,1,1), -- Frozen Boots +(@ICC_TrashGenericGrey,33382,0,1,1,1,1), -- Frozen Bracers +(@ICC_TrashGenericGrey,33383,0,1,1,1,1), -- Frozen Gloves +(@ICC_TrashGenericGrey,33434,0,1,1,1,1), -- Frozen Leather Helmet +(@ICC_TrashGenericGrey,33384,0,1,1,1,1), -- Frozen Pants +(@ICC_TrashGenericGrey,33385,0,1,1,1,1), -- Frozen Shoulderpads +(@ICC_TrashGenericGrey,33429,0,1,1,1,1), -- Ice Cleaver +(@ICC_TrashGenericGrey,33425,0,1,1,1,1), -- Ice-Pitted Blade +(@ICC_TrashGenericGrey,33431,0,1,1,1,1), -- Icesmashing Mace +(@ICC_TrashGenericGrey,33423,0,1,1,1,1), -- Rime-Covered Mace +(@ICC_TrashGenericGrey,33422,0,1,1,1,1), -- Shattered Bow +(@ICC_TrashGenericGrey,43852,70,1,1,1,1), -- Thick Fur Clothing Scraps (drops more often) +-- white items +(@ICC_TrashGenericWhite,33470,0,1,1,2,7), -- Frostweave Cloth +(@ICC_TrashGenericWhite,33445,0,1,1,1,1), -- Honeymint Tea +(@ICC_TrashGenericWhite,33454,0,1,1,1,1), -- Salted Venison +(@ICC_TrashGenericWhite,35947,0,1,1,1,1), -- Sparkling Frostcap +(@ICC_TrashGenericWhite,33447,0,1,1,1,1), -- Runic Healing Potion +(@ICC_TrashGenericWhite,33448,0,1,1,1,1), -- Runic Mana Potion +-- Scroll items +(@ICC_TrashGenericScroll,43463,0,1,1,1,1), -- Scroll of Agility VII +(@ICC_TrashGenericScroll,37091,0,1,1,1,1), -- Scroll of Intellect VII +(@ICC_TrashGenericScroll,37093,0,1,1,1,1), -- Scroll of Stamina VII +(@ICC_TrashGenericScroll,43465,0,1,1,1,1), -- Scroll of Strength VII +(@ICC_TrashGenericScroll,37097,0,1,1,1,1), -- Scroll of Spirit VII +(@ICC_TrashGenericScroll,43464,0,1,1,1,1), -- Scroll of Agility VIII +(@ICC_TrashGenericScroll,37092,0,1,1,1,1), -- Scroll of Intellect VIII +(@ICC_TrashGenericScroll,37094,0,1,1,1,1), -- Scroll of Stamina VIII +(@ICC_TrashGenericScroll,43466,0,1,1,1,1), -- Scroll of Strength VIII +(@ICC_TrashGenericScroll,37098,0,1,1,1,1), -- Scroll of Spirit VIII +-- green items (166) +(@ICC_TrashGenericGreen,36609,0,1,1,1,1), -- Abandoned Spear +(@ICC_TrashGenericGreen,36497,0,1,1,1,1), -- Adamant Mallet +(@ICC_TrashGenericGreen,36511,0,1,1,1,1), -- Artic War Hammer +(@ICC_TrashGenericGreen,36694,0,1,1,1,1), -- Beatific Mace +(@ICC_TrashGenericGreen,36527,0,1,1,1,1), -- Blackened Blade +(@ICC_TrashGenericGreen,36611,0,1,1,1,1), -- Black Scythe +(@ICC_TrashGenericGreen,36638,0,1,1,1,1), -- Bloody Crossbow +(@ICC_TrashGenericGreen,36428,0,1,1,1,1), -- Bouquet Ring +(@ICC_TrashGenericGreen,36639,0,1,1,1,1), -- Brutal Ballista +(@ICC_TrashGenericGreen,36707,0,1,1,1,1), -- Cascading Water Staff +(@ICC_TrashGenericGreen,36539,0,1,1,1,1), -- Chilled Warblade +(@ICC_TrashGenericGreen,36723,0,1,1,1,1), -- Clawed Shuriken +(@ICC_TrashGenericGreen,36035,0,1,1,1,1), -- Condor Belt +(@ICC_TrashGenericGreen,36042,0,1,1,1,1), -- Condor Bindings +(@ICC_TrashGenericGreen,36038,0,1,1,1,1), -- Condor Gloves +(@ICC_TrashGenericGreen,36039,0,1,1,1,1), -- Condor Headpiece +(@ICC_TrashGenericGreen,36040,0,1,1,1,1), -- Condor Pants +(@ICC_TrashGenericGreen,36037,0,1,1,1,1), -- Condor Robe +(@ICC_TrashGenericGreen,36036,0,1,1,1,1), -- Condor Sandals +(@ICC_TrashGenericGreen,36041,0,1,1,1,1), -- Condor Shoulderpads +(@ICC_TrashGenericGreen,36266,0,1,1,1,1), -- Cormorant Bracelets +(@ICC_TrashGenericGreen,36261,0,1,1,1,1), -- Cormorant Chain Vest +(@ICC_TrashGenericGreen,36260,0,1,1,1,1), -- Cormorant Footwraps +(@ICC_TrashGenericGreen,36262,0,1,1,1,1), -- Cormorant Gloves +(@ICC_TrashGenericGreen,36263,0,1,1,1,1), -- Cormorant Helm +(@ICC_TrashGenericGreen,36264,0,1,1,1,1), -- Cormorant Leggings +(@ICC_TrashGenericGreen,36265,0,1,1,1,1), -- Cormorant Mantle +(@ICC_TrashGenericGreen,36259,0,1,1,1,1), -- Cormorant Waistband +(@ICC_TrashGenericGreen,36525,0,1,1,1,1), -- Craggy Machete +(@ICC_TrashGenericGreen,36709,0,1,1,1,1), -- Crystal Woodstaff +(@ICC_TrashGenericGreen,36050,0,1,1,1,1), -- Crystalsong Bracelets +(@ICC_TrashGenericGreen,36047,0,1,1,1,1), -- Crystalsong Crown +(@ICC_TrashGenericGreen,36046,0,1,1,1,1), -- Crystalsong Gloves +(@ICC_TrashGenericGreen,36048,0,1,1,1,1), -- Crystalsong Leggings +(@ICC_TrashGenericGreen,36049,0,1,1,1,1), -- Crystalsong Mantle +(@ICC_TrashGenericGreen,36045,0,1,1,1,1), -- Crystalsong Robe +(@ICC_TrashGenericGreen,36043,0,1,1,1,1), -- Crystalsong Sash +(@ICC_TrashGenericGreen,36044,0,1,1,1,1), -- Crystalsong Slippers +(@ICC_TrashGenericGreen,36554,0,1,1,1,1), -- Cursed Staff +(@ICC_TrashGenericGreen,43297,0,1,1,1,1), -- Damaged Necklace +(@ICC_TrashGenericGreen,36553,0,1,1,1,1), -- Desecrated Staff +(@ICC_TrashGenericGreen,36695,0,1,1,1,1), -- Dogmatic Scepter +(@ICC_TrashGenericGreen,36721,0,1,1,1,1), -- Dragon's Teeth +(@ICC_TrashGenericGreen,36413,0,1,1,1,1), -- Dyed Taffeta Cape +(@ICC_TrashGenericGreen,36427,0,1,1,1,1), -- Engraved Ring +(@ICC_TrashGenericGreen,36484,0,1,1,1,1), -- Etched Dagger +(@ICC_TrashGenericGreen,36499,0,1,1,1,1), -- Frigid War-Mace +(@ICC_TrashGenericGreen,36470,0,1,1,1,1), -- Gilded Scepter +(@ICC_TrashGenericGreen,36381,0,1,1,1,1), -- Golem Breastplate +(@ICC_TrashGenericGreen,36382,0,1,1,1,1), -- Golem Gauntlets +(@ICC_TrashGenericGreen,36379,0,1,1,1,1), -- Golem Girdle +(@ICC_TrashGenericGreen,36383,0,1,1,1,1), -- Golem Helmet +(@ICC_TrashGenericGreen,36384,0,1,1,1,1), -- Golem Legplates +(@ICC_TrashGenericGreen,36385,0,1,1,1,1), -- Golem Pauldrons +(@ICC_TrashGenericGreen,36380,0,1,1,1,1), -- Golem Sabatons +(@ICC_TrashGenericGreen,36386,0,1,1,1,1), -- Golem Vambraces +(@ICC_TrashGenericGreen,36623,0,1,1,1,1), -- Harnessed Longbow +(@ICC_TrashGenericGreen,36568,0,1,1,1,1), -- Hollowed Bone Knuckles +(@ICC_TrashGenericGreen,36637,0,1,1,1,1), -- Horrific Crossbow +(@ICC_TrashGenericGreen,36471,0,1,1,1,1), -- Ice Crystal +(@ICC_TrashGenericGreen,36582,0,1,1,1,1), -- Ice Pick +(@ICC_TrashGenericGreen,36597,0,1,1,1,1), -- Ice-Splintering Axe +(@ICC_TrashGenericGreen,36456,0,1,1,1,1), -- Ice Kite Shield +(@ICC_TrashGenericGreen,36457,0,1,1,1,1), -- Ivory Shield +(@ICC_TrashGenericGreen,36373,0,1,1,1,1), -- Kraken Breastplate +(@ICC_TrashGenericGreen,36377,0,1,1,1,1), -- Kraken Epaulets +(@ICC_TrashGenericGreen,36374,0,1,1,1,1), -- Kraken Gauntlets +(@ICC_TrashGenericGreen,36371,0,1,1,1,1), -- Kraken Girdle +(@ICC_TrashGenericGreen,36372,0,1,1,1,1), -- Kraken Greaves +(@ICC_TrashGenericGreen,36375,0,1,1,1,1), -- Kraken Helm +(@ICC_TrashGenericGreen,36376,0,1,1,1,1), -- Kraken Legplates +(@ICC_TrashGenericGreen,36378,0,1,1,1,1), -- Kraken Vambraces +(@ICC_TrashGenericGreen,36469,0,1,1,1,1), -- Lidless Orb +(@ICC_TrashGenericGreen,36513,0,1,1,1,1), -- Lode-Headed Hammer +(@ICC_TrashGenericGreen,36414,0,1,1,1,1), -- Mammoth Fur Cloack +(@ICC_TrashGenericGreen,36483,0,1,1,1,1), -- Mandible Edge +(@ICC_TrashGenericGreen,36625,0,1,1,1,1), -- Massive Recurved Bow +(@ICC_TrashGenericGreen,36555,0,1,1,1,1), -- Minion Staff +(@ICC_TrashGenericGreen,36651,0,1,1,1,1), -- Muzzled Musket +(@ICC_TrashGenericGreen,36680,0,1,1,1,1), -- Mystic Fang +(@ICC_TrashGenericGreen,36498,0,1,1,1,1), -- Nerubian Mace +(@ICC_TrashGenericGreen,36512,0,1,1,1,1), -- Onerous Mallet +(@ICC_TrashGenericGreen,36441,0,1,1,1,1), -- Pearl Woven Choker +(@ICC_TrashGenericGreen,36540,0,1,1,1,1), -- Petrified Sword +(@ICC_TrashGenericGreen,36610,0,1,1,1,1), -- Plagued Pike +(@ICC_TrashGenericGreen,36595,0,1,1,1,1), -- Planate Broadaxe +(@ICC_TrashGenericGreen,36455,0,1,1,1,1), -- Plated Bulwark +(@ICC_TrashGenericGreen,36443,0,1,1,1,1), -- Platinum Medallion +(@ICC_TrashGenericGreen,36666,0,1,1,1,1), -- Polar Wand +(@ICC_TrashGenericGreen,36653,0,1,1,1,1), -- Precipice Longrifle +(@ICC_TrashGenericGreen,36147,0,1,1,1,1), -- Pygmy Belt +(@ICC_TrashGenericGreen,36154,0,1,1,1,1), -- Pygmy Bindings +(@ICC_TrashGenericGreen,36148,0,1,1,1,1), -- Pygmy Boots +(@ICC_TrashGenericGreen,36150,0,1,1,1,1), -- Pygmy Gloves +(@ICC_TrashGenericGreen,36151,0,1,1,1,1), -- Pygmy Helmet +(@ICC_TrashGenericGreen,36152,0,1,1,1,1), -- Pygmy Pants +(@ICC_TrashGenericGreen,36153,0,1,1,1,1), -- Pygmy Shoulders +(@ICC_TrashGenericGreen,36149,0,1,1,1,1), -- Pygmy Tunic +(@ICC_TrashGenericGreen,36722,0,1,1,1,1), -- Pyramid Throwing Star +(@ICC_TrashGenericGreen,36389,0,1,1,1,1), -- Revenant Armor +(@ICC_TrashGenericGreen,36387,0,1,1,1,1), -- Revenant Belt +(@ICC_TrashGenericGreen,36394,0,1,1,1,1), -- Revenant Bracers +(@ICC_TrashGenericGreen,36393,0,1,1,1,1), -- Revenant Epaulets +(@ICC_TrashGenericGreen,36390,0,1,1,1,1), -- Revenant Gauntlets +(@ICC_TrashGenericGreen,36388,0,1,1,1,1), -- Revenant Greaves +(@ICC_TrashGenericGreen,36391,0,1,1,1,1), -- Revenant Helmet +(@ICC_TrashGenericGreen,36392,0,1,1,1,1), -- Revenant Legguards +(@ICC_TrashGenericGreen,36596,0,1,1,1,1), -- Rupturing Axe +(@ICC_TrashGenericGreen,36569,0,1,1,1,1), -- Savage Talons +(@ICC_TrashGenericGreen,36693,0,1,1,1,1), -- Serene Hammer +(@ICC_TrashGenericGreen,36624,0,1,1,1,1), -- Shrieking Bow +(@ICC_TrashGenericGreen,36442,0,1,1,1,1), -- Silken Cord Amulet +(@ICC_TrashGenericGreen,36679,0,1,1,1,1), -- Singing Dagger +(@ICC_TrashGenericGreen,36485,0,1,1,1,1), -- Sinuous Keris +(@ICC_TrashGenericGreen,36567,0,1,1,1,1), -- Six-Fingered Claws +(@ICC_TrashGenericGreen,36583,0,1,1,1,1), -- Skeletal Hacker +(@ICC_TrashGenericGreen,36526,0,1,1,1,1), -- SLeeted Longsword +(@ICC_TrashGenericGreen,36708,0,1,1,1,1), -- Snow Blossom Staff +(@ICC_TrashGenericGreen,36667,0,1,1,1,1), -- Solid Ice Wand +(@ICC_TrashGenericGreen,36275,0,1,1,1,1), -- Spiderlord Belt +(@ICC_TrashGenericGreen,36276,0,1,1,1,1), -- Spiderlord Boots +(@ICC_TrashGenericGreen,36282,0,1,1,1,1), -- Spiderlord Bracers +(@ICC_TrashGenericGreen,36277,0,1,1,1,1), -- Spiderlord Chestpiece +(@ICC_TrashGenericGreen,36278,0,1,1,1,1), -- Spiderlord Gauntlets +(@ICC_TrashGenericGreen,36279,0,1,1,1,1), -- Spiderlord Helm +(@ICC_TrashGenericGreen,36280,0,1,1,1,1), -- Spiderlord Legguards +(@ICC_TrashGenericGreen,36281,0,1,1,1,1), -- Spiderlord Spaulders +(@ICC_TrashGenericGreen,36429,0,1,1,1,1), -- Spur Ring +(@ICC_TrashGenericGreen,36652,0,1,1,1,1), -- Stocky Shotgun +(@ICC_TrashGenericGreen,36274,0,1,1,1,1), -- Ulduar Bracers +(@ICC_TrashGenericGreen,36269,0,1,1,1,1), -- Ulduar Breastplate +(@ICC_TrashGenericGreen,36270,0,1,1,1,1), -- Ulduar Gauntlets +(@ICC_TrashGenericGreen,36267,0,1,1,1,1), -- Ulduar Girdle +(@ICC_TrashGenericGreen,36268,0,1,1,1,1), -- Ulduar Greaves +(@ICC_TrashGenericGreen,36271,0,1,1,1,1), -- Ulduar Helm +(@ICC_TrashGenericGreen,36272,0,1,1,1,1), -- Ulduar Legguards +(@ICC_TrashGenericGreen,36273,0,1,1,1,1), -- Ulduar Shoulderguards +(@ICC_TrashGenericGreen,36415,0,1,1,1,1), -- Vintage Satin Cloak +(@ICC_TrashGenericGreen,36058,0,1,1,1,1), -- Vizier Bracelets +(@ICC_TrashGenericGreen,36054,0,1,1,1,1), -- Vizier Gloves +(@ICC_TrashGenericGreen,36055,0,1,1,1,1), -- Vizier Hood +(@ICC_TrashGenericGreen,36056,0,1,1,1,1), -- Vizier Leggings +(@ICC_TrashGenericGreen,36057,0,1,1,1,1), -- Vizier Mantle +(@ICC_TrashGenericGreen,36053,0,1,1,1,1), -- Vizier Robe +(@ICC_TrashGenericGreen,36051,0,1,1,1,1), -- Vizier Sash +(@ICC_TrashGenericGreen,36052,0,1,1,1,1), -- Vizier SLippers +(@ICC_TrashGenericGreen,36665,0,1,1,1,1), -- Wasteland Wand +(@ICC_TrashGenericGreen,36170,0,1,1,1,1), -- Webspinner Bindings +(@ICC_TrashGenericGreen,36164,0,1,1,1,1), -- Webspinner Boots +(@ICC_TrashGenericGreen,36163,0,1,1,1,1), -- Webspinner Cord +(@ICC_TrashGenericGreen,36166,0,1,1,1,1), -- Webspinner Gloves +(@ICC_TrashGenericGreen,36167,0,1,1,1,1), -- Webspinner Hood +(@ICC_TrashGenericGreen,36168,0,1,1,1,1), -- Webspinner Leggings +(@ICC_TrashGenericGreen,36169,0,1,1,1,1), -- Webspinner Shoulderguards +(@ICC_TrashGenericGreen,36165,0,1,1,1,1), -- Webspinner Vest +(@ICC_TrashGenericGreen,36162,0,1,1,1,1), -- Wendigo Bands +(@ICC_TrashGenericGreen,36156,0,1,1,1,1), -- Wendigo Boots +(@ICC_TrashGenericGreen,36157,0,1,1,1,1), -- Wendigo Chestpiece +(@ICC_TrashGenericGreen,36155,0,1,1,1,1), -- Wendigo Girdle +(@ICC_TrashGenericGreen,36158,0,1,1,1,1), -- Wendigo Gloves +(@ICC_TrashGenericGreen,36159,0,1,1,1,1), -- Wendigo Hood +(@ICC_TrashGenericGreen,36160,0,1,1,1,1), -- Wendigo Legguards +(@ICC_TrashGenericGreen,36161,0,1,1,1,1), -- Wendigo Pauldrons +(@ICC_TrashGenericGreen,36541,0,1,1,1,1), -- Wintry Claymore +(@ICC_TrashGenericGreen,36681,0,1,1,1,1), -- Wisdom Carver +(@ICC_TrashGenericGreen,36581,0,1,1,1,1), -- Wolvar Handaxe +-- blue items +(@ICC_TrashGenericBlue,37792,0,1,1,1,1), -- Agin's Crushing Carapace +(@ICC_TrashGenericBlue,37770,0,1,1,1,1), -- Bulge-Concealing Breastplate +(@ICC_TrashGenericBlue,37780,0,1,1,1,1), -- Condor-Bone Chestguard +(@ICC_TrashGenericBlue,37760,0,1,1,1,1), -- Cracklefire Wristguards +(@ICC_TrashGenericBlue,37781,0,1,1,1,1), -- Grips of the Warming Heart +(@ICC_TrashGenericBlue,37824,0,1,1,1,1), -- Gwyneth's Runed Dragonwand +(@ICC_TrashGenericBlue,37761,0,1,1,1,1), -- Shimmerthread Girdle +(@ICC_TrashGenericBlue,37793,0,1,1,1,1), -- Skullcage of Eternal Terror +(@ICC_TrashGenericBlue,37794,0,1,1,1,1), -- Torta's Oversized Choker +(@ICC_TrashGenericBlue,37822,0,1,1,1,1), -- Twisted Puzzle-Ring +(@ICC_TrashGenericBlue,37771,0,1,1,1,1), -- Wristguard of Verdant Recovery +-- Designs +(@ICC_TrashGenericBlue,41788,0,1,1,1,1), -- Design: Beaming Earthsiege Diamond +(@ICC_TrashGenericBlue,41780,0,1,1,1,1), -- Design: Champion's Monarch Topaz +(@ICC_TrashGenericBlue,41786,0,1,1,1,1), -- Design: Destructive Skyflare Diamond +(@ICC_TrashGenericBlue,41777,0,1,1,1,1), -- Design: Etched Monarch Topaz +(@ICC_TrashGenericBlue,41789,0,1,1,1,1), -- Design: Inscribed Monarch Topaz +(@ICC_TrashGenericBlue,41781,0,1,1,1,1), -- Design: Misty Forest Emerald +(@ICC_TrashGenericBlue,41783,0,1,1,1,1), -- Design: Purified Twilight Opal +(@ICC_TrashGenericBlue,41778,0,1,1,1,1), -- Design: Resolute MOnarch Topaz +(@ICC_TrashGenericBlue,41782,0,1,1,1,1), -- Design: Shining Forest Emerald +(@ICC_TrashGenericBlue,41784,0,1,1,1,1), -- Design: Sovereign Twilight Opal +(@ICC_TrashGenericBlue,41779,0,1,1,1,1), -- Design: Stalwart Monarch Topaz +(@ICC_TrashGenericBlue,41785,0,1,1,1,1), -- Design: Tenuous Twilight Opal +(@ICC_TrashGenericBlue,41787,0,1,1,1,1), -- Design: Thundering Skyflare Diamond +-- tailoring +(@ICC_TrashGenericBlue,43876,0,1,1,1,1), -- A Guide to Northern Cloth Scavenging +-- purple items icc (7) +(@ICC_TrashGenericPurpleICC,50444,0,1,1,1,1), -- Rowan's Rifle of Silver Bullets +(@ICC_TrashGenericPurpleICC,50451,0,1,1,1,1), -- Belt of the Lonely Noble +(@ICC_TrashGenericPurpleICC,50450,0,1,1,1,1), -- Leggings of Dubious Charms +(@ICC_TrashGenericPurpleICC,50449,0,1,1,1,1), -- Stiffened Corpse Shoulderpads +(@ICC_TrashGenericPurpleICC,50453,0,1,1,1,1), -- Ring of Rotting Sinew +(@ICC_TrashGenericPurpleICC,50447,0,1,1,1,1), -- Harbinger's Bone Band +(@ICC_TrashGenericPurpleICC,50452,0,1,1,1,1), -- Wodin's Lucky Necklace +-- Generic World Epics +(@ICC_TrashGenericPurple,44311,0,1,1,1,1), -- Avool's Sword of Jin +(@ICC_TrashGenericPurple,37835,0,1,1,1,1), -- Je'Tze's Bell +(@ICC_TrashGenericPurple,44310,0,1,1,1,1), -- Namlak's Supernumerary Sticker +(@ICC_TrashGenericPurple,44309,0,1,1,1,1), -- Sash of Jordan +(@ICC_TrashGenericPurple,44308,0,1,1,1,1), -- Signet of Edward the Odd +(@ICC_TrashGenericPurple,37254,0,1,1,1,1), -- Super Simian Sphere +(@ICC_TrashGenericPurple,44312,0,1,1,1,1), -- Wapach's Spaulders of Solidarity +(@ICC_TrashGenericPurple,44313,0,1,1,1,1), -- Zom's Crackling Bulwark +-- purple items dungeon_N (4) +(@ICC_TrashGenericPurpleDUNN,49852,0,1,1,1,1), -- Coffin Nail +(@ICC_TrashGenericPurpleDUNN,49855,0,1,1,1,1), -- Plated Grips of Korth'azz +(@ICC_TrashGenericPurpleDUNN,49853,0,1,1,1,1), -- Titanium Links of Lore +(@ICC_TrashGenericPurpleDUNN,49854,0,1,1,1,1), -- Mantle of Tattered Feathers +-- purple items dungeon_H (3) +(@ICC_TrashGenericPurpleDUNH,50319,0,1,1,1,1), -- Unsharpened Ice Razor +(@ICC_TrashGenericPurpleDUNH,50315,0,1,1,1,1), -- Seven-Fingered Claws +(@ICC_TrashGenericPurpleDUNH,50318,0,1,1,1,1), -- Ghostly Wristwraps +-- final output icc +(@ICC_TrashCitadelFinal,1,40,1,0,-@ICC_TrashGenericGrey,1), -- 1 grey loot (40%) +(@ICC_TrashCitadelFinal,2,40,1,0,-@ICC_TrashGenericGrey,1), -- 1 grey loot (40%) +(@ICC_TrashCitadelFinal,3,20,1,0,-@ICC_TrashGenericWhite,1), -- 1 white loot (20%) +(@ICC_TrashCitadelFinal,4,7,1,0,-@ICC_TrashGenericScroll,1), -- 1 scroll loot (7%) +(@ICC_TrashCitadelFinal,5,10,1,0,-@ICC_TrashGenericGreen,1), -- 1 green loot (10%) +(@ICC_TrashCitadelFinal,6,3,1,0,-@ICC_TrashGenericBlue,1), -- 1 blue loot (3%) +(@ICC_TrashCitadelFinal,7,2,1,0,-@ICC_TrashGenericPurpleICC,1), -- 1 purple icc loot (2%) +(@ICC_TrashCitadelFinal,8,1,1,0,-@ICC_TrashGenericPurple,1), -- 1 purple world loot (1%) +-- final output dungeon_n +(@ICC_TrashDungeonNFinal,1,40,1,0,-@ICC_TrashGenericGrey,1), -- 1 grey loot (40%) +(@ICC_TrashDungeonNFinal,2,40,1,0,-@ICC_TrashGenericGrey,1), -- 1 grey loot (40%) +(@ICC_TrashDungeonNFinal,3,20,1,0,-@ICC_TrashGenericWhite,1), -- 1 white loot (20%) +(@ICC_TrashDungeonNFinal,4,7,1,0,-@ICC_TrashGenericScroll,1), -- 1 scroll loot (7%) +(@ICC_TrashDungeonNFinal,5,10,1,0,-@ICC_TrashGenericGreen,1), -- 1 green loot (10%) +(@ICC_TrashDungeonNFinal,6,3,1,0,-@ICC_TrashGenericBlue,1), -- 1 blue loot (3%) +(@ICC_TrashDungeonNFinal,7,2,1,0,-@ICC_TrashGenericPurpleDUNN,1), -- 1 purple dungeon loot (2%) +(@ICC_TrashDungeonNFinal,8,1,1,0,-@ICC_TrashGenericPurple,1), -- 1 purple world loot (1%) +-- final output dungeon_h +(@ICC_TrashDungeonHFinal,1,40,1,0,-@ICC_TrashGenericGrey,1), -- 1 grey loot (40%) +(@ICC_TrashDungeonHFinal,2,40,1,0,-@ICC_TrashGenericGrey,1), -- 1 grey loot (40%) +(@ICC_TrashDungeonHFinal,3,20,1,0,-@ICC_TrashGenericWhite,1), -- 1 white loot (20%) +(@ICC_TrashDungeonHFinal,4,7,1,0,-@ICC_TrashGenericScroll,1), -- 1 scroll loot (7%) +(@ICC_TrashDungeonHFinal,5,10,1,0,-@ICC_TrashGenericGreen,1), -- 1 green loot (10%) +(@ICC_TrashDungeonHFinal,6,3,1,0,-@ICC_TrashGenericBlue,1), -- 1 blue loot (3%) +(@ICC_TrashDungeonHFinal,7,2,1,0,-@ICC_TrashGenericPurpleDUNH,1), -- 1 purple heroicdungeon loot (1%) +(@ICC_TrashDungeonHFinal,8,1,1,0,-@ICC_TrashGenericPurple,1); -- 1 purple world loot (1%) + + +-- -------------------------------- +-- -- Apply Trash Loot Dungeon_N -- +-- -------------------------------- +SET @LootDUNGEON_N := 100000; -- needs official entry designated +UPDATE `creature_template` SET `lootid`=@LootDUNGEON_N WHERE `entry` IN (36522,36620,36516,36564,36499,36478,36666); -- FoS +UPDATE `creature_template` SET `lootid`=@LootDUNGEON_N WHERE `entry` IN (36896,36842,36830,36879,37711,36788,37712,37713); -- PoS +UPDATE `creature_template` SET `lootid`=@LootDUNGEON_N WHERE `entry` IN (38176,38177,38173,38172,38175,36723); -- HoR +DELETE FROM `creature_loot_template` WHERE `entry` IN (36522,36620,36516,36564,36499,36478,36666,36896,36842,36830,36879,37711,36788,37712,37713,38176,38177,38173,38172,38175,36723,@LootDUNGEON_N); +INSERT INTO `creature_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +(@LootDUNGEON_N,1,100,1,0,-@ICC_TrashDungeonNFinal,2); -- 2 selection from reference + +-- -------------------------------- +-- -- Apply Trash Loot Dungeon_H -- +-- -------------------------------- +SET @LootDUNGEON_H := 100001; -- needs official entry designated +UPDATE `creature_template` SET `lootid`=@LootDUNGEON_H WHERE `entry` IN (37569,37568,37567,37565,38193,37566,37563); -- FoS +UPDATE `creature_template` SET `lootid`=@LootDUNGEON_H WHERE `entry` IN (37609,37638,37637,37635,37636,38249,38025,38026); -- PoS +UPDATE `creature_template` SET `lootid`=@LootDUNGEON_H WHERE `entry` IN (37720,38524,38525,38563,38544,38564); -- HoR +DELETE FROM `creature_loot_template` WHERE `entry` IN (37569,37568,37567,37565,38193,37566,37563,37609,37638,37637,37635,37636,38249,38025,38026,37720,38524,38525,38563,38544,38564,@LootDUNGEON_H); +INSERT INTO `creature_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +(@LootDUNGEON_H,1,100,1,0,-@ICC_TrashDungeonHFinal,2); -- 2 selection from reference + +-- -------------------------- +-- -- Apply Trash Loot ICC -- +-- -------------------------- +SET @LootRAID := 100002; -- needs official entry designated +UPDATE `creature_template` SET `lootid`=@LootRAID WHERE `entry` IN(37012,37022,37571,37664,37595,37662,37665,37663,37666,37007,36811,36807,36829,36805,36808,36880,37546,37531,37229,37228,36725,37501,37502,37023,10404,38494,38490,36724,37126,37544,37545,37098,37038); +DELETE FROM `creature_loot_template` WHERE `entry` IN(37012,37022,37571,37664,37595,37662,37665,37663,37666,37007,36811,36807,36829,36805,36808,36880,37546,37531,37229,37228,36725,37501,37502,37023,10404,38494,38490,36724,37126,37544,37545,37098,37038,@LootRAID); +INSERT INTO `creature_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +(@LootRAID,1,100,1,0,-@ICC_TrashCitadelFinal,2); -- 2 selection from reference + +-- -------------------- +-- -- Special Cases: -- +-- -------------------- +-- Specialids +CALL `sp_set_npc_lootid_bylist` ('37217,37025,37230,37532,36891',NULL); +-- Loot +DELETE FROM `creature_loot_template` WHERE `entry` IN (37217,37025,37230,37532,36891); +INSERT INTO `creature_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- Precious +(37217,1,100,1,0,-@ICC_TrashCitadelFinal,2), -- 2 selection from reference +(37217,52019,30,1,0,1,1), -- Precious Ribbon +-- Stinky +(37025,1,100,1,0,-@ICC_TrashCitadelFinal,2), -- 2 selection from reference +-- Dragons (Spire Frostwyrm) +(37230,1,100,1,0,-@ICC_TrashCitadelFinal,2), -- 2 selection from reference +(37230,33631,65,1,1,2,3), -- Frosted Claw +(37230,33632,35,1,1,2,3), -- Icicle Fang +(37532,33631,65,1,1,2,3), -- Frosted Claw +(37532,33632,35,1,1,2,3), -- Icicle Fang +(36891,33631,65,1,1,2,3), -- Frosted Claw +(36891,33632,35,1,1,2,3); -- Icicle Fang diff --git a/sql/updates/world/2011_03_24_02_world_sai.sql b/sql/updates/world/2011_03_24_02_world_sai.sql new file mode 100644 index 0000000000000..b4ee24b0a31b3 --- /dev/null +++ b/sql/updates/world/2011_03_24_02_world_sai.sql @@ -0,0 +1,137 @@ +-- Jean Pierre Poulain SAI +SET @ENTRY := 34244; +SET @GOSSIP := 10478; +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,62,0,100,0,@GOSSIP,0,0,0,11,64795,1,0,0,0,0,7,0,0,0,0,0,0,0, 'Jean Pierre Poulain - On gossip option select - cast spell'); +-- Cleanup gossip +UPDATE `gossip_menu_option` SET `action_script_id`=0 WHERE `menu_id`=@GOSSIP; +DELETE FROM `gossip_scripts` WHERE `id` IN (1047800); + +-- Fizzcrank Fullthrottle SAI +SET @ENTRY := 25590; +SET @GOSSIP := 9182; +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,1,62,0,100,0,@GOSSIP,0,0,0,15,11708,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Fizzcrank Fullthrottle - On gossip option select - quest complete'), +(@ENTRY,0,1,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Fizzcrank Fullthrottle - On gossip option select - close gossip'); +-- Cleanup gossip +UPDATE `gossip_menu_option` SET `action_script_id`=0 WHERE `menu_id`=@GOSSIP; +DELETE FROM `gossip_scripts` WHERE `id` IN (918200); + +-- Keeper Remulos SAI +SET @ENTRY := 11832; +SET @GOSSIP := 10215; +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,62,0,100,0,@GOSSIP,0,0,0,11,57413,1,0,0,0,0,7,0,0,0,0,0,0,0, 'Keeper Remulos - On gossip option select - cast spell'), +(@ENTRY,0,1,2,62,0,100,0,@GOSSIP,1,0,0,11,57670,1,0,0,0,0,7,0,0,0,0,0,0,0, 'Keeper Remulos - On gossip option select - cast spell'), +(@ENTRY,0,2,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Keeper Remulos - On gossip option select - close gossip'); +-- Cleanup gossip +UPDATE `gossip_menu_option` SET `action_script_id`=0 WHERE `menu_id`=@GOSSIP; +DELETE FROM `gossip_scripts` WHERE `id` IN (1021500,1021501); + +-- Fizzcrank Recon Pilot SAI +SET @ENTRY := 25841; +SET @GOSSIP := 21248; +SET @SCRIPT := 212481; +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,1,62,0,100,0,@GOSSIP,0,0,0,11,46362,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Fizzcrank Recon Pilot - On gossip option select - cast spell'), +(@ENTRY,0,1,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Fizzcrank Recon Pilot - On gossip option select - close gossip'), +(@ENTRY,0,2,0,11,0,100,0,0,0,0,0,81,2,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Fizzcrank Recon Pilot - On spawn - set gossip flag'), +(@ENTRY,0,3,4,8,0,100,0,46362,0,0,0,11,46362,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Fizzcrank Recon Pilot - On spellhit - cast spell on envoker'), +(@ENTRY,0,4,0,61,0,100,0,0,0,0,0,23,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Fizzcrank Recon Pilot - On spellhit - set phase 1'), +(@ENTRY,0,5,0,1,1,100,0,3000,3000,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Fizzcrank Recon Pilot - OOC - wait 3 sec despawn (Phase 1)'); +-- Cleanup EAI +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +-- Cleanup gossip +UPDATE `gossip_menu_option` SET `action_script_id`=0 WHERE `menu_id`=@GOSSIP AND `id`=0; +DELETE FROM `gossip_scripts` WHERE `id`=@SCRIPT; + +-- Glodrak Huntsniper SAI +SET @ENTRY := 24657; +SET @GOSSIP := 10603; +SET @SCRIPT := 1060400; +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,1,62,0,100,0,@GOSSIP,0,0,0,11,66592,1,0,0,0,0,7,0,0,0,0,0,0,0, 'Glodrak Huntsniper - On gossip option select - cast spell'), +(@ENTRY,0,1,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Glodrak Huntsniper - On gossip option select - close gossip'); +-- Cleanup gossip +UPDATE `gossip_menu_option` SET `action_script_id`=0 WHERE `menu_id`=@GOSSIP AND `id`=0; +DELETE FROM `gossip_scripts` WHERE `id`=@SCRIPT; +-- Goldark Snipehunter SAI +SET @ENTRY := 23486; +SET @GOSSIP := 10604; +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,1,62,0,100,0,@GOSSIP,0,0,0,11,66592,1,0,0,0,0,7,0,0,0,0,0,0,0, 'Goldark Snipehunter - On gossip option select - cast spell'), +(@ENTRY,0,1,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Goldark Snipehunter - On gossip option select - close gossip'); +-- Cleanup gossip +UPDATE `gossip_menu_option` SET `action_script_id`=0 WHERE `menu_id`=@GOSSIP AND `id`=0; + +-- Pol Amberstill & Driz Tumblequick SAI +SET @ENTRY := 24468; +SET @ENTRY1 := 24510; +SET @GOSSIP := 8958; +SET @GOSSIP1 := 8960; +SET @SCRIPT := 895800; +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry` IN (@ENTRY,@ENTRY1); +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@ENTRY,@ENTRY1); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +-- Pol Amberstill +(@ENTRY,0,0,1,62,0,100,0,@GOSSIP,6,0,0,11,44262,1,0,0,0,0,7,0,0,0,0,0,0,0, 'Pol Amberstill - On gossip option select - cast spell'), +(@ENTRY,0,1,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Pol Amberstill - On gossip option select - close gossip'), +(@ENTRY,0,2,3,62,0,100,0,@GOSSIP1,0,0,0,11,44262,1,0,0,0,0,7,0,0,0,0,0,0,0, 'Pol Amberstill - On gossip option select - cast spell'), +(@ENTRY,0,3,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Pol Amberstill - On gossip option select - close gossip'), +-- Driz Tumblequick +(@ENTRY1,0,0,1,62,0,100,0,@GOSSIP,6,0,0,11,44262,1,0,0,0,0,7,0,0,0,0,0,0,0, 'Driz Tumblequick - On gossip option select - cast spell'), +(@ENTRY1,0,1,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Driz Tumblequick - On gossip option select - close gossip'), +(@ENTRY1,0,2,3,62,0,100,0,@GOSSIP1,0,0,0,11,44262,1,0,0,0,0,7,0,0,0,0,0,0,0, 'Driz Tumblequick - On gossip option select - cast spell'), +(@ENTRY1,0,3,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Driz Tumblequick - On gossip option select - close gossip'); +-- Ckeanup gossip +UPDATE `gossip_menu_option` SET `action_script_id`=0 WHERE `menu_id`=@GOSSIP AND `id`=6; +UPDATE `gossip_menu_option` SET `action_script_id`=0 WHERE `menu_id`=@GOSSIP1 AND `id`=0; +DELETE FROM `gossip_scripts` WHERE `id`=@SCRIPT; + +-- Steel Gate Chief Archaeologist SAI +SET @ENTRY := 24399; +SET @GOSSIP := 8953; +SET @SCRIPT := 895300; +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,1,62,0,100,0,@GOSSIP,0,0,0,11,43533,1,0,0,0,0,7,0,0,0,0,0,0,0, 'Steel Gate Chief Archaeologist - On gossip option select - cast spell'), +(@ENTRY,0,1,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Steel Gate Chief Archaeologist - On gossip option select - close gossip'); +-- Cleanup gossip +UPDATE `gossip_menu_option` SET `action_script_id`=0 WHERE `menu_id`=@GOSSIP AND `id`=0; +DELETE FROM `gossip_scripts` WHERE `id`=@SCRIPT; + +-- Drakuru SAI +SET @ENTRY := 26423; +SET @GOSSIP := 21249; +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,1,62,0,100,0,@GOSSIP,0,0,0,33,27921,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Drakuru - On gossip option select - killcredit'), +(@ENTRY,0,1,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Drakuru - On gossip option select - close gossip'); +-- Cleanup gossip +UPDATE `gossip_menu_option` SET `action_script_id`=0 WHERE `menu_id`=@GOSSIP AND `id`=0; +DELETE FROM `gossip_scripts` WHERE `id`=@GOSSIP; + +-- Dread Captain DeMeza SAI +SET @ENTRY := 28048; +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,1,62,0,100,0,9647,0,0,0,11,50517,1,0,0,0,0,7,0,0,0,0,0,0,0, 'Dread Captain DeMeza - On gossip option select - cast spell'), +(@ENTRY,0,1,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Dread Captain DeMeza - On gossip option select - close gossip'); +-- Cleanup gossip +UPDATE `gossip_menu_option` SET `action_script_id`=0 WHERE `menu_id`=9647 AND `id`=0; +DELETE FROM `gossip_scripts` WHERE `id`=9647; diff --git a/sql/updates/world/2011_03_24_03_world_sai.sql b/sql/updates/world/2011_03_24_03_world_sai.sql new file mode 100644 index 0000000000000..fa560592d066f --- /dev/null +++ b/sql/updates/world/2011_03_24_03_world_sai.sql @@ -0,0 +1,61 @@ +-- Scourge Deathspeaker SAI +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=27615; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=27615; +DELETE FROM `smart_scripts` WHERE `entryorguid`=27615; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(27615,0,0,1,1,0,100,1,1000,1000,1000,1000,11,49119,2,0,0,0,0,10,101497,27452,0,0,0,0,0,'Scourge Deathspeaker - Spawn & reset - channel Fire Beam'), +(27615,0,1,0,61,0,100,1,0,0,0,0,21,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Scourge Deathspeaker - Spawn & reset - Prevent Combat Movement'), +(27615,0,2,3,4,0,100,1,0,0,0,0,11,52282,2,0,0,0,0,2,0,0,0,0,0,0,0,'Scourge Deathspeaker - On aggro - Cast Fireball'), +(27615,0,3,0,61,0,100,1,0,0,0,0,22,1,0,0,0,0,0,0,0,0,0,0,0,0,0,'Scourge Deathspeaker - On aggro - Set phase 1'), +(27615,0,4,0,9,1,100,0,3000,3000,3400,4800,11,52282,1,0,0,0,0,2,0,0,0,0,0,0,0,'Scourge Deathspeaker - in combat - Cast Fireball (phase 1)'), +(27615,0,5,0,9,1,100,0,35,80,1000,1000,21,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Scourge Deathspeaker - At 35 Yards - Start Combat Movement (phase 1)'), +(27615,0,6,0,9,1,100,0,5,15,1000,1000,21,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Scourge Deathspeaker - At 15 Yards - Prevent Combat Movement (phase 1)'), +(27615,0,7,0,9,1,100,0,0,5,1000,1000,21,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Scourge Deathspeaker - Below 5 Yards - Start Combat Movement (phase 1)'), +(27615,0,8,0,3,1,100,1,0,7,0,0,22,2,0,0,0,0,0,0,0,0,0,0,0,0,0,'Scourge Deathspeaker - Mana at 7% - Set Phase 2 (phase 1)'), +(27615,0,9,0,0,2,100,1,0,0,0,0,21,1,0,0,0,0,0,0,0,0,0,0,0,0,0,'Scourge Deathspeaker - In combat - Allow Combat Movement (phase 2)'), +(27615,0,10,0,3,2,100,1,15,100,100,100,22,1,0,0,0,0,0,0,0,0,0,0,0,0,0,'Scourge Deathspeaker - Mana above 15% - Set Phase 1 (phase 2)'), +(27615,0,11,0,2,0,100,1,0,30,120000,130000,11,52281,0,0,0,0,0,2,0,0,0,0,0,0,0,'Scourge Deathspeaker - At 15% HP - Cast Flame of the Seer'), +(27615,0,12,0,2,0,100,1,0,15,0,0,22,3,0,0,0,0,0,0,0,0,0,0,0,0,0,'Scourge Deathspeaker - At 15% HP - Set Phase 3'), +(27615,0,13,0,2,4,100,1,0,15,0,0,21,1,0,0,0,0,0,0,0,0,0,0,0,0,0,'Scourge Deathspeaker - At 15% HP - Allow Combat Movement (phase 3)'), +(27615,0,14,15,2,4,100,1,0,15,0,0,25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'Scourge Deathspeaker - At 15% HP - Flee (phase 3)'), +(27615,0,15,0,61,4,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Scourge Deathspeaker - At 15% HP - Say text0 (Phase 3)'); + +-- NPC talk text insert +DELETE FROM `creature_text` WHERE `entry` IN (27615); +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(27615,0,0, '%s attempts to run away in fear!',2,0,100,0,0,0, 'Scourge Deathspeaker'); + +-- SET InhabitType for Invisible Stalker Grizzly Hills +UPDATE `creature_template` SET `InhabitType`=7 WHERE `entry`=27452; + +-- SAI for Dark Conclave Ritualist +SET @ENTRY := 22138; +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,1,0,100,1,1000,1000,1000,1000,11,38469,0,0,0,0,0,19,22139,0,0,0,0,0,0,'Dark Conclave Ritualist - OOC - Dark Conclave Ritualist Channel'); + +-- Shattered Sun Marksman fixup (tested) +-- Console no longer spamming waypoint script errors in The Dawning Square +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=24938; +-- Shattered Sun Marksman shoot at Bridge Marksman Target Dummy SAI +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (-65694,-65695,-65696,-65697,-65698,-65699,-65700,-65702); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(-65694,0,0,0,1,0,100,0,5000,5000,5000,7000,11,45223,0,0,0,0,0,10,62844,25192,0,0,0,0,0,'Shattered Sun Marksman - OOC 5-7 sec - Shoot at trigger'), +(-65695,0,0,0,1,0,100,0,2000,2000,5000,7000,11,45223,0,0,0,0,0,10,62844,25192,0,0,0,0,0,'Shattered Sun Marksman - OOC 5-7 sec - Shoot at trigger'), +(-65696,0,0,0,1,0,100,0,3000,3000,5000,7000,11,45223,0,0,0,0,0,10,62843,25192,0,0,0,0,0,'Shattered Sun Marksman - OOC 5-7 sec - Shoot at trigger'), +(-65697,0,0,0,1,0,100,0,6000,6000,5000,7000,11,45223,0,0,0,0,0,10,62843,25192,0,0,0,0,0,'Shattered Sun Marksman - OOC 5-7 sec - Shoot at trigger'), +(-65698,0,0,0,1,0,100,0,2000,2000,5000,7000,11,45223,0,0,0,0,0,10,59515,25192,0,0,0,0,0,'Shattered Sun Marksman - OOC 5-7 sec - Shoot at trigger'), +(-65699,0,0,0,1,0,100,0,5000,5000,5000,7000,11,45223,0,0,0,0,0,10,62841,25192,0,0,0,0,0,'Shattered Sun Marksman - OOC 5-7 sec - Shoot at trigger'), +(-65700,0,0,0,1,0,100,0,1000,1000,5000,7000,11,45223,0,0,0,0,0,10,62842,25192,0,0,0,0,0,'Shattered Sun Marksman - OOC 5-7 sec - Shoot at trigger'), +(-65702,0,0,0,1,0,100,0,5000,5000,5000,7000,11,45223,0,0,0,0,0,10,59473,25192,0,0,0,0,0,'Shattered Sun Marksman - OOC 5-7 sec - Shoot at trigger'); +-- Remove path data and scripts from Shattered Sun Marksman +DELETE FROM `waypoint_data` WHERE `id` IN (656940,656950,656960,656970,656980,656990,657000,657020); +DELETE FROM `waypoint_scripts` WHERE `id` BETWEEN 80 AND 111; +UPDATE `creature` SET `spawndist`=0,`MovementType`=0 WHERE `guid` IN (65694,65695,65696,65697,65698,65699,65700,65702); +UPDATE `creature_addon` SET `path_id`=0 WHERE `guid` IN (65694,65695,65696,65697,65698,65699,65700,65702); + +-- Fix Spell condition for Spell 45223 to target Bridge Marksman Target Dummy 25192 +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=45223; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(13,0,45223,0,18,1,25192,0,0,'','Spell 45223 targets Bridge Marksman Target Dummy'); diff --git a/sql/updates/world/2011_03_24_04_world_sai.sql b/sql/updates/world/2011_03_24_04_world_sai.sql new file mode 100644 index 0000000000000..e0c281fa55937 --- /dev/null +++ b/sql/updates/world/2011_03_24_04_world_sai.sql @@ -0,0 +1,448 @@ +-- Quest 10895 "Zeth'Gor Must Burn!" (Alliance) +-- Remove flame spawns from db +DELETE FROM `gameobject` WHERE `guid` IN (32141,32142,32143,24683,24684,24685,24686); +-- Remove Honor Hold Gryphon Brigadier, Foothill spawns from db +DELETE FROM `creature` WHERE `guid` IN (78738,78739,78740,78741); +-- Zeth'Gor Quest Credit Marker, They Must Burn & Remove Honor Hold Gryphon Brigadier have wrong inhabit type, fix flags +UPDATE `creature_template` SET `InhabitType`=4 WHERE `entry` IN (21173,21170,22404,22405,22406); +UPDATE `creature_template` SET `unit_flags`=`unit_flags`|2048 WHERE `entry` IN (21170,22404,22405,22406); + +-- Add missing Zeth'Gor Quest Credit Marker, They Must Burn +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`DeathState`,`MovementType`) VALUES +(78738,21173,530,1,1,0,0,-1162.911377,2248.195313,152.24733,4.815845,120,0,0,1,0,0,0); + +-- Add missing Go +DELETE FROM `gameobject_template` WHERE `entry`=183929; +INSERT INTO `gameobject_template` (`entry`,`type`,`displayId`,`name`,`castBarCaption`,`unk1`,`faction`,`flags`,`size`,`data0`,`data1`,`data2`,`data3`,`data4`,`data5`,`data6`,`data7`,`data8`,`data9`,`data10`,`data11`,`data12`,`data13`,`data14`,`data15`,`data16`,`data17`,`data18`,`data19`,`data20`,`data21`,`data22`,`data23`,`ScriptName`,`WDBVerified`) VALUES +(183929,6,0, '', '', '',35,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, '',1); + +-- SAI add animation to GameObject Smoke Beacon +SET @ENTRY := 184661; +UPDATE `gameobject_template` SET `AIName`= 'SmartGameObjectAI' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=1 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,1,0,0,1,0,100,0,0,0,1000,1000,93,3,0,0,0,0,0,1,0,0,0,0,0,0,0, 'GameObject Smoke Beacon - On Spawn - Do Custom Animation'); + +-- Add spell conditions for 36325 +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=36325; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(13,0,36325,0,18,1,21182,0,0,'','Spell 36325 target creature 21182'), +(13,0,36325,0,18,1,22401,0,0,'','Spell 36325 target creature 22401'), +(13,0,36325,0,18,1,22402,0,0,'','Spell 36325 target creature 22402'), +(13,0,36325,0,18,1,22403,0,0,'','Spell 36325 target creature 22403'); + +-- SAI for Zeth'Gor Quest Credit Marker, They Must Burn, Tower South +SET @ENTRY := 21182; +UPDATE `creature_template` SET `minlevel`=1,`maxlevel`=1,`flags_extra`=`flags_extra`&~2,`InhabitType`=4,`AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,11,0,100,0,0,0,0,0,53,0,@ENTRY,1,0,0,0,1,0,0,0,0,0,0,0, 'Zeth''Gor Quest Credit Marker, They Must Burn, Tower South - On Spawn - Start WP movement'), +(@ENTRY,0,1,2,8,0,100,0,36374,0,0,0,45,0,1,0,0,0,0,10,78738,21173,0,0,0,0,0,'Zeth''Gor Quest Credit Marker, They Must Burn, Tower South - On spell hit - Call Griphonriders'), +(@ENTRY,0,2,0,61,0,100,0,0,0,0,0,11,34386,2,0,0,0,0,1,0,0,0,0,0,0,0,'Zeth''Gor Quest Credit Marker, They Must Burn, Tower South - On spell hit - Spawn fire'); + +-- Waypoints for Zeth'Gor Quest Credit Marker, They Must Burn, Tower South from sniff +DELETE FROM `waypoints` WHERE `entry`=@ENTRY; +INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES +(@ENTRY,1,-1156.975,2109.627,83.51005,'Zeth''Gor Quest Credit Marker, They Must Burn, Tower South WP 1'), +(@ENTRY,2,-1152.303,2112.098,90.67654,'Zeth''Gor Quest Credit Marker, They Must Burn, Tower South WP 2'), +(@ENTRY,3,-1150.817,2103.74,89.81573,'Zeth''Gor Quest Credit Marker, They Must Burn, Tower South WP 3'), +(@ENTRY,4,-1153.965,2107.031,97.06559,'Zeth''Gor Quest Credit Marker, They Must Burn, Tower South WP 4'), +(@ENTRY,5,-1156.105,2107.421,93.06557,'Zeth''Gor Quest Credit Marker, They Must Burn, Tower South WP 5'), +(@ENTRY,6,-1152.167,2107.406,83.17665,'Zeth''Gor Quest Credit Marker, They Must Burn, Tower South WP 6'), +(@ENTRY,7,-1150.145,2102.392,75.23684,'Zeth''Gor Quest Credit Marker, They Must Burn, Tower South WP 7'), +(@ENTRY,8,-1158.784,2102.993,76.98234,'Zeth''Gor Quest Credit Marker, They Must Burn, Tower South WP 8'), +(@ENTRY,9,-1158.344,2112.019,79.20454,'Zeth''Gor Quest Credit Marker, They Must Burn, Tower South WP 9'), +(@ENTRY,10,-1148.166,2113.343,77.0103,'Zeth''Gor Quest Credit Marker, They Must Burn, Tower South WP 10'), +(@ENTRY,11,-1148.897,2102.624,69.67694,'Zeth''Gor Quest Credit Marker, They Must Burn, Tower South WP 11'), +(@ENTRY,12,-1157.054,2104.975,82.9548,'Zeth''Gor Quest Credit Marker, They Must Burn, Tower South WP 12'); +-- Update Creature +UPDATE `creature` SET `curhealth`=1,`spawndist`=0,`MovementType`=0,`position_x`=-1157.054,`position_y`=2104.975,`position_z`=82.9548,`orientation`=1.186824 WHERE `guid`=74299; + +-- SAI for Zeth'Gor Quest Credit Marker, They Must Burn, Tower North +SET @ENTRY := 22401; +UPDATE `creature_template` SET `minlevel`=1,`maxlevel`=1,`flags_extra`=`flags_extra`&~2,`InhabitType`=4,`AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,11,0,100,0,0,0,0,0,53,0,@ENTRY,1,0,0,0,1,0,0,0,0,0,0,0, 'Zeth''Gor Quest Credit Marker, They Must Burn, Tower North - On Spawn - Start WP movement'), +(@ENTRY,0,1,2,8,0,100,0,36374,0,0,0,45,0,2,0,0,0,0,10,74239,21173,0,0,0,0,0,'Zeth''Gor Quest Credit Marker, They Must Burn, Tower North - On spell hit - Call Griphonriders'), +(@ENTRY,0,2,0,61,0,100,0,0,0,0,0,11,34386,2,0,0,0,0,1,0,0,0,0,0,0,0,'Zeth''Gor Quest Credit Marker, They Must Burn, Tower North - On spell hit - Spawn fire'); + +-- Waypoints for Zeth'Gor Quest Credit Marker, They Must Burn, Tower North from sniff +DELETE FROM `waypoints` WHERE `entry`=@ENTRY; +INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES +(@ENTRY,1,-821.9919,2034.883,55.01843,'Zeth''Gor Quest Credit Marker, They Must Burn, Tower North WP 1'), +(@ENTRY,2,-820.9771,2027.591,63.68367,'Zeth''Gor Quest Credit Marker, They Must Burn, Tower North WP 2'), +(@ENTRY,3,-825.2185,2034.113,65.86314,'Zeth''Gor Quest Credit Marker, They Must Burn, Tower North WP 3'), +(@ENTRY,4,-816.8493,2028.659,49.75199,'Zeth''Gor Quest Credit Marker, They Must Burn, Tower North WP 4'), +(@ENTRY,5,-825.249,2026.351,46.58422,'Zeth''Gor Quest Credit Marker, They Must Burn, Tower North WP 5'); +-- Update Creature +UPDATE `creature` SET `curhealth`=1,`spawndist`=0,`MovementType`=0,`position_x`=-825.249,`position_y`=2026.351,`position_z`=46.58422,`orientation`=1.186824 WHERE `guid`=78735; + +-- SAI for Zeth'Gor Quest Credit Marker, They Must Burn, Tower Forge +SET @ENTRY := 22402; +UPDATE `creature_template` SET `minlevel`=1,`maxlevel`=1,`flags_extra`=`flags_extra`&~2,`InhabitType`=4,`AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,11,0,100,0,0,0,0,0,53,0,@ENTRY,1,0,0,0,1,0,0,0,0,0,0,0, 'Zeth''Gor Quest Credit Marker, They Must Burn, Tower Forge - On Spawn - Start WP movement'), +(@ENTRY,0,1,2,8,0,100,0,36374,0,0,0,45,0,3,0,0,0,0,10,74239,21173,0,0,0,0,0,'Zeth''Gor Quest Credit Marker, They Must Burn, Tower Forge - On spell hit - Call Griphonriders'), +(@ENTRY,0,2,0,61,0,100,0,0,0,0,0,11,34386,2,0,0,0,0,1,0,0,0,0,0,0,0,'Zeth''Gor Quest Credit Marker, They Must Burn, Tower Forge - On spell hit - Spawn fire'); + +-- Waypoints for Zeth'Gor Quest Credit Marker, They Must Burn, Tower Forge from sniff +DELETE FROM `waypoints` WHERE `entry`=@ENTRY; +INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES +(@ENTRY,1,-897.1001,1917.556,93.73737,'Zeth''Gor Quest Credit Marker, They Must Burn, Tower Forge WP 1'), +(@ENTRY,2,-903.386,1919.14,76.0997,'Zeth''Gor Quest Credit Marker, They Must Burn, Tower Forge WP 2'), +(@ENTRY,3,-898.1819,1920.161,82.67819,'Zeth''Gor Quest Credit Marker, They Must Burn, Tower Forge WP 3'), +(@ENTRY,4,-901.2836,1920.168,92.57269,'Zeth''Gor Quest Credit Marker, They Must Burn, Tower Forge WP 4'), +(@ENTRY,5,-894.9478,1924.78,75.48938,'Zeth''Gor Quest Credit Marker, They Must Burn, Tower Forge WP 5'), +(@ENTRY,6,-894.4704,1919.866,93.71019,'Zeth''Gor Quest Credit Marker, They Must Burn, Tower Forge WP 6'); +-- Update Creature +UPDATE `creature` SET `curhealth`=1,`spawndist`=0,`MovementType`=0,`position_x`=-894.4704,`position_y`=1919.866,`position_z`=93.71019,`orientation`=1.186824 WHERE `guid`=78736; + +-- SAI for Zeth'Gor Quest Credit Marker, They Must Burn, Tower Foothill +SET @ENTRY := 22403; +UPDATE `creature_template` SET `minlevel`=1,`maxlevel`=1,`flags_extra`=`flags_extra`&~2,`flags_extra`=`flags_extra`|128,`InhabitType`=4,`AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,11,0,100,0,0,0,0,0,53,0,@ENTRY,1,0,0,0,1,0,0,0,0,0,0,0, 'Zeth''Gor Quest Credit Marker, They Must Burn, Tower Foothill - On Spawn - Start WP movement'), +(@ENTRY,0,1,2,8,0,100,0,36374,0,0,0,45,0,4,0,0,0,0,10,74239,21173,0,0,0,0,0,'Zeth''Gor Quest Credit Marker, They Must Burn, Tower Foothill - On spell hit - Call Griphonriders'), +(@ENTRY,0,2,0,61,0,100,0,0,0,0,0,11,34386,2,0,0,0,0,1,0,0,0,0,0,0,0,'Zeth''Gor Quest Credit Marker, They Must Burn, Tower Foothill - On spell hit - Spawn fire'); + +-- Waypoints for Zeth'Gor Quest Credit Marker, They Must Burn, Tower Foothill from sniff +DELETE FROM `waypoints` WHERE `entry`=@ENTRY; +INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES +(@ENTRY,1,-978.3713,1883.556,104.3167,'Zeth''Gor Quest Credit Marker, They Must Burn, Tower Foothill WP 1'), +(@ENTRY,2,-974.3038,1878.926,109.6782,'Zeth''Gor Quest Credit Marker, They Must Burn, Tower Foothill WP 2'), +(@ENTRY,3,-974.1463,1874.819,121.9402,'Zeth''Gor Quest Credit Marker, They Must Burn, Tower Foothill WP 3'), +(@ENTRY,4,-982.4401,1875.441,100.4122,'Zeth''Gor Quest Credit Marker, They Must Burn, Tower Foothill WP 4'), +(@ENTRY,5,-975.1263,1882.178,118.0354,'Zeth''Gor Quest Credit Marker, They Must Burn, Tower Foothill WP 5'), +(@ENTRY,6,-979.3693,1876.667,121.5866,'Zeth''Gor Quest Credit Marker, They Must Burn, Tower Foothill WP 6'); +-- Update Creature +UPDATE `creature` SET `curhealth`=1,`spawndist`=0,`MovementType`=0,`position_x`=-979.3693,`position_y`=1876.667,`position_z`=121.5866,`orientation`=1.186824 WHERE `guid`=78737; + +-- SAI for Zeth'Gor Quest Credit Marker, They Must Burn +SET @ENTRY := 21173; -- Zeth'Gor Quest Credit Marker, They Must Burn +SET @ENTRY1 := 21170; -- Honor Hold Gryphon Brigadier, South +SET @ENTRY2 := 22404; -- Honor Hold Gryphon Brigadier, North +SET @ENTRY3 := 22405; -- Honor Hold Gryphon Brigadier, Forge +SET @ENTRY4 := 22406; -- Honor Hold Gryphon Brigadier, Foothills +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid` IN (@ENTRY*100, (@ENTRY*100)+1, (@ENTRY*100)+2, (@ENTRY*100)+3); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +-- AI +(@ENTRY,0,0,0,38,0,100,0,0,1,0,0,80,(@ENTRY*100)+0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Zeth''Gor Quest Credit Marker, They Must Burn, Tower South - On dataset - load script'), +(@ENTRY,0,1,0,38,0,100,0,0,2,0,0,80,(@ENTRY*100)+1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Zeth''Gor Quest Credit Marker, They Must Burn, Tower North - On dataset - load script'), +(@ENTRY,0,2,0,38,0,100,0,0,3,0,0,80,(@ENTRY*100)+2,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Zeth''Gor Quest Credit Marker, They Must Burn, Tower Forge - On dataset - load script'), +(@ENTRY,0,3,0,38,0,100,0,0,4,0,0,80,(@ENTRY*100)+3,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Zeth''Gor Quest Credit Marker, They Must Burn, Tower Foothill - On dataset - load script'), +-- Script 0 +(@ENTRY*100,9,0,0,0,0,100,0,0,0,0,0,45,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Reset data 0'), +(@ENTRY*100,9,1,0,0,0,100,0,1000,1000,0,0,11,36302,0,0,0,0,0,1,0,0,0,0,0,0,0, ' Summon Honor Hold Gryphon Brigadier, South'), +(@ENTRY*100,9,2,0,0,0,100,0,3000,3000,0,0,45,0,1,0,0,0,0,19,@ENTRY1,0,0,0,0,0,0, ' Summon Honor Hold Gryphon Brigadier, South'), +(@ENTRY*100,9,3,0,0,0,100,0,0,0,0,0,11,36302,0,0,0,0,0,1,0,0,0,0,0,0,0, ' Summon Honor Hold Gryphon Brigadier, South'), +(@ENTRY*100,9,4,0,0,0,100,0,3000,3000,0,0,45,0,2,0,0,0,0,19,@ENTRY1,0,0,0,0,0,0, ' Summon Honor Hold Gryphon Brigadier, South'), +(@ENTRY*100,9,5,0,0,0,100,0,0,0,0,0,11,36302,0,0,0,0,0,1,0,0,0,0,0,0,0, ' Summon Honor Hold Gryphon Brigadier, South'), +(@ENTRY*100,9,6,0,0,0,100,0,3000,3000,0,0,45,0,3,0,0,0,0,19,@ENTRY1,0,0,0,0,0,0, ' Summon Honor Hold Gryphon Brigadier, South'), +(@ENTRY*100,9,7,0,0,0,100,0,0,0,0,0,11,36302,0,0,0,0,0,1,0,0,0,0,0,0,0, ' Summon Honor Hold Gryphon Brigadier, South'), +(@ENTRY*100,9,8,0,0,0,100,0,3000,3000,0,0,45,0,4,0,0,0,0,19,@ENTRY1,0,0,0,0,0,0, ' Summon Honor Hold Gryphon Brigadier, South'), +-- Script 1 +((@ENTRY*100)+1,9,0,0,0,0,100,0,0,0,0,0,45,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Reset data 0'), +((@ENTRY*100)+1,9,1,0,0,0,100,0,0,0,0,0,11,39106,0,0,0,0,0,1,0,0,0,0,0,0,0, ' Summon Honor Hold Gryphon Brigadier, North'), +((@ENTRY*100)+1,9,2,0,0,0,100,0,3000,3000,0,0,45,0,1,0,0,0,0,19,@ENTRY2,0,0,0,0,0,0, ' Summon Honor Hold Gryphon Brigadier, North'), +((@ENTRY*100)+1,9,3,0,0,0,100,0,0,0,0,0,11,39106,0,0,0,0,0,1,0,0,0,0,0,0,0, ' Summon Honor Hold Gryphon Brigadier, North'), +((@ENTRY*100)+1,9,4,0,0,0,100,0,3000,3000,0,0,45,0,2,0,0,0,0,19,@ENTRY2,0,0,0,0,0,0, ' Summon Honor Hold Gryphon Brigadier, North'), +((@ENTRY*100)+1,9,5,0,0,0,100,0,0,0,0,0,11,39106,0,0,0,0,0,1,0,0,0,0,0,0,0, ' Summon Honor Hold Gryphon Brigadier, North'), +((@ENTRY*100)+1,9,6,0,0,0,100,0,3000,3000,0,0,45,0,3,0,0,0,0,19,@ENTRY2,0,0,0,0,0,0, ' Summon Honor Hold Gryphon Brigadier, North'), +((@ENTRY*100)+1,9,7,0,0,0,100,0,0,0,0,0,11,39106,0,0,0,0,0,1,0,0,0,0,0,0,0, ' Summon Honor Hold Gryphon Brigadier, North'), +((@ENTRY*100)+1,9,8,0,0,0,100,0,3000,3000,0,0,45,0,3,0,0,0,0,19,@ENTRY2,0,0,0,0,0,0, ' Summon Honor Hold Gryphon Brigadier, North'), +-- Script 2 +((@ENTRY*100)+2,9,0,0,0,0,100,0,0,0,0,0,45,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Reset data 0'), +((@ENTRY*100)+2,9,1,0,0,0,100,0,0,0,0,0,11,39107,0,0,0,0,0,1,0,0,0,0,0,0,0, ' Summon Honor Hold Gryphon Brigadier, Forge'), +((@ENTRY*100)+2,9,2,0,0,0,100,0,3000,3000,0,0,45,0,1,0,0,0,0,19,@ENTRY3,0,0,0,0,0,0, ' Summon Honor Hold Gryphon Brigadier, Forge'), +((@ENTRY*100)+2,9,3,0,0,0,100,0,0,0,0,0,11,39107,0,0,0,0,0,1,0,0,0,0,0,0,0, ' Summon Honor Hold Gryphon Brigadier, Forge'), +((@ENTRY*100)+2,9,4,0,0,0,100,0,3000,3000,0,0,45,0,2,0,0,0,0,19,@ENTRY3,0,0,0,0,0,0, ' Summon Honor Hold Gryphon Brigadier, Forge'), +((@ENTRY*100)+2,9,5,0,0,0,100,0,0,0,0,0,11,39107,0,0,0,0,0,1,0,0,0,0,0,0,0, ' Summon Honor Hold Gryphon Brigadier, Forge'), +((@ENTRY*100)+2,9,6,0,0,0,100,0,3000,3000,0,0,45,0,3,0,0,0,0,19,@ENTRY3,0,0,0,0,0,0, ' Summon Honor Hold Gryphon Brigadier, Forge'), +((@ENTRY*100)+2,9,7,0,0,0,100,0,0,0,0,0,11,39107,0,0,0,0,0,1,0,0,0,0,0,0,0, ' Summon Honor Hold Gryphon Brigadier, Forge'), +((@ENTRY*100)+2,9,8,0,0,0,100,0,3000,3000,0,0,45,0,3,0,0,0,0,19,@ENTRY3,0,0,0,0,0,0, ' Summon Honor Hold Gryphon Brigadier, Forge'), +-- Script 3 +((@ENTRY*100)+3,9,0,0,0,0,100,0,0,0,0,0,45,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Reset data 0'), +((@ENTRY*100)+3,9,1,0,0,0,100,0,0,0,0,0,11,39108,0,0,0,0,0,1,0,0,0,0,0,0,0, ' Summon Honor Hold Gryphon Brigadier, Foothill'), +((@ENTRY*100)+3,9,2,0,0,0,100,0,3000,3000,0,0,45,0,1,0,0,0,0,19,@ENTRY4,0,0,0,0,0,0, ' Summon Honor Hold Gryphon Brigadier, Foothill'), +((@ENTRY*100)+3,9,3,0,0,0,100,0,0,0,0,0,11,39108,0,0,0,0,0,1,0,0,0,0,0,0,0, ' Summon Honor Hold Gryphon Brigadier, Foothill'), +((@ENTRY*100)+3,9,4,0,0,0,100,0,3000,3000,0,0,45,0,2,0,0,0,0,19,@ENTRY4,0,0,0,0,0,0, ' Summon Honor Hold Gryphon Brigadier, Foothill'), +((@ENTRY*100)+3,9,5,0,0,0,100,0,0,0,0,0,11,39108,0,0,0,0,0,1,0,0,0,0,0,0,0, ' Summon Honor Hold Gryphon Brigadier, Foothill'), +((@ENTRY*100)+3,9,6,0,0,0,100,0,3000,3000,0,0,45,0,3,0,0,0,0,19,@ENTRY4,0,0,0,0,0,0, ' Summon Honor Hold Gryphon Brigadier, Foothill'), +((@ENTRY*100)+3,9,7,0,0,0,100,0,0,0,0,0,11,39108,0,0,0,0,0,1,0,0,0,0,0,0,0, ' Summon Honor Hold Gryphon Brigadier, Foothill'), +((@ENTRY*100)+3,9,8,0,0,0,100,0,3000,3000,0,0,45,0,1,0,0,0,0,19,@ENTRY4,0,0,0,0,0,0, ' Summon Honor Hold Gryphon Brigadier, Foothill'); + +-- SAI for Honor Hold Gryphon Brigadier, South +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY1; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY1; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY1,0,0,0,11,0,100,0,0,0,0,0,11,36350,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Zeth''Gor Quest Credit Marker, They Must Burn, Tower South - On Spawn - Add aura'), +(@ENTRY1,0,1,0,38,0,100,0,0,1,0,0,53,1,@ENTRY1*100,0,0,0,0,1,0,0,0,0,0,0,0, 'Zeth''Gor Quest Credit Marker, They Must Burn, Tower South - On data set - Start WP movement'), +(@ENTRY1,0,2,0,38,0,100,0,0,2,0,0,53,1,(@ENTRY1*100)+1,0,0,0,0,1,0,0,0,0,0,0,0, 'Zeth''Gor Quest Credit Marker, They Must Burn, Tower South - On data set - Start WP movement'), +(@ENTRY1,0,3,0,38,0,100,0,0,3,0,0,53,1,(@ENTRY1*100)+2,0,0,0,0,1,0,0,0,0,0,0,0, 'Zeth''Gor Quest Credit Marker, They Must Burn, Tower South - On data set - Start WP movement'), +(@ENTRY1,0,4,0,38,0,100,0,0,4,0,0,53,1,(@ENTRY1*100)+3,0,0,0,0,1,0,0,0,0,0,0,0, 'Zeth''Gor Quest Credit Marker, They Must Burn, Tower South - On data set - Start WP movement'), +(@ENTRY1,0,5,0,40,0,100,0,10,@ENTRY1*100,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Zeth''Gor Quest Credit Marker, They Must Burn, Tower South - On Reach WP - Despawn'), +(@ENTRY1,0,6,0,40,0,100,0,10,(@ENTRY1*100)+1,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Zeth''Gor Quest Credit Marker, They Must Burn, Tower South - On Reach WP - Despawn'), +(@ENTRY1,0,7,0,40,0,100,0,11,(@ENTRY1*100)+2,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Zeth''Gor Quest Credit Marker, They Must Burn, Tower South - On Reach WP - Despawn'), +(@ENTRY1,0,8,0,40,0,100,0,11,(@ENTRY1*100)+3,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Zeth''Gor Quest Credit Marker, They Must Burn, Tower South - On Reach WP - Despawn'); + +-- SAI for Honor Hold Gryphon Brigadier, North +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY2; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY2; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY2,0,0,0,11,0,100,0,0,0,0,0,11,36350,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Zeth''Gor Quest Credit Marker, They Must Burn, Tower South - On Spawn - Add aura'), +(@ENTRY2,0,1,0,38,0,100,0,0,1,0,0,53,1,@ENTRY2*100,0,0,0,0,1,0,0,0,0,0,0,0, 'Zeth''Gor Quest Credit Marker, They Must Burn, Tower South - On data set - Start WP movement'), +(@ENTRY2,0,2,0,38,0,100,0,0,2,0,0,53,1,(@ENTRY2*100)+1,0,0,0,0,1,0,0,0,0,0,0,0, 'Zeth''Gor Quest Credit Marker, They Must Burn, Tower South - On data set - Start WP movement'), +(@ENTRY2,0,3,0,38,0,100,0,0,3,0,0,53,1,(@ENTRY2*100)+2,0,0,0,0,1,0,0,0,0,0,0,0, 'Zeth''Gor Quest Credit Marker, They Must Burn, Tower South - On data set - Start WP movement'), +(@ENTRY2,0,4,0,38,0,100,0,0,4,0,0,53,1,(@ENTRY2*100)+3,0,0,0,0,1,0,0,0,0,0,0,0, 'Zeth''Gor Quest Credit Marker, They Must Burn, Tower South - On data set - Start WP movement'), +(@ENTRY2,0,5,0,40,0,100,0,12,@ENTRY2*100,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Zeth''Gor Quest Credit Marker, They Must Burn, Tower South - On Reach WP - Despawn'), +(@ENTRY2,0,6,0,40,0,100,0,11,(@ENTRY2*100)+1,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Zeth''Gor Quest Credit Marker, They Must Burn, Tower South - On Reach WP - Despawn'), +(@ENTRY2,0,7,0,40,0,100,0,12,(@ENTRY2*100)+2,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Zeth''Gor Quest Credit Marker, They Must Burn, Tower South - On Reach WP - Despawn'), +(@ENTRY2,0,8,0,40,0,100,0,12,(@ENTRY2*100)+3,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Zeth''Gor Quest Credit Marker, They Must Burn, Tower South - On Reach WP - Despawn'); + +-- SAI for Honor Hold Gryphon Brigadier, Forge +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY3; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY3; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY3,0,0,0,11,0,100,0,0,0,0,0,11,36350,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Zeth''Gor Quest Credit Marker, They Must Burn, Tower South - On Spawn - Add aura'), +(@ENTRY3,0,1,0,38,0,100,0,0,1,0,0,53,1,@ENTRY3*100,0,0,0,0,1,0,0,0,0,0,0,0, 'Zeth''Gor Quest Credit Marker, They Must Burn, Tower South - On data set - Start WP movement'), +(@ENTRY3,0,2,0,38,0,100,0,0,2,0,0,53,1,(@ENTRY3*100)+1,0,0,0,0,1,0,0,0,0,0,0,0, 'Zeth''Gor Quest Credit Marker, They Must Burn, Tower South - On data set - Start WP movement'), +(@ENTRY3,0,3,0,38,0,100,0,0,3,0,0,53,1,(@ENTRY3*100)+2,0,0,0,0,1,0,0,0,0,0,0,0, 'Zeth''Gor Quest Credit Marker, They Must Burn, Tower South - On data set - Start WP movement'), +(@ENTRY3,0,4,0,38,0,100,0,0,4,0,0,53,1,(@ENTRY3*100)+3,0,0,0,0,1,0,0,0,0,0,0,0, 'Zeth''Gor Quest Credit Marker, They Must Burn, Tower South - On data set - Start WP movement'), +(@ENTRY3,0,5,0,40,0,100,0,13,@ENTRY3*100,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Zeth''Gor Quest Credit Marker, They Must Burn, Tower South - On Reach WP - Despawn'), +(@ENTRY3,0,6,0,40,0,100,0,13,(@ENTRY3*100)+1,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Zeth''Gor Quest Credit Marker, They Must Burn, Tower South - On Reach WP - Despawn'), +(@ENTRY3,0,7,0,40,0,100,0,12,(@ENTRY3*100)+2,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Zeth''Gor Quest Credit Marker, They Must Burn, Tower South - On Reach WP - Despawn'), +(@ENTRY3,0,8,0,40,0,100,0,14,(@ENTRY3*100)+3,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Zeth''Gor Quest Credit Marker, They Must Burn, Tower South - On Reach WP - Despawn'); + +-- SAI for Honor Hold Gryphon Brigadier, Foothill +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY4; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY4; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY4,0,0,0,11,0,100,0,0,0,0,0,11,36350,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Zeth''Gor Quest Credit Marker, They Must Burn, Tower South - On Spawn - Add aura'), +(@ENTRY4,0,1,0,38,0,100,0,0,1,0,0,53,1,@ENTRY4*100,0,0,0,0,1,0,0,0,0,0,0,0, 'Zeth''Gor Quest Credit Marker, They Must Burn, Tower South - On data set - Start WP movement'), +(@ENTRY4,0,2,0,38,0,100,0,0,2,0,0,53,1,(@ENTRY4*100)+1,0,0,0,0,1,0,0,0,0,0,0,0, 'Zeth''Gor Quest Credit Marker, They Must Burn, Tower South - On data set - Start WP movement'), +(@ENTRY4,0,3,0,38,0,100,0,0,3,0,0,53,1,(@ENTRY4*100)+2,0,0,0,0,1,0,0,0,0,0,0,0, 'Zeth''Gor Quest Credit Marker, They Must Burn, Tower South - On data set - Start WP movement'), +(@ENTRY4,0,4,0,40,0,100,0,15,@ENTRY4*100,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Zeth''Gor Quest Credit Marker, They Must Burn, Tower South - On Reach WP - Despawn'), +(@ENTRY4,0,5,0,40,0,100,0,15,(@ENTRY4*100)+1,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Zeth''Gor Quest Credit Marker, They Must Burn, Tower South - On Reach WP - Despawn'), +(@ENTRY4,0,6,0,40,0,100,0,15,(@ENTRY4*100)+2,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Zeth''Gor Quest Credit Marker, They Must Burn, Tower South - On Reach WP - Despawn'); + +-- Honor Hold Gryphon Brigadier, South Pathing +DELETE FROM `waypoints` WHERE `entry` IN (@ENTRY1*100, (@ENTRY1*100)+1, (@ENTRY1*100)+2, (@ENTRY1*100)+3); +INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES +-- Honor Hold Gryphon Brigadier, South Path 1 +(@ENTRY1*100,1,-1166.146,2232.443,154.4811,'Honor Hold Gryphon Brigadier, South Path 1 WP 1'), +(@ENTRY1*100,2,-1166.439,2233.399,154.4811,'Honor Hold Gryphon Brigadier, South Path 1 WP 2'), +(@ENTRY1*100,3,-1162.907,2207.568,140.9076,'Honor Hold Gryphon Brigadier, South Path 1 WP 3'), +(@ENTRY1*100,4,-1165.149,2160.382,126.1298,'Honor Hold Gryphon Brigadier, South Path 1 WP 4'), +(@ENTRY1*100,5,-1171.198,2119.914,110.0741,'Honor Hold Gryphon Brigadier, South Path 1 WP 5'), +(@ENTRY1*100,6,-1152.598,2108.961,101.9074,'Honor Hold Gryphon Brigadier, South Path 1 WP 6'), +(@ENTRY1*100,7,-1126.18,2129.599,118.6573,'Honor Hold Gryphon Brigadier, South Path 1 WP 7'), +(@ENTRY1*100,8,-1113.314,2146.836,135.1296,'Honor Hold Gryphon Brigadier, South Path 1 WP 8'), +(@ENTRY1*100,9,-1105.45,2173.646,171.0185,'Honor Hold Gryphon Brigadier, South Path 1 WP 9'), +(@ENTRY1*100,10,-1107.9,2202.193,195.935,'Honor Hold Gryphon Brigadier, South Path 1 WP 10'), +-- Honor Hold Gryphon Brigadier, South Path 2 +((@ENTRY1*100)+1,1,-1166.146,2232.443,154.4811,'Honor Hold Gryphon Brigadier, South Path 2 WP 1'), +((@ENTRY1*100)+1,2,-1166.439,2233.399,154.4811,'Honor Hold Gryphon Brigadier, South Path 2 WP 2'), +((@ENTRY1*100)+1,3,-1182.963,2208.794,125.3797,'Honor Hold Gryphon Brigadier, South Path 2 WP 3'), +((@ENTRY1*100)+1,4,-1182.292,2161.906,114.2409,'Honor Hold Gryphon Brigadier, South Path 2 WP 4'), +((@ENTRY1*100)+1,5,-1175.9,2113.828,105.1853,'Honor Hold Gryphon Brigadier, South Path 2 WP 5'), +((@ENTRY1*100)+1,6,-1152.598,2108.961,104.5463,'Honor Hold Gryphon Brigadier, South Path 2 WP 6'), +((@ENTRY1*100)+1,7,-1126.18,2129.599,117.0184,'Honor Hold Gryphon Brigadier, South Path 2 WP 7'), +((@ENTRY1*100)+1,8,-1097.298,2159.928,136.074,'Honor Hold Gryphon Brigadier, South Path 2 WP 8'), +((@ENTRY1*100)+1,9,-1084.76,2185.17,157.8796,'Honor Hold Gryphon Brigadier, South Path 2 WP 9'), +((@ENTRY1*100)+1,10,-1074.359,2208.386,178.1295,'Honor Hold Gryphon Brigadier, South Path 2 WP 10'), +-- Honor Hold Gryphon Brigadier, South Path 3 +((@ENTRY1*100)+2,1,-1166.146,2232.443,154.4811,'Honor Hold Gryphon Brigadier, South Path 3 WP 1'), +((@ENTRY1*100)+2,2,-1166.439,2233.399,154.4811,'Honor Hold Gryphon Brigadier, South Path 3 WP 2'), +((@ENTRY1*100)+2,3,-1150.548,2194.858,120.9303,'Honor Hold Gryphon Brigadier, South Path 3 WP 3'), +((@ENTRY1*100)+2,4,-1151.814,2161.048,110.9858,'Honor Hold Gryphon Brigadier, South Path 3 WP 4'), +((@ENTRY1*100)+2,5,-1152.937,2131.728,105.9581,'Honor Hold Gryphon Brigadier, South Path 3 WP 5'), +((@ENTRY1*100)+2,6,-1151.148,2107.598,99.458,'Honor Hold Gryphon Brigadier, South Path 3 WP 6'), +((@ENTRY1*100)+2,7,-1165.406,2089.037,115.6802,'Honor Hold Gryphon Brigadier, South Path 3 WP 7'), +((@ENTRY1*100)+2,8,-1174.068,2083.782,125.0691,'Honor Hold Gryphon Brigadier, South Path 3 WP 8'), +((@ENTRY1*100)+2,9,-1205.327,2083.083,164.097,'Honor Hold Gryphon Brigadier, South Path 3 WP 9'), +((@ENTRY1*100)+2,10,-1232.793,2084.872,183.4025,'Honor Hold Gryphon Brigadier, South Path 3 WP 10'), +((@ENTRY1*100)+2,11,-1264.571,2093.127,197.5136,'Honor Hold Gryphon Brigadier, South Path 3 WP 11'), +-- Honor Hold Gryphon Brigadier, South Path 4 +((@ENTRY1*100)+3,1,-1166.146,2232.443,154.4811,'Honor Hold Gryphon Brigadier, South Path 4 WP 1'), +((@ENTRY1*100)+3,2,-1166.439,2233.399,154.4811,'Honor Hold Gryphon Brigadier, South Path 4 WP 2'), +((@ENTRY1*100)+3,3,-1152.79,2211.288,120.9303,'Honor Hold Gryphon Brigadier, South Path 4 WP 3'), +((@ENTRY1*100)+3,4,-1146.584,2178.448,110.9858,'Honor Hold Gryphon Brigadier, South Path 4 WP 4'), +((@ENTRY1*100)+3,5,-1155.939,2146.783,105.9581,'Honor Hold Gryphon Brigadier, South Path 4 WP 5'), +((@ENTRY1*100)+3,6,-1151.148,2107.598,99.68026,'Honor Hold Gryphon Brigadier, South Path 4 WP 6'), +((@ENTRY1*100)+3,7,-1142.785,2094.159,103.5414,'Honor Hold Gryphon Brigadier, South Path 4 WP 7'), +((@ENTRY1*100)+3,8,-1136.896,2085.377,109.1246,'Honor Hold Gryphon Brigadier, South Path 4 WP 8'), +((@ENTRY1*100)+3,9,-1119.036,2071.976,118.8748,'Honor Hold Gryphon Brigadier, South Path 4 WP 9'), +((@ENTRY1*100)+3,10,-1103.594,2050.397,128.2081,'Honor Hold Gryphon Brigadier, South Path 4 WP 10'), +((@ENTRY1*100)+3,11,-1080.568,2022.377,137.5138,'Honor Hold Gryphon Brigadier, South Path 4 WP 11'); + +-- Honor Hold Gryphon Brigadier, North Pathing +DELETE FROM `waypoints` WHERE `entry` IN (@ENTRY2*100, (@ENTRY2*100)+1, (@ENTRY2*100)+2, (@ENTRY2*100)+3); +INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES +-- Honor Hold Gryphon Brigadier, North Path 1 +(@ENTRY2*100,1,-739.3298,1922.589,100.9578,'Honor Hold Gryphon Brigadier, North Path 1 WP'), +(@ENTRY2*100,2,-738.3353,1922.693,100.9578,'Honor Hold Gryphon Brigadier, North Path 1 WP'), +(@ENTRY2*100,3,-750.1168,1929.094,99.47905,'Honor Hold Gryphon Brigadier, North Path 1 WP'), +(@ENTRY2*100,4,-774.873,1952.79,99.47905,'Honor Hold Gryphon Brigadier, North Path 1 WP'), +(@ENTRY2*100,5,-786.8572,1972.59,99.47905,'Honor Hold Gryphon Brigadier, North Path 1 WP'), +(@ENTRY2*100,6,-799.9429,2000.454,78.95126,'Honor Hold Gryphon Brigadier, North Path 1 WP'), +(@ENTRY2*100,7,-806.1043,2017.675,73.36794,'Honor Hold Gryphon Brigadier, North Path 1 WP'), +(@ENTRY2*100,8,-819.2725,2032.523,73.17354,'Honor Hold Gryphon Brigadier, North Path 1 WP'), +(@ENTRY2*100,9,-831.7571,2046.865,80.61793,'Honor Hold Gryphon Brigadier, North Path 1 WP'), +(@ENTRY2*100,10,-844.0977,2058.49,83.64579,'Honor Hold Gryphon Brigadier, North Path 1 WP'), +(@ENTRY2*100,11,-859.0389,2080.072,95.78463,'Honor Hold Gryphon Brigadier, North Path 1 WP'), +(@ENTRY2*100,12,-883.3383,2095.611,107.5624,'Honor Hold Gryphon Brigadier, North Path 1 WP'), +-- Honor Hold Gryphon Brigadier, North Path 2 +((@ENTRY2*100)+1,1,-739.3298,1922.589,100.9578,'Honor Hold Gryphon Brigadier, North Path 2 WP'), +((@ENTRY2*100)+1,2,-738.3353,1922.693,100.9578,'Honor Hold Gryphon Brigadier, North Path 2 WP'), +((@ENTRY2*100)+1,3,-750.1168,1929.094,99.47905,'Honor Hold Gryphon Brigadier, North Path 2 WP'), +((@ENTRY2*100)+1,4,-773.3017,1941.179,99.47905,'Honor Hold Gryphon Brigadier, North Path 2 WP'), +((@ENTRY2*100)+1,5,-792.3573,1953.981,99.47905,'Honor Hold Gryphon Brigadier, North Path 2 WP'), +((@ENTRY2*100)+1,6,-812.7388,1993.078,78.95126,'Honor Hold Gryphon Brigadier, North Path 2 WP'), +((@ENTRY2*100)+1,7,-823.2512,2008.549,73.36794,'Honor Hold Gryphon Brigadier, North Path 2 WP'), +((@ENTRY2*100)+1,8,-823.4645,2030.833,73.17354,'Honor Hold Gryphon Brigadier, North Path 2 WP'), +((@ENTRY2*100)+1,9,-812.5039,2051.152,80.61793,'Honor Hold Gryphon Brigadier, North Path 2 WP'), +((@ENTRY2*100)+1,10,-775.5078,2066.004,83.64579,'Honor Hold Gryphon Brigadier, North Path 2 WP'), +((@ENTRY2*100)+1,11,-728.4387,2072.975,87.72904,'Honor Hold Gryphon Brigadier, North Path 2 WP'), +-- Honor Hold Gryphon Brigadier, North Path 3 +((@ENTRY2*100)+2,1,-739.3298,1922.589,100.9578,'Honor Hold Gryphon Brigadier, North Path 3 WP'), +((@ENTRY2*100)+2,2,-738.3353,1922.693,100.9578,'Honor Hold Gryphon Brigadier, North Path 3 WP'), +((@ENTRY2*100)+2,3,-750.1168,1929.094,99.47905,'Honor Hold Gryphon Brigadier, North Path 3 WP'), +((@ENTRY2*100)+2,4,-773.3017,1941.179,99.47905,'Honor Hold Gryphon Brigadier, North Path 3 WP'), +((@ENTRY2*100)+2,5,-798.551,1950.061,99.47905,'Honor Hold Gryphon Brigadier, North Path 3 WP'), +((@ENTRY2*100)+2,6,-822.979,1966.302,78.95126,'Honor Hold Gryphon Brigadier, North Path 3 WP'), +((@ENTRY2*100)+2,7,-829.1212,1999.823,73.36794,'Honor Hold Gryphon Brigadier, North Path 3 WP'), +((@ENTRY2*100)+2,8,-823.4645,2030.833,73.17354,'Honor Hold Gryphon Brigadier, North Path 3 WP'), +((@ENTRY2*100)+2,9,-822.0243,2049.509,80.61793,'Honor Hold Gryphon Brigadier, North Path 3 WP'), +((@ENTRY2*100)+2,10,-838.6264,2088.113,83.64579,'Honor Hold Gryphon Brigadier, North Path 3 WP'), +((@ENTRY2*100)+2,11,-857.7249,2123.352,87.72904,'Honor Hold Gryphon Brigadier, North Path 3 WP'), +((@ENTRY2*100)+2,12,-856.7349,2157.759,99.95123,'Honor Hold Gryphon Brigadier, North Path 3 WP'), +-- Honor Hold Gryphon Brigadier, North Path 4 +((@ENTRY2*100)+3,1,-739.3298,1922.589,100.9578,'Honor Hold Gryphon Brigadier, North Path 4 WP'), +((@ENTRY2*100)+3,2,-738.3353,1922.693,100.9578,'Honor Hold Gryphon Brigadier, North Path 4 WP'), +((@ENTRY2*100)+3,3,-750.1168,1929.094,99.47905,'Honor Hold Gryphon Brigadier, North Path 4 WP'), +((@ENTRY2*100)+3,4,-773.3017,1941.179,99.47905,'Honor Hold Gryphon Brigadier, North Path 4 WP'), +((@ENTRY2*100)+3,5,-792.3573,1953.981,99.47905,'Honor Hold Gryphon Brigadier, North Path 4 WP'), +((@ENTRY2*100)+3,6,-812.7388,1993.078,78.95126,'Honor Hold Gryphon Brigadier, North Path 4 WP'), +((@ENTRY2*100)+3,7,-823.2512,2008.549,73.36794,'Honor Hold Gryphon Brigadier, North Path 4 WP'), +((@ENTRY2*100)+3,8,-823.4645,2030.833,73.17354,'Honor Hold Gryphon Brigadier, North Path 4 WP'), +((@ENTRY2*100)+3,9,-812.5039,2051.152,80.61793,'Honor Hold Gryphon Brigadier, North Path 4 WP'), +((@ENTRY2*100)+3,10,-838.6264,2088.113,83.64579,'Honor Hold Gryphon Brigadier, North Path 4 WP'), +((@ENTRY2*100)+3,11,-857.7249,2123.352,87.72904,'Honor Hold Gryphon Brigadier, North Path 4 WP'), +((@ENTRY2*100)+3,12,-891.1043,2149.23,87.72904,'Honor Hold Gryphon Brigadier, North Path 4 WP'); + +-- Honor Hold Gryphon Brigadier, Forge Pathing +DELETE FROM `waypoints` WHERE `entry` IN (@ENTRY3*100, (@ENTRY3*100)+1, (@ENTRY3*100)+2, (@ENTRY3*100)+3); +INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES +-- Honor Hold Gryphon Brigadier, Forge Path 1 +(@ENTRY3*100,1,-739.3298,1922.589,100.9578,'Honor Hold Gryphon Brigadier, Forge Path 1 WP'), +(@ENTRY3*100,2,-738.3353,1922.693,100.9578,'Honor Hold Gryphon Brigadier, Forge Path 1 WP'), +(@ENTRY3*100,3,-750.1168,1929.094,99.47905,'Honor Hold Gryphon Brigadier, Forge Path 1 WP'), +(@ENTRY3*100,4,-779.0291,1934.054,99.47905,'Honor Hold Gryphon Brigadier, Forge Path 1 WP'), +(@ENTRY3*100,5,-805.9227,1932.241,104.2291,'Honor Hold Gryphon Brigadier, Forge Path 1 WP'), +(@ENTRY3*100,6,-837.3495,1926.666,101.0902,'Honor Hold Gryphon Brigadier, Forge Path 1 WP'), +(@ENTRY3*100,7,-862.7343,1923.357,97.618,'Honor Hold Gryphon Brigadier, Forge Path 1 WP'), +(@ENTRY3*100,8,-897.9168,1921.757,99.59021,'Honor Hold Gryphon Brigadier, Forge Path 1 WP'), +(@ENTRY3*100,9,-914.8586,1930.438,97.67357,'Honor Hold Gryphon Brigadier, Forge Path 1 WP'), +(@ENTRY3*100,10,-932.5103,1940.806,109.0624,'Honor Hold Gryphon Brigadier, Forge Path 1 WP'), +(@ENTRY3*100,11,-945.1282,1950.602,122.7846,'Honor Hold Gryphon Brigadier, Forge Path 1 WP'), +(@ENTRY3*100,12,-966.2561,1954.868,135.8124,'Honor Hold Gryphon Brigadier, Forge Path 1 WP'), +(@ENTRY3*100,13,-993.241,1956.073,157.4512,'Honor Hold Gryphon Brigadier, Forge Path 1 WP'), +-- Honor Hold Gryphon Brigadier, Forge Path 2 +((@ENTRY3*100)+1,1,-739.3298,1922.589,100.9578,'Honor Hold Gryphon Brigadier, Forge Path 2 WP'), +((@ENTRY3*100)+1,2,-738.3353,1922.693,100.9578,'Honor Hold Gryphon Brigadier, Forge Path 2 WP'), +((@ENTRY3*100)+1,3,-750.1168,1929.094,99.47905,'Honor Hold Gryphon Brigadier, Forge Path 2 WP'), +((@ENTRY3*100)+1,4,-780.6625,1927.177,99.47905,'Honor Hold Gryphon Brigadier, Forge Path 2 WP'), +((@ENTRY3*100)+1,5,-811.2864,1921.429,104.2291,'Honor Hold Gryphon Brigadier, Forge Path 2 WP'), +((@ENTRY3*100)+1,6,-834.9781,1920.712,101.0902,'Honor Hold Gryphon Brigadier, Forge Path 2 WP'), +((@ENTRY3*100)+1,7,-866.0516,1916.696,97.618,'Honor Hold Gryphon Brigadier, Forge Path 2 WP'), +((@ENTRY3*100)+1,8,-895.7596,1922.273,99.59021,'Honor Hold Gryphon Brigadier, Forge Path 2 WP'), +((@ENTRY3*100)+1,9,-923.1928,1916.771,97.67357,'Honor Hold Gryphon Brigadier, Forge Path 2 WP'), +((@ENTRY3*100)+1,10,-948.4045,1901.38,98.9791,'Honor Hold Gryphon Brigadier, Forge Path 2 WP'), +((@ENTRY3*100)+1,11,-966.732,1893.369,110.0068,'Honor Hold Gryphon Brigadier, Forge Path 2 WP'), +((@ENTRY3*100)+1,12,-989.9695,1893.078,135.8124,'Honor Hold Gryphon Brigadier, Forge Path 2 WP'), +((@ENTRY3*100)+1,13,-1025.913,1875.034,164.979,'Honor Hold Gryphon Brigadier, Forge Path 2 WP'), +-- Honor Hold Gryphon Brigadier, Forge Path 3 +((@ENTRY3*100)+2,1,-739.3298,1922.589,100.9578,'Honor Hold Gryphon Brigadier, Forge Path 3 WP'), +((@ENTRY3*100)+2,2,-738.3353,1922.693,100.9578,'Honor Hold Gryphon Brigadier, Forge Path 3 WP'), +((@ENTRY3*100)+2,3,-750.1168,1929.094,99.47905,'Honor Hold Gryphon Brigadier, Forge Path 3 WP'), +((@ENTRY3*100)+2,4,-773.3017,1941.179,99.47905,'Honor Hold Gryphon Brigadier, Forge Path 3 WP'), +((@ENTRY3*100)+2,5,-799.0213,1938.265,104.2291,'Honor Hold Gryphon Brigadier, Forge Path 3 WP'), +((@ENTRY3*100)+2,6,-821.9453,1929.91,101.0902,'Honor Hold Gryphon Brigadier, Forge Path 3 WP'), +((@ENTRY3*100)+2,7,-847.0975,1925.127,97.618,'Honor Hold Gryphon Brigadier, Forge Path 3 WP'), +((@ENTRY3*100)+2,8,-884.1627,1919.391,99.59021,'Honor Hold Gryphon Brigadier, Forge Path 3 WP'), +((@ENTRY3*100)+2,9,-910.0975,1918.052,97.67357,'Honor Hold Gryphon Brigadier, Forge Path 3 WP'), +((@ENTRY3*100)+2,10,-931.7395,1901.312,98.9791,'Honor Hold Gryphon Brigadier, Forge Path 3 WP'), +((@ENTRY3*100)+2,11,-938.8629,1883.565,110.0068,'Honor Hold Gryphon Brigadier, Forge Path 3 WP'), +((@ENTRY3*100)+2,12,-948.2704,1857.24,135.8124,'Honor Hold Gryphon Brigadier, Forge Path 3 WP'), +-- Honor Hold Gryphon Brigadier, Forge Path 4 +((@ENTRY3*100)+3,1,-739.3298,1922.589,100.9578,'Honor Hold Gryphon Brigadier, Forge Path 4 WP'), +((@ENTRY3*100)+3,2,-738.3353,1922.693,100.9578,'Honor Hold Gryphon Brigadier, Forge Path 4 WP'), +((@ENTRY3*100)+3,3,-750.1168,1929.094,99.47905,'Honor Hold Gryphon Brigadier, Forge Path 4 WP'), +((@ENTRY3*100)+3,4,-773.3017,1941.179,99.47905,'Honor Hold Gryphon Brigadier, Forge Path 4 WP'), +((@ENTRY3*100)+3,5,-799.0213,1938.265,104.2291,'Honor Hold Gryphon Brigadier, Forge Path 4 WP'), +((@ENTRY3*100)+3,6,-821.9453,1929.91,101.0902,'Honor Hold Gryphon Brigadier, Forge Path 4 WP'), +((@ENTRY3*100)+3,7,-847.0975,1925.127,97.618,'Honor Hold Gryphon Brigadier, Forge Path 4 WP'), +((@ENTRY3*100)+3,8,-884.1627,1919.391,99.59021,'Honor Hold Gryphon Brigadier, Forge Path 4 WP'), +((@ENTRY3*100)+3,9,-898.5378,1920.82,97.67357,'Honor Hold Gryphon Brigadier, Forge Path 4 WP'), +((@ENTRY3*100)+3,10,-909.0667,1943.895,98.9791,'Honor Hold Gryphon Brigadier, Forge Path 4 WP'), +((@ENTRY3*100)+3,11,-882.7237,1983.156,110.0068,'Honor Hold Gryphon Brigadier, Forge Path 4 WP'), +((@ENTRY3*100)+3,12,-857.6995,1997.67,135.8124,'Honor Hold Gryphon Brigadier, Forge Path 4 WP'), +((@ENTRY3*100)+3,13,-834.7382,1999.236,151.1734,'Honor Hold Gryphon Brigadier, Forge Path 4 WP'), +((@ENTRY3*100)+3,14,-797.808,1990.238,154.7012,'Honor Hold Gryphon Brigadier, Forge Path 4 WP'); + +-- Honor Hold Gryphon Brigadier, Foothill Pathing +DELETE FROM `waypoints` WHERE `entry` IN (@ENTRY4*100, (@ENTRY4*100)+1, (@ENTRY4*100)+2); +INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES +-- Honor Hold Gryphon Brigadier, Foothill Path 1 +(@ENTRY4*100,1,-739.3298,1922.589,100.9578,'Honor Hold Gryphon Brigadier, Foothill Path 1 WP 1'), +(@ENTRY4*100,2,-738.3353,1922.693,100.9578,'Honor Hold Gryphon Brigadier, Foothill Path 1 WP 2'), +(@ENTRY4*100,3,-750.1168,1929.094,115.7846,'Honor Hold Gryphon Brigadier, Foothill Path 1 WP 3'), +(@ENTRY4*100,4,-780.6038,1912.869,111.4513,'Honor Hold Gryphon Brigadier, Foothill Path 1 WP 4'), +(@ENTRY4*100,5,-812.3557,1903.761,119.8957,'Honor Hold Gryphon Brigadier, Foothill Path 1 WP 5'), +(@ENTRY4*100,6,-844.3373,1894.094,121.1179,'Honor Hold Gryphon Brigadier, Foothill Path 1 WP 6'), +(@ENTRY4*100,7,-875.8698,1888.307,134.0069,'Honor Hold Gryphon Brigadier, Foothill Path 1 WP 7'), +(@ENTRY4*100,8,-908.7481,1889.962,139.368,'Honor Hold Gryphon Brigadier, Foothill Path 1 WP 8'), +(@ENTRY4*100,9,-936.4296,1891.453,135.5625,'Honor Hold Gryphon Brigadier, Foothill Path 1 WP 9'), +(@ENTRY4*100,10,-956.9449,1888.206,129.8402,'Honor Hold Gryphon Brigadier, Foothill Path 1 WP 10'), +(@ENTRY4*100,11,-976.4232,1879.735,128.3126,'Honor Hold Gryphon Brigadier, Foothill Path 1 WP 11'), +(@ENTRY4*100,12,-999.7429,1861.678,156.9511,'Honor Hold Gryphon Brigadier, Foothill Path 1 WP 12'), +(@ENTRY4*100,13,-1019.369,1838.22,181.4233,'Honor Hold Gryphon Brigadier, Foothill Path 1 WP 13'), +(@ENTRY4*100,14,-1015.93,1818.592,198.4232,'Honor Hold Gryphon Brigadier, Foothill Path 1 WP 14'), +(@ENTRY4*100,15,-1003.392,1791.963,211.84,'Honor Hold Gryphon Brigadier, Foothill Path 1 WP 15'), +-- Honor Hold Gryphon Brigadier, Foothill Path 2 +((@ENTRY4*100)+1,1,-739.3298,1922.589,100.9578,'Honor Hold Gryphon Brigadier, Foothill Path 2 WP 1'), +((@ENTRY4*100)+1,2,-738.3353,1922.693,100.9578,'Honor Hold Gryphon Brigadier, Foothill Path 2 WP 2'), +((@ENTRY4*100)+1,3,-750.1168,1929.094,115.7846,'Honor Hold Gryphon Brigadier, Foothill Path 2 WP 3'), +((@ENTRY4*100)+1,4,-780.6038,1912.869,111.4513,'Honor Hold Gryphon Brigadier, Foothill Path 2 WP 4'), +((@ENTRY4*100)+1,5,-812.3557,1903.761,119.8957,'Honor Hold Gryphon Brigadier, Foothill Path 2 WP 5'), +((@ENTRY4*100)+1,6,-844.3373,1894.094,121.1179,'Honor Hold Gryphon Brigadier, Foothill Path 2 WP 6'), +((@ENTRY4*100)+1,7,-875.8698,1888.307,134.0069,'Honor Hold Gryphon Brigadier, Foothill Path 2 WP 7'), +((@ENTRY4*100)+1,8,-905.6191,1885.849,139.368,'Honor Hold Gryphon Brigadier, Foothill Path 2 WP 8'), +((@ENTRY4*100)+1,9,-933.7491,1881.107,135.5625,'Honor Hold Gryphon Brigadier, Foothill Path 2 WP 9'), +((@ENTRY4*100)+1,10,-957.0587,1876.275,129.8402,'Honor Hold Gryphon Brigadier, Foothill Path 2 WP 10'), +((@ENTRY4*100)+1,11,-976.4232,1879.735,128.3126,'Honor Hold Gryphon Brigadier, Foothill Path 2 WP 11'), +((@ENTRY4*100)+1,12,-1001.597,1896.851,136.0901,'Honor Hold Gryphon Brigadier, Foothill Path 2 WP 12'), +((@ENTRY4*100)+1,13,-1026.942,1912.217,153.8956,'Honor Hold Gryphon Brigadier, Foothill Path 2 WP 13'), +((@ENTRY4*100)+1,14,-1046.058,1925.075,168.2844,'Honor Hold Gryphon Brigadier, Foothill Path 2 WP 14'), +((@ENTRY4*100)+1,15,-1065.902,1940.892,183.0622,'Honor Hold Gryphon Brigadier, Foothill Path 2 WP 15'), +-- Honor Hold Gryphon Brigadier, Foothill Path 3 +((@ENTRY4*100)+2,1,-739.3298,1922.589,100.9578,'Honor Hold Gryphon Brigadier, Foothill Path 3 WP 1'), +((@ENTRY4*100)+2,2,-738.3353,1922.693,100.9578,'Honor Hold Gryphon Brigadier, Foothill Path 3 WP 2'), +((@ENTRY4*100)+2,3,-750.1168,1929.094,115.7846,'Honor Hold Gryphon Brigadier, Foothill Path 3 WP 3'), +((@ENTRY4*100)+2,4,-780.6038,1912.869,111.4513,'Honor Hold Gryphon Brigadier, Foothill Path 3 WP 4'), +((@ENTRY4*100)+2,5,-812.3557,1903.761,119.8957,'Honor Hold Gryphon Brigadier, Foothill Path 3 WP 5'), +((@ENTRY4*100)+2,6,-852.6487,1887.492,134.7291,'Honor Hold Gryphon Brigadier, Foothill Path 3 WP 6'), +((@ENTRY4*100)+2,7,-885.8631,1878.916,144.8403,'Honor Hold Gryphon Brigadier, Foothill Path 3 WP 7'), +((@ENTRY4*100)+2,8,-910.2131,1876.215,149.118,'Honor Hold Gryphon Brigadier, Foothill Path 3 WP 8'), +((@ENTRY4*100)+2,9,-933.7659,1874.894,145.9792,'Honor Hold Gryphon Brigadier, Foothill Path 3 WP 9'), +((@ENTRY4*100)+2,10,-957.0587,1876.275,129.8402,'Honor Hold Gryphon Brigadier, Foothill Path 3 WP 10'), +((@ENTRY4*100)+2,11,-976.4232,1879.735,128.3126,'Honor Hold Gryphon Brigadier, Foothill Path 3 WP 11'), +((@ENTRY4*100)+2,12,-1003.331,1901.21,136.0901,'Honor Hold Gryphon Brigadier, Foothill Path 3 WP 12'), +((@ENTRY4*100)+2,13,-1019.146,1920.588,153.8956,'Honor Hold Gryphon Brigadier, Foothill Path 3 WP 13'), +((@ENTRY4*100)+2,14,-1035.73,1937.606,168.2844,'Honor Hold Gryphon Brigadier, Foothill Path 3 WP 14'), +((@ENTRY4*100)+2,15,-1055.794,1959.019,183.0622,'Honor Hold Gryphon Brigadier, Foothill Path 3 WP 15'); diff --git a/sql/updates/world/2011_03_25_00_world_creature_template.sql b/sql/updates/world/2011_03_25_00_world_creature_template.sql new file mode 100644 index 0000000000000..75b8c31885fd6 --- /dev/null +++ b/sql/updates/world/2011_03_25_00_world_creature_template.sql @@ -0,0 +1,2 @@ +UPDATE `creature_template` SET `InhabitType`=7 WHERE `flags_extra` & 128; -- Triggers floating +UPDATE `creature_template` SET `mechanic_immune_mask`=`mechanic_immune_mask`|16|8388608 WHERE `type`=6; -- Mobs undeads should be immune to fear and horror diff --git a/sql/updates/world/2011_03_25_01_world_gameobjects.sql b/sql/updates/world/2011_03_25_01_world_gameobjects.sql new file mode 100644 index 0000000000000..d2d9c0da5a232 --- /dev/null +++ b/sql/updates/world/2011_03_25_01_world_gameobjects.sql @@ -0,0 +1,7 @@ +-- Spawn Tribunal Chest in heroic HoS mode and correct wrong spawnmasks +SET @GUID = 151790; -- Set by TDB team (need 1) +UPDATE `gameobject` SET `spawnMask`=1 WHERE `guid`=65564; -- Tribunal Chest non heroic +DELETE FROM `gameobject` WHERE `id`=193996; +INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`)VALUES +(@GUID,193996,599,2,1,880.406,345.164,203.706,0,0,0,0,1,180,0,1); -- Tribunal Chest heroic +UPDATE `gameobject_template` SET `faction`=94, `flags`=4 /* should be 4 and nothing else (temp) */ WHERE `entry` IN (193996,190586); diff --git a/sql/updates/world/2011_03_25_02_world_creatures.sql b/sql/updates/world/2011_03_25_02_world_creatures.sql new file mode 100644 index 0000000000000..c6e3f98a9d76e --- /dev/null +++ b/sql/updates/world/2011_03_25_02_world_creatures.sql @@ -0,0 +1,11 @@ +-- Arcanimus should not have random movement +UPDATE `creature` SET `spawndist`=0,`MovementType`=0 WHERE `guid`=96298; +-- Fixup Big Electromental Flavor +UPDATE `creature` SET `modelid`=0,`spawndist`=0,`MovementType`=0 WHERE `id`=21757; +UPDATE `creature_template` SET `InhabitType`=7 WHERE `entry`=21757; +-- Remove Fizzcrank Airman missspawn +DELETE FROM `creature` WHERE `guid` IN (117923); +DELETE FROM `creature_addon` WHERE `guid` IN (117923); +-- Fixup South Sinkhole, Northeast Sinkhole, Northwest Sinkhole Set as trigger +UPDATE `creature` SET `modelid`=0 WHERE `id` IN (25664,25665,25666); +UPDATE `creature_template` SET `InhabitType`=7,`flags_extra`=`flags_extra`|128 WHERE `entry` IN (25664,25665,25666); diff --git a/sql/updates/world/2011_03_25_03_world_misc.sql b/sql/updates/world/2011_03_25_03_world_misc.sql new file mode 100644 index 0000000000000..03b34e06ace8c --- /dev/null +++ b/sql/updates/world/2011_03_25_03_world_misc.sql @@ -0,0 +1,47 @@ +-- Pathing for Ol' Sooty Entry: 1225 +SET @NPC := 8877; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=-5679.014160,`position_y`=-3185.046875,`position_z`=319.508057 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,-5716.181152,-3110.810791,316.686523,0,0,0,100,0), +(@PATH,2,-5716.187012,-3093.080078,325.600677,0,0,0,100,0), +(@PATH,3,-5712.214355,-3090.297607,327.738647,0,0,0,100,0), +(@PATH,4,-5705.484375,-3092.523438,329.362366,0,0,0,100,0), +(@PATH,5,-5681.826660,-3110.568848,338.121887,0,0,0,100,0), +(@PATH,6,-5659.498535,-3122.215576,344.336151,0,0,0,100,0), +(@PATH,7,-5639.585938,-3124.536133,348.404938,0,0,0,100,0), +(@PATH,8,-5618.112793,-3110.905762,360.618225,0,0,0,100,0), +(@PATH,9,-5621.486816,-3096.315918,368.247772,0,0,0,100,0), +(@PATH,10,-5632.212891,-3078.608398,374.990936,0,0,0,100,0), +(@PATH,11,-5629.793457,-3056.124023,384.465576,0,0,0,100,0), +(@PATH,12,-5642.278809,-3036.872314,385.471649,0,0,0,100,0), +(@PATH,13,-5609.369141,-3006.883301,386.288177,0,0,0,100,0), +(@PATH,14,-5643.634277,-3036.388672,385.531891,0,0,0,100,0), +(@PATH,15,-5630.174805,-3057.015869,384.385712,0,0,0,100,0), +(@PATH,16,-5629.840332,-3065.496338,381.129578,0,0,0,100,0), +(@PATH,17,-5634.866211,-3078.448975,374.489044,0,0,0,100,0), +(@PATH,18,-5620.416504,-3101.081543,364.819855,0,0,0,100,0), +(@PATH,19,-5624.629395,-3117.040527,354.493805,0,0,0,100,0), +(@PATH,20,-5644.949707,-3125.081787,347.271362,0,0,0,100,0), +(@PATH,21,-5660.741699,-3121.580566,343.975922,0,0,0,100,0), +(@PATH,22,-5676.210938,-3111.586914,340.021484,0,0,0,100,0), +(@PATH,23,-5691.895508,-3102.994385,333.646698,0,0,0,100,0), +(@PATH,24,-5711.662109,-3088.433594,328.761566,0,0,0,100,0), +(@PATH,25,-5717.663574,-3099.033691,321.686920,0,0,0,100,0), +(@PATH,26,-5705.214844,-3132.324219,315.837585,0,0,0,100,0), +(@PATH,27,-5679.014160,-3185.046875,319.508057,0,0,0,100,0); + +-- Thargold Ironwing SAI +SET @ENTRY := 29154; +SET @GOSSIP := 9776; +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,1,62,0,100,0,@GOSSIP,0,0,0,11,53335,1,0,0,0,0,7,0,0,0,0,0,0,0, 'Thargold Ironwing - On gossip option select - cast spell'), +(@ENTRY,0,1,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Thargold Ironwing - On gossip option select - close gossip'); +-- Cleanup gossip +UPDATE `gossip_menu_option` SET `action_script_id`=0 WHERE `menu_id`=@GOSSIP; +DELETE FROM `gossip_scripts` WHERE `id` IN (977600); diff --git a/sql/updates/world/2011_03_26_00_world_achievement_criteria_data.sql b/sql/updates/world/2011_03_26_00_world_achievement_criteria_data.sql new file mode 100644 index 0000000000000..ed92b7ea830eb --- /dev/null +++ b/sql/updates/world/2011_03_26_00_world_achievement_criteria_data.sql @@ -0,0 +1,29 @@ +DELETE FROM `achievement_criteria_data` WHERE `criteria_id` IN (10062,10063,10054,10055,10046,10047,10048,10049,10050,10051,10044,10045); +INSERT INTO `achievement_criteria_data` (`criteria_id`,`type`,`value1`,`value2`,`ScriptName`) VALUES +(10062,12,0,0, 'achievement_quick_shave'), +(10063,12,1,0, 'achievement_quick_shave'), +(10044,12,0,0, 'achievement_unbroken'), +(10045,12,1,0, 'achievement_unbroken'), +(10054,12,0,0, 'achievement_shutout'), +(10055,12,1,0, 'achievement_shutout'), +(10046,12,0,0, 'achievement_three_car_garage_chopper'), +(10047,12,0,0, 'achievement_three_car_garage_siege'), +(10048,12,0,0, 'achievement_three_car_garage_demolisher'), +(10049,12,1,0, 'achievement_three_car_garage_chopper'), +(10050,12,1,0, 'achievement_three_car_garage_siege'), +(10051,12,1,0, 'achievement_three_car_garage_demolisher'), +(10062,11,0,0, 'achievement_quick_shave'), +(10063,11,0,0, 'achievement_quick_shave'), +(10044,11,0,0, 'achievement_unbroken'), +(10045,11,0,0, 'achievement_unbroken'), +(10054,11,0,0, 'achievement_shutout'), +(10055,11,0,0, 'achievement_shutout'), +(10046,11,0,0, 'achievement_three_car_garage_chopper'), +(10047,11,0,0, 'achievement_three_car_garage_siege'), +(10048,11,0,0, 'achievement_three_car_garage_demolisher'), +(10049,11,0,0, 'achievement_three_car_garage_chopper'), +(10050,11,0,0, 'achievement_three_car_garage_siege'), +(10051,11,0,0, 'achievement_three_car_garage_demolisher'); + +-- Remove disabled entries +DELETE FROM `disables` WHERE `sourceType`=4 AND `entry` IN (10044,10045,10046,10047,10048,10049,10050,10051,10054,10055,10062,10063); diff --git a/sql/updates/world/2011_03_26_00_world_conditions.sql b/sql/updates/world/2011_03_26_00_world_conditions.sql new file mode 100644 index 0000000000000..f276a0f24b24a --- /dev/null +++ b/sql/updates/world/2011_03_26_00_world_conditions.sql @@ -0,0 +1,8 @@ +-- conditions for spells used by Malygos +DELETE FROM `conditions` WHERE `SourceGroup`=0 AND `SourceEntry` IN (56263,55853,56505,56429,56152) AND `ConditionTypeOrReference`=18; +INSERT INTO `conditions` (SourceTypeOrReferenceId,ConditionTypeOrReference,SourceGroup,SourceEntry,ConditionValue1,ConditionValue2) VALUES +(13,18,0,55853,1,30090), +(13,18,0,56263,1,30090), +(13,18,0,56505,1,30334), +(13,18,0,56429,1,30334), +(13,18,0,56152,1,28859); diff --git a/sql/updates/world/2011_03_26_00_world_creature_template.sql b/sql/updates/world/2011_03_26_00_world_creature_template.sql new file mode 100644 index 0000000000000..dd2a90833b143 --- /dev/null +++ b/sql/updates/world/2011_03_26_00_world_creature_template.sql @@ -0,0 +1,24 @@ +-- vortex trigger +UPDATE `creature_template` SET `modelid1`=11686,`modelid2`=169,`InhabitType`=5,`unit_flags`=0x02000000,`VehicleId`=214,`flags_extra`=130 WHERE `entry`=30090; +UPDATE `creature` SET `modelid`=0 WHERE `id`=30090; + +-- Portal (Malygos) +UPDATE `creature_template` SET `InhabitType`=5 WHERE `entry`=30118; +UPDATE `creature_template` SET `speed_walk`=2.4,`speed_run`=0.857142857 WHERE `entry`=30084; + +-- Hover Disk +UPDATE `creature_template` SET `VehicleId`=224,`faction_A`=35,`faction_H`=35,`InhabitType`=5 WHERE `entry` IN (30234,30248); + +-- Surge of Power +UPDATE `creature_template` SET flags_extra=130 WHERE entry=30334; + +-- Wyrmrest Skytalon (Player's Mount) +UPDATE `creature_template` SET `InhabitType`=5 WHERE `entry`=30161; + +-- Alexstrasza the Life-Binder +UPDATE `creature_template` SET `InhabitType`=5 WHERE `entry`=32295; + +-- static Field +UPDATE `creature_template` SET `flags_extra`=130,`InhabitType`=5 WHERE `entry`=30592; + +UPDATE `creature_template` SET `VehicleId`=220,`spell1`=56091,`spell2`=56092,`spell3`=57090,`spell4`=57143,`spell5`=57108,`spell6`=57092,`spell7`=60534 WHERE `entry`=30161; \ No newline at end of file diff --git a/sql/updates/world/2011_03_26_00_world_creature_template_addon.sql b/sql/updates/world/2011_03_26_00_world_creature_template_addon.sql new file mode 100644 index 0000000000000..79a24670a8dbd --- /dev/null +++ b/sql/updates/world/2011_03_26_00_world_creature_template_addon.sql @@ -0,0 +1,2 @@ +DELETE FROM `creature_template_addon` WHERE `entry`=30592; +INSERT INTO `creature_template_addon` (entry,auras) VALUES (30592,'57428 0'); \ No newline at end of file diff --git a/sql/updates/world/2011_03_26_00_world_creature_text.sql b/sql/updates/world/2011_03_26_00_world_creature_text.sql new file mode 100644 index 0000000000000..d2adbec16a244 --- /dev/null +++ b/sql/updates/world/2011_03_26_00_world_creature_text.sql @@ -0,0 +1,30 @@ + +DELETE FROM `creature_text` WHERE `entry` IN (32295,28859); +INSERT INTO `creature_text` (entry,groupid,id,text,type,language,sound,comment) VALUE +(28859,0,0,'My patience has reached its limit, I will be rid of you!',1,0,14517,'Malygos - Aggro (Phase 1)'), +(28859,1,0,'Your stupidity has finally caught up to you',1,0,14519,'Malygos - Killed Player (1) (Phase 1)'), +(28859,1,1,'More artifacts to confiscate...',1,0,14520,'Malygos - Killed Player (2) (Phase 1)'), +(28859,1,2,' How very... naive...',1,0,14521,'Malygos - Killed Player (3) (Phase 1)'), +(28859,2,0,'I had hoped to end your lives quickly, but you have proven more... resilient then I had anticipated. Nonetheless, your efforts are in vain, it is you reckless, careless mortals who are to blame for this war! I do what I must... And if it means your... extinction... THEN SO BE IT',1,0,14522,'Malygos - End Phase One'), +(28859,3,0,'Few have experienced the pain I will now inflict upon you!',1,0,14523,'Malygos - Aggro (Phase 2)'), +(28859,4,0,'I will teach you IGNORANT children just how little you know of magic...',1,0,14524,'Malygos - Anti-Magic Shell'), +(28859,5,0,'Watch helplessly as your hopes are swept away...',1,0,14525,'Malygos - Magic Blast'), +(28859,6,0,'Your energy will be put to good use!',1,0,14526,'Malygos - Killed Player 1 (Phase 2)'), +(28859,6,1,'I am the spell-weaver! My power is infinite!',1,0,14527,'Malygos - Killed Player 2 (Phase 2)'), +(28859,6,2,'Your spirit will linger here forever!',1,0,14528,'Malygos - Killed Player 3 (Phase 2)'), +(28859,7,0,'ENOUGH! If you intend to reclaim Azeroth''s magic, then you shall have it...',1,0,14529,'Malygos - End Phase 2'), +(28859,8,0,'Now your benefactors make their appearance... But they are too late. The powers contained here are sufficient to destroy the world ten times over! What do you think they will do to you?',1,0,14530,'Intro Phase 3'), +(28859,9,0,'SUBMIT!',1,0,14531,'Malygos - Aggro (Phase 3)'), +(28859,10,0,'The powers at work here exceed anything you could possibly imagine!',1,0,14532,'Malygos - Surge of Power'), +(28859,11,0,'I AM UNSTOPPABLE!',1,0,14533,'Malygos - Buffed by a spark'), +(28859,12,0,'Alexstrasza! Another of your brood falls!',1,0,14534,'Malygos - Killed Player 1 (Phase 3)'), +(28859,12,1,'Little more then gnats!',1,0,14535,'Malygos - Killed Player 2 (Phase 3)'), +(28859,12,2,'Your red allies will share your fate...',1,0,14536,'Malygos - Killed Player 3 (Phase 3)'), +(28859,13,0,'Still standing? Not for long...',1,0,14537,'Malygos - Spell Casting 1(Phase 3)'), +(28859,13,1,'Your cause is lost',1,0,14538,'Malygos - Spell Casting 2 (Phase 3)'), +(28859,13,2,'Your fragile mind will be shattered!',1,0,14539,'Malygos - Spell Casting 3 (Phase 3)'), +(28859,14,0,'Unthinkable! The mortals will destroy... everything... my sister... what have you...',1,0,0,'Malygos - Death'), +(32295,0,0,'I did what I had to, brother. You gave me no alternative.',1,0,0,'Alexstrasza - Yell One'), +(32295,1,0,'And so ends the Nexus War.',1,0,0,'Alexstrasza - Yell Two'), +(32295,2,0,'This resolution pains me deeply, but the destruction, the monumental loss of life had to end. Regardless of Malygos'' recent transgressions, I will mourn his loss. He was once a guardian, a protector. This day, one of the world''s mightiest has fallen.',1,0,0,'Alexstrasza - Yell Three'), +(32295,3,0,'The red dragonflight will take on the burden of mending the devastation wrought on Azeroth. Return home to your people and rest. Tomorrow will bring you new challenges, and you must be ready to face them. Life... goes on.',1,0,0,'Alexstrasza - Yell Four'); diff --git a/sql/updates/world/2011_03_26_00_world_gameobject.sql b/sql/updates/world/2011_03_26_00_world_gameobject.sql new file mode 100644 index 0000000000000..1d587b199a8ab --- /dev/null +++ b/sql/updates/world/2011_03_26_00_world_gameobject.sql @@ -0,0 +1,9 @@ +-- Spawning Focusing Iris +DELETE FROM `gameobject` WHERE `id`=193958; +INSERT INTO `gameobject` (guid,id,map,spawnMask,phaseMask,position_x,position_y,position_z,orientation,rotation0,rotation1,rotation2,rotation3,spawntimesecs,animprogress,state) VALUES +(151791,193958,616,1,1,754.2546,1301.71973,266.170319,-1.60570168,0,0,0,0,120,0,1); +-- Spawning chests +DELETE FROM `gameobject` WHERE `id` IN (193967,193905); +INSERT INTO `gameobject` (guid,id,map,spawnMask,phaseMask,position_x,position_y,position_z,orientation,spawntimesecs,animprogress,state) VALUES +(151792,193905,616,1,1,764.56,1284.63,269,1.82,-604800,100,1), +(151793,193967,616,2,1,764.56,1284.63,269,1.82,-604800,100,1); \ No newline at end of file diff --git a/sql/updates/world/2011_03_26_00_world_npc_spellclick_spells.sql b/sql/updates/world/2011_03_26_00_world_npc_spellclick_spells.sql new file mode 100644 index 0000000000000..61ace8c08774a --- /dev/null +++ b/sql/updates/world/2011_03_26_00_world_npc_spellclick_spells.sql @@ -0,0 +1,5 @@ +-- Hover Disk +DELETE FROM `npc_spellclick_spells` WHERE `npc_entry` IN (30248,30234); +INSERT INTO `npc_spellclick_spells` (npc_entry,spell_id,quest_start,quest_end,cast_flags) VALUES +(30234,61421,0,0,0), +(30248,61421,0,0,0); diff --git a/sql/updates/world/2011_03_26_00_world_scriptname.sql b/sql/updates/world/2011_03_26_00_world_scriptname.sql new file mode 100644 index 0000000000000..c849a870155f8 --- /dev/null +++ b/sql/updates/world/2011_03_26_00_world_scriptname.sql @@ -0,0 +1,15 @@ +DELETE FROM `instance_template` WHERE `map`=616; +INSERT INTO `instance_template` (map,parent,script) VALUES (616,571,'instance_eye_of_eternity'); + +UPDATE `creature_template` SET `ScriptName`='boss_malygos' WHERE `entry`=28859; +UPDATE `creature_template` SET `ScriptName`='npc_power_spark' WHERE `entry`=30084; +UPDATE `creature_template` SET `ScriptName`='npc_portal_eoe' WHERE `entry`=30118; +UPDATE `creature_template` SET `ScriptName`='npc_hover_disk' WHERE `entry` IN (30234,30248); +UPDATE `creature_template` SET `ScriptName`='npc_arcane_overload' WHERE `entry`=30282; +UPDATE `creature_template` SET `ScriptName`='npc_wyrmrest_skytalon' WHERE `entry`=30161; +UPDATE `creature_template` SET `ScriptName`='npc_alexstrasza_eoe' WHERE `entry`=32295; + +DELETE FROM `spell_script_names` WHERE `spell_id`=56105; +INSERT INTO `spell_script_names` VALUES (56105,'spell_malygos_vortex_dummy'); +DELETE FROM `spell_script_names` WHERE `spell_id`=55873; +INSERT INTO `spell_script_names` VALUES (55873,'spell_malygos_vortex_visual'); \ No newline at end of file diff --git a/sql/updates/world/2011_03_26_00_world_smart_scripts.sql b/sql/updates/world/2011_03_26_00_world_smart_scripts.sql new file mode 100644 index 0000000000000..3f5431cd39a6d --- /dev/null +++ b/sql/updates/world/2011_03_26_00_world_smart_scripts.sql @@ -0,0 +1,11 @@ +-- Scripts for Nexus Lord and Scion of Eternity +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` IN (30249,30245); +DELETE FROM `smart_scripts` WHERE (`entryorguid`=30249 AND `source_type`=0); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(30249, 0, 0, 0, 0, 0, 100, 6, 3000, 5000, 4000, 6000, 11, 56397, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 'Scion of Eternity - Cast Arcane Barrage (Random)'), +(30249, 0, 1, 0, 7, 0, 100, 6, 1, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Scion of Eternity - Despawn in EvadeMode'); +DELETE FROM `smart_scripts` WHERE (`entryorguid`=30245 AND `source_type`=0); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(30245, 0, 0, 0, 0, 0, 100, 6, 7000, 10000, 10000, 15000, 11, 57060, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Nexus Lord - Cast Haste (Self)'), +(30245, 0, 1, 0, 0, 0, 100, 6, 5000, 8000, 9000, 12000, 11, 57058, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Nexus Lord - Cast Arcane Shock (Random)'), +(30245, 0, 2, 0, 7, 0, 100, 6, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Nexus Lord - Despawn in EvadeMode'); diff --git a/sql/updates/world/2011_03_26_00_world_vehicle_template_accessory.sql b/sql/updates/world/2011_03_26_00_world_vehicle_template_accessory.sql new file mode 100644 index 0000000000000..a5b0963181abe --- /dev/null +++ b/sql/updates/world/2011_03_26_00_world_vehicle_template_accessory.sql @@ -0,0 +1,5 @@ +-- Hover Disk +DELETE FROM `vehicle_template_accessory` WHERE `entry` IN (30234,30248); +INSERT INTO `vehicle_template_accessory` (entry,accessory_entry,seat_id,minion,description) VALUES +(30234,30245,0,0,'Hover Disk - Nexus Lord'), +(30248,30249,0,0,'Hover Disk - Scion of Eternity'); \ No newline at end of file diff --git a/sql/updates/world/2011_03_26_01_world_achievement_criteria_data.sql b/sql/updates/world/2011_03_26_01_world_achievement_criteria_data.sql new file mode 100644 index 0000000000000..0f1d5083f1414 --- /dev/null +++ b/sql/updates/world/2011_03_26_01_world_achievement_criteria_data.sql @@ -0,0 +1,14 @@ +DELETE FROM `achievement_criteria_data` WHERE `criteria_id` IN (10062,10063,10054,10055,10046,10047,10048,10049,10050,10051,10044,10045) AND `type`!=11; +INSERT INTO `achievement_criteria_data` (`criteria_id`,`type`,`value1`,`value2`,`ScriptName`) VALUES +(10062,12,0,0, ''), +(10063,12,1,0, ''), +(10044,12,0,0, ''), +(10045,12,1,0, ''), +(10054,12,0,0, ''), +(10055,12,1,0, ''), +(10046,12,0,0, ''), +(10047,12,0,0, ''), +(10048,12,0,0, ''), +(10049,12,1,0, ''), +(10050,12,1,0, ''), +(10051,12,1,0, ''); diff --git a/sql/updates/world/2011_03_26_02_world_spell_linked_spell.sql b/sql/updates/world/2011_03_26_02_world_spell_linked_spell.sql new file mode 100644 index 0000000000000..4a7db38c11890 --- /dev/null +++ b/sql/updates/world/2011_03_26_02_world_spell_linked_spell.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=-57350 AND `spell_effect`=60242 ; +INSERT INTO `spell_linked_spell` (`spell_trigger`,`spell_effect`,`type`,`comment`) VALUES +(-57350,60242,0, 'Darkmoon Card: Illusion'); diff --git a/sql/updates/world/2011_03_26_03_world_quest_template.sql b/sql/updates/world/2011_03_26_03_world_quest_template.sql new file mode 100644 index 0000000000000..f5552e51ad530 --- /dev/null +++ b/sql/updates/world/2011_03_26_03_world_quest_template.sql @@ -0,0 +1,3 @@ +-- Set Correct Requirements for quest: Once More Unto The Breach, Hero (13104/13105) +UPDATE `quest_template` SET `SkillOrClassMask`=-32 WHERE `entry`= 13105; -- Death Knight only +UPDATE `quest_template` SET `SkillOrClassMask`=-1503 WHERE `entry`= 13105; -- Other Classes diff --git a/sql/updates/world/2011_03_26_03_world_spell_linked_spell.sql b/sql/updates/world/2011_03_26_03_world_spell_linked_spell.sql new file mode 100644 index 0000000000000..caa8e51b9b183 --- /dev/null +++ b/sql/updates/world/2011_03_26_03_world_spell_linked_spell.sql @@ -0,0 +1,3 @@ +-- Spell Arcane Barrage +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=56397; +INSERT INTO `spell_linked_spell` (spell_trigger,spell_effect,type,comment) VALUES (56397,63934,1,'Arcane Barrage - Arcane Barrage'); diff --git a/sql/updates/world/2011_03_27_00_world_quest_template.sql b/sql/updates/world/2011_03_27_00_world_quest_template.sql new file mode 100644 index 0000000000000..929ae4b42b992 --- /dev/null +++ b/sql/updates/world/2011_03_27_00_world_quest_template.sql @@ -0,0 +1,3 @@ +-- Set Correct Requirements for quest: Once More Unto The Breach, Hero (13104/13105) +UPDATE `quest_template` SET `SkillOrClassMask`=-32 WHERE `entry`= 13105; -- Death Knight only +UPDATE `quest_template` SET `SkillOrClassMask`=-1503 WHERE `entry`= 13104; -- Other Classes diff --git a/sql/updates/world/2011_03_27_01_world_misc.sql b/sql/updates/world/2011_03_27_01_world_misc.sql new file mode 100644 index 0000000000000..74a001be493b6 --- /dev/null +++ b/sql/updates/world/2011_03_27_01_world_misc.sql @@ -0,0 +1,150 @@ +/* Dalaran Books */ +SET @Gossip = 21255; -- Set by TDB Team (gossip_menu.entry - need 2) +SET @Guid = 151794; -- Set by TDB Team (gameobject.guid - need 35) +SET @Pool = 5691; -- Set by TDB Team (pool_template.entry - need 8) +SET @GoDespawnTime = 10800; -- Three hours + +-- Spawns +DELETE FROM `gameobject` WHERE `id` IN (192708,192706,192871,192905,192710,192886,192869,192880,192895,192713,192889,192890,192894,192884,192866,192891,192872,192881,192709,192883,192651,192888,192711,192653,192887,192652,192865,192874,192868,192870,192885,192867,192882,192707,192896); +INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES +-- Introduction +(@Guid+0,192708,571,1,1,5814.522,582.1118,652.7509,0.244345576,0,0,0,0,@GoDespawnTime,0,1), -- The Schools of Arcane Magic - Introduction +(@Guid+1,192706,571,1,1,5814.522,582.1118,652.7509,0.244345576,0,0,0,0,@GoDespawnTime,0,1), -- The Worst Mage in Dalaran: A Children's Book +(@Guid+2,192871,571,1,1,5814.522,582.1118,652.7509,0.244345576,0,0,0,0,@GoDespawnTime,0,1), -- The Archmage Antonidas - Part II +(@Guid+3,192905,571,1,1,5814.522,582.1118,652.7509,0.244345576,0,0,0,0,@GoDespawnTime,0,1), -- The Old Wizard's Almanac +-- Conjuration +(@Guid+4,192710,571,1,1,5812.64,797.223,662.57,-2.86234,0,0,0,0,@GoDespawnTime,0,1), -- The Schools of Arcane Magic - Conjuration +(@Guid+5,192886,571,1,1,5812.64,797.223,662.57,-2.86234,0,0,0,0,@GoDespawnTime,0,1), -- In Time, the Arcane Corrupts All! +(@Guid+6,192869,571,1,1,5812.64,797.223,662.57,-2.86234,0,0,0,0,@GoDespawnTime,0,1), -- LAVA BLAST - by Pyroco +(@Guid+7,192880,571,1,1,5812.64,797.223,662.57,-2.86234,0,0,0,0,@GoDespawnTime,0,1), -- Journal of Archmage Antonidas +(@Guid+8,192895,571,1,1,5812.64,797.223,662.57,-2.86234,0,0,0,0,@GoDespawnTime,0,1), -- Kirin Tor Monthly (March Issue) +-- Enchantment +(@Guid+9,192713,571,1,1,5808.22,691.076,658.715,2.179470,0,0,0,0,@GoDespawnTime,0,1), -- The Schools of Arcane Magic - Enchantment +(@Guid+10,192889,571,1,1,5808.22,691.076,658.715,2.179470,0,0,0,0,@GoDespawnTime,0,1), -- Kirin Tor Monthly (November Issue) +(@Guid+11,192890,571,1,1,5808.22,691.076,658.715,2.179470,0,0,0,0,@GoDespawnTime,0,1), -- STAY OUT!!! +(@Guid+12,192894,571,1,1,5808.22,691.076,658.715,2.179470,0,0,0,0,@GoDespawnTime,0,1), -- Remedial Magic 101: Tips from the Pros +(@Guid+13,192884,571,1,1,5808.22,691.076,658.715,2.179470,0,0,0,0,@GoDespawnTime,0,1), -- Portals are NOT Garbage Bins! +-- Necromancy +(@Guid+14,192866,571,1,1,5850.57,664.754,659.569,-1.93732,0,0,0,0,@GoDespawnTime,0,1), -- The Schools of Arcane Magic - Necromancy +(@Guid+15,192891,571,1,1,5850.57,664.754,659.569,-1.93732,0,0,0,0,@GoDespawnTime,0,1), -- To Do Today +(@Guid+16,192872,571,1,1,5850.57,664.754,659.569,-1.93732,0,0,0,0,@GoDespawnTime,0,1), -- The Archmage Antonidas - Part III +(@Guid+17,192881,571,1,1,5850.57,664.754,659.569,-1.93732,0,0,0,0,@GoDespawnTime,0,1), -- Thinking with Portals - A Memorandum on Proper Portal Usage +-- Abjuration +(@Guid+18,192709,571,1,1,5763.5,618.08,650.092,3.49199,0,0,0,0,@GoDespawnTime,0,1), -- The Schools of Arcane Magic - Abjuration +(@Guid+19,192883,571,1,1,5763.5,618.08,650.092,3.49199,0,0,0,0,@GoDespawnTime,0,1), -- Blinking Rules & Regulations +(@Guid+20,192651,571,1,1,5763.5,618.08,650.092,3.49199,0,0,0,0,@GoDespawnTime,0,1), -- Damaged Apprentice Journal +(@Guid+21,192888,571,1,1,5763.5,618.08,650.092,3.49199,0,0,0,0,@GoDespawnTime,0,1), -- Bundle of Romantic Correspondences +-- Divination +(@Guid+22,192711,571,1,1,5778.18,832.302,680.268,0.0283899,0,0,0,0,@GoDespawnTime,0,1), -- The Schools of Arcane Magic - Divination +(@Guid+23,192653,571,1,1,5778.18,832.302,680.268,0.0283899,0,0,0,0,@GoDespawnTime,0,1), -- On the Virtues of Magic +(@Guid+24,192887,571,1,1,5778.18,832.302,680.268,0.0283899,0,0,0,0,@GoDespawnTime,0,1), -- Losses of the Third War +(@Guid+25,192652,571,1,1,5778.18,832.302,680.268,0.0283899,0,0,0,0,@GoDespawnTime,0,1), -- Kirin Tor Monthly (May Issue) +-- Illusion +(@Guid+26,192865,571,1,1,5776.88,517.79,653.911,0.401425,0,0,0,0,@GoDespawnTime,0,1), -- The Schools of Arcane Magic - Illusion +(@Guid+27,192874,571,1,1,5776.88,517.79,653.911,0.401425,0,0,0,0,@GoDespawnTime,0,1), -- The Fluffy Bunny +(@Guid+28,192868,571,1,1,5776.88,517.79,653.911,0.401425,0,0,0,0,@GoDespawnTime,0,1), -- The Dangers of Magic Abuse +(@Guid+29,192870,571,1,1,5776.88,517.79,653.911,0.401425,0,0,0,0,@GoDespawnTime,0,1), -- The Archmage Antonidas - Part I +(@Guid+30,192885,571,1,1,5776.88,517.79,653.911,0.401425,0,0,0,0,@GoDespawnTime,0,1), -- The Fate of Apprentice Argoly +-- Transmutation +(@Guid+31,192867,571,1,1,5844.61328,664.541,649.3733,-0.3316107,0,0,0,0,@GoDespawnTime,0,1), -- The Schools of Arcane Magic - Transmutation +(@Guid+32,192882,571,1,1,5844.61328,664.541,649.3733,-0.3316107,0,0,0,0,@GoDespawnTime,0,1), -- Polymorphic Rules & Regulations +(@Guid+33,192707,571,1,1,5844.61328,664.541,649.3733,-0.3316107,0,0,0,0,@GoDespawnTime,0,1), -- Weathered Diary - Dates from the Third War +(@Guid+34,192896,571,1,1,5844.61328,664.541,649.3733,-0.3316107,0,0,0,0,@GoDespawnTime,0,1); -- Excerpts from the Journal of Archmage Vargoth + +/* +-- SAI prototype: Despawn after use FIXME: SAI can't despawn GOs +UPDATE `gameobject_template` SET `AIName`='SmartGameObjectAI' WHERE `entry` IN (xxx); +DELETE FROM `smart_scripts` WHERE `source_type`=1 AND `id`=0 AND `entryorguid` IN (xxx); +INSERT INTO `smart_scripts`(`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(xxx,1,0,0,64,0,100,0,0,0,0,0,41,180000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Dalaran Books: Despawn after 3 mins on gossip_hello'); +*/ + +-- Pooling +DELETE FROM `pool_template` WHERE `entry` BETWEEN @Pool+0 AND @Pool+7; +INSERT INTO `pool_template` (`entry`,`max_limit`,`description`) VALUES +(@Pool+0,1, 'Dalaran Books: Violet Gate'), +(@Pool+1,1, 'Dalaran Books: Violet Citadel Lower'), +(@Pool+2,1, 'Dalaran Books: Threads of Fate'), +(@Pool+3,1, 'Dalaran Books: Ledgerdemain Lounge Upstairs'), +(@Pool+4,1, 'Dalaran Books: Visitor’s Center'), +(@Pool+5,1, 'Dalaran Books: Violet Citadel Upstairs'), +(@Pool+6,1, 'Dalaran Books: Violet Hold'), +(@Pool+7,1, 'Dalaran Books: Ledgerdemain Lounge Lower'); + +DELETE FROM `pool_gameobject` WHERE `pool_entry` BETWEEN @Pool+0 AND @Pool+7; +INSERT INTO `pool_gameobject` (`guid`,`pool_entry`,`chance`,`description`) VALUES +-- Introduction +(@Guid+0,@Pool+0,0, 'The Schools of Arcane Magic - Introduction'), +(@Guid+1,@Pool+0,0, 'The Worst Mage in Dalaran: A Children''s Book'), +(@Guid+2,@Pool+0,0, 'The Archmage Antonidas - Part II'), +(@Guid+3,@Pool+0,0, 'The Old Wizard''s Almanac'), +-- Conjuration +(@Guid+4,@Pool+1,0, 'The Schools of Arcane Magic - Conjuration'), +(@Guid+5,@Pool+1,0, 'In Time, the Arcane Corrupts All!'), +(@Guid+6,@Pool+1,0, 'LAVA BLAST - by Pyroco'), +(@Guid+7,@Pool+1,0, 'Journal of Archmage Antonidas'), +(@Guid+8,@Pool+1,0, 'Kirin Tor Monthly (March Issue)'), +-- Enchantment +(@Guid+9,@Pool+2,0, 'The Schools of Arcane Magic - Enchantment'), +(@Guid+10,@Pool+2,0, 'Kirin Tor Monthly (November Issue)'), +(@Guid+11,@Pool+2,0, 'STAY OUT!!!'), +(@Guid+12,@Pool+2,0, 'Remedial Magic 101: Tips from the Pros'), +(@Guid+13,@Pool+2,0, 'Portals are NOT Garbage Bins!'), +-- Necromancy +(@Guid+14,@Pool+3,0, 'The Schools of Arcane Magic - Necromancy'), +(@Guid+15,@Pool+3,0, 'To Do Today'), +(@Guid+16,@Pool+3,0, 'The Archmage Antonidas - Part III'), +(@Guid+17,@Pool+3,0, 'Thinking with Portals - A Memorandum on Proper Portal Usage'), +-- Abjuration +(@Guid+18,@Pool+4,0, 'The Schools of Arcane Magic - Abjuration'), +(@Guid+19,@Pool+4,0, 'Blinking Rules & Regulations'), +(@Guid+20,@Pool+4,0, 'Damaged Apprentice Journal'), +(@Guid+21,@Pool+4,0, 'Bundle of Romantic Correspondences'), +-- Divination +(@Guid+22,@Pool+5,0, 'The Schools of Arcane Magic - Divination'), +(@Guid+23,@Pool+5,0, 'On the Virtues of Magic'), +(@Guid+24,@Pool+5,0, 'Losses of the Third War'), +(@Guid+25,@Pool+5,0, 'Kirin Tor Monthly (May Issue)'), +-- Illusion +(@Guid+26,@Pool+6,0, 'The Schools of Arcane Magic - Illusion'), +(@Guid+27,@Pool+6,0, 'The Fluffy Bunny'), +(@Guid+28,@Pool+6,0, 'The Dangers of Magic Abuse'), +(@Guid+29,@Pool+6,0, 'The Archmage Antonidas - Part I'), +(@Guid+30,@Pool+6,0, 'The Fate of Apprentice Argoly'), +-- Transmutation +(@Guid+31,@Pool+7,0, 'The Schools of Arcane Magic - Transmutation'), +(@Guid+32,@Pool+7,0, 'Polymorphic Rules & Regulations'), +(@Guid+33,@Pool+7,0, 'Weathered Diary - Dates from the Third War'), +(@Guid+34,@Pool+7,0, 'Excerpts from the Journal of Archmage Vargoth'); + +UPDATE `creature_template` SET `gossip_menu_id`=@Gossip+0,`AIName`='SmartAI' WHERE `entry`=19481; -- Archmage Vargoth +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=19284; -- Archmage Vargoth +UPDATE `creature` SET `npcflag`=1 WHERE `guid`=98174; -- Archmage Vargoth +DELETE FROM `creature_template_addon` WHERE `entry`=19481; +INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(19481,0,0,1,0, NULL); -- Archmage Vargoth +-- Gossip for Archmage Vargoth +DELETE FROM `gossip_menu` WHERE `text_id` IN (14192,14194); +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES +(@Gossip+0,14192), +(@Gossip+1,14194); +DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (@Gossip+0,@Gossip+1) AND `id`=0; +INSERT INTO `gossip_menu_option` (`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`) VALUES +(@Gossip+0,0,0, 'I have a book that might interest you. Would you like to take a look?',1,1,@Gossip+1,0,0,0,0,NULL), +(@Gossip+1,0,0, 'Thank you! I''ll be sure to notify you if I find anything else.',1,1,0,0,0,0,0,NULL); -- SAI script +DELETE FROM `creature_template_addon` WHERE `entry`=32643; +INSERT INTO `creature_template_addon` (`entry`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(32643,0,0,0,3,0,'61478 0'); -- companion pet aura (arcane explosions) + +DELETE FROM `smart_scripts` WHERE `entryorguid`=-98174 AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(-98174,0,0,0,62,0,100,0,@Gossip+1,0,0,0,11,61457,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Archmage Vargoth (Dalaran) - On gossip select cast Kirin Tor Familiar on invoker'); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=@Gossip+0 AND `SourceEntry`=14192; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=@Gossip+0 AND `SourceEntry`=0; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,@Gossip+0,14192,0,4,4395,0,0,0, '', 'Archmage Vargoth - Gossip: zone restriction to Dalaran'), +(15,@Gossip+0,0,0,4,4395,0,0,0, '', 'Archmage Vargoth - Gossip option: zone restriction to Dalaran'), +(15,@Gossip+0,0,0,26,44738,1,0,0, '', 'Archmage Vargoth - Gossip option: player should not have item 44738'), +(15,@Gossip+0,0,0,17,1956,0,0,0, '', 'Archmage Vargoth - Gossip option: player should have achiev 1956'); +-- FIXME: add a gossip option condition: player should not have spell 61472 diff --git a/sql/updates/world/2011_03_27_02_world_misc.sql b/sql/updates/world/2011_03_27_02_world_misc.sql new file mode 100644 index 0000000000000..383de94a629bd --- /dev/null +++ b/sql/updates/world/2011_03_27_02_world_misc.sql @@ -0,0 +1,746 @@ +/* ################################################################################################ +# Zalazane's Fall by Nay and Kaelima +################################################################################################ */ +/* ### Variables ### */ +SET @CGuid = 208901; -- (Set by TDB team - creature.guid - need X) +SET @GGuid = 151829; -- (Set by TDB team - gameobject.guid - need X) +SET @EquiEntry = 2433; -- (Set by TDB team - creature_equip_template.entry - need X) +SET @Gossip = 21257; -- (Set by TDB team - gossip_menu.entry - need 1) +SET @Event = 61; -- (Set by TDB team - game_event.entry - need 1) +-- Creature enums +SET @N_Vanira = 40184; -- Vanira +SET @N_VaniraTotem = 40187; -- Vanira's Sentry Totem +SET @N_Frog = 40176; -- Sen'jin Frog +SET @N_AtunnedFrog = 40188; -- Atunned Frog +SET @N_Voljin = 40391; -- Vol'jin +SET @N_Uruzin = 40253; -- Champion Uru'zin +SET @N_VoljinBoss = 39654; -- Vol'jin (on the island, starts fight) +SET @N_BatHandler = 40204; -- Handler Marnlek +SET @N_Bat = 40222; -- Scout Bat +SET @N_SpyFrogCredit = 40218; -- Spy Frog Credit +SET @N_TigerCredit = 40301; -- Tiger Matriarch Credit +SET @N_TigerSpirit = 40305; -- Spirit of the Tiger +SET @N_Matriarch = 40312; -- Tiger Matriarch (casts 75163 (Vicious Bite), 61184 (Pounce), 75159 (Claw)) +SET @N_Zentabra = 40329; -- Zen'tabra +SET @N_DWarrior = 40392; -- Darkspear Warrior +SET @N_DScout = 40416; -- Darkspear Scout +SET @N_Citizien1 = 40256; -- Troll Citizien (1) +SET @N_Citizien2 = 40257; -- Troll Citizien (2) +SET @N_Volunteer1 = 40260; -- Troll Volunteer +SET @N_Volunteer2 = 40264; -- Troll Volunteer +SET @N_RDancer = 40356; -- Ritual Dancer +SET @N_TDanceleader = 40361; -- Troll Dance Leader +SET @N_DancePart = 40363; -- Dance Participant +SET @N_RDrummer = 40373; -- Ritual Drummer +SET @N_Omen = 40387; -- Omen Event Credit +SET @N_DAncestor = 40388; -- Darkspear Ancestor +SET @N_Voice = 40374; -- Voice of the Spirits +SET @N_Doctor = 40352; -- Witch Doctor Hez'tok +-- Gameobject enums +SET @G_BatTotem = 202833; -- Sen'jin Bat Totem +SET @G_BatStraw = 202834; -- Sen'jin Bat Roost Straw +SET @G_BatFence = 202835; -- Sen'jin Bat Roost Fence +SET @G_BatPost = 202839; -- Sen'jin Bat Roost Fence Post +SET @G_RDrum = 202879; -- Ritual Drum +SET @G_RGong = 202880; -- Ritual Gong +SET @G_RBrazier = 202881; -- Ritual Brazier +SET @G_SRDrum = 202882; -- Small Ritual Drum +SET @G_SRDrum2 = 202883; -- Small Ritual Drum 2 +SET @G_Banner = 202885; -- Sen'jin Banner +SET @G_Tent = 202886; -- Sen'jin Tent +SET @G_Table = 202888; -- Sen'jin Table +SET @G_Book1 = 202889; -- Troll Book 1 +SET @G_Book2 = 202890; -- Troll Book 2 +SET @G_CCrate = 202891; -- Closed Weapon Crate +SET @G_OCrate = 202892; -- Open Weapon Crate +SET @G_SPennant = 202893; -- Sen'jin Pennant +-- Quest enums +SET @Q_DaPerfectSpies = 25444; -- Da Perfect Spies +SET @Q_FrogsAway = 25446; -- Frogs Away! +SET @Q_LadyOfDaTigers = 25470; -- Lady Of Da Tigers +SET @Q_DanceOfDeSpirits = 25480; -- Dance Of De Spirits +SET @Q_TrollinForVolunteers = 25461; -- Trollin' For Volunteers +SET @Q_PreparinForBattle = 25495; -- Preparin For Battle +SET @Q_ZalazanesFall = 25445; -- Zalazane's Fall +-- Spell enums +SET @S_Pickup = 74904; -- Pickup Sen'jin Frog [player -> creature] +SET @S_Pickup2 = 74905; -- Pickup Sen'jin Frog [creature -> player] +SET @S_InvsAura = 75433; -- Spawn Invisibility Aura (QZS 2) +SET @S_FrogsAway = 74977; -- Frogs Away! +SET @S_SeeSenjinFrogInvs = 75434; -- See Sen'jin Frog Invis +SET @S_SeeSpyFrogInvs =74982; -- See Spy Frog Invisibility +SET @S_Taxi_Frog = 74978; -- Echo Isles: Unlearned Spy Frog Taxi +SET @S_Taxi_Troll = 75421; -- Echo Isles: Unlearned Troll Recruit Taxi +SET @S_Taxi_Battle = 75422; -- Echo Isles: Unlearned Troll Battle Taxi +SET @S_SpyFrogInvs = 74980; -- Spy Frog Invisibility +SET @S_SmokeFlare = 74971; -- Red Flare State +SET @S_VisualSpawn = 31517; -- Bind Visual Spawn In DND +SET @S_SpyFrogState = 74917; -- Spy Frog State +SET @S_RideVehicle = 46598; -- Ride Vehicle Hardcoded +SET @S_Tiger = 75147; -- Spirit of the Tiger +SET @S_ForceTiger = 75186; -- Force Cast Spirit of the Tiger +SET @S_NatVisual = 60957; -- Cosmetic Nature Cast +SET @S_TigerAura = 75165; -- Spirit of the Tiger Aura +SET @S_TigerSeeInvs = 75180; -- Detect QZS 3 +SET @S_TigerGhost = 22650; -- Ghost Visual +SET @S_BossEmotePAura =75213; -- Boss Emote & No Summon Aura +SET @S_TigerCredit = 40301; -- OCW TOTE On Quest Check (what?) +SET @S_MatriarchShroud = 75179; -- Matriarch's Shroud +SET @S_TigerQuestCredit = 75197; -- Zen'tabra Credit +SET @S_MatriarchSummonF = 75188; -- Force Cast Summon Tiger Matriarch +SET @S_MatriarchSummon = 75187; -- Summon Tiger Matriarch +SET @S_ZentabraSummon = 75181; -- Summon Zen'tabra +SET @S_ZentabraController = 75212; -- Controller Summon Zen'tabra Trigger +SET @S_ZentrabaSmoke = 36747; -- Spawn Smoke (Druid) +SET @S_ZentrabaTransform = 74931; -- [DND] Tiger Transform +SET @S_VolunterSummon1 = 75088; -- Motivate +SET @S_VolunterSummon2 = 75086; -- Motivate + +-- Item enums +SET @I_VoljinDrums = 54215; -- Voljin Drums Questitem + +/* ### Creatures ### */ +-- Templates +UPDATE `creature_template` SET `gossip_menu_id`=11341,`faction_A`=126,`faction_H`=126,`exp`=2,`minlevel`=80,`maxlevel`=80,`baseattacktime`=2000,`npcflag`=`npcflag`|3,`unit_flags`=`unit_flags`|33024,`equipment_id`=@EquiEntry+0,`unit_class`=2,`speed_run`=1.1428571428571,`AIName`='SmartAI' WHERE `entry`=@N_Vanira; -- Vanira +UPDATE `creature_template` SET `faction_A`=126,`faction_H`=126,`minlevel`=80,`maxlevel`=80,`baseattacktime`=2000,`unit_flags`=`unit_flags`|256,`speed_run`=1.1428571428571 WHERE `entry`=@N_VaniraTotem; -- Vanira's Sentry Totem +UPDATE `creature_template` SET `AIName`='SmartAI',`baseattacktime`=2000,/*`npcflag`=`npcflag`|16777216,*/`speed_run`=1.1428571428571 WHERE `entry`=@N_Frog; -- Sen'jin Frog +UPDATE `creature_template` SET `faction_A`=190,`faction_H`=190,`baseattacktime`=2000,`unit_flags`=`unit_flags`|256,`speed_run`=1.1428571428571,`AIName`='SmartAI',`MovementType`=1 WHERE `entry`=@N_AtunnedFrog; -- Atunned Frog +UPDATE `creature_template` SET `gossip_menu_id`=11345,`faction_A`=126,`faction_H`=126,`exp`=2,`minlevel`=78,`maxlevel`=78,`baseattacktime`=2000,`npcflag`=`npcflag`|1,`unit_flags`=`unit_flags`|33024,`equipment_id`=191,`unit_class`=2,`speed_run`=1.1428571428571 WHERE `entry`=@N_BatHandler; -- Handler Marnlek +UPDATE `creature_template` SET `faction_A`=126,`faction_H`=126,`exp`=2,`minlevel`=80,`maxlevel`=80,`baseattacktime`=2000,`unit_flags`=`unit_flags`|256,`speed_run`=4.2857142857143 WHERE `entry`=@N_Bat; -- Scout Bat +UPDATE `creature_template` SET `baseattacktime`=2000,`unit_flags`=`unit_flags`|33555200,`speed_run`=1.1428571428571 WHERE `entry`=@N_SpyFrogCredit; -- Spy Frog Credit +UPDATE `creature_template` SET `spell1`=75159,`spell2`=75160,`spell3`=75161,`faction_A`=35,`faction_H`=35,`exp`=2,`minlevel`=80,`maxlevel`=80,`baseattacktime`=2500,`unit_flags`=`unit_flags`|16777224,`unit_class`=4,`speed_walk`=2.8,`speed_run`=1.5714285714286,`vehicleid`=736,`attackpower`=1167 WHERE `entry`=@N_TigerSpirit; -- Spirit of the Tiger CHECKME: speed_run and speed_walk +UPDATE `creature_template` SET `baseattacktime`=2000,`unit_flags`=`unit_flags`|33555200,`speed_run`=1.1428571428571,`AIName`='SmartAI' WHERE `entry`=@N_TigerCredit; -- Tiger Matriarch Credit +UPDATE `creature_template` SET `faction_A`=2102,`faction_H`=2102,`exp`=2,`minlevel`=80,`maxlevel`=80,`baseattacktime`=1625,`mindmg`=117,`maxdmg`=322,`attackpower`=143,`dmg_multiplier`=1.2,`unit_flags`=`unit_flags`|526336,`dynamicflags`=`dynamicflags`|4,`unit_class`=2,`speed_run`=1.1428571428571 WHERE `entry`=@N_Matriarch; -- Tiger Matriarch +UPDATE `creature_template` SET `faction_A`=35,`faction_H`=35,`minlevel`=80,`maxlevel`=80,`baseattacktime`=2000,`unit_flags`=`unit_flags`|32776,`equipment_id`=1669,`unit_class`=2,`speed_run`=1.1428571428571,`flags_extra`=`flags_extra`|2,`AIName`='SmartAI' WHERE `entry`=@N_Zentabra; -- Zen'tabra +UPDATE `creature_template` SET `faction_A`=126,`faction_H`=126,`exp`=2,`minlevel`=80,`maxlevel`=80,`baseattacktime`=2000,`npcflag`=`npcflag`|2,`unit_flags`=`unit_flags`|33024,`equipment_id`=@EquiEntry+1,`unit_class`=2,`speed_run`=1.1428571428571 WHERE `entry`=@N_Uruzin; -- Champion Uru'zin +UPDATE `creature_template` SET `faction_A`=126,`faction_H`=126,`exp`=2,`minlevel`=80,`maxlevel`=80,`baseattacktime`=2000,`unit_flags`=`unit_flags`|33024,`equipment_id`=@EquiEntry+2,`speed_run`=1.1428571428571 WHERE `entry`=@N_DWarrior; -- Darkspear Warrior +UPDATE `creature_template` SET `faction_A`=126,`faction_H`=126,`exp`=2,`minlevel`=80,`maxlevel`=80,`baseattacktime`=2000,`unit_flags`=`unit_flags`|32768,`equipment_id`=@EquiEntry+3,`speed_run`=1.1428571428571,`InhabitType`=1,`AIName`='SmartAI' WHERE `entry`=@N_DScout; -- Darkspear Scout +UPDATE `creature_template` SET `gossip_menu_id`=11391,`faction_A`=126,`faction_H`=126,`exp`=2,`minlevel`=83,`maxlevel`=83,`baseattacktime`=2000,`mindmg`=496,`maxdmg`=674,`attackpower`=783,`dmg_multiplier`=7.5,`npcflag`=`npcflag`|3,`unit_flags`=`unit_flags`|256,`equipment_id`=@EquiEntry+4,`unit_class`=2,`speed_run`=1.1428571428571 WHERE `entry`=@N_Voljin; -- Vol'jin +UPDATE `creature_template` SET `faction_A`=126,`faction_H`=126,`exp`=2,`minlevel`=70,`maxlevel`=80,`baseattacktime`=2000,`unit_flags`=`unit_flags`|256,`unit_class`=2,`speed_run`=1.1428571428571 WHERE `entry`=@N_RDancer; -- Ritual Dancer +UPDATE `creature_template` SET `faction_A`=126,`faction_H`=126,`baseattacktime`=2000,`unit_flags`=`unit_flags`|33280,`speed_run`=1.1428571428571,`AIName`='SmartAI' WHERE `entry`=@N_Citizien1; -- Troll Citizien (1) +UPDATE `creature_template` SET `faction_A`=126,`faction_H`=126,`baseattacktime`=2000,`unit_flags`=`unit_flags`|33280,`speed_run`=1.1428571428571,`AIName`='SmartAI' WHERE `entry`=@N_Citizien2; -- Troll Citizien (2) +UPDATE `creature_template` SET `baseattacktime`=2000,`unit_flags`=`unit_flags`|33555200,`speed_run`=1.1428571428571 WHERE `entry`=@N_TDanceleader; -- Troll Dance Leader +UPDATE `creature_template` SET `baseattacktime`=2000,`unit_flags`=`unit_flags`|33555200,`speed_walk`=1.6,`speed_run`=2,`InhabitType`=5,`MovementType`=1,`AIName`='SmartAI' WHERE `entry`=@N_DancePart; -- Dance Participant +UPDATE `creature_template` SET `faction_A`=126,`faction_H`=126,`exp`=2,`minlevel`=70,`maxlevel`=80,`baseattacktime`=2000,`equipment_id`=36,`unit_class`=2,`speed_run`=1.1428571428571,`AIName`='SmartAI' WHERE `entry`=@N_RDrummer; -- Ritual Drummer +UPDATE `creature_template` SET `baseattacktime`=2000,`unit_flags`=`unit_flags`|33555200,`speed_run`=1.1428571428571 WHERE `entry`=@N_Omen; -- Omen Event Credit +UPDATE `creature_template` SET `faction_A`=126,`faction_H`=126,`exp`=2,`minlevel`=70,`maxlevel`=80,`baseattacktime`=2000,`unit_flags`=`unit_flags`|32768,`speed_run`=1.1428571428571 WHERE `entry`=@N_DAncestor; -- Darkspear Ancestor +UPDATE `creature_template` SET `baseattacktime`=2000,`unit_flags`=`unit_flags`|0x00008308 WHERE `entry` IN (@N_Volunteer1,@N_Volunteer2); -- Troll Volunteer +UPDATE `creature_template` SET `faction_A`=126,`faction_H`=126,`exp`=2,`minlevel`=80,`maxlevel`=80,`baseattacktime`=2000,`unit_flags`=`unit_flags`|33536,`equipment_id`=@EquiEntry+5,`unit_class`=2,`speed_run`=1.1428571428571 WHERE `entry`=@N_Voice; -- Voice of the Spirits +UPDATE `creature_template` SET `faction_A`=126,`faction_H`=126,`exp`=2,`minlevel`=80,`maxlevel`=80,`baseattacktime`=2000,`unit_flags`=`unit_flags`|33536,`equipment_id`=@EquiEntry+5,`unit_class`=2,`speed_run`=1.1428571428571,`gossip_menu_id`=@Gossip,`npcflag`=`npcflag`|1,`AIName`='SmartAI' WHERE `entry`=@N_Doctor; -- Witch Doctor Hez'tok +UPDATE `creature_template` SET `npcflag`=`npcflag`|3 WHERE `entry`=@N_VoljinBoss; + +-- Models +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=1 WHERE `modelid`=31719; -- Vanira +UPDATE `creature_model_info` SET `bounding_radius`=1.5,`combat_reach`=0,`gender`=2 WHERE `modelid`=31720; -- Vanira's Sentry Totem +UPDATE `creature_model_info` SET `bounding_radius`=0.25,`combat_reach`=1,`gender`=2 WHERE `modelid`=31727; -- Sen'jin Frog +UPDATE `creature_model_info` SET `bounding_radius`=0.3,`combat_reach`=1,`gender`=2 WHERE `modelid`=22469; -- Atunned Frog +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=31726; -- Handler Marnlek +UPDATE `creature_model_info` SET `bounding_radius`=0,`combat_reach`=1,`gender`=2 WHERE `modelid`=31725; -- Scout Bat +UPDATE `creature_model_info` SET `bounding_radius`=0.4,`combat_reach`=0,`gender`=2 WHERE `modelid`=19595; -- Spy Frog Credit +UPDATE `creature_model_info` SET `bounding_radius`=1.15,`combat_reach`=1,`gender`=0 WHERE `modelid`=31788; -- Spirit of the Tiger +UPDATE `creature_model_info` SET `bounding_radius`=0.125,`combat_reach`=0,`gender`=2 WHERE `modelid`=17188; -- Tiger Matriarch Credit +UPDATE `creature_model_info` SET `bounding_radius`=1.272,`combat_reach`=2,`gender`=1 WHERE `modelid`=31765; -- Tiger Matriarch +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=1 WHERE `modelid`=31734; -- Zen'tabra +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=31762; -- Champion Uru'zin +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=1 WHERE `modelid`=31841; -- Darkspear Warrior +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=1 WHERE `modelid`=31738; -- Darkspear Scout +UPDATE `creature_model_info` SET `bounding_radius`=0.3672,`combat_reach`=1,`gender`=0 WHERE `modelid`=31736; -- Vol'jin +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=9768; -- Ritual Dancer +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=1 WHERE `modelid`=2589; -- Troll Citizien (1) +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=0 WHERE `modelid`=2588; -- Troll Citizien (2) +UPDATE `creature_model_info` SET `bounding_radius`=0.125,`combat_reach`=0,`gender`=2 WHERE `modelid`=17188; -- Troll Dance Leader +UPDATE `creature_model_info` SET `bounding_radius`=0.175,`combat_reach`=0,`gender`=2 WHERE `modelid`=22769; -- Dance Participant +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=1 WHERE `modelid`=2589; -- Ritual Drummer +UPDATE `creature_model_info` SET `bounding_radius`=0.125,`combat_reach`=0,`gender`=2 WHERE `modelid`=17188; -- Omen Event Credit +UPDATE `creature_model_info` SET `bounding_radius`=0.306,`combat_reach`=1,`gender`=1 WHERE `modelid`=4033; -- Darkspear Ancestor +UPDATE `creature_model_info` SET `bounding_radius`=0.5355,`combat_reach`=2,`gender`=0 WHERE `modelid`=31819; -- Voice of the Spirits + +-- Equipments +DELETE FROM `creature_equip_template` WHERE `entry` BETWEEN @EquiEntry+0 AND @EquiEntry+5; +INSERT INTO `creature_equip_template` (`entry`,`equipentry1`,`equipentry2`,`equipentry3`) VALUES +(@EquiEntry+0,19903,13319,0), -- Vanira +(@EquiEntry+1,33982,33980,49022), -- Champion Uru'zin +(@EquiEntry+2,53924,53933,5870), -- Darkspear Warrior +(@EquiEntry+3,42873,0,5870), -- Darkspear Scout +(@EquiEntry+4,53835,0,14118), -- Vol'jin +(@EquiEntry+5,19909,0,0); -- Voice of the Spirits +-- Addons +DELETE FROM `creature_template_addon` WHERE `entry` IN (@N_VaniraTotem,@N_Frog,@N_AtunnedFrog,@N_BatHandler,@N_Bat,@N_SpyFrogCredit,@N_TigerSpirit,@N_TigerCredit,@N_Matriarch,@N_Zentabra,@N_Uruzin,@N_DWarrior,@N_DScout,@N_Voljin,@N_RDancer,@N_Citizien1,@N_Citizien2,@N_TDanceleader,@N_DancePart,@N_RDrummer,@N_Omen,@N_DAncestor); +INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(@N_VaniraTotem,0,0,1,0,NULL), -- Vanira's Sentry Totem +(@N_Frog,0,65536,1,0, '75433 0'), -- Sen'jin Frog, bytes1=65536 (@S_InvsAura) +(@N_AtunnedFrog,0,0,1,0, '74917 0'), -- Atunned Frog (@S_SpyFrogState) +(@N_BatHandler,0,0,1,0,NULL), -- Handler Marnlek +(@N_Bat,0,33554432,1,0, NULL), -- Scout Bat +(@N_SpyFrogCredit,0,65536,1,0, '74980 0 74971 0'), -- Spy Frog Credit @S_SpyFrogInvs and @S_SmokeFlare +(@N_TigerSpirit,0,65536,1,0, '75180 0 22650 0'), -- Spirit of the Tiger CHECKME: remove auras? @S_TigerSeeInvs and @S_TigerGhost +(@N_TigerCredit,0,0,1,0,NULL), -- Tiger Matriarch Credit +(@N_Matriarch,0,65536,1,0, '75179 0 75179 1'), -- Tiger Matriarch @S_MatriarchShroud +(@N_Zentabra,0,0,0,0,NULL), -- Zentabra +(@N_Uruzin,0,0,2,0, '75075 0 18950 0 18950 1'), -- Champion Uru'zin +(@N_DWarrior,0,0,1,0,NULL), -- Darkspear Warrior +(@N_DScout,31725,0,1,0,NULL), -- Darkspear Scout (mounted) +(@N_Voljin,29261,0,1,0, NULL), -- Vol'jin (mounted) +(@N_RDancer,0,0,1,10, NULL), -- Ritual Dancer +(@N_Citizien1,0,0,1,0, '73940 0'), -- Troll Citizien (1) +(@N_Citizien2,0,0,1,0, '73939 0'), -- Troll Citizien (2) +(@N_TDanceleader,0,0,1,10, NULL), -- Troll Dance Leader +(@N_DancePart,0,0,1,0, '35709 0'), -- Dance Participant +(@N_RDrummer,0,0,1,173, '73940 0'), -- Ritual Drummer +(@N_Omen,0,0,1,0, NULL), -- Omen Event Credit +(@N_DAncestor,0,0,257,10, '73813 0 22650 0'); -- Darkspear Ancestor +DELETE FROM `creature_addon` WHERE `guid` BETWEEN @CGuid+85 AND @CGuid+92; +INSERT INTO `creature_addon` (`guid`,`emote`,`bytes2`,`auras`) VALUES +(@CGuid+85,10,1, '75228 0'), -- Ritual Dancer +(@CGuid+86,10,1, '75229 0'), -- Ritual Dancer +(@CGuid+87,10,1, '75228 0'), -- Ritual Dancer +(@CGuid+88,10,1, '75230 0'), -- Ritual Dancer +(@CGuid+89,10,1, '75230 0'), -- Ritual Dancer +(@CGuid+90,10,1, '75230 0'), -- Ritual Dancer +(@CGuid+91,10,1, '75228 0'), -- Ritual Dancer +(@CGuid+92,10,1, '75229 0'); -- Ritual Dancer +-- Gossips +DELETE FROM `gossip_menu` WHERE `entry` IN (11341,11345,11391,@Gossip); +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES +(11341,15796), -- Vanira +(11345,15806), -- Handler Marnlek +(11391,15865), -- Vol'jin +(@Gossip,15846); -- Witch Doctor Hez'tok + +DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (11345,@Gossip); +INSERT INTO `gossip_menu_option` (`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`) VALUES +(11345,0,0, 'Vanira told me to speak to you about borrowing a bat.' ,1,1,0,0,11345*100,0,0,NULL), -- Handler Marnlek (Frogs Away quest) +(11345,1,0, 'I need to get to Razor Hill to reqruit on behalf of Vol''jin. May i borrow a bat?' ,1,1,0,0,11345*100+1,0,0,NULL), -- Handler Marnlek (Trollin' For Volunteers quest) +(11345,2,0, 'I am ready to take back the Echo Isles. Take me to the staging area!' ,1,1,0,0,11345*100+2,0,0,NULL), -- Handler Marnlek (Preparin' For Battle quest) +(@Gossip,0,0, 'Let us consult the omens.' ,1,1,0,0,0,0,0,NULL); -- Witch Doctor Hez'tok (quest Dance of De Spirits) +DELETE FROM `gossip_scripts` WHERE `id` IN (11345*100,11345*100+1,11345*100+2); +INSERT INTO `gossip_scripts` (`id`,`delay`,`command`,`datalong`,`datalong2`,`dataint`,`x`,`y`,`z`,`o`) VALUES +(11345*100+0,0,15,@S_Taxi_Frog,1,0,0,0,0,0), -- Handler Marnlek (Frogs Away quest) +(11345*100+1,0,15,@S_Taxi_Troll,1,0,0,0,0,0),-- Handler Marnlek (Trollin' For Volunteers quest) +(11345*100+2,0,15,@S_Taxi_Battle,1,0,0,0,0,0);-- Handler Marnlek (Prepari' For Battle quest) + +-- Spawns +DELETE FROM `creature` WHERE `id` IN (@N_Vanira,@N_VaniraTotem,@N_Frog,@N_BatHandler,@N_Bat,@N_SpyFrogCredit,@N_TigerCredit,@N_Uruzin,@N_DWarrior,@N_DScout,@N_Voljin,@N_RDancer,@N_Citizien1,@N_Citizien2,@N_Doctor); +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`DeathState`,`MovementType`) VALUES +(@CGuid+0,@N_Vanira,1,1,1,0,0,-747.175354,-5003.974,19.505209,3.769911,120,0,0,1,0,0,0), -- Vanira +(@CGuid+1,@N_VaniraTotem,1,1,1,0,0,-747.7049,-5007.78125,18.8993073,3.38593864,120,0,0,1,0,0,0), -- Vanira's Sentry Totem +(@CGuid+2,@N_Frog,1,1,1,0,0,-702.0243,-4936.85938,24.78558,0,45,10,0,1,0,0,1), -- Sen'jin Frog +(@CGuid+3,@N_Frog,1,1,1,0,0,-706.8733,-5089.25342,10.1877956,0,45,10,0,1,0,0,1), -- Sen'jin Frog +(@CGuid+4,@N_Frog,1,1,1,0,0,-717.1079,-5030.84961,16.7545834,0.588063061,45,10,0,1,0,0,1), -- Sen'jin Frog +(@CGuid+5,@N_Frog,1,1,1,0,0,-721.449646,-5060.799,14.6723547,0,45,10,0,1,0,0,1), -- Sen'jin Frog +(@CGuid+6,@N_Frog,1,1,1,0,0,-721.4549,-5041.06934,15.9652061,0,45,10,0,1,0,0,1), -- Sen'jin Frog +(@CGuid+7,@N_Frog,1,1,1,0,0,-738.0006,-5049.516,14.9542475,5.759314,45,10,0,1,0,0,1), -- Sen'jin Frog +(@CGuid+8,@N_Frog,1,1,1,0,0,-752.2173,-4959.93359,22.16427,1.52473652,45,10,0,1,0,0,1), -- Sen'jin Frog +(@CGuid+9,@N_Frog,1,1,1,0,0,-754.166,-4912.5,21.3002,0.8383126,45,10,0,1,0,0,1), -- Sen'jin Frog +(@CGuid+10,@N_Frog,1,1,1,0,0,-754.8121,-4931.80273,21.6752,1.62117982,45,10,0,1,0,0,1), -- Sen'jin Frog +(@CGuid+11,@N_Frog,1,1,1,0,0,-764.584,-4972.916,20.9381447,1.66710317,45,10,0,1,0,0,1), -- Sen'jin Frog +(@CGuid+12,@N_Frog,1,1,1,0,0,-790.7708,-5014.889,15.7722931,0,45,10,0,1,0,0,1), -- Sen'jin Frog +(@CGuid+13,@N_Frog,1,1,1,0,0,-802.0174,-5037.51025,10.57736,0,45,10,0,1,0,0,1), -- Sen'jin Frog +(@CGuid+14,@N_Frog,1,1,1,0,0,-814.3917,-5010.16064,15.0449858,4.40670633,45,10,0,1,0,0,1), -- Sen'jin Frog +(@CGuid+15,@N_Frog,1,1,1,0,0,-817.2394,-4942.282,21.2968235,5.06702662,45,10,0,1,0,0,1), -- Sen'jin Frog +(@CGuid+16,@N_Frog,1,1,1,0,0,-858.816,-5039.144,3.00985622,0,45,10,0,1,0,0,1), -- Sen'jin Frog +(@CGuid+17,@N_Frog,1,1,1,0,0,-879.258667,-4998.14063,11.6243248,0,45,10,0,1,0,0,1), -- Sen'jin Frog +(@CGuid+18,@N_Frog,1,1,1,0,0,-899.050354,-4994.48633,11.61574,0,45,10,0,1,0,0,1), -- Sen'jin Frog +(@CGuid+19,@N_Frog,1,1,1,0,0,-924.550354,-4933.639,15.4050817,0,45,10,0,1,0,0,1), -- Sen'jin Frog +(@CGuid+20,@N_BatHandler,1,1,1,0,0,-840.052063,-4982.163,14.42927,4.86946869,120,0,0,1,0,0,0), -- Handler Marnlek +(@CGuid+21,@N_Bat,1,1,1,0,0,-833.529541,-4980.7207,17.1929779,4.29351,120,0,0,1,0,0,0), -- Scout Bat +(@CGuid+22,@N_SpyFrogCredit,1,1,1,19595,0,-1020.20831,-5152.76758,0.7509203,0,120,0,0,1,0,0,0), -- Spy Frog Credit +(@CGuid+23,@N_SpyFrogCredit,1,1,1,19595,0,-1040.78821,-5585.186,3.46228218,0,120,0,0,1,0,0,0), -- Spy Frog Credit +(@CGuid+24,@N_SpyFrogCredit,1,1,1,19595,0,-1049.91846,-5542.507,7.80553341,0,120,0,0,1,0,0,0), -- Spy Frog Credit +(@CGuid+25,@N_SpyFrogCredit,1,1,1,19595,0,-1060.92017,-5459.61963,8.204561,0,120,0,0,1,0,0,0), -- Spy Frog Credit +(@CGuid+26,@N_SpyFrogCredit,1,1,1,19595,0,-1061.52954,-5631.46338,4.56439066,0,120,0,0,1,0,0,0), -- Spy Frog Credit +(@CGuid+27,@N_SpyFrogCredit,1,1,1,19595,0,-1066.36108,-5374.9165,6.87270164,0,120,0,0,1,0,0,0), -- Spy Frog Credit +(@CGuid+28,@N_SpyFrogCredit,1,1,1,19595,0,-1088.9635,-5173.884,0.8336973,0,120,0,0,1,0,0,0), -- Spy Frog Credit +(@CGuid+29,@N_SpyFrogCredit,1,1,1,19595,0,-1102.04858,-5435.264,10.6309662,0,120,0,0,1,0,0,0), -- Spy Frog Credit +(@CGuid+30,@N_SpyFrogCredit,1,1,1,19595,0,-1123.28821,-5619.78125,5.64494038,0,120,0,0,1,0,0,0), -- Spy Frog Credit +(@CGuid+31,@N_SpyFrogCredit,1,1,1,19595,0,-1127.76917,-5131.19971,2.93869424,0,120,0,0,1,0,0,0), -- Spy Frog Credit +(@CGuid+32,@N_SpyFrogCredit,1,1,1,19595,0,-1129.83167,-5481.14941,7.60199165,0,120,0,0,1,0,0,0), -- Spy Frog Credit +(@CGuid+33,@N_SpyFrogCredit,1,1,1,19595,0,-1148.42542,-5413.82275,9.589724,0,120,0,0,1,0,0,0), -- Spy Frog Credit +(@CGuid+34,@N_SpyFrogCredit,1,1,1,19595,0,-1188.81775,-5342.51758,4.28526449,0,120,0,0,1,0,0,0), -- Spy Frog Credit +(@CGuid+35,@N_SpyFrogCredit,1,1,1,19595,0,-1194.816,-5617.877,6.84516954,0,120,0,0,1,0,0,0), -- Spy Frog Credit +(@CGuid+36,@N_SpyFrogCredit,1,1,1,19595,0,-1201.60413,-5379.16846,8.589357,0,120,0,0,1,0,0,0), -- Spy Frog Credit +(@CGuid+37,@N_SpyFrogCredit,1,1,1,19595,0,-1240.37854,-5594.7085,8.538581,0,120,0,0,1,0,0,0), -- Spy Frog Credit +(@CGuid+38,@N_SpyFrogCredit,1,1,1,19595,0,-1269.05212,-5386.241,4.37299967,0,120,0,0,1,0,0,0), -- Spy Frog Credit +(@CGuid+39,@N_SpyFrogCredit,1,1,1,19595,0,-1288.60242,-5571.11475,7.43579245,0,120,0,0,1,0,0,0), -- Spy Frog Credit +(@CGuid+40,@N_SpyFrogCredit,1,1,1,19595,0,-1290.526,-5122.43066,1.76108432,0,120,0,0,1,0,0,0), -- Spy Frog Credit +(@CGuid+41,@N_SpyFrogCredit,1,1,1,19595,0,-1304.35938,-5169.80029,0.8500093,0,120,0,0,1,0,0,0), -- Spy Frog Credit +(@CGuid+42,@N_SpyFrogCredit,1,1,1,19595,0,-1319.65625,-5477.335,5.18921232,0,120,0,0,1,0,0,0), -- Spy Frog Credit +(@CGuid+43,@N_SpyFrogCredit,1,1,1,19595,0,-1321.61108,-5527.35938,4.55899572,0,120,0,0,1,0,0,0), -- Spy Frog Credit +(@CGuid+44,@N_SpyFrogCredit,1,1,1,19595,0,-1423.26221,-5171.405,3.53906035,0,120,0,0,1,0,0,0), -- Spy Frog Credit +(@CGuid+45,@N_SpyFrogCredit,1,1,1,19595,0,-1502.29688,-5262.67725,4.59295273,0,120,0,0,1,0,0,0), -- Spy Frog Credit +(@CGuid+46,@N_SpyFrogCredit,1,1,1,19595,0,-1532.30725,-5340.738,7.00164938,0,120,0,0,1,0,0,0), -- Spy Frog Credit +(@CGuid+47,@N_SpyFrogCredit,1,1,1,19595,0,-1589.217,-5340.08154,7.06946659,0,120,0,0,1,0,0,0), -- Spy Frog Credit +(@CGuid+48,@N_SpyFrogCredit,1,1,1,19595,0,-1611.14233,-5275.979,7.61691332,0,120,0,0,1,0,0,0), -- Spy Frog Credit +(@CGuid+49,@N_SpyFrogCredit,1,1,1,19595,0,-654.15625,-5626.69971,7.23921061,0,120,0,0,1,0,0,0), -- Spy Frog Credit +(@CGuid+50,@N_SpyFrogCredit,1,1,1,19595,0,-688.0955,-5517.6875,6.0036335,0,120,0,0,1,0,0,0), -- Spy Frog Credit +(@CGuid+51,@N_SpyFrogCredit,1,1,1,19595,0,-729.5972,-5655.9707,20.0036564,0,120,0,0,1,0,0,0), -- Spy Frog Credit +(@CGuid+52,@N_SpyFrogCredit,1,1,1,19595,0,-732.177063,-5498.76758,5.77328968,0,120,0,0,1,0,0,0), -- Spy Frog Credit +(@CGuid+53,@N_SpyFrogCredit,1,1,1,19595,0,-794.5955,-5544.462,5.39234161,0,120,0,0,1,0,0,0), -- Spy Frog Credit +(@CGuid+54,@N_SpyFrogCredit,1,1,1,19595,0,-794.699646,-5350.50537,2.74348927,0,120,0,0,1,0,0,0), -- Spy Frog Credit +(@CGuid+55,@N_SpyFrogCredit,1,1,1,19595,0,-805.8073,-5674.384,6.65550661,0,120,0,0,1,0,0,0), -- Spy Frog Credit +(@CGuid+56,@N_SpyFrogCredit,1,1,1,19595,0,-835.071167,-5606.038,4.20461655,0,120,0,0,1,0,0,0), -- Spy Frog Credit +(@CGuid+57,@N_SpyFrogCredit,1,1,1,19595,0,-853.2448,-5335.12842,2.75194836,0,120,0,0,1,0,0,0), -- Spy Frog Credit +(@CGuid+58,@N_SpyFrogCredit,1,1,1,19595,0,-954.821167,-5186.238,1.09095335,0,120,0,0,1,0,0,0), -- Spy Frog Credit +(@CGuid+59,@N_TigerCredit,1,1,1,0,0,-1122.29346,-5126.54346,2.91218519,0.7679449,120,0,0,1,0,0,0), -- Tiger Matriarch Credit +(@CGuid+60,@N_Uruzin,1,1,1,0,0,-765.4323,-5018.39746,17.1423054,3.73500466,120,0,0,1,0,0,0), -- Champion Uru'zin +(@CGuid+61,@N_DWarrior,1,1,1,0,0,-732.241333,-5022.276,16.84526,3.89208412,120,0,0,1,0,0,0), -- Darkspear Warrior +(@CGuid+62,@N_DWarrior,1,1,1,0,0,-735.364563,-5027.39941,16.4661217,2.00712872,120,0,0,1,0,0,0), -- Darkspear Warrior +(@CGuid+63,@N_DWarrior,1,1,1,0,0,-738.178833,-4955.24854,22.872057,4.276057,120,0,0,1,0,0,0), -- Darkspear Warrior +(@CGuid+64,@N_DWarrior,1,1,1,0,0,-738.25,-4962.1665,22.7414722,2.09439516,120,0,0,1,0,0,0), -- Darkspear Warrior +(@CGuid+65,@N_DWarrior,1,1,1,0,0,-741.2917,-4956.875,22.88887,5.88175964,120,0,0,1,0,0,0), -- Darkspear Warrior +(@CGuid+66,@N_DWarrior,1,1,1,0,0,-749.0781,-5000.17041,20.16327,3.89208412,120,0,0,1,0,0,0), -- Darkspear Warrior +(@CGuid+67,@N_DWarrior,1,1,1,0,0,-757.1233,-4992.118,21.0182743,3.96189737,120,0,0,1,0,0,0), -- Darkspear Warrior +(@CGuid+68,@N_DWarrior,1,1,1,0,0,-763.309,-5027.79541,16.8784733,0.7330383,120,0,0,1,0,0,0), -- Darkspear Warrior +(@CGuid+69,@N_DWarrior,1,1,1,0,0,-765.3125,-5030.11133,16.3195953,0.715585,120,0,0,1,0,0,0), -- Darkspear Warrior +(@CGuid+70,@N_DWarrior,1,1,1,0,0,-765.8906,-5025.62158,16.8368073,0.715585,120,0,0,1,0,0,0), -- Darkspear Warrior +(@CGuid+71,@N_DWarrior,1,1,1,0,0,-767.1684,-5032.358,16.15991,0.7330383,120,0,0,1,0,0,0), -- Darkspear Warrior +(@CGuid+72,@N_DWarrior,1,1,1,0,0,-767.9028,-5027.934,16.3112679,0.7679449,120,0,0,1,0,0,0), -- Darkspear Warrior +(@CGuid+73,@N_DWarrior,1,1,1,0,0,-768.635437,-5023.29541,16.7641678,0.75049156,120,0,0,1,0,0,0), -- Darkspear Warrior +(@CGuid+74,@N_DWarrior,1,1,1,0,0,-769.75,-5030.163,16.0145359,0.715585,120,0,0,1,0,0,0), -- Darkspear Warrior +(@CGuid+75,@N_DWarrior,1,1,1,0,0,-770.6458,-5025.61475,16.2830353,0.6981317,120,0,0,1,0,0,0), -- Darkspear Warrior +(@CGuid+76,@N_DWarrior,1,1,1,0,0,-771.302063,-5021.15967,16.708334,0.75049156,120,0,0,1,0,0,0), -- Darkspear Warrior +(@CGuid+77,@N_DWarrior,1,1,1,0,0,-772.487854,-5027.84375,16.176178,0.5934119,120,0,0,1,0,0,0), -- Darkspear Warrior +(@CGuid+78,@N_DWarrior,1,1,1,0,0,-773.3264,-5023.50342,16.5206375,0.7330383,120,0,0,1,0,0,0), -- Darkspear Warrior +(@CGuid+79,@N_DWarrior,1,1,1,0,0,-773.822937,-5019.007,16.52002,0.610865235,120,0,0,1,0,0,0), -- Darkspear Warrior +(@CGuid+80,@N_DWarrior,1,1,1,0,0,-775.158,-5025.7085,16.1457977,0.75049156,120,0,0,1,0,0,0), -- Darkspear Warrior +(@CGuid+81,@N_DWarrior,1,1,1,0,0,-775.8455,-5021.35059,16.11615,0.558505356,120,0,0,1,0,0,0), -- Darkspear Warrior +(@CGuid+82,@N_DWarrior,1,1,1,0,0,-777.677063,-5023.559,15.9583549,0.610865235,120,0,0,1,0,0,0), -- Darkspear Warrior +(@CGuid+83,@N_DScout,1,1,1,0,0,-860.102844,-5113.565,47.2615623,1.28633785,600,0,0,1,0,0,0), -- Darkspear Scout +(@CGuid+84,@N_Voljin,1,1,1,0,0,-755.1476,-4998.04,20.3369122,4.03171062,120,0,0,1,0,0,0), -- Vol'jin +(@CGuid+85,@N_RDancer,1,1,1,0,0,-794.6799,-4988.15674,17.72195,3.49065852,120,0,0,1,0,0,0), -- Ritual Dancer +(@CGuid+86,@N_RDancer,1,1,1,0,0,-794.896362,-4997.275,17.1909542,3.21140575,120,0,0,1,0,0,0), -- Ritual Dancer +(@CGuid+87,@N_RDancer,1,1,1,0,0,-800.975769,-4981.555,17.78231,4.276057,120,0,0,1,0,0,0), -- Ritual Dancer +(@CGuid+88,@N_RDancer,1,1,1,0,0,-801.497,-5003.56934,16.5553436,2.21656823,120,0,0,1,0,0,0), -- Ritual Dancer +(@CGuid+89,@N_RDancer,1,1,1,0,0,-810.093933,-4981.34033,17.4377289,5.148721,120,0,0,1,0,0,0), -- Ritual Dancer +(@CGuid+90,@N_RDancer,1,1,1,0,0,-810.6152,-5003.353,16.2423363,0.994837642,120,0,0,1,0,0,0), -- Ritual Dancer +(@CGuid+91,@N_RDancer,1,1,1,0,0,-816.6938,-4987.63574,16.7508545,5.846853,120,0,0,1,0,0,0), -- Ritual Dancer +(@CGuid+92,@N_RDancer,1,1,1,0,0,-816.9091,-4996.754,16.6877289,0.34906584,120,0,0,1,0,0,0), -- Ritual Dancer +(@CGuid+93,@N_Citizien1,1,1,1,0,0,246.170135,-4714.729,15.371768,5.6548667,120,0,0,1,0,0,0), -- Troll Citizien (1) +(@CGuid+94,@N_Citizien1,1,1,1,0,0,247.421875,-4675.27246,16.1996269,0.296705961,120,0,0,1,0,0,0), -- Troll Citizien (1) +(@CGuid+95,@N_Citizien1,1,1,1,0,0,248.00174,-4672.84033,16.0127563,5.41052055,120,0,0,1,0,0,0), -- Troll Citizien (1) +(@CGuid+96,@N_Citizien1,1,1,1,0,0,271.295135,-4739.4585,9.89915,5.794493,120,0,0,1,0,0,0), -- Troll Citizien (1) +(@CGuid+97,@N_Citizien1,1,1,1,0,0,273.3559,-4774.604,12.1704369,0.9599311,120,0,0,1,0,0,0), -- Troll Citizien (1) +(@CGuid+98,@N_Citizien1,1,1,1,0,0,273.432281,-4738.96338,9.832179,3.73500466,120,0,0,1,0,0,0), -- Troll Citizien (1) +(@CGuid+99,@N_Citizien1,1,1,1,0,0,343.7361,-4791.71533,11.36291,0.9599311,120,0,0,1,0,0,0), -- Troll Citizien (1) +(@CGuid+100,@N_Citizien1,1,1,1,0,0,351.678833,-4693.84033,16.5411034,2.25147462,120,0,0,1,0,0,0), -- Troll Citizien (1) +(@CGuid+101,@N_Citizien1,1,1,1,0,0,369.43576,-4690.94971,15.8566027,5.39306736,120,0,0,1,0,0,0), -- Troll Citizien (1) +(@CGuid+102,@N_Citizien1,1,1,1,0,0,375.81424,-4775.57666,12.5081263,5.75958633,120,0,0,1,0,0,0), -- Troll Citizien (1) +(@CGuid+103,@N_Citizien1,1,1,1,0,0,408.949646,-4703.797,9.698563,4.60766935,120,0,0,1,0,0,0), -- Troll Citizien (1) +(@CGuid+104,@N_Citizien1,1,1,1,0,0,411.1059,-4704.4585,9.560572,3.822271,120,0,0,1,0,0,0), -- Troll Citizien (1) +(@CGuid+105,@N_Citizien2,1,1,1,0,0,246.520828,-4717.009,15.2929316,1.53588974,120,0,0,1,0,0,0), -- Troll Citizien (2) +(@CGuid+106,@N_Citizien2,1,1,1,0,0,254.949661,-4698.413,14.71032,2.72271371,120,0,0,1,0,0,0), -- Troll Citizien (2) +(@CGuid+107,@N_Citizien2,1,1,1,0,0,266.074646,-4829.903,10.9051781,0.331612557,120,0,0,1,0,0,0), -- Troll Citizien (2) +(@CGuid+108,@N_Citizien2,1,1,1,0,0,289.449646,-4820.14258,10.6073713,0.9599311,120,0,0,1,0,0,0), -- Troll Citizien (2) +(@CGuid+109,@N_Citizien2,1,1,1,0,0,293.4236,-4798.14063,10.0895939,2.25147462,120,0,0,1,0,0,0), -- Troll Citizien (2) +(@CGuid+110,@N_Citizien2,1,1,1,0,0,333.5087,-4815.271,10.6071978,2.82743335,120,0,0,1,0,0,0), -- Troll Citizien (2) +(@CGuid+111,@N_Citizien2,1,1,1,0,0,338.1736,-4669.69434,16.5411034,4.712389,120,0,0,1,0,0,0), -- Troll Citizien (2) +(@CGuid+112,@N_Citizien2,1,1,1,0,0,343.204865,-4831.057,10.1974783,0.2443461,120,0,0,1,0,0,0), -- Troll Citizien (2) +(@CGuid+113,@N_Citizien2,1,1,1,0,0,343.3646,-4789.488,11.7296114,6.091199,120,0,0,1,0,0,0), -- Troll Citizien (2) +(@CGuid+114,@N_Citizien2,1,1,1,0,0,345.03125,-4831.41162,10.3018608,2.60054064,120,0,0,1,0,0,0), -- Troll Citizien (2) +(@CGuid+115,@N_Citizien2,1,1,1,0,0,349.482635,-4724.882,10.3245821,3.12413931,120,0,0,1,0,0,0), -- Troll Citizien (2) +(@CGuid+116,@N_Citizien2,1,1,1,0,0,375.765625,-4777.94629,12.5297422,0.7679449,120,0,0,1,0,0,0), -- Troll Citizien (2) +(@CGuid+117,@N_Doctor,1,1,1,0,0,-805.0104,-4975.75,17.75085,4.655138,120,0,0,1,0,0,0); -- Witch Doctor Hez'tok + +/* ### Gameobjects ### */ +-- Templates +UPDATE `gameobject_template` SET `flags`=`flags`|32 WHERE `entry`=@G_BatTotem; -- Sen'jin Bat Totem +UPDATE `gameobject_template` SET `flags`=`flags`|32 WHERE `entry`=@G_BatStraw; -- Sen'jin Bat Roost Straw +UPDATE `gameobject_template` SET `flags`=`flags`|32 WHERE `entry`=@G_BatFence; -- Sen'jin Bat Roost Fence +UPDATE `gameobject_template` SET `flags`=`flags`|32 WHERE `entry`=@G_BatPost; -- Sen'jin Bat Roost Fence Post +UPDATE `gameobject_template` SET `faction`=114 WHERE `entry`=@G_RDrum; -- Ritual Drum +UPDATE `gameobject_template` SET `faction`=114 WHERE `entry`=@G_RGong; -- Ritual Gong +UPDATE `gameobject_template` SET `flags`=`flags`|32 WHERE `entry`=@G_Banner; -- Sen'jin Banner +UPDATE `gameobject_template` SET `flags`=`flags`|32 WHERE `entry`=@G_Tent; -- Sen'jin Tent +-- Spawns +DELETE FROM `gameobject` WHERE `id` IN (@G_BatTotem,@G_BatStraw,@G_BatFence,@G_BatPost,@G_RDrum,@G_RGong,@G_RBrazier,@G_SRDrum,@G_SRDrum2,@G_Banner,@G_Tent,@G_Table,@G_Book1,@G_Book2,@G_CCrate,@G_OCrate,@G_SPennant); +INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES +(@GGuid+0,@G_BatTotem,1,1,1,-839.1424,-4978.337,14.5841064,-2.94959545,0,0,0,0,120,0,1), -- Sen'jin Bat Totem +(@GGuid+1,@G_BatStraw,1,1,1,-833.6285,-4980.71338,14.823576,-2.70525527,0,0,0,0,120,0,1), -- Sen'jin Bat Roost Straw +(@GGuid+2,@G_BatFence,1,1,1,-827.066,-4983.64063,15.518714,-3.07176614,0,0,0,0,120,0,1), -- Sen'jin Bat Roost Fence +(@GGuid+3,@G_BatFence,1,1,1,-829.5955,-4978.009,15.6437654,-2.44346023,0,0,0,0,120,0,1), -- Sen'jin Bat Roost Fence +(@GGuid+4,@G_BatPost,1,1,1,-831.7917,-4975.60938,15.85345,-2.40855432,0,0,0,0,120,0,1), -- Sen'jin Bat Roost Fence Post +(@GGuid+5,@G_RDrum,1,1,1,-797.4774,-4972.70166,17.8050346,-2.12930059,0,0,0,0,120,0,1), -- Ritual Drum +(@GGuid+6,@G_RGong,1,1,1,-789.6094,-4979.12842,18.0358353,-2.54817939,0,0,0,0,120,0,1), -- Ritual Gong +(@GGuid+7,@G_RBrazier,1,1,1,-806.4583,-4993.28125,16.5453663,0,0,0,0,0,120,0,1), -- Ritual Brazier +(@GGuid+8,@G_SRDrum,1,1,1,-799.1007,-4987.36475,17.63783,0.2792516,0,0,0,0,120,0,1), -- Small Ritual Drum +(@GGuid+9,@G_SRDrum,1,1,1,-811.529541,-4988.205,17.119791,-1.08210289,0,0,0,0,120,0,1), -- Small Ritual Drum +(@GGuid+10,@G_SRDrum2,1,1,1,-799.7882,-4986.07275,17.487505,0.2792516,0,0,0,0,120,0,1), -- Small Ritual Drum 2 +(@GGuid+11,@G_SRDrum2,1,1,1,-810.487854,-4987.1665,17.1008987,-1.08210289,0,0,0,0,120,0,1), -- Small Ritual Drum 2 +(@GGuid+12,@G_Banner,1,1,1,-747.2708,-4998.53467,20.1927032,-2.373644,0,0,0,0,120,0,1), -- Sen'jin Banner +(@GGuid+13,@G_Banner,1,1,1,-755.0156,-4990.882,20.33256,-2.321287,0,0,0,0,120,0,1), -- Sen'jin Banner +(@GGuid+14,@G_Banner,1,1,1,-763.5799,-4919.818,20.1778774,-0.122172989,0,0,0,0,120,0,1), -- Sen'jin Banner +(@GGuid+15,@G_Banner,1,1,1,-764.842041,-4936.15967,21.0983143,-0.209439442,0,0,0,0,120,0,1), -- Sen'jin Banner +(@GGuid+16,@G_Banner,1,1,1,-775.4427,-4895.79541,19.8775959,0.733038247,0,0,0,0,120,0,1), -- Sen'jin Banner +(@GGuid+17,@G_Banner,1,1,1,-789.1441,-4880.585,19.14895,0.7504908,0,0,0,0,120,0,1), -- Sen'jin Banner +(@GGuid+18,@G_Banner,1,1,1,-834.1094,-4873.14746,20.0067558,1.16936862,0,0,0,0,120,0,1), -- Sen'jin Banner +(@GGuid+19,@G_Banner,1,1,1,-857.8316,-4945.30566,20.62204,2.70525527,0,0,0,0,120,0,1), -- Sen'jin Banner +(@GGuid+20,@G_Banner,1,1,1,-863.6007,-4916.259,19.7371979,-2.28637886,0,0,0,0,120,0,1), -- Sen'jin Banner +(@GGuid+21,@G_Tent,1,1,1,-736.0573,-5025.12842,16.7929783,2.75761318,0,0,0,0,120,0,1), -- Sen'jin Tent +(@GGuid+22,@G_Tent,1,1,1,-738.6719,-4956.72754,22.8236065,2.75761318,0,0,0,0,120,0,1), -- Sen'jin Tent +(@GGuid+23,@G_Table,1,1,1,-736.4427,-5024.759,16.54466,0,0,0,0,0,120,0,1), -- Sen'jin Table +(@GGuid+24,@G_Table,1,1,1,-739.4375,-4957.403,22.8180714,0,0,0,0,0,120,0,1), -- Sen'jin Table +(@GGuid+25,@G_Book1,1,1,1,-735.8073,-5024.637,17.6406937,-0.6632232,0,0,0,0,120,0,1), -- Troll Book 1 +(@GGuid+26,@G_Book1,1,1,1,-737.0833,-5024.98438,17.5850124,-3.10665226,0,0,0,0,120,0,1), -- Troll Book 1 +(@GGuid+27,@G_Book1,1,1,1,-739.1528,-4958.62158,23.8722477,-1.23918331,0,0,0,0,120,0,1), -- Troll Book 1 +(@GGuid+28,@G_Book2,1,1,1,-736.213562,-5025.762,17.5919647,-1.2566359,0,0,0,0,120,0,1), -- Troll Book 2 +(@GGuid+29,@G_Book2,1,1,1,-739.194458,-4957.163,23.8564358,0.994837165,0,0,0,0,120,0,1), -- Troll Book 2 +(@GGuid+30,@G_Book2,1,1,1,-740.059,-4958.033,23.8347683,-2.84488273,0,0,0,0,120,0,1), -- Troll Book 2 +(@GGuid+31,@G_CCrate,1,1,1,-740.7344,-5022.94775,16.8128815,1.3264482,0,0,0,0,120,0,1), -- Closed Weapon Crate +(@GGuid+32,@G_CCrate,1,1,1,-740.8455,-5023.08154,17.3481083,1.79768872,0,0,0,0,120,0,1), -- Closed Weapon Crate +(@GGuid+33,@G_CCrate,1,1,1,-742.066,-4997.028,20.3147964,-0.0523588844,0,0,0,0,120,0,1), -- Closed Weapon Crate +(@GGuid+34,@G_CCrate,1,1,1,-742.098938,-4997.07129,20.8562927,-0.733038247,0,0,0,0,120,0,1), -- Closed Weapon Crate +(@GGuid+35,@G_CCrate,1,1,1,-743.295166,-4954.14258,22.7840157,1.3264482,0,0,0,0,120,0,1), -- Closed Weapon Crate +(@GGuid+36,@G_CCrate,1,1,1,-743.3125,-4954.191,23.3492069,2.86233544,0,0,0,0,120,0,1), -- Closed Weapon Crate +(@GGuid+37,@G_CCrate,1,1,1,-806.2153,-4925.30225,19.9984951,1.3264482,0,0,0,0,120,0,1), -- Closed Weapon Crate +(@GGuid+38,@G_CCrate,1,1,1,-806.2483,-4925.19775,19.4074268,-2.23401761,0,0,0,0,120,0,1), -- Closed Weapon Crate +(@GGuid+39,@G_CCrate,1,1,1,-819.258667,-4934.972,21.0808868,-1.04719758,0,0,0,0,120,0,1), -- Closed Weapon Crate +(@GGuid+40,@G_CCrate,1,1,1,-819.3316,-4935,20.471838,-1.58824873,0,0,0,0,120,0,1), -- Closed Weapon Crate +(@GGuid+41,@G_OCrate,1,1,1,-740.9323,-5023.299,17.89152,-2.513274,0,0,0,0,120,0,1), -- Open Weapon Crate +(@GGuid+42,@G_OCrate,1,1,1,-742.0833,-4997.009,21.4263363,-2.513274,0,0,0,0,120,0,1), -- Open Weapon Crate +(@GGuid+43,@G_OCrate,1,1,1,-743.2639,-4954.288,23.9839115,2.30383062,0,0,0,0,120,0,1), -- Open Weapon Crate +(@GGuid+44,@G_OCrate,1,1,1,-819.381958,-4934.98438,21.6449852,-0.366517574,0,0,0,0,120,0,1), -- Open Weapon Crate +(@GGuid+45,@G_SPennant,1,1,1,-729.473938,-5019.743,27.5368786,2.40855432,0,0,0,0,120,0,1), -- Sen'jin Pennant +(@GGuid+46,@G_SPennant,1,1,1,-732.1042,-4951.34033,33.59528,2.40855432,0,0,0,0,120,0,1), -- Sen'jin Pennant +(@GGuid+47,@G_SPennant,1,1,1,-735.2778,-5033.16162,27.6115456,2.40855432,0,0,0,0,120,0,1), -- Sen'jin Pennant +(@GGuid+48,@G_SPennant,1,1,1,-736.4948,-5024.741,32.8763771,2.40855432,0,0,0,0,120,0,1), -- Sen'jin Pennant +(@GGuid+49,@G_SPennant,1,1,1,-737.885437,-4964.80371,33.6575661,2.40855432,0,0,0,0,120,0,1), -- Sen'jin Pennant +(@GGuid+50,@G_SPennant,1,1,1,-739.0625,-4956.28662,39.0746231,2.40855432,0,0,0,0,120,0,1), -- Sen'jin Pennant +(@GGuid+51,@G_SPennant,1,1,1,-744.319458,-5021.384,27.2134647,2.40855432,0,0,0,0,120,0,1), -- Sen'jin Pennant +(@GGuid+52,@G_SPennant,1,1,1,-746.8889,-4953.03,33.6572571,2.40855432,0,0,0,0,120,0,1), -- Sen'jin Pennant +(@GGuid+53,@G_SPennant,1,1,1,-775.2899,-4910.69434,32.3446465,2.40855432,0,0,0,0,120,0,1), -- Sen'jin Pennant +(@GGuid+54,@G_SPennant,1,1,1,-784.7708,-4942.91846,55.81524,2.40855432,0,0,0,0,120,0,1), -- Sen'jin Pennant +(@GGuid+55,@G_SPennant,1,1,1,-802.7708,-4915.73633,29.8921642,2.40855432,0,0,0,0,120,0,1), -- Sen'jin Pennant +(@GGuid+56,@G_SPennant,1,1,1,-802.798645,-4896.53662,30.4030666,2.40855432,0,0,0,0,120,0,1), -- Sen'jin Pennant +(@GGuid+57,@G_SPennant,1,1,1,-835.0399,-4898.42725,30.9498634,2.40855432,0,0,0,0,120,0,1), -- Sen'jin Pennant +(@GGuid+58,@G_SPennant,1,1,1,-842.7656,-4939.89941,33.59177,2.40855432,0,0,0,0,120,0,1); -- Sen'jin Pennant + + +/* ### Quests ### */ +DELETE FROM `disables` WHERE `entry` IN (@Q_DaPerfectSpies,@Q_FrogsAway,@Q_LadyOfDaTigers,@Q_DanceOfDeSpirits,@Q_TrollinForVolunteers,@Q_PreparinForBattle,@Q_ZalazanesFall); -- WTF. +-- Templates +UPDATE `quest_template` SET `PrevQuestId`=@Q_DaPerfectSpies WHERE `entry`=@Q_FrogsAway; +UPDATE `quest_template` SET `PrevQuestId`=@Q_FrogsAway WHERE `entry`=@Q_TrollinForVolunteers; +UPDATE `quest_template` SET `PrevQuestId`=@Q_TrollinForVolunteers WHERE `entry`=@Q_LadyOfDaTigers; +UPDATE `quest_template` SET `PrevQuestId`=@Q_LadyOfDaTigers WHERE `entry`=@Q_DanceOfDeSpirits; +UPDATE `quest_template` SET `PrevQuestId`=@Q_DanceOfDeSpirits WHERE `entry`=@Q_PreparinForBattle; +UPDATE `quest_template` SET `PrevQuestId`=@Q_PreparinForBattle WHERE `entry`=@Q_ZalazanesFall; +UPDATE `quest_template` SET `OfferRewardText` = 'These be enough for me purposes. Now comes de hard part.' WHERE `entry`=@Q_DaPerfectSpies; +UPDATE `quest_template` SET `OfferRewardText` = 'I''m already beginnin'' to see what de frogs are seein''. Ya done it perfectly, $N. Now Vol''jin and I will see what Zalazane be plannin''.' WHERE `entry`=@Q_FrogsAway; +UPDATE `quest_template` SET `OfferRewardText` = 'Vanira''s frog be tellin'' de truth, den? Dis tiger be a druid and an ally? We couldn''t be hopin'' for a better outcome. Dis be a good omen for de coming battle.' WHERE `entry`=@Q_LadyOfDaTigers; +UPDATE `quest_template` SET `OfferRewardText` = 'Ya found some good ones. I be trainin'' them hard and we won''t stop until we''ve driven Zalazane from our islands.' WHERE `entry`=@Q_TrollinForVolunteers; +UPDATE `quest_template` SET `OfferRewardText` = 'I will take de spirits'' advice to heart. Wit'' dem behind us and de power of de ancient loas of de Darkspear Tribe, we be ready to reclaim what''s ours!' WHERE `entry`=@Q_DanceOfDeSpirits; +UPDATE `quest_template` SET `OfferRewardText` = 'At last, everythin'' be ready. Now, we show Zalazane what happen to dose who defy de Darkspears!' WHERE `entry`=@Q_PreparinForBattle; +UPDATE `quest_template` SET `OfferRewardText` = '$N, you''d be a mighty warrior and a fierce commrade to da Darkspear trolls. De Echo Isles are OURS now and we couldn''ta done it wit''out ya.$B$BTake dis cloak. Wear it wit pride. You''d be a member of da tribe now!$B$BIn no time, da trolls will have a home again and we have you to thank for dat.' WHERE `entry`=@Q_ZalazanesFall; +-- Relations +DELETE FROM `creature_involvedrelation` WHERE `id` IN (@N_Vanira,@N_Voljin,@N_Uruzin,@N_VoljinBoss); +INSERT INTO `creature_involvedrelation` (`id`,`quest`) VALUES +(@N_Vanira,@Q_DaPerfectSpies), +(@N_Vanira,@Q_FrogsAway), +(@N_Voljin,@Q_LadyOfDaTigers), +(@N_Voljin,@Q_DanceOfDeSpirits), +(@N_Uruzin,@Q_TrollinForVolunteers), +(@N_VoljinBoss,@Q_PreparinForBattle), +(@N_Voljin,@Q_ZalazanesFall); +-- Map POI +DELETE FROM `quest_poi` WHERE `questid` IN (@Q_FrogsAway,@Q_TrollinForVolunteers,@Q_LadyOfDaTigers,@Q_DanceOfDeSpirits,@Q_PreparinForBattle,@Q_DaPerfectSpies); +INSERT INTO `quest_poi` (`questid`,`id`,`objIndex`,`mapId`,`WorldMapAreaId`,`FloorId`,`unk3`,`unk4`) VALUES +(@Q_FrogsAway,0,0,1,4,0,0,1),(@Q_FrogsAway,1,0,1,4,0,0,1), +(@Q_FrogsAway,2,0,1,4,0,0,1),(@Q_FrogsAway,3,0,1,4,0,0,1), +(@Q_FrogsAway,4,-1,1,4,0,0,1),(@Q_TrollinForVolunteers,0,0,1,4,0,0,1), +(@Q_TrollinForVolunteers,1,-1,1,4,0,0,1),(@Q_LadyOfDaTigers,0,0,1,4,0,0,1), +(@Q_LadyOfDaTigers,1,-1,1,4,0,0,1),(@Q_DanceOfDeSpirits,0,0,1,4,0,0,1), +(@Q_DanceOfDeSpirits,1,-1,1,4,0,0,1),(@Q_PreparinForBattle,0,-1,1,4,0,0,1), +(@Q_DaPerfectSpies,0,-1,1,4,0,0,1),(@Q_DaPerfectSpies,1,10,1,4,0,0,7), +(@Q_DaPerfectSpies,2,1,1,4,0,0,7); +DELETE FROM `quest_poi_points` WHERE `questid` IN (@Q_FrogsAway,@Q_TrollinForVolunteers,@Q_LadyOfDaTigers,@Q_DanceOfDeSpirits,@Q_PreparinForBattle,@Q_DaPerfectSpies); +INSERT INTO `quest_poi_points` (`questId`,`id`,`x`,`y`) VALUES +(@Q_FrogsAway,0,-1041,-5585),(@Q_FrogsAway,0,-1062,-5631),(@Q_FrogsAway,0,-1066,-5375), +(@Q_FrogsAway,0,-1189,-5343),(@Q_FrogsAway,0,-1195,-5618),(@Q_FrogsAway,0,-1269,-5386), +(@Q_FrogsAway,0,-1289,-5571),(@Q_FrogsAway,0,-1320,-5477),(@Q_FrogsAway,0,-1322,-5527), +(@Q_FrogsAway,1,-1502,-5263),(@Q_FrogsAway,1,-1532,-5341),(@Q_FrogsAway,1,-1589,-5340), +(@Q_FrogsAway,1,-1611,-5276),(@Q_FrogsAway,2,-1020,-5153),(@Q_FrogsAway,2,-1089,-5174), +(@Q_FrogsAway,2,-1128,-5131),(@Q_FrogsAway,2,-955,-5186),(@Q_FrogsAway,3,-654,-5627), +(@Q_FrogsAway,3,-688,-5518),(@Q_FrogsAway,3,-730,-5656),(@Q_FrogsAway,3,-732,-5499), +(@Q_FrogsAway,3,-795,-5544),(@Q_FrogsAway,3,-806,-5674),(@Q_FrogsAway,3,-835,-5606), +(@Q_FrogsAway,4,-747,-5004),(@Q_TrollinForVolunteers,0,246,-4715), +(@Q_TrollinForVolunteers,0,247,-4675),(@Q_TrollinForVolunteers,0,248,-4673), +(@Q_TrollinForVolunteers,0,266,-4830),(@Q_TrollinForVolunteers,0,284,-4628), +(@Q_TrollinForVolunteers,0,302,-4612),(@Q_TrollinForVolunteers,0,343,-4831), +(@Q_TrollinForVolunteers,0,345,-4831),(@Q_TrollinForVolunteers,0,376,-4778), +(@Q_TrollinForVolunteers,0,380,-4661),(@Q_TrollinForVolunteers,0,411,-4704), +(@Q_TrollinForVolunteers,1,-765,-5018),(@Q_LadyOfDaTigers,0,-1122,-5127), +(@Q_LadyOfDaTigers,1,-755,-4998),(@Q_DanceOfDeSpirits,0,-805,-4976), +(@Q_DanceOfDeSpirits,1,-755,-4998),(@Q_PreparinForBattle,0,-804,-5373), +(@Q_DaPerfectSpies,0,-747,-5004),(@Q_DaPerfectSpies,1,-1014,-4911), +(@Q_DaPerfectSpies,1,-644,-4999),(@Q_DaPerfectSpies,1,-673,-4932), +(@Q_DaPerfectSpies,1,-673,-5062),(@Q_DaPerfectSpies,1,-736,-5100), +(@Q_DaPerfectSpies,1,-740,-4873),(@Q_DaPerfectSpies,1,-808,-4831), +(@Q_DaPerfectSpies,1,-808,-5100),(@Q_DaPerfectSpies,1,-887,-5062), +(@Q_DaPerfectSpies,1,-892,-4776),(@Q_DaPerfectSpies,1,-959,-4995), +(@Q_DaPerfectSpies,1,-984,-4785),(@Q_DaPerfectSpies,2,-749,-5024); + +/* # Quest fixes # */ + +DELETE FROM `npc_spellclick_spells` WHERE `npc_entry` IN (@N_Frog,@N_TigerSpirit); +INSERT INTO `npc_spellclick_spells` (`npc_entry`,`spell_id`,`quest_start`,`quest_start_active`,`quest_end`,`cast_flags`,`aura_required`,`aura_forbidden`,`user_type`) VALUES +(@N_Frog,@S_Pickup,@Q_DaPerfectSpies,1,@Q_DaPerfectSpies,1,0,0,0), +(@N_Frog,@S_Pickup2,@Q_DaPerfectSpies,1,@Q_DaPerfectSpies,3,0,0,0), +(@N_TigerSpirit,@S_RideVehicle,0,0,0,1,0,0,0); -- Spirit of the Tiger - Ride Vehicle Hardcoded + +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@N_Frog,@N_AtunnedFrog,@N_Vanira,@N_Zentabra,@N_DScout,@N_Citizien1,@N_Citizien2,@N_Doctor,@N_DancePart,@N_RDrummer) AND `source_type`=0; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@N_Vanira*100,@N_Zentabra*100,@N_DScout*100,@N_Doctor*100) AND `source_type`=9; +INSERT INTO `smart_scripts`(`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`)VALUES +(@N_Frog,0,0,0,8,0,100,0,@S_Pickup,0,0,0,41,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Echo Isles: Senjin Frog - add aura'), +(@N_AtunnedFrog,0,0,0,54,0,100,0,0,0,0,0,33,@N_SpyFrogCredit,0,0,0,0,0,0,0,0,0,0,0,0,0, 'Echo Isles: Spy Frog Killcredit'), -- FIXME: should be replaced by proper flare targeting +(@N_AtunnedFrog,0,1,0,25,0,100,0,0,0,0,0,89,5,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Attuned Frog: On reset set random movement'), +(@N_Vanira,0,0,0,19,0,100,0,@Q_LadyOfDaTigers,0,0,0,80,@N_Vanira*100,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Echo Isles: On quest accept run script'), +(@N_Vanira*100,9,0,0,0,0,100,0,0,0,0,0,11,@S_ForceTiger,0,0,0,0,0,7,0,0,0,0,0,0,0,'Echo Isles: Cast Force Tiger on player'), +(@N_Vanira*100,9,1,0,0,0,100,0,0,0,0,0,11,@S_NatVisual,0,0,0,0,0,1,0,0,0,0,0,0,0,'Echo Isles: Cast Nature Visual on self'), +(@N_Vanira*100,9,2,0,0,0,100,0,0,0,0,0,1,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Echo Isles: Say Text 0'), +(@N_Vanira*100,9,3,0,0,0,100,0,500,500,0,0,86,75165,0,22,0,0,0,1,0,0,0,0,0,0,0,'Echo Isles: Force Tiger cast 75165 on self'), +(@N_Zentabra,0,0,0,25,0,100,0,0,0,0,0,80,@N_Zentabra*100,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Call actionlist on spawn'), +(@N_Zentabra*100,9,0,0,0,0,100,0,0,0,0,0,66,0,0,0,0,0,0,23,0,0,0,0,0,0,0, 'Set orientation to player'), +(@N_Zentabra*100,9,1,0,0,0,100,0,0,0,0,0,11,@S_ZentrabaSmoke,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Cast spawn smoke effect on self'), +(@N_Zentabra*100,9,2,0,0,0,100,0,1000,1000,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Say text 0'), +(@N_Zentabra*100,9,3,0,0,0,100,0,1500,1500,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Say text 1'), +(@N_Zentabra*100,9,4,0,0,0,100,0,5500,5500,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Say text 2'), +(@N_Zentabra*100,9,5,0,0,0,100,0,5500,5500,0,0,1,3,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Say text 3'), +(@N_Zentabra*100,9,6,0,0,0,100,0,5500,5500,0,0,1,4,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Say text 4'), +(@N_Zentabra*100,9,7,0,0,0,100,0,0,0,0,0,33,@N_TigerCredit,0,0,0,0,0,23,0,0,0,0,0,0,0, 'Award kill credit to player'), +(@N_Zentabra*100,9,8,0,0,0,100,0,5500,5500,0,0,11,@S_ZentrabaTransform,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Cast tiger transform on self'), +(@N_Zentabra*100,9,9,0,0,0,100,0,100,100,0,0,59,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Set run on self'), +(@N_Zentabra*100,9,10,0,0,0,100,0,0,0,0,0,46,10,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Move self forward 10 yards'), +(@N_Zentabra*100,9,11,0,0,0,100,0,600,600,0,0,41,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Despawn self'), +(@N_DScout,0,0,0,25,0,100,0,0,0,0,0,53,1,@N_DScout,0,0,0,0,1,0,0,0,0,0,0,0, 'Darkspear Scout: Start waypath on spawn'), +(@N_DScout,0,1,0,40,0,100,0,1,@N_DScout,0,0,60,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Darkspear Scout: Set fly = 0 on waypoint 1'), +(@N_DScout,0,2,0,40,0,100,0,1,@N_DScout,0,0,59,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Darkspear Scout: Set run = 0 on waypoint 1'), +(@N_DScout,0,3,0,40,0,100,0,1,@N_DScout,0,0,43,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Darkspear Scout: Unmount on waypoint 1'), +(@N_DScout,0,4,0,40,0,100,0,6,@N_DScout,0,0,54,15000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Darkspear Scout: Pause waypoint on waypoint 6'), +(@N_DScout,0,5,0,40,0,100,0,6,@N_DScout,0,0,66,0,0,0,0,0,0,1,0,0,0,0,0,0,0.820305, 'Darkspear Scout: Change orientation on waypoint 6'), +(@N_DScout,0,6,0,40,0,100,0,6,@N_DScout,0,0,80,@N_DScout*100,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Darkspear Scout: Run script on waypoint 6'), +(@N_DScout,0,7,0,40,0,100,0,9,@N_DScout,0,0,41,500,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Darkspear Scout: Despawn on waypoint 9'), +(@N_DScout*100,9,0,0,0,0,100,0,0,0,0,0,10,1,2,5,66,0,0,1,0,0,0,0,0,0,0, 'Darkspear Scout: Random emote 1,2,5,66'), +(@N_DScout*100,9,1,0,0,0,50,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Darkspear Scout: Random text'), +(@N_DScout*100,9,2,0,0,0,50,0,1000,1000,0,0,1,0,0,0,0,0,0,9,@N_Voljin,0,15,0,0,0,0, 'Vol''Jin: Reply to Darkspear Scout'), +(@N_DScout*100,9,3,0,0,0,100,0,2000,2000,0,0,10,1,2,5,66,0,0,1,0,0,0,0,0,0,0, 'Darkspear Scout: Random emote 1,2,5,66'), +(@N_DScout*100,9,4,0,0,0,100,0,6000,6000,0,0,10,1,2,5,66,0,0,1,0,0,0,0,0,0,0, 'Darkspear Scout: Random emote 1,2,5,66'), +(@N_Citizien1,0,0,0,8,0,100,0,@S_VolunterSummon1,0,0,0,41,1000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Echo Isles: On spellhit - force despawn'), +(@N_Citizien2,0,0,0,8,0,100,0,@S_VolunterSummon2,0,0,0,41,1000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Echo Isles: On spellhit - force despawn'), +(@N_Doctor, 0,0,0,62,0,0,0,@Gossip+0,0,0,0,80,@N_Doctor*100,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Witch Doctor Hez''tok - On gossip select start script'), +(@N_Doctor*100,9,0,0,0,0,100,0,0,0,0,0,83,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Witch Doctor Hez''tok - Remove gossip flag'), +(@N_Doctor*100,9,1,0,0,0,100,0,1500,1500,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Witch Doctor Hez''tok - Say text 0'), +(@N_Doctor*100,9,2,0,0,0,100,0,1000,1000,0,0,12,@N_RDrummer,1,50000,0,0,0,8,0,0,0,-812.137,-4986.7,17.3759,5.89921, 'Witch Doctor Hez''tok - Summon Ritual Drummer (1)'), +(@N_Doctor*100,9,3,0,0,0,100,0,0,0,0,0,12,@N_RDrummer,1,50000,0,0,0,8,0,0,0,-798.187,-4985.52,17.7904,4.41568, 'Witch Doctor Hez''tok - Summon Ritual Drummer (2)'), +(@N_Doctor*100,9,4,0,0,0,100,0,0,0,0,0,12,@N_RDrummer,1,50000,0,0,0,8,0,0,0,-799.888,-4975.01,17.9325,0.942478, 'Witch Doctor Hez''tok - Summon Ritual Drummer (3)'), +(@N_Doctor*100,9,5,0,0,0,100,0,3500,3500,0,0,69,0,0,0,0,0,0,8,0,0,0,-806.2,-4989.5,17.5177,0, 'Witch Doctor Hez''tok - Move to pos'), +(@N_Doctor*100,9,6,0,0,0,100,0,6500,6500,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Witch Doctor Hez''tok - Say text 1'), +(@N_Doctor*100,9,7,0,0,0,100,0,5500,5500,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Witch Doctor Hez''tok - Say text 2'), +(@N_Doctor*100,9,8,0,0,0,100,0,3500,3500,0,0,5,25,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Witch Doctor Hez''tok - Do emote'), +(@N_Doctor*100,9,9,0,0,0,100,0,3500,3500,0,0,1,3,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Witch Doctor Hez''tok - Say text 3'), +(@N_Doctor*100,9,10,0,0,0,100,0,2500,2500,0,0,5,6,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Witch Doctor Hez''tok - Do emote'), +(@N_Doctor*100,9,11,0,0,0,100,0,5000,5000,0,0,11,56745,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Witch Doctor Hez''tok - Cast Drink Alcohol self'), +(@N_Doctor*100,9,12,0,0,0,100,0,600,600,0,0,11,29389,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Witch Doctor Hez''tok - Cast Firebreathing self'), +(@N_Doctor*100,9,13,0,0,0,100,0,4000,4000,0,0,90,8,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Witch Doctor Hez''tok - Set bytes1 kneel state'), +(@N_Doctor*100,9,14,0,0,0,100,0,1000,1000,0,0,12,@N_DancePart,1,40000,0,0,0,8,0,0,0,-805.8477,-5003.044,20.18328,5.89921, 'Witch Doctor Hez''tok - Summon Dance Participant (1)'), +(@N_Doctor*100,9,15,0,0,0,100,0,0,0,0,0,12,@N_DancePart,1,40000,0,0,0,8,0,0,0,-801.0605,-4998.501,18.59358,4.41568, 'Witch Doctor Hez''tok - Summon Dance Participant (2)'), +(@N_Doctor*100,9,16,0,0,0,100,0,0,0,0,0,12,@N_DancePart,1,40000,0,0,0,8,0,0,0,-808.2397,-4985.208,19.54311,0.942478, 'Witch Doctor Hez''tok - Summon Dance Participant (3)'), +(@N_Doctor*100,9,17,0,0,0,100,0,0,0,0,0,12,@N_DancePart,1,40000,0,0,0,8,0,0,0,-799.2618,-4994.353,19.61933,5.89921, 'Witch Doctor Hez''tok - Summon Dance Participant (4)'), +(@N_Doctor*100,9,18,0,0,0,100,0,0,0,0,0,12,@N_DancePart,1,40000,0,0,0,8,0,0,0,-797.8184,-4986.597,21.60157,4.41568, 'Witch Doctor Hez''tok - Summon Dance Participant (5)'), +(@N_Doctor*100,9,19,0,0,0,100,0,0,0,0,0,12,@N_DancePart,1,40000,0,0,0,8,0,0,0,-805.1284,-4987.553,18.79003,0.942478, 'Witch Doctor Hez''tok - Summon Dance Participant (6)'), +(@N_Doctor*100,9,20,0,0,0,100,0,0,0,0,0,12,@N_DancePart,1,40000,0,0,0,8,0,0,0,-814.1109,-5001.676,19.44409,5.89921, 'Witch Doctor Hez''tok - Summon Dance Participant (7)'), +(@N_Doctor*100,9,21,0,0,0,100,0,0,0,0,0,12,@N_DancePart,1,40000,0,0,0,8,0,0,0,-795.7561,-4993.671,21.80729,5.89921, 'Witch Doctor Hez''tok - Summon Dance Participant (8)'), +(@N_Doctor*100,9,22,0,0,0,100,0,1000,1000,0,0,12,@N_DAncestor,1,40000,0,0,0,8,0,0,0,-790.217041,-4999.733,17.171814,2.84488654, 'Witch Doctor Hez''tok - Summon Darkspear Ancestor (1)'), +(@N_Doctor*100,9,23,0,0,0,100,0,0,0,0,0,12,@N_DAncestor,1,40000,0,0,0,8,0,0,0,-792.0052,-4994.14258,17.4839725,2.70526028, 'Witch Doctor Hez''tok - Summon Darkspear Ancestor (2)'), +(@N_Doctor*100,9,24,0,0,0,100,0,0,0,0,0,12,@N_DAncestor,1,40000,0,0,0,8,0,0,0,-795.2049,-5003.078,17.716095,2.46091413, 'Witch Doctor Hez''tok - Summon Darkspear Ancestor (3)'), +(@N_Doctor*100,9,25,0,0,0,100,0,0,0,0,0,12,@N_DAncestor,1,40000,0,0,0,8,0,0,0,-799.2274,-5005.68066,16.6322536,2.11184835, 'Witch Doctor Hez''tok - Summon Darkspear Ancestor (4)'), +(@N_Doctor*100,9,26,0,0,0,100,0,0,0,0,0,12,@N_DAncestor,1,40000,0,0,0,8,0,0,0,-799.2557,-4990.76172,17.6279469,2.70527148, 'Witch Doctor Hez''tok - Summon Darkspear Ancestor (5)'), +(@N_Doctor*100,9,27,0,0,0,100,0,0,0,0,0,12,@N_DAncestor,1,40000,0,0,0,8,0,0,0,-801.422058,-4998.04346,17.0008545,2.46088934, 'Witch Doctor Hez''tok - Summon Darkspear Ancestor (6)'), +(@N_Doctor*100,9,28,0,0,0,100,0,0,0,0,0,12,@N_DAncestor,1,40000,0,0,0,8,0,0,0,-805.4358,-5002.88525,16.544487,1.727876, 'Witch Doctor Hez''tok - Summon Darkspear Ancestor (7)'), +(@N_Doctor*100,9,29,0,0,0,100,0,0,0,0,0,12,@N_DAncestor,1,40000,0,0,0,8,0,0,0,-807.135,-4997.469,17.0008545,1.15000379, 'Witch Doctor Hez''tok - Summon Darkspear Ancestor (8)'), +(@N_Doctor*100,9,30,0,0,0,100,0,0,0,0,0,12,@N_DAncestor,1,40000,0,0,0,8,0,0,0,-810.3698,-4993.825,17.1258545,0.808653831, 'Witch Doctor Hez''tok - Summon Darkspear Ancestor (9)'), +(@N_Doctor*100,9,31,0,0,0,100,0,0,0,0,0,12,@N_DAncestor,1,40000,0,0,0,8,0,0,0,-810.3889,-5004.778,16.12407,1.15191734, 'Witch Doctor Hez''tok - Summon Darkspear Ancestor (10)'), +(@N_Doctor*100,9,32,0,0,0,100,0,7000,7000,0,0,11,70663,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Witch Doctor Hez''tok - Cast Shadow Nova self'), +(@N_Doctor*100,9,33,0,0,0,100,0,0,0,0,0,11,31309,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Witch Doctor Hez''tok - Cast Spirit Particles self'), +(@N_Doctor*100,9,34,0,0,0,100,0,0,0,0,0,91,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Witch Doctor Hez''tok - Set bytes1 none'), +(@N_Doctor*100,9,35,0,0,0,100,0,100,100,0,0,3,@N_Voice,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Witch Doctor Hez''tok - Change entry to Voice of the Spirits'), +(@N_Doctor*100,9,36,0,0,0,100,0,100,100,0,0,3,0,31819,0,0,0,0,1,0,0,0,0,0,0,0, 'Witch Doctor Hez''tok - Change model to Voice of the Spirits'), +(@N_Doctor*100,9,37,0,0,0,100,0,1000,1000,0,0,1,4,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Witch Doctor Hez''tok - Say text 4'), +(@N_Doctor*100,9,38,0,0,0,100,0,4000,4000,0,0,1,5,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Witch Doctor Hez''tok - Say text 5'), +(@N_Doctor*100,9,39,0,0,0,100,0,3000,3000,0,0,5,25,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Witch Doctor Hez''tok - Do emote'), +(@N_Doctor*100,9,40,0,0,0,100,0,3500,3500,0,0,1,6,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Witch Doctor Hez''tok - Say text 6'), +(@N_Doctor*100,9,41,0,0,0,100,0,6000,6000,0,0,1,7,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Witch Doctor Hez''tok - Say text 7'), +(@N_Doctor*100,9,42,0,0,0,100,0,4500,4500,0,0,5,274,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Witch Doctor Hez''tok - Do emote'), +(@N_Doctor*100,9,43,0,0,0,100,0,5000,5000,0,0,1,8,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Witch Doctor Hez''tok - Say text 8'), +(@N_Doctor*100,9,44,0,0,0,100,0,4500,4500,0,0,5,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Witch Doctor Hez''tok - Do emote'), +(@N_Doctor*100,9,45,0,0,0,100,0,5500,5500,0,0,11,70663,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Witch Doctor Hez''tok - Cast Shadow Nova self'), +(@N_Doctor*100,9,46,0,0,0,100,0,100,100,0,0,28,31309,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Witch Doctor Hez''tok - Remove aura Spirit Particles'), +(@N_Doctor*100,9,47,0,0,0,100,0,0,0,0,0,3,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Witch Doctor Hez''tok - Change entry and model to Witch Doctor Hez''tok'), +(@N_Doctor*100,9,48,0,0,0,100,0,4000,4000,0,0,1,9,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Witch Doctor Hez''tok - Say text 9'), +(@N_Doctor*100,9,49,0,0,0,100,0,2500,2500,0,0,5,2,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Witch Doctor Hez''tok - Do emote'), +(@N_Doctor*100,9,50,0,0,0,100,0,0,0,0,0,85,75319,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Witch Doctor Hez''tok - Cast Omen Event Credit invoker'), -- working +-- (@N_Doctor*100,9,50,0,0,0,100,0,0,0,0,0,11,75319,2,0,0,0,0,1,0,0,0,0,0,0,0, 'Witch Doctor Hez''tok - Cast Omen Event Credit self'), -- how it shold be but not working +(@N_Doctor*100,9,51,0,0,0,100,0,5000,5000,0,0,69,0,0,0,0,0,0,8,0,0,0,-805.0104,-4975.75,17.75085,0, 'Witch Doctor Hez''tok - Move to pos'), +(@N_Doctor*100,9,52,0,0,0,100,0,5000,5000,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,4.625123, 'Witch Doctor Hez''tok - Change orientation'), +(@N_Doctor*100,9,53,0,0,0,100,0,2000,2000,0,0,82,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Witch Doctor Hez''tok - Enable gossip flag'), +(@N_DancePart,0,0,0,25,0,100,0,0,0,0,0,89,10,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Dance Participant - On reset set random movement'), +(@N_DancePart,0,1,0,25,0,100,0,0,0,0,0,3,0,22769,0,0,0,0,1,0,0,0,0,0,0,0, 'Dance Participant - On reset set model'), +(@N_RDrummer,0,0,0,1,0,100,0,0,0,1000,2000,5,38,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Ritual Drummer - Play emote attack 2h every 1 or 2 secs'), +(@N_RDrummer,0,1,0,1,0,100,0,0,0,5000,5000,11,75313,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Ritual Drummer - Cast Bang Ritual Gong every 5 seconds'), +(@N_RDrummer,0,2,0,1,0,100,1,4000,4000,0,0,4,7294,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Ritual Drummer - Play TrollDrumLoop after 4 seconds of spawn - not repeteable'), +(@N_RDrummer,0,3,0,1,0,100,0,0,0,30000,30000,4,7294,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Ritual Drummer - Play Drumms sound every 30 secs'); + +DELETE FROM `creature_text` WHERE `entry` IN (@N_Vanira,@N_Zentabra,@N_Volunteer1,@N_Volunteer2,@N_Matriarch,@N_TigerCredit,@N_Doctor,@N_DScout,@N_Voljin); +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@N_Vanira,0,0, 'O spirit of de tigers, lend $N your power and help us find de answers we seek!',0,0,100,5,0,0, 'Vanira'), +(@N_Zentabra,0,0, 'Dat be enough for now!',0,0,100,25,0,0, 'Zen''tabra'), +(@N_Zentabra,1,0, 'Don''t be lookin'' so surprised. Your shaman friend has sharp eyes, or should I say, sharp frogs.',0,0,100,1,0,0, 'Zen''tabra'), +(@N_Zentabra,2,0, 'My kind, da druids, we been layin'' low for some time now. We been waitin'' to see when an'' if Vol''jin might return.',0,0,100,11,0,0, 'Zen''tabra'), +(@N_Zentabra,3,0, 'Now dat it looks like de Darkspear be returnin'' to these isles, maybe de time has come for us to reveal ourselves.',0,0,100,1,0,0, 'Zen''tabra'), +(@N_Zentabra,4,0, 'Go back to Vol''jin an'' tell him dis: Zen''tabra stands ready to help him in de coming battle.',0,0,100,1,0,0, 'Zen''tabra'), +(@N_Volunteer1,0,0, 'Sign me up!',0,0,100,66,0,0, 'Troll Volunteer JustSpawned'), +(@N_Volunteer1,0,1, 'Anythin'' for Vol''jin!',0,0,100,0,0,0, 'Troll Volunteer JustSpawned'), +(@N_Volunteer1,0,2, 'I''d be glad to help.',0,0,100,273,0,0, 'Troll Volunteer JustSpawned'), +(@N_Volunteer1,0,3, 'Just point me at de enemy!',0,0,100,66,0,0, 'Troll Volunteer JustSpawned'), +(@N_Volunteer2,0,0, 'Sign me up!',0,0,100,66,0,0, 'Troll Volunteer JustSpawned'), +(@N_Volunteer2,0,1, 'Anythin'' for Vol''jin!',0,0,100,0,0,0, 'Troll Volunteer JustSpawned'), +(@N_Volunteer2,0,2, 'I''d be glad to help.',0,0,100,273,0,0, 'Troll Volunteer JustSpawned'), +(@N_Volunteer2,0,3, 'Just point me at de enemy!',0,0,100,66,0,0, 'Troll Volunteer JustSpawned'), +(@N_Volunteer1,1,0, 'Reportin'' for duty.',0,0,100,66,0,0, 'Troll Volunteer Quest Turn in'), +(@N_Volunteer1,1,1, 'Ready to take de fight to Zalazane.',0,0,100,1,0,0, 'Troll Volunteer Quest Turn in'), +(@N_Volunteer1,1,2, 'Ready to fight beside Vol''jin!',0,0,100,66,0,0, 'Troll Volunteer Quest Turn in'), +(@N_Volunteer1,1,3, 'New troll here!',0,0,100,0,0,0, 'Troll Volunteer Quest Turn in'), +(@N_Volunteer1,1,4, 'When does de trainin'' start?',0,0,100,6,0,0, 'Troll Volunteer Quest Turn in'), +(@N_Volunteer2,1,0, 'Reportin'' for duty.',0,0,100,66,0,0, 'Troll Volunteer Quest Turn in'), +(@N_Volunteer2,1,1, 'Ready to take de fight to Zalazane.',0,0,100,1,0,0, 'Troll Volunteer Quest Turn in'), +(@N_Volunteer2,1,2, 'Ready to fight beside Vol''jin!',0,0,100,66,0,0, 'Troll Volunteer Quest Turn in'), +(@N_Volunteer2,1,3, 'New troll here!',0,0,100,0,0,0, 'Troll Volunteer Quest Turn in'), +(@N_Volunteer2,1,4, 'When does de trainin'' start?',0,0,100,6,0,0, 'Troll Volunteer Quest Turn in'), +(@N_TigerCredit,0,0, 'The tiger matriarch appears! Prove yourself in combat!',3,0,100,0,0,0, 'Tiger Matriarch Credit'), +(@N_Doctor,0,0, 'Darkspears, we consult de spirits! Drummers, take your places!' ,0,0,100,25,0,0, 'Witch Doctor Hez''tok' ), +(@N_Doctor,1,0, 'Spirits, we be gathered here to ask for your guidance.' ,0,0,100,5,0,0, 'Witch Doctor Hez''tok' ), +(@N_Doctor,2,0, 'Our leader, Vol''jin, son of Sen''jin, issued de call to all Darkspears: reclaim de Echo Isles for our tribe.' ,0,0,100,1,0,0, 'Witch Doctor Hez''tok'), +(@N_Doctor,3,0, 'Spirits! I offer me own body to you! Speak through me! Is de time right for mighty Vol''jin''s undertaking?' ,0,0,100,5,0,0, 'Witch Doctor Hez''tok'), +(@N_Doctor,4,0, 'De ancestors hear ya, witch doctor!' ,0,0,100,1,0,0, 'Witch Doctor Hez''tok'), +(@N_Doctor,5,0, 'Know dat your plans please us, Darkspears. De son of Sen''jin walks de right path.' ,0,0,100,1,0,0, 'Witch Doctor Hez''tok'), +(@N_Doctor,6,0, 'De task in front of ya will not be easy, but ya have our blessin''.' ,0,0,100,1,0,0, 'Witch Doctor Hez''tok'), +(@N_Doctor,7,0, 'Ya gave up your home an'' ya gave up de loas of your ancestors when ya left de Echo Isles. Dey will not be pleased dat you been ignorin'' dem.' ,0,0,100,1,0,0, 'Witch Doctor Hez''tok'), +(@N_Doctor,8,0, 'Ya must make amends wit'' Bwonsamdi, de guardian of de dead, if ya hope to defeat Zalazane. It be de only way. Tell de son of Sen''jin dese things.' ,0,0,100,1,0,0, 'Witch Doctor Hez''tok'), +(@N_Doctor,9,0, 'De spirits have blessed us wit'' an answer! De Echo Isles will be ours again!' ,0,0,100,5,0,0, 'Witch Doctor Hez''tok'), +(@N_DScout,0,0, 'He got a big army, an'' he be plannin'' somethin'' down dere.' ,0,0,100,1,0,0, 'Darkspear Scout'), +(@N_DScout,0,1, 'Zalazane got most of his hexes trolls hidden under de canopy on de big island.' ,0,0,100,1,0,0, 'Darkspear Scout'), +(@N_Voljin,0,0, 'Thank ya, scout. Keep up da patrols. But for now, a rest is in order. Dismissed.' ,0,0,100,1,0,0, 'Vol''jin'); + +DELETE FROM `waypoints` WHERE `entry`=@N_DScout; +INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES +(@N_DScout,1,-838.1788,-4989.835,14.93872, ''), +(@N_DScout,2,-829.3889,-4999.125,15.50085, ''), +(@N_DScout,3,-808.0018,-5010.587,15.36734, ''), +(@N_DScout,4,-796.1736,-5009.604,16.01879, ''), +(@N_DScout,5,-782.4566,-5002.518,17.26879, ''), +(@N_DScout,6,-758.7136,-5001.088,19.65562, 'Run script'), +(@N_DScout,7,-763.0104,-4995.054,20.06314, ''), +(@N_DScout,8,-753.5364,-4974.764,21.81314, ''), +(@N_DScout,9,-742.8715,-4961.878,22.66427, 'Despawn'); + +DELETE FROM `spell_area` WHERE `spell` IN (@S_SeeSenjinFrogInvs,@S_SeeSpyFrogInvs); +INSERT INTO `spell_area` (`spell`,`area`,`quest_start`,`quest_start_active`,`quest_end`,`aura_spell`,`racemask`,`gender`,`autocast`) VALUES +(@S_SeeSenjinFrogInvs,393,@Q_DaPerfectSpies,1,@Q_DaPerfectSpies,0,0,2,1), -- Darkspear Strand +(@S_SeeSenjinFrogInvs,367,@Q_DaPerfectSpies,1,@Q_DaPerfectSpies,0,0,2,1), -- Sen'jin Village +(@S_SeeSenjinFrogInvs,14,@Q_DaPerfectSpies,1,@Q_DaPerfectSpies,0,0,2,1), -- Durotar +(@S_SeeSpyFrogInvs,368,@Q_FrogsAway,1,@Q_FrogsAway,0,0,2,1); -- Echo Isles + +-- Conditions +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup` IN (11345,@Gossip+0); +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=17 AND `SourceEntry`=@S_FrogsAway; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=16 AND `SourceEntry`=@N_TigerSpirit; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=18 AND `SourceEntry`=@I_VoljinDrums; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=75319; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`Comment`) VALUES +(15,11345,0,0,9,@Q_FrogsAway,0,0,0, 'Echo Isles: QFrogs Away: gossip'), +(15,11345,1,0,9,@Q_TrollinForVolunteers,0,0,0, 'Echo Isles: Trollin for Volunteers: gossip'), +(15,11345,2,0,28,@Q_PreparinForBattle,0,0,0, 'Echo Isles: Preparin'' For Battle: gossip'), +(15,@Gossip+0,0,0,9,@Q_DanceOfDeSpirits,0,0,0, 'Hez''tok: Dance of De Spirits: gossip'), +(17,0,@S_FrogsAway,0,1,@S_SeeSpyFrogInvs,0,0,0, 'Echo Isles: SFrogs Away'), +(16,0,@N_TigerSpirit,0,23,367,0,0,0, 'Dismount player when not in intended zone'), -- Sen'jin Village +(16,0,@N_TigerSpirit,1,23,393,0,0,0, 'Dismount player when not in intended zone'), -- Darkspear Strand +(16,0,@N_TigerSpirit,2,23,368,0,0,0, 'Dismount player when not in intended zone'), -- Echo Isles +(18,0,@I_VoljinDrums,0,24,1,@N_Citizien1,0,63, 'Limit Voljin Drums to be used on Troll Citizen'), +(18,0,@I_VoljinDrums,1,24,1,@N_Citizien2,0,63, 'Limit Voljin Drums to be used on Troll Citizen'), +(13,0,75319,0,18,1,0,0,0, 'Omen Kill Credit - Target player AoE'); + +/* ### Game event ### */ +DELETE FROM `game_event` WHERE `eventEntry`=@Event; +INSERT INTO `game_event` (`eventEntry`,`start_time`,`end_time`,`occurence`,`length`,`holiday`,`description`,`world_event`) VALUES +(@Event, '2010-09-07 00:00:00' , '2010-10-10 00:00:00' ,9999999,47520,0, 'Zalazane''s Fall' ,0); +DELETE FROM `game_event_creature_quest` WHERE `id` IN (@N_Vanira,@N_Voljin,@N_Uruzin,@N_VoljinBoss); +INSERT INTO `game_event_creature_quest` (`id`,`quest`,`eventEntry`) VALUES +(@N_Vanira,@Q_DaPerfectSpies,@Event), +(@N_Vanira,@Q_FrogsAway,@Event), +(@N_Vanira,@Q_LadyOfDaTigers,@Event), +(@N_Voljin,@Q_DanceOfDeSpirits,@Event), +(@N_Uruzin,@Q_TrollinForVolunteers,@Event), +(@N_Uruzin,@Q_PreparinForBattle,@Event), +(@N_VoljinBoss,@Q_ZalazanesFall,@Event); +DELETE FROM `game_event_creature` WHERE `eventEntry`=@Event; +INSERT INTO `game_event_creature` (`guid`,`eventEntry`) VALUES +(@CGuid+0,@Event),(@CGuid+1,@Event),(@CGuid+2,@Event), +(@CGuid+3,@Event),(@CGuid+4,@Event),(@CGuid+5,@Event), +(@CGuid+6,@Event),(@CGuid+7,@Event),(@CGuid+8,@Event), +(@CGuid+9,@Event),(@CGuid+10,@Event),(@CGuid+11,@Event), +(@CGuid+12,@Event),(@CGuid+13,@Event),(@CGuid+14,@Event), +(@CGuid+15,@Event),(@CGuid+16,@Event),(@CGuid+17,@Event), +(@CGuid+18,@Event),(@CGuid+19,@Event),(@CGuid+20,@Event), +(@CGuid+21,@Event),(@CGuid+22,@Event),(@CGuid+23,@Event), +(@CGuid+24,@Event),(@CGuid+25,@Event),(@CGuid+26,@Event), +(@CGuid+27,@Event),(@CGuid+28,@Event),(@CGuid+29,@Event), +(@CGuid+30,@Event),(@CGuid+31,@Event),(@CGuid+32,@Event), +(@CGuid+33,@Event),(@CGuid+34,@Event),(@CGuid+35,@Event), +(@CGuid+36,@Event),(@CGuid+37,@Event),(@CGuid+38,@Event), +(@CGuid+39,@Event),(@CGuid+40,@Event),(@CGuid+41,@Event), +(@CGuid+42,@Event),(@CGuid+43,@Event),(@CGuid+44,@Event), +(@CGuid+45,@Event),(@CGuid+46,@Event),(@CGuid+47,@Event), +(@CGuid+48,@Event),(@CGuid+49,@Event),(@CGuid+51,@Event), +(@CGuid+52,@Event),(@CGuid+53,@Event),(@CGuid+54,@Event), +(@CGuid+55,@Event),(@CGuid+56,@Event),(@CGuid+57,@Event), +(@CGuid+58,@Event),(@CGuid+59,@Event),(@CGuid+60,@Event), +(@CGuid+61,@Event),(@CGuid+62,@Event),(@CGuid+63,@Event), +(@CGuid+64,@Event),(@CGuid+65,@Event),(@CGuid+66,@Event), +(@CGuid+67,@Event),(@CGuid+68,@Event),(@CGuid+69,@Event), +(@CGuid+70,@Event),(@CGuid+71,@Event),(@CGuid+72,@Event), +(@CGuid+73,@Event),(@CGuid+74,@Event),(@CGuid+75,@Event), +(@CGuid+76,@Event),(@CGuid+77,@Event),(@CGuid+78,@Event), +(@CGuid+79,@Event),(@CGuid+80,@Event),(@CGuid+81,@Event), +(@CGuid+82,@Event),(@CGuid+83,@Event),(@CGuid+84,@Event), +(@CGuid+85,@Event),(@CGuid+86,@Event),(@CGuid+87,@Event), +(@CGuid+88,@Event),(@CGuid+89,@Event),(@CGuid+90,@Event), +(@CGuid+91,@Event),(@CGuid+92,@Event),(@CGuid+93,@Event), +(@CGuid+94,@Event),(@CGuid+95,@Event),(@CGuid+96,@Event), +(@CGuid+97,@Event),(@CGuid+98,@Event),(@CGuid+99,@Event), +(@CGuid+100,@Event),(@CGuid+101,@Event),(@CGuid+102,@Event), +(@CGuid+103,@Event),(@CGuid+104,@Event),(@CGuid+105,@Event), +(@CGuid+106,@Event),(@CGuid+107,@Event),(@CGuid+108,@Event), +(@CGuid+109,@Event),(@CGuid+110,@Event),(@CGuid+111,@Event), +(@CGuid+112,@Event),(@CGuid+113,@Event),(@CGuid+114,@Event), +(@CGuid+115,@Event),(@CGuid+116,@Event),(@CGuid+117,@Event); +DELETE FROM `game_event_gameobject` WHERE `eventEntry`=@Event; +INSERT INTO `game_event_gameobject` (`guid`,`eventEntry`) VALUES +(@GGuid+0,@Event),(@GGuid+1,@Event),(@GGuid+2,@Event), +(@GGuid+3,@Event),(@GGuid+4,@Event),(@GGuid+5,@Event), +(@GGuid+6,@Event),(@GGuid+7,@Event),(@GGuid+8,@Event), +(@GGuid+9,@Event),(@GGuid+10,@Event),(@GGuid+11,@Event), +(@GGuid+12,@Event),(@GGuid+13,@Event),(@GGuid+14,@Event), +(@GGuid+15,@Event),(@GGuid+16,@Event),(@GGuid+17,@Event), +(@GGuid+18,@Event),(@GGuid+19,@Event),(@GGuid+20,@Event), +(@GGuid+21,@Event),(@GGuid+22,@Event),(@GGuid+23,@Event), +(@GGuid+24,@Event),(@GGuid+25,@Event),(@GGuid+26,@Event), +(@GGuid+27,@Event),(@GGuid+28,@Event),(@GGuid+29,@Event), +(@GGuid+30,@Event),(@GGuid+31,@Event),(@GGuid+32,@Event), +(@GGuid+33,@Event),(@GGuid+34,@Event),(@GGuid+35,@Event), +(@GGuid+36,@Event),(@GGuid+37,@Event),(@GGuid+38,@Event), +(@GGuid+39,@Event),(@GGuid+40,@Event),(@GGuid+41,@Event), +(@GGuid+42,@Event),(@GGuid+43,@Event),(@GGuid+44,@Event), +(@GGuid+45,@Event),(@GGuid+46,@Event),(@GGuid+47,@Event), +(@GGuid+48,@Event),(@GGuid+49,@Event),(@GGuid+50,@Event), +(@GGuid+51,@Event),(@GGuid+52,@Event),(@GGuid+53,@Event), +(@GGuid+54,@Event),(@GGuid+55,@Event),(@GGuid+56,@Event), +(@GGuid+57,@Event),(@GGuid+58,@Event); diff --git a/sql/updates/world/2011_03_27_02_world_scriptname.sql b/sql/updates/world/2011_03_27_02_world_scriptname.sql new file mode 100644 index 0000000000000..cd11006aa0beb --- /dev/null +++ b/sql/updates/world/2011_03_27_02_world_scriptname.sql @@ -0,0 +1,3 @@ +UPDATE `creature_template` SET `ScriptName`= 'npc_tiger_matriarch_credit' WHERE `entry`=40301; +UPDATE `creature_template` SET `ScriptName`= 'npc_tiger_matriarch' WHERE `entry`=40312; +UPDATE `creature_template` SET `ScriptName`= 'npc_troll_volunteer' WHERE `entry` IN (40260,40264); diff --git a/sql/updates/world/2011_03_27_02_world_spell_scriptname.sql b/sql/updates/world/2011_03_27_02_world_spell_scriptname.sql new file mode 100644 index 0000000000000..5ca119d74804f --- /dev/null +++ b/sql/updates/world/2011_03_27_02_world_spell_scriptname.sql @@ -0,0 +1,4 @@ +DELETE FROM `spell_script_names` WHERE `spell_id` IN (75420,75102); +INSERT INTO `spell_script_names` VALUES +(75420, 'spell_mount_check'), +(75102, 'spell_voljin_war_drums'); diff --git a/sql/updates/world/2011_03_27_03_world_achievement_reward.sql b/sql/updates/world/2011_03_27_03_world_achievement_reward.sql new file mode 100644 index 0000000000000..2afcce64f7bad --- /dev/null +++ b/sql/updates/world/2011_03_27_03_world_achievement_reward.sql @@ -0,0 +1,5 @@ +-- Send in-game mail when player completes achievements Emblematic +DELETE FROM `achievement_reward` WHERE `entry` IN (4784,4785); +INSERT INTO `achievement_reward` (`entry`,`title_A`,`title_H`,`item`,`sender`,`subject`,`text`) VALUES +(4784,0,0,0,37942, 'Emblem Quartermasters in Dalaran''s Silver Enclave', 'Your achievements in Northrend have not gone unnoticed, friend.$B$BThe Emblems you have earned may be used to purchase equipment from the various Emblem Quartermasters in Dalaran.$B$BYou may find us there, in the Silver Enclave, where each variety of Emblem has its own quartermaster.$B$BWe look forward to your arrival!'), +(4785,0,0,0,37941, 'Emblem Quartermasters in Dalaran''s Sunreaver Sanctuary', 'Your achievements in Northrend have not gone unnoticed, friend.$B$BThe Emblems you have earned may be used to purchase equipment from the various Emblem Quartermasters in Dalaran.$B$BYou may find us there, in the Sunreaver Sanctuary, where each variety of Emblem has its own quartermaster.$B$BWe look forward to your arrival!'); diff --git a/sql/updates/world/2011_03_28_00_world_misc.sql b/sql/updates/world/2011_03_28_00_world_misc.sql new file mode 100644 index 0000000000000..ee74787d6ac4a --- /dev/null +++ b/sql/updates/world/2011_03_28_00_world_misc.sql @@ -0,0 +1,63 @@ +UPDATE `creature_template` SET `npcflag`=`npcflag`|16777216 WHERE `entry`=40176; -- Sen'jin Frog +-- Add missing table at Steelgrill's Depot +DELETE FROM `gameobject` WHERE `guid`=151888 AND `id`=202564; +INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES +(151888,202564,0,1,1,-5463.98975,-626.967041,393.528717,0,0,0,0,0,120,0,1); +-- Add non-existing equipment +DELETE FROM `creature_equip_template` WHERE `entry`=2432; +INSERT INTO `creature_equip_template` (`entry`,`equipentry1`,`equipentry2`,`equipentry3`) VALUES +(2432,53056,0,0); +UPDATE `creature_template` SET `equipment_id`=2432 WHERE `entry`=39368; -- Set equipment to Drill Sergeant Steamcrank +UPDATE `creature_template` SET `equipment_id`=2432 WHERE `entry`=39675; -- Set equipment to Captain Tread Sparknozzle +UPDATE `creature_template` SET `equipment_id`=682 WHERE `entry`=32417; -- Set equipment to Scarlet Highlord Daion +-- Mjordin Combatant does not have EAI present +UPDATE `creature_template` SET `AIName`= '' WHERE `entry`=30037; +-- Netherwing Ledge Fixup +-- Fix and add spawns +DELETE FROM `creature` WHERE `id` IN (23289,23345,23346,23348,23291,23340,23342,23344,23370,23376,23427,23489); +DELETE FROM `creature` WHERE `guid` BETWEEN 52334 AND 52347; +INSERT INTO `creature` (guid,id,map,spawnMask,phaseMask,modelid,equipment_id,position_x,position_y,position_z,orientation,spawntimesecs,spawndist,currentwaypoint,curhealth,curmana,DeathState,MovementType) VALUES +(52334,23289,530,1,1,0,0,-5155.48975,696.2224,42.196106,4.90454865,120,0,0,1,0,0,0), -- Mine Car +(52335,23289,530,1,1,0,0,-5195.42334,620.3688,44.1691132,6.20430231,120,0,0,1,0,0,0), -- Mine Car +(52336,23345,530,1,1,0,0,-5066.307,640.2136,86.49668,1.553343,120,0,0,1,0,0,0), -- Wing Commander Ichman +(52337,23346,530,1,1,0,0,-5060.32666,640.43634,86.66157,1.50098312,120,0,0,1,0,0,0), -- Wing Commander Mulverick +(52338,23348,530,1,1,0,0,-5074.878,625.448547,85.91173,1.57079637,120,0,0,1,0,0,0), -- Captain Skyshatter +(52339,23291,530,1,1,0,0,-5105.28,548.8744,85.7275848,0.4537856,120,0,0,1,0,0,0), -- Chief Overseer Mudlump +(52340,23340,530,1,1,0,0,-5088.555,640.8356,86.61429,1.48352981,120,0,0,1,0,0,0), -- Murg "Oldie" Muckjaw +(52341,23342,530,1,1,0,0,-5081.61768,640.931763,86.61429,1.57079637,120,0,0,1,0,0,0), -- Trope the Filth-Belcher +(52342,23344,530,1,1,0,0,-5072.988,640.0335,86.48929,1.60313094,120,0,0,1,0,0,0), -- Corlok the Vet +(52343,23370,530,1,1,0,0,-5104.80127,683.6003,104.504616,5.56760025,120,0,0,1,0,0,0), -- Dragonmaw Tower Controller +(52344,23376,530,1,1,0,0,-5129.35352,681.3448,40.0699348,1.04193306,120,0,0,1,0,0,0), -- Dragonmaw Foreman +(52345,23376,530,1,1,0,0,-5197.53369,620.5416,44.5623055,6.202318,120,0,0,1,0,0,0), -- Dragonmaw Foreman +(52346,23427,530,1,1,0,0,-5092.035,581.6629,86.958786,1.18682384,120,0,0,1,0,0,0), -- Illidari Lord Balthas +(52347,23489,530,1,1,0,0,-5099.259,617.7783,85.9796,4.22369671,120,0,0,1,0,0,0); -- Drake Dealer Hurlunk +DELETE FROM `creature_template_addon` WHERE `entry` IN (23345,23346,23348,23291,23340,23342,23344,23370,23427,23489); +INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes2`) VALUES +(23345,17718,1), -- Wing Commander Ichman +(23346,17719,1), -- Wing Commander Mulverick +(23348,21425,1), -- Captain Skyshatter +(23291,0,1), -- Chief Overseer Mudlump +(23340,17701,1), -- Murg "Oldie" Muckjaw +(23342,21155,1), -- Trope the Filth-Belcher +(23344,16314,1), -- Corlok the Vet +(23370,0,1), -- Dragonmaw Tower Controller +(23427,0,1), -- Illidari Lord Balthas +(23489,0,1); -- Drake Dealer Hurlunk +UPDATE `creature_model_info` SET `bounding_radius`=0.5,`combat_reach`=1,`gender`=2 WHERE `modelid`=11686; -- Dragonmaw Peon Work Node +UPDATE `creature_model_info` SET `bounding_radius`=0.62,`combat_reach`=2,`gender`=2 WHERE `modelid`=21412; -- Nethermine Flayer +UPDATE `creature_model_info` SET `bounding_radius`=0.3361105,`combat_reach`=1.1,`gender`=0 WHERE `modelid`=20284; -- Nethermine Ravager +UPDATE `creature_model_info` SET `bounding_radius`=0.4687497,`combat_reach`=2.025,`gender`=0 WHERE `modelid`=20893; -- Dragonmaw Skybreaker +UPDATE `creature_model_info` SET `bounding_radius`=2.5,`combat_reach`=5,`gender`=0 WHERE `modelid`=20896; -- Dragonmaw Ascendant +UPDATE `creature_model_info` SET `bounding_radius`=0.5022,`combat_reach`=2.025,`gender`=0 WHERE `modelid`=21421; -- Murg "Oldie" Muckjaw +UPDATE `creature_model_info` SET `bounding_radius`=0.520833,`combat_reach`=2.25,`gender`=0 WHERE `modelid`=21424; -- Corlok the Vet +UPDATE `creature_model_info` SET `bounding_radius`=0.520833,`combat_reach`=2.25,`gender`=0 WHERE `modelid`=21426; -- Captain Skyshatter +UPDATE `creature_model_info` SET `bounding_radius`=1,`combat_reach`=0,`gender`=0 WHERE `modelid`=21422; -- Trope the Filth-Belcher +UPDATE `creature_template` SET `exp`=1,`minlevel`=70,`maxlevel`=70,`speed_run`=1 WHERE `entry`=23308; -- Dragonmaw Peon Work Node +UPDATE `creature_template` SET `speed_walk`=2,`speed_run`=2 WHERE `entry`=22253; -- Dragonmaw Ascendant +-- More Netherwing Eggs +SET @GUID := 151889; +DELETE FROM `gameobject` WHERE `guid` BETWEEN @GUID AND @GUID+2; +INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`) VALUES +(@GUID,185915,530,1,1,-4244.827,325.0044,134.4166,0.1396245,0,0,0.06975555,0.9975641,1600), +(@GUID+1,185915,530,1,1,-4221.473,370.1472,136.2317,2.111848,0,0,0.8703556,0.4924237,1600), +(@GUID+2,185915,530,1,1,-5103.112,707.9791,85.04285,0.2792516,0,0,0.1391726,0.9902682,1600); diff --git a/sql/updates/world/2011_03_29_00_world_creature.sql b/sql/updates/world/2011_03_29_00_world_creature.sql new file mode 100644 index 0000000000000..dbe2f3e052d13 --- /dev/null +++ b/sql/updates/world/2011_03_29_00_world_creature.sql @@ -0,0 +1,1424 @@ +-- --------------------------- +-- -- Northrend Rare Spawns -- +-- --------------------------- +SET @GUID = 151934; +SET @EQUIP = 2433; +-- ---------------------- +-- -- Template Updates -- +-- ---------------------- +UPDATE `creature_template` SET `faction_A`=16,`faction_H`=16,`unit_flags`=64,`speed_run`=0.99206285714286 WHERE `entry`=32447; -- Zul'drak Sentinel +UPDATE `creature_template` SET `faction_A`=14,`faction_H`=14,`unit_flags`=32832,`speed_run`=1.1428571428571 WHERE `entry`=32409; -- Crazed Indu'le Survivor +UPDATE `creature_template` SET `faction_A`=14,`faction_H`=14,`unit_flags`=32832,`speed_walk`=2,`speed_run`=2 WHERE `entry`=32422; -- Grocklar +UPDATE `creature_template` SET `faction_A`=16,`faction_H`=16,`unit_flags`=32832,`speed_walk`=2,`speed_run`=2 WHERE `entry`=32429; -- Seething Hate +UPDATE `creature_model_info` SET `bounding_radius`=0.248,`combat_reach`=4,`gender`=0 WHERE `modelid`=26663; -- Grocklar +UPDATE `creature_model_info` SET `bounding_radius`=0.5,`combat_reach`=1,`gender`=2 WHERE `modelid`=18083; -- Seething Hate +UPDATE `creature_model_info` SET `bounding_radius`=0.6076385,`combat_reach`=2.625,`gender`=2 WHERE `modelid`=28284; -- Crazed Indu'le Survivor +UPDATE `creature_template` SET `equipment_id`=@EQUIP,`speed_run`=1.3857142857143 WHERE `entry`=32417; -- Scarlet Highlord Daion + +-- ------------------------- +-- -- Template_Addon data -- +-- ------------------------- +DELETE FROM `creature_template_addon` WHERE `entry` IN (32429,32422,32409,32417,32447); +INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(32429,0,0,1,0, '52561 0'), -- Seething Hate +(32422,0,0,1,0, NULL), -- Grocklar +(32409,0,0,1,0, NULL), -- Crazed Indu'le Survivor +(32417,19296,0,1,0, NULL), -- Scarlet Highlord Daion +(32447,0,0,1,0, NULL); -- Zul'drak Sentinel + +-- -------------------- +-- -- Equipment data -- +-- -------------------- +DELETE FROM `creature_equip_template` WHERE `entry`=@EQUIP; +INSERT INTO `creature_equip_template` (`entry`,`equipentry1`,`equipentry2`,`equipentry3`) VALUES +(@EQUIP,38175,12932,0); + +-- --------------------- +-- -- Creature Spawns -- +-- --------------------- +DELETE FROM `creature` WHERE `guid` BETWEEN @GUID AND @GUID+86; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`DeathState`,`MovementType`) VALUES +-- Old Crystalbark +(@GUID,32357,571,1,1,0,0,3550.59,7169.73,220.75,0.130042,28800,0,0,13936,3231,0,2), +(@GUID+1,32357,571,1,1,0,0,3792.23,7329.76,196.23,5.38979,28800,0,0,13936,3231,0,2), +(@GUID+2,32357,571,1,1,0,0,3990.13,6574,180.599,2.84903,28800,0,0,13936,3231,0,2), +(@GUID+3,32357,571,1,1,0,0,3733.24,6779.39,156.379,2.8011,28800,0,0,13936,3231,0,2), +-- Fumblub Gearwind +(@GUID+4,32358,571,1,1,0,782,3766.55,4309.43,12.6436,0.814532,28800,0,0,13936,0,0,2), -- Fixed Z +-- Icehorn +(@GUID+5,32361,571,1,1,0,0,3565.27,3635.4,36.3026,1.89603,28800,20,0,13936,0,0,1), +(@GUID+6,32361,571,1,1,0,0,3131.14,3647.86,4.40561,2.64266,28800,0,0,13936,0,0,2), +(@GUID+7,32361,571,1,1,0,0,3122.88,3925.21,25.9087,2.59032,28800,20,0,13936,0,0,1), +-- Crazed Indu'le Survivor +(@GUID+8,32409,571,1,1,0,0,3425.29,1811.42,81.2668,0.434945,28800,5,0,14910,0,0,1), +-- Scarlet Highlord Daion +(@GUID+9,32417,571,1,1,0,0,4105.49,-1132.07,134.27,0.953492,28800,0,0,14910,0,0,2), +(@GUID+10,32417,571,1,1,0,0,4577.47,-602.83,155.108,3.43925,28800,0,0,14910,0,0,2), +(@GUID+11,32417,571,1,1,0,0,4739.51,-373.885,187.437,2.81958,28800,0,0,14910,0,0,2), +(@GUID+12,32417,571,1,1,0,0,4616.39,-411.872,155.531,2.32242,28800,0,0,14910,0,0,2), +-- Perobas the Bloodthirster +(@GUID+13,32377,571,1,1,0,0,2402.76,-5545.49,289.63,6.28297,28800,0,0,13936,0,0,2), +(@GUID+14,32377,571,1,1,0,0,2286.36,-5080.37,254.684,0.376,28800,0,0,13936,0,0,2), +(@GUID+15,32377,571,1,1,0,0,2667.07,-4613.32,253.45,2.52328,28800,0,0,13936,0,0,2), +-- Vigdis the War Maiden +(@GUID+16,32386,571,1,1,0,0,1091.68,-5756.49,233.888,5.71161,28800,0,0,13936,0,0,2), +(@GUID+17,32386,571,1,1,0,0,988.678,-5798.41,252.204,5.48463,28800,15,0,13936,0,0,1), +(@GUID+18,32386,571,1,1,0,0,685.78,-5894.07,289.31,3.23013,28800,15,0,13936,0,0,1), +(@GUID+19,32386,571,1,1,0,0,698.198,-5916.6,291.038,2.11171,28800,0,0,13936,0,0,2), +(@GUID+20,32386,571,1,1,0,0,1537.69,-5810.95,272.362,3.87268,28800,0,0,13936,0,0,2), +(@GUID+21,32386,571,1,1,0,0,1219.76,-5551.19,203.268,4.46259,28800,0,0,13936,0,0,2), +-- King Pin +(@GUID+22,32398,571,1,1,27950,0,827.638,-3283.51,12.2082,3.9619,28800,5,0,13936,0,0,1), +(@GUID+23,32398,571,1,1,0,0,534.88,-2934.28,-0.13,5.13,28800,5,0,13936,0,0,1), +(@GUID+24,32398,571,1,1,0,0,314.914,-3130,34.8139,3.91321,28800,5,0,13936,0,0,1), +(@GUID+25,32398,571,1,1,0,0,23.3933,-3343.96,7.06814,0.594844,28800,0,0,13936,0,0,2), +(@GUID+26,32398,571,1,1,0,0,110.217,-3455.56,10.9399,5.36934,28800,5,0,13936,0,0,1), +-- Tukemuth +(@GUID+27,32400,571,1,1,0,0,4423.2,-191.606,86.97,2.2154,28800,0,0,39760,0,0,2), +(@GUID+28,32400,571,1,1,0,0,4257.03,-245.357,71.873,0.90693,28800,0,0,39760,0,0,2), +(@GUID+29,32400,571,1,1,0,0,4171.21,-107.972,66.5049,0.678376,28800,0,0,39760,0,0,2), +(@GUID+30,32400,571,1,1,0,0,4117.19,339.269,56.2234,4.64336,28800,0,0,39760,0,0,2), +(@GUID+31,32400,571,1,1,0,0,3757.18,-256.696,76.8022,1.93109,28800,0,0,39760,0,0,2), +(@GUID+32,32400,571,1,1,0,0,3831,362.401,34.2447,4.3449,28800,0,0,39760,0,0,2), +(@GUID+33,32400,571,1,1,0,0,3327.3,632.078,83.1728,5.52535,28800,0,0,39760,0,0,2), +(@GUID+34,32400,571,1,1,0,0,3424.75,-224.108,75.47,1.22373,28800,0,0,39760,0,0,2), +-- Grocklar +(@GUID+35,32422,571,1,1,0,0,3570.74,-1748.55,160.909,0.577843,28800,0,0,41128,0,0,2), +(@GUID+36,32422,571,1,1,0,0,3568.53,-2418.75,139.732,3.53036,28800,0,0,41128,0,0,2), +(@GUID+37,32422,571,1,1,0,0,3061.42,-1840.03,66.0206,6.06678,28800,0,0,41128,0,0,2), +(@GUID+38,32422,571,1,1,0,0,4028.69,-1717.33,200.062,4.76214,28800,0,0,41128,0,0,2), +(@GUID+39,32422,571,1,1,0,0,2969.77,-2260.25,65.7,1.53929,28800,0,0,41128,0,0,2), +(@GUID+40,32422,571,1,1,0,0,3588.57,-2184.77,137.255,0.374254,28800,0,0,41128,0,0,2), +-- Seething Hate +(@GUID+41,32429,571,1,1,0,0,3913.28,-2804.43,176.136,1.75467,28800,0,0,14910,0,0,2), +(@GUID+42,32429,571,1,1,0,0,3601.19,-3275.54,222.069,4.60829,28800,0,0,14910,0,0,2), +(@GUID+43,32429,571,1,1,0,0,3972.31,-2710.12,165.749,6.28272,28800,0,0,14910,0,0,2), +-- Syreian the Bonecarver +(@GUID+44,32438,571,1,1,0,1660,4064.03,-4598.68,174.644,5.63537,28800,5,0,14910,0,0,1), +(@GUID+45,32438,571,1,1,0,1660,4263.49,-4476.45,189.827,5.73447,28800,0,0,14910,0,0,2), +(@GUID+46,32438,571,1,1,0,1660,4162.44,-4622,140.978,4.71489,28800,5,0,14910,0,0,1), +(@GUID+47,32438,571,1,1,0,1660,4341.29,-4776.17,52.0998,4.73701,28800,5,0,14910,0,0,1), +(@GUID+48,32438,571,1,1,0,1660,4435.31,-4528.65,115.486,4.76371,28800,5,0,14910,0,0,1), +(@GUID+49,32438,571,1,1,0,1660,4582.12,-4714.61,62.4486,4.75272,28800,5,0,14910,0,0,1), +-- Hildana Deathstealer +(@GUID+50,32495,571,1,1,0,0,7514.08,3663.15,623.327,5.33787,3600,0,0,18900,5991,0,0), +(@GUID+51,32495,571,1,1,0,0,8360.11,3510.63,655.052,3.11519,3600,0,0,18900,5991,0,0), +(@GUID+52,32495,571,1,1,0,0,8459.92,3147.1,588.143,3.932,3600,0,0,18900,5991,0,0), +(@GUID+53,32495,571,1,1,0,0,6800.17,1774.63,569.475,4.94124,3600,0,0,18900,5991,0,0), +-- High Thane Jorfus +(@GUID+54,32501,571,1,1,0,0,6155.1,2377.94,510.346,5.46898,28800,5,0,18900,0,0,1), +(@GUID+55,32501,571,1,1,0,0,7711.4,1029.98,446.606,4.69297,28800,5,0,18900,0,0,1), +(@GUID+56,32501,571,1,1,0,0,6525.8,3309.78,665.388,5.66139,28800,5,0,18900,0,0,1), +-- Terror Spinner +(@GUID+57,32475,571,1,1,0,0,6711.42,-4186.12,456.852,5.50739,28800,20,0,16502,0,0,1), +(@GUID+58,32475,571,1,1,0,0,6704.23,-4205.16,458.033,4.71414,28800,20,0,16502,0,0,1), +(@GUID+59,32475,571,1,1,0,0,6554.22,-4523.84,450.781,2.6564,28800,20,0,16502,0,0,1), +(@GUID+60,32475,571,1,1,0,0,6704.23,-4205.16,458.033,4.71414,28800,20,0,16502,0,0,1), +-- Griegen +(@GUID+61,32471,571,1,1,0,0,5115.49,-1652.65,234.728,2.96739,28800,0,0,15952,0,0,2), +(@GUID+62,32471,571,1,1,0,0,5326.75,-1479.26,238.009,3.02158,28800,0,0,15952,0,0,2), +(@GUID+63,32471,571,1,1,0,0,5596.75,-1742.88,239.19,0.406713,28800,0,0,15952,0,0,2), +(@GUID+64,32471,571,1,1,0,0,5314.94,-1939.21,238.942,0.458038,28800,0,0,15952,0,0,2), +(@GUID+65,32471,571,1,1,0,0,5791.11,-1302.72,234.538,4.79067,28800,10,0,15952,0,0,1), +(@GUID+66,32471,571,1,1,0,0,5327.54,-1702.84,238.882,4.63875,28800,10,0,15952,0,0,1), +(@GUID+67,32471,571,1,1,0,0,5133.37,-1853.51,245.385,4.72044,28800,10,0,15952,0,0,1), +-- King Krush +(@GUID+68,32485,571,1,1,0,0,4865.04,4679.54,-69.2385,1.14987,28800,0,0,42540,0,0,2), +(@GUID+69,32485,571,1,1,0,0,6087.94,4603.13,-96.8083,2.44102,28800,0,0,42540,0,0,2), +-- Aotona +(@GUID+70,32481,571,1,1,0,0,5368.74,4427.76,-133.397,0.206642,28800,20,0,15952,0,0,1), +(@GUID+71,32481,571,1,1,0,0,5803.02,4564.18,-135.413,2.00913,28800,20,0,15952,0,0,1), +(@GUID+72,32481,571,1,1,0,0,5286.53,4998.04,-134.7,5.46489,28800,20,0,15952,0,0,1), +(@GUID+73,32481,571,1,1,0,0,5591.7,5192.67,-133.378,0.631543,28800,20,0,15952,0,0,1), +(@GUID+74,32481,571,1,1,0,0,5777.08,5070.89,-136.107,3.63961,28800,20,0,15952,0,0,1), +(@GUID+75,32481,571,1,1,0,0,5762.37,5001.74,-127.39,3.13774,28800,20,0,15952,0,0,1), +-- Dirkee +(@GUID+76,32500,571,1,1,0,0,8392.22,-1189.11,927.468,1.73202,28800,20,0,50400,3994,0,1), +(@GUID+77,32500,571,1,1,0,0,7751.04,-1099.42,926.238,2.84729,28800,20,0,50400,3994,0,1), +(@GUID+78,32500,571,1,1,0,0,7290.77,-1119.28,938.286,0.26333,28800,20,0,50400,3994,0,1), +(@GUID+79,32500,571,1,1,0,0,7934.73,-3183.8,862.21,4.21701,28800,20,0,50400,3994,0,1), +-- Putridus the Ancient +(@GUID+80,32487,571,1,1,0,0,6726.491,2521.456,428.1825,0.130042,28800,0,0,1,0,0,2), +(@GUID+81,32487,571,1,1,0,0,7812.443,2103.041,380.3420,0.130042,28800,0,0,1,0,0,2), +(@GUID+82,32487,571,1,1,0,0,7609.677,1477.351,330.2054,0.130042,28800,0,0,1,0,0,2), +(@GUID+83,32487,571,1,1,0,0,7190.445,1270.757,302.0640,0.130042,28800,0,0,1,0,0,2), +(@GUID+84,32487,571,1,1,0,0,7049.174,1225.784,295.9547,0.130042,28800,0,0,1,0,0,2), +-- Zul Drak Sentinel +(@GUID+85,32447,571,1,1,0,0,5693.950,-2871.760,274.5770,0.130042,28800,0,0,1,0,0,2), +(@GUID+86,32447,571,1,1,0,0,4914.310,-1661.770,248.3090,0.130042,28800,0,0,1,0,0,2); + +-- ------------------------------- +-- -- DefiningPooling_templates -- +-- ------------------------------- +DELETE FROM `pool_template` WHERE `entry` BETWEEN 1086 AND 1106; +INSERT INTO `pool_template` (`entry`,`max_limit`,`description`) VALUES +(1086,1, 'Old Crystalbark Rare Spawn (1 out 4)'), +(1087,1, 'Fumblub Gearwind Rare Spawn (1 out 1)'), +(1088,1, 'Icehorn Rare Spawn (1 out 3)'), +(1089,1, 'Crazed Indu le Survivor Rare Spawn (1 out 1)'), +(1090,1, 'Scarlet Highlord Daion Rare Spawn (1 out 4)'), +(1091,1, 'Perobas the Bloodthirster Rare Spawn (1 out 3)'), +(1092,1, 'Vigdis the War Maiden Rare Spawn (1 out 6)'), +(1093,1, 'King Pin Rare Spawn (1 out 5)'), +(1094,1, 'Tukemuth Rare Spawn (1 out 8)'), +(1095,1, 'Grocklar Rare Spawn (1 out 6)'), +(1096,1, 'Seething Hate Rare Spawn (1 out 3)'), +(1097,1, 'Syreian the Bonecarver Rare Spawn (1 out 6)'), +(1098,1, 'Hildana Deathstealer Rare Spawn (1 out 4)'), +(1099,1, 'High Thane Jorfus Rare Spawn (1 out 3)'), +(1100,1, 'Terror Spinner Rare Spawn (1 out 4)'), +(1101,1, 'Griegen Rare Spawn (1 out 7)'), +(1102,1, 'King Krush Rare Spawn (1 out 2)'), +(1103,1, 'Aotona Rare Spawn (1 out 6)'), +(1104,1, 'Dirkee Rare Spawn (1 out 4)'), +(1105,1, 'Putridus the Ancient Rare Spawn (1 out 5)'), +(1106,1, 'Zul Drak Sentinel Rare Spawn (1 out 2)'); +-- ------------------------ +-- -- Pooling the Spawns -- +-- ------------------------ +DELETE FROM `pool_creature` WHERE `pool_entry` BETWEEN 1086 AND 1106; +INSERT INTO `pool_creature` (`guid`,`pool_entry`,`chance`,`description`) VALUES +(@GUID+0,1086,0, 'Old Crystalbark - Spawnlocation 1'), +(@GUID+1,1086,0, 'Old Crystalbark - Spawnlocation 2'), +(@GUID+2,1086,0, 'Old Crystalbark - Spawnlocation 3'), +(@GUID+3,1086,0, 'Old Crystalbark - Spawnlocation 4'), +(@GUID+4,1087,100, 'Fumblub Gearwind - Spawnlocation 1'), +(@GUID+5,1088,0, 'Icehorn - Spawnlocation 1'), +(@GUID+6,1088,0, 'Icehorn Spawnlocation 2'), +(@GUID+7,1088,0, 'Icehorn Spawnlocation 3'), +(@GUID+8,1089,100, 'Crazed Indu le Survivor - Spawnlocation 1'), +(@GUID+9,1090,0, 'Scarlet Highlord Daion Spawnlocation 1'), +(@GUID+10,1090,0, 'Scarlet Highlord Daion Spawnlocation 2'), +(@GUID+11,1090,0, 'Scarlet Highlord Daion Spawnlocation 3'), +(@GUID+12,1090,0, 'Scarlet Highlord Daion Spawnlocation 4'), +(@GUID+13,1091,0, 'Perobas the Bloodthirster Spawnlocation 1'), +(@GUID+14,1091,0, 'Perobas the Bloodthirster Spawnlocation 2'), +(@GUID+15,1091,0, 'Perobas the Bloodthirster Spawnlocation 3'), +(@GUID+16,1092,0, 'Vigdis the War Maiden Spawnlocation 1'), +(@GUID+17,1092,0, 'Vigdis the War Maiden Spawnlocation 2'), +(@GUID+18,1092,0, 'Vigdis the War Maiden Spawnlocation 3'), +(@GUID+19,1092,0, 'Vigdis the War Maiden Spawnlocation 4'), +(@GUID+20,1092,0, 'Vigdis the War Maiden Spawnlocation 5'), +(@GUID+21,1092,0, 'Vigdis the War Maiden Spawnlocation 6'), +(@GUID+22,1093,0, 'King Pin Spawnlocation 1'), +(@GUID+23,1093,0, 'King Pin Spawnlocation 2'), +(@GUID+24,1093,0, 'King Pin Spawnlocation 3'), +(@GUID+25,1093,0, 'King Pin Spawnlocation 4'), +(@GUID+26,1093,0, 'King Pin Spawnlocation 5'), +(@GUID+27,1094,0, 'Tukemuth Spawnlocation 1'), +(@GUID+28,1094,0, 'Tukemuth Spawnlocation 2'), +(@GUID+29,1094,0, 'Tukemuth Spawnlocation 3'), +(@GUID+30,1094,0, 'Tukemuth Spawnlocation 4'), +(@GUID+31,1094,0, 'Tukemuth Spawnlocation 5'), +(@GUID+32,1094,0, 'Tukemuth Spawnlocation 6'), +(@GUID+33,1094,0, 'Tukemuth Spawnlocation 7'), +(@GUID+34,1094,0, 'Tukemuth Spawnlocation 8'), +(@GUID+35,1095,0, 'Grocklar Spawnlocation 1'), +(@GUID+36,1095,0, 'Grocklar Spawnlocation 2'), +(@GUID+37,1095,0, 'Grocklar Spawnlocation 3'), +(@GUID+38,1095,0, 'Grocklar Spawnlocation 4'), +(@GUID+39,1095,0, 'Grocklar Spawnlocation 5'), +(@GUID+40,1095,0, 'Grocklar Spawnlocation 6'), +(@GUID+41,1096,0, 'Seething Hate Spawnlocation 1'), +(@GUID+42,1096,0, 'Seething Hate Spawnlocation 2'), +(@GUID+43,1096,0, 'Seething Hate Spawnlocation 3'), +(@GUID+44,1097,0, 'Syreian the Bonecarver Spawnlocation 1'), +(@GUID+45,1097,0, 'Syreian the Bonecarver Spawnlocation 2'), +(@GUID+46,1097,0, 'Syreian the Bonecarver Spawnlocation 3'), +(@GUID+47,1097,0, 'Syreian the Bonecarver Spawnlocation 4'), +(@GUID+48,1097,0, 'Syreian the Bonecarver Spawnlocation 5'), +(@GUID+49,1097,0, 'Syreian the Bonecarver Spawnlocation 6'), +(@GUID+50,1098,0, 'Hildana Deathstealer Spawnlocation 1'), +(@GUID+51,1098,0, 'Hildana Deathstealer Spawnlocation 2'), +(@GUID+52,1098,0, 'Hildana Deathstealer Spawnlocation 3'), +(@GUID+53,1098,0, 'Hildana Deathstealer Spawnlocation 4'), +(@GUID+54,1099,0, 'High Thane Jorfus Spawnlocation 1'), +(@GUID+55,1099,0, 'High Thane Jorfus Spawnlocation 2'), +(@GUID+56,1099,0, 'High Thane Jorfus Spawnlocation 3'), +(@GUID+57,1100,0, 'Terror Spinner Spawnlocation 1'), +(@GUID+58,1100,0, 'Terror Spinner Spawnlocation 2'), +(@GUID+59,1100,0, 'Terror Spinner Spawnlocation 3'), +(@GUID+60,1100,0, 'Terror Spinner Spawnlocation 4'), +(@GUID+61,1101,0, 'Griegen Spawnlocation 1'), +(@GUID+62,1101,0, 'Griegen Spawnlocation 2'), +(@GUID+63,1101,0, 'Griegen Spawnlocation 3'), +(@GUID+64,1101,0, 'Griegen Spawnlocation 4'), +(@GUID+65,1101,0, 'Griegen Spawnlocation 5'), +(@GUID+66,1101,0, 'Griegen Spawnlocation 6'), +(@GUID+67,1101,0, 'Griegen Spawnlocation 7'), +(@GUID+68,1102,0, 'King Krush Spawnlocation 1'), +(@GUID+69,1102,0, 'King Krush Spawnlocation 2'), +(@GUID+70,1103,0, 'Aotona Spawnlocation 1'), +(@GUID+71,1103,0, 'Aotona Spawnlocation 2'), +(@GUID+72,1103,0, 'Aotona Spawnlocation 3'), +(@GUID+73,1103,0, 'Aotona Spawnlocation 4'), +(@GUID+74,1103,0, 'Aotona Spawnlocation 5'), +(@GUID+75,1103,0, 'Aotona Spawnlocation 6'), +(@GUID+76,1104,0, 'Dirkee Spawnlocation 1'), +(@GUID+77,1104,0, 'Dirkee Spawnlocation 2'), +(@GUID+78,1104,0, 'Dirkee Spawnlocation 3'), +(@GUID+79,1104,0, 'Dirkee Spawnlocation 4'), +(@GUID+80,1105,0, 'Putridus the Ancient Spawnlocation 1'), +(@GUID+81,1105,0, 'Putridus the Ancient Spawnlocation 2'), +(@GUID+82,1105,0, 'Putridus the Ancient Spawnlocation 3'), +(@GUID+83,1105,0, 'Putridus the Ancient Spawnlocation 4'), +(@GUID+84,1105,0, 'Putridus the Ancient Spawnlocation 5'), +(@GUID+85,1106,0, 'Zul Drak Sentinel Spawnlocation 1'), +(@GUID+86,1106,0, 'Zul Drak Sentinel Spawnlocation 2'); + +-- ----------------------- +-- -- Creature Pathings -- +-- ----------------------- +-- Putridus the Ancient SAI +SET @ENTRY := 32487; +SET @SPELL1 := 61080; -- Putrid Punt +SET @SPELL2 := 41534; -- War Stomp +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,0,0,100,0,7000,8000,8000,9000,11,@SPELL1,1,0,0,0,0,2,0,0,0,0,0,0,0,'Putridus the Ancient - Combat - Cast Putrid Punt'), +(@ENTRY,0,1,0,0,0,100,0,6000,7000,12000,12000,11,@SPELL2,1,0,0,0,0,2,0,0,0,0,0,0,0,'Putridus the Ancient - Combat - Cast War Stomp'); +-- Pathing for Putridus the Ancient Entry: 32487 +SET @PATH := @GUID+80 * 10; +DELETE FROM `creature_addon` WHERE `guid`=@GUID+80; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@GUID+80,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,6682.528,2498.002,433.9948,0,0,0,100,0), +(@PATH,2,6726.491,2521.456,428.1825,0,0,0,100,0), +(@PATH,3,6763.606,2540.764,424.1843,0,0,0,100,0), +(@PATH,4,6798.884,2566.029,418.5891,0,0,0,100,0), +(@PATH,5,6840.742,2591.737,413.0497,0,0,0,100,0), +(@PATH,6,6881.453,2615.144,409.9131,0,0,0,100,0), +(@PATH,7,6918.779,2634.562,405.9561,0,0,0,100,0), +(@PATH,8,6958.574,2641.570,401.6977,0,0,0,100,0), +(@PATH,9,7005.859,2647.866,399.2826,0,0,0,100,0), +(@PATH,10,7046.561,2646.076,397.9875,0,0,0,100,0), +(@PATH,11,7080.877,2647.094,397.3363,0,0,0,100,0), +(@PATH,12,7124.366,2648.242,395.8636,0,0,0,100,0), +(@PATH,13,7161.439,2649.354,395.0137,0,0,0,100,0), +(@PATH,14,7199.069,2648.609,394.5688,0,0,0,100,0), +(@PATH,15,7239.180,2647.334,392.9237,0,0,0,100,0), +(@PATH,16,7285.470,2636.182,393.9926,0,0,0,100,0), +(@PATH,17,7315.738,2608.110,393.2762,0,0,0,100,0), +(@PATH,18,7348.643,2572.670,392.2311,0,0,0,100,0), +(@PATH,19,7370.756,2530.682,392.1492,0,0,0,100,0), +(@PATH,20,7395.200,2496.757,391.2005,0,0,0,100,0), +(@PATH,21,7424.339,2472.582,388.7454,0,0,0,100,0), +(@PATH,22,7456.768,2452.186,385.1945,0,0,0,100,0), +(@PATH,23,7497.301,2428.523,382.9902,0,0,0,100,0), +(@PATH,24,7538.836,2402.540,380.5944,0,0,0,100,0), +(@PATH,25,7581.293,2376.074,376.8400,0,0,0,100,0), +(@PATH,26,7618.725,2352.308,374.1796,0,0,0,100,0), +(@PATH,27,7653.262,2329.615,373.0400,0,0,0,100,0), +(@PATH,28,7687.885,2305.656,370.4056,0,0,0,100,0), +(@PATH,29,7726.067,2275.610,369.6468,0,0,0,100,0), +(@PATH,30,7757.738,2242.657,369.2574,0,0,0,100,0), +(@PATH,31,7780.571,2213.544,367.9858,0,0,0,100,0), +(@PATH,32,7798.583,2186.587,366.9403,0,0,0,100,0), +(@PATH,33,7811.335,2150.569,364.6897,0,0,0,100,0), +(@PATH,34,7812.443,2103.041,380.3420,0,0,0,100,0), +(@PATH,35,7812.340,2079.998,389.7163,0,0,0,100,0), +(@PATH,36,7812.245,2058.403,392.1172,0,0,0,100,0), +(@PATH,37,7812.190,2036.709,389.5194,0,0,0,100,0), +(@PATH,38,7812.143,2014.416,380.2727,0,0,0,100,0), +(@PATH,39,7811.477,1974.489,367.6566,0,0,0,100,0), +(@PATH,40,7811.252,1937.083,365.6089,0,0,0,100,0), +(@PATH,41,7810.860,1897.173,363.0266,0,0,0,100,0), +(@PATH,42,7785.744,1870.642,361.4379,0,0,0,100,0), +(@PATH,43,7743.309,1851.258,357.4115,0,0,0,100,0), +(@PATH,44,7699.728,1829.282,355.4451,0,0,0,100,0), +(@PATH,45,7696.018,1791.864,351.5138,0,0,0,100,0), +(@PATH,46,7702.002,1751.072,346.2082,0,0,0,100,0), +(@PATH,47,7723.843,1723.729,344.1997,0,0,0,100,0), +(@PATH,48,7727.404,1690.751,342.8039,0,0,0,100,0), +(@PATH,49,7711.238,1670.327,340.3039,0,0,0,100,0), +(@PATH,50,7689.874,1631.565,336.2794,0,0,0,100,0), +(@PATH,51,7668.053,1600.292,334.6544,0,0,0,100,0), +(@PATH,52,7645.275,1559.671,332.7607,0,0,0,100,0), +(@PATH,53,7632.163,1515.536,331.6975,0,0,0,100,0), +(@PATH,54,7609.677,1477.351,330.2054,0,0,0,100,0), +(@PATH,55,7579.112,1452.958,327.5829,0,0,0,100,0), +(@PATH,56,7539.097,1427.456,324.4498,0,0,0,100,0), +(@PATH,57,7519.051,1409.884,321.9337,0,0,0,100,0), +(@PATH,58,7501.126,1376.004,319.7974,0,0,0,100,0), +(@PATH,59,7460.677,1369.438,314.6037,0,0,0,100,0), +(@PATH,60,7419.581,1363.374,312.0828,0,0,0,100,0), +(@PATH,61,7389.044,1348.929,310.1828,0,0,0,100,0), +(@PATH,62,7347.691,1344.195,308.6195,0,0,0,100,0), +(@PATH,63,7314.380,1346.306,307.6338,0,0,0,100,0), +(@PATH,64,7281.290,1348.486,306.5570,0,0,0,100,0), +(@PATH,65,7259.728,1332.310,305.3224,0,0,0,100,0), +(@PATH,66,7226.770,1301.865,302.9928,0,0,0,100,0), +(@PATH,67,7190.445,1270.757,302.0640,0,0,0,100,0), +(@PATH,68,7159.991,1271.942,300.1463,0,0,0,100,0), +(@PATH,69,7118.611,1256.946,297.7034,0,0,0,100,0), +(@PATH,70,7077.323,1235.719,296.1696,0,0,0,100,0), +(@PATH,71,7049.174,1225.784,295.9547,0,0,0,100,0), +(@PATH,72,7038.954,1222.982,295.8718,0,0,0,100,0), +(@PATH,73,7005.839,1214.057,306.8951,0,0,0,100,0), +(@PATH,74,6974.230,1206.504,304.6984,0,0,0,100,0), +(@PATH,75,6968.840,1205.214,302.3910,0,0,0,100,0), +(@PATH,76,6945.642,1200.520,292.3016,0,0,0,100,0), +(@PATH,77,6914.853,1191.724,288.5059,0,0,0,100,0), +(@PATH,78,6882.745,1177.818,284.5468,0,0,0,100,0), +(@PATH,79,6845.187,1154.830,281.7770,0,0,0,100,0), +(@PATH,80,6810.069,1170.602,278.5624,0,0,0,100,0), +(@PATH,81,6778.632,1167.743,275.3220,0,0,0,100,0), +(@PATH,82,6757.009,1150.346,275.5406,0,0,0,100,0), +(@PATH,83,6734.180,1152.155,275.0406,0,0,0,100,0), +(@PATH,84,6708.991,1156.622,274.5040,0,0,0,100,0), +(@PATH,85,6693.807,1148.469,273.6163,0,0,0,100,0), +(@PATH,86,6671.106,1128.045,274.4435,0,0,0,100,0), +(@PATH,87,6693.807,1148.469,273.6163,0,0,0,100,0), +(@PATH,88,6708.991,1156.622,274.5040,0,0,0,100,0), +(@PATH,89,6734.180,1152.155,275.0406,0,0,0,100,0), +(@PATH,90,6757.009,1150.346,275.5406,0,0,0,100,0), +(@PATH,91,6778.632,1167.743,275.3220,0,0,0,100,0), +(@PATH,92,6810.069,1170.602,278.5624,0,0,0,100,0), +(@PATH,93,6845.187,1154.830,281.7770,0,0,0,100,0), +(@PATH,94,6882.745,1177.818,284.5468,0,0,0,100,0), +(@PATH,95,6914.853,1191.724,288.5059,0,0,0,100,0), +(@PATH,96,6945.642,1200.520,292.3016,0,0,0,100,0), +(@PATH,97,6968.840,1205.214,302.3910,0,0,0,100,0), +(@PATH,98,6974.230,1206.504,304.6984,0,0,0,100,0), +(@PATH,99,7005.839,1214.057,306.8951,0,0,0,100,0), +(@PATH,100,7038.954,1222.982,295.8718,0,0,0,100,0), +(@PATH,101,7049.174,1225.784,295.9547,0,0,0,100,0), +(@PATH,102,7077.323,1235.719,296.1696,0,0,0,100,0), +(@PATH,103,7118.611,1256.946,297.7034,0,0,0,100,0), +(@PATH,104,7159.991,1271.942,300.1463,0,0,0,100,0), +(@PATH,105,7190.445,1270.757,302.0640,0,0,0,100,0), +(@PATH,106,7226.770,1301.865,302.9928,0,0,0,100,0), +(@PATH,107,7259.728,1332.310,305.3224,0,0,0,100,0), +(@PATH,108,7281.290,1348.486,306.5570,0,0,0,100,0), +(@PATH,109,7314.380,1346.306,307.6338,0,0,0,100,0), +(@PATH,110,7347.691,1344.195,308.6195,0,0,0,100,0), +(@PATH,111,7389.044,1348.929,310.1828,0,0,0,100,0), +(@PATH,112,7419.581,1363.374,312.0828,0,0,0,100,0), +(@PATH,113,7460.677,1369.438,314.6037,0,0,0,100,0), +(@PATH,114,7501.126,1376.004,319.7974,0,0,0,100,0), +(@PATH,115,7519.051,1409.884,321.9337,0,0,0,100,0), +(@PATH,116,7539.097,1427.456,324.4498,0,0,0,100,0), +(@PATH,117,7579.112,1452.958,327.5829,0,0,0,100,0), +(@PATH,118,7609.677,1477.351,330.2054,0,0,0,100,0), +(@PATH,119,7632.163,1515.536,331.6975,0,0,0,100,0), +(@PATH,120,7645.275,1559.671,332.7607,0,0,0,100,0), +(@PATH,121,7668.053,1600.292,334.6544,0,0,0,100,0), +(@PATH,122,7689.874,1631.565,336.2794,0,0,0,100,0), +(@PATH,123,7711.238,1670.327,340.3039,0,0,0,100,0), +(@PATH,124,7727.404,1690.751,342.8039,0,0,0,100,0), +(@PATH,125,7723.843,1723.729,344.1997,0,0,0,100,0), +(@PATH,126,7702.002,1751.072,346.2082,0,0,0,100,0), +(@PATH,127,7696.018,1791.864,351.5138,0,0,0,100,0), +(@PATH,128,7699.728,1829.282,355.4451,0,0,0,100,0), +(@PATH,129,7743.309,1851.258,357.4115,0,0,0,100,0), +(@PATH,130,7785.744,1870.642,361.4379,0,0,0,100,0), +(@PATH,131,7810.860,1897.173,363.0266,0,0,0,100,0), +(@PATH,132,7811.252,1937.083,365.6089,0,0,0,100,0), +(@PATH,133,7811.477,1974.489,367.6566,0,0,0,100,0), +(@PATH,134,7812.143,2014.416,380.2727,0,0,0,100,0), +(@PATH,135,7812.190,2036.709,389.5194,0,0,0,100,0), +(@PATH,136,7812.245,2058.403,392.1172,0,0,0,100,0), +(@PATH,137,7812.340,2079.998,389.7163,0,0,0,100,0), +(@PATH,138,7812.443,2103.041,380.3420,0,0,0,100,0), +(@PATH,139,7811.335,2150.569,364.6897,0,0,0,100,0), +(@PATH,140,7798.583,2186.587,366.9403,0,0,0,100,0), +(@PATH,141,7780.571,2213.544,367.9858,0,0,0,100,0), +(@PATH,142,7757.738,2242.657,369.2574,0,0,0,100,0), +(@PATH,143,7726.067,2275.610,369.6468,0,0,0,100,0), +(@PATH,144,7687.885,2305.656,370.4056,0,0,0,100,0), +(@PATH,145,7653.262,2329.615,373.0400,0,0,0,100,0), +(@PATH,146,7618.725,2352.308,374.1796,0,0,0,100,0), +(@PATH,147,7581.293,2376.074,376.8400,0,0,0,100,0), +(@PATH,148,7538.836,2402.540,380.5944,0,0,0,100,0), +(@PATH,149,7497.301,2428.523,382.9902,0,0,0,100,0), +(@PATH,150,7456.768,2452.186,385.1945,0,0,0,100,0), +(@PATH,151,7424.339,2472.582,388.7454,0,0,0,100,0), +(@PATH,152,7395.200,2496.757,391.2005,0,0,0,100,0), +(@PATH,153,7370.756,2530.682,392.1492,0,0,0,100,0), +(@PATH,154,7348.643,2572.670,392.2311,0,0,0,100,0), +(@PATH,155,7315.738,2608.110,393.2762,0,0,0,100,0), +(@PATH,156,7285.470,2636.182,393.9926,0,0,0,100,0), +(@PATH,157,7239.180,2647.334,392.9237,0,0,0,100,0), +(@PATH,158,7199.069,2648.609,394.5688,0,0,0,100,0), +(@PATH,159,7161.439,2649.354,395.0137,0,0,0,100,0), +(@PATH,160,7124.366,2648.242,395.8636,0,0,0,100,0), +(@PATH,161,7080.877,2647.094,397.3363,0,0,0,100,0), +(@PATH,162,7046.561,2646.076,397.9875,0,0,0,100,0), +(@PATH,163,7005.859,2647.866,399.2826,0,0,0,100,0), +(@PATH,164,6958.574,2641.570,401.6977,0,0,0,100,0), +(@PATH,165,6918.779,2634.562,405.9561,0,0,0,100,0), +(@PATH,166,6881.453,2615.144,409.9131,0,0,0,100,0), +(@PATH,167,6840.742,2591.737,413.0497,0,0,0,100,0), +(@PATH,168,6798.884,2566.029,418.5891,0,0,0,100,0), +(@PATH,169,6763.606,2540.764,424.1843,0,0,0,100,0), +(@PATH,170,6726.491,2521.456,428.1825,0,0,0,100,0); +-- Pathing for Putridus the Ancient Entry: 32487 +SET @PATH := @GUID+81 * 10; +DELETE FROM `creature_addon` WHERE `guid`=@GUID+81; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@GUID+81,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,7812.340,2079.998,389.7163,0,0,0,100,0), +(@PATH,2,7812.245,2058.403,392.1172,0,0,0,100,0), +(@PATH,3,7812.190,2036.709,389.5194,0,0,0,100,0), +(@PATH,4,7812.143,2014.416,380.2727,0,0,0,100,0), +(@PATH,5,7811.477,1974.489,367.6566,0,0,0,100,0), +(@PATH,6,7811.252,1937.083,365.6089,0,0,0,100,0), +(@PATH,7,7810.860,1897.173,363.0266,0,0,0,100,0), +(@PATH,8,7785.744,1870.642,361.4379,0,0,0,100,0), +(@PATH,9,7743.309,1851.258,357.4115,0,0,0,100,0), +(@PATH,10,7699.728,1829.282,355.4451,0,0,0,100,0), +(@PATH,11,7696.018,1791.864,351.5138,0,0,0,100,0), +(@PATH,12,7702.002,1751.072,346.2082,0,0,0,100,0), +(@PATH,13,7723.843,1723.729,344.1997,0,0,0,100,0), +(@PATH,14,7727.404,1690.751,342.8039,0,0,0,100,0), +(@PATH,15,7711.238,1670.327,340.3039,0,0,0,100,0), +(@PATH,16,7689.874,1631.565,336.2794,0,0,0,100,0), +(@PATH,17,7668.053,1600.292,334.6544,0,0,0,100,0), +(@PATH,18,7645.275,1559.671,332.7607,0,0,0,100,0), +(@PATH,19,7632.163,1515.536,331.6975,0,0,0,100,0), +(@PATH,20,7609.677,1477.351,330.2054,0,0,0,100,0), +(@PATH,21,7579.112,1452.958,327.5829,0,0,0,100,0), +(@PATH,22,7539.097,1427.456,324.4498,0,0,0,100,0), +(@PATH,23,7519.051,1409.884,321.9337,0,0,0,100,0), +(@PATH,24,7501.126,1376.004,319.7974,0,0,0,100,0), +(@PATH,25,7460.677,1369.438,314.6037,0,0,0,100,0), +(@PATH,26,7419.581,1363.374,312.0828,0,0,0,100,0), +(@PATH,27,7389.044,1348.929,310.1828,0,0,0,100,0), +(@PATH,28,7347.691,1344.195,308.6195,0,0,0,100,0), +(@PATH,29,7314.380,1346.306,307.6338,0,0,0,100,0), +(@PATH,30,7281.290,1348.486,306.5570,0,0,0,100,0), +(@PATH,31,7259.728,1332.310,305.3224,0,0,0,100,0), +(@PATH,32,7226.770,1301.865,302.9928,0,0,0,100,0), +(@PATH,33,7190.445,1270.757,302.0640,0,0,0,100,0), +(@PATH,34,7159.991,1271.942,300.1463,0,0,0,100,0), +(@PATH,35,7118.611,1256.946,297.7034,0,0,0,100,0), +(@PATH,36,7077.323,1235.719,296.1696,0,0,0,100,0), +(@PATH,37,7049.174,1225.784,295.9547,0,0,0,100,0), +(@PATH,38,7038.954,1222.982,295.8718,0,0,0,100,0), +(@PATH,39,7005.839,1214.057,306.8951,0,0,0,100,0), +(@PATH,40,6974.230,1206.504,304.6984,0,0,0,100,0), +(@PATH,41,6968.840,1205.214,302.3910,0,0,0,100,0), +(@PATH,42,6945.642,1200.520,292.3016,0,0,0,100,0), +(@PATH,43,6914.853,1191.724,288.5059,0,0,0,100,0), +(@PATH,44,6882.745,1177.818,284.5468,0,0,0,100,0), +(@PATH,45,6845.187,1154.830,281.7770,0,0,0,100,0), +(@PATH,46,6810.069,1170.602,278.5624,0,0,0,100,0), +(@PATH,47,6778.632,1167.743,275.3220,0,0,0,100,0), +(@PATH,48,6757.009,1150.346,275.5406,0,0,0,100,0), +(@PATH,49,6734.180,1152.155,275.0406,0,0,0,100,0), +(@PATH,50,6708.991,1156.622,274.5040,0,0,0,100,0), +(@PATH,51,6693.807,1148.469,273.6163,0,0,0,100,0), +(@PATH,52,6671.106,1128.045,274.4435,0,0,0,100,0), +(@PATH,53,6693.807,1148.469,273.6163,0,0,0,100,0), +(@PATH,54,6708.991,1156.622,274.5040,0,0,0,100,0), +(@PATH,55,6734.180,1152.155,275.0406,0,0,0,100,0), +(@PATH,56,6757.009,1150.346,275.5406,0,0,0,100,0), +(@PATH,57,6778.632,1167.743,275.3220,0,0,0,100,0), +(@PATH,58,6810.069,1170.602,278.5624,0,0,0,100,0), +(@PATH,59,6845.187,1154.830,281.7770,0,0,0,100,0), +(@PATH,60,6882.745,1177.818,284.5468,0,0,0,100,0), +(@PATH,61,6914.853,1191.724,288.5059,0,0,0,100,0), +(@PATH,62,6945.642,1200.520,292.3016,0,0,0,100,0), +(@PATH,63,6968.840,1205.214,302.3910,0,0,0,100,0), +(@PATH,64,6974.230,1206.504,304.6984,0,0,0,100,0), +(@PATH,65,7005.839,1214.057,306.8951,0,0,0,100,0), +(@PATH,66,7038.954,1222.982,295.8718,0,0,0,100,0), +(@PATH,67,7049.174,1225.784,295.9547,0,0,0,100,0), +(@PATH,68,7077.323,1235.719,296.1696,0,0,0,100,0), +(@PATH,69,7118.611,1256.946,297.7034,0,0,0,100,0), +(@PATH,70,7159.991,1271.942,300.1463,0,0,0,100,0), +(@PATH,71,7190.445,1270.757,302.0640,0,0,0,100,0), +(@PATH,72,7226.770,1301.865,302.9928,0,0,0,100,0), +(@PATH,73,7259.728,1332.310,305.3224,0,0,0,100,0), +(@PATH,74,7281.290,1348.486,306.5570,0,0,0,100,0), +(@PATH,75,7314.380,1346.306,307.6338,0,0,0,100,0), +(@PATH,76,7347.691,1344.195,308.6195,0,0,0,100,0), +(@PATH,77,7389.044,1348.929,310.1828,0,0,0,100,0), +(@PATH,78,7419.581,1363.374,312.0828,0,0,0,100,0), +(@PATH,79,7460.677,1369.438,314.6037,0,0,0,100,0), +(@PATH,80,7501.126,1376.004,319.7974,0,0,0,100,0), +(@PATH,81,7519.051,1409.884,321.9337,0,0,0,100,0), +(@PATH,82,7539.097,1427.456,324.4498,0,0,0,100,0), +(@PATH,83,7579.112,1452.958,327.5829,0,0,0,100,0), +(@PATH,84,7609.677,1477.351,330.2054,0,0,0,100,0), +(@PATH,85,7632.163,1515.536,331.6975,0,0,0,100,0), +(@PATH,86,7645.275,1559.671,332.7607,0,0,0,100,0), +(@PATH,87,7668.053,1600.292,334.6544,0,0,0,100,0), +(@PATH,88,7689.874,1631.565,336.2794,0,0,0,100,0), +(@PATH,89,7711.238,1670.327,340.3039,0,0,0,100,0), +(@PATH,90,7727.404,1690.751,342.8039,0,0,0,100,0), +(@PATH,91,7723.843,1723.729,344.1997,0,0,0,100,0), +(@PATH,92,7702.002,1751.072,346.2082,0,0,0,100,0), +(@PATH,93,7696.018,1791.864,351.5138,0,0,0,100,0), +(@PATH,94,7699.728,1829.282,355.4451,0,0,0,100,0), +(@PATH,95,7743.309,1851.258,357.4115,0,0,0,100,0), +(@PATH,96,7785.744,1870.642,361.4379,0,0,0,100,0), +(@PATH,97,7810.860,1897.173,363.0266,0,0,0,100,0), +(@PATH,98,7811.252,1937.083,365.6089,0,0,0,100,0), +(@PATH,99,7811.477,1974.489,367.6566,0,0,0,100,0), +(@PATH,100,7812.143,2014.416,380.2727,0,0,0,100,0), +(@PATH,101,7812.190,2036.709,389.5194,0,0,0,100,0), +(@PATH,102,7812.245,2058.403,392.1172,0,0,0,100,0), +(@PATH,103,7812.340,2079.998,389.7163,0,0,0,100,0), +(@PATH,104,7812.443,2103.041,380.3420,0,0,0,100,0), +(@PATH,105,7811.335,2150.569,364.6897,0,0,0,100,0), +(@PATH,106,7798.583,2186.587,366.9403,0,0,0,100,0), +(@PATH,107,7780.571,2213.544,367.9858,0,0,0,100,0), +(@PATH,108,7757.738,2242.657,369.2574,0,0,0,100,0), +(@PATH,109,7726.067,2275.610,369.6468,0,0,0,100,0), +(@PATH,110,7687.885,2305.656,370.4056,0,0,0,100,0), +(@PATH,111,7653.262,2329.615,373.0400,0,0,0,100,0), +(@PATH,112,7618.725,2352.308,374.1796,0,0,0,100,0), +(@PATH,113,7581.293,2376.074,376.8400,0,0,0,100,0), +(@PATH,114,7538.836,2402.540,380.5944,0,0,0,100,0), +(@PATH,115,7497.301,2428.523,382.9902,0,0,0,100,0), +(@PATH,116,7456.768,2452.186,385.1945,0,0,0,100,0), +(@PATH,117,7424.339,2472.582,388.7454,0,0,0,100,0), +(@PATH,118,7395.200,2496.757,391.2005,0,0,0,100,0), +(@PATH,119,7370.756,2530.682,392.1492,0,0,0,100,0), +(@PATH,120,7348.643,2572.670,392.2311,0,0,0,100,0), +(@PATH,121,7315.738,2608.110,393.2762,0,0,0,100,0), +(@PATH,122,7285.470,2636.182,393.9926,0,0,0,100,0), +(@PATH,123,7239.180,2647.334,392.9237,0,0,0,100,0), +(@PATH,124,7199.069,2648.609,394.5688,0,0,0,100,0), +(@PATH,125,7161.439,2649.354,395.0137,0,0,0,100,0), +(@PATH,126,7124.366,2648.242,395.8636,0,0,0,100,0), +(@PATH,127,7080.877,2647.094,397.3363,0,0,0,100,0), +(@PATH,128,7046.561,2646.076,397.9875,0,0,0,100,0), +(@PATH,129,7005.859,2647.866,399.2826,0,0,0,100,0), +(@PATH,130,6958.574,2641.570,401.6977,0,0,0,100,0), +(@PATH,131,6918.779,2634.562,405.9561,0,0,0,100,0), +(@PATH,132,6881.453,2615.144,409.9131,0,0,0,100,0), +(@PATH,133,6840.742,2591.737,413.0497,0,0,0,100,0), +(@PATH,134,6798.884,2566.029,418.5891,0,0,0,100,0), +(@PATH,135,6763.606,2540.764,424.1843,0,0,0,100,0), +(@PATH,136,6726.491,2521.456,428.1825,0,0,0,100,0), +(@PATH,137,6682.528,2498.002,433.9948,0,0,0,100,0), +(@PATH,138,6726.491,2521.456,428.1825,0,0,0,100,0), +(@PATH,139,6763.606,2540.764,424.1843,0,0,0,100,0), +(@PATH,140,6798.884,2566.029,418.5891,0,0,0,100,0), +(@PATH,141,6840.742,2591.737,413.0497,0,0,0,100,0), +(@PATH,142,6881.453,2615.144,409.9131,0,0,0,100,0), +(@PATH,143,6918.779,2634.562,405.9561,0,0,0,100,0), +(@PATH,144,6958.574,2641.570,401.6977,0,0,0,100,0), +(@PATH,145,7005.859,2647.866,399.2826,0,0,0,100,0), +(@PATH,146,7046.561,2646.076,397.9875,0,0,0,100,0), +(@PATH,147,7080.877,2647.094,397.3363,0,0,0,100,0), +(@PATH,148,7124.366,2648.242,395.8636,0,0,0,100,0), +(@PATH,149,7161.439,2649.354,395.0137,0,0,0,100,0), +(@PATH,150,7199.069,2648.609,394.5688,0,0,0,100,0), +(@PATH,151,7239.180,2647.334,392.9237,0,0,0,100,0), +(@PATH,152,7285.470,2636.182,393.9926,0,0,0,100,0), +(@PATH,153,7315.738,2608.110,393.2762,0,0,0,100,0), +(@PATH,154,7348.643,2572.670,392.2311,0,0,0,100,0), +(@PATH,155,7370.756,2530.682,392.1492,0,0,0,100,0), +(@PATH,156,7395.200,2496.757,391.2005,0,0,0,100,0), +(@PATH,157,7424.339,2472.582,388.7454,0,0,0,100,0), +(@PATH,158,7456.768,2452.186,385.1945,0,0,0,100,0), +(@PATH,159,7497.301,2428.523,382.9902,0,0,0,100,0), +(@PATH,160,7538.836,2402.540,380.5944,0,0,0,100,0), +(@PATH,161,7581.293,2376.074,376.8400,0,0,0,100,0), +(@PATH,162,7618.725,2352.308,374.1796,0,0,0,100,0), +(@PATH,163,7653.262,2329.615,373.0400,0,0,0,100,0), +(@PATH,164,7687.885,2305.656,370.4056,0,0,0,100,0), +(@PATH,165,7726.067,2275.610,369.6468,0,0,0,100,0), +(@PATH,166,7757.738,2242.657,369.2574,0,0,0,100,0), +(@PATH,167,7780.571,2213.544,367.9858,0,0,0,100,0), +(@PATH,168,7798.583,2186.587,366.9403,0,0,0,100,0), +(@PATH,169,7811.335,2150.569,364.6897,0,0,0,100,0), +(@PATH,170,7812.443,2103.041,380.3420,0,0,0,100,0); +-- Pathing for Putridus the Ancient Entry: 32487 +SET @PATH := @GUID+82 * 10; +DELETE FROM `creature_addon` WHERE `guid`=@GUID+82; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@GUID+82,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,7632.163,1515.536,331.6975,0,0,0,100,0), +(@PATH,2,7645.275,1559.671,332.7607,0,0,0,100,0), +(@PATH,3,7668.053,1600.292,334.6544,0,0,0,100,0), +(@PATH,4,7689.874,1631.565,336.2794,0,0,0,100,0), +(@PATH,5,7711.238,1670.327,340.3039,0,0,0,100,0), +(@PATH,6,7727.404,1690.751,342.8039,0,0,0,100,0), +(@PATH,7,7723.843,1723.729,344.1997,0,0,0,100,0), +(@PATH,8,7702.002,1751.072,346.2082,0,0,0,100,0), +(@PATH,9,7696.018,1791.864,351.5138,0,0,0,100,0), +(@PATH,10,7699.728,1829.282,355.4451,0,0,0,100,0), +(@PATH,11,7743.309,1851.258,357.4115,0,0,0,100,0), +(@PATH,12,7785.744,1870.642,361.4379,0,0,0,100,0), +(@PATH,13,7810.860,1897.173,363.0266,0,0,0,100,0), +(@PATH,14,7811.252,1937.083,365.6089,0,0,0,100,0), +(@PATH,15,7811.477,1974.489,367.6566,0,0,0,100,0), +(@PATH,16,7812.143,2014.416,380.2727,0,0,0,100,0), +(@PATH,17,7812.190,2036.709,389.5194,0,0,0,100,0), +(@PATH,18,7812.245,2058.403,392.1172,0,0,0,100,0), +(@PATH,19,7812.340,2079.998,389.7163,0,0,0,100,0), +(@PATH,20,7812.443,2103.041,380.3420,0,0,0,100,0), +(@PATH,21,7811.335,2150.569,364.6897,0,0,0,100,0), +(@PATH,22,7798.583,2186.587,366.9403,0,0,0,100,0), +(@PATH,23,7780.571,2213.544,367.9858,0,0,0,100,0), +(@PATH,24,7757.738,2242.657,369.2574,0,0,0,100,0), +(@PATH,25,7726.067,2275.610,369.6468,0,0,0,100,0), +(@PATH,26,7687.885,2305.656,370.4056,0,0,0,100,0), +(@PATH,27,7653.262,2329.615,373.0400,0,0,0,100,0), +(@PATH,28,7618.725,2352.308,374.1796,0,0,0,100,0), +(@PATH,29,7581.293,2376.074,376.8400,0,0,0,100,0), +(@PATH,30,7538.836,2402.540,380.5944,0,0,0,100,0), +(@PATH,31,7497.301,2428.523,382.9902,0,0,0,100,0), +(@PATH,32,7456.768,2452.186,385.1945,0,0,0,100,0), +(@PATH,33,7424.339,2472.582,388.7454,0,0,0,100,0), +(@PATH,34,7395.200,2496.757,391.2005,0,0,0,100,0), +(@PATH,35,7370.756,2530.682,392.1492,0,0,0,100,0), +(@PATH,36,7348.643,2572.670,392.2311,0,0,0,100,0), +(@PATH,37,7315.738,2608.110,393.2762,0,0,0,100,0), +(@PATH,38,7285.470,2636.182,393.9926,0,0,0,100,0), +(@PATH,39,7239.180,2647.334,392.9237,0,0,0,100,0), +(@PATH,40,7199.069,2648.609,394.5688,0,0,0,100,0), +(@PATH,41,7161.439,2649.354,395.0137,0,0,0,100,0), +(@PATH,42,7124.366,2648.242,395.8636,0,0,0,100,0), +(@PATH,43,7080.877,2647.094,397.3363,0,0,0,100,0), +(@PATH,44,7046.561,2646.076,397.9875,0,0,0,100,0), +(@PATH,45,7005.859,2647.866,399.2826,0,0,0,100,0), +(@PATH,46,6958.574,2641.570,401.6977,0,0,0,100,0), +(@PATH,47,6918.779,2634.562,405.9561,0,0,0,100,0), +(@PATH,48,6881.453,2615.144,409.9131,0,0,0,100,0), +(@PATH,49,6840.742,2591.737,413.0497,0,0,0,100,0), +(@PATH,50,6798.884,2566.029,418.5891,0,0,0,100,0), +(@PATH,51,6763.606,2540.764,424.1843,0,0,0,100,0), +(@PATH,52,6726.491,2521.456,428.1825,0,0,0,100,0), +(@PATH,53,6682.528,2498.002,433.9948,0,0,0,100,0), +(@PATH,54,6726.491,2521.456,428.1825,0,0,0,100,0), +(@PATH,55,6763.606,2540.764,424.1843,0,0,0,100,0), +(@PATH,56,6798.884,2566.029,418.5891,0,0,0,100,0), +(@PATH,57,6840.742,2591.737,413.0497,0,0,0,100,0), +(@PATH,58,6881.453,2615.144,409.9131,0,0,0,100,0), +(@PATH,59,6918.779,2634.562,405.9561,0,0,0,100,0), +(@PATH,60,6958.574,2641.570,401.6977,0,0,0,100,0), +(@PATH,61,7005.859,2647.866,399.2826,0,0,0,100,0), +(@PATH,62,7046.561,2646.076,397.9875,0,0,0,100,0), +(@PATH,63,7080.877,2647.094,397.3363,0,0,0,100,0), +(@PATH,64,7124.366,2648.242,395.8636,0,0,0,100,0), +(@PATH,65,7161.439,2649.354,395.0137,0,0,0,100,0), +(@PATH,66,7199.069,2648.609,394.5688,0,0,0,100,0), +(@PATH,67,7239.180,2647.334,392.9237,0,0,0,100,0), +(@PATH,68,7285.470,2636.182,393.9926,0,0,0,100,0), +(@PATH,69,7315.738,2608.110,393.2762,0,0,0,100,0), +(@PATH,70,7348.643,2572.670,392.2311,0,0,0,100,0), +(@PATH,71,7370.756,2530.682,392.1492,0,0,0,100,0), +(@PATH,72,7395.200,2496.757,391.2005,0,0,0,100,0), +(@PATH,73,7424.339,2472.582,388.7454,0,0,0,100,0), +(@PATH,74,7456.768,2452.186,385.1945,0,0,0,100,0), +(@PATH,75,7497.301,2428.523,382.9902,0,0,0,100,0), +(@PATH,76,7538.836,2402.540,380.5944,0,0,0,100,0), +(@PATH,77,7581.293,2376.074,376.8400,0,0,0,100,0), +(@PATH,78,7618.725,2352.308,374.1796,0,0,0,100,0), +(@PATH,79,7653.262,2329.615,373.0400,0,0,0,100,0), +(@PATH,80,7687.885,2305.656,370.4056,0,0,0,100,0), +(@PATH,81,7726.067,2275.610,369.6468,0,0,0,100,0), +(@PATH,82,7757.738,2242.657,369.2574,0,0,0,100,0), +(@PATH,83,7780.571,2213.544,367.9858,0,0,0,100,0), +(@PATH,84,7798.583,2186.587,366.9403,0,0,0,100,0), +(@PATH,85,7811.335,2150.569,364.6897,0,0,0,100,0), +(@PATH,86,7812.443,2103.041,380.3420,0,0,0,100,0), +(@PATH,87,7812.340,2079.998,389.7163,0,0,0,100,0), +(@PATH,88,7812.245,2058.403,392.1172,0,0,0,100,0), +(@PATH,89,7812.190,2036.709,389.5194,0,0,0,100,0), +(@PATH,90,7812.143,2014.416,380.2727,0,0,0,100,0), +(@PATH,91,7811.477,1974.489,367.6566,0,0,0,100,0), +(@PATH,92,7811.252,1937.083,365.6089,0,0,0,100,0), +(@PATH,93,7810.860,1897.173,363.0266,0,0,0,100,0), +(@PATH,94,7785.744,1870.642,361.4379,0,0,0,100,0), +(@PATH,95,7743.309,1851.258,357.4115,0,0,0,100,0), +(@PATH,96,7699.728,1829.282,355.4451,0,0,0,100,0), +(@PATH,97,7696.018,1791.864,351.5138,0,0,0,100,0), +(@PATH,98,7702.002,1751.072,346.2082,0,0,0,100,0), +(@PATH,99,7723.843,1723.729,344.1997,0,0,0,100,0), +(@PATH,100,7727.404,1690.751,342.8039,0,0,0,100,0), +(@PATH,101,7711.238,1670.327,340.3039,0,0,0,100,0), +(@PATH,102,7689.874,1631.565,336.2794,0,0,0,100,0), +(@PATH,103,7668.053,1600.292,334.6544,0,0,0,100,0), +(@PATH,104,7645.275,1559.671,332.7607,0,0,0,100,0), +(@PATH,105,7632.163,1515.536,331.6975,0,0,0,100,0), +(@PATH,106,7609.677,1477.351,330.2054,0,0,0,100,0), +(@PATH,107,7579.112,1452.958,327.5829,0,0,0,100,0), +(@PATH,108,7539.097,1427.456,324.4498,0,0,0,100,0), +(@PATH,109,7519.051,1409.884,321.9337,0,0,0,100,0), +(@PATH,110,7501.126,1376.004,319.7974,0,0,0,100,0), +(@PATH,111,7460.677,1369.438,314.6037,0,0,0,100,0), +(@PATH,112,7419.581,1363.374,312.0828,0,0,0,100,0), +(@PATH,113,7389.044,1348.929,310.1828,0,0,0,100,0), +(@PATH,114,7347.691,1344.195,308.6195,0,0,0,100,0), +(@PATH,115,7314.380,1346.306,307.6338,0,0,0,100,0), +(@PATH,116,7281.290,1348.486,306.5570,0,0,0,100,0), +(@PATH,117,7259.728,1332.310,305.3224,0,0,0,100,0), +(@PATH,118,7226.770,1301.865,302.9928,0,0,0,100,0), +(@PATH,119,7190.445,1270.757,302.0640,0,0,0,100,0), +(@PATH,120,7159.991,1271.942,300.1463,0,0,0,100,0), +(@PATH,121,7118.611,1256.946,297.7034,0,0,0,100,0), +(@PATH,122,7077.323,1235.719,296.1696,0,0,0,100,0), +(@PATH,123,7049.174,1225.784,295.9547,0,0,0,100,0), +(@PATH,124,7038.954,1222.982,295.8718,0,0,0,100,0), +(@PATH,125,7005.839,1214.057,306.8951,0,0,0,100,0), +(@PATH,126,6974.230,1206.504,304.6984,0,0,0,100,0), +(@PATH,127,6968.840,1205.214,302.3910,0,0,0,100,0), +(@PATH,128,6945.642,1200.520,292.3016,0,0,0,100,0), +(@PATH,129,6914.853,1191.724,288.5059,0,0,0,100,0), +(@PATH,130,6882.745,1177.818,284.5468,0,0,0,100,0), +(@PATH,131,6845.187,1154.830,281.7770,0,0,0,100,0), +(@PATH,132,6810.069,1170.602,278.5624,0,0,0,100,0), +(@PATH,133,6778.632,1167.743,275.3220,0,0,0,100,0), +(@PATH,134,6757.009,1150.346,275.5406,0,0,0,100,0), +(@PATH,135,6734.180,1152.155,275.0406,0,0,0,100,0), +(@PATH,136,6708.991,1156.622,274.5040,0,0,0,100,0), +(@PATH,137,6693.807,1148.469,273.6163,0,0,0,100,0), +(@PATH,138,6671.106,1128.045,274.4435,0,0,0,100,0), +(@PATH,139,6693.807,1148.469,273.6163,0,0,0,100,0), +(@PATH,140,6708.991,1156.622,274.5040,0,0,0,100,0), +(@PATH,141,6734.180,1152.155,275.0406,0,0,0,100,0), +(@PATH,142,6757.009,1150.346,275.5406,0,0,0,100,0), +(@PATH,143,6778.632,1167.743,275.3220,0,0,0,100,0), +(@PATH,144,6810.069,1170.602,278.5624,0,0,0,100,0), +(@PATH,145,6845.187,1154.830,281.7770,0,0,0,100,0), +(@PATH,146,6882.745,1177.818,284.5468,0,0,0,100,0), +(@PATH,147,6914.853,1191.724,288.5059,0,0,0,100,0), +(@PATH,148,6945.642,1200.520,292.3016,0,0,0,100,0), +(@PATH,149,6968.840,1205.214,302.3910,0,0,0,100,0), +(@PATH,150,6974.230,1206.504,304.6984,0,0,0,100,0), +(@PATH,151,7005.839,1214.057,306.8951,0,0,0,100,0), +(@PATH,152,7038.954,1222.982,295.8718,0,0,0,100,0), +(@PATH,153,7049.174,1225.784,295.9547,0,0,0,100,0), +(@PATH,154,7077.323,1235.719,296.1696,0,0,0,100,0), +(@PATH,155,7118.611,1256.946,297.7034,0,0,0,100,0), +(@PATH,156,7159.991,1271.942,300.1463,0,0,0,100,0), +(@PATH,157,7190.445,1270.757,302.0640,0,0,0,100,0), +(@PATH,158,7226.770,1301.865,302.9928,0,0,0,100,0), +(@PATH,159,7259.728,1332.310,305.3224,0,0,0,100,0), +(@PATH,160,7281.290,1348.486,306.5570,0,0,0,100,0), +(@PATH,161,7314.380,1346.306,307.6338,0,0,0,100,0), +(@PATH,162,7347.691,1344.195,308.6195,0,0,0,100,0), +(@PATH,163,7389.044,1348.929,310.1828,0,0,0,100,0), +(@PATH,164,7419.581,1363.374,312.0828,0,0,0,100,0), +(@PATH,165,7460.677,1369.438,314.6037,0,0,0,100,0), +(@PATH,166,7501.126,1376.004,319.7974,0,0,0,100,0), +(@PATH,167,7519.051,1409.884,321.9337,0,0,0,100,0), +(@PATH,168,7539.097,1427.456,324.4498,0,0,0,100,0), +(@PATH,169,7579.112,1452.958,327.5829,0,0,0,100,0), +(@PATH,170,7609.677,1477.351,330.2054,0,0,0,100,0); +-- Pathing for Putridus the Ancient Entry: 32487 +SET @PATH := @GUID+83 * 10; +DELETE FROM `creature_addon` WHERE `guid`=@GUID+83; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@GUID+83,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,7159.991,1271.942,300.1463,0,0,0,100,0), +(@PATH,2,7118.611,1256.946,297.7034,0,0,0,100,0), +(@PATH,3,7077.323,1235.719,296.1696,0,0,0,100,0), +(@PATH,4,7049.174,1225.784,295.9547,0,0,0,100,0), +(@PATH,5,7038.954,1222.982,295.8718,0,0,0,100,0), +(@PATH,6,7005.839,1214.057,306.8951,0,0,0,100,0), +(@PATH,7,6974.230,1206.504,304.6984,0,0,0,100,0), +(@PATH,8,6968.840,1205.214,302.3910,0,0,0,100,0), +(@PATH,9,6945.642,1200.520,292.3016,0,0,0,100,0), +(@PATH,10,6914.853,1191.724,288.5059,0,0,0,100,0), +(@PATH,11,6882.745,1177.818,284.5468,0,0,0,100,0), +(@PATH,12,6845.187,1154.830,281.7770,0,0,0,100,0), +(@PATH,13,6810.069,1170.602,278.5624,0,0,0,100,0), +(@PATH,14,6778.632,1167.743,275.3220,0,0,0,100,0), +(@PATH,15,6757.009,1150.346,275.5406,0,0,0,100,0), +(@PATH,16,6734.180,1152.155,275.0406,0,0,0,100,0), +(@PATH,17,6708.991,1156.622,274.5040,0,0,0,100,0), +(@PATH,18,6693.807,1148.469,273.6163,0,0,0,100,0), +(@PATH,19,6671.106,1128.045,274.4435,0,0,0,100,0), +(@PATH,20,6693.807,1148.469,273.6163,0,0,0,100,0), +(@PATH,21,6708.991,1156.622,274.5040,0,0,0,100,0), +(@PATH,22,6734.180,1152.155,275.0406,0,0,0,100,0), +(@PATH,23,6757.009,1150.346,275.5406,0,0,0,100,0), +(@PATH,24,6778.632,1167.743,275.3220,0,0,0,100,0), +(@PATH,25,6810.069,1170.602,278.5624,0,0,0,100,0), +(@PATH,26,6845.187,1154.830,281.7770,0,0,0,100,0), +(@PATH,27,6882.745,1177.818,284.5468,0,0,0,100,0), +(@PATH,28,6914.853,1191.724,288.5059,0,0,0,100,0), +(@PATH,29,6945.642,1200.520,292.3016,0,0,0,100,0), +(@PATH,30,6968.840,1205.214,302.3910,0,0,0,100,0), +(@PATH,31,6974.230,1206.504,304.6984,0,0,0,100,0), +(@PATH,32,7005.839,1214.057,306.8951,0,0,0,100,0), +(@PATH,33,7038.954,1222.982,295.8718,0,0,0,100,0), +(@PATH,34,7049.174,1225.784,295.9547,0,0,0,100,0), +(@PATH,35,7077.323,1235.719,296.1696,0,0,0,100,0), +(@PATH,36,7118.611,1256.946,297.7034,0,0,0,100,0), +(@PATH,37,7159.991,1271.942,300.1463,0,0,0,100,0), +(@PATH,38,7190.445,1270.757,302.0640,0,0,0,100,0), +(@PATH,39,7226.770,1301.865,302.9928,0,0,0,100,0), +(@PATH,40,7259.728,1332.310,305.3224,0,0,0,100,0), +(@PATH,41,7281.290,1348.486,306.5570,0,0,0,100,0), +(@PATH,42,7314.380,1346.306,307.6338,0,0,0,100,0), +(@PATH,43,7347.691,1344.195,308.6195,0,0,0,100,0), +(@PATH,44,7389.044,1348.929,310.1828,0,0,0,100,0), +(@PATH,45,7419.581,1363.374,312.0828,0,0,0,100,0), +(@PATH,46,7460.677,1369.438,314.6037,0,0,0,100,0), +(@PATH,47,7501.126,1376.004,319.7974,0,0,0,100,0), +(@PATH,48,7519.051,1409.884,321.9337,0,0,0,100,0), +(@PATH,49,7539.097,1427.456,324.4498,0,0,0,100,0), +(@PATH,50,7579.112,1452.958,327.5829,0,0,0,100,0), +(@PATH,51,7609.677,1477.351,330.2054,0,0,0,100,0), +(@PATH,52,7632.163,1515.536,331.6975,0,0,0,100,0), +(@PATH,53,7645.275,1559.671,332.7607,0,0,0,100,0), +(@PATH,54,7668.053,1600.292,334.6544,0,0,0,100,0), +(@PATH,55,7689.874,1631.565,336.2794,0,0,0,100,0), +(@PATH,56,7711.238,1670.327,340.3039,0,0,0,100,0), +(@PATH,57,7727.404,1690.751,342.8039,0,0,0,100,0), +(@PATH,58,7723.843,1723.729,344.1997,0,0,0,100,0), +(@PATH,59,7702.002,1751.072,346.2082,0,0,0,100,0), +(@PATH,60,7696.018,1791.864,351.5138,0,0,0,100,0), +(@PATH,61,7699.728,1829.282,355.4451,0,0,0,100,0), +(@PATH,62,7743.309,1851.258,357.4115,0,0,0,100,0), +(@PATH,63,7785.744,1870.642,361.4379,0,0,0,100,0), +(@PATH,64,7810.860,1897.173,363.0266,0,0,0,100,0), +(@PATH,65,7811.252,1937.083,365.6089,0,0,0,100,0), +(@PATH,66,7811.477,1974.489,367.6566,0,0,0,100,0), +(@PATH,67,7812.143,2014.416,380.2727,0,0,0,100,0), +(@PATH,68,7812.190,2036.709,389.5194,0,0,0,100,0), +(@PATH,69,7812.245,2058.403,392.1172,0,0,0,100,0), +(@PATH,70,7812.340,2079.998,389.7163,0,0,0,100,0), +(@PATH,71,7812.443,2103.041,380.3420,0,0,0,100,0), +(@PATH,72,7811.335,2150.569,364.6897,0,0,0,100,0), +(@PATH,73,7798.583,2186.587,366.9403,0,0,0,100,0), +(@PATH,74,7780.571,2213.544,367.9858,0,0,0,100,0), +(@PATH,75,7757.738,2242.657,369.2574,0,0,0,100,0), +(@PATH,76,7726.067,2275.610,369.6468,0,0,0,100,0), +(@PATH,77,7687.885,2305.656,370.4056,0,0,0,100,0), +(@PATH,78,7653.262,2329.615,373.0400,0,0,0,100,0), +(@PATH,79,7618.725,2352.308,374.1796,0,0,0,100,0), +(@PATH,80,7581.293,2376.074,376.8400,0,0,0,100,0), +(@PATH,81,7538.836,2402.540,380.5944,0,0,0,100,0), +(@PATH,82,7497.301,2428.523,382.9902,0,0,0,100,0), +(@PATH,83,7456.768,2452.186,385.1945,0,0,0,100,0), +(@PATH,84,7424.339,2472.582,388.7454,0,0,0,100,0), +(@PATH,85,7395.200,2496.757,391.2005,0,0,0,100,0), +(@PATH,86,7370.756,2530.682,392.1492,0,0,0,100,0), +(@PATH,87,7348.643,2572.670,392.2311,0,0,0,100,0), +(@PATH,88,7315.738,2608.110,393.2762,0,0,0,100,0), +(@PATH,89,7285.470,2636.182,393.9926,0,0,0,100,0), +(@PATH,90,7239.180,2647.334,392.9237,0,0,0,100,0), +(@PATH,91,7199.069,2648.609,394.5688,0,0,0,100,0), +(@PATH,92,7161.439,2649.354,395.0137,0,0,0,100,0), +(@PATH,93,7124.366,2648.242,395.8636,0,0,0,100,0), +(@PATH,94,7080.877,2647.094,397.3363,0,0,0,100,0), +(@PATH,95,7046.561,2646.076,397.9875,0,0,0,100,0), +(@PATH,96,7005.859,2647.866,399.2826,0,0,0,100,0), +(@PATH,97,6958.574,2641.570,401.6977,0,0,0,100,0), +(@PATH,98,6918.779,2634.562,405.9561,0,0,0,100,0), +(@PATH,99,6881.453,2615.144,409.9131,0,0,0,100,0), +(@PATH,100,6840.742,2591.737,413.0497,0,0,0,100,0), +(@PATH,101,6798.884,2566.029,418.5891,0,0,0,100,0), +(@PATH,102,6763.606,2540.764,424.1843,0,0,0,100,0), +(@PATH,103,6726.491,2521.456,428.1825,0,0,0,100,0), +(@PATH,104,6682.528,2498.002,433.9948,0,0,0,100,0), +(@PATH,105,6726.491,2521.456,428.1825,0,0,0,100,0), +(@PATH,106,6763.606,2540.764,424.1843,0,0,0,100,0), +(@PATH,107,6798.884,2566.029,418.5891,0,0,0,100,0), +(@PATH,108,6840.742,2591.737,413.0497,0,0,0,100,0), +(@PATH,109,6881.453,2615.144,409.9131,0,0,0,100,0), +(@PATH,110,6918.779,2634.562,405.9561,0,0,0,100,0), +(@PATH,111,6958.574,2641.570,401.6977,0,0,0,100,0), +(@PATH,112,7005.859,2647.866,399.2826,0,0,0,100,0), +(@PATH,113,7046.561,2646.076,397.9875,0,0,0,100,0), +(@PATH,114,7080.877,2647.094,397.3363,0,0,0,100,0), +(@PATH,115,7124.366,2648.242,395.8636,0,0,0,100,0), +(@PATH,116,7161.439,2649.354,395.0137,0,0,0,100,0), +(@PATH,117,7199.069,2648.609,394.5688,0,0,0,100,0), +(@PATH,118,7239.180,2647.334,392.9237,0,0,0,100,0), +(@PATH,119,7285.470,2636.182,393.9926,0,0,0,100,0), +(@PATH,120,7315.738,2608.110,393.2762,0,0,0,100,0), +(@PATH,121,7348.643,2572.670,392.2311,0,0,0,100,0), +(@PATH,122,7370.756,2530.682,392.1492,0,0,0,100,0), +(@PATH,123,7395.200,2496.757,391.2005,0,0,0,100,0), +(@PATH,124,7424.339,2472.582,388.7454,0,0,0,100,0), +(@PATH,125,7456.768,2452.186,385.1945,0,0,0,100,0), +(@PATH,126,7497.301,2428.523,382.9902,0,0,0,100,0), +(@PATH,127,7538.836,2402.540,380.5944,0,0,0,100,0), +(@PATH,128,7581.293,2376.074,376.8400,0,0,0,100,0), +(@PATH,129,7618.725,2352.308,374.1796,0,0,0,100,0), +(@PATH,130,7653.262,2329.615,373.0400,0,0,0,100,0), +(@PATH,131,7687.885,2305.656,370.4056,0,0,0,100,0), +(@PATH,132,7726.067,2275.610,369.6468,0,0,0,100,0), +(@PATH,133,7757.738,2242.657,369.2574,0,0,0,100,0), +(@PATH,134,7780.571,2213.544,367.9858,0,0,0,100,0), +(@PATH,135,7798.583,2186.587,366.9403,0,0,0,100,0), +(@PATH,136,7811.335,2150.569,364.6897,0,0,0,100,0), +(@PATH,137,7812.443,2103.041,380.3420,0,0,0,100,0), +(@PATH,138,7812.340,2079.998,389.7163,0,0,0,100,0), +(@PATH,139,7812.245,2058.403,392.1172,0,0,0,100,0), +(@PATH,140,7812.190,2036.709,389.5194,0,0,0,100,0), +(@PATH,141,7812.143,2014.416,380.2727,0,0,0,100,0), +(@PATH,142,7811.477,1974.489,367.6566,0,0,0,100,0), +(@PATH,143,7811.252,1937.083,365.6089,0,0,0,100,0), +(@PATH,144,7810.860,1897.173,363.0266,0,0,0,100,0), +(@PATH,145,7785.744,1870.642,361.4379,0,0,0,100,0), +(@PATH,146,7743.309,1851.258,357.4115,0,0,0,100,0), +(@PATH,147,7699.728,1829.282,355.4451,0,0,0,100,0), +(@PATH,148,7696.018,1791.864,351.5138,0,0,0,100,0), +(@PATH,149,7702.002,1751.072,346.2082,0,0,0,100,0), +(@PATH,150,7723.843,1723.729,344.1997,0,0,0,100,0), +(@PATH,151,7727.404,1690.751,342.8039,0,0,0,100,0), +(@PATH,152,7711.238,1670.327,340.3039,0,0,0,100,0), +(@PATH,153,7689.874,1631.565,336.2794,0,0,0,100,0), +(@PATH,154,7668.053,1600.292,334.6544,0,0,0,100,0), +(@PATH,155,7645.275,1559.671,332.7607,0,0,0,100,0), +(@PATH,156,7632.163,1515.536,331.6975,0,0,0,100,0), +(@PATH,157,7609.677,1477.351,330.2054,0,0,0,100,0), +(@PATH,158,7579.112,1452.958,327.5829,0,0,0,100,0), +(@PATH,159,7539.097,1427.456,324.4498,0,0,0,100,0), +(@PATH,160,7519.051,1409.884,321.9337,0,0,0,100,0), +(@PATH,161,7501.126,1376.004,319.7974,0,0,0,100,0), +(@PATH,162,7460.677,1369.438,314.6037,0,0,0,100,0), +(@PATH,163,7419.581,1363.374,312.0828,0,0,0,100,0), +(@PATH,164,7389.044,1348.929,310.1828,0,0,0,100,0), +(@PATH,165,7347.691,1344.195,308.6195,0,0,0,100,0), +(@PATH,166,7314.380,1346.306,307.6338,0,0,0,100,0), +(@PATH,167,7281.290,1348.486,306.5570,0,0,0,100,0), +(@PATH,168,7259.728,1332.310,305.3224,0,0,0,100,0), +(@PATH,169,7226.770,1301.865,302.9928,0,0,0,100,0), +(@PATH,170,7190.445,1270.757,302.0640,0,0,0,100,0); +-- Pathing for Putridus the Ancient Entry: 32487 +SET @PATH := @GUID+84 * 10; +DELETE FROM `creature_addon` WHERE `guid`=@GUID+84; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@GUID+84,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,7038.954,1222.982,295.8718,0,0,0,100,0), +(@PATH,2,7005.839,1214.057,306.8951,0,0,0,100,0), +(@PATH,3,6974.230,1206.504,304.6984,0,0,0,100,0), +(@PATH,4,6968.840,1205.214,302.3910,0,0,0,100,0), +(@PATH,5,6945.642,1200.520,292.3016,0,0,0,100,0), +(@PATH,6,6914.853,1191.724,288.5059,0,0,0,100,0), +(@PATH,7,6882.745,1177.818,284.5468,0,0,0,100,0), +(@PATH,8,6845.187,1154.830,281.7770,0,0,0,100,0), +(@PATH,9,6810.069,1170.602,278.5624,0,0,0,100,0), +(@PATH,10,6778.632,1167.743,275.3220,0,0,0,100,0), +(@PATH,11,6757.009,1150.346,275.5406,0,0,0,100,0), +(@PATH,12,6734.180,1152.155,275.0406,0,0,0,100,0), +(@PATH,13,6708.991,1156.622,274.5040,0,0,0,100,0), +(@PATH,14,6693.807,1148.469,273.6163,0,0,0,100,0), +(@PATH,15,6671.106,1128.045,274.4435,0,0,0,100,0), +(@PATH,16,6693.807,1148.469,273.6163,0,0,0,100,0), +(@PATH,17,6708.991,1156.622,274.5040,0,0,0,100,0), +(@PATH,18,6734.180,1152.155,275.0406,0,0,0,100,0), +(@PATH,19,6757.009,1150.346,275.5406,0,0,0,100,0), +(@PATH,20,6778.632,1167.743,275.3220,0,0,0,100,0), +(@PATH,21,6810.069,1170.602,278.5624,0,0,0,100,0), +(@PATH,22,6845.187,1154.830,281.7770,0,0,0,100,0), +(@PATH,23,6882.745,1177.818,284.5468,0,0,0,100,0), +(@PATH,24,6914.853,1191.724,288.5059,0,0,0,100,0), +(@PATH,25,6945.642,1200.520,292.3016,0,0,0,100,0), +(@PATH,26,6968.840,1205.214,302.3910,0,0,0,100,0), +(@PATH,27,6974.230,1206.504,304.6984,0,0,0,100,0), +(@PATH,28,7005.839,1214.057,306.8951,0,0,0,100,0), +(@PATH,29,7038.954,1222.982,295.8718,0,0,0,100,0), +(@PATH,30,7049.174,1225.784,295.9547,0,0,0,100,0), +(@PATH,31,7077.323,1235.719,296.1696,0,0,0,100,0), +(@PATH,32,7118.611,1256.946,297.7034,0,0,0,100,0), +(@PATH,33,7159.991,1271.942,300.1463,0,0,0,100,0), +(@PATH,34,7190.445,1270.757,302.0640,0,0,0,100,0), +(@PATH,35,7226.770,1301.865,302.9928,0,0,0,100,0), +(@PATH,36,7259.728,1332.310,305.3224,0,0,0,100,0), +(@PATH,37,7281.290,1348.486,306.5570,0,0,0,100,0), +(@PATH,38,7314.380,1346.306,307.6338,0,0,0,100,0), +(@PATH,39,7347.691,1344.195,308.6195,0,0,0,100,0), +(@PATH,40,7389.044,1348.929,310.1828,0,0,0,100,0), +(@PATH,41,7419.581,1363.374,312.0828,0,0,0,100,0), +(@PATH,42,7460.677,1369.438,314.6037,0,0,0,100,0), +(@PATH,43,7501.126,1376.004,319.7974,0,0,0,100,0), +(@PATH,44,7519.051,1409.884,321.9337,0,0,0,100,0), +(@PATH,45,7539.097,1427.456,324.4498,0,0,0,100,0), +(@PATH,46,7579.112,1452.958,327.5829,0,0,0,100,0), +(@PATH,47,7609.677,1477.351,330.2054,0,0,0,100,0), +(@PATH,48,7632.163,1515.536,331.6975,0,0,0,100,0), +(@PATH,49,7645.275,1559.671,332.7607,0,0,0,100,0), +(@PATH,50,7668.053,1600.292,334.6544,0,0,0,100,0), +(@PATH,51,7689.874,1631.565,336.2794,0,0,0,100,0), +(@PATH,52,7711.238,1670.327,340.3039,0,0,0,100,0), +(@PATH,53,7727.404,1690.751,342.8039,0,0,0,100,0), +(@PATH,54,7723.843,1723.729,344.1997,0,0,0,100,0), +(@PATH,55,7702.002,1751.072,346.2082,0,0,0,100,0), +(@PATH,56,7696.018,1791.864,351.5138,0,0,0,100,0), +(@PATH,57,7699.728,1829.282,355.4451,0,0,0,100,0), +(@PATH,58,7743.309,1851.258,357.4115,0,0,0,100,0), +(@PATH,59,7785.744,1870.642,361.4379,0,0,0,100,0), +(@PATH,60,7810.860,1897.173,363.0266,0,0,0,100,0), +(@PATH,61,7811.252,1937.083,365.6089,0,0,0,100,0), +(@PATH,62,7811.477,1974.489,367.6566,0,0,0,100,0), +(@PATH,63,7812.143,2014.416,380.2727,0,0,0,100,0), +(@PATH,64,7812.190,2036.709,389.5194,0,0,0,100,0), +(@PATH,65,7812.245,2058.403,392.1172,0,0,0,100,0), +(@PATH,66,7812.340,2079.998,389.7163,0,0,0,100,0), +(@PATH,67,7812.443,2103.041,380.3420,0,0,0,100,0), +(@PATH,68,7811.335,2150.569,364.6897,0,0,0,100,0), +(@PATH,69,7798.583,2186.587,366.9403,0,0,0,100,0), +(@PATH,70,7780.571,2213.544,367.9858,0,0,0,100,0), +(@PATH,71,7757.738,2242.657,369.2574,0,0,0,100,0), +(@PATH,72,7726.067,2275.610,369.6468,0,0,0,100,0), +(@PATH,73,7687.885,2305.656,370.4056,0,0,0,100,0), +(@PATH,74,7653.262,2329.615,373.0400,0,0,0,100,0), +(@PATH,75,7618.725,2352.308,374.1796,0,0,0,100,0), +(@PATH,76,7581.293,2376.074,376.8400,0,0,0,100,0), +(@PATH,77,7538.836,2402.540,380.5944,0,0,0,100,0), +(@PATH,78,7497.301,2428.523,382.9902,0,0,0,100,0), +(@PATH,79,7456.768,2452.186,385.1945,0,0,0,100,0), +(@PATH,80,7424.339,2472.582,388.7454,0,0,0,100,0), +(@PATH,81,7395.200,2496.757,391.2005,0,0,0,100,0), +(@PATH,82,7370.756,2530.682,392.1492,0,0,0,100,0), +(@PATH,83,7348.643,2572.670,392.2311,0,0,0,100,0), +(@PATH,84,7315.738,2608.110,393.2762,0,0,0,100,0), +(@PATH,85,7285.470,2636.182,393.9926,0,0,0,100,0), +(@PATH,86,7239.180,2647.334,392.9237,0,0,0,100,0), +(@PATH,87,7199.069,2648.609,394.5688,0,0,0,100,0), +(@PATH,88,7161.439,2649.354,395.0137,0,0,0,100,0), +(@PATH,89,7124.366,2648.242,395.8636,0,0,0,100,0), +(@PATH,90,7080.877,2647.094,397.3363,0,0,0,100,0), +(@PATH,91,7046.561,2646.076,397.9875,0,0,0,100,0), +(@PATH,92,7005.859,2647.866,399.2826,0,0,0,100,0), +(@PATH,93,6958.574,2641.570,401.6977,0,0,0,100,0), +(@PATH,94,6918.779,2634.562,405.9561,0,0,0,100,0), +(@PATH,95,6881.453,2615.144,409.9131,0,0,0,100,0), +(@PATH,96,6840.742,2591.737,413.0497,0,0,0,100,0), +(@PATH,97,6798.884,2566.029,418.5891,0,0,0,100,0), +(@PATH,98,6763.606,2540.764,424.1843,0,0,0,100,0), +(@PATH,99,6726.491,2521.456,428.1825,0,0,0,100,0), +(@PATH,100,6682.528,2498.002,433.9948,0,0,0,100,0), +(@PATH,101,6726.491,2521.456,428.1825,0,0,0,100,0), +(@PATH,102,6763.606,2540.764,424.1843,0,0,0,100,0), +(@PATH,103,6798.884,2566.029,418.5891,0,0,0,100,0), +(@PATH,104,6840.742,2591.737,413.0497,0,0,0,100,0), +(@PATH,105,6881.453,2615.144,409.9131,0,0,0,100,0), +(@PATH,106,6918.779,2634.562,405.9561,0,0,0,100,0), +(@PATH,107,6958.574,2641.570,401.6977,0,0,0,100,0), +(@PATH,108,7005.859,2647.866,399.2826,0,0,0,100,0), +(@PATH,109,7046.561,2646.076,397.9875,0,0,0,100,0), +(@PATH,110,7080.877,2647.094,397.3363,0,0,0,100,0), +(@PATH,111,7124.366,2648.242,395.8636,0,0,0,100,0), +(@PATH,112,7161.439,2649.354,395.0137,0,0,0,100,0), +(@PATH,113,7199.069,2648.609,394.5688,0,0,0,100,0), +(@PATH,114,7239.180,2647.334,392.9237,0,0,0,100,0), +(@PATH,115,7285.470,2636.182,393.9926,0,0,0,100,0), +(@PATH,116,7315.738,2608.110,393.2762,0,0,0,100,0), +(@PATH,117,7348.643,2572.670,392.2311,0,0,0,100,0), +(@PATH,118,7370.756,2530.682,392.1492,0,0,0,100,0), +(@PATH,119,7395.200,2496.757,391.2005,0,0,0,100,0), +(@PATH,120,7424.339,2472.582,388.7454,0,0,0,100,0), +(@PATH,121,7456.768,2452.186,385.1945,0,0,0,100,0), +(@PATH,122,7497.301,2428.523,382.9902,0,0,0,100,0), +(@PATH,123,7538.836,2402.540,380.5944,0,0,0,100,0), +(@PATH,124,7581.293,2376.074,376.8400,0,0,0,100,0), +(@PATH,125,7618.725,2352.308,374.1796,0,0,0,100,0), +(@PATH,126,7653.262,2329.615,373.0400,0,0,0,100,0), +(@PATH,127,7687.885,2305.656,370.4056,0,0,0,100,0), +(@PATH,128,7726.067,2275.610,369.6468,0,0,0,100,0), +(@PATH,129,7757.738,2242.657,369.2574,0,0,0,100,0), +(@PATH,130,7780.571,2213.544,367.9858,0,0,0,100,0), +(@PATH,131,7798.583,2186.587,366.9403,0,0,0,100,0), +(@PATH,132,7811.335,2150.569,364.6897,0,0,0,100,0), +(@PATH,133,7812.443,2103.041,380.3420,0,0,0,100,0), +(@PATH,134,7812.340,2079.998,389.7163,0,0,0,100,0), +(@PATH,135,7812.245,2058.403,392.1172,0,0,0,100,0), +(@PATH,136,7812.190,2036.709,389.5194,0,0,0,100,0), +(@PATH,137,7812.143,2014.416,380.2727,0,0,0,100,0), +(@PATH,138,7811.477,1974.489,367.6566,0,0,0,100,0), +(@PATH,139,7811.252,1937.083,365.6089,0,0,0,100,0), +(@PATH,140,7810.860,1897.173,363.0266,0,0,0,100,0), +(@PATH,141,7785.744,1870.642,361.4379,0,0,0,100,0), +(@PATH,142,7743.309,1851.258,357.4115,0,0,0,100,0), +(@PATH,143,7699.728,1829.282,355.4451,0,0,0,100,0), +(@PATH,144,7696.018,1791.864,351.5138,0,0,0,100,0), +(@PATH,145,7702.002,1751.072,346.2082,0,0,0,100,0), +(@PATH,146,7723.843,1723.729,344.1997,0,0,0,100,0), +(@PATH,147,7727.404,1690.751,342.8039,0,0,0,100,0), +(@PATH,148,7711.238,1670.327,340.3039,0,0,0,100,0), +(@PATH,149,7689.874,1631.565,336.2794,0,0,0,100,0), +(@PATH,150,7668.053,1600.292,334.6544,0,0,0,100,0), +(@PATH,151,7645.275,1559.671,332.7607,0,0,0,100,0), +(@PATH,152,7632.163,1515.536,331.6975,0,0,0,100,0), +(@PATH,153,7609.677,1477.351,330.2054,0,0,0,100,0), +(@PATH,154,7579.112,1452.958,327.5829,0,0,0,100,0), +(@PATH,155,7539.097,1427.456,324.4498,0,0,0,100,0), +(@PATH,156,7519.051,1409.884,321.9337,0,0,0,100,0), +(@PATH,157,7501.126,1376.004,319.7974,0,0,0,100,0), +(@PATH,158,7460.677,1369.438,314.6037,0,0,0,100,0), +(@PATH,159,7419.581,1363.374,312.0828,0,0,0,100,0), +(@PATH,160,7389.044,1348.929,310.1828,0,0,0,100,0), +(@PATH,161,7347.691,1344.195,308.6195,0,0,0,100,0), +(@PATH,162,7314.380,1346.306,307.6338,0,0,0,100,0), +(@PATH,163,7281.290,1348.486,306.5570,0,0,0,100,0), +(@PATH,164,7259.728,1332.310,305.3224,0,0,0,100,0), +(@PATH,165,7226.770,1301.865,302.9928,0,0,0,100,0), +(@PATH,166,7190.445,1270.757,302.0640,0,0,0,100,0), +(@PATH,167,7159.991,1271.942,300.1463,0,0,0,100,0), +(@PATH,168,7118.611,1256.946,297.7034,0,0,0,100,0), +(@PATH,169,7077.323,1235.719,296.1696,0,0,0,100,0), +(@PATH,170,7049.174,1225.784,295.9547,0,0,0,100,0); + +-- Pathing for Zul'drak Sentinel Entry: 32447 +SET @NPC := @GUID+85; +SET @PATH := @NPC * 10; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,5724.000,-2852.640,274.5060,0,0,0,100,0), +(@PATH,2,5755.550,-2823.590,274.5150,0,0,0,100,0), +(@PATH,3,5809.330,-2835.480,274.4960,0,0,0,100,0), +(@PATH,4,5829.910,-2805.140,274.4080,0,0,0,100,0), +(@PATH,5,5828.510,-2766.280,274.7190,0,0,0,100,0), +(@PATH,6,5828.290,-2755.410,276.5500,0,0,0,100,0), +(@PATH,7,5822.310,-2702.180,276.5840,0,0,0,100,0), +(@PATH,8,5794.060,-2684.310,276.5840,0,0,0,100,0), +(@PATH,9,5761.970,-2664.910,276.5840,0,0,0,100,0), +(@PATH,10,5744.330,-2663.150,280.7680,0,0,0,100,0), +(@PATH,11,5737.410,-2654.850,280.7680,0,0,0,100,0), +(@PATH,12,5737.570,-2632.250,292.4730,0,0,0,100,0), +(@PATH,13,5750.730,-2617.920,292.3230,0,0,0,100,0), +(@PATH,14,5773.040,-2617.450,292.4190,0,0,0,100,0), +(@PATH,15,5791.980,-2617.770,292.4190,0,0,0,100,0), +(@PATH,16,5818.440,-2617.850,292.4190,0,0,0,100,0), +(@PATH,17,5842.470,-2617.850,292.4190,0,0,0,100,0), +(@PATH,18,5869.620,-2618.230,292.4190,0,0,0,100,0), +(@PATH,19,5842.470,-2617.850,292.4190,0,0,0,100,0), +(@PATH,20,5818.440,-2617.850,292.4190,0,0,0,100,0), +(@PATH,21,5791.980,-2617.770,292.4190,0,0,0,100,0), +(@PATH,22,5773.040,-2617.450,292.4190,0,0,0,100,0), +(@PATH,23,5750.730,-2617.920,292.3230,0,0,0,100,0), +(@PATH,24,5727.260,-2618.850,292.4160,0,0,0,100,0), +(@PATH,25,5705.450,-2617.610,292.4120,0,0,0,100,0), +(@PATH,26,5683.230,-2617.440,292.4180,0,0,0,100,0), +(@PATH,27,5666.380,-2618.120,292.4710,0,0,0,100,0), +(@PATH,28,5644.480,-2618.200,292.4710,0,0,0,100,0), +(@PATH,29,5618.580,-2617.640,292.4990,0,0,0,100,0), +(@PATH,30,5597.510,-2617.550,292.4990,0,0,0,100,0), +(@PATH,31,5580.090,-2617.990,292.4990,0,0,0,100,0), +(@PATH,32,5566.360,-2617.760,292.4200,0,0,0,100,0), +(@PATH,33,5580.090,-2617.990,292.4990,0,0,0,100,0), +(@PATH,34,5597.510,-2617.550,292.4990,0,0,0,100,0), +(@PATH,35,5618.580,-2617.640,292.4990,0,0,0,100,0), +(@PATH,36,5644.480,-2618.200,292.4710,0,0,0,100,0), +(@PATH,37,5666.380,-2618.120,292.4710,0,0,0,100,0), +(@PATH,38,5683.230,-2617.440,292.4180,0,0,0,100,0), +(@PATH,39,5705.450,-2617.610,292.4120,0,0,0,100,0), +(@PATH,40,5727.260,-2618.850,292.4160,0,0,0,100,0), +(@PATH,41,5737.570,-2632.250,292.4730,0,0,0,100,0), +(@PATH,42,5737.410,-2654.850,280.7680,0,0,0,100,0), +(@PATH,43,5744.330,-2663.150,280.7680,0,0,0,100,0), +(@PATH,44,5761.970,-2664.910,276.5840,0,0,0,100,0), +(@PATH,45,5794.060,-2684.310,276.5840,0,0,0,100,0), +(@PATH,46,5822.310,-2702.180,276.5840,0,0,0,100,0), +(@PATH,47,5828.290,-2755.410,276.5500,0,0,0,100,0), +(@PATH,48,5828.510,-2766.280,274.7190,0,0,0,100,0), +(@PATH,49,5829.910,-2805.140,274.4080,0,0,0,100,0), +(@PATH,50,5809.330,-2835.480,274.4960,0,0,0,100,0), +(@PATH,51,5755.550,-2823.590,274.5150,0,0,0,100,0), +(@PATH,52,5724.000,-2852.640,274.5060,0,0,0,100,0), +(@PATH,53,5693.950,-2871.760,274.5770,0,0,0,100,0), +(@PATH,54,5664.210,-2905.730,274.3850,0,0,0,100,0), +(@PATH,55,5629.240,-2933.900,274.3790,0,0,0,100,0), +(@PATH,56,5601.860,-2960.070,274.3790,0,0,0,100,0), +(@PATH,57,5594.340,-2966.000,276.5940,0,0,0,100,0), +(@PATH,58,5559.140,-2960.480,276.5840,0,0,0,100,0), +(@PATH,59,5526.130,-2965.070,276.5840,0,0,0,100,0), +(@PATH,60,5507.190,-2996.900,276.5880,0,0,0,100,0), +(@PATH,61,5490.880,-3013.770,288.0960,0,0,0,100,0), +(@PATH,62,5465.120,-3043.530,288.7970,0,0,0,100,0), +(@PATH,63,5455.740,-3053.280,292.0040,0,0,0,100,0), +(@PATH,64,5438.300,-3072.640,292.4190,0,0,0,100,0), +(@PATH,65,5408.170,-3076.490,292.4190,0,0,0,100,0), +(@PATH,66,5389.960,-3057.200,292.4190,0,0,0,100,0), +(@PATH,67,5372.570,-3028.290,292.4190,0,0,0,100,0), +(@PATH,68,5359.020,-2999.280,292.4190,0,0,0,100,0), +(@PATH,69,5343.850,-2981.210,292.4190,0,0,0,100,0), +(@PATH,70,5316.590,-2957.750,292.4180,0,0,0,100,0), +(@PATH,71,5291.510,-2936.590,292.4180,0,0,0,100,0), +(@PATH,72,5269.860,-2920.950,292.4180,0,0,0,100,0), +(@PATH,73,5248.840,-2899.650,292.4180,0,0,0,100,0), +(@PATH,74,5228.780,-2879.540,292.4180,0,0,0,100,0), +(@PATH,75,5202.560,-2855.400,292.4200,0,0,0,100,0), +(@PATH,76,5194.670,-2837.020,292.4180,0,0,0,100,0), +(@PATH,77,5216.640,-2815.020,292.4180,0,0,0,100,0), +(@PATH,78,5246.490,-2789.880,292.4180,0,0,0,100,0), +(@PATH,79,5272.980,-2764.980,292.4180,0,0,0,100,0), +(@PATH,80,5297.260,-2742.340,292.4200,0,0,0,100,0), +(@PATH,81,5323.050,-2718.580,292.4170,0,0,0,100,0), +(@PATH,82,5354.000,-2692.930,292.4190,0,0,0,100,0), +(@PATH,83,5323.050,-2718.580,292.4170,0,0,0,100,0), +(@PATH,84,5297.260,-2742.340,292.4200,0,0,0,100,0), +(@PATH,85,5272.980,-2764.980,292.4180,0,0,0,100,0), +(@PATH,86,5246.490,-2789.880,292.4180,0,0,0,100,0), +(@PATH,87,5216.640,-2815.020,292.4180,0,0,0,100,0), +(@PATH,88,5194.670,-2837.020,292.4180,0,0,0,100,0), +(@PATH,89,5172.790,-2864.270,292.4190,0,0,0,100,0), +(@PATH,90,5154.700,-2887.120,292.4190,0,0,0,100,0), +(@PATH,91,5129.290,-2891.070,292.4190,0,0,0,100,0), +(@PATH,92,5107.440,-2912.540,292.4190,0,0,0,100,0), +(@PATH,93,5083.430,-2936.790,292.4190,0,0,0,100,0), +(@PATH,94,5062.290,-2957.040,292.0600,0,0,0,100,0), +(@PATH,95,5042.170,-2976.570,292.5840,0,0,0,100,0), +(@PATH,96,5013.840,-3004.280,292.4190,0,0,0,100,0), +(@PATH,97,4990.340,-3027.050,292.4190,0,0,0,100,0), +(@PATH,98,4963.340,-3053.410,292.4190,0,0,0,100,0), +(@PATH,99,4935.050,-3080.150,292.4190,0,0,0,100,0), +(@PATH,100,4912.420,-3101.800,292.4190,0,0,0,100,0), +(@PATH,101,4886.650,-3126.440,292.4190,0,0,0,100,0), +(@PATH,102,4862.060,-3149.930,292.4190,0,0,0,100,0), +(@PATH,103,4843.120,-3168.170,292.4190,0,0,0,100,0), +(@PATH,104,4862.060,-3149.930,292.4190,0,0,0,100,0), +(@PATH,105,4886.650,-3126.440,292.4190,0,0,0,100,0), +(@PATH,106,4912.420,-3101.800,292.4190,0,0,0,100,0), +(@PATH,107,4935.050,-3080.150,292.4190,0,0,0,100,0), +(@PATH,108,4963.340,-3053.410,292.4190,0,0,0,100,0), +(@PATH,109,4990.340,-3027.050,292.4190,0,0,0,100,0), +(@PATH,110,5013.840,-3004.280,292.4190,0,0,0,100,0), +(@PATH,111,5042.170,-2976.570,292.5840,0,0,0,100,0), +(@PATH,112,5062.290,-2957.040,292.0600,0,0,0,100,0), +(@PATH,113,5083.430,-2936.790,292.4190,0,0,0,100,0), +(@PATH,114,5107.440,-2912.540,292.4190,0,0,0,100,0), +(@PATH,115,5129.290,-2891.070,292.4190,0,0,0,100,0), +(@PATH,116,5154.700,-2887.120,292.4190,0,0,0,100,0), +(@PATH,117,5172.790,-2864.270,292.4190,0,0,0,100,0), +(@PATH,118,5202.560,-2855.400,292.4200,0,0,0,100,0), +(@PATH,119,5228.780,-2879.540,292.4180,0,0,0,100,0), +(@PATH,120,5248.840,-2899.650,292.4180,0,0,0,100,0), +(@PATH,121,5269.860,-2920.950,292.4180,0,0,0,100,0), +(@PATH,122,5291.510,-2936.590,292.4180,0,0,0,100,0), +(@PATH,123,5316.590,-2957.750,292.4180,0,0,0,100,0), +(@PATH,124,5343.850,-2981.210,292.4190,0,0,0,100,0), +(@PATH,125,5359.020,-2999.280,292.4190,0,0,0,100,0), +(@PATH,126,5372.570,-3028.290,292.4190,0,0,0,100,0), +(@PATH,127,5389.960,-3057.200,292.4190,0,0,0,100,0), +(@PATH,128,5408.170,-3076.490,292.4190,0,0,0,100,0), +(@PATH,129,5438.300,-3072.640,292.4190,0,0,0,100,0), +(@PATH,130,5455.740,-3053.280,292.0040,0,0,0,100,0), +(@PATH,131,5465.120,-3043.530,288.7970,0,0,0,100,0), +(@PATH,132,5490.880,-3013.770,288.0960,0,0,0,100,0), +(@PATH,133,5507.190,-2996.900,276.5880,0,0,0,100,0), +(@PATH,134,5526.130,-2965.070,276.5840,0,0,0,100,0), +(@PATH,135,5559.140,-2960.480,276.5840,0,0,0,100,0), +(@PATH,136,5594.340,-2966.000,276.5940,0,0,0,100,0), +(@PATH,137,5601.860,-2960.070,274.3790,0,0,0,100,0), +(@PATH,138,5629.240,-2933.900,274.3790,0,0,0,100,0), +(@PATH,139,5664.210,-2905.730,274.3850,0,0,0,100,0), +(@PATH,140,5693.950,-2871.760,274.5770,0,0,0,100,0); +-- Pathing for Zul'drak Sentinel Entry: 32447 +SET @NPC := @GUID+86; +SET @PATH := @NPC * 10; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,4914.130,-1622.030,248.3090,0,0,0,100,0), +(@PATH,2,4912.460,-1580.230,248.3090,0,0,0,100,0), +(@PATH,3,4906.730,-1561.730,248.3680,0,0,0,100,0), +(@PATH,4,4883.310,-1539.930,248.7920,0,0,0,100,0), +(@PATH,5,4851.130,-1514.290,249.1620,0,0,0,100,0), +(@PATH,6,4883.310,-1539.930,248.7920,0,0,0,100,0), +(@PATH,7,4906.730,-1561.730,248.3680,0,0,0,100,0), +(@PATH,8,4912.460,-1580.230,248.3090,0,0,0,100,0), +(@PATH,9,4914.130,-1622.030,248.3090,0,0,0,100,0), +(@PATH,10,4914.310,-1661.770,248.3090,0,0,0,100,0), +(@PATH,11,4913.710,-1698.930,248.3080,0,0,0,100,0), +(@PATH,12,4914.110,-1730.130,248.3070,0,0,0,100,0), +(@PATH,13,4914.250,-1760.870,248.3070,0,0,0,100,0), +(@PATH,14,4914.320,-1804.820,248.3090,0,0,0,100,0), +(@PATH,15,4913.730,-1841.620,248.3090,0,0,0,100,0), +(@PATH,16,4912.850,-1875.260,248.3090,0,0,0,100,0), +(@PATH,17,4913.100,-1909.730,248.3070,0,0,0,100,0), +(@PATH,18,4913.340,-1956.600,248.3000,0,0,0,100,0), +(@PATH,19,4913.430,-1996.570,248.3090,0,0,0,100,0), +(@PATH,20,4913.280,-2029.650,248.3080,0,0,0,100,0), +(@PATH,21,4931.000,-2048.890,248.3080,0,0,0,100,0), +(@PATH,22,4966.010,-2050.800,248.3080,0,0,0,100,0), +(@PATH,23,4997.010,-2052.770,248.3080,0,0,0,100,0), +(@PATH,24,5028.930,-2055.350,248.1920,0,0,0,100,0), +(@PATH,25,5062.110,-2058.030,248.2960,0,0,0,100,0), +(@PATH,26,5083.820,-2050.360,248.1850,0,0,0,100,0), +(@PATH,27,5111.150,-2049.930,248.1180,0,0,0,100,0), +(@PATH,28,5148.310,-2050.290,248.2960,0,0,0,100,0), +(@PATH,29,5177.760,-2049.490,248.2960,0,0,0,100,0), +(@PATH,30,5211.760,-2048.980,248.2970,0,0,0,100,0), +(@PATH,31,5177.760,-2049.490,248.2960,0,0,0,100,0), +(@PATH,32,5148.310,-2050.290,248.2960,0,0,0,100,0), +(@PATH,33,5111.150,-2049.930,248.1180,0,0,0,100,0), +(@PATH,34,5083.820,-2050.360,248.1850,0,0,0,100,0), +(@PATH,35,5062.110,-2058.030,248.2960,0,0,0,100,0), +(@PATH,36,5028.930,-2055.350,248.1920,0,0,0,100,0), +(@PATH,37,4997.010,-2052.770,248.3080,0,0,0,100,0), +(@PATH,38,4966.010,-2050.800,248.3080,0,0,0,100,0), +(@PATH,39,4931.000,-2048.890,248.3080,0,0,0,100,0), +(@PATH,40,4913.280,-2029.650,248.3080,0,0,0,100,0), +(@PATH,41,4913.430,-1996.570,248.3090,0,0,0,100,0), +(@PATH,42,4913.340,-1956.600,248.3000,0,0,0,100,0), +(@PATH,43,4913.100,-1909.730,248.3070,0,0,0,100,0), +(@PATH,44,4912.850,-1875.260,248.3090,0,0,0,100,0), +(@PATH,45,4913.730,-1841.620,248.3090,0,0,0,100,0), +(@PATH,46,4914.320,-1804.820,248.3090,0,0,0,100,0), +(@PATH,47,4914.250,-1760.870,248.3070,0,0,0,100,0), +(@PATH,48,4914.110,-1730.130,248.3070,0,0,0,100,0), +(@PATH,49,4913.710,-1698.930,248.3080,0,0,0,100,0), +(@PATH,50,4914.310,-1661.770,248.3090,0,0,0,100,0); + +-- Pathing for Fumblub Gearwind Entry: 32358 +SET @NPC := @GUID+4; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=4107.777,`position_y`=4981.302,`position_z`=4.601125 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3996.668,5027.57,4.601125,0,0,0,100,0), +(@PATH,2,3908.403,5132.647,18.65668,0,0,0,100,0), +(@PATH,3,3762.461,5061.485,18.65668,0,0,0,100,0), +(@PATH,4,3706.78,4998.379,18.65668,0,0,0,100,0), +(@PATH,5,3626.849,4981.311,18.65668,0,0,0,100,0), +(@PATH,6,3553.993,4971.021,18.65668,0,0,0,100,0), +(@PATH,7,3562.81,4855.884,18.65668,0,0,0,100,0), +(@PATH,8,3482.353,4704.925,8.01779,0,0,0,100,0), +(@PATH,9,3476.721,4495.351,7.07335,0,0,0,100,0), +(@PATH,10,3651.377,4535.771,7.07335,0,0,0,100,0), +(@PATH,11,3797.042,4659.164,4.21224,0,0,0,100,0), +(@PATH,12,3959.966,4664.088,5.490018,0,0,0,100,0), +(@PATH,13,4050.999,4706.122,13.51779,0,0,0,100,0), +(@PATH,14,4141.185,4783.229,13.99001,0,0,0,100,0), +(@PATH,15,4250.018,4783.799,13.8789,0,0,0,100,0), +(@PATH,16,4252.546,4879.61,7.906681,0,0,0,100,0), +(@PATH,17,4107.777,4981.302,4.601125,0,0,0,100,0); + + +-- NR Rare Spawns +SET @GUID := 250006; + +UPDATE `creature_template` SET `faction_a`=14, `faction_h`=14 WHERE entry IN (32630); +DELETE FROM `creature` WHERE `guid`=@GUID; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`DeathState`,`MovementType`) VALUES +-- Vyragosa +(@GUID,32630,571,1,1,0,0,7090.247,-1566.583,958.0051,0.7234184,28800,0,0,1,0,0,2); + +-- Pathing for Vyragosa Entry: 32630 +SET @NPC := @GUID; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=6913.308,`position_y`=-1725.261,`position_z`=954.7917 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,7025.494,-1624.87,957.3694,0,0,0,100,0), +(@PATH,2,7167.578,-1501.694,962.5693,0,0,0,100,0), +(@PATH,3,7440.402,-1295.861,997.2911,0,0,0,100,0), +(@PATH,4,7210.958,-1046.892,1006.18,0,0,0,100,0), +(@PATH,5,6998.465,-1076.847,1024.819,0,0,0,100,0), +(@PATH,6,6874.249,-1097.382,927.736,0,0,0,100,0), +(@PATH,7,6614.792,-875.7547,812.7645,0,0,0,100,0), +(@PATH,8,6563.275,-811.7673,749.8757,0,0,0,100,0), +(@PATH,9,6299.502,-797.577,529.1257,0,0,0,100,0), +(@PATH,10,6194.549,-1013.144,501.5424,0,0,0,100,0), +(@PATH,11,6319.254,-1251.661,468.6258,0,0,0,100,0), +(@PATH,12,6309.161,-1537.857,615.0423,0,0,0,100,0), +(@PATH,13,6748.211,-1664.307,919.3118,0,0,0,100,0), +(@PATH,14,6913.308,-1725.261,954.7917,0,0,0,100,0); diff --git a/sql/updates/world/2011_03_29_01_world_pool_template.sql b/sql/updates/world/2011_03_29_01_world_pool_template.sql new file mode 100644 index 0000000000000..be1546e7f4436 --- /dev/null +++ b/sql/updates/world/2011_03_29_01_world_pool_template.sql @@ -0,0 +1,14 @@ +-- update some maxcounts in spawnpools +UPDATE `pool_template` SET `max_limit`=15 WHERE `entry`=896; -- Wintergrasp from 20 to 15 +UPDATE `pool_template` SET `max_limit`=35 WHERE `entry`=897; -- Icecrown from 20 to 35 +UPDATE `pool_template` SET `max_limit`=10 WHERE `entry`=2001; -- Alterac Mountains (outer section) from 4 to 10 +UPDATE `pool_template` SET `max_limit`=45 WHERE `entry`=2002; -- Arathi Highlands (Main Section) from 10 to 45 +UPDATE `pool_template` SET `max_limit`=25 WHERE `entry`=2004; -- Badlands from 9 to 25 +UPDATE `pool_template` SET `max_limit`=20 WHERE `entry`=2005; -- Blasted Lands from 8 to 20 +UPDATE `pool_template` SET `max_limit`=40 WHERE `entry`=2007; -- Burning Steppes from 10 to 40 +UPDATE `pool_template` SET `max_limit`=15 WHERE `entry`=2008; -- Dun Morogh from 12 to 15 +UPDATE `pool_template` SET `max_limit`=20 WHERE `entry`=2009; -- Duskwood from 16 to 20 +UPDATE `pool_template` SET `max_limit`=10 WHERE `entry`=2012; -- Eversong Woods from 6 to 10 +UPDATE `pool_template` SET `max_limit`=10 WHERE `entry`=2014; -- Hillsbrad Foothills (Main Section) from 5 to 10 +UPDATE `pool_template` SET `max_limit`= 3 WHERE `entry`=2016; -- Hillsbrad Foothills (Azurelode Mine) - Special Mineral GOs ONLY from 4 to 3 +UPDATE `pool_template` SET `max_limit`=20 WHERE `entry`=2018; -- Loch Modan from 9 to 20 diff --git a/sql/updates/world/2011_03_29_02_world_equipment_template.sql b/sql/updates/world/2011_03_29_02_world_equipment_template.sql new file mode 100644 index 0000000000000..788cfac3e4d6e --- /dev/null +++ b/sql/updates/world/2011_03_29_02_world_equipment_template.sql @@ -0,0 +1,5 @@ +UPDATE `creature_template` SET `equipment_id`=682 WHERE `entry`=32417; -- Scarlet Highlord Daion +-- Re-import deleted template +DELETE FROM `creature_equip_template` WHERE `entry`=2433; +INSERT INTO `creature_equip_template` (`entry`,`equipentry1`,`equipentry2`,`equipentry3`) VALUES +(2433,19903,13319,0); diff --git a/src/server/authserver/Server/AuthSocket.cpp b/src/server/authserver/Server/AuthSocket.cpp index 0b7a49fe74a7d..7fa8bbd76e3e9 100755 --- a/src/server/authserver/Server/AuthSocket.cpp +++ b/src/server/authserver/Server/AuthSocket.cpp @@ -213,7 +213,7 @@ void AuthSocket::OnAccept(void) void AuthSocket::OnClose(void) { - sLog->outDebug("AuthSocket::OnClose"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "AuthSocket::OnClose"); } // Read the packet from the client @@ -420,7 +420,7 @@ bool AuthSocket::_HandleLogonChallenge() std::string databaseV = fields[5].GetString(); std::string databaseS = fields[6].GetString(); - sLog->outDebug("database authentication values: v='%s' s='%s'", databaseV.c_str(), databaseS.c_str()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "database authentication values: v='%s' s='%s'", databaseV.c_str(), databaseS.c_str()); // multiply with 2 since bytes are stored as hexstring if (databaseV.size() != s_BYTE_SIZE * 2 || databaseS.size() != s_BYTE_SIZE * 2) @@ -505,7 +505,7 @@ bool AuthSocket::_HandleLogonProof() if (_expversion == NO_VALID_EXP_FLAG) { // Check if we have the appropriate patch on the disk - sLog->outDebug("Client with invalid version, patching is not implemented"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Client with invalid version, patching is not implemented"); socket().shutdown(); return true; } @@ -1017,7 +1017,7 @@ void Patcher::LoadPatchMD5(char *szFileName) std::string path = "./patches/"; path += szFileName; FILE *pPatch = fopen(path.c_str(), "rb"); - sLog->outDebug("Loading patch info from %s\n", path.c_str()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Loading patch info from %s\n", path.c_str()); if (!pPatch) { diff --git a/src/server/authserver/Server/RealmSocket.cpp b/src/server/authserver/Server/RealmSocket.cpp index 299dd4509940d..c80b2c4f08f4a 100755 --- a/src/server/authserver/Server/RealmSocket.cpp +++ b/src/server/authserver/Server/RealmSocket.cpp @@ -276,7 +276,6 @@ int RealmSocket::handle_input(ACE_HANDLE) return n == space ? 1 : 0; } - void RealmSocket::set_session(Session* session) { if (session_ != NULL) diff --git a/src/server/authserver/authserver.conf.dist b/src/server/authserver/authserver.conf.dist index 6bd1185305cd5..86423d53e18d9 100644 --- a/src/server/authserver/authserver.conf.dist +++ b/src/server/authserver/authserver.conf.dist @@ -86,6 +86,22 @@ LogLevel = 0 LogFile = "Auth.log" +# +# Debug Log Mask +# Description: Bitmask that determines which debug log output (level 3) +# will be logged. +# Possible flags: +# +# 64 - Anything related to network input/output, +# such as packet handlers and netcode logs +# +# Simply add the values together to create a bitmask. +# For more info see enum DebugLogFilters in Log.h +# +# Default: 0 (nothing) + +DebugLogMask = 64 + # # SQLDriverLogFile # Description: Log file for SQL driver events. diff --git a/src/server/collision/BoundingIntervalHierarchy.cpp b/src/server/collision/BoundingIntervalHierarchy.cpp index ca2dc9c164530..470f89e6a698c 100755 --- a/src/server/collision/BoundingIntervalHierarchy.cpp +++ b/src/server/collision/BoundingIntervalHierarchy.cpp @@ -21,7 +21,7 @@ void BIH::buildHierarchy(std::vector &tempTree, buildData &dat, BuildStats &stats) { // create space for the first node - tempTree.push_back(3 << 30); // dummy leaf + tempTree.push_back(uint32(3 << 30)); // dummy leaf tempTree.insert(tempTree.end(), 2, 0); //tempTree.add(0); diff --git a/src/server/collision/Management/VMapManager2.cpp b/src/server/collision/Management/VMapManager2.cpp index ffcb6e838b51e..b318b91b29efa 100644 --- a/src/server/collision/Management/VMapManager2.cpp +++ b/src/server/collision/Management/VMapManager2.cpp @@ -274,7 +274,7 @@ namespace VMAP delete worldmodel; return NULL; } - sLog->outDebug("VMapManager2: loading file '%s%s'", basepath.c_str(), filename.c_str()); + sLog->outDebug(LOG_FILTER_MAPS, "VMapManager2: loading file '%s%s'", basepath.c_str(), filename.c_str()); model = iLoadedModelFiles.insert(std::pair(filename, ManagedModel())).first; model->second.setModel(worldmodel); } @@ -292,7 +292,7 @@ namespace VMAP } if( model->second.decRefCount() == 0) { - sLog->outDebug("VMapManager2: unloading file '%s'", filename.c_str()); + sLog->outDebug(LOG_FILTER_MAPS, "VMapManager2: unloading file '%s'", filename.c_str()); delete model->second.getModel(); iLoadedModelFiles.erase(model); } diff --git a/src/server/collision/Maps/MapTree.cpp b/src/server/collision/Maps/MapTree.cpp index de4c044b61680..cd4c74d2eade2 100644 --- a/src/server/collision/Maps/MapTree.cpp +++ b/src/server/collision/Maps/MapTree.cpp @@ -62,7 +62,7 @@ namespace VMAP void operator()(const Vector3& point, uint32 entry) { #ifdef VMAP_DEBUG - sLog->outDebug("AreaInfoCallback: trying to intersect '%s'", prims[entry].name.c_str()); + sLog->outDebug(LOG_FILTER_MAPS, "AreaInfoCallback: trying to intersect '%s'", prims[entry].name.c_str()); #endif prims[entry].intersectPoint(point, aInfo); } @@ -78,7 +78,7 @@ namespace VMAP void operator()(const Vector3& point, uint32 entry) { #ifdef VMAP_DEBUG - sLog->outDebug("LocationInfoCallback: trying to intersect '%s'", prims[entry].name.c_str()); + sLog->outDebug(LOG_FILTER_MAPS, "LocationInfoCallback: trying to intersect '%s'", prims[entry].name.c_str()); #endif if (prims[entry].GetLocationInfo(point, locInfo)) result = true; @@ -89,7 +89,6 @@ namespace VMAP bool result; }; - //========================================================= std::string StaticMapTree::getTileFileName(uint32 mapID, uint32 tileX, uint32 tileY) @@ -278,7 +277,7 @@ namespace VMAP bool StaticMapTree::InitMap(const std::string &fname, VMapManager2 *vm) { - sLog->outDebug("StaticMapTree::InitMap() : initializing StaticMapTree '%s'", fname.c_str()); + sLog->outDebug(LOG_FILTER_MAPS, "StaticMapTree::InitMap() : initializing StaticMapTree '%s'", fname.c_str()); bool success = true; std::string fullname = iBasePath + fname; FILE *rf = fopen(fullname.c_str(), "rb"); @@ -289,7 +288,7 @@ namespace VMAP char chunk[8]; //general info if (!readChunk(rf, chunk, VMAP_MAGIC, 8)) success = false; - char tiled; + char tiled = '\0'; if (success && fread(&tiled, sizeof(char), 1, rf) != 1) success = false; iIsTiled = bool(tiled); // Nodes @@ -306,12 +305,12 @@ namespace VMAP // only non-tiled maps have them, and if so exactly one (so far at least...) ModelSpawn spawn; #ifdef VMAP_DEBUG - sLog->outDebug("StaticMapTree::InitMap() : map isTiled: %u", static_cast(iIsTiled)); + sLog->outDebug(LOG_FILTER_MAPS, "StaticMapTree::InitMap() : map isTiled: %u", static_cast(iIsTiled)); #endif if (!iIsTiled && ModelSpawn::readFromFile(rf, spawn)) { WorldModel *model = vm->acquireModelInstance(iBasePath, spawn.name); - sLog->outDebug("StaticMapTree::InitMap() : loading %s", spawn.name.c_str()); + sLog->outDebug(LOG_FILTER_MAPS, "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...) @@ -370,7 +369,7 @@ namespace VMAP if (!readChunk(tf, chunk, VMAP_MAGIC, 8)) result = false; - uint32 numSpawns; + uint32 numSpawns = 0; if (result && fread(&numSpawns, sizeof(uint32), 1, tf) != 1) result = false; for (uint32 i=0; i iNTreeValues) { - sLog->outDebug("StaticMapTree::LoadMapTile() : invalid tree element (%u/%u)", referencedVal, iNTreeValues); + sLog->outDebug(LOG_FILTER_MAPS, "StaticMapTree::LoadMapTile() : invalid tree element (%u/%u)", referencedVal, iNTreeValues); continue; } #endif @@ -407,9 +406,9 @@ namespace VMAP ++iLoadedSpawns[referencedVal]; #ifdef VMAP_DEBUG if (iTreeValues[referencedVal].ID != spawn.ID) - sLog->outDebug("StaticMapTree::LoadMapTile() : trying to load wrong spawn in node"); + sLog->outDebug(LOG_FILTER_MAPS, "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); + sLog->outDebug(LOG_FILTER_MAPS, "StaticMapTree::LoadMapTile() : name collision on GUID=%u", spawn.ID); #endif } } diff --git a/src/server/collision/Models/ModelInstance.cpp b/src/server/collision/Models/ModelInstance.cpp index 57e1e42d579f4..e9258fdb522d5 100644 --- a/src/server/collision/Models/ModelInstance.cpp +++ b/src/server/collision/Models/ModelInstance.cpp @@ -153,7 +153,7 @@ namespace VMAP bool ModelSpawn::readFromFile(FILE *rf, ModelSpawn &spawn) { - uint32 check=0, nameLen; + uint32 check = 0, nameLen; check += fread(&spawn.flags, sizeof(uint32), 1, rf); // EoF? if (!check) @@ -176,13 +176,13 @@ namespace VMAP spawn.iBound = G3D::AABox(bLow, bHigh); } check += fread(&nameLen, sizeof(uint32), 1, rf); - if(check != (has_bound ? 17 : 11)) + if (check != uint32(has_bound ? 17 : 11)) { std::cout << "Error reading ModelSpawn!\n"; return false; } char nameBuff[500]; - if (nameLen>500) // file names should never be that long, must be file error + if (nameLen > 500) // file names should never be that long, must be file error { std::cout << "Error reading ModelSpawn, file name too long!\n"; return false; @@ -207,16 +207,16 @@ namespace VMAP check += fwrite(&spawn.iRot, sizeof(float), 3, wf); check += fwrite(&spawn.iScale, sizeof(float), 1, wf); bool has_bound = (spawn.flags & MOD_HAS_BOUND); - if(has_bound) // only WMOs have bound in MPQ, only available after computation + if (has_bound) // only WMOs have bound in MPQ, only available after computation { check += fwrite(&spawn.iBound.low(), sizeof(float), 3, wf); check += fwrite(&spawn.iBound.high(), sizeof(float), 3, wf); } uint32 nameLen = spawn.name.length(); check += fwrite(&nameLen, sizeof(uint32), 1, wf); - if(check != (has_bound ? 17 : 11)) return false; + if (check != uint32(has_bound ? 17 : 11)) return false; check = fwrite(spawn.name.c_str(), sizeof(char), nameLen, wf); - if(check != nameLen) return false; + if (check != nameLen) return false; return true; } diff --git a/src/server/collision/Models/ModelInstance.h b/src/server/collision/Models/ModelInstance.h index 844c71cac51eb..289fd5ff3fe01 100755 --- a/src/server/collision/Models/ModelInstance.h +++ b/src/server/collision/Models/ModelInstance.h @@ -56,7 +56,6 @@ namespace VMAP // temp? const G3D::AABox& getBounds() const { return iBound; } - static bool readFromFile(FILE *rf, ModelSpawn &spawn); static bool writeToFile(FILE *rw, const ModelSpawn &spawn); }; diff --git a/src/server/collision/Models/WorldModel.cpp b/src/server/collision/Models/WorldModel.cpp index 8f6c3669690e1..f639b5fc3f4eb 100644 --- a/src/server/collision/Models/WorldModel.cpp +++ b/src/server/collision/Models/WorldModel.cpp @@ -28,7 +28,6 @@ template<> struct BoundsTrait static void getBounds(const VMAP::GroupModel& obj, G3D::AABox& out) { out = obj.GetBound(); } }; - namespace VMAP { bool IntersectTriangle(const MeshTriangle &tri, std::vector::const_iterator points, const G3D::Ray &ray, float &distance) @@ -303,11 +302,12 @@ namespace VMAP { char chunk[8]; bool result = true; - uint32 chunkSize, count; + uint32 chunkSize = 0; + uint32 count = 0; triangles.clear(); vertices.clear(); delete iLiquid; - iLiquid = 0; + iLiquid = NULL; if (result && fread(&iBound, sizeof(G3D::AABox), 1, rf) != 1) result = false; if (result && fread(&iMogpFlags, sizeof(uint32), 1, rf) != 1) result = false; @@ -538,7 +538,8 @@ namespace VMAP return false; bool result = true; - uint32 chunkSize, count; + uint32 chunkSize = 0; + uint32 count = 0; char chunk[8]; // Ignore the added magic header if (!readChunk(rf, chunk, VMAP_MAGIC, 8)) result = false; diff --git a/src/server/game/AI/CoreAI/CombatAI.cpp b/src/server/game/AI/CoreAI/CombatAI.cpp index 1aedf41cd470d..008ec447f6a03 100755 --- a/src/server/game/AI/CoreAI/CombatAI.cpp +++ b/src/server/game/AI/CoreAI/CombatAI.cpp @@ -298,7 +298,6 @@ VehicleAI::VehicleAI(Creature *c) : CreatureAI(c), m_vehicle(c->GetVehicleKit()) m_DismissTimer = VEHICLE_DISMISS_TIME; } - //NOTE: VehicleAI::UpdateAI runs even while the vehicle is mounted void VehicleAI::UpdateAI(const uint32 diff) { @@ -340,9 +339,7 @@ void VehicleAI::LoadConditions() { conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_CREATURE_TEMPLATE_VEHICLE, me->GetEntry()); if (!conditions.empty()) - { - sLog->outDebug("VehicleAI::LoadConditions: loaded %u conditions", uint32(conditions.size())); - } + sLog->outDebug(LOG_FILTER_CONDITIONSYS, "VehicleAI::LoadConditions: loaded %u conditions", uint32(conditions.size())); } void VehicleAI::CheckConditions(const uint32 diff) diff --git a/src/server/game/AI/CoreAI/GuardAI.cpp b/src/server/game/AI/CoreAI/GuardAI.cpp index 5715e6fde1c5f..ecff2d2a031d2 100755 --- a/src/server/game/AI/CoreAI/GuardAI.cpp +++ b/src/server/game/AI/CoreAI/GuardAI.cpp @@ -35,7 +35,6 @@ GuardAI::GuardAI(Creature* creature) : ScriptedAI(creature), i_victimGuid(0), i_ { } - bool GuardAI::CanSeeAlways(WorldObject const* obj) { if (!obj->isType(TYPEMASK_UNIT)) @@ -139,7 +138,6 @@ void GuardAI::UpdateAI(const uint32 /*diff*/) } } - void GuardAI::JustDied(Unit* killer) { if (Player* pkiller = killer->GetCharmerOrOwnerPlayerOrPlayerItself()) diff --git a/src/server/game/AI/CoreAI/PetAI.cpp b/src/server/game/AI/CoreAI/PetAI.cpp index e89ab41baae34..d5199ba3e3c22 100755 --- a/src/server/game/AI/CoreAI/PetAI.cpp +++ b/src/server/game/AI/CoreAI/PetAI.cpp @@ -116,13 +116,13 @@ void PetAI::UpdateAI(const uint32 diff) HandleReturnMovement(); } else if (owner && !me->HasUnitState(UNIT_STAT_FOLLOW)) // no charm info and no victim - me->GetMotionMaster()->MoveFollow(owner, CalculateFollowDistance(), me->GetFollowAngle()); + me->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, me->GetFollowAngle()); if (!me->GetCharmInfo()) return; // Autocast (casted only in combat or persistent spells in any state) - if (me->GetGlobalCooldown() == 0 && !me->HasUnitState(UNIT_STAT_CASTING)) + if (!me->HasUnitState(UNIT_STAT_CASTING)) { typedef std::vector > TargetSpellList; TargetSpellList targetSpellStore; @@ -137,6 +137,9 @@ void PetAI::UpdateAI(const uint32 diff) if (!spellInfo) continue; + if (me->GetCharmInfo() && me->GetCharmInfo()->GetGlobalCooldownMgr().HasGlobalCooldown(spellInfo)) + continue; + // ignore some combinations of combat state and combat/noncombat spells if (!me->getVictim()) { @@ -314,20 +317,28 @@ Unit *PetAI::SelectNextTarget() if (me->HasReactState(REACT_PASSIVE)) return NULL; - Unit *target = NULL; + Unit *target = me->getAttackerForHelper(); targetHasCC = false; - // Check pet's attackers first to prevent dragging mobs back - // to owner - if ((target = me->getAttackerForHelper()) && !_CheckTargetCC(target)) {} - // Check owner's attackers if pet didn't have any - else if (me->GetCharmerOrOwner() && (target = me->GetCharmerOrOwner()->getAttackerForHelper()) && !_CheckTargetCC(target)) {} - // 3.0.2 - Pets now start attacking their owners target in defensive mode as soon as the hunter does - else if (me->GetCharmerOrOwner() && (target = me->GetCharmerOrOwner()->getVictim()) && !_CheckTargetCC(target)) {} - // Default - else return NULL; + // Check pet's attackers first to prevent dragging mobs back to owner + if (target && !_CheckTargetCC(target)) + return target; - return target; + if (me->GetCharmerOrOwner()) + { + // Check owner's attackers if pet didn't have any + target = me->GetCharmerOrOwner()->getAttackerForHelper(); + if (target && !_CheckTargetCC(target)) + return target; + + // 3.0.2 - Pets now start attacking their owners target in defensive mode as soon as the hunter does + target = me->GetCharmerOrOwner()->getVictim(); + if (target && !_CheckTargetCC(target)) + return target; + } + + // Default + return NULL; } void PetAI::HandleReturnMovement() @@ -358,7 +369,7 @@ void PetAI::HandleReturnMovement() { me->GetCharmInfo()->SetIsReturning(true); me->GetMotionMaster()->Clear(); - me->GetMotionMaster()->MoveFollow(me->GetCharmerOrOwner(), CalculateFollowDistance(), me->GetFollowAngle()); + me->GetMotionMaster()->MoveFollow(me->GetCharmerOrOwner(), PET_FOLLOW_DIST, me->GetFollowAngle()); } } } @@ -437,29 +448,6 @@ void PetAI::MovementInform(uint32 moveType, uint32 data) } } -float PetAI::CalculateFollowDistance() -{ - float distance; - CreatureInfo const *cinfo = me->GetCreatureInfo(); - switch (cinfo->family) - { - case CREATURE_FAMILY_SPIDER: - case CREATURE_FAMILY_DEVILSAUR: - distance = -2.0f; - break; - case CREATURE_FAMILY_CHIMAERA: - case CREATURE_FAMILY_CORE_HOUND: - case CREATURE_FAMILY_RHINO: - distance = -4.0f; - break; - default: - distance = PET_FOLLOW_DIST; - break; - } - - return distance; -} - bool PetAI::_CanAttack(Unit *target) { // Evaluates wether a pet can attack a specific diff --git a/src/server/game/AI/CoreAI/PetAI.h b/src/server/game/AI/CoreAI/PetAI.h index 357d040cca65a..fd64aa39688a9 100755 --- a/src/server/game/AI/CoreAI/PetAI.h +++ b/src/server/game/AI/CoreAI/PetAI.h @@ -57,7 +57,6 @@ class PetAI : public CreatureAI Unit *SelectNextTarget(); void HandleReturnMovement(); void DoAttack(Unit *target, bool chase); - float CalculateFollowDistance(); bool _CanAttack(Unit *target); bool _CheckTargetCC(Unit *target); }; diff --git a/src/server/game/AI/CoreAI/UnitAI.cpp b/src/server/game/AI/CoreAI/UnitAI.cpp index c28b0c54b1a41..8d95a0260e482 100755 --- a/src/server/game/AI/CoreAI/UnitAI.cpp +++ b/src/server/game/AI/CoreAI/UnitAI.cpp @@ -87,35 +87,7 @@ Unit* UnitAI::SelectTarget(SelectAggroTarget targetType, uint32 position, float void UnitAI::SelectTargetList(std::list &targetList, uint32 num, SelectAggroTarget targetType, float dist, bool playerOnly, int32 aura) { - const std::list &threatlist = me->getThreatManager().getThreatList(); - - if (threatlist.empty()) - return; - - DefaultTargetSelector targetSelector(me, dist,playerOnly, aura); - for (std::list::const_iterator itr = threatlist.begin(); itr != threatlist.end(); ++itr) - if (targetSelector((*itr)->getTarget())) - targetList.push_back((*itr)->getTarget()); - - if (targetType == SELECT_TARGET_NEAREST || targetType == SELECT_TARGET_FARTHEST) - targetList.sort(Trinity::ObjectDistanceOrderPred(me)); - - if (targetType == SELECT_TARGET_FARTHEST || targetType == SELECT_TARGET_BOTTOMAGGRO) - targetList.reverse(); - - if (targetList.size() < num) - return; - - if (targetType == SELECT_TARGET_RANDOM) - { - while (num < targetList.size()) { - std::list::iterator itr = targetList.begin(); - advance(itr, urand(0, targetList.size()-1)); - targetList.erase(itr); - } - } - else - targetList.resize(num); + SelectTargetList(targetList, DefaultTargetSelector(me, dist, playerOnly, aura), num, targetType); } float UnitAI::DoGetSpellMaxRange(uint32 spellId, bool positive) diff --git a/src/server/game/AI/CoreAI/UnitAI.h b/src/server/game/AI/CoreAI/UnitAI.h index 87a71a4931790..f64f25250c24f 100755 --- a/src/server/game/AI/CoreAI/UnitAI.h +++ b/src/server/game/AI/CoreAI/UnitAI.h @@ -49,9 +49,9 @@ enum SelectAggroTarget }; // default predicate function to select target based on distance, player and/or aura criteria -struct DefaultTargetSelector : public std::unary_function +struct DefaultTargetSelector : public std::unary_function { - const Unit *me; + const Unit* me; float m_dist; bool m_playerOnly; int32 m_aura; @@ -60,9 +60,9 @@ struct DefaultTargetSelector : public std::unary_function // dist: if 0: ignored, if > 0: maximum distance to the reference unit, if < 0: minimum distance to the reference unit // playerOnly: self explaining // aura: if 0: ignored, if > 0: the target shall have the aura, if < 0, the target shall NOT have the aura - DefaultTargetSelector(const Unit *pUnit, float dist, bool playerOnly, int32 aura) : me(pUnit), m_dist(dist), m_playerOnly(playerOnly), m_aura(aura) {} + DefaultTargetSelector(Unit const* pUnit, float dist, bool playerOnly, int32 aura) : me(pUnit), m_dist(dist), m_playerOnly(playerOnly), m_aura(aura) {} - bool operator() (const Unit *pTarget) + bool operator() (Unit const* pTarget) { if (!me) return false; @@ -102,12 +102,12 @@ class UnitAI protected: Unit * const me; public: - explicit UnitAI(Unit *u) : me(u) {} + explicit UnitAI(Unit* unit) : me(unit) {} virtual ~UnitAI() {} - virtual bool CanAIAttack(const Unit * /*who*/) const { return true; } - virtual void AttackStart(Unit *); - virtual void UpdateAI(const uint32 diff) = 0; + virtual bool CanAIAttack(Unit const* /*target*/) const { return true; } + virtual void AttackStart(Unit* /*target*/); + virtual void UpdateAI(uint32 const diff) = 0; virtual void InitializeAI() { if (!me->isDead()) Reset(); } @@ -117,45 +117,25 @@ class UnitAI virtual void OnCharmed(bool apply) = 0; // Pass parameters between AI - virtual void DoAction(const int32 /*param*/ = 0) {} + virtual void DoAction(int32 const /*param*/) {} virtual uint32 GetData(uint32 /*id = 0*/) { return 0; } virtual void SetData(uint32 /*id*/, uint32 /*value*/) {} - virtual void SetGUID(const uint64 &/*guid*/, int32 /*id*/ = 0) {} + virtual void SetGUID(uint64 const&/*guid*/, int32 /*id*/ = 0) {} virtual uint64 GetGUID(int32 /*id*/ = 0) { return 0; } Unit* SelectTarget(SelectAggroTarget targetType, uint32 position = 0, float dist = 0.0f, bool playerOnly = false, int32 aura = 0); - void SelectTargetList(std::list &targetList, uint32 num, SelectAggroTarget targetType, float dist = 0.0f, bool playerOnly = false, int32 aura = 0); - - // Called at any Damage to any victim (before damage apply) - virtual void DamageDealt(Unit* /*victim*/, uint32& /*damage*/, DamageEffectType /*damageType*/) { } - - // Called at any Damage from any attacker (before damage apply) - // Note: it for recalculation damage or special reaction at damage - // for attack reaction use AttackedBy called for not DOT damage in Unit::DealDamage also - virtual void DamageTaken(Unit* /*attacker*/, uint32& /*damage*/) {} - - // Called when the creature receives heal - virtual void HealReceived(Unit* /*done_by*/, uint32& /*addhealth*/) {} - - // Called when the unit heals - virtual void HealDone(Unit* /*done_to*/, uint32& /*addhealth*/) {} - // Select the targets satifying the predicate. - // predicate shall extend std::unary_function - template Unit* SelectTarget(SelectAggroTarget targetType, uint32 position, PREDICATE predicate) + // predicate shall extend std::unary_function + template Unit* SelectTarget(SelectAggroTarget targetType, uint32 position, PREDICATE predicate) { - const std::list &threatlist = me->getThreatManager().getThreatList(); - std::list targetList; - + const std::list &threatlist = me->getThreatManager().getThreatList(); if (position >= threatlist.size()) return NULL; + std::list targetList; for (std::list::const_iterator itr = threatlist.begin(); itr != threatlist.end(); ++itr) - { - HostileReference* ref = (*itr); - if (predicate(ref->getTarget())) - targetList.push_back(ref->getTarget()); - } + if (predicate((*itr)->getTarget())) + targetList.push_back((*itr)->getTarget()); if (position >= targetList.size()) return NULL; @@ -163,39 +143,79 @@ class UnitAI if (targetType == SELECT_TARGET_NEAREST || targetType == SELECT_TARGET_FARTHEST) targetList.sort(Trinity::ObjectDistanceOrderPred(me)); - switch(targetType) + switch (targetType) { case SELECT_TARGET_NEAREST: case SELECT_TARGET_TOPAGGRO: - { - std::list::iterator itr = targetList.begin(); - advance(itr, position); - return *itr; - } - break; - + { + std::list::iterator itr = targetList.begin(); + std::advance(itr, position); + return *itr; + } case SELECT_TARGET_FARTHEST: case SELECT_TARGET_BOTTOMAGGRO: - { - std::list::reverse_iterator ritr = targetList.rbegin(); - advance(ritr, position); - return *ritr; - } - break; - + { + std::list::reverse_iterator ritr = targetList.rbegin(); + std::advance(ritr, position); + return *ritr; + } case SELECT_TARGET_RANDOM: - { - std::list::iterator itr = targetList.begin(); - advance(itr, urand(position, targetList.size()-1)); - return *itr; - } + { + std::list::iterator itr = targetList.begin(); + std::advance(itr, urand(position, targetList.size()-1)); + return *itr; + } + default: break; } return NULL; } - void AttackStartCaster(Unit *victim, float dist); + void SelectTargetList(std::list &targetList, uint32 num, SelectAggroTarget targetType, float dist = 0.0f, bool playerOnly = false, int32 aura = 0); + + // Select the targets satifying the predicate. + // predicate shall extend std::unary_function + template void SelectTargetList(std::list &targetList, PREDICATE predicate, uint32 maxTargets, SelectAggroTarget targetType) + { + std::list const& threatlist = me->getThreatManager().getThreatList(); + if (threatlist.empty()) + return; + + for (std::list::const_iterator itr = threatlist.begin(); itr != threatlist.end(); ++itr) + if (predicate((*itr)->getTarget())) + targetList.push_back((*itr)->getTarget()); + + if (targetList.size() < maxTargets) + return; + + if (targetType == SELECT_TARGET_NEAREST || targetType == SELECT_TARGET_FARTHEST) + targetList.sort(Trinity::ObjectDistanceOrderPred(me)); + + if (targetType == SELECT_TARGET_FARTHEST || targetType == SELECT_TARGET_BOTTOMAGGRO) + targetList.reverse(); + + if (targetType == SELECT_TARGET_RANDOM) + Trinity::RandomResizeList(targetList, maxTargets); + else + targetList.resize(maxTargets); + } + + // Called at any Damage to any victim (before damage apply) + virtual void DamageDealt(Unit* /*victim*/, uint32& /*damage*/, DamageEffectType /*damageType*/) { } + + // Called at any Damage from any attacker (before damage apply) + // Note: it for recalculation damage or special reaction at damage + // for attack reaction use AttackedBy called for not DOT damage in Unit::DealDamage also + virtual void DamageTaken(Unit* /*attacker*/, uint32& /*damage*/) {} + + // Called when the creature receives heal + virtual void HealReceived(Unit* /*done_by*/, uint32& /*addhealth*/) {} + + // Called when the unit heals + virtual void HealDone(Unit* /*done_to*/, uint32& /*addhealth*/) {} + + void AttackStartCaster(Unit* victim, float dist); void DoAddAuraToAllHostilePlayers(uint32 spellid); void DoCast(uint32 spellId); @@ -209,12 +229,12 @@ class UnitAI void DoMeleeAttackIfReady(); bool DoSpellAttackIfReady(uint32 spell); - static AISpellInfoType *AISpellInfo; + static AISpellInfoType* AISpellInfo; static void FillAISpellInfo(); virtual void sGossipHello(Player* /*player*/) {} virtual void sGossipSelect(Player* /*player*/, uint32 /*sender*/, uint32 /*action*/) {} - virtual void sGossipSelectCode(Player* /*player*/, uint32 /*sender*/, uint32 /*action*/, const char* /*code*/) {} + virtual void sGossipSelectCode(Player* /*player*/, uint32 /*sender*/, uint32 /*action*/, char const* /*code*/) {} virtual void sQuestAccept(Player* /*player*/, Quest const* /*quest*/) {} virtual void sQuestSelect(Player* /*player*/, Quest const* /*quest*/) {} virtual void sQuestComplete(Player* /*player*/, Quest const* /*quest*/) {} @@ -227,7 +247,7 @@ class PlayerAI : public UnitAI protected: Player* const me; public: - explicit PlayerAI(Player *p) : UnitAI((Unit*)p), me(p) {} + explicit PlayerAI(Player* p) : UnitAI((Unit*)p), me(p) {} void OnCharmed(bool apply); }; @@ -235,8 +255,8 @@ class PlayerAI : public UnitAI class SimpleCharmedAI : public PlayerAI { public: - void UpdateAI(const uint32 diff); - SimpleCharmedAI(Player *p): PlayerAI(p) {} + void UpdateAI(uint32 const diff); + SimpleCharmedAI(Player* player): PlayerAI(player) {} }; #endif diff --git a/src/server/game/AI/CreatureAI.cpp b/src/server/game/AI/CreatureAI.cpp index afa928e52e88e..92a2227fe8b99 100755 --- a/src/server/game/AI/CreatureAI.cpp +++ b/src/server/game/AI/CreatureAI.cpp @@ -34,13 +34,12 @@ void CreatureAI::OnCharmed(bool /*apply*/) AISpellInfoType * UnitAI::AISpellInfo; AISpellInfoType * GetAISpellInfo(uint32 i) { return &CreatureAI::AISpellInfo[i]; } - void CreatureAI::Talk(uint8 id, uint64 WhisperGuid) { sCreatureTextMgr->SendChat(me, id, WhisperGuid); } -void CreatureAI::DoZoneInCombat(Creature* creature) +void CreatureAI::DoZoneInCombat(Creature* creature /*= NULL*/) { if (!creature) creature = me; @@ -140,7 +139,7 @@ void CreatureAI::EnterEvadeMode() if (!_EnterEvadeMode()) return; - sLog->outDebug("Creature %u enters evade mode.", me->GetEntry()); + sLog->outDebug(LOG_FILTER_UNITS, "Creature %u enters evade mode.", me->GetEntry()); if (!me->GetVehicle()) // otherwise me will be in evade mode forever { diff --git a/src/server/game/AI/CreatureAI.h b/src/server/game/AI/CreatureAI.h index 12b200f1311da..db7442df3caf5 100755 --- a/src/server/game/AI/CreatureAI.h +++ b/src/server/game/AI/CreatureAI.h @@ -66,27 +66,27 @@ enum SCEquip class CreatureAI : public UnitAI { protected: - Creature * const me; + Creature* const me; bool UpdateVictim(); bool UpdateVictimWithGaze(); - void SetGazeOn(Unit *target); + void SetGazeOn(Unit* target); - Creature *DoSummon(uint32 uiEntry, const Position &pos, uint32 uiDespawntime = 30000, TempSummonType uiType = TEMPSUMMON_CORPSE_TIMED_DESPAWN); - Creature *DoSummon(uint32 uiEntry, WorldObject *obj, float fRadius = 5.0f, uint32 uiDespawntime = 30000, TempSummonType uiType = TEMPSUMMON_CORPSE_TIMED_DESPAWN); - Creature *DoSummonFlyer(uint32 uiEntry, WorldObject *obj, float fZ, float fRadius = 5.0f, uint32 uiDespawntime = 30000, TempSummonType uiType = TEMPSUMMON_CORPSE_TIMED_DESPAWN); + Creature* DoSummon(uint32 entry, Position const& pos, uint32 despawnTime = 30000, TempSummonType summonType = TEMPSUMMON_CORPSE_TIMED_DESPAWN); + Creature* DoSummon(uint32 entry, WorldObject* obj, float radius = 5.0f, uint32 despawnTime = 30000, TempSummonType summonType = TEMPSUMMON_CORPSE_TIMED_DESPAWN); + Creature* DoSummonFlyer(uint32 entry, WorldObject* obj, float flightZ, float radius = 5.0f, uint32 despawnTime = 30000, TempSummonType summonType = TEMPSUMMON_CORPSE_TIMED_DESPAWN); public: void Talk(uint8 id, uint64 WhisperGuid = 0); - explicit CreatureAI(Creature *c) : UnitAI((Unit*)c), me(c), m_MoveInLineOfSight_locked(false) {} + explicit CreatureAI(Creature* creature) : UnitAI(creature), me(creature), m_MoveInLineOfSight_locked(false) {} virtual ~CreatureAI() {} /// == Reactions At ================================= - // Called if IsVisible(Unit *who) is true at each *who move, reaction at visibility zone enter - void MoveInLineOfSight_Safe(Unit *who); + // Called if IsVisible(Unit* who) is true at each who move, reaction at visibility zone enter + void MoveInLineOfSight_Safe(Unit* who); // Called in Creature::Update when deathstate = DEAD. Inherited classes may maniuplate the ability to respawn based on scripted events. virtual bool CanRespawn() { return true; } @@ -95,29 +95,29 @@ class CreatureAI : public UnitAI virtual void EnterEvadeMode(); // Called for reaction at enter to combat if not in combat yet (enemy can be NULL) - virtual void EnterCombat(Unit* /*enemy*/) {} + virtual void EnterCombat(Unit* /*victim*/) {} // Called when the creature is killed - virtual void JustDied(Unit *) {} + virtual void JustDied(Unit* /*killer*/) {} // Called when the creature kills a unit - virtual void KilledUnit(Unit *) {} + virtual void KilledUnit(Unit* /*victim*/) {} // Called when the creature summon successfully other creature - virtual void JustSummoned(Creature*) {} - virtual void IsSummonedBy(Unit * /*summoner*/) {} + virtual void JustSummoned(Creature* /*summon*/) {} + virtual void IsSummonedBy(Unit* /*summoner*/) {} - virtual void SummonedCreatureDespawn(Creature* /*unit*/) {} - virtual void SummonedCreatureDies(Creature* /*unit*/, Unit* /*killer*/) {} + virtual void SummonedCreatureDespawn(Creature* /*summon*/) {} + virtual void SummonedCreatureDies(Creature* /*summon*/, Unit* /*killer*/) {} // Called when hit by a spell - virtual void SpellHit(Unit*, const SpellEntry*) {} + virtual void SpellHit(Unit* /*caster*/, SpellEntry const* /*spell*/) {} // Called when spell hits a target - virtual void SpellHitTarget(Unit* /*target*/, const SpellEntry*) {} + virtual void SpellHitTarget(Unit* /*target*/, SpellEntry const* /*spell*/) {} // Called to get trigger target for aura effect - virtual Unit * GetAuraEffectTriggerTarget(uint32 /*spellId*/, uint8 /*effIndex*/) {return NULL;} + virtual Unit* GetAuraEffectTriggerTarget(uint32 /*spellId*/, uint8 /*effIndex*/) { return NULL; } // Called when the creature is target of hostile action: swing, hostile spell landed, fear/etc) //virtual void AttackedBy(Unit* attacker); @@ -127,25 +127,25 @@ class CreatureAI : public UnitAI virtual void JustRespawned() { Reset(); } // Called at waypoint reached or point movement finished - virtual void MovementInform(uint32 /*MovementType*/, uint32 /*Data*/) {} + virtual void MovementInform(uint32 /*type*/, uint32 /*id*/) {} void OnCharmed(bool apply); - //virtual void SpellClick(Player *player) {} + //virtual void SpellClick(Player* player) {} // Called at reaching home after evade virtual void JustReachedHome() {} - void DoZoneInCombat(Creature* pUnit = NULL); + void DoZoneInCombat(Creature* creature = NULL); // Called at text emote receive from player - virtual void ReceiveEmote(Player* /*pPlayer*/, uint32 /*text_emote*/) {} + virtual void ReceiveEmote(Player* /*player*/, uint32 /*emoteId*/) {} /// == Triggered Actions Requested ================== // Called when creature attack expected (if creature can and no have current victim) // Note: for reaction at hostile action must be called AttackedBy function. - //virtual void AttackStart(Unit *) {} + //virtual void AttackStart(Unit* ) {} // Called at World update tick //virtual void UpdateAI(const uint32 /*diff*/) {} @@ -153,10 +153,10 @@ class CreatureAI : public UnitAI /// == State checks ================================= // Is unit visible for MoveInLineOfSight - //virtual bool IsVisible(Unit *) const { return false; } + //virtual bool IsVisible(Unit* ) const { return false; } // called when the corpse of this creature gets removed - virtual void CorpseRemoved(uint32 & /*respawnDelay*/) {} + virtual void CorpseRemoved(uint32& /*respawnDelay*/) {} // Called when victim entered water and creature can not enter water //virtual bool canReachByRangeAttack(Unit*) { return false; } @@ -166,11 +166,11 @@ class CreatureAI : public UnitAI // Pointer to controlled by AI creature //Creature* const me; - virtual void PassengerBoarded(Unit * /*who*/, int8 /*seatId*/, bool /*apply*/) {} + virtual void PassengerBoarded(Unit* /*passenger*/, int8 /*seatId*/, bool /*apply*/) {} - virtual bool CanSeeAlways(WorldObject const* obj) {return false;} + virtual bool CanSeeAlways(WorldObject const* /*obj*/) { return false; } protected: - virtual void MoveInLineOfSight(Unit *); + virtual void MoveInLineOfSight(Unit* /*who*/); bool _EnterEvadeMode(); diff --git a/src/server/game/AI/CreatureAIImpl.h b/src/server/game/AI/CreatureAIImpl.h index f92fb316377b0..4619c6f9f799f 100755 --- a/src/server/game/AI/CreatureAIImpl.h +++ b/src/server/game/AI/CreatureAIImpl.h @@ -584,24 +584,24 @@ inline void UnitAI::DoCastAOE(uint32 spellId, bool triggered) me->CastSpell((Unit*)NULL, spellId, triggered); } -inline Creature *CreatureAI::DoSummon(uint32 uiEntry, const Position &pos, uint32 uiDespawntime, TempSummonType uiType) +inline Creature* CreatureAI::DoSummon(uint32 entry, const Position &pos, uint32 despawnTime, TempSummonType summonType) { - return me->SummonCreature(uiEntry, pos, uiType, uiDespawntime); + return me->SummonCreature(entry, pos, summonType, despawnTime); } -inline Creature *CreatureAI::DoSummon(uint32 uiEntry, WorldObject* obj, float fRadius, uint32 uiDespawntime, TempSummonType uiType) +inline Creature* CreatureAI::DoSummon(uint32 entry, WorldObject* obj, float radius, uint32 despawnTime, TempSummonType summonType) { Position pos; - obj->GetRandomNearPosition(pos, fRadius); - return me->SummonCreature(uiEntry, pos, uiType, uiDespawntime); + obj->GetRandomNearPosition(pos, radius); + return me->SummonCreature(entry, pos, summonType, despawnTime); } -inline Creature *CreatureAI::DoSummonFlyer(uint32 uiEntry, WorldObject *obj, float _fZ, float fRadius, uint32 uiDespawntime, TempSummonType uiType) +inline Creature* CreatureAI::DoSummonFlyer(uint32 entry, WorldObject* obj, float flightZ, float radius, uint32 despawnTime, TempSummonType summonType) { Position pos; - obj->GetRandomNearPosition(pos, fRadius); - pos.m_positionZ += _fZ; - return me->SummonCreature(uiEntry, pos, uiType, uiDespawntime); + obj->GetRandomNearPosition(pos, radius); + pos.m_positionZ += flightZ; + return me->SummonCreature(entry, pos, summonType, despawnTime); } #endif diff --git a/src/server/game/AI/CreatureAISelector.cpp b/src/server/game/AI/CreatureAISelector.cpp index dc669e56a01b1..46cbd1abf5d4c 100755 --- a/src/server/game/AI/CreatureAISelector.cpp +++ b/src/server/game/AI/CreatureAISelector.cpp @@ -95,7 +95,7 @@ namespace FactorySelector // select NullCreatureAI if not another cases ainame = (ai_factory == NULL) ? "NullCreatureAI" : ai_factory->key(); - sLog->outStaticDebug("Creature %u used AI is %s.", creature->GetGUIDLow(), ainame.c_str()); + sLog->outDebug(LOG_FILTER_TSCR, "Creature %u used AI is %s.", creature->GetGUIDLow(), ainame.c_str()); return (ai_factory == NULL ? new NullCreatureAI(creature) : ai_factory->Create(creature)); } @@ -139,7 +139,7 @@ namespace FactorySelector std::string ainame = (ai_factory == NULL || go->GetScriptId()) ? "NullGameObjectAI" : ai_factory->key(); - sLog->outStaticDebug("GameObject %u used AI is %s.", go->GetGUIDLow(), ainame.c_str()); + sLog->outDebug(LOG_FILTER_TSCR, "GameObject %u used AI is %s.", go->GetGUIDLow(), ainame.c_str()); return (ai_factory == NULL ? new NullGameObjectAI(go) : ai_factory->Create(go)); } diff --git a/src/server/game/AI/EventAI/CreatureEventAI.cpp b/src/server/game/AI/EventAI/CreatureEventAI.cpp index ba7ed5605899d..93eb293e1bd40 100755 --- a/src/server/game/AI/EventAI/CreatureEventAI.cpp +++ b/src/server/game/AI/EventAI/CreatureEventAI.cpp @@ -870,14 +870,12 @@ void CreatureEventAI::Reset() if (m_bEmptyList) return; - for (CreatureEventAIList::iterator i = m_CreatureEventAIList.begin(); i != m_CreatureEventAIList.end(); ++i) { if ((*i).Event.event_type == EVENT_T_RESET) ProcessEvent(*i); } - //Reset all events to enabled for (CreatureEventAIList::iterator i = m_CreatureEventAIList.begin(); i != m_CreatureEventAIList.end(); ++i) { @@ -1256,7 +1254,7 @@ void CreatureEventAI::DoScriptText(int32 textEntry, WorldObject* pSource, Unit* return; } - sLog->outDebug("CreatureEventAI: DoScriptText: text entry=%i, Sound=%u, Type=%u, Language=%u, Emote=%u",textEntry,(*i).second.SoundId,(*i).second.Type,(*i).second.Language,(*i).second.Emote); + sLog->outDebug(LOG_FILTER_DATABASE_AI, "CreatureEventAI: DoScriptText: text entry=%i, Sound=%u, Type=%u, Language=%u, Emote=%u",textEntry,(*i).second.SoundId,(*i).second.Type,(*i).second.Language,(*i).second.Emote); if ((*i).second.SoundId) { @@ -1356,7 +1354,7 @@ void CreatureEventAI::ReceiveEmote(Player* pPlayer, uint32 text_emote) if (cond.Meets(pPlayer)) { - sLog->outDebug("CreatureEventAI: ReceiveEmote CreatureEventAI: Condition ok, processing"); + sLog->outDebug(LOG_FILTER_DATABASE_AI, "CreatureEventAI: ReceiveEmote CreatureEventAI: Condition ok, processing"); ProcessEvent(*itr, pPlayer); } } diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp index ddf000e31c7ee..75ba3790e547b 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp @@ -30,7 +30,7 @@ void SummonList::DoZoneInCombat(uint32 entry) } } -void SummonList::DoAction(uint32 entry, uint32 info) +void SummonList::DoAction(uint32 entry, int32 info) { for (iterator i = begin(); i != end();) { @@ -81,14 +81,41 @@ void SummonList::DespawnAll() } } +void SummonList::RemoveNotExisting() +{ + for (iterator i = begin(); i != end();) + { + if (Unit::GetCreature(*me, *i)) + ++i; + else + erase(i++); + } +} + +bool SummonList::HasEntry(uint32 entry) +{ + for (iterator i = begin(); i != end();) + { + Creature* summon = Unit::GetCreature(*me, *i); + if (!summon) + erase(i++); + else if (summon->GetEntry() == entry) + return true; + else + ++i; + } + + return false; +} + ScriptedAI::ScriptedAI(Creature* pCreature) : CreatureAI(pCreature), me(pCreature), IsFleeing(false), - m_bCombatMovement(true), - m_uiEvadeCheckCooldown(2500) + _isCombatMovementAllowed(true), + _evadeCheckCooldown(2500) { - m_heroicMode = me->GetMap()->IsHeroic(); - m_difficulty = Difficulty(me->GetMap()->GetSpawnMode()); + _isHeroic = me->GetMap()->IsHeroic(); + _difficulty = Difficulty(me->GetMap()->GetSpawnMode()); } void ScriptedAI::AttackStartNoMove(Unit* pWho) @@ -100,7 +127,7 @@ void ScriptedAI::AttackStartNoMove(Unit* pWho) DoStartNoMovement(pWho); } -void ScriptedAI::UpdateAI(const uint32 /*uiDiff*/) +void ScriptedAI::UpdateAI(uint32 const /*diff*/) { //Check if we have a current target if (!UpdateVictim()) @@ -160,47 +187,15 @@ void ScriptedAI::DoPlaySoundToSet(WorldObject* pSource, uint32 uiSoundId) pSource->PlayDirectSound(uiSoundId); } -Creature* ScriptedAI::DoSpawnCreature(uint32 uiId, float fX, float fY, float fZ, float fAngle, uint32 uiType, uint32 uiDespawntime) -{ - return me->SummonCreature(uiId, me->GetPositionX()+fX, me->GetPositionY()+fY, me->GetPositionZ()+fZ, fAngle, (TempSummonType)uiType, uiDespawntime); -} - -Unit* ScriptedAI::SelectUnit(SelectAggroTarget pTarget, uint32 uiPosition) +Creature* ScriptedAI::DoSpawnCreature(uint32 entry, float offsetX, float offsetY, float offsetZ, float angle, uint32 type, uint32 despawntime) { - //ThreatList m_threatlist; - std::list& threatlist = me->getThreatManager().getThreatList(); - std::list::iterator itr = threatlist.begin(); - std::list::reverse_iterator ritr = threatlist.rbegin(); - - if (uiPosition >= threatlist.size() || !threatlist.size()) - return NULL; - - switch (pTarget) - { - case SELECT_TARGET_RANDOM: - advance (itr , uiPosition + (rand() % (threatlist.size() - uiPosition))); - return Unit::GetUnit((*me),(*itr)->getUnitGuid()); - break; - - case SELECT_TARGET_TOPAGGRO: - advance (itr , uiPosition); - return Unit::GetUnit((*me),(*itr)->getUnitGuid()); - break; - - case SELECT_TARGET_BOTTOMAGGRO: - advance (ritr , uiPosition); - return Unit::GetUnit((*me),(*ritr)->getUnitGuid()); - break; - - default: - return UnitAI::SelectTarget(pTarget, uiPosition); - } + return me->SummonCreature(entry, me->GetPositionX() + offsetX, me->GetPositionY() + offsetY, me->GetPositionZ() + offsetZ, angle, TempSummonType(type), despawntime); } -SpellEntry const* ScriptedAI::SelectSpell(Unit* pTarget, uint32 uiSchool, uint32 uiMechanic, SelectTargetType selectTargets, uint32 uiPowerCostMin, uint32 uiPowerCostMax, float fRangeMin, float fRangeMax, SelectEffect selectEffects) +SpellEntry const* ScriptedAI::SelectSpell(Unit* target, uint32 school, uint32 mechanic, SelectTargetType targets, uint32 powerCostMin, uint32 powerCostMax, float rangeMin, float rangeMax, SelectEffect effects) { //No target so we can't cast - if (!pTarget) + if (!target) return false; //Silenced so we can't cast @@ -209,101 +204,101 @@ SpellEntry const* ScriptedAI::SelectSpell(Unit* pTarget, uint32 uiSchool, uint32 //Using the extended script system we first create a list of viable spells SpellEntry const* apSpell[CREATURE_MAX_SPELLS]; - memset(apSpell, 0, sizeof(SpellEntry*)*CREATURE_MAX_SPELLS); + memset(apSpell, 0, CREATURE_MAX_SPELLS * sizeof(SpellEntry*)); - uint32 uiSpellCount = 0; + uint32 spellCount = 0; - SpellEntry const* pTempSpell; - SpellRangeEntry const* pTempRange; + SpellEntry const* tempSpell = NULL; + SpellRangeEntry const* tempRange = NULL; //Check if each spell is viable(set it to null if not) for (uint32 i = 0; i < CREATURE_MAX_SPELLS; i++) { - pTempSpell = GetSpellStore()->LookupEntry(me->m_spells[i]); + tempSpell = sSpellStore.LookupEntry(me->m_spells[i]); //This spell doesn't exist - if (!pTempSpell) + if (!tempSpell) continue; // Targets and Effects checked first as most used restrictions //Check the spell targets if specified - if (selectTargets && !(SpellSummary[me->m_spells[i]].Targets & (1 << (selectTargets-1)))) + if (targets && !(SpellSummary[me->m_spells[i]].Targets & (1 << (targets-1)))) continue; //Check the type of spell if we are looking for a specific spell type - if (selectEffects && !(SpellSummary[me->m_spells[i]].Effects & (1 << (selectEffects-1)))) + if (effects && !(SpellSummary[me->m_spells[i]].Effects & (1 << (effects-1)))) continue; //Check for school if specified - if (uiSchool && (pTempSpell->SchoolMask & uiSchool) == 0) + if (school && (tempSpell->SchoolMask & school) == 0) continue; //Check for spell mechanic if specified - if (uiMechanic && pTempSpell->Mechanic != uiMechanic) + if (mechanic && tempSpell->Mechanic != mechanic) continue; //Make sure that the spell uses the requested amount of power - if (uiPowerCostMin && pTempSpell->manaCost < uiPowerCostMin) + if (powerCostMin && tempSpell->manaCost < powerCostMin) continue; - if (uiPowerCostMax && pTempSpell->manaCost > uiPowerCostMax) + if (powerCostMax && tempSpell->manaCost > powerCostMax) continue; //Continue if we don't have the mana to actually cast this spell - if (pTempSpell->manaCost > me->GetPower((Powers)pTempSpell->powerType)) + if (tempSpell->manaCost > me->GetPower(Powers(tempSpell->powerType))) continue; //Get the Range - pTempRange = GetSpellRangeStore()->LookupEntry(pTempSpell->rangeIndex); + tempRange = GetSpellRangeStore()->LookupEntry(tempSpell->rangeIndex); //Spell has invalid range store so we can't use it - if (!pTempRange) + if (!tempRange) continue; //Check if the spell meets our range requirements - if (fRangeMin && me->GetSpellMinRangeForTarget(pTarget, pTempRange) < fRangeMin) + if (rangeMin && me->GetSpellMinRangeForTarget(target, tempRange) < rangeMin) continue; - if (fRangeMax && me->GetSpellMaxRangeForTarget(pTarget, pTempRange) > fRangeMax) + if (rangeMax && me->GetSpellMaxRangeForTarget(target, tempRange) > rangeMax) continue; //Check if our target is in range - if (me->IsWithinDistInMap(pTarget, (float)me->GetSpellMinRangeForTarget(pTarget, pTempRange)) || !me->IsWithinDistInMap(pTarget, (float)me->GetSpellMaxRangeForTarget(pTarget, pTempRange))) + if (me->IsWithinDistInMap(target, float(me->GetSpellMinRangeForTarget(target, tempRange))) || !me->IsWithinDistInMap(target, float(me->GetSpellMaxRangeForTarget(target, tempRange)))) continue; //All good so lets add it to the spell list - apSpell[uiSpellCount] = pTempSpell; - ++uiSpellCount; + apSpell[spellCount] = tempSpell; + ++spellCount; } //We got our usable spells so now lets randomly pick one - if (!uiSpellCount) + if (!spellCount) return NULL; - return apSpell[rand()%uiSpellCount]; + return apSpell[urand(0, spellCount - 1)]; } -bool ScriptedAI::CanCast(Unit* pTarget, SpellEntry const* pSpell, bool bTriggered) +bool ScriptedAI::CanCast(Unit* target, SpellEntry const* spell, bool triggered /*= false*/) { //No target so we can't cast - if (!pTarget || !pSpell) + if (!target || !spell) return false; //Silenced so we can't cast - if (!bTriggered && me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SILENCED)) + if (!triggered && me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SILENCED)) return false; //Check for power - if (!bTriggered && me->GetPower((Powers)pSpell->powerType) < pSpell->manaCost) + if (!triggered && me->GetPower(Powers(spell->powerType)) < spell->manaCost) return false; - SpellRangeEntry const* pTempRange = GetSpellRangeStore()->LookupEntry(pSpell->rangeIndex); + SpellRangeEntry const* tempRange = GetSpellRangeStore()->LookupEntry(spell->rangeIndex); //Spell has invalid range store so we can't use it - if (!pTempRange) + if (!tempRange) return false; //Unit is out of range of this spell - if (me->IsInRange(pTarget, (float)me->GetSpellMinRangeForTarget(pTarget, pTempRange), (float)me->GetSpellMaxRangeForTarget(pTarget, pTempRange))) + if (me->IsInRange(target, float(me->GetSpellMinRangeForTarget(target, tempRange)), float(me->GetSpellMaxRangeForTarget(target, tempRange)))) return false; return true; @@ -422,29 +417,29 @@ Player* ScriptedAI::GetPlayerAtMinimumRange(float fMinimumRange) return pPlayer; } -void ScriptedAI::SetEquipmentSlots(bool bLoadDefault, int32 uiMainHand, int32 uiOffHand, int32 uiRanged) +void ScriptedAI::SetEquipmentSlots(bool loadDefault, int32 mainHand /*= EQUIP_NO_CHANGE*/, int32 offHand /*= EQUIP_NO_CHANGE*/, int32 ranged /*= EQUIP_NO_CHANGE*/) { - if (bLoadDefault) + if (loadDefault) { - if (CreatureInfo const* pInfo = GetCreatureTemplateStore(me->GetEntry())) - me->LoadEquipment(pInfo->equipmentId,true); + if (CreatureInfo const* creatureInfo = ObjectMgr::GetCreatureTemplate(me->GetEntry())) + me->LoadEquipment(creatureInfo->equipmentId, true); return; } - if (uiMainHand >= 0) - me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(uiMainHand)); + if (mainHand >= 0) + me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(mainHand)); - if (uiOffHand >= 0) - me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, uint32(uiOffHand)); + if (offHand >= 0) + me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, uint32(offHand)); - if (uiRanged >= 0) - me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2, uint32(uiRanged)); + if (ranged >= 0) + me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2, uint32(ranged)); } -void ScriptedAI::SetCombatMovement(bool bCombatMove) +void ScriptedAI::SetCombatMovement(bool allowMovement) { - m_bCombatMovement = bCombatMove; + _isCombatMovementAllowed = allowMovement; } enum eNPCs @@ -457,13 +452,13 @@ enum eNPCs // Hacklike storage used for misc creatures that are expected to evade of outside of a certain area. // It is assumed the information is found elswehere and can be handled by the core. So far no luck finding such information/way to extract it. -bool ScriptedAI::EnterEvadeIfOutOfCombatArea(const uint32 uiDiff) +bool ScriptedAI::EnterEvadeIfOutOfCombatArea(uint32 const diff) { - if (m_uiEvadeCheckCooldown <= uiDiff) - m_uiEvadeCheckCooldown = 2500; + if (_evadeCheckCooldown <= diff) + _evadeCheckCooldown = 2500; else { - m_uiEvadeCheckCooldown -= uiDiff; + _evadeCheckCooldown -= diff; return false; } @@ -501,20 +496,18 @@ bool ScriptedAI::EnterEvadeIfOutOfCombatArea(const uint32 uiDiff) return true; } -void Scripted_NoMovementAI::AttackStart(Unit* pWho) +void Scripted_NoMovementAI::AttackStart(Unit* target) { - if (!pWho) + if (!target) return; - if (me->Attack(pWho, true)) - { - DoStartNoMovement(pWho); - } + if (me->Attack(target, true)) + DoStartNoMovement(target); } -BossAI::BossAI(Creature *c, uint32 id) : ScriptedAI(c) -, bossId(id), summons(me), instance(c->GetInstanceScript()) -, boundary(instance ? instance->GetBossBoundary(id) : NULL) +BossAI::BossAI(Creature* creature, uint32 bossId) : ScriptedAI(creature) +, _bossId(bossId), summons(creature), instance(creature->GetInstanceScript()) +, _boundary(instance ? instance->GetBossBoundary(bossId) : NULL) { } @@ -523,10 +516,11 @@ void BossAI::_Reset() if (!me->isAlive()) return; + me->ResetLootMode(); events.Reset(); summons.DespawnAll(); if (instance) - instance->SetBossState(bossId, NOT_STARTED); + instance->SetBossState(_bossId, NOT_STARTED); } void BossAI::_JustDied() @@ -535,7 +529,7 @@ void BossAI::_JustDied() summons.DespawnAll(); if (instance) { - instance->SetBossState(bossId, DONE); + instance->SetBossState(_bossId, DONE); instance->SaveToDB(); } } @@ -547,12 +541,12 @@ void BossAI::_EnterCombat() if (instance) { // bosses do not respawn, check only on enter combat - if (!instance->CheckRequiredBosses(bossId)) + if (!instance->CheckRequiredBosses(_bossId)) { EnterEvadeMode(); return; } - instance->SetBossState(bossId, IN_PROGRESS); + instance->SetBossState(_bossId, IN_PROGRESS); } } @@ -560,18 +554,19 @@ void BossAI::TeleportCheaters() { float x, y, z; me->GetPosition(x, y, z); - std::list &m_threatlist = me->getThreatManager().getThreatList(); - for (std::list::iterator itr = m_threatlist.begin(); itr != m_threatlist.end(); ++itr) - if ((*itr)->getTarget()->GetTypeId() == TYPEID_PLAYER && !CheckBoundary((*itr)->getTarget())) - (*itr)->getTarget()->NearTeleportTo(x, y, z, 0); + std::list& threatList = me->getThreatManager().getThreatList(); + for (std::list::iterator itr = threatList.begin(); itr != threatList.end(); ++itr) + if (Unit* target = (*itr)->getTarget()) + if (target->GetTypeId() == TYPEID_PLAYER && !CheckBoundary(target)) + target->NearTeleportTo(x, y, z, 0); } -bool BossAI::CheckBoundary(Unit *who) +bool BossAI::CheckBoundary(Unit* who) { - if (!boundary || !who) + if (!GetBoundary() || !who) return true; - for (BossBoundaryMap::const_iterator itr = boundary->begin(); itr != boundary->end(); ++itr) + for (BossBoundaryMap::const_iterator itr = GetBoundary()->begin(); itr != GetBoundary()->end(); ++itr) { switch (itr->first) { @@ -615,32 +610,35 @@ bool BossAI::CheckBoundary(Unit *who) return true; } -void BossAI::JustSummoned(Creature *summon) +void BossAI::JustSummoned(Creature* summon) { summons.Summon(summon); if (me->isInCombat()) DoZoneInCombat(summon); } -void BossAI::SummonedCreatureDespawn(Creature *summon) +void BossAI::SummonedCreatureDespawn(Creature* summon) { summons.Despawn(summon); } // SD2 grid searchers. -Creature *GetClosestCreatureWithEntry(WorldObject *pSource, uint32 uiEntry, float fMaxSearchRange, bool bAlive) +Creature* GetClosestCreatureWithEntry(WorldObject* source, uint32 entry, float maxSearchRange, bool alive /*= true*/) { - return pSource->FindNearestCreature(uiEntry, fMaxSearchRange, bAlive); + return source->FindNearestCreature(entry, maxSearchRange, alive); } -GameObject *GetClosestGameObjectWithEntry(WorldObject *pSource, uint32 uiEntry, float fMaxSearchRange) + +GameObject* GetClosestGameObjectWithEntry(WorldObject* source, uint32 entry, float maxSearchRange) { - return pSource->FindNearestGameObject(uiEntry, fMaxSearchRange); + return source->FindNearestGameObject(entry, maxSearchRange); } -void GetCreatureListWithEntryInGrid(std::list& lList, WorldObject *pSource, uint32 uiEntry, float fMaxSearchRange) + +void GetCreatureListWithEntryInGrid(std::list& list, WorldObject* source, uint32 entry, float maxSearchRange) { - return pSource->GetCreatureListWithEntryInGrid(lList, uiEntry, fMaxSearchRange); + source->GetCreatureListWithEntryInGrid(list, entry, maxSearchRange); } -void GetGameObjectListWithEntryInGrid(std::list& lList, WorldObject *pSource, uint32 uiEntry, float fMaxSearchRange) + +void GetGameObjectListWithEntryInGrid(std::list& list, WorldObject* source, uint32 entry, float maxSearchRange) { - return pSource->GetGameObjectListWithEntryInGrid(lList, uiEntry, fMaxSearchRange); + source->GetGameObjectListWithEntryInGrid(list, entry, maxSearchRange); } diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.h b/src/server/game/AI/ScriptedAI/ScriptedCreature.h index f94a41dfb102b..d60e5defa3327 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.h +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.h @@ -30,53 +30,55 @@ class SummonList : public std::list { public: explicit SummonList(Creature* creature) : me(creature) {} - void Summon(Creature *summon) { push_back(summon->GetGUID()); } - void Despawn(Creature *summon) { remove(summon->GetGUID()); } + void Summon(Creature* summon) { push_back(summon->GetGUID()); } + void Despawn(Creature* summon) { remove(summon->GetGUID()); } void DespawnEntry(uint32 entry); void DespawnAll(); - void DoAction(uint32 entry, uint32 info); + void DoAction(uint32 entry, int32 info); void DoZoneInCombat(uint32 entry = 0); + void RemoveNotExisting(); + bool HasEntry(uint32 entry); private: - Creature *me; + Creature* me; }; struct ScriptedAI : public CreatureAI { - explicit ScriptedAI(Creature* pCreature); + explicit ScriptedAI(Creature* creature); virtual ~ScriptedAI() {} // ************* //CreatureAI Functions // ************* - void AttackStartNoMove(Unit *pTarget); + void AttackStartNoMove(Unit* target); // Called at any Damage from any attacker (before damage apply) - void DamageTaken(Unit* /*pDone_by*/, uint32& /*uiDamage*/) {} + void DamageTaken(Unit* /*attacker*/, uint32& /*damage*/) {} //Called at World update tick - void UpdateAI(const uint32); + virtual void UpdateAI(uint32 const diff); //Called at creature death - void JustDied(Unit* /*who*/){} + void JustDied(Unit* /*killer*/) {} //Called at creature killing another unit - void KilledUnit(Unit* /*who*/){} + void KilledUnit(Unit* /*victim*/) {} // Called when the creature summon successfully other creature - void JustSummoned(Creature*) {} + void JustSummoned(Creature* /*summon*/) {} // Called when a summoned creature is despawned - void SummonedCreatureDespawn(Creature*) {} + void SummonedCreatureDespawn(Creature* /*summon*/) {} // Called when hit by a spell - void SpellHit(Unit* /*caster*/, const SpellEntry * /*spell*/) {} + void SpellHit(Unit* /*caster*/, SpellEntry const* /*spell*/) {} // Called when spell hits a target - void SpellHitTarget(Unit * /*pTarget*/, const SpellEntry * /*spell*/) {} + void SpellHitTarget(Unit* /*target*/, SpellEntry const* /*spell*/) {} //Called at waypoint reached or PointMovement end - void MovementInform(uint32 /*type*/, uint32 /*id*/){} + void MovementInform(uint32 /*type*/, uint32 /*id*/) {} // Called when AI is temporarily replaced or put back when possess is applied or removed void OnPossess(bool /*apply*/) {} @@ -99,101 +101,96 @@ struct ScriptedAI : public CreatureAI void Reset() {} //Called at creature aggro either by MoveInLOS or Attack Start - void EnterCombat(Unit* /*who*/) {} + void EnterCombat(Unit* /*victim*/) {} // ************* //AI Helper Functions // ************* //Start movement toward victim - void DoStartMovement(Unit* pVictim, float fDistance = 0, float fAngle = 0); + void DoStartMovement(Unit* target, float distance = 0.0f, float angle = 0.0f); //Start no movement on victim - void DoStartNoMovement(Unit* pVictim); + void DoStartNoMovement(Unit* target); //Stop attack of current victim void DoStopAttack(); //Cast spell by spell info - void DoCastSpell(Unit* pTarget, SpellEntry const* pSpellInfo, bool bTriggered = false); + void DoCastSpell(Unit* target, SpellEntry const* spellInfo, bool triggered = false); //Plays a sound to all nearby players - void DoPlaySoundToSet(WorldObject* pSource, uint32 sound); + void DoPlaySoundToSet(WorldObject* source, uint32 soundId); //Drops all threat to 0%. Does not remove players from the threat list void DoResetThreat(); - float DoGetThreat(Unit* u); - void DoModifyThreatPercent(Unit* pUnit, int32 pct); + float DoGetThreat(Unit* unit); + void DoModifyThreatPercent(Unit* unit, int32 pct); - void DoTeleportTo(float fX, float fY, float fZ, uint32 uiTime = 0); - void DoTeleportTo(const float pos[4]); - - void DoAction(const int32 /*param*/) {} + void DoTeleportTo(float x, float y, float z, uint32 time = 0); + void DoTeleportTo(float const pos[4]); //Teleports a player without dropping threat (only teleports to same map) - void DoTeleportPlayer(Unit* pUnit, float fX, float fY, float fZ, float fO); - void DoTeleportAll(float fX, float fY, float fZ, float fO); + void DoTeleportPlayer(Unit* unit, float x, float y, float z, float o); + void DoTeleportAll(float x, float y, float z, float o); //Returns friendly unit with the most amount of hp missing from max hp - Unit* DoSelectLowestHpFriendly(float fRange, uint32 uiMinHPDiff = 1); + Unit* DoSelectLowestHpFriendly(float range, uint32 minHPDiff = 1); //Returns a list of friendly CC'd units within range - std::list DoFindFriendlyCC(float fRange); + std::list DoFindFriendlyCC(float range); //Returns a list of all friendly units missing a specific buff within range - std::list DoFindFriendlyMissingBuff(float fRange, uint32 uiSpellId); + std::list DoFindFriendlyMissingBuff(float range, uint32 spellId); //Return a player with at least minimumRange from me - Player* GetPlayerAtMinimumRange(float fMinimumRange); + Player* GetPlayerAtMinimumRange(float minRange); //Spawns a creature relative to me - Creature* DoSpawnCreature(uint32 uiId, float fX, float fY, float fZ, float fAngle, uint32 uiType, uint32 uiDespawntime); - - //Selects a unit from the creature's current aggro list - Unit* SelectUnit(SelectAggroTarget pTarget, uint32 uiPosition); + Creature* DoSpawnCreature(uint32 entry, float offsetX, float offsetY, float offsetZ, float angle, uint32 type, uint32 despawntime); bool HealthBelowPct(uint32 pct) const { return me->HealthBelowPct(pct); } bool HealthAbovePct(uint32 pct) const { return me->HealthAbovePct(pct); } //Returns spells that meet the specified criteria from the creatures spell list - SpellEntry const* SelectSpell(Unit* Target, uint32 School, uint32 Mechanic, SelectTargetType Targets, uint32 PowerCostMin, uint32 PowerCostMax, float RangeMin, float RangeMax, SelectEffect Effect); + SpellEntry const* SelectSpell(Unit* target, uint32 school, uint32 mechanic, SelectTargetType targets, uint32 powerCostMin, uint32 powerCostMax, float rangeMin, float rangeMax, SelectEffect effect); //Checks if you can cast the specified spell - bool CanCast(Unit* pTarget, SpellEntry const* pSpell, bool bTriggered = false); + bool CanCast(Unit* target, SpellEntry const* spell, bool triggered = false); - void SetEquipmentSlots(bool bLoadDefault, int32 uiMainHand = EQUIP_NO_CHANGE, int32 uiOffHand = EQUIP_NO_CHANGE, int32 uiRanged = EQUIP_NO_CHANGE); + void SetEquipmentSlots(bool loadDefault, int32 mainHand = EQUIP_NO_CHANGE, int32 offHand = EQUIP_NO_CHANGE, int32 ranged = EQUIP_NO_CHANGE); //Generally used to control if MoveChase() is to be used or not in AttackStart(). Some creatures does not chase victims - void SetCombatMovement(bool CombatMove); - bool IsCombatMovement() { return m_bCombatMovement; } + void SetCombatMovement(bool allowMovement); + bool IsCombatMovementAllowed() { return _isCombatMovementAllowed; } - bool EnterEvadeIfOutOfCombatArea(const uint32 uiDiff); + bool EnterEvadeIfOutOfCombatArea(uint32 const diff); // return true for heroic mode. i.e. // - for dungeon in mode 10-heroic, // - for raid in mode 10-Heroic // - for raid in mode 25-heroic // DO NOT USE to check raid in mode 25-normal. - bool IsHeroic() { return m_heroicMode; } + bool IsHeroic() { return _isHeroic; } // return the dungeon or raid difficulty - Difficulty getDifficulty() { return m_difficulty; } + Difficulty GetDifficulty() { return _difficulty; } // return true for 25 man or 25 man heroic mode - bool Is25ManRaid() { return m_difficulty & 1; } + bool Is25ManRaid() { return _difficulty & 1; } template inline const T& DUNGEON_MODE(const T& normal5, const T& heroic10) { - switch(m_difficulty) + switch (_difficulty) { - case DUNGEON_DIFFICULTY_NORMAL: - return normal5; - case DUNGEON_DIFFICULTY_HEROIC: - return heroic10; - default: - break; + case DUNGEON_DIFFICULTY_NORMAL: + return normal5; + case DUNGEON_DIFFICULTY_HEROIC: + return heroic10; + default: + break; } return heroic10; @@ -202,14 +199,14 @@ struct ScriptedAI : public CreatureAI template inline const T& RAID_MODE(const T& normal10, const T& normal25) { - switch(m_difficulty) + switch (_difficulty) { - case RAID_DIFFICULTY_10MAN_NORMAL: - return normal10; - case RAID_DIFFICULTY_25MAN_NORMAL: - return normal25; - default: - break; + case RAID_DIFFICULTY_10MAN_NORMAL: + return normal10; + case RAID_DIFFICULTY_25MAN_NORMAL: + return normal25; + default: + break; } return normal25; @@ -218,27 +215,28 @@ struct ScriptedAI : public CreatureAI template inline const T& RAID_MODE(const T& normal10, const T& normal25, const T& heroic10, const T& heroic25) { - switch(m_difficulty) + switch (_difficulty) { - case RAID_DIFFICULTY_10MAN_NORMAL: - return normal10; - case RAID_DIFFICULTY_25MAN_NORMAL: - return normal25; - case RAID_DIFFICULTY_10MAN_HEROIC: - return heroic10; - case RAID_DIFFICULTY_25MAN_HEROIC: - return heroic25; + case RAID_DIFFICULTY_10MAN_NORMAL: + return normal10; + case RAID_DIFFICULTY_25MAN_NORMAL: + return normal25; + case RAID_DIFFICULTY_10MAN_HEROIC: + return heroic10; + case RAID_DIFFICULTY_25MAN_HEROIC: + return heroic25; + default: + break; } return heroic25; } private: - bool m_bCombatMovement; - uint32 m_uiEvadeCheckCooldown; - - bool m_heroicMode; - Difficulty m_difficulty; + Difficulty _difficulty; + uint32 _evadeCheckCooldown; + bool _isCombatMovementAllowed; + bool _isHeroic; }; struct Scripted_NoMovementAI : public ScriptedAI @@ -247,29 +245,27 @@ struct Scripted_NoMovementAI : public ScriptedAI virtual ~Scripted_NoMovementAI() {} //Called at each attack of me by any victim - void AttackStart(Unit* who); + void AttackStart(Unit* target); }; -struct BossAI : public ScriptedAI +class BossAI : public ScriptedAI { - BossAI(Creature *c, uint32 id); - virtual ~BossAI() {} + public: + BossAI(Creature* creature, uint32 bossId); + virtual ~BossAI() {} - const uint32 bossId; - EventMap events; - SummonList summons; - InstanceScript * const instance; - const BossBoundaryMap * const boundary; + InstanceScript* const instance; + BossBoundaryMap const* GetBoundary() const { return _boundary; } - void JustSummoned(Creature *summon); - void SummonedCreatureDespawn(Creature *summon); + void JustSummoned(Creature* summon); + void SummonedCreatureDespawn(Creature* summon); - void UpdateAI(const uint32 diff) = 0; + void UpdateAI(uint32 const diff) = 0; - void Reset() { _Reset(); } - void EnterCombat(Unit * /*who*/) { _EnterCombat(); } - void JustDied(Unit * /*killer*/) { _JustDied(); } - void JustReachedHome() { _JustReachedHome(); } + void Reset() { _Reset(); } + void EnterCombat(Unit* /*who*/) { _EnterCombat(); } + void JustDied(Unit* /*killer*/) { _JustDied(); } + void JustReachedHome() { _JustReachedHome(); } protected: void _Reset(); @@ -281,18 +277,26 @@ struct BossAI : public ScriptedAI { if (CheckBoundary(me)) return true; + EnterEvadeMode(); return false; } - bool CheckBoundary(Unit *who); + + bool CheckBoundary(Unit* who); void TeleportCheaters(); + + EventMap events; + SummonList summons; + + private: + BossBoundaryMap const* const _boundary; + const uint32 _bossId; }; // SD2 grid searchers. -Creature *GetClosestCreatureWithEntry(WorldObject *pSource, uint32 uiEntry, float fMaxSearchRange, bool bAlive = true); -GameObject *GetClosestGameObjectWithEntry(WorldObject *pSource, uint32 uiEntry, float fMaxSearchRange); -void GetCreatureListWithEntryInGrid(std::list& lList, WorldObject* pSource, uint32 uiEntry, float fMaxSearchRange); -void GetGameObjectListWithEntryInGrid(std::list& lList, WorldObject* pSource, uint32 uiEntry, float fMaxSearchRange); +Creature* GetClosestCreatureWithEntry(WorldObject* source, uint32 entry, float maxSearchRange, bool alive = true); +GameObject* GetClosestGameObjectWithEntry(WorldObject* source, uint32 entry, float maxSearchRange); +void GetCreatureListWithEntryInGrid(std::list& list, WorldObject* source, uint32 entry, float maxSearchRange); +void GetGameObjectListWithEntryInGrid(std::list& list, WorldObject* source, uint32 entry, float maxSearchRange); #endif - diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp index c41ce1881d872..2c39bdc86d341 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp @@ -45,7 +45,7 @@ void npc_escortAI::AttackStart(Unit* pWho) if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == POINT_MOTION_TYPE) me->GetMotionMaster()->MovementExpired(); - if (IsCombatMovement()) + if (IsCombatMovementAllowed()) me->GetMotionMaster()->MoveChase(pWho); } } @@ -148,7 +148,7 @@ void npc_escortAI::JustRespawned() { m_uiEscortState = STATE_ESCORT_NONE; - if (!IsCombatMovement()) + if (!IsCombatMovementAllowed()) SetCombatMovement(true); //add a small delay before going to first waypoint, normal in near all cases @@ -178,7 +178,7 @@ void npc_escortAI::EnterEvadeMode() { AddEscortState(STATE_ESCORT_RETURNING); ReturnToLastPoint(); - sLog->outDebug("TSCR: EscortAI has left combat and is now returning to last point"); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI has left combat and is now returning to last point"); } else { @@ -225,7 +225,7 @@ void npc_escortAI::UpdateAI(const uint32 uiDiff) { if (DespawnAtEnd) { - sLog->outDebug("TSCR: EscortAI reached end of waypoints"); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI reached end of waypoints"); if (m_bCanReturnToStart) { @@ -236,7 +236,7 @@ void npc_escortAI::UpdateAI(const uint32 uiDiff) m_uiWPWaitTimer = 0; - sLog->outDebug("TSCR: EscortAI are returning home to spawn location: %u, %f, %f, %f", POINT_HOME, fRetX, fRetY, fRetZ); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI are returning home to spawn location: %u, %f, %f, %f", POINT_HOME, fRetX, fRetY, fRetZ); return; } @@ -252,7 +252,7 @@ void npc_escortAI::UpdateAI(const uint32 uiDiff) } else { - sLog->outDebug("TSCR: EscortAI reached end of waypoints with Despawn off"); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI reached end of waypoints with Despawn off"); return; } @@ -261,7 +261,7 @@ void npc_escortAI::UpdateAI(const uint32 uiDiff) if (!HasEscortState(STATE_ESCORT_PAUSED)) { me->GetMotionMaster()->MovePoint(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); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI start waypoint %u (%f, %f, %f).", CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z); WaypointStart(CurrentWP->id); @@ -279,7 +279,7 @@ void npc_escortAI::UpdateAI(const uint32 uiDiff) { if (DespawnAtFar && !IsPlayerOrGroupInRange()) { - sLog->outDebug("TSCR: EscortAI failed because player/group was to far away or not found"); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI failed because player/group was to far away or not found"); if (m_bCanInstantRespawn) { @@ -317,7 +317,7 @@ void npc_escortAI::MovementInform(uint32 uiMoveType, uint32 uiPointId) //Combat start position reached, continue waypoint movement if (uiPointId == POINT_LAST_POINT) { - sLog->outDebug("TSCR: EscortAI has returned to original position before combat"); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI has returned to original position before combat"); if (m_bIsRunning && me->HasUnitMovementFlag(MOVEMENTFLAG_WALKING)) me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); @@ -331,7 +331,7 @@ void npc_escortAI::MovementInform(uint32 uiMoveType, uint32 uiPointId) } else if (uiPointId == POINT_HOME) { - sLog->outDebug("TSCR: EscortAI has returned to original home location and will continue from beginning of waypoint list."); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI has returned to original home location and will continue from beginning of waypoint list."); CurrentWP = WaypointList.begin(); m_uiWPWaitTimer = 1; @@ -345,7 +345,7 @@ void npc_escortAI::MovementInform(uint32 uiMoveType, uint32 uiPointId) return; } - sLog->outDebug("TSCR: EscortAI Waypoint %u reached", CurrentWP->id); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI Waypoint %u reached", CurrentWP->id); //Call WP function WaypointReached(CurrentWP->id); @@ -416,14 +416,14 @@ void npc_escortAI::SetRun(bool bRun) if (!m_bIsRunning) me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); else - sLog->outDebug("TSCR: EscortAI attempt to set run mode, but is already running."); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI attempt to set run mode, but is already running."); } else { if (m_bIsRunning) me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); else - sLog->outDebug("TSCR: EscortAI attempt to set walk mode, but is already walking."); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI attempt to set walk mode, but is already walking."); } m_bIsRunning = bRun; } @@ -433,29 +433,27 @@ void npc_escortAI::Start(bool bIsActiveAttacker, bool bRun, uint64 uiPlayerGUID, { if (me->getVictim()) { - sLog->outError("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 (script: %s, creature entry: %u) attempts to Start while in combat", me->GetScriptName().c_str(), me->GetEntry()); return; } if (HasEscortState(STATE_ESCORT_ESCORTING)) { - sLog->outError("TSCR: EscortAI attempt to Start while already escorting."); + sLog->outError("TSCR: EscortAI (script: %s, creature entry: %u) attempts to Start while already escorting", me->GetScriptName().c_str(), me->GetEntry()); return; } if (!ScriptWP) // sd2 never adds wp in script, but tc does { - - if (!WaypointList.empty()) - WaypointList.clear(); - - FillPointMovementListForCreature(); - + if (!WaypointList.empty()) + WaypointList.clear(); + FillPointMovementListForCreature(); } if (WaypointList.empty()) { - sLog->outErrorDb("TSCR: EscortAI Start with 0 waypoints (possible missing entry in script_waypoint. Quest: %u).", pQuest ? pQuest->GetQuestId() : 0); + sLog->outErrorDb("TSCR: EscortAI (script: %s, creature entry: %u) starts with 0 waypoints (possible missing entry in script_waypoint. Quest: %u).", + me->GetScriptName().c_str(), me->GetEntry(), pQuest ? pQuest->GetQuestId() : 0); return; } @@ -470,19 +468,19 @@ void npc_escortAI::Start(bool bIsActiveAttacker, bool bRun, uint64 uiPlayerGUID, m_bCanReturnToStart = bCanLoopPath; if (m_bCanReturnToStart && m_bCanInstantRespawn) - sLog->outDebug("TSCR: EscortAI is set to return home after waypoint end and instant respawn at waypoint end. Creature will never despawn."); + sLog->outDebug(LOG_FILTER_TSCR, "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(); - sLog->outDebug("TSCR: EscortAI start with WAYPOINT_MOTION_TYPE, changed to MoveIdle."); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI start with WAYPOINT_MOTION_TYPE, changed to MoveIdle."); } //disable npcflags me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE); - sLog->outDebug("TSCR: EscortAI started with " UI64FMTD " waypoints. ActiveAttacker = %d, Run = %d, PlayerGUID = " UI64FMTD "", uint64(WaypointList.size()), m_bIsActiveAttacker, m_bIsRunning, m_uiPlayerGUID); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI started with " UI64FMTD " waypoints. ActiveAttacker = %d, Run = %d, PlayerGUID = " UI64FMTD "", uint64(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 06fb3bc667ac4..036d43229ff7f 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp @@ -41,7 +41,7 @@ void FollowerAI::AttackStart(Unit* pWho) if (me->HasUnitState(UNIT_STAT_FOLLOW)) me->ClearUnitState(UNIT_STAT_FOLLOW); - if (IsCombatMovement()) + if (IsCombatMovementAllowed()) me->GetMotionMaster()->MoveChase(pWho); } } @@ -147,7 +147,7 @@ void FollowerAI::JustRespawned() { m_uiFollowState = STATE_FOLLOW_NONE; - if (!IsCombatMovement()) + if (!IsCombatMovementAllowed()) SetCombatMovement(true); if (me->getFaction() != me->GetCreatureInfo()->faction_A) @@ -165,7 +165,7 @@ void FollowerAI::EnterEvadeMode() if (HasFollowState(STATE_FOLLOW_INPROGRESS)) { - sLog->outDebug("TSCR: FollowerAI left combat, returning to CombatStartPosition."); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: FollowerAI left combat, returning to CombatStartPosition."); if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE) { @@ -191,7 +191,7 @@ void FollowerAI::UpdateAI(const uint32 uiDiff) { if (HasFollowState(STATE_FOLLOW_COMPLETE) && !HasFollowState(STATE_FOLLOW_POSTEVENT)) { - sLog->outDebug("TSCR: FollowerAI is set completed, despawns."); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: FollowerAI is set completed, despawns."); me->DespawnOrUnsummon(); return; } @@ -202,7 +202,7 @@ void FollowerAI::UpdateAI(const uint32 uiDiff) { if (HasFollowState(STATE_FOLLOW_RETURNING)) { - sLog->outDebug("TSCR: FollowerAI is returning to leader."); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: FollowerAI is returning to leader."); RemoveFollowState(STATE_FOLLOW_RETURNING); me->GetMotionMaster()->MoveFollow(pPlayer, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE); @@ -231,7 +231,7 @@ void FollowerAI::UpdateAI(const uint32 uiDiff) if (bIsMaxRangeExceeded) { - sLog->outDebug("TSCR: FollowerAI failed because player/group was to far away or not found"); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: FollowerAI failed because player/group was to far away or not found"); me->DespawnOrUnsummon(); return; } @@ -274,7 +274,7 @@ void FollowerAI::StartFollow(Player* pLeader, uint32 uiFactionForFollower, const { if (me->getVictim()) { - sLog->outDebug("TSCR: FollowerAI attempt to StartFollow while in combat."); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: FollowerAI attempt to StartFollow while in combat."); return; } @@ -296,7 +296,7 @@ void FollowerAI::StartFollow(Player* pLeader, uint32 uiFactionForFollower, const { me->GetMotionMaster()->Clear(); me->GetMotionMaster()->MoveIdle(); - sLog->outDebug("TSCR: FollowerAI start with WAYPOINT_MOTION_TYPE, set to MoveIdle."); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: FollowerAI start with WAYPOINT_MOTION_TYPE, set to MoveIdle."); } me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE); @@ -305,7 +305,7 @@ void FollowerAI::StartFollow(Player* pLeader, uint32 uiFactionForFollower, const me->GetMotionMaster()->MoveFollow(pLeader, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE); - sLog->outDebug("TSCR: FollowerAI start follow %s (GUID " UI64FMTD ")", pLeader->GetName(), m_uiLeaderGUID); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: FollowerAI start follow %s (GUID " UI64FMTD ")", pLeader->GetName(), m_uiLeaderGUID); } Player* FollowerAI::GetLeaderForFollower() @@ -324,7 +324,7 @@ Player* FollowerAI::GetLeaderForFollower() if (pMember && pMember->isAlive() && me->IsWithinDistInMap(pMember, MAX_PLAYER_DISTANCE)) { - sLog->outDebug("TSCR: FollowerAI GetLeader changed and returned new leader."); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: FollowerAI GetLeader changed and returned new leader."); m_uiLeaderGUID = pMember->GetGUID(); return pMember; break; @@ -334,7 +334,7 @@ Player* FollowerAI::GetLeaderForFollower() } } - sLog->outDebug("TSCR: FollowerAI GetLeader can not find suitable leader."); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: FollowerAI GetLeader can not find suitable leader."); return NULL; } diff --git a/src/server/game/AI/ScriptedAI/ScriptedSimpleAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedSimpleAI.cpp index 3bf1271a6536d..5614d9f84e653 100755 --- a/src/server/game/AI/ScriptedAI/ScriptedSimpleAI.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedSimpleAI.cpp @@ -134,13 +134,13 @@ void SimpleAI::KilledUnit(Unit *victim) pTarget = me->getVictim(); break; case CAST_HOSTILE_SECOND_AGGRO: - pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO,1); + pTarget = SelectTarget(SELECT_TARGET_TOPAGGRO,1); break; case CAST_HOSTILE_LAST_AGGRO: - pTarget = SelectUnit(SELECT_TARGET_BOTTOMAGGRO,0); + pTarget = SelectTarget(SELECT_TARGET_BOTTOMAGGRO,0); break; case CAST_HOSTILE_RANDOM: - pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); + pTarget = SelectTarget(SELECT_TARGET_RANDOM,0); break; case CAST_KILLEDUNIT_VICTIM: pTarget = victim; @@ -182,13 +182,13 @@ void SimpleAI::DamageTaken(Unit *killer, uint32 &damage) pTarget = me->getVictim(); break; case CAST_HOSTILE_SECOND_AGGRO: - pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO,1); + pTarget = SelectTarget(SELECT_TARGET_TOPAGGRO,1); break; case CAST_HOSTILE_LAST_AGGRO: - pTarget = SelectUnit(SELECT_TARGET_BOTTOMAGGRO,0); + pTarget = SelectTarget(SELECT_TARGET_BOTTOMAGGRO,0); break; case CAST_HOSTILE_RANDOM: - pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); + pTarget = SelectTarget(SELECT_TARGET_RANDOM,0); break; case CAST_JUSTDIED_KILLER: pTarget = killer; @@ -233,13 +233,13 @@ void SimpleAI::UpdateAI(const uint32 diff) pTarget = me->getVictim(); break; case CAST_HOSTILE_SECOND_AGGRO: - pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO,1); + pTarget = SelectTarget(SELECT_TARGET_TOPAGGRO,1); break; case CAST_HOSTILE_LAST_AGGRO: - pTarget = SelectUnit(SELECT_TARGET_BOTTOMAGGRO,0); + pTarget = SelectTarget(SELECT_TARGET_BOTTOMAGGRO,0); break; case CAST_HOSTILE_RANDOM: - pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); + pTarget = SelectTarget(SELECT_TARGET_RANDOM,0); break; } diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp index dbd58b06a5fdf..4186f5e7565f0 100644 --- a/src/server/game/AI/SmartScripts/SmartAI.cpp +++ b/src/server/game/AI/SmartScripts/SmartAI.cpp @@ -15,7 +15,6 @@ * with this program. If not, see . */ - #include "DatabaseEnv.h" #include "SQLStorage.h" #include "ObjectMgr.h" @@ -33,7 +32,7 @@ #include "SmartAI.h" #include "ScriptPCH.h" -SmartAI::SmartAI(Creature *c) : CreatureAI(c) +SmartAI::SmartAI(Creature* c) : CreatureAI(c) { // copy script to local (protection for table reload) @@ -211,7 +210,6 @@ void SmartAI::EndPath(bool fail) else GetScript()->SetPathId(0); - ObjectList* targets = GetScript()->GetTargetList(SMART_ESCORT_TARGETS); if (targets && mEscortQuestID) { @@ -224,11 +222,11 @@ void SmartAI::EndPath(bool fail) if(fail && plr->GetQuestStatus(mEscortQuestID) == QUEST_STATUS_INCOMPLETE) plr->FailQuest(mEscortQuestID); - if (Group *pGroup = plr->GetGroup()) + if (Group* pGroup = plr->GetGroup()) { - for (GroupReference *gr = pGroup->GetFirstMember(); gr != NULL; gr = gr->next()) + for (GroupReference* gr = pGroup->GetFirstMember(); gr != NULL; gr = gr->next()) { - Player *pGroupGuy = gr->getSource(); + Player* pGroupGuy = gr->getSource(); if(!fail && pGroupGuy->IsAtGroupRewardDistance(me) && !pGroupGuy->GetCorpse()) pGroupGuy->AreaExploredOrEventHappens(mEscortQuestID); @@ -392,11 +390,11 @@ bool SmartAI::IsEscortInvokerInRange() if (me->GetDistance(plr) <= SMART_ESCORT_MAX_PLAYER_DIST) return true; - if (Group *pGroup = plr->GetGroup()) + if (Group* pGroup = plr->GetGroup()) { - for (GroupReference *gr = pGroup->GetFirstMember(); gr != NULL; gr = gr->next()) + for (GroupReference* gr = pGroup->GetFirstMember(); gr != NULL; gr = gr->next()) { - Player *pGroupGuy = gr->getSource(); + Player* pGroupGuy = gr->getSource(); if (me->GetDistance(pGroupGuy) <= SMART_ESCORT_MAX_PLAYER_DIST) return true; @@ -793,7 +791,7 @@ void SmartAI::SetFollow(Unit* target, float dist, float angle, uint32 credit, ui void SmartAI::SetScript9(SmartScriptHolder &e, uint32 entry, Unit* invoker) { if (invoker) - GetScript()->mLastInvoker = invoker; + GetScript()->mLastInvoker = invoker->GetGUID(); GetScript()->SetScript9(e, entry); } /* @@ -845,7 +843,7 @@ void SmartGameObjectAI::Reset() // Called when a player opens a gossip dialog with the gameobject. bool SmartGameObjectAI::GossipHello(Player* player) { - sLog->outDebug("SmartGameObjectAI::GossipHello"); + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartGameObjectAI::GossipHello"); GetScript()->ProcessEventsFor(SMART_EVENT_GOSSIP_HELLO, player, 0 ,0 , false, NULL, go); return false; } @@ -894,7 +892,7 @@ void SmartGameObjectAI::SetData(uint32 id, uint32 value) void SmartGameObjectAI::SetScript9(SmartScriptHolder &e, uint32 entry, Unit* invoker) { if (invoker) - GetScript()->mLastInvoker = invoker; + GetScript()->mLastInvoker = invoker->GetGUID(); GetScript()->SetScript9(e, entry); } @@ -909,7 +907,7 @@ class SmartTrigger : public AreaTriggerScript bool OnTrigger(Player* player, AreaTriggerEntry const* trigger) { - sLog->outDebug("AreaTrigger %u is using SmartTrigger script", trigger->id); + sLog->outDebug(LOG_FILTER_DATABASE_AI, "AreaTrigger %u is using SmartTrigger script", trigger->id); SmartScript script; script.OnInitialize(NULL, trigger); script.ProcessEventsFor(SMART_EVENT_AREATRIGGER_ONTRIGGER, player, trigger->id); diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index e8610ff94b521..91e34d83a5c76 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -15,7 +15,6 @@ * with this program. If not, see . */ - #include "DatabaseEnv.h" #include "SQLStorage.h" #include "ObjectMgr.h" @@ -52,7 +51,15 @@ SmartScript::SmartScript() meOrigGUID = 0; goOrigGUID = 0; mResumeActionList = true; - mLastInvoker = NULL; + mLastInvoker = 0; +} + +SmartScript::~SmartScript() +{ + for (ObjectListMap::iterator itr = mTargetStorage->begin(); itr != mTargetStorage->end(); ++itr) + delete itr->second; + + delete mTargetStorage; } void SmartScript::OnReset() @@ -97,7 +104,7 @@ void SmartScript::ProcessEventsFor(SMART_EVENT e, Unit* unit, uint32 var0, uint3 } } -void SmartScript::ProcessAction(SmartScriptHolder &e, Unit* unit, uint32 var0, uint32 var1, bool bvar, const SpellEntry* spell, GameObject* gob) +void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, uint32 var1, bool bvar, const SpellEntry* spell, GameObject* gob) { //calc random if (e.GetEventType() != SMART_EVENT_LINK && e.event.event_chance < 100 && e.event.event_chance) @@ -109,108 +116,147 @@ void SmartScript::ProcessAction(SmartScriptHolder &e, Unit* unit, uint32 var0, u e.runOnce = true;//used for repeat check if (unit) - mLastInvoker = unit; + mLastInvoker = unit->GetGUID(); if (e.link && e.link != e.event_id) { SmartScriptHolder linked = FindLinkedEvent(e.link); if (linked.GetActionType() && linked.GetEventType() == SMART_EVENT_LINK) - { ProcessEvent(linked, unit, var0, var1, bvar, spell, gob); - }else{ + else sLog->outErrorDb("SmartScript::ProcessAction: Entry %d SourceType %u, Event %u, Link Event %u not found or invalid, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.link); - } } + if (Unit* tempInvoker = GetLastInvoker()) + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: Invoker: %s (guidlow: %u)", tempInvoker->GetName(), tempInvoker->GetGUIDLow()); + switch (e.GetActionType()) { case SMART_ACTION_TALK: + { + ObjectList* targets = GetTargets(e, unit); + talker = me; + if (targets) { - ObjectList* targets = GetTargets(e, unit); - talker = me; - if (targets) + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); itr++) + if (IsCreature((*itr))) { - if (IsCreature((*itr))) - { - talker = (*itr)->ToCreature(); - break; - } + talker = (*itr)->ToCreature(); + break; } } - mLastTextID = e.action.talk.textGroupID; - mTextTimer = e.action.talk.duration; - mTextGUID = IsPlayer(mLastInvoker)? mLastInvoker->GetGUID() : NULL;//invoker, used for $vars in texts - mUseTextTimer = true; - sCreatureTextMgr->SendChat(talker, uint8(e.action.talk.textGroupID), mTextGUID); - break; + + delete targets; } + + mLastTextID = e.action.talk.textGroupID; + mTextTimer = e.action.talk.duration; + mTextGUID = IsPlayer(GetLastInvoker()) ? GetLastInvoker()->GetGUID() : NULL;//invoker, used for $vars in texts + mUseTextTimer = true; + sCreatureTextMgr->SendChat(talker, uint8(e.action.talk.textGroupID), mTextGUID); + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_TALK: talker: %s (GuidLow: %u), textGuid: %u", + talker->GetName(), talker->GetGUIDLow(), mTextGUID); + break; + } case SMART_ACTION_SIMPLE_TALK: + { + ObjectList* targets = GetTargets(e, unit); + if (targets) { - ObjectList* targets = GetTargets(e, unit); - if (targets) + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); itr++) + if (IsCreature((*itr))) + sCreatureTextMgr->SendChat((*itr)->ToCreature(), uint8(e.action.talk.textGroupID), IsPlayer(GetLastInvoker())? GetLastInvoker()->GetGUID() : NULL); + else if (IsPlayer((*itr))) { - if (IsCreature((*itr))) - { - sCreatureTextMgr->SendChat((*itr)->ToCreature(), uint8(e.action.talk.textGroupID), IsPlayer(mLastInvoker)? mLastInvoker->GetGUID() : NULL); - } else if (IsPlayer((*itr))) - { - sCreatureTextMgr->SendChat(me, uint8(e.action.talk.textGroupID),IsPlayer(mLastInvoker)? mLastInvoker->GetGUID() : NULL,CHAT_TYPE_END,LANG_ADDON,TEXT_RANGE_NORMAL,NULL,TEAM_OTHER,false, (*itr)->ToPlayer()); - } + Unit* templastInvoker = GetLastInvoker(); + sCreatureTextMgr->SendChat(me, uint8(e.action.talk.textGroupID), IsPlayer(templastInvoker) ? templastInvoker->GetGUID() : NULL, CHAT_TYPE_END, LANG_ADDON, TEXT_RANGE_NORMAL, NULL, TEAM_OTHER, false, (*itr)->ToPlayer()); } + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SIMPLE_TALK: talker: %s (GuidLow: %u), textGroupId: %u", + (*itr)->GetName(), (*itr)->GetGUIDLow(), uint8(e.action.talk.textGroupID)); } - break; + + delete targets; } + break; + } case SMART_ACTION_PLAY_EMOTE: + { + ObjectList* targets = GetTargets(e, unit); + if (targets) { - ObjectList* targets = GetTargets(e, unit); - if (targets) - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); itr++) - if (IsUnit((*itr))) - (*itr)->ToUnit()->HandleEmoteCommand(e.action.emote.emote); - break; + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + if (IsUnit((*itr))) + { + (*itr)->ToUnit()->HandleEmoteCommand(e.action.emote.emote); + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_PLAY_EMOTE: target: %s (GuidLow: %u), emote: %u", + (*itr)->GetName(), (*itr)->GetGUIDLow(), e.action.emote.emote); + } + + delete targets; } + break; + } case SMART_ACTION_SOUND: + { + ObjectList* targets = GetTargets(e, unit); + if (targets) { - ObjectList* targets = GetTargets(e, unit); - if (targets) - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); itr++) - if (IsCreature((*itr))) - sCreatureTextMgr->SendSound((*itr)->ToCreature(), e.action.sound.sound, CHAT_TYPE_SAY, 0, TextRange(e.action.sound.range), Team(NULL), false); - break; + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + { + if (IsCreature((*itr))) + { + sCreatureTextMgr->SendSound((*itr)->ToCreature(), e.action.sound.sound, CHAT_TYPE_SAY, 0, TextRange(e.action.sound.range), Team(NULL), false); + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SOUND: source: %s (GuidLow: %u), sound: %u, range: %u", + (*itr)->GetName(), (*itr)->GetGUIDLow(), e.action.sound.sound, e.action.sound.range); + } + } + + delete targets; } + break; + } case SMART_ACTION_SET_FACTION: { ObjectList* targets = GetTargets(e, unit); if (targets) { - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); itr++) + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { if (IsCreature((*itr))) { if (e.action.faction.factionID) + { (*itr)->ToCreature()->setFaction(e.action.faction.factionID); + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SET_FACTION: Creature entry %u, GuidLow %u set faction to %u", + (*itr)->GetEntry(), (*itr)->GetGUIDLow(), e.action.faction.factionID); + } else { if (CreatureInfo const* ci = GetCreatureTemplateStore((*itr)->ToCreature()->GetEntry())) { if ((*itr)->ToCreature()->getFaction() != ci->faction_A) + { (*itr)->ToCreature()->setFaction(ci->faction_A); + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SET_FACTION: Creature entry %u, GuidLow %u set faction to %u", + (*itr)->GetEntry(), (*itr)->GetGUIDLow(), ci->faction_A); + } } } } } + + delete targets; } break; } case SMART_ACTION_MORPH_TO_ENTRY_OR_MODEL: { ObjectList* targets = GetTargets(e, unit); - if (!targets) return; - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); itr++) + if (!targets) + return; + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { if (!IsCreature((*itr))) continue; @@ -224,821 +270,1153 @@ void SmartScript::ProcessAction(SmartScriptHolder &e, Unit* unit, uint32 var0, u { uint32 display_id = sObjectMgr->ChooseDisplayId(0, ci); (*itr)->ToCreature()->SetDisplayId(display_id); + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_MORPH_TO_ENTRY_OR_MODEL: Creature entry %u, GuidLow %u set displayid to %u", + (*itr)->GetEntry(), (*itr)->GetGUIDLow(), display_id); } } //if no param1, then use value from param2 (modelId) else + { (*itr)->ToCreature()->SetDisplayId(e.action.morphOrMount.model); + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_MORPH_TO_ENTRY_OR_MODEL: Creature entry %u, GuidLow %u set displayid to %u", + (*itr)->GetEntry(), (*itr)->GetGUIDLow(), e.action.morphOrMount.model); + } } else + { (*itr)->ToCreature()->DeMorph(); + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_MORPH_TO_ENTRY_OR_MODEL: Creature entry %u, GuidLow %u demorphs.", + (*itr)->GetEntry(), (*itr)->GetGUIDLow()); + } } + + delete targets; break; } case SMART_ACTION_FAIL_QUEST: { ObjectList* targets = GetTargets(e, unit); - if (!targets) return; - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); itr++) + if (!targets) + return; + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { if (IsPlayer((*itr))) + { (*itr)->ToPlayer()->FailQuest(e.action.quest.quest); + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_FAIL_QUEST: Player guidLow %u fails quest %u", + (*itr)->GetGUIDLow(), e.action.quest.quest); + } } + + delete targets; break; } case SMART_ACTION_ADD_QUEST: { ObjectList* targets = GetTargets(e, unit); - if (!targets) return; - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); itr++) + if (!targets) + return; + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { if (IsPlayer((*itr))) if (const Quest* q = sObjectMgr->GetQuestTemplate(e.action.quest.quest)) + { (*itr)->ToPlayer()->AddQuest(q, NULL); + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_ADD_QUEST: Player guidLow %u add quest %u", + (*itr)->GetGUIDLow(), e.action.quest.quest); + } } + + delete targets; break; } case SMART_ACTION_SET_REACT_STATE: { - if (!me) return; + if (!me) + return; + me->SetReactState(ReactStates(e.action.react.state)); + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SET_REACT_STATE: Creature guidLow %u set reactstate %u", + me->GetGUIDLow(), e.action.react.state); break; } case SMART_ACTION_RANDOM_EMOTE: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + return; + uint32 emotes[SMART_ACTION_PARAM_COUNT]; + emotes[0] = e.action.randomEmote.emote1; + emotes[1] = e.action.randomEmote.emote2; + emotes[2] = e.action.randomEmote.emote3; + emotes[3] = e.action.randomEmote.emote4; + emotes[4] = e.action.randomEmote.emote5; + emotes[5] = e.action.randomEmote.emote6; + uint32 temp[SMART_ACTION_PARAM_COUNT]; + uint32 count = 0; + for (uint8 i = 0; i < SMART_ACTION_PARAM_COUNT; i++) + { + if (emotes[i]) + { + temp[count] = emotes[i]; + count++; + } + } + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { - ObjectList* targets = GetTargets(e, unit); - if (!targets) return; - uint32 emotes[SMART_ACTION_PARAM_COUNT]; - emotes[0] = e.action.randomEmote.emote1; - emotes[1] = e.action.randomEmote.emote2; - emotes[2] = e.action.randomEmote.emote3; - emotes[3] = e.action.randomEmote.emote4; - emotes[4] = e.action.randomEmote.emote5; - emotes[5] = e.action.randomEmote.emote6; - uint32 temp[SMART_ACTION_PARAM_COUNT]; - uint32 count = 0; - for (uint8 i = 0; i < SMART_ACTION_PARAM_COUNT; i++) + if (IsUnit((*itr))) { - if (emotes[i]) - { - temp[count] = emotes[i]; - count++; - } + uint32 emote = temp[urand(0, count)]; + (*itr)->ToUnit()->HandleEmoteCommand(emote); + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_RANDOM_EMOTE: Creature guidLow %u handle random emote %u", + (*itr)->GetGUIDLow(), emote); } - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); itr++) - if (IsUnit((*itr))) - (*itr)->ToUnit()->HandleEmoteCommand(temp[urand(0, count)]); - break; } + + delete targets; + break; + } case SMART_ACTION_THREAT_ALL_PCT: { - if (!me) return; - std::list& threatList = me->getThreatManager().getThreatList(); - for (std::list::iterator i = threatList.begin(); i != threatList.end(); ++i) - if (Unit* Temp = Unit::GetUnit(*me,(*i)->getUnitGuid())) + if (!me) + return; + + std::list const& threatList = me->getThreatManager().getThreatList(); + for (std::list::const_iterator i = threatList.begin(); i != threatList.end(); ++i) + { + if (Unit* Temp = Unit::GetUnit(*me, (*i)->getUnitGuid())) + { me->getThreatManager().modifyThreatPercent(Temp, e.action.threatPCT.threatINC ? (int32)e.action.threatPCT.threatINC : -(int32)e.action.threatPCT.threatDEC); + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_THREAT_ALL_PCT: Creature guidLow %u modify threat for unit %u, value %i", + me->GetGUIDLow(), Temp->GetGUIDLow(), e.action.threatPCT.threatINC ? (int32)e.action.threatPCT.threatINC : -(int32)e.action.threatPCT.threatDEC); + } + } break; } case SMART_ACTION_THREAT_SINGLE_PCT: { - if (!me) return; + if (!me) + return; + ObjectList* targets = GetTargets(e, unit); - if (!targets) return; - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); itr++) + if (!targets) + return; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + { if (IsUnit((*itr))) + { me->getThreatManager().modifyThreatPercent((*itr)->ToUnit(), e.action.threatPCT.threatINC ? (int32)e.action.threatPCT.threatINC : -(int32)e.action.threatPCT.threatDEC); + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_THREAT_SINGLE_PCT: Creature guidLow %u modify threat for unit %u, value %i", + me->GetGUIDLow(), (*itr)->GetGUIDLow(), e.action.threatPCT.threatINC ? (int32)e.action.threatPCT.threatINC : -(int32)e.action.threatPCT.threatDEC); + } + } + + delete targets; break; } case SMART_ACTION_CALL_AREAEXPLOREDOREVENTHAPPENS: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + return; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { - //if (!me) return; - ObjectList* targets = GetTargets(e, unit); - if (!targets) return; - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); itr++) - if (IsPlayer((*itr))) - (*itr)->ToPlayer()->AreaExploredOrEventHappens(e.action.quest.quest); - break; + if (IsPlayer((*itr))) + { + (*itr)->ToPlayer()->AreaExploredOrEventHappens(e.action.quest.quest); + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_CALL_AREAEXPLOREDOREVENTHAPPENS: Player guidLow %u credited quest %u", + (*itr)->GetGUIDLow(), e.action.quest.quest); + } } + + delete targets; + break; + } case SMART_ACTION_SEND_CASTCREATUREORGO: + { + if (!GetBaseObject()) + return; + + ObjectList* targets = GetTargets(e, unit); + if (!targets) + return; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { - if (!GetBaseObject()) return; - ObjectList* targets = GetTargets(e, unit); - if (!targets) return; - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); itr++) - if (IsPlayer((*itr))) - (*itr)->ToPlayer()->CastedCreatureOrGO(e.action.castedCreatureOrGO.creature, GetBaseObject()->GetGUID(), e.action.castedCreatureOrGO.spell); - break; + if (IsPlayer((*itr))) + { + (*itr)->ToPlayer()->CastedCreatureOrGO(e.action.castedCreatureOrGO.creature, GetBaseObject()->GetGUID(), e.action.castedCreatureOrGO.spell); + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SEND_CASTCREATUREORGO: Player guidLow %u.org Creature: %u, BaseObject GUID: "UI64FMTD" , Spell: %u", + e.action.castedCreatureOrGO.creature, GetBaseObject()->GetGUID(), e.action.castedCreatureOrGO.spell); + } } + + delete targets; + break; + } case SMART_ACTION_CAST: + { + if (!me) + return; + + ObjectList* targets = GetTargets(e, unit); + if (!targets) + return; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { - if (!me) return; - ObjectList* targets = GetTargets(e, unit); - if (!targets) return; - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); itr++) - if (IsUnit((*itr))) - { - if (e.action.cast.flags & SMARTCAST_INTERRUPT_PREVIOUS) - me->InterruptNonMeleeSpells(false); - me->CastSpell((*itr)->ToUnit(), e.action.cast.spell,(e.action.cast.flags & SMARTCAST_TRIGGERED) ? true : false); - } - break; + if (IsUnit((*itr))) + { + if (e.action.cast.flags & SMARTCAST_INTERRUPT_PREVIOUS) + me->InterruptNonMeleeSpells(false); + + me->CastSpell((*itr)->ToUnit(), e.action.cast.spell, (e.action.cast.flags & SMARTCAST_TRIGGERED) ? true : false); + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_CAST:: Creature %u casts spell %u on target %u with castflags %u", + me->GetGUIDLow(), e.action.cast.spell, (*itr)->GetGUIDLow(), e.action.cast.flags); + } } + + delete targets; + break; + } case SMART_ACTION_INVOKER_CAST: + { + Unit* tempLastInvoker = GetLastInvoker(); + if (!tempLastInvoker) + return; + + ObjectList* targets = GetTargets(e, unit); + if (!targets) + return; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { - if (!mLastInvoker) return; - ObjectList* targets = GetTargets(e, unit); - if (!targets) return; - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); itr++) - if (IsUnit((*itr))) - { - if (e.action.cast.flags & SMARTCAST_INTERRUPT_PREVIOUS) - mLastInvoker->InterruptNonMeleeSpells(false); - mLastInvoker->CastSpell((*itr)->ToUnit(), e.action.cast.spell,(e.action.cast.flags & SMARTCAST_TRIGGERED) ? true : false); - } - break; + if (IsUnit((*itr))) + { + if (e.action.cast.flags & SMARTCAST_INTERRUPT_PREVIOUS) + tempLastInvoker->InterruptNonMeleeSpells(false); + + tempLastInvoker->CastSpell((*itr)->ToUnit(), e.action.cast.spell, (e.action.cast.flags & SMARTCAST_TRIGGERED) ? true : false); + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_INVOKER_CAST: Invoker %u casts spell % on target %u with castflags %u", + tempLastInvoker->GetGUIDLow(), (*itr)->GetGUIDLow(), e.action.cast.spell, e.action.cast.flags); + } } + + delete targets; + break; + } case SMART_ACTION_ADD_AURA: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + return; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { - ObjectList* targets = GetTargets(e, unit); - if (!targets) return; - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); itr++) - if (IsUnit((*itr))) - { - (*itr)->ToUnit()->AddAura(e.action.cast.spell, (*itr)->ToUnit()); - } - break; + if (IsUnit((*itr))) + { + (*itr)->ToUnit()->AddAura(e.action.cast.spell, (*itr)->ToUnit()); + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_ADD_AURA: Adding aura %u to unit %u", + e.action.cast.spell, (*itr)->GetGUIDLow()); + } } + + delete targets; + break; + } case SMART_ACTION_ACTIVATE_GOBJECT: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + return; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { - ObjectList* targets = GetTargets(e, unit); - if (!targets) return; - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); itr++) - if (IsGameObject((*itr))) - { - // Activate - (*itr)->ToGameObject()->SetLootState(GO_READY); - (*itr)->ToGameObject()->UseDoorOrButton(); - } - break; + if (IsGameObject((*itr))) + { + // Activate + (*itr)->ToGameObject()->SetLootState(GO_READY); + (*itr)->ToGameObject()->UseDoorOrButton(); + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_ACTIVATE_GOBJECT. Gameobject %u (entry: %u) activated", + (*itr)->GetGUIDLow(), (*itr)->GetEntry()); + } } + + delete targets; + break; + } case SMART_ACTION_RESET_GOBJECT: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + return; + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { - ObjectList* targets = GetTargets(e, unit); - if (!targets) return; - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); itr++) - if (IsGameObject((*itr))) - (*itr)->ToGameObject()->ResetDoorOrButton(); - break; + if (IsGameObject((*itr))) + { + (*itr)->ToGameObject()->ResetDoorOrButton(); + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_RESET_GOBJECT. Gameobject %u (entry: %u) reset", + (*itr)->GetGUIDLow(), (*itr)->GetEntry()); + } } + + delete targets; + break; + } case SMART_ACTION_SET_EMOTE_STATE: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + return; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { - ObjectList* targets = GetTargets(e, unit); - if (!targets) return; - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); itr++) - if (IsUnit((*itr))) - (*itr)->ToUnit()->SetUInt32Value(UNIT_NPC_EMOTESTATE, e.action.emote.emote); - break; + if (IsUnit((*itr))) + { + (*itr)->ToUnit()->SetUInt32Value(UNIT_NPC_EMOTESTATE, e.action.emote.emote); + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SET_EMOTE_STATE. Unit %u set emotestate to %u", + (*itr)->GetGUIDLow(), e.action.emote.emote); + } } + + delete targets; + break; + } case SMART_ACTION_SET_UNIT_FLAG: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + return; + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { - ObjectList* targets = GetTargets(e, unit); - if (!targets) return; - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); itr++) - if (IsUnit((*itr))) - (*itr)->ToUnit()->SetFlag(UNIT_FIELD_FLAGS, e.action.unitFlag.flag); - break; + if (IsUnit((*itr))) + { + (*itr)->ToUnit()->SetFlag(UNIT_FIELD_FLAGS, e.action.unitFlag.flag); + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SET_UNIT_FLAG. Unit %u added flag %u to UNIT_FIELD_FLAGS", + (*itr)->GetGUIDLow(), e.action.unitFlag.flag); + } } + + delete targets; + break; + } case SMART_ACTION_REMOVE_UNIT_FLAG: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + return; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { - ObjectList* targets = GetTargets(e, unit); - if (!targets) return; - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); itr++) - if (IsUnit((*itr))) - (*itr)->ToUnit()->RemoveFlag(UNIT_FIELD_FLAGS, e.action.unitFlag.flag); - break; + if (IsUnit((*itr))) + { + (*itr)->ToUnit()->RemoveFlag(UNIT_FIELD_FLAGS, e.action.unitFlag.flag); + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_REMOVE_UNIT_FLAG. Unit %u removed flag %u to UNIT_FIELD_FLAGS", + (*itr)->GetGUIDLow(), e.action.unitFlag.flag); + } } + + delete targets; + break; + } case SMART_ACTION_AUTO_ATTACK: - { - if (!IsSmart()) return; - CAST_AI(SmartAI, me->AI())->SetAutoAttack(e.action.autoAttack.attack ? true : false); - break; - } + { + if (!IsSmart()) + return; + + CAST_AI(SmartAI, me->AI())->SetAutoAttack(e.action.autoAttack.attack ? true : false); + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_AUTO_ATTACK: Creature: %u bool on = %u", + me->GetGUIDLow(), e.action.autoAttack.attack); + break; + } case SMART_ACTION_ALLOW_COMBAT_MOVEMENT: - { - if (!IsSmart()) return; - bool move = e.action.combatMove.move ? true : false; - CAST_AI(SmartAI, me->AI())->SetCombatMove(move); - break; - } + { + if (!IsSmart()) + return; + + bool move = e.action.combatMove.move ? true : false; + CAST_AI(SmartAI, me->AI())->SetCombatMove(move); + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_ALLOW_COMBAT_MOVEMENT: Creature %u bool on = %u", + me->GetGUIDLow(), e.action.combatMove.move); + break; + } case SMART_ACTION_SET_EVENT_PHASE: - { - SetPhase(e.action.setEventPhase.phase); - break; - } + { + SetPhase(e.action.setEventPhase.phase); + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SET_EVENT_PHASE: Creature %u set event phase %u", + me->GetGUIDLow(), e.action.setEventPhase.phase); + break; + } case SMART_ACTION_INC_EVENT_PHASE: - { - IncPhase(e.action.incEventPhase.inc); - DecPhase(e.action.incEventPhase.dec); - break; - } + { + IncPhase(e.action.incEventPhase.inc); + DecPhase(e.action.incEventPhase.dec); + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_INC_EVENT_PHASE: Creature %u inc event phase by %u, " + "decrease by %u", me->GetGUIDLow(), e.action.incEventPhase.inc, e.action.incEventPhase.dec); + break; + } case SMART_ACTION_EVADE: - { - if (me) me->AI()->EnterEvadeMode(); + { + if (!me) return; - } + + me->AI()->EnterEvadeMode(); + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_EVADE: Creature %u EnterEvadeMode", me->GetGUIDLow()); + return; + } case SMART_ACTION_FLEE_FOR_ASSIST: - { - if (me) me->DoFleeToGetAssistance(); - break; - } + { + if (!me) + return; + + me->DoFleeToGetAssistance(); + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_FLEE_FOR_ASSIST: Creature %u DoFleeToGetAssistance", me->GetGUIDLow()); + break; + } case SMART_ACTION_CALL_GROUPEVENTHAPPENS: + { + if (IsPlayer(unit) && GetBaseObject()) { - if (IsPlayer(unit) && GetBaseObject()) - unit->ToPlayer()->GroupEventHappens(e.action.quest.quest, GetBaseObject()); - break; + unit->ToPlayer()->GroupEventHappens(e.action.quest.quest, GetBaseObject()); + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_CALL_GROUPEVENTHAPPENS: Player %u, group credit for quest %u", + unit->GetGUIDLow(), e.action.quest.quest); } + break; + } case SMART_ACTION_CALL_CASTEDCREATUREORGO: + { + if (!GetBaseObject()) + return; + + ObjectList* targets = GetTargets(e, unit); + if (!targets) + return; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { - if (!GetBaseObject()) return; - ObjectList* targets = GetTargets(e, unit); - if (!targets) return; - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); itr++) + if (IsPlayer((*itr))) { - if (IsPlayer((*itr))) - (*itr)->ToPlayer()->CastedCreatureOrGO(e.action.castedCreatureOrGO.creature, GetBaseObject()->GetGUID(), e.action.castedCreatureOrGO.spell); + (*itr)->ToPlayer()->CastedCreatureOrGO(e.action.castedCreatureOrGO.creature, GetBaseObject()->GetGUID(), e.action.castedCreatureOrGO.spell); + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_CALL_CASTEDCREATUREORGO: Player %u, target %u, spell %u", + (*itr)->GetGUIDLow(), e.action.castedCreatureOrGO.creature, e.action.castedCreatureOrGO.spell); } - break; } + + delete targets; + break; + } case SMART_ACTION_REMOVEAURASFROMSPELL: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + return; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { - ObjectList* targets = GetTargets(e, unit); - if (!targets) return; - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); itr++) - { - if(!IsUnit((*itr))) continue; - (*itr)->ToUnit()->RemoveAurasDueToSpell(e.action.removeAura.spell); - } - break; + if (!IsUnit((*itr))) + continue; + + (*itr)->ToUnit()->RemoveAurasDueToSpell(e.action.removeAura.spell); + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_REMOVEAURASFROMSPELL: Unit %u, spell %u", + (*itr)->GetGUIDLow(), e.action.removeAura.spell); } + + delete targets; + break; + } case SMART_ACTION_FOLLOW: + { + if (!IsSmart()) + return; + + ObjectList* targets = GetTargets(e, unit); + if (!targets) + return; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { - if (!IsSmart()) return; - ObjectList* targets = GetTargets(e, unit); - if (!targets) return; - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); itr++) + if (IsUnit((*itr))) { - if (IsUnit((*itr))) - { - CAST_AI(SmartAI, me->AI())->SetFollow((*itr)->ToUnit(), (float)e.action.follow.dist, (float)e.action.follow.angle, e.action.follow.credit, e.action.follow.entry, e.action.follow.creditType); - return; - } + CAST_AI(SmartAI, me->AI())->SetFollow((*itr)->ToUnit(), (float)e.action.follow.dist, (float)e.action.follow.angle, e.action.follow.credit, e.action.follow.entry, e.action.follow.creditType); + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_FOLLOW: Creature %u following target %u", + me->GetGUIDLow(), (*itr)->GetGUIDLow()); + return; } - break; } + + delete targets; + break; + } case SMART_ACTION_RANDOM_PHASE: - { - uint32 phases[SMART_ACTION_PARAM_COUNT]; - phases[0] = e.action.randomEmote.emote1; - phases[1] = e.action.randomEmote.emote2; - phases[2] = e.action.randomEmote.emote3; - phases[3] = e.action.randomEmote.emote4; - phases[4] = e.action.randomEmote.emote5; - phases[5] = e.action.randomEmote.emote6; - uint32 temp[SMART_ACTION_PARAM_COUNT]; - uint32 count = 0; - for (uint8 i = 0; i < SMART_ACTION_PARAM_COUNT; i++) + { + uint32 phases[SMART_ACTION_PARAM_COUNT]; + phases[0] = e.action.randomPhase.phase1; + phases[1] = e.action.randomPhase.phase2; + phases[2] = e.action.randomPhase.phase3; + phases[3] = e.action.randomPhase.phase4; + phases[4] = e.action.randomPhase.phase5; + phases[5] = e.action.randomPhase.phase6; + uint32 temp[SMART_ACTION_PARAM_COUNT]; + uint32 count = 0; + for (uint8 i = 0; i < SMART_ACTION_PARAM_COUNT; i++) + { + if (phases[i] > 0) { - if (phases[i] > 0) - { - temp[count] = phases[i]; - count++; - } + temp[count] = phases[i]; + count++; } - SetPhase(temp[urand(0, count)]); - break; } + + uint32 phase = temp[urand(0, count)]; + SetPhase(phase); + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_RANDOM_PHASE: Creature %u sets event phase to %u", + me->GetGUIDLow(), phase); + break; + } case SMART_ACTION_RANDOM_PHASE_RANGE: - { - SetPhase(urand(e.action.randomPhaseRange.phaseMin, e.action.randomPhaseRange.phaseMax)); - break; - } + { + uint32 phase = urand(e.action.randomPhaseRange.phaseMin, e.action.randomPhaseRange.phaseMax); + SetPhase(phase); + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_RANDOM_PHASE_RANGE: Creature %u sets event phase to %u", + me->GetGUIDLow(), phase); + break; + } case SMART_ACTION_CALL_KILLEDMONSTER: + { + Player* pPlayer = NULL; + if (me) + pPlayer = me->GetLootRecipient(); + + if (me && pPlayer) + pPlayer->RewardPlayerAndGroupAtEvent(e.action.killedMonster.creature, pPlayer); + + else if (GetBaseObject()) { - Player* pPlayer = NULL; - if (me) - pPlayer = me->GetLootRecipient(); - if (me && pPlayer) - pPlayer->RewardPlayerAndGroupAtEvent(e.action.killedMonster.creature, pPlayer); - else if (GetBaseObject()) - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) return; - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); itr++) - { - if(!IsPlayer((*itr))) continue; - (*itr)->ToPlayer()->RewardPlayerAndGroupAtEvent(e.action.killedMonster.creature, (*itr)->ToPlayer()); - } - }else if (trigger && IsPlayer(unit)) + ObjectList* targets = GetTargets(e, unit); + if (!targets) + return; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { - unit->ToPlayer()->RewardPlayerAndGroupAtEvent(e.action.killedMonster.creature, unit); + if (!IsPlayer((*itr))) + continue; + + (*itr)->ToPlayer()->RewardPlayerAndGroupAtEvent(e.action.killedMonster.creature, (*itr)->ToPlayer()); + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_CALL_KILLEDMONSTER: Player %u, Killcredit: %u", + (*itr)->GetGUIDLow(), e.action.killedMonster.creature); } - break; + + delete targets; + } + else if (trigger && IsPlayer(unit)) + { + unit->ToPlayer()->RewardPlayerAndGroupAtEvent(e.action.killedMonster.creature, unit); + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_CALL_KILLEDMONSTER: (trigger == true) Player %u, Killcredit: %u", + unit->GetGUIDLow(), e.action.killedMonster.creature); } + break; + } case SMART_ACTION_SET_INST_DATA: + { + WorldObject* obj = GetBaseObject(); + if (!obj) + obj = unit; + + if (!obj) + return; + + InstanceScript* pInst = (InstanceScript*)obj->GetInstanceScript(); + if (!pInst) { - WorldObject* obj = GetBaseObject(); - if (!obj) - obj = unit; - if (!obj) - return; - InstanceScript* pInst = (InstanceScript*)obj->GetInstanceScript(); - if (!pInst) - { - sLog->outErrorDb("SmartScript: Event %u attempt to set instance data without instance script. EntryOrGuid %d", e.GetEventType(), e.entryOrGuid); - return; - } - pInst->SetData(e.action.setInstanceData.field, e.action.setInstanceData.data); - break; + sLog->outErrorDb("SmartScript: Event %u attempt to set instance data without instance script. EntryOrGuid %d", e.GetEventType(), e.entryOrGuid); + return; } + + pInst->SetData(e.action.setInstanceData.field, e.action.setInstanceData.data); + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_SET_INST_DATA: Field: %u, data: %u", + e.action.setInstanceData.field, e.action.setInstanceData.data); + break; + } case SMART_ACTION_SET_INST_DATA64: - { - WorldObject* obj = GetBaseObject(); - if (!obj) - obj = unit; - if (!obj) - return; - InstanceScript* pInst = (InstanceScript*)obj->GetInstanceScript(); - if (!pInst) - { - sLog->outErrorDb("SmartScript: Event %u attempt to set instance data without instance script. EntryOrGuid %d", e.GetEventType(), e.entryOrGuid); - return; - } - ObjectList* targets = GetTargets(e, unit); - if (!targets) return; - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); itr++) - { - pInst->SetData64(e.action.setInstanceData64.field, (*itr)->GetGUID()); - return; - } + { + WorldObject* obj = GetBaseObject(); + if (!obj) + obj = unit; - break; - } - case SMART_ACTION_UPDATE_TEMPLATE: + if (!obj) + return; + + InstanceScript* pInst = (InstanceScript*)obj->GetInstanceScript(); + if (!pInst) { - if (!me || me->GetEntry() == e.action.updateTemplate.creature) - return; - me->UpdateEntry(e.action.updateTemplate.creature, e.action.updateTemplate.team ? HORDE : ALLIANCE); - break; + sLog->outErrorDb("SmartScript: Event %u attempt to set instance data without instance script. EntryOrGuid %d", e.GetEventType(), e.entryOrGuid); + return; } + + ObjectList* targets = GetTargets(e, unit); + if (!targets) + return; + + pInst->SetData64(e.action.setInstanceData64.field, targets->front()->GetGUID()); + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_SET_INST_DATA64: Field: %u, data: "UI64FMTD, + e.action.setInstanceData64.field, targets->front()->GetGUID()); + + delete targets; + break; + } + case SMART_ACTION_UPDATE_TEMPLATE: + { + if (!me || me->GetEntry() == e.action.updateTemplate.creature) + return; + + me->UpdateEntry(e.action.updateTemplate.creature, e.action.updateTemplate.team ? HORDE : ALLIANCE); + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_UPDATE_TEMPLATE: Creature %u, Template: %u, Team: %u", + me->GetGUIDLow(), e.action.updateTemplate.team ? HORDE : ALLIANCE); + break; + } case SMART_ACTION_DIE: + { + if (me && !me->isDead()) { - if (me && !me->isDead()) - me->Kill(me); - break; + me->Kill(me); + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_DIE: Creature %u", me->GetGUIDLow()); } + break; + } case SMART_ACTION_SET_IN_COMBAT_WITH_ZONE: + { + if (me) { - if (me) - me->SetInCombatWithZone(); - break; + me->SetInCombatWithZone(); + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_SET_IN_COMBAT_WITH_ZONE: Creature %u", me->GetGUIDLow()); } + break; + } case SMART_ACTION_CALL_FOR_HELP: + { + if (me) { - if (me) - me->CallForHelp((float)e.action.callHelp.range); - break; + me->CallForHelp((float)e.action.callHelp.range); + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_CALL_FOR_HELP: Creature %u", me->GetGUIDLow()); } + break; + } case SMART_ACTION_SET_SHEATH: + { + if (me) { - if (me) - me->SetSheath(SheathState(e.action.setSheath.sheath)); - break; + me->SetSheath(SheathState(e.action.setSheath.sheath)); + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_SET_SHEATH: Creature %u, State: %u", + me->GetGUIDLow(), e.action.setSheath.sheath); } + break; + } case SMART_ACTION_FORCE_DESPAWN: - { - if (!IsSmart()) return; - CAST_AI(SmartAI, me->AI())->SetDespawnTime(e.action.forceDespawn.delay + 1);//next tick - CAST_AI(SmartAI, me->AI())->StartDespawn(); - break; - } + { + if (!IsSmart()) + return; + CAST_AI(SmartAI, me->AI())->SetDespawnTime(e.action.forceDespawn.delay + 1);//next tick + CAST_AI(SmartAI, me->AI())->StartDespawn(); + break; + } case SMART_ACTION_SET_INGAME_PHASE_MASK: - { - if (GetBaseObject()) - GetBaseObject()->SetPhaseMask(e.action.ingamePhaseMask.mask, true); - break; - } + { + if (GetBaseObject()) + GetBaseObject()->SetPhaseMask(e.action.ingamePhaseMask.mask, true); + break; + } case SMART_ACTION_MOUNT_TO_ENTRY_OR_MODEL: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + return; + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { - ObjectList* targets = GetTargets(e, unit); - if (!targets) return; - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); itr++) + if(!IsUnit((*itr))) continue; + if (e.action.morphOrMount.creature || e.action.morphOrMount.model) { - if(!IsUnit((*itr))) continue; - if (e.action.morphOrMount.creature || e.action.morphOrMount.model) + if (e.action.morphOrMount.creature > 0) { - if (e.action.morphOrMount.creature > 0) + if (CreatureInfo const* cInfo = GetCreatureTemplateStore(e.action.morphOrMount.creature)) { - if (CreatureInfo const* cInfo = GetCreatureTemplateStore(e.action.morphOrMount.creature)) - { - uint32 display_id = sObjectMgr->ChooseDisplayId(0, cInfo); - (*itr)->ToUnit()->Mount(display_id); - } + uint32 display_id = sObjectMgr->ChooseDisplayId(0, cInfo); + (*itr)->ToUnit()->Mount(display_id); } - else - (*itr)->ToUnit()->Mount(e.action.morphOrMount.model); } else - (*itr)->ToUnit()->Unmount(); + (*itr)->ToUnit()->Mount(e.action.morphOrMount.model); } - break; - } - case SMART_ACTION_SET_INVINCIBILITY_HP_LEVEL: - { - if (!GetBaseObject()) return; - if (e.action.invincHP.minHP) - mInvinceabilityHpLevel = me->CountPctFromMaxHealth(e.action.invincHP.minHP); else - mInvinceabilityHpLevel = e.action.invincHP.minHP; - break; + (*itr)->ToUnit()->Unmount(); } + + delete targets; + break; + } + case SMART_ACTION_SET_INVINCIBILITY_HP_LEVEL: + { + if (!GetBaseObject()) + return; + if (e.action.invincHP.percent) + mInvinceabilityHpLevel = me->CountPctFromMaxHealth(e.action.invincHP.percent); + else + mInvinceabilityHpLevel = e.action.invincHP.minHP; + break; + } case SMART_ACTION_SET_DATA: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + return; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { - ObjectList* targets = GetTargets(e, unit); - if (!targets) return; - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); itr++) - { - if (IsCreature((*itr))) - (*itr)->ToCreature()->AI()->SetData(e.action.setData.field, e.action.setData.data); - if (IsGameObject((*itr))) - (*itr)->ToGameObject()->AI()->SetData(e.action.setData.field, e.action.setData.data); - return; - } - break; + if (IsCreature(*itr)) + (*itr)->ToCreature()->AI()->SetData(e.action.setData.field, e.action.setData.data); + else if (IsGameObject(*itr)) + (*itr)->ToGameObject()->AI()->SetData(e.action.setData.field, e.action.setData.data); } + + delete targets; + break; + } case SMART_ACTION_MOVE_FORWARD: - { - if (!me) return; - float x,y,z; - me->GetClosePoint(x, y, z, me->GetObjectSize() / 3, (float)e.action.moveRandom.distance); - me->GetMotionMaster()->MovePoint(SMART_RANDOM_POINT,x,y,z); - break; - } + { + if (!me) + return; + float x, y, z; + me->GetClosePoint(x, y, z, me->GetObjectSize() / 3, (float)e.action.moveRandom.distance); + me->GetMotionMaster()->MovePoint(SMART_RANDOM_POINT, x, y, z); + break; + } case SMART_ACTION_SET_VISIBILITY: - { - if (me) - me->SetVisible(e.action.visibility.state ? true : false); - break; - } + { + if (me) + me->SetVisible(e.action.visibility.state ? true : false); + break; + } case SMART_ACTION_SET_ACTIVE: - { - if (GetBaseObject()) - GetBaseObject()->setActive(true); - break; - } + { + if (GetBaseObject()) + GetBaseObject()->setActive(true); + break; + } case SMART_ACTION_ATTACK_START: + { + if (!me) + return; + + ObjectList* targets = GetTargets(e, unit); + if (!targets) + return; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { - if (!me) return; - ObjectList* targets = GetTargets(e, unit); - if (!targets) return; - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); itr++) + if (IsUnit(*itr)) { - if (IsUnit((*itr))) - me->AI()->AttackStart((*itr)->ToUnit()); + me->AI()->AttackStart((*itr)->ToUnit()); + delete targets; return; } - break; } + break; + } case SMART_ACTION_SUMMON_CREATURE: + { + WorldObject* obj = GetBaseObject(); + if (!obj) + obj = unit; + float x, y, z, o; + ObjectList* targets = GetTargets(e, unit); + if (targets) { - WorldObject* obj = GetBaseObject(); - if (!obj) - obj = unit; - float x,y,z,o;; - ObjectList* targets = GetTargets(e, unit); - if (targets) + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); itr++) - { - if(!IsUnit((*itr))) continue; - (*itr)->GetPosition(x,y,z,o); - if (Creature* summon = GetBaseObject()->SummonCreature(e.action.summonCreature.creature, x, y, z, o, (TempSummonType)e.action.summonCreature.type, e.action.summonCreature.duration)) - { - if (unit && e.action.summonCreature.attackInvoker) - { - summon->AI()->AttackStart((*itr)->ToUnit()); - } - } - } - } - if (e.GetTargetType() != SMART_TARGET_POSITION) - return; - if (Creature* summon = GetBaseObject()->SummonCreature(e.action.summonCreature.creature, e.target.x, e.target.y, e.target.z, e.target.o, (TempSummonType)e.action.summonCreature.type, e.action.summonCreature.duration)) - { - if (unit && e.action.summonCreature.attackInvoker) - summon->AI()->AttackStart(unit); + if (!IsUnit(*itr)) + continue; + + (*itr)->GetPosition(x, y, z, o); + if (Creature* summon = GetBaseObject()->SummonCreature(e.action.summonCreature.creature, x, y, z, o, (TempSummonType)e.action.summonCreature.type, e.action.summonCreature.duration)) + if (unit && e.action.summonCreature.attackInvoker) + summon->AI()->AttackStart((*itr)->ToUnit()); } - break; + + delete targets; } + + if (e.GetTargetType() != SMART_TARGET_POSITION) + return; + + if (Creature* summon = GetBaseObject()->SummonCreature(e.action.summonCreature.creature, e.target.x, e.target.y, e.target.z, e.target.o, (TempSummonType)e.action.summonCreature.type, e.action.summonCreature.duration)) + if (unit && e.action.summonCreature.attackInvoker) + summon->AI()->AttackStart(unit); + break; + } case SMART_ACTION_SUMMON_GO: + { + if (!GetBaseObject()) + return; + + float x, y, z, o; + ObjectList* targets = GetTargets(e, unit); + if (targets) { - if (!GetBaseObject()) return; - float x,y,z,o; - ObjectList* targets = GetTargets(e, unit); - if (targets) + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); itr++) - { - if(!IsUnit((*itr))) continue; - (*itr)->GetPosition(x,y,z,o); - GetBaseObject()->SummonGameObject(e.action.summonGO.entry, x, y, z, o, 0, 0, 0, 0, e.action.summonGO.despawnTime); - } + if (!IsUnit(*itr)) + continue; + + (*itr)->GetPosition(x, y, z, o); + GetBaseObject()->SummonGameObject(e.action.summonGO.entry, x, y, z, o, 0, 0, 0, 0, e.action.summonGO.despawnTime); } - if (e.GetTargetType() != SMART_TARGET_POSITION) - return; - GetBaseObject()->SummonGameObject(e.action.summonGO.entry, e.target.x, e.target.y, e.target.z, e.target.o, 0, 0, 0, 0, e.action.summonGO.despawnTime); - break; + + delete targets; } + + if (e.GetTargetType() != SMART_TARGET_POSITION) + return; + + GetBaseObject()->SummonGameObject(e.action.summonGO.entry, e.target.x, e.target.y, e.target.z, e.target.o, 0, 0, 0, 0, e.action.summonGO.despawnTime); + break; + } case SMART_ACTION_KILL_UNIT: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + return; + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { - ObjectList* targets = GetTargets(e, unit); - if (!targets) return; - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); itr++) - { - if(!IsUnit((*itr))) continue; - (*itr)->ToUnit()->Kill((*itr)->ToUnit()); - } - break; + if (!IsUnit(*itr)) + continue; + + (*itr)->ToUnit()->Kill((*itr)->ToUnit()); } + + delete targets; + break; + } case SMART_ACTION_INSTALL_AI_TEMPLATE: - { - InstallTemplate(e); - break; - } + { + InstallTemplate(e); + break; + } case SMART_ACTION_ADD_ITEM: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + return; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { - ObjectList* targets = GetTargets(e, unit); - if (!targets) return; - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); itr++) - { - if(!IsPlayer((*itr))) continue; - (*itr)->ToPlayer()->AddItem(e.action.item.entry, e.action.item.count); - } - break; + if (!IsPlayer(*itr)) + continue; + + (*itr)->ToPlayer()->AddItem(e.action.item.entry, e.action.item.count); } + + delete targets; + break; + } case SMART_ACTION_REMOVE_ITEM: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + return; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { - ObjectList* targets = GetTargets(e, unit); - if (!targets) return; - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); itr++) - { - if(!IsPlayer((*itr))) continue; - (*itr)->ToPlayer()->DestroyItemCount(e.action.item.entry, e.action.item.count, true); - } - break; + if (!IsPlayer(*itr)) + continue; + + (*itr)->ToPlayer()->DestroyItemCount(e.action.item.entry, e.action.item.count, true); } + + delete targets; + break; + } case SMART_ACTION_STORE_VARIABLE_DECIMAL: - { - if(mStoredDecimals.find(e.action.storeVar.id) != mStoredDecimals.end()) - mStoredDecimals.erase(e.action.storeVar.id); - mStoredDecimals[e.action.storeVar.id] = e.action.storeVar.number; - break; - } + { + if (mStoredDecimals.find(e.action.storeVar.id) != mStoredDecimals.end()) + mStoredDecimals.erase(e.action.storeVar.id); + mStoredDecimals[e.action.storeVar.id] = e.action.storeVar.number; + break; + } case SMART_ACTION_STORE_TARGET_LIST: - { - ObjectList* targets = GetTargets(e, unit); - StoreTargetList(targets, e.action.storeTargets.id); - break; - } + { + ObjectList* targets = GetTargets(e, unit); + StoreTargetList(targets, e.action.storeTargets.id); + break; + } case SMART_ACTION_TELEPORT: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + return; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { - ObjectList* targets = GetTargets(e, unit); - if (!targets) return; - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); itr++) - { - if(!IsPlayer((*itr))) continue; - (*itr)->ToPlayer()->TeleportTo(e.action.teleport.mapID, e.target.x, e.target.y, e.target.z, e.target.o); - } - break; + if (!IsPlayer(*itr)) + continue; + + (*itr)->ToPlayer()->TeleportTo(e.action.teleport.mapID, e.target.x, e.target.y, e.target.z, e.target.o); } + + delete targets; + break; + } case SMART_ACTION_SET_FLY: - { - if (!IsSmart()) return; - CAST_AI(SmartAI, me->AI())->SetFly(e.action.setFly.fly ? true : false); - break; - } + { + if (!IsSmart()) + return; + CAST_AI(SmartAI, me->AI())->SetFly(e.action.setFly.fly ? true : false); + break; + } case SMART_ACTION_SET_RUN: - { - if (!IsSmart()) return; - CAST_AI(SmartAI, me->AI())->SetRun(e.action.setRun.run ? true : false); - break; - } - + { + if (!IsSmart()) + return; + CAST_AI(SmartAI, me->AI())->SetRun(e.action.setRun.run ? true : false); + break; + } case SMART_ACTION_SET_SWIMM: - { - if (!IsSmart()) return; - CAST_AI(SmartAI, me->AI())->SetSwimm(e.action.setSwimm.swimm ? true : false); - break; - } + { + if (!IsSmart()) + return; + CAST_AI(SmartAI, me->AI())->SetSwimm(e.action.setSwimm.swimm ? true : false); + break; + } case SMART_ACTION_WP_START: - { - if (!IsSmart()) return; - bool run = e.action.wpStart.run ? true : false; - uint32 entry = e.action.wpStart.pathID; - bool repeat = e.action.wpStart.repeat ? true : false; - ObjectList* targets = GetTargets(e, unit); - StoreTargetList(targets, SMART_ESCORT_TARGETS); - me->SetReactState((ReactStates)e.action.wpStart.reactState); - CAST_AI(SmartAI, me->AI())->StartPath(run, entry, repeat, unit); - - uint32 quest = e.action.wpStart.quest; - uint32 DespawnTime = e.action.wpStart.despawnTime; - CAST_AI(SmartAI, me->AI())->mEscortQuestID = quest; - CAST_AI(SmartAI, me->AI())->SetDespawnTime(DespawnTime); - break; - } + { + if (!IsSmart()) + return; + bool run = e.action.wpStart.run ? true : false; + uint32 entry = e.action.wpStart.pathID; + bool repeat = e.action.wpStart.repeat ? true : false; + ObjectList* targets = GetTargets(e, unit); + StoreTargetList(targets, SMART_ESCORT_TARGETS); + me->SetReactState((ReactStates)e.action.wpStart.reactState); + CAST_AI(SmartAI, me->AI())->StartPath(run, entry, repeat, unit); + + uint32 quest = e.action.wpStart.quest; + uint32 DespawnTime = e.action.wpStart.despawnTime; + CAST_AI(SmartAI, me->AI())->mEscortQuestID = quest; + CAST_AI(SmartAI, me->AI())->SetDespawnTime(DespawnTime); + break; + } case SMART_ACTION_WP_PAUSE: - { - if (!IsSmart()) return; - uint32 delay = e.action.wpPause.delay; - CAST_AI(SmartAI, me->AI())->PausePath(delay, e.GetEventType() == SMART_EVENT_WAYPOINT_REACHED ? false : true); - break; - } + { + if (!IsSmart()) + return; + uint32 delay = e.action.wpPause.delay; + CAST_AI(SmartAI, me->AI())->PausePath(delay, e.GetEventType() == SMART_EVENT_WAYPOINT_REACHED ? false : true); + break; + } case SMART_ACTION_WP_STOP: - { - if (!IsSmart()) return; - uint32 DespawnTime = e.action.wpStop.despawnTime; - uint32 quest = e.action.wpStop.quest; - bool fail = e.action.wpStop.fail ? true : false; - CAST_AI(SmartAI, me->AI())->StopPath(DespawnTime, quest, fail); - break; - } + { + if (!IsSmart()) + return; + uint32 DespawnTime = e.action.wpStop.despawnTime; + uint32 quest = e.action.wpStop.quest; + bool fail = e.action.wpStop.fail ? true : false; + CAST_AI(SmartAI, me->AI())->StopPath(DespawnTime, quest, fail); + break; + } case SMART_ACTION_WP_RESUME: - { - if (!IsSmart()) return; - CAST_AI(SmartAI, me->AI())->ResumePath(); - break; - } + { + if (!IsSmart()) + return; + CAST_AI(SmartAI, me->AI())->ResumePath(); + break; + } case SMART_ACTION_SET_ORIENTATION: - { - if (!me) return; - ObjectList* targets = GetTargets(e, unit); - if (e.GetTargetType() == SMART_TARGET_SELF) - me->SetFacing(me->GetCreatureData()->orientation, NULL); - else if (e.GetTargetType() == SMART_TARGET_POSITION) - me->SetFacing(e.target.o, NULL); - else if (targets && !targets->empty()) - me->SetFacing(0, (*targets->begin())); - break; - } + { + if (!me) + return; + + ObjectList* targets = GetTargets(e, unit); + if (e.GetTargetType() == SMART_TARGET_SELF) + me->SetFacing(me->GetCreatureData()->orientation, NULL); + else if (e.GetTargetType() == SMART_TARGET_POSITION) + me->SetFacing(e.target.o, NULL); + else if (targets && !targets->empty()) + me->SetFacing(0, (*targets->begin())); + + delete targets; + break; + } case SMART_ACTION_PLAYMOVIE: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + return; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { - ObjectList* targets = GetTargets(e, unit); - if (!targets) return; - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); itr++) - { - if(!IsPlayer((*itr))) continue; - (*itr)->ToPlayer()->SendMovieStart(e.action.movie.entry); - } + if (!IsPlayer(*itr)) + continue; - break; + (*itr)->ToPlayer()->SendMovieStart(e.action.movie.entry); } + + delete targets; + break; + } case SMART_ACTION_MOVE_TO_POS: - { - if (!IsSmart()) return; - bool run = e.action.setRun.run ? true : false; - CAST_AI(SmartAI, me->AI())->SetRun(run); - me->GetMotionMaster()->MovePoint(0, e.target.x, e.target.y , e.target.z); - break; - } + { + if (!IsSmart()) + return; + bool run = e.action.setRun.run ? true : false; + CAST_AI(SmartAI, me->AI())->SetRun(run); + me->GetMotionMaster()->MovePoint(0, e.target.x, e.target.y , e.target.z); + break; + } case SMART_ACTION_RESPAWN_TARGET: { ObjectList* targets = GetTargets(e, unit); - if (!targets) return; - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); itr++) + if (!targets) + return; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { - if(IsCreature((*itr))) + if (IsCreature(*itr)) (*itr)->ToCreature()->Respawn(); - if(IsGameObject((*itr))) + else if (IsGameObject(*itr)) (*itr)->ToGameObject()->Respawn(); } + + delete targets; break; } case SMART_ACTION_CLOSE_GOSSIP: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) return; - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); itr++) - { - if(IsPlayer((*itr))) - (*itr)->ToPlayer()->PlayerTalkClass->CloseGossip(); - } - break; - } + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + return; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + if (IsPlayer(*itr)) + (*itr)->ToPlayer()->PlayerTalkClass->CloseGossip(); + + delete targets; + break; + } case SMART_ACTION_EQUIP: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) return; - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); itr++) - { - if(Creature* npc = (*itr)->ToCreature()) - { - uint32 slot[3]; - if (e.action.equip.entry) - { - EquipmentInfo const *einfo = sObjectMgr->GetEquipmentInfo(e.action.equip.entry); - if (!einfo) - { - sLog->outErrorDb("SmartScript: SMART_ACTION_EQUIP uses non-existent equipment info entry %u", e.action.equip.entry); - return; - } - npc->SetCurrentEquipmentId(e.action.equip.entry); - slot[0] = einfo->equipentry[0]; - slot[1] = einfo->equipentry[1]; - slot[2] = einfo->equipentry[2]; - } - else + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + return; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + { + if(Creature* npc = (*itr)->ToCreature()) + { + uint32 slot[3]; + if (e.action.equip.entry) + { + EquipmentInfo const* einfo = sObjectMgr->GetEquipmentInfo(e.action.equip.entry); + if (!einfo) { - slot[0] = e.action.equip.slot1; - slot[1] = e.action.equip.slot2; - slot[2] = e.action.equip.slot3; + sLog->outErrorDb("SmartScript: SMART_ACTION_EQUIP uses non-existent equipment info entry %u", e.action.equip.entry); + return; } - if (!e.action.equip.mask || e.action.equip.mask & 1) - npc->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, e.action.equip.slot1); - if (!e.action.equip.mask || e.action.equip.mask & 2) - npc->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, e.action.equip.slot2); - if (!e.action.equip.mask || e.action.equip.mask & 4) - npc->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2, e.action.equip.slot3); + npc->SetCurrentEquipmentId(e.action.equip.entry); + slot[0] = einfo->equipentry[0]; + slot[1] = einfo->equipentry[1]; + slot[2] = einfo->equipentry[2]; } + else + { + slot[0] = e.action.equip.slot1; + slot[1] = e.action.equip.slot2; + slot[2] = e.action.equip.slot3; + } + if (!e.action.equip.mask || e.action.equip.mask & 1) + npc->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, slot[0]); + if (!e.action.equip.mask || e.action.equip.mask & 2) + npc->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, slot[1]); + if (!e.action.equip.mask || e.action.equip.mask & 4) + npc->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2, slot[2]); } - break; } - case SMART_ACTION_CREATE_TIMED_EVENT: - { - SmartEvent ne; - ne.type = (SMART_EVENT)SMART_EVENT_UPDATE; - ne.event_chance = e.action.timeEvent.chance; - if (!ne.event_chance) ne.event_chance = 100; - - ne.minMaxRepeat.min = e.action.timeEvent.min; - ne.minMaxRepeat.max = e.action.timeEvent.max; - ne.minMaxRepeat.repeatMin = e.action.timeEvent.repeatMin; - ne.minMaxRepeat.repeatMax = e.action.timeEvent.repeatMax; - - if (!ne.minMaxRepeat.repeatMin && !ne.minMaxRepeat.repeatMax) - ne.event_flags |= SMART_EVENT_FLAG_NOT_REPEATABLE; - SmartAction ac; - ac.type = (SMART_ACTION)SMART_ACTION_TRIGGER_TIMED_EVENT; - ac.timeEvent.id = e.action.timeEvent.id; - - SmartScriptHolder ev; - ev.event = ne; - ev.event_id = e.action.timeEvent.id; - ev.target = e.target; - ev.action = ac; - InitTimer(ev); - mStoredEvents.push_back(ev); + delete targets; + break; + } + case SMART_ACTION_CREATE_TIMED_EVENT: + { + SmartEvent ne; + ne.type = (SMART_EVENT)SMART_EVENT_UPDATE; + ne.event_chance = e.action.timeEvent.chance; + if (!ne.event_chance) ne.event_chance = 100; + + ne.minMaxRepeat.min = e.action.timeEvent.min; + ne.minMaxRepeat.max = e.action.timeEvent.max; + ne.minMaxRepeat.repeatMin = e.action.timeEvent.repeatMin; + ne.minMaxRepeat.repeatMax = e.action.timeEvent.repeatMax; + + if (!ne.minMaxRepeat.repeatMin && !ne.minMaxRepeat.repeatMax) + ne.event_flags |= SMART_EVENT_FLAG_NOT_REPEATABLE; + + SmartAction ac; + ac.type = (SMART_ACTION)SMART_ACTION_TRIGGER_TIMED_EVENT; + ac.timeEvent.id = e.action.timeEvent.id; + + SmartScriptHolder ev; + ev.event = ne; + ev.event_id = e.action.timeEvent.id; + ev.target = e.target; + ev.action = ac; + InitTimer(ev); + mStoredEvents.push_back(ev); - break; - } + break; + } case SMART_ACTION_TRIGGER_TIMED_EVENT: - { - ProcessEventsFor((SMART_EVENT)SMART_EVENT_TIMED_EVENT_TRIGGERED, NULL, e.action.timeEvent.id); - break; - } + ProcessEventsFor((SMART_EVENT)SMART_EVENT_TIMED_EVENT_TRIGGERED, NULL, e.action.timeEvent.id); + break; case SMART_ACTION_REMOVE_TIMED_EVENT: - { - mRemIDs.push_back(e.action.timeEvent.id); - break; - } + mRemIDs.push_back(e.action.timeEvent.id); + break; case SMART_ACTION_OVERRIDE_SCRIPT_BASE_OBJECT: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + return; + + for (ObjectList::iterator itr = targets->begin(); itr != targets->end(); ++itr) { - ObjectList* targets = GetTargets(e, unit); - if (!targets) return; - for (ObjectList::iterator itr = targets->begin(); itr != targets->end(); itr++) + if (IsCreature(*itr)) { - if (IsCreature(*itr)) - { - if (!meOrigGUID) - meOrigGUID = me?me->GetGUID():0; - if (!goOrigGUID) - goOrigGUID = go?go->GetGUID():0; - go = NULL; - me = (*itr)->ToCreature(); - return; - }else if (IsGameObject((*itr))) - { - if (!meOrigGUID) - meOrigGUID = me?me->GetGUID():0; - if (!goOrigGUID) - goOrigGUID = go?go->GetGUID():0; - go = (*itr)->ToGameObject(); - me = NULL; - return; - } + if (!meOrigGUID) + meOrigGUID = me ? me->GetGUID() : 0; + if (!goOrigGUID) + goOrigGUID = go ? go->GetGUID() : 0; + go = NULL; + me = (*itr)->ToCreature(); + + delete targets; + return; + } + else if (IsGameObject(*itr)) + { + if (!meOrigGUID) + meOrigGUID = me ? me->GetGUID() : 0; + if (!goOrigGUID) + goOrigGUID = go ? go->GetGUID() : 0; + go = (*itr)->ToGameObject(); + me = NULL; + + delete targets; + return; } - break; } + + delete targets; + break; + } case SMART_ACTION_RESET_SCRIPT_BASE_OBJECT: ResetBaseObject(); break; @@ -1046,219 +1424,285 @@ void SmartScript::ProcessAction(SmartScriptHolder &e, Unit* unit, uint32 var0, u OnReset(); break; case SMART_ACTION_ENTER_VEHICLE: + { + if (!me) + return; + + ObjectList* targets = GetTargets(e, unit); + if (!targets) + return; + + for (ObjectList::iterator itr = targets->begin(); itr != targets->end(); ++itr) { - if (!me) return; - ObjectList* targets = GetTargets(e, unit); - if (!targets) return; - for (ObjectList::iterator itr = targets->begin(); itr != targets->end(); itr++) + if (IsUnit(*itr) && (*itr)->ToUnit()->GetVehicleKit()) { - if (IsUnit(*itr) && (*itr)->ToUnit()->GetVehicleKit()) - { - me->EnterVehicle((*itr)->ToUnit()->GetVehicleKit(), e.action.enterVehicle.seat); - return; - } + me->EnterVehicle((*itr)->ToUnit(), e.action.enterVehicle.seat); + delete targets; + return; } - break; } + + delete targets; + break; + } case SMART_ACTION_CALL_TIMED_ACTIONLIST: + { + if (e.GetTargetType() == SMART_TARGET_NONE) { - if (e.GetTargetType() == SMART_TARGET_NONE) - { - sLog->outErrorDb("SmartScript: Entry %d SourceType %u Event %u Action %u is using TARGET_NONE(0) for Script9 target. Please correct target_type in database.", e.entryOrGuid, e.GetScriptType(), e.GetEventType(), e.GetActionType()); - return; - } - ObjectList* targets = GetTargets(e, unit); - if (targets) + sLog->outErrorDb("SmartScript: Entry %d SourceType %u Event %u Action %u is using TARGET_NONE(0) for Script9 target. Please correct target_type in database.", e.entryOrGuid, e.GetScriptType(), e.GetEventType(), e.GetActionType()); + return; + } + + ObjectList* targets = GetTargets(e, unit); + if (targets) + { + for (ObjectList::iterator itr = targets->begin(); itr != targets->end(); ++itr) { - for (ObjectList::iterator itr = targets->begin(); itr != targets->end(); itr++) + if (Creature* target = (*itr)->ToCreature()) { - if (Creature* target = (*itr)->ToCreature()) - { - if (IsSmart(target)) - CAST_AI(SmartAI, target->AI())->SetScript9(e, e.action.timedActionList.id, mLastInvoker); - } else if (GameObject* target = (*itr)->ToGameObject()) - { - if (IsSmartGO(target)) - CAST_AI(SmartGameObjectAI, target->AI())->SetScript9(e, e.action.timedActionList.id, mLastInvoker); - } + if (IsSmart(target)) + CAST_AI(SmartAI, target->AI())->SetScript9(e, e.action.timedActionList.id, GetLastInvoker()); + } + else if (GameObject* target = (*itr)->ToGameObject()) + { + if (IsSmartGO(target)) + CAST_AI(SmartGameObjectAI, target->AI())->SetScript9(e, e.action.timedActionList.id, GetLastInvoker()); } } - break; + + delete targets; } + break; + } case SMART_ACTION_SET_NPC_FLAG: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) return; - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); itr++) - if (IsUnit((*itr))) - (*itr)->ToUnit()->SetUInt32Value(UNIT_NPC_FLAGS, e.action.unitFlag.flag); - break; - } + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + return; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + if (IsUnit(*itr)) + (*itr)->ToUnit()->SetUInt32Value(UNIT_NPC_FLAGS, e.action.unitFlag.flag); + + delete targets; + break; + } case SMART_ACTION_ADD_NPC_FLAG: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) return; - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); itr++) - if (IsUnit((*itr))) - (*itr)->ToUnit()->SetFlag(UNIT_NPC_FLAGS, e.action.unitFlag.flag); - break; - } + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + return; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + if (IsUnit(*itr)) + (*itr)->ToUnit()->SetFlag(UNIT_NPC_FLAGS, e.action.unitFlag.flag); + + delete targets; + break; + } case SMART_ACTION_REMOVE_NPC_FLAG: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + return; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + if (IsUnit(*itr)) + (*itr)->ToUnit()->RemoveFlag(UNIT_NPC_FLAGS, e.action.unitFlag.flag); + + delete targets; + break; + } + case SMART_ACTION_CROSS_CAST: + { + ObjectList* casters = GetTargets(CreateEvent(SMART_EVENT_UPDATE_IC, 0, 0, 0, 0, 0, SMART_ACTION_NONE, 0, 0, 0, 0, 0, 0, (SMARTAI_TARGETS)e.action.cast.targetType, e.action.cast.targetParam1, e.action.cast.targetParam2, e.action.cast.targetParam3, 0), unit); + if (!casters) + return; + + ObjectList* targets = GetTargets(e, unit); + if (!targets) { - ObjectList* targets = GetTargets(e, unit); - if (!targets) return; - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); itr++) - if (IsUnit((*itr))) - (*itr)->ToUnit()->RemoveFlag(UNIT_NPC_FLAGS, e.action.unitFlag.flag); - break; + delete casters; // casters already validated, delete now + return; } - case SMART_ACTION_CROSS_CAST: + + for (ObjectList::const_iterator itr = casters->begin(); itr != casters->end(); ++itr) { - ObjectList* casters = GetTargets(CreateEvent(SMART_EVENT_UPDATE_IC,0,0,0,0,0,SMART_ACTION_NONE,0,0,0,0,0,0,(SMARTAI_TARGETS)e.action.cast.targetType,e.action.cast.targetParam1,e.action.cast.targetParam2,e.action.cast.targetParam3,0), unit); - ObjectList* targets = GetTargets(e, unit); - if (!targets || !casters) return; - for (ObjectList::const_iterator itr = casters->begin(); itr != casters->end(); itr++) + if (IsUnit(*itr)) { - if (IsUnit((*itr))) - { - if (e.action.cast.flags & SMARTCAST_INTERRUPT_PREVIOUS) - (*itr)->ToUnit()->InterruptNonMeleeSpells(false); + if (e.action.cast.flags & SMARTCAST_INTERRUPT_PREVIOUS) + (*itr)->ToUnit()->InterruptNonMeleeSpells(false); - for (ObjectList::const_iterator it = targets->begin(); it != targets->end(); it++) - { - if (IsUnit((*it))) - { - (*itr)->ToUnit()->CastSpell((*it)->ToUnit(), e.action.cast.spell,(e.action.cast.flags & SMARTCAST_TRIGGERED) ? true : false); - } - } - } + for (ObjectList::const_iterator it = targets->begin(); it != targets->end(); it++) + if (IsUnit(*it)) + (*itr)->ToUnit()->CastSpell((*it)->ToUnit(), e.action.cast.spell, (e.action.cast.flags & SMARTCAST_TRIGGERED) ? true : false); } - break; } + + delete targets; + delete casters; + break; + } case SMART_ACTION_CALL_RANDOM_TIMED_ACTIONLIST: + { + uint32 actions[SMART_ACTION_PARAM_COUNT]; + actions[0] = e.action.randTimedActionList.entry1; + actions[1] = e.action.randTimedActionList.entry2; + actions[2] = e.action.randTimedActionList.entry3; + actions[3] = e.action.randTimedActionList.entry4; + actions[4] = e.action.randTimedActionList.entry5; + actions[5] = e.action.randTimedActionList.entry6; + uint32 temp[SMART_ACTION_PARAM_COUNT]; + uint32 count = 0; + for (uint8 i = 0; i < SMART_ACTION_PARAM_COUNT; i++) + { + if (actions[i] > 0) + { + temp[count] = actions[i]; + ++count; + } + } + + uint32 id = temp[urand(0, count)]; + if (e.GetTargetType() == SMART_TARGET_NONE) + { + sLog->outErrorDb("SmartScript: Entry %d SourceType %u Event %u Action %u is using TARGET_NONE(0) for Script9 target. Please correct target_type in database.", e.entryOrGuid, e.GetScriptType(), e.GetEventType(), e.GetActionType()); + return; + } + + ObjectList* targets = GetTargets(e, unit); + if (targets) { - uint32 actions[SMART_ACTION_PARAM_COUNT]; - actions[0] = e.action.randTimedActionList.entry1; - actions[1] = e.action.randTimedActionList.entry2; - actions[2] = e.action.randTimedActionList.entry3; - actions[3] = e.action.randTimedActionList.entry4; - actions[4] = e.action.randTimedActionList.entry5; - actions[5] = e.action.randTimedActionList.entry6; - uint32 temp[SMART_ACTION_PARAM_COUNT]; - uint32 count = 0; - for (uint8 i = 0; i < SMART_ACTION_PARAM_COUNT; i++) + for (ObjectList::iterator itr = targets->begin(); itr != targets->end(); ++itr) { - if (actions[i] > 0) + if (Creature* target = (*itr)->ToCreature()) { - temp[count] = actions[i]; - count++; + if (IsSmart(target)) + CAST_AI(SmartAI, target->AI())->SetScript9(e, id, GetLastInvoker()); } - } - uint32 id = temp[urand(0, count)]; - if (e.GetTargetType() == SMART_TARGET_NONE) - { - sLog->outErrorDb("SmartScript: Entry %d SourceType %u Event %u Action %u is using TARGET_NONE(0) for Script9 target. Please correct target_type in database.", e.entryOrGuid, e.GetScriptType(), e.GetEventType(), e.GetActionType()); - return; - } - ObjectList* targets = GetTargets(e, unit); - if (targets) - { - for (ObjectList::iterator itr = targets->begin(); itr != targets->end(); itr++) + else if (GameObject* target = (*itr)->ToGameObject()) { - if (Creature* target = (*itr)->ToCreature()) - { - if (IsSmart(target)) - CAST_AI(SmartAI, target->AI())->SetScript9(e, id, mLastInvoker); - } else if (GameObject* target = (*itr)->ToGameObject()) - { - if (IsSmartGO(target)) - CAST_AI(SmartGameObjectAI, target->AI())->SetScript9(e, id, mLastInvoker); - } + if (IsSmartGO(target)) + CAST_AI(SmartGameObjectAI, target->AI())->SetScript9(e, id, GetLastInvoker()); } } - break; + + delete targets; } + break; + } case SMART_ACTION_CALL_RANDOM_RANGE_TIMED_ACTIONLIST: + { + uint32 id = urand(e.action.randTimedActionList.entry1, e.action.randTimedActionList.entry2); + if (e.GetTargetType() == SMART_TARGET_NONE) { - uint32 id = urand(e.action.randTimedActionList.entry1, e.action.randTimedActionList.entry2); - if (e.GetTargetType() == SMART_TARGET_NONE) - { - sLog->outErrorDb("SmartScript: Entry %d SourceType %u Event %u Action %u is using TARGET_NONE(0) for Script9 target. Please correct target_type in database.", e.entryOrGuid, e.GetScriptType(), e.GetEventType(), e.GetActionType()); - return; - } - ObjectList* targets = GetTargets(e, unit); - if (targets) + sLog->outErrorDb("SmartScript: Entry %d SourceType %u Event %u Action %u is using TARGET_NONE(0) for Script9 target. Please correct target_type in database.", e.entryOrGuid, e.GetScriptType(), e.GetEventType(), e.GetActionType()); + return; + } + + ObjectList* targets = GetTargets(e, unit); + if (targets) + { + for (ObjectList::iterator itr = targets->begin(); itr != targets->end(); ++itr) { - for (ObjectList::iterator itr = targets->begin(); itr != targets->end(); itr++) + if (Creature* target = (*itr)->ToCreature()) { - if (Creature* target = (*itr)->ToCreature()) - { - if (IsSmart(target)) - CAST_AI(SmartAI, target->AI())->SetScript9(e, id, mLastInvoker); - } else if (GameObject* target = (*itr)->ToGameObject()) - { - if (IsSmartGO(target)) - CAST_AI(SmartGameObjectAI, target->AI())->SetScript9(e, id, mLastInvoker); - } + if (IsSmart(target)) + CAST_AI(SmartAI, target->AI())->SetScript9(e, id, GetLastInvoker()); + } else if (GameObject* target = (*itr)->ToGameObject()) + { + if (IsSmartGO(target)) + CAST_AI(SmartGameObjectAI, target->AI())->SetScript9(e, id, GetLastInvoker()); } } - break; + + delete targets; } + break; + } case SMART_ACTION_ACTIVATE_TAXI: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) return; - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); itr++) - if (IsPlayer((*itr))) - (*itr)->ToPlayer()->ActivateTaxiPathTo(e.action.taxi.id); - break; - } + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + return; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + if (IsPlayer(*itr)) + (*itr)->ToPlayer()->ActivateTaxiPathTo(e.action.taxi.id); + + delete targets; + break; + } case SMART_ACTION_RANDOM_MOVE: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + return; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { - ObjectList* targets = GetTargets(e, unit); - if (!targets) return; - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); itr++) - if (IsCreature((*itr))) - { - if (e.action.moveRandom.distance) - (*itr)->ToCreature()->GetMotionMaster()->MoveRandom((float)e.action.moveRandom.distance); - else - (*itr)->ToCreature()->GetMotionMaster()->MoveIdle(); - } - break; + if (IsCreature((*itr))) + { + if (e.action.moveRandom.distance) + (*itr)->ToCreature()->GetMotionMaster()->MoveRandom((float)e.action.moveRandom.distance); + else + (*itr)->ToCreature()->GetMotionMaster()->MoveIdle(); + } } + + delete targets; + break; + } case SMART_ACTION_SET_UNIT_FIELD_BYTES_1: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) return; - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); itr++) - if (IsUnit((*itr))) - (*itr)->ToUnit()->SetByteFlag(UNIT_FIELD_BYTES_1, 0, e.action.setunitByte.byte1); - break; - } + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + return; + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + if (IsUnit(*itr)) + (*itr)->ToUnit()->SetByteFlag(UNIT_FIELD_BYTES_1, 0, e.action.setunitByte.byte1); + + delete targets; + break; + } case SMART_ACTION_REMOVE_UNIT_FIELD_BYTES_1: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) return; - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); itr++) - if (IsUnit((*itr))) - (*itr)->ToUnit()->RemoveByteFlag(UNIT_FIELD_BYTES_1, 0, e.action.delunitByte.byte1); - break; - } + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + return; + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + if (IsUnit(*itr)) + (*itr)->ToUnit()->RemoveByteFlag(UNIT_FIELD_BYTES_1, 0, e.action.delunitByte.byte1); + + delete targets; + break; + } case SMART_ACTION_INTERRUPT_SPELL: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - return; - - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); itr++) - { - if (IsUnit((*itr))) - (*itr)->ToUnit()->InterruptNonMeleeSpells(e.action.interruptSpellCasting.withDelayed,e.action.interruptSpellCasting.spell_id,e.action.interruptSpellCasting.withInstant); - } + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + return; - break; - } + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + if (IsUnit(*itr)) + (*itr)->ToUnit()->InterruptNonMeleeSpells(e.action.interruptSpellCasting.withDelayed, e.action.interruptSpellCasting.spell_id, e.action.interruptSpellCasting.withInstant); + + delete targets; + break; + } + case SMART_ACTION_SEND_GO_CUSTOM_ANIM: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + return; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + if (IsGameObject(*itr)) + (*itr)->ToGameObject()->SendCustomAnim(e.action.sendGoCustomAnim.anim); + + delete targets; + break; + } default: sLog->outErrorDb("SmartScript::ProcessAction: Unhandled Action type %u", e.GetActionType()); break; @@ -1279,56 +1723,56 @@ void SmartScript::InstallTemplate(SmartScriptHolder e) { case SMARTAI_TEMPLATE_CASTER: { - AddEvent(SMART_EVENT_UPDATE_IC,0, 0,0,e.action.installTtemplate.param2,e.action.installTtemplate.param3,SMART_ACTION_CAST,e.action.installTtemplate.param1,e.target.raw.param1,0,0,0,0,SMART_TARGET_VICTIM,0,0,0,1); - AddEvent(SMART_EVENT_RANGE,0, e.action.installTtemplate.param4,300,0,0,SMART_ACTION_ALLOW_COMBAT_MOVEMENT,1,0,0,0,0,0,SMART_TARGET_NONE,0,0,0,1); - AddEvent(SMART_EVENT_RANGE,0, 0,e.action.installTtemplate.param4>10?e.action.installTtemplate.param4-10:0,0,0,SMART_ACTION_ALLOW_COMBAT_MOVEMENT,0,0,0,0,0,0,SMART_TARGET_NONE,0,0,0,1); - AddEvent(SMART_EVENT_MANA_PCT,0,e.action.installTtemplate.param5-15>100?100:e.action.installTtemplate.param5+15,100,1000,1000,SMART_ACTION_SET_EVENT_PHASE,1,0,0,0,0,0,SMART_TARGET_NONE,0,0,0,0); - AddEvent(SMART_EVENT_MANA_PCT,0,0,e.action.installTtemplate.param5,1000,1000,SMART_ACTION_SET_EVENT_PHASE,0,0,0,0,0,0,SMART_TARGET_NONE,0,0,0,0); - AddEvent(SMART_EVENT_MANA_PCT,0,0,e.action.installTtemplate.param5,1000,1000,SMART_ACTION_ALLOW_COMBAT_MOVEMENT,1,0,0,0,0,0,SMART_TARGET_NONE,0,0,0,0); + AddEvent(SMART_EVENT_UPDATE_IC, 0, 0, 0, e.action.installTtemplate.param2, e.action.installTtemplate.param3, SMART_ACTION_CAST, e.action.installTtemplate.param1, e.target.raw.param1, 0, 0, 0, 0, SMART_TARGET_VICTIM, 0, 0, 0, 1); + AddEvent(SMART_EVENT_RANGE, 0, e.action.installTtemplate.param4, 300, 0, 0, SMART_ACTION_ALLOW_COMBAT_MOVEMENT, 1, 0, 0, 0, 0, 0, SMART_TARGET_NONE, 0, 0, 0, 1); + AddEvent(SMART_EVENT_RANGE, 0, 0, e.action.installTtemplate.param4>10?e.action.installTtemplate.param4-10:0, 0, 0, SMART_ACTION_ALLOW_COMBAT_MOVEMENT, 0, 0, 0, 0, 0, 0, SMART_TARGET_NONE, 0, 0, 0, 1); + AddEvent(SMART_EVENT_MANA_PCT, 0, e.action.installTtemplate.param5-15>100?100:e.action.installTtemplate.param5+15, 100, 1000, 1000, SMART_ACTION_SET_EVENT_PHASE, 1, 0, 0, 0, 0, 0, SMART_TARGET_NONE, 0, 0, 0, 0); + AddEvent(SMART_EVENT_MANA_PCT, 0, 0, e.action.installTtemplate.param5, 1000, 1000, SMART_ACTION_SET_EVENT_PHASE, 0, 0, 0, 0, 0, 0, SMART_TARGET_NONE, 0, 0, 0, 0); + AddEvent(SMART_EVENT_MANA_PCT, 0, 0, e.action.installTtemplate.param5, 1000, 1000, SMART_ACTION_ALLOW_COMBAT_MOVEMENT, 1, 0, 0, 0, 0, 0, SMART_TARGET_NONE, 0, 0, 0, 0); break; } case SMARTAI_TEMPLATE_TURRET: { - AddEvent(SMART_EVENT_UPDATE_IC,0, 0,0,e.action.installTtemplate.param2,e.action.installTtemplate.param3,SMART_ACTION_CAST,e.action.installTtemplate.param1,e.target.raw.param1,0,0,0,0,SMART_TARGET_VICTIM,0,0,0,0); - AddEvent(SMART_EVENT_JUST_CREATED,0, 0,0,0,0,SMART_ACTION_ALLOW_COMBAT_MOVEMENT,0,0,0,0,0,0,SMART_TARGET_NONE,0,0,0,0); + AddEvent(SMART_EVENT_UPDATE_IC, 0, 0, 0, e.action.installTtemplate.param2, e.action.installTtemplate.param3, SMART_ACTION_CAST, e.action.installTtemplate.param1, e.target.raw.param1, 0, 0, 0, 0, SMART_TARGET_VICTIM, 0, 0, 0, 0); + AddEvent(SMART_EVENT_JUST_CREATED, 0, 0, 0, 0, 0, SMART_ACTION_ALLOW_COMBAT_MOVEMENT, 0, 0, 0, 0, 0, 0, SMART_TARGET_NONE, 0, 0, 0, 0); break; } case SMARTAI_TEMPLATE_CAGED_NPC_PART: { if (!me) return; //store cage as id1 - AddEvent(SMART_EVENT_DATA_SET,0,0,0,0,0,SMART_ACTION_STORE_TARGET_LIST,1,0,0,0,0,0,SMART_TARGET_CLOSEST_GAMEOBJECT,e.action.installTtemplate.param1,10,0,0); + AddEvent(SMART_EVENT_DATA_SET, 0, 0, 0, 0, 0, SMART_ACTION_STORE_TARGET_LIST, 1, 0, 0, 0, 0, 0, SMART_TARGET_CLOSEST_GAMEOBJECT, e.action.installTtemplate.param1, 10, 0, 0); //reset(close) cage on hostage(me) respawn - AddEvent(SMART_EVENT_UPDATE,SMART_EVENT_FLAG_NOT_REPEATABLE,0,0,0,0,SMART_ACTION_RESET_GOBJECT,0,0,0,0,0,0,SMART_TARGET_GAMEOBJECT_DISTANCE,e.action.installTtemplate.param1,5,0,0); + AddEvent(SMART_EVENT_UPDATE, SMART_EVENT_FLAG_NOT_REPEATABLE, 0, 0, 0, 0, SMART_ACTION_RESET_GOBJECT, 0, 0, 0, 0, 0, 0, SMART_TARGET_GAMEOBJECT_DISTANCE, e.action.installTtemplate.param1, 5, 0, 0); - AddEvent(SMART_EVENT_DATA_SET,0,0,0,0,0,SMART_ACTION_SET_RUN,e.action.installTtemplate.param3,0,0,0,0,0,SMART_TARGET_NONE,0,0,0,0); - AddEvent(SMART_EVENT_DATA_SET,0,0,0,0,0,SMART_ACTION_SET_EVENT_PHASE,1,0,0,0,0,0,SMART_TARGET_NONE,0,0,0,0); + AddEvent(SMART_EVENT_DATA_SET, 0, 0, 0, 0, 0, SMART_ACTION_SET_RUN, e.action.installTtemplate.param3, 0, 0, 0, 0, 0, SMART_TARGET_NONE, 0, 0, 0, 0); + AddEvent(SMART_EVENT_DATA_SET, 0, 0, 0, 0, 0, SMART_ACTION_SET_EVENT_PHASE, 1, 0, 0, 0, 0, 0, SMART_TARGET_NONE, 0, 0, 0, 0); - AddEvent(SMART_EVENT_UPDATE,SMART_EVENT_FLAG_NOT_REPEATABLE,1000,1000,0,0,SMART_ACTION_MOVE_FORWARD,e.action.installTtemplate.param4,0,0,0,0,0,SMART_TARGET_NONE,0,0,0,1); + AddEvent(SMART_EVENT_UPDATE, SMART_EVENT_FLAG_NOT_REPEATABLE, 1000, 1000, 0, 0, SMART_ACTION_MOVE_FORWARD, e.action.installTtemplate.param4, 0, 0, 0, 0, 0, SMART_TARGET_NONE, 0, 0, 0, 1); //phase 1: give quest credit on movepoint reached - AddEvent(SMART_EVENT_MOVEMENTINFORM,0, POINT_MOTION_TYPE,SMART_RANDOM_POINT,0,0,SMART_ACTION_SET_DATA,0,0,0,0,0,0,SMART_TARGET_STORED,1,0,0,1); + AddEvent(SMART_EVENT_MOVEMENTINFORM, 0, POINT_MOTION_TYPE, SMART_RANDOM_POINT, 0, 0, SMART_ACTION_SET_DATA, 0, 0, 0, 0, 0, 0, SMART_TARGET_STORED, 1, 0, 0, 1); //phase 1: despawn after time on movepoint reached - AddEvent(SMART_EVENT_MOVEMENTINFORM,0, POINT_MOTION_TYPE,SMART_RANDOM_POINT,0,0,SMART_ACTION_FORCE_DESPAWN,e.action.installTtemplate.param2,0,0,0,0,0,SMART_TARGET_NONE,0,0,0,1); + AddEvent(SMART_EVENT_MOVEMENTINFORM, 0, POINT_MOTION_TYPE, SMART_RANDOM_POINT, 0, 0, SMART_ACTION_FORCE_DESPAWN, e.action.installTtemplate.param2, 0, 0, 0, 0, 0, SMART_TARGET_NONE, 0, 0, 0, 1); if (sCreatureTextMgr->TextExist(me->GetEntry(), (uint8)e.action.installTtemplate.param5)) - AddEvent(SMART_EVENT_MOVEMENTINFORM,0, POINT_MOTION_TYPE,SMART_RANDOM_POINT,0,0,SMART_ACTION_TALK,e.action.installTtemplate.param5,0,0,0,0,0,SMART_TARGET_NONE,0,0,0,1); + AddEvent(SMART_EVENT_MOVEMENTINFORM, 0, POINT_MOTION_TYPE, SMART_RANDOM_POINT, 0, 0, SMART_ACTION_TALK, e.action.installTtemplate.param5, 0, 0, 0, 0, 0, SMART_TARGET_NONE, 0, 0, 0, 1); break; } case SMARTAI_TEMPLATE_CAGED_GO_PART: { if (!go) return; //store hostage as id1 - AddEvent(SMART_EVENT_GOSSIP_HELLO,0,0,0,0,0,SMART_ACTION_STORE_TARGET_LIST,1,0,0,0,0,0,SMART_TARGET_CLOSEST_CREATURE,e.action.installTtemplate.param1,10,0,0); + AddEvent(SMART_EVENT_GOSSIP_HELLO, 0, 0, 0, 0, 0, SMART_ACTION_STORE_TARGET_LIST, 1, 0, 0, 0, 0, 0, SMART_TARGET_CLOSEST_CREATURE, e.action.installTtemplate.param1, 10, 0, 0); //store invoker as id2 - AddEvent(SMART_EVENT_GOSSIP_HELLO,0,0,0,0,0,SMART_ACTION_STORE_TARGET_LIST,2,0,0,0,0,0,SMART_TARGET_NONE,0,0,0,0); + AddEvent(SMART_EVENT_GOSSIP_HELLO, 0, 0, 0, 0, 0, SMART_ACTION_STORE_TARGET_LIST, 2, 0, 0, 0, 0, 0, SMART_TARGET_NONE, 0, 0, 0, 0); //signal hostage - AddEvent(SMART_EVENT_GOSSIP_HELLO,0,0,0,0,0,SMART_ACTION_SET_DATA,0,0,0,0,0,0,SMART_TARGET_STORED,1,0,0,0); + AddEvent(SMART_EVENT_GOSSIP_HELLO, 0, 0, 0, 0, 0, SMART_ACTION_SET_DATA, 0, 0, 0, 0, 0, 0, SMART_TARGET_STORED, 1, 0, 0, 0); //when hostage raeched end point, give credit to invoker if (e.action.installTtemplate.param2) - AddEvent(SMART_EVENT_DATA_SET,0,0,0,0,0,SMART_ACTION_CALL_KILLEDMONSTER,e.action.installTtemplate.param1,0,0,0,0,0,SMART_TARGET_STORED,2,0,0,0); + AddEvent(SMART_EVENT_DATA_SET, 0, 0, 0, 0, 0, SMART_ACTION_CALL_KILLEDMONSTER, e.action.installTtemplate.param1, 0, 0, 0, 0, 0, SMART_TARGET_STORED, 2, 0, 0, 0); else - AddEvent(SMART_EVENT_GOSSIP_HELLO,0,0,0,0,0,SMART_ACTION_CALL_KILLEDMONSTER,e.action.installTtemplate.param1,0,0,0,0,0,SMART_TARGET_STORED,2,0,0,0); + AddEvent(SMART_EVENT_GOSSIP_HELLO, 0, 0, 0, 0, 0, SMART_ACTION_CALL_KILLEDMONSTER, e.action.installTtemplate.param1, 0, 0, 0, 0, 0, SMART_TARGET_STORED, 2, 0, 0, 0); break; } case SMARTAI_TEMPLATE_BASIC: @@ -1376,8 +1820,9 @@ ObjectList* SmartScript::GetTargets(SmartScriptHolder e, Unit* invoker) Unit* trigger = NULL; if (invoker) trigger = invoker; - else if (mLastInvoker) - trigger = mLastInvoker; + else if (Unit* tempLastInvoker = GetLastInvoker()) + trigger = tempLastInvoker; + ObjectList* l = new ObjectList(); switch (e.GetTargetType()) { @@ -1390,24 +1835,24 @@ ObjectList* SmartScript::GetTargets(SmartScriptHolder e, Unit* invoker) l->push_back(me->getVictim()); break; case SMART_TARGET_HOSTILE_SECOND_AGGRO: - if (!me) return NULL; - if(Unit* u = me->AI()->SelectTarget(SELECT_TARGET_TOPAGGRO, 1)) - l->push_back(u); + if (me) + if (Unit* u = me->AI()->SelectTarget(SELECT_TARGET_TOPAGGRO, 1)) + l->push_back(u); break; case SMART_TARGET_HOSTILE_LAST_AGGRO: - if (!me) return NULL; - if(Unit* u = me->AI()->SelectTarget(SELECT_TARGET_BOTTOMAGGRO, 0)) - l->push_back(u); + if (me) + if (Unit* u = me->AI()->SelectTarget(SELECT_TARGET_BOTTOMAGGRO, 0)) + l->push_back(u); break; case SMART_TARGET_HOSTILE_RANDOM: - if (!me) return NULL; - if(Unit* u = me->AI()->SelectTarget(SELECT_TARGET_RANDOM, 0)) - l->push_back(u); + if (me) + if (Unit* u = me->AI()->SelectTarget(SELECT_TARGET_RANDOM, 0)) + l->push_back(u); break; case SMART_TARGET_HOSTILE_RANDOM_NOT_TOP: - if (!me) return NULL; - if(Unit* u = me->AI()->SelectTarget(SELECT_TARGET_RANDOM, 1)) - l->push_back(u); + if (me) + if (Unit* u = me->AI()->SelectTarget(SELECT_TARGET_RANDOM, 1)) + l->push_back(u); break; case SMART_TARGET_NONE: case SMART_TARGET_ACTION_INVOKER: @@ -1416,197 +1861,215 @@ ObjectList* SmartScript::GetTargets(SmartScriptHolder e, Unit* invoker) break; case SMART_TARGET_ACTION_INVOKER_VEHICLE: if (trigger && trigger->GetVehicle() && trigger->GetVehicle()->GetBase()) - { l->push_back(trigger->GetVehicle()->GetBase()); - } break; case SMART_TARGET_INVOKER_PARTY: if (trigger) { l->push_back(trigger); if (Player* plr = trigger->ToPlayer()) - { - if (Group *pGroup = plr->GetGroup()) - { - for (GroupReference *gr = pGroup->GetFirstMember(); gr != NULL; gr = gr->next()) - { - if (Player *pGroupGuy = gr->getSource()) - l->push_back(pGroupGuy); - } - } - } + if (Group* pGroup = plr->GetGroup()) + for (GroupReference* groupRef = pGroup->GetFirstMember(); groupRef != NULL; groupRef = groupRef->next()) + if (Player* member = groupRef->getSource()) + l->push_back(member); } break; case SMART_TARGET_CREATURE_RANGE: + { + // will always return a valid pointer, even if empty list + ObjectList* units = GetWorldObjectsInDist((float)e.target.unitRange.maxDist); + for (ObjectList::const_iterator itr = units->begin(); itr != units->end(); ++itr) { - ObjectList* units = GetWorldObjectsInDist((float)e.target.unitRange.maxDist); - if (!units) return NULL; - for (ObjectList::const_iterator itr = units->begin(); itr != units->end(); itr++) - { - if(!IsCreature((*itr))) - continue; - if (me && me == (*itr)) - continue; - if (((e.target.unitRange.creature && (*itr)->ToCreature()->GetEntry() == e.target.unitRange.creature) || !e.target.unitRange.creature) && GetBaseObject()->IsInRange((*itr), (float)e.target.unitRange.minDist, (float)e.target.unitRange.maxDist)) - l->push_back((*itr)); - } - break; + if (!IsCreature(*itr)) + continue; + + if (me && me == *itr) + continue; + + if (((e.target.unitRange.creature && (*itr)->ToCreature()->GetEntry() == e.target.unitRange.creature) || !e.target.unitRange.creature) && GetBaseObject()->IsInRange(*itr, (float)e.target.unitRange.minDist, (float)e.target.unitRange.maxDist)) + l->push_back(*itr); } + + delete units; + break; + } case SMART_TARGET_CREATURE_DISTANCE: + { + // will always return a valid pointer, even if empty list + ObjectList* units = GetWorldObjectsInDist((float)e.target.unitDistance.dist); + for (ObjectList::const_iterator itr = units->begin(); itr != units->end(); ++itr) { - ObjectList* units = GetWorldObjectsInDist((float)e.target.unitDistance.dist); - if (!units) return NULL; - for (ObjectList::const_iterator itr = units->begin(); itr != units->end(); itr++) - { - if(!IsCreature((*itr))) - continue; - if (me && me == (*itr)) - continue; - if ((e.target.unitDistance.creature && (*itr)->ToCreature()->GetEntry() == e.target.unitDistance.creature) || !e.target.unitDistance.creature) - { - l->push_back((*itr)); - } - } - break; + if (!IsCreature(*itr)) + continue; + + if (me && me == *itr) + continue; + + if ((e.target.unitDistance.creature && (*itr)->ToCreature()->GetEntry() == e.target.unitDistance.creature) || !e.target.unitDistance.creature) + l->push_back(*itr); } + + delete units; + break; + } case SMART_TARGET_GAMEOBJECT_DISTANCE: + { + // will always return a valid pointer, even if empty list + ObjectList* units = GetWorldObjectsInDist((float)e.target.goDistance.dist); + for (ObjectList::const_iterator itr = units->begin(); itr != units->end(); ++itr) { - ObjectList* units = GetWorldObjectsInDist((float)e.target.goDistance.dist); - if (!units) return NULL; - for (ObjectList::const_iterator itr = units->begin(); itr != units->end(); itr++) - { - if(!IsGameObject((*itr))) - continue; - if (go && go == (*itr)) - continue; - if ((e.target.goDistance.entry && (*itr)->ToGameObject()->GetEntry() == e.target.goDistance.entry) || !e.target.goDistance.entry) - l->push_back((*itr)); - } - break; + if (!IsGameObject(*itr)) + continue; + + if (go && go == *itr) + continue; + + if ((e.target.goDistance.entry && (*itr)->ToGameObject()->GetEntry() == e.target.goDistance.entry) || !e.target.goDistance.entry) + l->push_back(*itr); } + + delete units; + break; + } case SMART_TARGET_GAMEOBJECT_RANGE: + { + // will always return a valid pointer, even if empty list + ObjectList* units = GetWorldObjectsInDist((float)e.target.goRange.maxDist); + for (ObjectList::const_iterator itr = units->begin(); itr != units->end(); ++itr) { - ObjectList* units = GetWorldObjectsInDist((float)e.target.goRange.maxDist); - if (!units) return NULL; - for (ObjectList::const_iterator itr = units->begin(); itr != units->end(); itr++) - { - if(!IsGameObject((*itr))) - continue; - if (go && go == (*itr)) - continue; - if (((e.target.goRange.entry && IsGameObject((*itr)) && (*itr)->ToGameObject()->GetEntry() == e.target.goRange.entry) || !e.target.goRange.entry) && GetBaseObject()->IsInRange((*itr), (float)e.target.goRange.minDist, (float)e.target.goRange.maxDist)) - l->push_back((*itr)); - } - break; + if(!IsGameObject(*itr)) + continue; + + if (go && go == *itr) + continue; + + if (((e.target.goRange.entry && IsGameObject(*itr) && (*itr)->ToGameObject()->GetEntry() == e.target.goRange.entry) || !e.target.goRange.entry) && GetBaseObject()->IsInRange((*itr), (float)e.target.goRange.minDist, (float)e.target.goRange.maxDist)) + l->push_back(*itr); } + + delete units; + break; + } case SMART_TARGET_CREATURE_GUID: + { + Creature* target = NULL; + if (e.target.unitGUID.entry) { - Creature* target = NULL; - if (e.target.unitGUID.entry) - { - uint64 guid = MAKE_NEW_GUID(e.target.unitGUID.guid, e.target.unitGUID.entry, HIGHGUID_UNIT); - target = HashMapHolder::Find(guid); - } else - { - if (!trigger && !GetBaseObject()) - { - sLog->outErrorDb("SMART_TARGET_CREATURE_GUID can not be used without invoker and without entry"); - return NULL; - } - target = FindCreatureNear(trigger?trigger:GetBaseObject(), e.target.unitGUID.guid); - } - if (target) - { - l->push_back(target); - } - break; + uint64 guid = MAKE_NEW_GUID(e.target.unitGUID.guid, e.target.unitGUID.entry, HIGHGUID_UNIT); + target = HashMapHolder::Find(guid); } - case SMART_TARGET_GAMEOBJECT_GUID: + else { - GameObject* target = NULL; - if (e.target.unitGUID.entry) + if (!trigger && !GetBaseObject()) { - uint64 guid = MAKE_NEW_GUID(e.target.goGUID.guid, e.target.goGUID.entry, HIGHGUID_GAMEOBJECT); - target = HashMapHolder::Find(guid); - } else - { - if (!trigger && !GetBaseObject()) - { - sLog->outErrorDb("SMART_TARGET_GAMEOBJECT_GUID can not be used without invoker and without entry"); - return NULL; - } - target = FindGameObjectNear(trigger?trigger:GetBaseObject(), e.target.goGUID.guid); - } - if (target) - { - l->push_back(target); + sLog->outErrorDb("SMART_TARGET_CREATURE_GUID can not be used without invoker and without entry"); + break; } - break; + + target = FindCreatureNear(trigger ? trigger : GetBaseObject(), e.target.unitGUID.guid); } - case SMART_TARGET_PLAYER_RANGE: + + if (target) + l->push_back(target); + break; + } + case SMART_TARGET_GAMEOBJECT_GUID: + { + GameObject* target = NULL; + if (e.target.unitGUID.entry) { - ObjectList* units = GetWorldObjectsInDist((float)e.target.playerRange.maxDist); - if (!units || !GetBaseObject()) return NULL; - for (ObjectList::const_iterator itr = units->begin(); itr != units->end(); itr++) - { - if(IsPlayer((*itr)) && GetBaseObject()->IsInRange((*itr), (float)e.target.playerRange.minDist, (float)e.target.playerRange.maxDist)) - l->push_back((*itr)); - } - break; + uint64 guid = MAKE_NEW_GUID(e.target.goGUID.guid, e.target.goGUID.entry, HIGHGUID_GAMEOBJECT); + target = HashMapHolder::Find(guid); } - case SMART_TARGET_PLAYER_DISTANCE: + else { - ObjectList* units = GetWorldObjectsInDist((float)e.target.playerDistance.dist); - if (!units) return NULL; - for (ObjectList::const_iterator itr = units->begin(); itr != units->end(); itr++) + if (!trigger && !GetBaseObject()) { - if(IsPlayer((*itr))) - l->push_back((*itr)); + sLog->outErrorDb("SMART_TARGET_GAMEOBJECT_GUID can not be used without invoker and without entry"); + break; } - break; + + target = FindGameObjectNear(trigger ? trigger : GetBaseObject(), e.target.goGUID.guid); } + + if (target) + l->push_back(target); + break; + } + case SMART_TARGET_PLAYER_RANGE: + { + // will always return a valid pointer, even if empty list + ObjectList* units = GetWorldObjectsInDist((float)e.target.playerRange.maxDist); + if (!units->empty() && GetBaseObject()) + for (ObjectList::const_iterator itr = units->begin(); itr != units->end(); ++itr) + if (IsPlayer(*itr) && GetBaseObject()->IsInRange(*itr, (float)e.target.playerRange.minDist, (float)e.target.playerRange.maxDist)) + l->push_back(*itr); + + delete units; + break; + } + case SMART_TARGET_PLAYER_DISTANCE: + { + // will always return a valid pointer, even if empty list + ObjectList* units = GetWorldObjectsInDist((float)e.target.playerDistance.dist); + for (ObjectList::const_iterator itr = units->begin(); itr != units->end(); ++itr) + if (IsPlayer(*itr)) + l->push_back(*itr); + + delete units; + break; + } case SMART_TARGET_STORED: - { - ObjectListMap::iterator itr = mTargetStorage->find(e.target.stored.id); - if (itr != mTargetStorage->end()) - return itr->second; - return l; - } + { + ObjectListMap::iterator itr = mTargetStorage->find(e.target.stored.id); + if (itr != mTargetStorage->end()) + l->assign(itr->second->begin(), itr->second->end()); + + return l; + } case SMART_TARGET_CLOSEST_CREATURE: - { - Creature* target = GetClosestCreatureWithEntry(GetBaseObject(),e.target.closest.entry, (float)(e.target.closest.dist ? e.target.closest.dist : 100), e.target.closest.dead ? false : true); - if (target) - l->push_back(target); - break; - } + { + Creature* target = GetClosestCreatureWithEntry(GetBaseObject(), e.target.closest.entry, (float)(e.target.closest.dist ? e.target.closest.dist : 100), e.target.closest.dead ? false : true); + if (target) + l->push_back(target); + break; + } case SMART_TARGET_CLOSEST_GAMEOBJECT: - { - GameObject* target = GetClosestGameObjectWithEntry(GetBaseObject(),e.target.closest.entry, (float)(e.target.closest.dist ? e.target.closest.dist : 100)); - if (target) - l->push_back(target); - break; - } + { + GameObject* target = GetClosestGameObjectWithEntry(GetBaseObject(), e.target.closest.entry, (float)(e.target.closest.dist ? e.target.closest.dist : 100)); + if (target) + l->push_back(target); + break; + } case SMART_TARGET_OWNER_OR_SUMMONER: - { - if (!me) return NULL; - uint64 guid = me->GetCharmerOrOwnerGUID(); - if (Unit* owner = ObjectAccessor::GetUnit(*me, guid)) + { + if (me) + if (Unit* owner = ObjectAccessor::GetUnit(*me, me->GetCharmerOrOwnerGUID())) l->push_back(owner); - break; - } + break; + } case SMART_TARGET_THREAT_LIST: + { + if (me) { - if (!me) return NULL; - std::list& threatList = me->getThreatManager().getThreatList(); - for (std::list::iterator i = threatList.begin(); i != threatList.end(); ++i) - if (Unit* Temp = Unit::GetUnit(*me,(*i)->getUnitGuid())) - l->push_back(Temp); - break; + std::list const& threatList = me->getThreatManager().getThreatList(); + for (std::list::const_iterator i = threatList.begin(); i != threatList.end(); ++i) + if (Unit* temp = Unit::GetUnit(*me, (*i)->getUnitGuid())) + l->push_back(temp); } + break; + } case SMART_TARGET_POSITION: default: - return NULL; + break; + } + + if (l->empty()) + { + delete l; + l = NULL; } + return l; } @@ -1623,7 +2086,7 @@ ObjectList* SmartScript::GetWorldObjectsInDist(float dist) return targets; } -void SmartScript::ProcessEvent(SmartScriptHolder &e, Unit* unit, uint32 var0, uint32 var1, bool bvar, const SpellEntry* spell, GameObject* gob) +void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, uint32 var1, bool bvar, const SpellEntry* spell, GameObject* gob) { if (!e.active && e.GetEventType() != SMART_EVENT_LINK) return; @@ -1654,68 +2117,68 @@ void SmartScript::ProcessEvent(SmartScriptHolder &e, Unit* unit, uint32 var0, ui ProcessAction(e); break; case SMART_EVENT_HEALT_PCT: - { - if (!me || !me->isInCombat() || !me->GetMaxHealth()) - return; - uint32 perc = (uint32)me->GetHealthPct(); - if (perc > e.event.minMaxRepeat.max || perc < e.event.minMaxRepeat.min) - return; - RecalcTimer(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax); - ProcessAction(e); - break; - } + { + if (!me || !me->isInCombat() || !me->GetMaxHealth()) + return; + uint32 perc = (uint32)me->GetHealthPct(); + if (perc > e.event.minMaxRepeat.max || perc < e.event.minMaxRepeat.min) + return; + RecalcTimer(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax); + ProcessAction(e); + break; + } case SMART_EVENT_TARGET_HEALTH_PCT: - { - if (!me || !me->isInCombat() || !me->getVictim() || !me->getVictim()->GetMaxHealth()) - return; - uint32 perc = (uint32)me->getVictim()->GetHealthPct(); - if (perc > e.event.minMaxRepeat.max || perc < e.event.minMaxRepeat.min) - return; - RecalcTimer(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax); - ProcessAction(e, me->getVictim()); - break; - } + { + if (!me || !me->isInCombat() || !me->getVictim() || !me->getVictim()->GetMaxHealth()) + return; + uint32 perc = (uint32)me->getVictim()->GetHealthPct(); + if (perc > e.event.minMaxRepeat.max || perc < e.event.minMaxRepeat.min) + return; + RecalcTimer(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax); + ProcessAction(e, me->getVictim()); + break; + } case SMART_EVENT_MANA_PCT: - { - if (!me || !me->isInCombat() || !me->GetMaxPower(POWER_MANA)) - return; - uint32 perc = uint32(100.0f * me->GetPower(POWER_MANA) / me->GetMaxPower(POWER_MANA)); - if (perc > e.event.minMaxRepeat.max || perc < e.event.minMaxRepeat.min) - return; - RecalcTimer(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax); - ProcessAction(e); - break; - } + { + if (!me || !me->isInCombat() || !me->GetMaxPower(POWER_MANA)) + return; + uint32 perc = uint32(100.0f * me->GetPower(POWER_MANA) / me->GetMaxPower(POWER_MANA)); + if (perc > e.event.minMaxRepeat.max || perc < e.event.minMaxRepeat.min) + return; + RecalcTimer(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax); + ProcessAction(e); + break; + } case SMART_EVENT_TARGET_MANA_PCT: - { - if (!me || !me->isInCombat() || !me->getVictim() || !me->getVictim()->GetMaxPower(POWER_MANA)) - return; - uint32 perc = uint32(100.0f * me->getVictim()->GetPower(POWER_MANA) / me->getVictim()->GetMaxPower(POWER_MANA)); - if (perc > e.event.minMaxRepeat.max || perc < e.event.minMaxRepeat.min) - return; - RecalcTimer(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax); - ProcessAction(e, me->getVictim()); - break; - } + { + if (!me || !me->isInCombat() || !me->getVictim() || !me->getVictim()->GetMaxPower(POWER_MANA)) + return; + uint32 perc = uint32(100.0f * me->getVictim()->GetPower(POWER_MANA) / me->getVictim()->GetMaxPower(POWER_MANA)); + if (perc > e.event.minMaxRepeat.max || perc < e.event.minMaxRepeat.min) + return; + RecalcTimer(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax); + ProcessAction(e, me->getVictim()); + break; + } case SMART_EVENT_RANGE: - { - if (!me || !me->isInCombat() || !me->getVictim()) - return; + { + if (!me || !me->isInCombat() || !me->getVictim()) + return; - if (me->IsInRange(me->getVictim(),(float)e.event.minMaxRepeat.min,(float)e.event.minMaxRepeat.max)) - { - ProcessAction(e, me->getVictim()); - RecalcTimer(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax); - } - break; - } - case SMART_EVENT_TARGET_CASTING: + if (me->IsInRange(me->getVictim(), (float)e.event.minMaxRepeat.min, (float)e.event.minMaxRepeat.max)) { - if (!me || !me->isInCombat() || !me->getVictim() || !me->getVictim()->IsNonMeleeSpellCasted(false, false, true)) - return; ProcessAction(e, me->getVictim()); - RecalcTimer(e, e.event.minMax.repeatMin, e.event.minMax.repeatMax); + RecalcTimer(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax); } + break; + } + case SMART_EVENT_TARGET_CASTING: + { + if (!me || !me->isInCombat() || !me->getVictim() || !me->getVictim()->IsNonMeleeSpellCasted(false, false, true)) + return; + ProcessAction(e, me->getVictim()); + RecalcTimer(e, e.event.minMax.repeatMin, e.event.minMax.repeatMax); + } case SMART_EVENT_FRIENDLY_HEALTH: { if (!me || !me->isInCombat()) @@ -1754,7 +2217,8 @@ void SmartScript::ProcessEvent(SmartScriptHolder &e, Unit* unit, uint32 var0, ui } case SMART_EVENT_HAS_AURA: { - if (!me) return; + if (!me) + return; uint32 count = me->GetAuraCount(e.event.aura.spell); if ((!e.event.aura.count && !count) || (e.event.aura.count && count >= e.event.aura.count)) { @@ -1765,8 +2229,10 @@ void SmartScript::ProcessEvent(SmartScriptHolder &e, Unit* unit, uint32 var0, ui } case SMART_EVENT_TARGET_BUFFED: { - if (!me || !me->getVictim()) return; - if (!me) return; + if (!me || !me->getVictim()) + return; + if (!me) + return; uint32 count = me->getVictim()->GetAuraCount(e.event.aura.spell); if (count < e.event.aura.count) return; @@ -1806,7 +2272,8 @@ void SmartScript::ProcessEvent(SmartScriptHolder &e, Unit* unit, uint32 var0, ui break; case SMART_EVENT_KILL: { - if (!me || !unit) return; + if (!me || !unit) + return; if (e.event.kill.playerOnly && unit->GetTypeId() != TYPEID_PLAYER) return; if (e.event.kill.creature && unit->GetEntry() != e.event.kill.creature) @@ -1818,9 +2285,10 @@ void SmartScript::ProcessEvent(SmartScriptHolder &e, Unit* unit, uint32 var0, ui case SMART_EVENT_SPELLHIT_TARGET: case SMART_EVENT_SPELLHIT: { - if (!spell) return; - if (!e.event.spellHit.spell || spell->Id == e.event.spellHit.spell) - if (!e.event.spellHit.school || (spell->SchoolMask & e.event.spellHit.school)) + if (!spell) + return; + if ((!e.event.spellHit.spell || spell->Id == e.event.spellHit.spell) && + (!e.event.spellHit.school || (spell->SchoolMask & e.event.spellHit.school))) { ProcessAction(e, unit, 0, 0, bvar, spell); RecalcTimer(e, e.event.spellHit.cooldownMin, e.event.spellHit.cooldownMax); @@ -1829,7 +2297,8 @@ void SmartScript::ProcessEvent(SmartScriptHolder &e, Unit* unit, uint32 var0, ui } case SMART_EVENT_OOC_LOS: { - if (!me || me->isInCombat()) return; + if (!me || me->isInCombat()) + return; //can trigger if closer than fMaxAllowedRange float range = (float)e.event.los.maxDist; @@ -1848,7 +2317,8 @@ void SmartScript::ProcessEvent(SmartScriptHolder &e, Unit* unit, uint32 var0, ui } case SMART_EVENT_IC_LOS: { - if (!me || !me->isInCombat()) return; + if (!me || !me->isInCombat()) + return; //can trigger if closer than fMaxAllowedRange float range = (float)e.event.los.maxDist; @@ -1867,7 +2337,8 @@ void SmartScript::ProcessEvent(SmartScriptHolder &e, Unit* unit, uint32 var0, ui } case SMART_EVENT_RESPAWN: { - if (!GetBaseObject()) return; + if (!GetBaseObject()) + return; if (e.event.respawn.type == SMART_SCRIPT_RESPAWN_CONDITION_MAP && GetBaseObject()->GetMapId() != e.event.respawn.map) return; if (e.event.respawn.type == SMART_SCRIPT_RESPAWN_CONDITION_AREA && GetBaseObject()->GetZoneId() != e.event.respawn.area) @@ -1877,7 +2348,8 @@ void SmartScript::ProcessEvent(SmartScriptHolder &e, Unit* unit, uint32 var0, ui } case SMART_EVENT_SUMMONED_UNIT: { - if (!IsCreature(unit)) return; + if (!IsCreature(unit)) + return; if (e.event.summoned.creature && unit->GetEntry() != e.event.summoned.creature) return; ProcessAction(e, unit); @@ -1891,7 +2363,7 @@ void SmartScript::ProcessEvent(SmartScriptHolder &e, Unit* unit, uint32 var0, ui if (var0 > e.event.minMaxRepeat.max || var0 < e.event.minMaxRepeat.min) return; ProcessAction(e, unit); - RecalcTimer(e, e.event.minMaxRepeat.repeatMin,e.event.minMaxRepeat.repeatMax); + RecalcTimer(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax); break; } case SMART_EVENT_MOVEMENTINFORM: @@ -1969,42 +2441,44 @@ void SmartScript::ProcessEvent(SmartScriptHolder &e, Unit* unit, uint32 var0, ui case SMART_EVENT_PASSENGER_REMOVED: case SMART_EVENT_PASSENGER_BOARDED: { - if (!unit) return; + if (!unit) + return; ProcessAction(e, unit); RecalcTimer(e, e.event.minMax.repeatMin, e.event.minMax.repeatMax); break; } case SMART_EVENT_TIMED_EVENT_TRIGGERED: - { - if (e.event.timedEvent.id == var0) - ProcessAction(e,unit); - break; - } + { + if (e.event.timedEvent.id == var0) + ProcessAction(e, unit); + break; + } case SMART_EVENT_GOSSIP_SELECT: - { - sLog->outString("SmartScript: Gossip Select: menu %u action %u", var0, var1);//little help for scripters - if (e.event.gossip.sender != var0 || e.event.gossip.action != var1) - return; - ProcessAction(e, unit, var0, var1); - break; - } + { + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript: Gossip Select: menu %u action %u", var0, var1);//little help for scripters + if (e.event.gossip.sender != var0 || e.event.gossip.action != var1) + return; + ProcessAction(e, unit, var0, var1); + break; + } case SMART_EVENT_DUMMY_EFFECT: - { - if (e.event.dummy.spell != var0 || e.event.dummy.effIndex != var1) - return; - ProcessAction(e, unit, var0, var1); - break; - } + { + if (e.event.dummy.spell != var0 || e.event.dummy.effIndex != var1) + return; + ProcessAction(e, unit, var0, var1); + break; + } default: sLog->outErrorDb("SmartScript::ProcessEvent: Unhandled Event type %u", e.GetEventType()); break; } } -void SmartScript::InitTimer(SmartScriptHolder &e) +void SmartScript::InitTimer(SmartScriptHolder& e) { switch (e.GetEventType()) - {//set only events which have initial timers + { + //set only events which have initial timers case SMART_EVENT_UPDATE: case SMART_EVENT_UPDATE_IC: case SMART_EVENT_UPDATE_OOC: @@ -2017,24 +2491,27 @@ void SmartScript::InitTimer(SmartScriptHolder &e) break; } } -void SmartScript::RecalcTimer(SmartScriptHolder &e, uint32 min, uint32 max) +void SmartScript::RecalcTimer(SmartScriptHolder& e, uint32 min, uint32 max) { // min/max was checked at loading! e.timer = urand(uint32(min), uint32(max)); e.active = e.timer ? false : true; } -void SmartScript::UpdateTimer(SmartScriptHolder &e, const uint32 diff) +void SmartScript::UpdateTimer(SmartScriptHolder& e, uint32 const diff) { if (e.GetEventType() == SMART_EVENT_LINK) return; + if (e.event.event_phase_mask && !IsInPhase(e.event.event_phase_mask)) return; if (e.GetEventType() == SMART_EVENT_UPDATE_IC && (!me || !me->isInCombat())) return; + if (e.GetEventType() == SMART_EVENT_UPDATE_OOC && (me && me->isInCombat()))//can be used with me=NULL (go script) return; + if (e.timer < diff) { e.active = true;//activate events with cooldown @@ -2072,10 +2549,12 @@ void SmartScript::UpdateTimer(SmartScriptHolder &e, const uint32 diff) break; } } - } else e.timer -= diff; + } + else + e.timer -= diff; } -bool SmartScript::CheckTimer(SmartScriptHolder &e) +bool SmartScript::CheckTimer(SmartScriptHolder const& e) const { return e.active; } @@ -2085,29 +2564,26 @@ void SmartScript::InstallEvents() if (!mInstallEvents.empty()) { for (SmartAIEventList::iterator i = mInstallEvents.begin(); i != mInstallEvents.end(); ++i) - { - mEvents.push_back((*i));//must be before UpdateTimers - } + mEvents.push_back(*i);//must be before UpdateTimers + mInstallEvents.clear(); } } -void SmartScript::OnUpdate(const uint32 diff) +void SmartScript::OnUpdate(uint32 const diff) { if ((mScriptType == SMART_SCRIPT_TYPE_CREATURE || mScriptType == SMART_SCRIPT_TYPE_GAMEOBJECT) && !GetBaseObject()) return; + InstallEvents();//before UpdateTimers for (SmartAIEventList::iterator i = mEvents.begin(); i != mEvents.end(); ++i) - UpdateTimer((*i), diff); + UpdateTimer(*i, diff); if (!mStoredEvents.empty()) - { for (SmartAIEventList::iterator i = mStoredEvents.begin(); i != mStoredEvents.end(); ++i) - { - UpdateTimer((*i), diff); - } - } + UpdateTimer(*i, diff); + bool needCleanup = true; if (!mTimedActionList.empty()) { @@ -2115,7 +2591,7 @@ void SmartScript::OnUpdate(const uint32 diff) { if ((*i).enableTimed) { - UpdateTimer((*i), diff); + UpdateTimer(*i, diff); needCleanup = false; } } @@ -2150,9 +2626,9 @@ void SmartScript::FillScript(SmartAIEventList e, WorldObject* obj, AreaTriggerEn if (e.empty()) { if (obj) - sLog->outDebug("SmartScript: EventMap for Entry %u is empty but is using SmartScript.", obj->GetEntry()); + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript: EventMap for Entry %u is empty but is using SmartScript.", obj->GetEntry()); if (at) - sLog->outDebug("SmartScript: EventMap for AreaTrigger %u is empty but is using SmartScript.", at->id); + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript: EventMap for AreaTrigger %u is empty but is using SmartScript.", at->id); return; } for (SmartAIEventList::iterator i = e.begin(); i != e.end(); ++i) @@ -2214,12 +2690,12 @@ void SmartScript::OnInitialize(WorldObject* obj, AreaTriggerEntry const* at) case TYPEID_UNIT: mScriptType = SMART_SCRIPT_TYPE_CREATURE; me = obj->ToCreature(); - sLog->outDebug("SmartScript::OnInitialize: source is Creature %u", me->GetEntry()); + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::OnInitialize: source is Creature %u", me->GetEntry()); break; case TYPEID_GAMEOBJECT: mScriptType = SMART_SCRIPT_TYPE_GAMEOBJECT; go = obj->ToGameObject(); - sLog->outDebug("SmartScript::OnInitialize: source is GameObject %u", go->GetEntry()); + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::OnInitialize: source is GameObject %u", go->GetEntry()); break; default: sLog->outError("SmartScript::OnInitialize: Unhandled TypeID !WARNING!"); @@ -2229,7 +2705,7 @@ void SmartScript::OnInitialize(WorldObject* obj, AreaTriggerEntry const* at) { mScriptType = SMART_SCRIPT_TYPE_AREATRIGGER; trigger = at; - sLog->outDebug("SmartScript::OnInitialize: source is AreaTrigger %u", trigger->id); + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::OnInitialize: source is AreaTrigger %u", trigger->id); } else { @@ -2264,7 +2740,6 @@ void SmartScript::UpdateAIWhileCharmed(const uint32 diff) { } - void SmartScript::DoAction(const int32 param) { } @@ -2305,7 +2780,6 @@ uint32 SmartScript::DoChat(int8 id, uint64 whisperGuid) }*/ // SmartScript end - Unit* SmartScript::DoSelectLowestHpFriendly(float range, uint32 MinHPDiff) { if (!me) return NULL; @@ -2357,7 +2831,7 @@ void SmartScript::DoFindFriendlyMissingBuff(std::list& _list, float r cell.Visit(p, grid_creature_searcher, *me->GetMap()); } -void SmartScript::SetScript9(SmartScriptHolder &e, uint32 entry) +void SmartScript::SetScript9(SmartScriptHolder& e, uint32 entry) { mTimedActionList.clear(); mTimedActionList = sSmartScriptMgr->GetScript(entry, SMART_SCRIPT_TYPE_TIMED_ACTIONLIST); @@ -2378,4 +2852,7 @@ void SmartScript::SetScript9(SmartScriptHolder &e, uint32 entry) mResumeActionList = e.action.timedActionList.dontResume ? false : true; InitTimer((*i)); } +}Unit* SmartScript::GetLastInvoker() +{ + return ObjectAccessor::FindUnit(mLastInvoker); } diff --git a/src/server/game/AI/SmartScripts/SmartScript.h b/src/server/game/AI/SmartScripts/SmartScript.h index 08ee5570a89ca..8b0fb3bbca32e 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.h +++ b/src/server/game/AI/SmartScripts/SmartScript.h @@ -33,20 +33,20 @@ class SmartScript { public: - ~SmartScript(){}; SmartScript(); + ~SmartScript(); void OnInitialize(WorldObject* obj, AreaTriggerEntry const* at = NULL); void GetScript(); void FillScript(SmartAIEventList e, WorldObject* obj, AreaTriggerEntry const* at); void ProcessEventsFor(SMART_EVENT e, Unit* unit = NULL, uint32 var0 = 0, uint32 var1 = 0, bool bvar = false, const SpellEntry* spell = NULL, GameObject* gob = NULL); - void ProcessEvent(SmartScriptHolder &e, Unit* unit = NULL, uint32 var0 = 0, uint32 var1 = 0, bool bvar = false, const SpellEntry* spell = NULL, GameObject* gob = NULL); - bool CheckTimer(SmartScriptHolder &e); - void RecalcTimer(SmartScriptHolder &e, uint32 min, uint32 max); - void UpdateTimer(SmartScriptHolder &e, const uint32 diff); - void InitTimer(SmartScriptHolder &e); - void ProcessAction(SmartScriptHolder &e, Unit* unit = NULL, uint32 var0 = 0, uint32 var1 = 0, bool bvar = false, const SpellEntry* spell = NULL, GameObject* gob = NULL); + void ProcessEvent(SmartScriptHolder& e, Unit* unit = NULL, uint32 var0 = 0, uint32 var1 = 0, bool bvar = false, const SpellEntry* spell = NULL, GameObject* gob = NULL); + bool CheckTimer(SmartScriptHolder const& e) const; + void RecalcTimer(SmartScriptHolder& e, uint32 min, uint32 max); + void UpdateTimer(SmartScriptHolder& e, uint32 const diff); + void InitTimer(SmartScriptHolder& e); + void ProcessAction(SmartScriptHolder& e, Unit* unit = NULL, uint32 var0 = 0, uint32 var1 = 0, bool bvar = false, const SpellEntry* spell = NULL, GameObject* gob = NULL); ObjectList* GetTargets(SmartScriptHolder e, Unit* invoker = NULL); ObjectList* GetWorldObjectsInDist(float dist); void InstallTemplate(SmartScriptHolder e); @@ -63,22 +63,27 @@ class SmartScript obj = go; return obj; } + bool IsUnit(WorldObject* obj) { return obj && (obj->GetTypeId() == TYPEID_UNIT || obj->GetTypeId() == TYPEID_PLAYER); } + bool IsPlayer(WorldObject* obj) { return obj && obj->GetTypeId() == TYPEID_PLAYER; } + bool IsCreature(WorldObject* obj) { return obj && obj->GetTypeId() == TYPEID_UNIT; } + bool IsGameObject(WorldObject* obj) { return obj && obj->GetTypeId() == TYPEID_GAMEOBJECT; } + bool ConditionValid(Unit* u, int32 c, int32 v1, int32 v2, int32 v3) { if (c == 0) return true; @@ -92,7 +97,7 @@ class SmartScript } void OnUpdate(const uint32 diff); - void OnMoveInLineOfSight(Unit *who); + void OnMoveInLineOfSight(Unit* who); Unit* DoSelectLowestHpFriendly(float range, uint32 MinHPDiff); void DoFindFriendlyCC(std::list& _list, float range); @@ -100,29 +105,43 @@ class SmartScript void StoreTargetList(ObjectList* targets, uint32 id) { - if (!targets) return; - if(mTargetStorage->find(id) != mTargetStorage->end()) - mTargetStorage->erase(id); + if (!targets) + return; + + if (mTargetStorage->find(id) != mTargetStorage->end()) + delete (*mTargetStorage)[id]; + (*mTargetStorage)[id] = targets; } + bool IsSmart(Creature* c = NULL) { bool smart = true; - if (c && c->GetAIName() != "SmartAI") smart = false; - if (!me || me->GetAIName() != "SmartAI") smart = false; + if (c && c->GetAIName() != "SmartAI") + smart = false; + + if (!me || me->GetAIName() != "SmartAI") + smart = false; + if (!smart) sLog->outErrorDb("SmartScript: Action target Creature(entry: %u) is not using SmartAI, action skipped to prevent crash.", c?c->GetEntry():(me?me->GetEntry():0)); return smart; } + bool IsSmartGO(GameObject* g = NULL) { bool smart = true; - if (g && g->GetAIName() != "SmartGameObjectAI") smart = false; - if (!go || go->GetAIName() != "SmartGameObjectAI") smart = false; + if (g && g->GetAIName() != "SmartGameObjectAI") + smart = false; + + if (!go || go->GetAIName() != "SmartGameObjectAI") + smart = false; if (!smart) + sLog->outErrorDb("SmartScript: Action target GameObject(entry: %u) is not using SmartGameObjectAI, action skipped to prevent crash.", g?g->GetEntry():(go?go->GetEntry():0)); return smart; } + ObjectList* GetTargetList(uint32 id) { ObjectListMap::iterator itr = mTargetStorage->find(id); @@ -131,9 +150,9 @@ class SmartScript return NULL; } - inline GameObject* FindGameObjectNear(WorldObject* pSearchObject, uint32 guid) const + GameObject* FindGameObjectNear(WorldObject* pSearchObject, uint32 guid) const { - GameObject *pGameObject = NULL; + GameObject* pGameObject = NULL; CellPair p(Trinity::ComputeCellPair(pSearchObject->GetPositionX(), pSearchObject->GetPositionY())); Cell cell(p); @@ -148,9 +167,9 @@ class SmartScript return pGameObject; } - inline Creature* FindCreatureNear(WorldObject* pSearchObject, uint32 guid) const + Creature* FindCreatureNear(WorldObject* pSearchObject, uint32 guid) const { - Creature *crea = NULL; + Creature* crea = NULL; CellPair p(Trinity::ComputeCellPair(pSearchObject->GetPositionX(), pSearchObject->GetPositionY())); Cell cell(p); cell.data.Part.reserved = ALL_DISTRICT; @@ -190,16 +209,19 @@ class SmartScript } //TIMED_ACTIONLIST (script type 9 aka script9) - void SetScript9(SmartScriptHolder &e, uint32 entry); - Unit* mLastInvoker; + void SetScript9(SmartScriptHolder& e, uint32 entry); + Unit* GetLastInvoker(); + uint64 mLastInvoker; private: - void IncPhase(int32 p = 1) { + void IncPhase(int32 p = 1) + { if(p >= 0) mEventPhase += (uint32)p; else DecPhase(abs(p)); } + void DecPhase(int32 p = 1) { mEventPhase -= (mEventPhase < (uint32)p ? (uint32)p - mEventPhase : (uint32)p); } bool IsInPhase(uint32 p) const { return mEventPhase & p; } void SetPhase(uint32 p = 0) { mEventPhase = p; } diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp index 1f4185ac01a2f..58e3dde547e9c 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp @@ -15,7 +15,6 @@ * with this program. If not, see . */ - #include "DatabaseEnv.h" #include "SQLStorage.h" #include "ObjectMgr.h" @@ -55,7 +54,7 @@ void SmartWaypointMgr::LoadFromDB() do { - Field *fields = result->Fetch(); + Field* fields = result->Fetch(); uint32 entry = fields[0].GetUInt32(); uint32 id = fields[1].GetUInt32(); float x,y,z; @@ -63,8 +62,7 @@ void SmartWaypointMgr::LoadFromDB() y = fields[3].GetFloat(); z = fields[4].GetFloat(); - - WayPoint *wp = new WayPoint(id, x, y, z); + WayPoint* wp = new WayPoint(id, x, y, z); if (last_entry != entry) { @@ -118,7 +116,7 @@ void SmartAIMgr::LoadSmartAIFromDB() SmartScriptHolder temp; temp.entryOrGuid = fields[0].GetInt32(); - SmartScriptType source_type = (SmartScriptType)fields[1].GetUInt32(); + SmartScriptType source_type = (SmartScriptType)fields[1].GetUInt8(); if (source_type >= SMART_SCRIPT_TYPE_MAX) { sLog->outErrorDb("SmartAIMgr::LoadSmartAIFromDB: invalid source_type (%u), skipped loading.", uint32(source_type)); @@ -170,19 +168,19 @@ void SmartAIMgr::LoadSmartAIFromDB() } } temp.source_type = source_type; - temp.event_id = fields[2].GetUInt32(); - temp.link = fields[3].GetUInt32(); - temp.event.type = (SMART_EVENT)fields[4].GetUInt32(); - temp.event.event_phase_mask = fields[5].GetUInt32(); - temp.event.event_chance = fields[6].GetUInt32(); - temp.event.event_flags = fields[7].GetUInt32(); + temp.event_id = fields[2].GetUInt16(); + temp.link = fields[3].GetUInt16(); + temp.event.type = (SMART_EVENT)fields[4].GetUInt8(); + temp.event.event_phase_mask = fields[5].GetUInt8(); + temp.event.event_chance = fields[6].GetUInt8(); + temp.event.event_flags = fields[7].GetUInt8(); temp.event.raw.param1 = fields[8].GetUInt32(); temp.event.raw.param2 = fields[9].GetUInt32(); temp.event.raw.param3 = fields[10].GetUInt32(); temp.event.raw.param4 = fields[11].GetUInt32(); - temp.action.type = (SMART_ACTION)fields[12].GetUInt32(); + temp.action.type = (SMART_ACTION)fields[12].GetUInt8(); temp.action.raw.param1 = fields[13].GetUInt32(); temp.action.raw.param2 = fields[14].GetUInt32(); @@ -191,7 +189,7 @@ void SmartAIMgr::LoadSmartAIFromDB() temp.action.raw.param5 = fields[17].GetUInt32(); temp.action.raw.param6 = fields[18].GetUInt32(); - temp.target.type = (SMARTAI_TARGETS)fields[19].GetUInt32(); + temp.target.type = (SMARTAI_TARGETS)fields[19].GetUInt8(); temp.target.raw.param1 = fields[20].GetUInt32(); temp.target.raw.param2 = fields[21].GetUInt32(); temp.target.raw.param3 = fields[22].GetUInt32(); @@ -316,7 +314,8 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder &e) } else { - switch (e.event.type) + uint32 type = e.event.type; + switch (type) { case SMART_EVENT_UPDATE: case SMART_EVENT_UPDATE_IC: @@ -583,7 +582,6 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder &e) break; - case SMART_ACTION_SET_EVENT_PHASE: if (e.action.setEventPhase.phase >= SMART_EVENT_PHASE_MAX) { @@ -769,6 +767,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder &e) case SMART_ACTION_SET_UNIT_FIELD_BYTES_1: case SMART_ACTION_REMOVE_UNIT_FIELD_BYTES_1: case SMART_ACTION_INTERRUPT_SPELL: + case SMART_ACTION_SEND_GO_CUSTOM_ANIM: break; default: sLog->outErrorDb("SmartAIMgr: Not handled action_type(%u), event_type(%u), Entry %d SourceType %u Event %u, skipped.", e.GetActionType(), e.GetEventType(), e.entryOrGuid, e.GetScriptType(), e.event_id); diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h index 0dcb166070f91..7095acb8c3043 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h @@ -149,7 +149,7 @@ enum SMART_EVENT SMART_EVENT_GOSSIP_SELECT = 62, //1 // menuID, actionID SMART_EVENT_JUST_CREATED = 63, //1 // none SMART_EVENT_GOSSIP_HELLO = 64, //1 // none - SMART_EVENT_FOLLOW_COMPLETED = 65, //1 // none + SMART_EVENT_FOLLOW_COMPLETED = 65, //1 // none SMART_EVENT_DUMMY_EFFECT = 66, //1 // spellId, effectIndex SMART_EVENT_END = 67, @@ -445,12 +445,13 @@ enum SMART_ACTION SMART_ACTION_RANDOM_MOVE = 89, // maxDist SMART_ACTION_SET_UNIT_FIELD_BYTES_1 = 90, // bytes, target - SMART_ACTION_REMOVE_UNIT_FIELD_BYTES_1 = 91, // bytes, target SMART_ACTION_INTERRUPT_SPELL = 92, - SMART_ACTION_END = 93, + SMART_ACTION_SEND_GO_CUSTOM_ANIM = 93, // anim id + + SMART_ACTION_END = 94, }; struct SmartAction @@ -691,7 +692,6 @@ struct SmartAction uint32 id; } taxi; - struct { uint32 run; @@ -761,7 +761,6 @@ struct SmartAction uint32 id; } storeTargets; - struct { uint32 id; @@ -829,6 +828,11 @@ struct SmartAction uint32 spell_id; bool withInstant; } interruptSpellCasting; + + struct + { + uint32 anim; + } sendGoCustomAnim; struct { uint32 param1; @@ -1203,7 +1207,7 @@ class SmartAIMgr else { if(entry > 0)//first search is for guid (negative), do not drop error if not found - sLog->outDebug("SmartAIMgr::GetScript: Could not load Script for Entry %d ScriptType %u.", entry, uint32(type)); + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartAIMgr::GetScript: Could not load Script for Entry %d ScriptType %u.", entry, uint32(type)); return temp; } } diff --git a/src/server/game/Accounts/AccountMgr.cpp b/src/server/game/Accounts/AccountMgr.cpp index 3c0072b54fad9..cf1fb265c300a 100755 --- a/src/server/game/Accounts/AccountMgr.cpp +++ b/src/server/game/Accounts/AccountMgr.cpp @@ -74,8 +74,12 @@ AccountOpResult AccountMgr::DeleteAccount(uint32 accid) } // table realm specific but common for all characters of account for realm - CharacterDatabase.PExecute("DELETE FROM character_tutorial WHERE account = '%u'",accid); - CharacterDatabase.PExecute("DELETE FROM account_data WHERE account = '%u'",accid); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_TUTORIALS); + stmt->setUInt32(0, accid); + CharacterDatabase.Execute(stmt); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ACCOUNT_DATA); + stmt->setUInt32(0, accid); + CharacterDatabase.Execute(stmt); SQLTransaction trans = LoginDatabase.BeginTransaction(); diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index 3d79c69cbca23..755f52eeae23c 100755 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -422,8 +422,7 @@ void AchievementMgr::Reset() void AchievementMgr::ResetAchievementCriteria(AchievementCriteriaTypes type, uint32 miscvalue1, uint32 miscvalue2, bool evenIfCriteriaComplete) { - if ((sLog->getLogFilter() & LOG_FILTER_ACHIEVEMENT_UPDATES) == 0) - sLog->outDetail("AchievementMgr::ResetAchievementCriteria(%u, %u, %u)", type, miscvalue1, miscvalue2); + sLog->outDebug(LOG_FILTER_ACHIEVEMENTSYS, "AchievementMgr::ResetAchievementCriteria(%u, %u, %u)", type, miscvalue1, miscvalue2); if (!sWorld->getBoolConfig(CONFIG_GM_ALLOW_ACHIEVEMENT_GAINS) && m_player->GetSession()->GetSecurity() > SEC_PLAYER) return; @@ -442,9 +441,9 @@ void AchievementMgr::ResetAchievementCriteria(AchievementCriteriaTypes type, uin continue; for (uint8 j = 0; j < MAX_CRITERIA_REQUIREMENTS; ++j) - if (achievementCriteria->additionalRequrements[j].additionalRequirement_type == miscvalue1 && - (!achievementCriteria->additionalRequrements[j].additionalRequirement_value || - achievementCriteria->additionalRequrements[j].additionalRequirement_value == miscvalue2)) + if (achievementCriteria->additionalRequirements[j].additionalRequirement_type == miscvalue1 && + (!achievementCriteria->additionalRequirements[j].additionalRequirement_value || + achievementCriteria->additionalRequirements[j].additionalRequirement_value == miscvalue2)) { RemoveCriteriaProgress(achievementCriteria); break; @@ -623,18 +622,17 @@ void AchievementMgr::LoadFromDB(PreparedQueryResult achievementResult, PreparedQ } } -void AchievementMgr::SendAchievementEarned(AchievementEntry const* achievement) +void AchievementMgr::SendAchievementEarned(AchievementEntry const* achievement) const { if (GetPlayer()->GetSession()->PlayerLoading()) return; // Don't send for achievements with ACHIEVEMENT_FLAG_TRACKING - if (achievement->flags & ACHIEVEMENT_FLAG_TRACKING) + if (achievement->flags & ACHIEVEMENT_FLAG_HIDDEN) return; #ifdef TRINITY_DEBUG - if ((sLog->getLogFilter() & LOG_FILTER_ACHIEVEMENT_UPDATES) == 0) - sLog->outDebug("AchievementMgr::SendAchievementEarned(%u)", achievement->ID); + sLog->outDebug(LOG_FILTER_ACHIEVEMENTSYS, "AchievementMgr::SendAchievementEarned(%u)", achievement->ID); #endif if (Guild* guild = sObjectMgr->GetGuildById(GetPlayer()->GetGuildId())) @@ -663,9 +661,9 @@ void AchievementMgr::SendAchievementEarned(AchievementEntry const* achievement) cell.data.Part.reserved = ALL_DISTRICT; cell.SetNoCreate(); - Trinity::AchievementChatBuilder say_builder(*GetPlayer(), CHAT_MSG_ACHIEVEMENT, LANG_ACHIEVEMENT_EARNED,achievement->ID); + Trinity::AchievementChatBuilder say_builder(*GetPlayer(), CHAT_MSG_ACHIEVEMENT, LANG_ACHIEVEMENT_EARNED, achievement->ID); Trinity::LocalizedPacketDo say_do(say_builder); - Trinity::PlayerDistWorker > say_worker(GetPlayer(),sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY),say_do); + Trinity::PlayerDistWorker > say_worker(GetPlayer(), sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), say_do); TypeContainerVisitor >, WorldTypeMapContainer > message(say_worker); cell.Visit(p, message, *GetPlayer()->GetMap(), *GetPlayer(), sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY)); } @@ -678,7 +676,7 @@ void AchievementMgr::SendAchievementEarned(AchievementEntry const* achievement) GetPlayer()->SendMessageToSetInRange(&data, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), true); } -void AchievementMgr::SendCriteriaUpdate(AchievementCriteriaEntry const* entry, CriteriaProgress const* progress, uint32 timeElapsed, bool timedCompleted) +void AchievementMgr::SendCriteriaUpdate(AchievementCriteriaEntry const* entry, CriteriaProgress const* progress, uint32 timeElapsed, bool timedCompleted) const { WorldPacket data(SMSG_CRITERIA_UPDATE, 8+4+8); data << uint32(entry->ID); @@ -708,7 +706,7 @@ void AchievementMgr::CheckAllAchievementCriteria() } static const uint32 achievIdByArenaSlot[MAX_ARENA_SLOT] = { 1057, 1107, 1108 }; -static const uint32 achievIdForDangeon[][4] = +static const uint32 achievIdForDungeon[][4] = { // ach_cr_id,is_dungeon,is_raid,is_heroic_dungeon { 321, true, true, true }, @@ -724,8 +722,7 @@ static const uint32 achievIdForDangeon[][4] = */ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscvalue1, uint32 miscvalue2, Unit *unit, uint32 time) { - if ((sLog->getLogFilter() & LOG_FILTER_ACHIEVEMENT_UPDATES) == 0) - sLog->outDetail("AchievementMgr::UpdateAchievementCriteria(%u, %u, %u, %u)", type, miscvalue1, miscvalue2, time); + sLog->outDebug(LOG_FILTER_ACHIEVEMENTSYS, "AchievementMgr::UpdateAchievementCriteria(%u, %u, %u, %u)", type, miscvalue1, miscvalue2, time); if (!sWorld->getBoolConfig(CONFIG_GM_ALLOW_ACHIEVEMENT_GAINS) && m_player->GetSession()->GetSecurity() > SEC_PLAYER) return; @@ -734,19 +731,11 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui for (AchievementCriteriaEntryList::const_iterator i = achievementCriteriaList.begin(); i != achievementCriteriaList.end(); ++i) { AchievementCriteriaEntry const *achievementCriteria = (*i); - if (sDisableMgr->IsDisabledFor(DISABLE_TYPE_ACHIEVEMENT_CRITERIA, achievementCriteria->ID, NULL)) - continue; - AchievementEntry const *achievement = sAchievementStore.LookupEntry(achievementCriteria->referredAchievement); if (!achievement) continue; - if ((achievement->factionFlag == ACHIEVEMENT_FACTION_HORDE && GetPlayer()->GetTeam() != HORDE) || - (achievement->factionFlag == ACHIEVEMENT_FACTION_ALLIANCE && GetPlayer()->GetTeam() != ALLIANCE)) - continue; - - // don't update already completed criteria - if (IsCompletedCriteria(achievementCriteria,achievement)) + if (!CanUpdateCriteria(achievementCriteria, achievement)) continue; switch (type) @@ -955,26 +944,26 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui // search case bool found = false; - for (int j = 0; achievIdForDangeon[j][0]; ++j) + for (int j = 0; achievIdForDungeon[j][0]; ++j) { - if (achievIdForDangeon[j][0] == achievement->ID) + if (achievIdForDungeon[j][0] == achievement->ID) { if (map->IsRaid()) { // if raid accepted (ignore difficulty) - if (!achievIdForDangeon[j][2]) + if (!achievIdForDungeon[j][2]) break; // for } else if (GetPlayer()->GetDungeonDifficulty() == DUNGEON_DIFFICULTY_NORMAL) { // dungeon in normal mode accepted - if (!achievIdForDangeon[j][1]) + if (!achievIdForDungeon[j][1]) break; // for } else { // dungeon in heroic mode accepted - if (!achievIdForDangeon[j][3]) + if (!achievIdForDungeon[j][3]) break; // for } @@ -1115,7 +1104,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui break; case ACHIEVEMENT_CRITERIA_TYPE_LOOT_TYPE: { - // miscvalue1=loot_type (note: 0 = LOOT_CORSPE and then it ignored) + // miscvalue1=loot_type (note: 0 = LOOT_CORPSE and then it ignored) // miscvalue2=count of item loot if (!miscvalue1 || !miscvalue2) continue; @@ -1146,7 +1135,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui continue; // additional requirements - if (achievementCriteria->additionalRequrements[0].additionalRequirement_type == ACHIEVEMENT_CRITERIA_CONDITION_NO_LOSE) + if (achievementCriteria->additionalRequirements[0].additionalRequirement_type == ACHIEVEMENT_CRITERIA_CONDITION_NO_LOSE) { // those requirements couldn't be found in the dbc AchievementCriteriaDataSet const* data = sAchievementMgr->GetCriteriaDataSet(achievementCriteria); @@ -1299,9 +1288,9 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui if (!miscvalue1) continue; - if (achievementCriteria->additionalRequrements[0].additionalRequirement_type == ACHIEVEMENT_CRITERIA_CONDITION_MAP) + if (achievementCriteria->additionalRequirements[0].additionalRequirement_type == ACHIEVEMENT_CRITERIA_CONDITION_MAP) { - if (GetPlayer()->GetMapId() != achievementCriteria->additionalRequrements[0].additionalRequirement_value) + if (GetPlayer()->GetMapId() != achievementCriteria->additionalRequirements[0].additionalRequirement_value) continue; // map specific case (BG in fact) expected player targeted damage/heal @@ -1530,23 +1519,19 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui break; // Not implemented yet :( } - if (IsCompletedCriteria(achievementCriteria,achievement)) + if (IsCompletedCriteria(achievementCriteria, achievement)) CompletedCriteriaFor(achievement); // check again the completeness for SUMM and REQ COUNT achievements, // as they don't depend on the completed criteria but on the sum of the progress of each individual criteria if (achievement->flags & ACHIEVEMENT_FLAG_SUMM) - { if (IsCompletedAchievement(achievement)) CompletedAchievement(achievement); - } if (AchievementEntryList const* achRefList = sAchievementMgr->GetAchievementByReferencedId(achievement->ID)) - { for (AchievementEntryList::const_iterator itr = achRefList->begin(); itr != achRefList->end(); ++itr) if (IsCompletedAchievement(*itr)) CompletedAchievement(*itr); - } } } @@ -1570,7 +1555,6 @@ bool AchievementMgr::IsCompletedCriteria(AchievementCriteriaEntry const* achieve if (!progress) return false; - switch (achievementCriteria->requiredType) { case ACHIEVEMENT_CRITERIA_TYPE_WIN_BG: @@ -1816,8 +1800,7 @@ void AchievementMgr::SetCriteriaProgress(AchievementCriteriaEntry const* entry, if (entry->timeLimit && timedIter == m_timedAchievements.end()) return; - if ((sLog->getLogFilter() & LOG_FILTER_ACHIEVEMENT_UPDATES) == 0) - sLog->outDetail("AchievementMgr::SetCriteriaProgress(%u, %u) for (GUID:%u)", entry->ID, changeValue, m_player->GetGUIDLow()); + sLog->outDebug(LOG_FILTER_ACHIEVEMENTSYS, "AchievementMgr::SetCriteriaProgress(%u, %u) for (GUID:%u)", entry->ID, changeValue, m_player->GetGUIDLow()); CriteriaProgress* progress = GetCriteriaProgress(entry); if (!progress) @@ -2031,14 +2014,14 @@ void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement, b } } -void AchievementMgr::SendAllAchievementData() +void AchievementMgr::SendAllAchievementData() const { WorldPacket data(SMSG_ALL_ACHIEVEMENT_DATA, m_completedAchievements.size()*8+4+m_criteriaProgress.size()*38+4); BuildAllDataPacket(&data); GetPlayer()->GetSession()->SendPacket(&data); } -void AchievementMgr::SendRespondInspectAchievements(Player* player) +void AchievementMgr::SendRespondInspectAchievements(Player* player) const { WorldPacket data(SMSG_RESPOND_INSPECT_ACHIEVEMENTS, 9+m_completedAchievements.size()*8+4+m_criteriaProgress.size()*38+4); data.append(GetPlayer()->GetPackGUID()); @@ -2049,14 +2032,14 @@ void AchievementMgr::SendRespondInspectAchievements(Player* player) /** * used by SMSG_RESPOND_INSPECT_ACHIEVEMENT and SMSG_ALL_ACHIEVEMENT_DATA */ -void AchievementMgr::BuildAllDataPacket(WorldPacket *data) +void AchievementMgr::BuildAllDataPacket(WorldPacket *data) const { - AchievementEntry const *achievement; + AchievementEntry const* achievement = NULL; for (CompletedAchievementMap::const_iterator iter = m_completedAchievements.begin(); iter != m_completedAchievements.end(); ++iter) { - // Skip tracking - they bug client UI + // Skip hidden achievements achievement = sAchievementStore.LookupEntry(iter->first); - if (achievement->flags & ACHIEVEMENT_FLAG_TRACKING) + if (achievement->flags & ACHIEVEMENT_FLAG_HIDDEN) continue; *data << uint32(iter->first); @@ -2083,17 +2066,43 @@ bool AchievementMgr::HasAchieved(AchievementEntry const* achievement) const return m_completedAchievements.find(achievement->ID) != m_completedAchievements.end(); } -//========================================================== -AchievementCriteriaEntryList const& AchievementGlobalMgr::GetAchievementCriteriaByType(AchievementCriteriaTypes type) +bool AchievementMgr::CanUpdateCriteria(AchievementCriteriaEntry const* criteria, AchievementEntry const* achievement) { - return m_AchievementCriteriasByType[type]; -} + if (sDisableMgr->IsDisabledFor(DISABLE_TYPE_ACHIEVEMENT_CRITERIA, criteria->ID, NULL)) + return false; -AchievementCriteriaEntryList const& AchievementGlobalMgr::GetTimedAchievementCriteriaByType(AchievementCriteriaTimedTypes type) -{ - return m_AchievementCriteriasByTimedType[type]; + if ((achievement->requiredFaction == ACHIEVEMENT_FACTION_HORDE && GetPlayer()->GetTeam() != HORDE) || + (achievement->requiredFaction == ACHIEVEMENT_FACTION_ALLIANCE && GetPlayer()->GetTeam() != ALLIANCE)) + return false; + + for (uint32 i = 0; i < MAX_CRITERIA_REQUIREMENTS; ++i) + { + if (!criteria->additionalRequirements[i].additionalRequirement_type) + continue; + + switch (criteria->additionalRequirements[i].additionalRequirement_type) + { + case ACHIEVEMENT_CRITERIA_CONDITION_MAP: + if (GetPlayer()->GetMapId() != criteria->additionalRequirements[i].additionalRequirement_value) + return false; + break; + case ACHIEVEMENT_CRITERIA_CONDITION_NOT_IN_GROUP: + if (GetPlayer()->GetGroup()) + return false; + break; + default: + break; + } + } + + // don't update already completed criteria + if (IsCompletedCriteria(criteria, achievement)) + return false; + + return true; } +//========================================================== void AchievementGlobalMgr::LoadAchievementCriteriaList() { uint32 oldMSTime = getMSTime(); @@ -2250,7 +2259,7 @@ void AchievementGlobalMgr::LoadAchievementCriteriaData() case ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL: // any cases break; case ACHIEVEMENT_CRITERIA_TYPE_WIN_RATED_ARENA: // need skip generic cases - if (criteria->additionalRequrements[0].additionalRequirement_type != ACHIEVEMENT_CRITERIA_CONDITION_NO_LOSE) + if (criteria->additionalRequirements[0].additionalRequirement_type != ACHIEVEMENT_CRITERIA_CONDITION_NO_LOSE) continue; break; case ACHIEVEMENT_CRITERIA_TYPE_EQUIP_EPIC_ITEM: // any cases @@ -2371,7 +2380,7 @@ void AchievementGlobalMgr::LoadRewards() continue; } - if (pAchievement->factionFlag == ACHIEVEMENT_FACTION_ANY && ((reward.titleId[0] == 0) != (reward.titleId[1] == 0))) + if (pAchievement->requiredFaction == ACHIEVEMENT_FACTION_ANY && ((reward.titleId[0] == 0) != (reward.titleId[1] == 0))) sLog->outErrorDb("Table `achievement_reward` (Entry: %u) has title (A: %u H: %u) for only one team.", entry, reward.titleId[0], reward.titleId[1]); if (reward.titleId[0]) @@ -2451,7 +2460,6 @@ void AchievementGlobalMgr::LoadRewardLocales() return; } - do { Field *fields = result->Fetch(); diff --git a/src/server/game/Achievements/AchievementMgr.h b/src/server/game/Achievements/AchievementMgr.h index a5d2f541730c3..e419976bf73e1 100755 --- a/src/server/game/Achievements/AchievementMgr.h +++ b/src/server/game/Achievements/AchievementMgr.h @@ -255,26 +255,26 @@ class AchievementMgr void UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscvalue1 = 0, uint32 miscvalue2 = 0, Unit *unit = NULL, uint32 time = 0); void CompletedAchievement(AchievementEntry const* entry, bool ignoreGMAllowAchievementConfig = false); void CheckAllAchievementCriteria(); - void SendAllAchievementData(); - void SendRespondInspectAchievements(Player* player); + void SendAllAchievementData() const; + void SendRespondInspectAchievements(Player* player) const; bool HasAchieved(AchievementEntry const* achievement) const; - Player* GetPlayer() { return m_player; } + Player* GetPlayer() const { return m_player; } void UpdateTimedAchievements(uint32 timeDiff); void StartTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry, uint32 timeLost = 0); void RemoveTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry); // used for quest and scripted timed achievements private: 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); + void SendAchievementEarned(AchievementEntry const* achievement) const; + void SendCriteriaUpdate(AchievementCriteriaEntry const* entry, CriteriaProgress const* progress, uint32 timeElapsed, bool timedCompleted) const; CriteriaProgress* GetCriteriaProgress(AchievementCriteriaEntry const* entry); void SetCriteriaProgress(AchievementCriteriaEntry const* entry, uint32 changeValue, ProgressType ptype = PROGRESS_SET); void RemoveCriteriaProgress(AchievementCriteriaEntry const* entry); void CompletedCriteriaFor(AchievementEntry const* achievement); - bool IsCompletedCriteria(AchievementCriteriaEntry const* criteria, AchievementEntry const* achievement); + bool IsCompletedCriteria(AchievementCriteriaEntry const* achievementCriteria, AchievementEntry const* achievement); bool IsCompletedAchievement(AchievementEntry const* entry); - //void CompleteAchievementsWithRefs(AchievementEntry const* entry); - void BuildAllDataPacket(WorldPacket *data); + bool CanUpdateCriteria(AchievementCriteriaEntry const* criteria, AchievementEntry const* achievement); + void BuildAllDataPacket(WorldPacket *data) const; Player* m_player; CriteriaProgressMap m_criteriaProgress; @@ -290,9 +290,17 @@ class AchievementGlobalMgr ~AchievementGlobalMgr() {} public: - AchievementCriteriaEntryList const& GetAchievementCriteriaByType(AchievementCriteriaTypes type); - AchievementCriteriaEntryList const& GetTimedAchievementCriteriaByType(AchievementCriteriaTimedTypes type); - AchievementCriteriaEntryList const* GetAchievementCriteriaByAchievement(uint32 id) + AchievementCriteriaEntryList const& GetAchievementCriteriaByType(AchievementCriteriaTypes type) const + { + return m_AchievementCriteriasByType[type]; + } + + AchievementCriteriaEntryList const& GetTimedAchievementCriteriaByType(AchievementCriteriaTimedTypes type) const + { + return m_AchievementCriteriasByTimedType[type]; + } + + AchievementCriteriaEntryList const* GetAchievementCriteriaByAchievement(uint32 id) const { AchievementCriteriaListByAchievement::const_iterator itr = m_AchievementCriteriaListByAchievement.find(id); return itr != m_AchievementCriteriaListByAchievement.end() ? &itr->second : NULL; @@ -316,7 +324,7 @@ class AchievementGlobalMgr return iter != m_achievementRewardLocales.end() ? &iter->second : NULL; } - AchievementCriteriaDataSet const* GetCriteriaDataSet(AchievementCriteriaEntry const *achievementCriteria) + AchievementCriteriaDataSet const* GetCriteriaDataSet(AchievementCriteriaEntry const *achievementCriteria) const { AchievementCriteriaDataMap::const_iterator iter = m_criteriaDataMap.find(achievementCriteria->ID); return iter != m_criteriaDataMap.end() ? &iter->second : NULL; diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp index 8a04b75434c01..fa8381e1ae25b 100644 --- a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp +++ b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp @@ -76,10 +76,10 @@ uint32 AuctionHouseMgr::GetAuctionDeposit(AuctionHouseEntry const* entry, uint32 uint32 timeHr = (((time / 60) / 60) / 12); uint32 deposit = uint32(((multiplier * MSV * count / 3) * timeHr * 3) * sWorld->getRate(RATE_AUCTION_DEPOSIT)); - sLog->outDebug("MSV: %u", MSV); - sLog->outDebug("Items: %u", count); - sLog->outDebug("Multiplier: %f", multiplier); - sLog->outDebug("Deposit: %u", deposit); + sLog->outDebug(LOG_FILTER_AUCTIONHOUSE, "MSV: %u", MSV); + sLog->outDebug(LOG_FILTER_AUCTIONHOUSE, "Items: %u", count); + sLog->outDebug(LOG_FILTER_AUCTIONHOUSE, "Multiplier: %f", multiplier); + sLog->outDebug(LOG_FILTER_AUCTIONHOUSE, "Deposit: %u", deposit); if (deposit < AH_MINIMUM_DEPOSIT) return AH_MINIMUM_DEPOSIT; @@ -142,7 +142,7 @@ void AuctionHouseMgr::SendAuctionWonMail(AuctionEntry *auction, SQLTransaction& msgAuctionWonBody.width(16); msgAuctionWonBody << std::right << std::hex << auction->owner; msgAuctionWonBody << std::dec << ":" << auction->bid << ":" << auction->buyout; - sLog->outDebug("AuctionWon body string : %s", msgAuctionWonBody.str().c_str()); + sLog->outDebug(LOG_FILTER_AUCTIONHOUSE, "AuctionWon body string : %s", msgAuctionWonBody.str().c_str()); // set owner to bidder (to prevent delete item with sender char deleting) // owner in `data` will set at mail receive and item extracting @@ -186,7 +186,7 @@ void AuctionHouseMgr::SendAuctionSalePendingMail(AuctionEntry * auction, SQLTran msgAuctionSalePendingBody << ":" << auction->deposit << ":" << auctionCut << ":0:"; msgAuctionSalePendingBody << secsToTimeBitFields(distrTime); - sLog->outDebug("AuctionSalePending body string : %s", msgAuctionSalePendingBody.str().c_str()); + sLog->outDebug(LOG_FILTER_AUCTIONHOUSE, "AuctionSalePending body string : %s", msgAuctionSalePendingBody.str().c_str()); MailDraft(msgAuctionSalePendingSubject.str(), msgAuctionSalePendingBody.str()) .SendMailTo(trans, MailReceiver(owner,auction->owner), auction, MAIL_CHECK_MASK_COPIED); @@ -213,7 +213,7 @@ void AuctionHouseMgr::SendAuctionSuccessfulMail(AuctionEntry * auction, SQLTrans auctionSuccessfulBody << std::dec << ":" << auction->bid << ":" << auction->buyout; auctionSuccessfulBody << ":" << auction->deposit << ":" << auctionCut; - sLog->outDebug("AuctionSuccessful body string : %s", auctionSuccessfulBody.str().c_str()); + sLog->outDebug(LOG_FILTER_AUCTIONHOUSE, "AuctionSuccessful body string : %s", auctionSuccessfulBody.str().c_str()); uint32 profit = auction->bid + auction->deposit - auctionCut; @@ -304,7 +304,6 @@ void AuctionHouseMgr::SendAuctionCancelledToBidderMail(AuctionEntry* auction, SQ } } - void AuctionHouseMgr::LoadAuctionItems() { uint32 oldMSTime = getMSTime(); @@ -374,7 +373,6 @@ void AuctionHouseMgr::LoadAuctions() { Field* fields = result->Fetch(); - AuctionEntry *aItem = new AuctionEntry(); if (!aItem->LoadFromDB(fields)) { diff --git a/src/server/game/Battlegrounds/ArenaTeam.cpp b/src/server/game/Battlegrounds/ArenaTeam.cpp index 7b559198cffb2..c5450b901ec89 100755 --- a/src/server/game/Battlegrounds/ArenaTeam.cpp +++ b/src/server/game/Battlegrounds/ArenaTeam.cpp @@ -72,7 +72,7 @@ bool ArenaTeam::Create(uint64 captainGuid, uint32 type, std::string ArenaTeamNam return false; uint32 captainLowGuid = GUID_LOPART(captainGuid); - sLog->outDebug("GUILD: creating arena team %s to leader: %u", ArenaTeamName.c_str(), captainLowGuid); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Creating arena team %s to leader: %u", ArenaTeamName.c_str(), captainLowGuid); m_CaptainGuid = captainGuid; m_Name = ArenaTeamName; @@ -388,7 +388,7 @@ void ArenaTeam::Roster(WorldSession *session) } session->SendPacket(&data); - sLog->outDebug("WORLD: Sent SMSG_ARENA_TEAM_ROSTER"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_ARENA_TEAM_ROSTER"); } void ArenaTeam::Query(WorldSession *session) @@ -403,7 +403,7 @@ void ArenaTeam::Query(WorldSession *session) data << uint32(m_BorderStyle); // border style data << uint32(m_BorderColor); // border color session->SendPacket(&data); - sLog->outDebug("WORLD: Sent SMSG_ARENA_TEAM_QUERY_RESPONSE"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_ARENA_TEAM_QUERY_RESPONSE"); } void ArenaTeam::Stats(WorldSession *session) @@ -489,7 +489,7 @@ void ArenaTeam::SetStats(uint32 stat_type, uint32 value) CharacterDatabase.PExecute("UPDATE arena_team_stats SET rank = '%u' WHERE arenateamid = '%u'", value, GetId()); break; default: - sLog->outDebug("unknown stat type in ArenaTeam::SetStats() %u", stat_type); + sLog->outError("unknown stat type in ArenaTeam::SetStats() %u", stat_type); break; } } @@ -532,7 +532,7 @@ void ArenaTeam::BroadcastEvent(ArenaTeamEvents event, uint64 guid, uint8 strCoun BroadcastPacket(&data); - sLog->outDebug("WORLD: Sent SMSG_ARENA_TEAM_EVENT"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_ARENA_TEAM_EVENT"); } uint8 ArenaTeam::GetSlotByType(uint32 type) @@ -577,9 +577,11 @@ uint32 ArenaTeam::GetPoints(uint32 MemberRating) // type penalties for <5v5 teams if (m_Type == ARENA_TEAM_2v2) - points *= 0.76f; + points *= 0.88f; + /* else if (m_Type == ARENA_TEAM_3v3) points *= 0.88f; + */ return (uint32) points; } @@ -655,7 +657,10 @@ int32 ArenaTeam::GetPersonalRatingMod(int32 base_rating, uint32 own_rating, uint // max (2 * team rating gain/loss), min 0 gain/loss float chance = GetChanceAgainst(own_rating, enemy_rating); chance *= 2.0f; - return (int32)ceil(float(base_rating) * chance); + float bonusChance = chance - 1.0f; + if (bonusChance < 0 || base_rating < 0) + bonusChance = 0; + return (int32)(ceil(float(base_rating) * chance) + ceil(24.0f * bonusChance)); } void ArenaTeam::FinishGame(int32 mod) diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index b19cac0b772cb..d1c312e886447 100755 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -41,79 +41,81 @@ namespace Trinity { public: BattlegroundChatBuilder(ChatMsg msgtype, int32 textId, Player const* source, va_list* args = NULL) - : i_msgtype(msgtype), i_textId(textId), i_source(source), i_args(args) {} + : _msgtype(msgtype), _textId(textId), _source(source), _args(args) { } + void operator()(WorldPacket& data, LocaleConstant loc_idx) { - char const* text = sObjectMgr->GetTrinityString(i_textId,loc_idx); - - if (i_args) + char const* text = sObjectMgr->GetTrinityString(_textId, loc_idx); + if (_args) { // we need copy va_list before use or original va_list will corrupted va_list ap; - va_copy(ap,*i_args); + va_copy(ap, *_args); - char str [2048]; - vsnprintf(str,2048,text, ap); + char str[2048]; + vsnprintf(str, 2048, text, ap); va_end(ap); - do_helper(data,&str[0]); + do_helper(data, &str[0]); } else - do_helper(data,text); + do_helper(data, text); } + private: void do_helper(WorldPacket& data, char const* text) { - uint64 target_guid = i_source ? i_source ->GetGUID() : 0; + uint64 target_guid = _source ? _source ->GetGUID() : 0; - data << uint8(i_msgtype); + data << uint8 (_msgtype); data << uint32(LANG_UNIVERSAL); data << uint64(target_guid); // there 0 for BG messages data << uint32(0); // can be chat msg group or something data << uint64(target_guid); - data << uint32(strlen(text)+1); + data << uint32(strlen(text) + 1); data << text; - data << uint8(i_source ? i_source->chatTag() : uint8(0)); + data << uint8 (_source ? _source->chatTag() : uint8(0)); } - ChatMsg i_msgtype; - int32 i_textId; - Player const* i_source; - va_list* i_args; + ChatMsg _msgtype; + int32 _textId; + Player const* _source; + va_list* _args; }; class Battleground2ChatBuilder { public: Battleground2ChatBuilder(ChatMsg msgtype, int32 textId, Player const* source, int32 arg1, int32 arg2) - : i_msgtype(msgtype), i_textId(textId), i_source(source), i_arg1(arg1), i_arg2(arg2) {} + : _msgtype(msgtype), _textId(textId), _source(source), _arg1(arg1), _arg2(arg2) {} + void operator()(WorldPacket& data, LocaleConstant loc_idx) { - char const* text = sObjectMgr->GetTrinityString(i_textId,loc_idx); - char const* arg1str = i_arg1 ? sObjectMgr->GetTrinityString(i_arg1,loc_idx) : ""; - char const* arg2str = i_arg2 ? sObjectMgr->GetTrinityString(i_arg2,loc_idx) : ""; + char const* text = sObjectMgr->GetTrinityString(_textId, loc_idx); + char const* arg1str = _arg1 ? sObjectMgr->GetTrinityString(_arg1, loc_idx) : ""; + char const* arg2str = _arg2 ? sObjectMgr->GetTrinityString(_arg2, loc_idx) : ""; - char str [2048]; - snprintf(str,2048,text, arg1str, arg2str); + char str[2048]; + snprintf(str, 2048, text, arg1str, arg2str); - uint64 target_guid = i_source ? i_source ->GetGUID() : 0; + uint64 target_guid = _source ? _source->GetGUID() : 0; - data << uint8(i_msgtype); + data << uint8 (_msgtype); data << uint32(LANG_UNIVERSAL); data << uint64(target_guid); // there 0 for BG messages data << uint32(0); // can be chat msg group or something data << uint64(target_guid); - data << uint32(strlen(str)+1); + data << uint32(strlen(str) + 1); data << str; - data << uint8(i_source ? i_source->chatTag() : uint8(0)); + data << uint8 (_source ? _source->chatTag() : uint8(0)); } - private: - ChatMsg i_msgtype; - int32 i_textId; - Player const* i_source; - int32 i_arg1; - int32 i_arg2; + private: + ChatMsg _msgtype; + int32 _textId; + Player const* _source; + int32 _arg1; + int32 _arg2; }; } // namespace Trinity @@ -127,8 +129,8 @@ void Battleground::BroadcastWorker(Do& _do) Battleground::Battleground() { - m_TypeID = BattlegroundTypeId(0); - m_RandomTypeID = BattlegroundTypeId(0); + m_TypeID = BATTLEGROUND_TYPE_NONE; + m_RandomTypeID = BATTLEGROUND_TYPE_NONE; m_InstanceID = 0; m_Status = STATUS_NONE; m_ClientInstanceID = 0; @@ -206,30 +208,20 @@ Battleground::~Battleground() { // remove objects and creatures // (this is done automatically in mapmanager update, when the instance is reset after the reset time) - int size = m_BgCreatures.size(); - for (int i = 0; i < size; ++i) + uint32 size = uint32(m_BgCreatures.size()); + for (uint32 i = 0; i < size; ++i) DelCreature(i); - size = m_BgObjects.size(); - for (int i = 0; i < size; ++i) + size = uint32(m_BgObjects.size()); + for (uint32 i = 0; i < size; ++i) DelObject(i); - if (GetInstanceID()) // not spam by useless queries in case BG templates - { - // delete creature and go respawn times - CharacterDatabase.PExecute("DELETE FROM creature_respawn WHERE instance = '%u'",GetInstanceID()); - CharacterDatabase.PExecute("DELETE FROM gameobject_respawn WHERE instance = '%u'",GetInstanceID()); - // delete instance from db - CharacterDatabase.PExecute("DELETE FROM instance WHERE id = '%u'",GetInstanceID()); - // remove from battlegrounds - } - sBattlegroundMgr->RemoveBattleground(GetInstanceID(), GetTypeID()); // unload map if (m_Map) m_Map->SetUnload(); // remove from bg free slot queue - this->RemoveFromBGFreeSlotQueue(); + RemoveFromBGFreeSlotQueue(); for (BattlegroundScoreMap::const_iterator itr = m_PlayerScores.begin(); itr != m_PlayerScores.end(); ++itr) delete itr->second; @@ -254,6 +246,27 @@ void Battleground::Update(uint32 diff) return; } + _ProcessOfflineQueue(); + _ProcessRessurect(diff); + + if (GetStatus() == STATUS_IN_PROGRESS && !isArena() && sBattlegroundMgr->GetPrematureFinishTime() && (GetPlayersCountByTeam(ALLIANCE) < GetMinPlayersPerTeam() || GetPlayersCountByTeam(HORDE) < GetMinPlayersPerTeam())) + _ProcessProgress(diff); + else if (m_PrematureCountDown) + m_PrematureCountDown = false; + + if (GetStatus() == STATUS_WAIT_JOIN && GetPlayersSize()) + _ProcessJoin(diff); + + if (GetStatus() == STATUS_WAIT_LEAVE) + _ProcessLeave(diff); + + // Update start time and reset stats timer + m_StartTime += diff; + m_ResetStatTimer += diff; +} + +inline void Battleground::_ProcessOfflineQueue() +{ // remove offline players from bg after 5 minutes if (!m_OfflineQueue.empty()) { @@ -269,11 +282,14 @@ void Battleground::Update(uint32 diff) } } - /*********************************************************/ - /*** BATTLEGROUND RESSURECTION SYSTEM ***/ - /*********************************************************/ +} - //this should be handled by spell system +inline void Battleground::_ProcessRessurect(uint32 diff) +{ + // ********************************************************* + // *** BATTLEGROUND RESSURECTION SYSTEM *** + // ********************************************************* + // this should be handled by spell system m_LastResurrectTime += diff; if (m_LastResurrectTime >= RESURRECTION_INTERVAL) { @@ -325,188 +341,213 @@ void Battleground::Update(uint32 diff) } m_ResurrectQueue.clear(); } +} - /*********************************************************/ - /*** BATTLEGROUND BALLANCE SYSTEM ***/ - /*********************************************************/ - +inline void Battleground::_ProcessProgress(uint32 diff) +{ + // ********************************************************* + // *** BATTLEGROUND BALLANCE SYSTEM *** + // ********************************************************* // if less then minimum players are in on one side, then start premature finish timer - if (GetStatus() == STATUS_IN_PROGRESS && !isArena() && sBattlegroundMgr->GetPrematureFinishTime() && (GetPlayersCountByTeam(ALLIANCE) < GetMinPlayersPerTeam() || GetPlayersCountByTeam(HORDE) < GetMinPlayersPerTeam())) + if (!m_PrematureCountDown) { - if (!m_PrematureCountDown) - { - m_PrematureCountDown = true; - m_PrematureCountDownTimer = sBattlegroundMgr->GetPrematureFinishTime(); - } - else if (m_PrematureCountDownTimer < diff) + m_PrematureCountDown = true; + m_PrematureCountDownTimer = sBattlegroundMgr->GetPrematureFinishTime(); + } + else if (m_PrematureCountDownTimer < diff) + { + // time's up! + uint32 winner = 0; + if (GetPlayersCountByTeam(ALLIANCE) >= GetMinPlayersPerTeam()) + winner = ALLIANCE; + else if (GetPlayersCountByTeam(HORDE) >= GetMinPlayersPerTeam()) + winner = HORDE; + + EndBattleground(winner); + m_PrematureCountDown = false; + } + else if (!sBattlegroundMgr->isTesting()) + { + uint32 newtime = m_PrematureCountDownTimer - diff; + // announce every minute + if (newtime > (MINUTE * IN_MILLISECONDS)) { - // time's up! - uint32 winner = 0; - if (GetPlayersCountByTeam(ALLIANCE) >= GetMinPlayersPerTeam()) - winner = ALLIANCE; - else if (GetPlayersCountByTeam(HORDE) >= GetMinPlayersPerTeam()) - winner = HORDE; - - EndBattleground(winner); - m_PrematureCountDown = false; + 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 if (!sBattlegroundMgr->isTesting()) + else { - uint32 newtime = m_PrematureCountDownTimer - diff; - // announce every minute - if (newtime > (MINUTE * IN_MILLISECONDS)) - { - 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_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; + //announce every 15 seconds + 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; } - else if (m_PrematureCountDown) - m_PrematureCountDown = false; +} - /*********************************************************/ - /*** BATTLEGROUND STARTING SYSTEM ***/ - /*********************************************************/ +inline void Battleground::_ProcessJoin(uint32 diff) +{ + // ********************************************************* + // *** BATTLEGROUND STARTING SYSTEM *** + // ********************************************************* + ModifyStartDelayTime(diff); - if (GetStatus() == STATUS_WAIT_JOIN && GetPlayersSize()) + if (m_ResetStatTimer <= 5000) { - ModifyStartDelayTime(diff); - - if (m_ResetStatTimer <= 5000) - { - m_ResetStatTimer = 0; - for (BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr) - if (Player *plr = sObjectMgr->GetPlayer(itr->first)) - plr->ResetAllPowers(); - } - - if (!(m_Events & BG_STARTING_EVENT_1)) - { - m_Events |= BG_STARTING_EVENT_1; + m_ResetStatTimer = 0; + for (BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr) + if (Player *plr = sObjectMgr->GetPlayer(itr->first)) + plr->ResetAllPowers(); + } - // setup here, only when at least one player has ported to the map - if (!SetupBattleground()) - { - EndNow(); - return; - } + if (!(m_Events & BG_STARTING_EVENT_1)) + { + m_Events |= BG_STARTING_EVENT_1; - StartingEventCloseDoors(); - SetStartDelayTime(m_StartDelayTimes[BG_STARTING_EVENT_FIRST]); - //first start warning - 2 or 1 minute - SendMessageToAll(m_StartMessageIds[BG_STARTING_EVENT_FIRST], CHAT_MSG_BG_SYSTEM_NEUTRAL); - } - // After 1 minute or 30 seconds, warning is signalled - else if (GetStartDelayTime() <= m_StartDelayTimes[BG_STARTING_EVENT_SECOND] && !(m_Events & BG_STARTING_EVENT_2)) + // Setup here, only when at least one player has ported to the map + if (!SetupBattleground()) { - m_Events |= BG_STARTING_EVENT_2; - SendMessageToAll(m_StartMessageIds[BG_STARTING_EVENT_SECOND], CHAT_MSG_BG_SYSTEM_NEUTRAL); - } - // After 30 or 15 seconds, warning is signalled - else if (GetStartDelayTime() <= m_StartDelayTimes[BG_STARTING_EVENT_THIRD] && !(m_Events & BG_STARTING_EVENT_3)) - { - m_Events |= BG_STARTING_EVENT_3; - SendMessageToAll(m_StartMessageIds[BG_STARTING_EVENT_THIRD], CHAT_MSG_BG_SYSTEM_NEUTRAL); + EndNow(); + return; } - // delay expired (atfer 2 or 1 minute) - else if (GetStartDelayTime() <= 0 && !(m_Events & BG_STARTING_EVENT_4)) - { - m_Events |= BG_STARTING_EVENT_4; - StartingEventOpenDoors(); + StartingEventCloseDoors(); + SetStartDelayTime(m_StartDelayTimes[BG_STARTING_EVENT_FIRST]); + // First start warning - 2 or 1 minute + SendMessageToAll(m_StartMessageIds[BG_STARTING_EVENT_FIRST], CHAT_MSG_BG_SYSTEM_NEUTRAL); + } + // After 1 minute or 30 seconds, warning is signalled + else if (GetStartDelayTime() <= m_StartDelayTimes[BG_STARTING_EVENT_SECOND] && !(m_Events & BG_STARTING_EVENT_2)) + { + m_Events |= BG_STARTING_EVENT_2; + SendMessageToAll(m_StartMessageIds[BG_STARTING_EVENT_SECOND], CHAT_MSG_BG_SYSTEM_NEUTRAL); + } + // After 30 or 15 seconds, warning is signalled + else if (GetStartDelayTime() <= m_StartDelayTimes[BG_STARTING_EVENT_THIRD] && !(m_Events & BG_STARTING_EVENT_3)) + { + m_Events |= BG_STARTING_EVENT_3; + SendMessageToAll(m_StartMessageIds[BG_STARTING_EVENT_THIRD], CHAT_MSG_BG_SYSTEM_NEUTRAL); + } + // Delay expired (atfer 2 or 1 minute) + else if (GetStartDelayTime() <= 0 && !(m_Events & BG_STARTING_EVENT_4)) + { + m_Events |= BG_STARTING_EVENT_4; - SendWarningToAll(m_StartMessageIds[BG_STARTING_EVENT_FOURTH]); - SetStatus(STATUS_IN_PROGRESS); - SetStartDelayTime(m_StartDelayTimes[BG_STARTING_EVENT_FOURTH]); + StartingEventOpenDoors(); - //remove preparation - if (isArena()) - { - //TODO : add arena sound PlaySoundToAll(SOUND_ARENA_START); + SendWarningToAll(m_StartMessageIds[BG_STARTING_EVENT_FOURTH]); + SetStatus(STATUS_IN_PROGRESS); + SetStartDelayTime(m_StartDelayTimes[BG_STARTING_EVENT_FOURTH]); - for (BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr) - if (Player *plr = sObjectMgr->GetPlayer(itr->first)) + // Remove preparation + if (isArena()) + { + // TODO : add arena sound PlaySoundToAll(SOUND_ARENA_START); + for (BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr) + if (Player *plr = sObjectMgr->GetPlayer(itr->first)) + { + // BG Status packet + WorldPacket status; + BattlegroundQueueTypeId bgQueueTypeId = sBattlegroundMgr->BGQueueTypeId(m_TypeID, GetArenaType()); + uint32 queueSlot = plr->GetBattlegroundQueueIndex(bgQueueTypeId); + sBattlegroundMgr->BuildBattlegroundStatusPacket(&status, this, queueSlot, STATUS_IN_PROGRESS, 0, GetStartTime(), GetArenaType()); + plr->GetSession()->SendPacket(&status); + + plr->RemoveAurasDueToSpell(SPELL_ARENA_PREPARATION); + plr->ResetAllPowers(); + // remove auras with duration lower than 30s + Unit::AuraApplicationMap & auraMap = plr->GetAppliedAuras(); + for (Unit::AuraApplicationMap::iterator iter = auraMap.begin(); iter != auraMap.end();) { - // BG Status packet - WorldPacket status; - BattlegroundQueueTypeId bgQueueTypeId = sBattlegroundMgr->BGQueueTypeId(m_TypeID, GetArenaType()); - uint32 queueSlot = plr->GetBattlegroundQueueIndex(bgQueueTypeId); - sBattlegroundMgr->BuildBattlegroundStatusPacket(&status, this, queueSlot, STATUS_IN_PROGRESS, 0, GetStartTime(), GetArenaType()); - plr->GetSession()->SendPacket(&status); - - plr->RemoveAurasDueToSpell(SPELL_ARENA_PREPARATION); - plr->ResetAllPowers(); - // remove auras with duration lower than 30s - Unit::AuraApplicationMap & auraMap = plr->GetAppliedAuras(); - for (Unit::AuraApplicationMap::iterator iter = auraMap.begin(); iter != auraMap.end();) - { - AuraApplication * aurApp = iter->second; - Aura * aura = aurApp->GetBase(); - if (!aura->IsPermanent() - && aura->GetDuration() <= 30*IN_MILLISECONDS - && aurApp->IsPositive() - && (!(aura->GetSpellProto()->Attributes & SPELL_ATTR0_UNAFFECTED_BY_INVULNERABILITY)) - && (!aura->HasEffectType(SPELL_AURA_MOD_INVISIBILITY))) - plr->RemoveAura(iter); - else - ++iter; - } + AuraApplication * aurApp = iter->second; + Aura * aura = aurApp->GetBase(); + if (!aura->IsPermanent() + && aura->GetDuration() <= 30*IN_MILLISECONDS + && aurApp->IsPositive() + && (!(aura->GetSpellProto()->Attributes & SPELL_ATTR0_UNAFFECTED_BY_INVULNERABILITY)) + && (!aura->HasEffectType(SPELL_AURA_MOD_INVISIBILITY))) + plr->RemoveAura(iter); + else + ++iter; } + } - CheckArenaWinConditions(); - } - else - { - PlaySoundToAll(SOUND_BG_START); + CheckArenaWinConditions(); + } + else + { + PlaySoundToAll(SOUND_BG_START); - for (BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr) - if (Player* plr = sObjectMgr->GetPlayer(itr->first)) - { - plr->RemoveAurasDueToSpell(SPELL_PREPARATION); - plr->ResetAllPowers(); - } - //Announce BG starting - if (sWorld->getBoolConfig(CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_ENABLE)) + for (BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr) + if (Player* plr = sObjectMgr->GetPlayer(itr->first)) { - sWorld->SendWorldText(LANG_BG_STARTED_ANNOUNCE_WORLD, GetName(), GetMinLevel(), GetMaxLevel()); + plr->RemoveAurasDueToSpell(SPELL_PREPARATION); + plr->ResetAllPowers(); } - } + // Announce BG starting + if (sWorld->getBoolConfig(CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_ENABLE)) + sWorld->SendWorldText(LANG_BG_STARTED_ANNOUNCE_WORLD, GetName(), GetMinLevel(), GetMaxLevel()); } } +} - /*********************************************************/ - /*** BATTLEGROUND ENDING SYSTEM ***/ - /*********************************************************/ - - if (GetStatus() == STATUS_WAIT_LEAVE) +inline void Battleground::_ProcessLeave(uint32 diff) +{ + // ********************************************************* + // *** BATTLEGROUND ENDING SYSTEM *** + // ********************************************************* + // remove all players from battleground after 2 minutes + m_EndTime -= diff; + if (m_EndTime <= 0) { - // remove all players from battleground after 2 minutes - m_EndTime -= diff; - if (m_EndTime <= 0) + m_EndTime = 0; + BattlegroundPlayerMap::iterator itr, next; + for (itr = m_Players.begin(); itr != m_Players.end(); itr = next) { - m_EndTime = 0; - BattlegroundPlayerMap::iterator itr, next; - for (itr = m_Players.begin(); itr != m_Players.end(); itr = next) - { - next = itr; - ++next; - //itr is erased here! - RemovePlayerAtLeave(itr->first, true, true);// remove player from BG - // do not change any battleground's private variables - } + next = itr; + ++next; + //itr is erased here! + RemovePlayerAtLeave(itr->first, true, true);// remove player from BG + // do not change any battleground's private variables } } +} - // Update start time and reset stats timer - m_StartTime += diff; - m_ResetStatTimer += diff; +inline Player* Battleground::_GetPlayer(const uint64& guid, bool offlineRemove, const char* context) const +{ + Player* player = NULL; + if (!offlineRemove) + { + player = sObjectMgr->GetPlayer(guid); + if (!player) + sLog->outError("Battleground::%s: player (GUID: %u) not found for BG (map: %u, instance id: %u)!", + context, GUID_LOPART(guid), m_MapId, m_InstanceID); + } + return player; +} + +inline Player* Battleground::_GetPlayer(BattlegroundPlayerMap::iterator itr, const char* context) +{ + return _GetPlayer(itr->first, itr->second.OfflineRemoveTime, context); +} + +inline Player* Battleground::_GetPlayer(BattlegroundPlayerMap::const_iterator itr, const char* context) const +{ + return _GetPlayer(itr->first, itr->second.OfflineRemoveTime, context); +} + +inline Player* Battleground::_GetPlayerForTeam(uint32 teamId, BattlegroundPlayerMap::const_iterator itr, const char* context) const +{ + Player* player = NULL; + if (player = _GetPlayer(itr, context)) + { + uint32 team = itr->second.Team; + if (!team) + team = player->GetTeam(); + if (team != teamId) + player = NULL; + } + return player; } void Battleground::SetTeamStartLoc(uint32 TeamID, float X, float Y, float Z, float O) @@ -521,39 +562,16 @@ void Battleground::SetTeamStartLoc(uint32 TeamID, float X, float Y, float Z, flo void Battleground::SendPacketToAll(WorldPacket *packet) { for (BattlegroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr) - { - if (itr->second.OfflineRemoveTime) - continue; - Player *plr = sObjectMgr->GetPlayer(itr->first); - if (plr) - plr->GetSession()->SendPacket(packet); - else - sLog->outError("Battleground:SendPacketToAll: Player (GUID: %u) not found!", GUID_LOPART(itr->first)); - } + if (Player* player = _GetPlayer(itr, "SendPacketToAll")) + player->GetSession()->SendPacket(packet); } void Battleground::SendPacketToTeam(uint32 TeamID, WorldPacket *packet, Player *sender, bool self) { for (BattlegroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr) - { - if (itr->second.OfflineRemoveTime) - continue; - Player *plr = sObjectMgr->GetPlayer(itr->first); - if (!plr) - { - sLog->outError("Battleground:SendPacketToTeam: Player (GUID: %u) not found!", GUID_LOPART(itr->first)); - continue; - } - - if (!self && sender == plr) - continue; - - uint32 team = itr->second.Team; - if (!team) team = plr->GetTeam(); - - if (team == TeamID) - plr->GetSession()->SendPacket(packet); - } + if (Player* player = _GetPlayerForTeam(TeamID, itr, "SendPacketToTeam")) + if (self || sender != player) + player->GetSession()->SendPacket(packet); } void Battleground::PlaySoundToAll(uint32 SoundID) @@ -566,137 +584,52 @@ void Battleground::PlaySoundToAll(uint32 SoundID) void Battleground::PlaySoundToTeam(uint32 SoundID, uint32 TeamID) { WorldPacket data; - for (BattlegroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr) - { - if (itr->second.OfflineRemoveTime) - continue; - Player *plr = sObjectMgr->GetPlayer(itr->first); - - if (!plr) - { - sLog->outError("Battleground:PlaySoundToTeam: Player (GUID: %u) not found!", GUID_LOPART(itr->first)); - continue; - } - - uint32 team = itr->second.Team; - if (!team) team = plr->GetTeam(); - - if (team == TeamID) + if (Player* player = _GetPlayerForTeam(TeamID, itr, "PlaySoundToTeam")) { sBattlegroundMgr->BuildPlaySoundPacket(&data, SoundID); - plr->GetSession()->SendPacket(&data); + player->GetSession()->SendPacket(&data); } - } } void Battleground::CastSpellOnTeam(uint32 SpellID, uint32 TeamID) { for (BattlegroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr) - { - if (itr->second.OfflineRemoveTime) - continue; - Player *plr = sObjectMgr->GetPlayer(itr->first); - - if (!plr) - { - sLog->outError("Battleground:CastSpellOnTeam: Player (GUID: %u) not found!", GUID_LOPART(itr->first)); - continue; - } - - uint32 team = itr->second.Team; - if (!team) team = plr->GetTeam(); - - if (team == TeamID) - plr->CastSpell(plr, SpellID, true); - } + if (Player* player = _GetPlayerForTeam(TeamID, itr, "CastSpellOnTeam")) + player->CastSpell(player, SpellID, true); } void Battleground::RemoveAuraOnTeam(uint32 SpellID, uint32 TeamID) { for (BattlegroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr) - { - if (itr->second.OfflineRemoveTime) - continue; - Player *plr = sObjectMgr->GetPlayer(itr->first); - - if (!plr) - { - sLog->outError("Battleground:RemoveAuraOnTeam: Player (GUID: %u) not found!", GUID_LOPART(itr->first)); - continue; - } - - uint32 team = itr->second.Team; - if (!team) team = plr->GetTeam(); - - if (team == TeamID) - plr->RemoveAura(SpellID); - } + if (Player* player = _GetPlayerForTeam(TeamID, itr, "RemoveAuraOnTeam")) + player->RemoveAura(SpellID); } void Battleground::YellToAll(Creature* creature, const char* text, uint32 language) { - for (std::map::iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr) - { - WorldPacket data(SMSG_MESSAGECHAT, 200); - Player *plr = sObjectMgr->GetPlayer(itr->first); - if (!plr) + for (BattlegroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr) + if (Player* player = _GetPlayer(itr, "YellToAll")) { - sLog->outError("Battleground: Player " UI64FMTD " not found!", itr->first); - continue; + WorldPacket data(SMSG_MESSAGECHAT, 200); + creature->BuildMonsterChat(&data, CHAT_MSG_MONSTER_YELL, text, language, creature->GetName(), itr->first); + player->GetSession()->SendPacket(&data); } - creature->BuildMonsterChat(&data,CHAT_MSG_MONSTER_YELL,text,language,creature->GetName(),itr->first); - plr->GetSession()->SendPacket(&data); - } } void Battleground::RewardHonorToTeam(uint32 Honor, uint32 TeamID) { for (BattlegroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr) - { - if (itr->second.OfflineRemoveTime) - continue; - Player *plr = sObjectMgr->GetPlayer(itr->first); - - if (!plr) - { - sLog->outError("Battleground:RewardHonorToTeam: Player (GUID: %u) not found!", GUID_LOPART(itr->first)); - continue; - } - - uint32 team = itr->second.Team; - if (!team) team = plr->GetTeam(); - - if (team == TeamID) - UpdatePlayerScore(plr, SCORE_BONUS_HONOR, Honor); - } + if (Player* player = _GetPlayerForTeam(TeamID, itr, "RewardHonorToTeam")) + UpdatePlayerScore(player, SCORE_BONUS_HONOR, Honor); } void Battleground::RewardReputationToTeam(uint32 faction_id, uint32 Reputation, uint32 TeamID) { - FactionEntry const* factionEntry = sFactionStore.LookupEntry(faction_id); - - if (!factionEntry) - return; - - for (BattlegroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr) - { - if (itr->second.OfflineRemoveTime) - continue; - Player *plr = sObjectMgr->GetPlayer(itr->first); - - if (!plr) - { - sLog->outError("Battleground:RewardReputationToTeam: Player (GUID: %u) not found!", GUID_LOPART(itr->first)); - continue; - } - - uint32 team = itr->second.Team; - if (!team) team = plr->GetTeam(); - - if (team == TeamID) - plr->GetReputationMgr().ModifyReputation(factionEntry, Reputation); - } + if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(faction_id)) + for (BattlegroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr) + if (Player* player = _GetPlayerForTeam(TeamID, itr, "RewardReputationToTeam")) + player->GetReputationMgr().ModifyReputation(factionEntry, Reputation); } void Battleground::UpdateWorldState(uint32 Field, uint32 Value) @@ -706,7 +639,7 @@ void Battleground::UpdateWorldState(uint32 Field, uint32 Value) SendPacketToAll(&data); } -void Battleground::UpdateWorldStateForPlayer(uint32 Field, uint32 Value, Player *Source) +void Battleground::UpdateWorldStateForPlayer(uint32 Field, uint32 Value, Player* Source) { WorldPacket data; sBattlegroundMgr->BuildUpdateWorldStatePacket(&data, Field, Value); @@ -715,10 +648,10 @@ void Battleground::UpdateWorldStateForPlayer(uint32 Field, uint32 Value, Player void Battleground::EndBattleground(uint32 winner) { - this->RemoveFromBGFreeSlotQueue(); + RemoveFromBGFreeSlotQueue(); - ArenaTeam * winner_arena_team = NULL; - ArenaTeam * loser_arena_team = NULL; + ArenaTeam* winner_arena_team = NULL; + ArenaTeam* loser_arena_team = NULL; uint32 loser_team_rating = 0; uint32 loser_matchmaker_rating = 0; int32 loser_change = 0; @@ -778,7 +711,7 @@ void Battleground::EndBattleground(uint32 winner) winner_matchmaker_rating = GetArenaMatchmakerRating(winner); winner_change = winner_arena_team->WonAgainst(loser_matchmaker_rating); loser_change = loser_arena_team->LostAgainst(winner_matchmaker_rating); - sLog->outDebug("--- Winner rating: %u, Loser rating: %u, Winner MMR: %u, Loser MMR: %u, Winner change: %u, Losser change: %u ---", winner_team_rating, loser_team_rating, + sLog->outArena("--- Winner rating: %u, Loser rating: %u, Winner MMR: %u, Loser MMR: %u, Winner change: %u, Loser change: %u ---", winner_team_rating, loser_team_rating, winner_matchmaker_rating, loser_matchmaker_rating, winner_change, loser_change); SetArenaTeamRatingChangeForTeam(winner, winner_change); SetArenaTeamRatingChangeForTeam(GetOtherTeam(winner), loser_change); @@ -861,12 +794,10 @@ void Battleground::EndBattleground(uint32 winner) } continue; } - Player *plr = sObjectMgr->GetPlayer(itr->first); + + Player* plr = _GetPlayer(itr, "EndBattleground"); if (!plr) - { - sLog->outError("Battleground:EndBattleground Player (GUID: %u) not found!", GUID_LOPART(itr->first)); continue; - } // should remove spirit of redemption if (plr->HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION)) @@ -932,7 +863,6 @@ void Battleground::EndBattleground(uint32 winner) UpdatePlayerScore(plr, SCORE_BONUS_HONOR, GetBonusHonorFromKill(loser_kills)); } - plr->ResetAllPowers(); plr->CombatStopWithPets(true); @@ -985,12 +915,12 @@ uint32 Battleground::GetBattlemasterEntry() const } } -void Battleground::BlockMovement(Player *plr) +void Battleground::BlockMovement(Player* plr) { plr->SetClientControl(plr, 0); // movement disabled NOTE: the effect will be automatically removed by client when the player is teleported from the battleground, so no need to send with uint8(1) in RemovePlayerAtLeave() } -void Battleground::RemovePlayerAtLeave(uint64 guid, bool Transport, bool SendPacket) +void Battleground::RemovePlayerAtLeave(const uint64& guid, bool Transport, bool SendPacket) { uint32 team = GetPlayerTeam(guid); bool participant = false; @@ -1085,7 +1015,6 @@ void Battleground::RemovePlayerAtLeave(uint64 guid, bool Transport, bool SendPac if (!group->RemoveMember(guid)) // group was disbanded { SetBgRaid(team, NULL); - delete group; } } DecreaseInvitedCount(team); @@ -1133,7 +1062,8 @@ void Battleground::Reset() m_Events = 0; if (m_InvitedAlliance > 0 || m_InvitedHorde > 0) - sLog->outError("Battleground system: bad counter, m_InvitedAlliance: %d, m_InvitedHorde: %d", m_InvitedAlliance, m_InvitedHorde); + sLog->outError("Battleground::Reset: one of the counters is not 0 (alliance: %u, horde: %u) for BG (map: %u, instance id: %u)!", + m_InvitedAlliance, m_InvitedHorde, m_MapId, m_InstanceID); m_InvitedAlliance = 0; m_InvitedHorde = 0; @@ -1163,7 +1093,7 @@ void Battleground::StartBattleground() sLog->outArena("Arena match type: %u for Team1Id: %u - Team2Id: %u started.", m_ArenaType, m_ArenaTeamIds[BG_TEAM_ALLIANCE], m_ArenaTeamIds[BG_TEAM_HORDE]); } -void Battleground::AddPlayer(Player *plr) +void Battleground::AddPlayer(Player* plr) { // remove afk from player if (plr->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_AFK)) @@ -1245,8 +1175,8 @@ void Battleground::AddPlayer(Player *plr) sLog->outDetail("BATTLEGROUND: Player %s joined the battle.", plr->GetName()); } -/* this method adds player to his team's bg group, or sets his correct group if player is already in bg group */ -void Battleground::AddOrSetPlayerToCorrectBgGroup(Player *player, uint32 team) +// this method adds player to his team's bg group, or sets his correct group if player is already in bg group +void Battleground::AddOrSetPlayerToCorrectBgGroup(Player* player, uint32 team) { uint64 playerGuid = player->GetGUID(); Group* group = GetBgRaid(team); @@ -1254,7 +1184,7 @@ void Battleground::AddOrSetPlayerToCorrectBgGroup(Player *player, uint32 team) { group = new Group; SetBgRaid(team, group); - group->Create(playerGuid, player->GetName()); + group->Create(player); } else // raid already exist { @@ -1265,10 +1195,13 @@ void Battleground::AddOrSetPlayerToCorrectBgGroup(Player *player, uint32 team) } else { - group->AddMember(playerGuid, player->GetName()); + group->AddMember(player); if (Group* originalGroup = player->GetOriginalGroup()) if (originalGroup->IsLeader(playerGuid)) + { group->ChangeLeader(playerGuid); + group->SendUpdate(); + } } } } @@ -1311,7 +1244,7 @@ void Battleground::EventPlayerLoggedOut(Player* player) //player->LeaveBattleground(); } -/* This method should be called only once ... it adds pointer to queue */ +// This method should be called only once ... it adds pointer to queue void Battleground::AddToBGFreeSlotQueue() { // make sure to add only once @@ -1322,7 +1255,7 @@ void Battleground::AddToBGFreeSlotQueue() } } -/* This method removes this battleground from free queue - it must be called when deleting battleground - not used now*/ +// This method removes this battleground from free queue - it must be called when deleting battleground - not used now void Battleground::RemoveFromBGFreeSlotQueue() { // set to be able to re-add if needed @@ -1342,10 +1275,10 @@ void Battleground::RemoveFromBGFreeSlotQueue() // returns the number how many players can join battleground to MaxPlayersPerTeam uint32 Battleground::GetFreeSlotsForTeam(uint32 Team) const { - //if BG is starting ... invite anyone + // if BG is starting ... invite anyone if (GetStatus() == STATUS_WAIT_JOIN) return (GetInvitedCount(Team) < GetMaxPlayersPerTeam()) ? GetMaxPlayersPerTeam() - GetInvitedCount(Team) : 0; - //if BG is already started .. do not allow to join too much players of one faction + // if BG is already started .. do not allow to join too much players of one faction uint32 otherTeam; uint32 otherIn; if (Team == ALLIANCE) @@ -1388,9 +1321,9 @@ uint32 Battleground::GetFreeSlotsForTeam(uint32 Team) const // return the minimum of the 3 differences // min of diff and diff 2 - diff = diff < diff2 ? diff : diff2; + diff = std::min(diff, diff2); // min of diff, diff2 and diff3 - return diff < diff3 ? diff : diff3 ; + return std::min(diff, diff3); } return 0; } @@ -1400,15 +1333,14 @@ bool Battleground::HasFreeSlots() const return GetPlayersSize() < GetMaxPlayers(); } -void Battleground::UpdatePlayerScore(Player *Source, uint32 type, uint32 value, bool doAddHonor) +void Battleground::UpdatePlayerScore(Player* Source, uint32 type, uint32 value, bool doAddHonor) { //this procedure is called from virtual function implemented in bg subclass BattlegroundScoreMap::const_iterator itr = m_PlayerScores.find(Source->GetGUID()); - if (itr == m_PlayerScores.end()) // player not found... return; - switch(type) + switch (type) { case SCORE_KILLING_BLOWS: // Killing blows itr->second->KillingBlows += value; @@ -1426,12 +1358,12 @@ void Battleground::UpdatePlayerScore(Player *Source, uint32 type, uint32 value, { // reward honor instantly if (doAddHonor) - { - Source->RewardHonor(NULL, 1, value);//RewardHonor calls UpdatePlayerScore with doAddHonor = false - }else itr->second->BonusHonor += value; + Source->RewardHonor(NULL, 1, value); // RewardHonor calls UpdatePlayerScore with doAddHonor = false + else + itr->second->BonusHonor += value; } break; - //used only in EY, but in MSG_PVP_LOG_DATA opcode + // used only in EY, but in MSG_PVP_LOG_DATA opcode case SCORE_DAMAGE_DONE: // Damage Done itr->second->DamageDone += value; break; @@ -1447,12 +1379,13 @@ void Battleground::UpdatePlayerScore(Player *Source, uint32 type, uint32 value, break; /** World of Warcraft Armory **/ default: - sLog->outError("Battleground: Unknown player score type %u", type); + sLog->outError("Battleground::UpdatePlayerScore: unknown score type (%u) for BG (map: %u, instance id: %u)!", + type, m_MapId, m_InstanceID); break; } } -void Battleground::AddPlayerToResurrectQueue(uint64 npc_guid, uint64 player_guid) +void Battleground::AddPlayerToResurrectQueue(const uint64& npc_guid, const uint64& player_guid) { m_ReviveQueue[npc_guid].push_back(player_guid); @@ -1463,22 +1396,17 @@ void Battleground::AddPlayerToResurrectQueue(uint64 npc_guid, uint64 player_guid plr->CastSpell(plr, SPELL_WAITING_FOR_RESURRECT, true); } -void Battleground::RemovePlayerFromResurrectQueue(uint64 player_guid) +void Battleground::RemovePlayerFromResurrectQueue(const uint64& player_guid) { for (std::map >::iterator itr = m_ReviveQueue.begin(); itr != m_ReviveQueue.end(); ++itr) { - for (std::vector::iterator itr2 =(itr->second).begin(); itr2 != (itr->second).end(); ++itr2) + for (std::vector::iterator itr2 = (itr->second).begin(); itr2 != (itr->second).end(); ++itr2) { if (*itr2 == player_guid) { (itr->second).erase(itr2); - - Player *plr = sObjectMgr->GetPlayer(player_guid); - if (!plr) - return; - - plr->RemoveAurasDueToSpell(SPELL_WAITING_FOR_RESURRECT); - + if (Player *plr = sObjectMgr->GetPlayer(player_guid)) + plr->RemoveAurasDueToSpell(SPELL_WAITING_FOR_RESURRECT); return; } } @@ -1493,15 +1421,17 @@ bool Battleground::AddObject(uint32 type, uint32 entry, float x, float y, float Map *map = GetBgMap(); if (!map) return false; - // must be created this way, adding to godatamap would add it to the base map of the instance + // Must be created this way, adding to godatamap would add it to the base map of the instance // and when loading it (in go::LoadFromDB()), a new guid would be assigned to the object, and a new object would be created - // so we must create it specific for this instance + // So we must create it specific for this instance GameObject * go = new GameObject; - if (!go->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_GAMEOBJECT),entry, GetBgMap(), - PHASEMASK_NORMAL, x,y,z,o,rotation0,rotation1,rotation2,rotation3,100,GO_STATE_READY)) + if (!go->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_GAMEOBJECT), entry, GetBgMap(), + PHASEMASK_NORMAL, x, y, z, o, rotation0, rotation1, rotation2, rotation3, 100, GO_STATE_READY)) { - sLog->outErrorDb("Gameobject template %u not found in database! Battleground not created!", entry); - sLog->outError("Cannot create gameobject template %u! Battleground not created!", entry); + sLog->outErrorDb("Battleground::AddObject: cannot create gameobject (entry: %u) for BG (map: %u, instance id: %u)!", + entry, m_MapId, m_InstanceID); + sLog->outError("Battleground::AddObject: cannot create gameobject (entry: %u) for BG (map: %u, instance id: %u)!", + entry, m_MapId, m_InstanceID); delete go; return false; } @@ -1527,53 +1457,50 @@ bool Battleground::AddObject(uint32 type, uint32 entry, float x, float y, float data.animprogress = 100; data.go_state = 1; */ - // add to world, so it can be later looked up from HashMapHolder + // Add to world, so it can be later looked up from HashMapHolder map->Add(go); m_BgObjects[type] = go->GetGUID(); return true; } -//some doors aren't despawned so we cannot handle their closing in gameobject::update() -//it would be nice to correctly implement GO_ACTIVATED state and open/close doors in gameobject code +// Some doors aren't despawned so we cannot handle their closing in gameobject::update() +// It would be nice to correctly implement GO_ACTIVATED state and open/close doors in gameobject code void Battleground::DoorClose(uint32 type) { - GameObject *obj = GetBgMap()->GetGameObject(m_BgObjects[type]); - if (obj) + if (GameObject *obj = GetBgMap()->GetGameObject(m_BgObjects[type])) { - //if doors are open, close it + // If doors are open, close it if (obj->getLootState() == GO_ACTIVATED && obj->GetGoState() != GO_STATE_READY) { - //change state to allow door to be closed + // Change state to allow door to be closed obj->SetLootState(GO_READY); obj->UseDoorOrButton(RESPAWN_ONE_DAY); } } else - { - sLog->outError("Battleground: Door object not found (cannot close doors)"); - } + sLog->outError("Battleground::DoorClose: door gameobject (type: %u, GUID: %u) not found for BG (map: %u, instance id: %u)!", + type, GUID_LOPART(m_BgObjects[type]), m_MapId, m_InstanceID); } void Battleground::DoorOpen(uint32 type) { - GameObject *obj = GetBgMap()->GetGameObject(m_BgObjects[type]); - if (obj) + if (GameObject *obj = GetBgMap()->GetGameObject(m_BgObjects[type])) { - //change state to be sure they will be opened + // Change state to be sure they will be opened obj->SetLootState(GO_READY); obj->UseDoorOrButton(RESPAWN_ONE_DAY); } else - { - sLog->outError("Battleground: Door object not found! - doors will be closed."); - } + sLog->outError("Battleground::DoorOpen: door gameobject (type: %u, GUID: %u) not found for BG (map: %u, instance id: %u)!", + type, GUID_LOPART(m_BgObjects[type]), m_MapId, m_InstanceID); } GameObject* Battleground::GetBGObject(uint32 type) { GameObject *obj = GetBgMap()->GetGameObject(m_BgObjects[type]); if (!obj) - sLog->outError("couldn't get gameobject %i",type); + sLog->outError("Battleground::GetBGObject: gameobject (type: %u, GUID: %u) not found for BG (map: %u, instance id: %u)!", + type, GUID_LOPART(m_BgObjects[type]), m_MapId, m_InstanceID); return obj; } @@ -1581,37 +1508,25 @@ Creature* Battleground::GetBGCreature(uint32 type) { Creature *creature = GetBgMap()->GetCreature(m_BgCreatures[type]); if (!creature) - sLog->outError("Could not get BG creature %i (BG: %s Instance: %u)", type, GetBgMap()->GetBG()->GetName(), GetBgMap()->GetInstanceId()); + sLog->outError("Battleground::GetBGCreature: creature (type: %u, GUID: %u) not found for BG (map: %u, instance id: %u)!", + type, GUID_LOPART(m_BgCreatures[type]), m_MapId, m_InstanceID); return creature; } void Battleground::SpawnBGObject(uint32 type, uint32 respawntime) { - Map * map = GetBgMap(); - if (!map) - return; - if (respawntime == 0) - { - GameObject *obj = map->GetGameObject(m_BgObjects[type]); - if (obj) - { - //we need to change state from GO_JUST_DEACTIVATED to GO_READY in case battleground is starting again - if (obj->getLootState() == GO_JUST_DEACTIVATED) - obj->SetLootState(GO_READY); - obj->SetRespawnTime(0); - map->Add(obj); - } - } - else - { - GameObject *obj = map->GetGameObject(m_BgObjects[type]); - if (obj) + if (Map* map = GetBgMap()) + if (GameObject *obj = map->GetGameObject(m_BgObjects[type])) { - map->Add(obj); + if (respawntime) + obj->SetLootState(GO_JUST_DEACTIVATED); + else + if (obj->getLootState() == GO_JUST_DEACTIVATED) + // Change state from GO_JUST_DEACTIVATED to GO_READY in case battleground is starting again + obj->SetLootState(GO_READY); obj->SetRespawnTime(respawntime); - obj->SetLootState(GO_JUST_DEACTIVATED); + map->Add(obj); } - } } Creature* Battleground::AddCreature(uint32 entry, uint32 type, uint32 teamval, float x, float y, float z, float o, uint32 respawntime) @@ -1619,14 +1534,15 @@ Creature* Battleground::AddCreature(uint32 entry, uint32 type, uint32 teamval, f // If the assert is called, means that m_BgCreatures must be resized! ASSERT(type < m_BgCreatures.size()); - Map * map = GetBgMap(); + Map* map = GetBgMap(); if (!map) return NULL; Creature* pCreature = new Creature; if (!pCreature->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, PHASEMASK_NORMAL, entry, 0, teamval, x, y, z, o)) { - sLog->outError("Can't create creature entry: %u",entry); + sLog->outError("Battleground::AddCreature: cannot create creature (entry: %u) for BG (map: %u, instance id: %u)!", + entry, m_MapId, m_InstanceID); delete pCreature; return NULL; } @@ -1636,10 +1552,12 @@ Creature* Battleground::AddCreature(uint32 entry, uint32 type, uint32 teamval, f CreatureInfo const *cinfo = ObjectMgr::GetCreatureTemplate(entry); if (!cinfo) { - sLog->outErrorDb("Battleground::AddCreature: entry %u does not exist.", entry); + sLog->outError("Battleground::AddCreature: creature template (entry: %u) does not exist for BG (map: %u, instance id: %u)!", + entry, m_MapId, m_InstanceID); + delete pCreature; return NULL; } - //force using DB speeds + // Force using DB speeds pCreature->SetSpeed(MOVE_WALK, cinfo->speed_walk); pCreature->SetSpeed(MOVE_RUN, cinfo->speed_run); @@ -1651,50 +1569,23 @@ Creature* Battleground::AddCreature(uint32 entry, uint32 type, uint32 teamval, f return pCreature; } -/* -void Battleground::SpawnBGCreature(uint32 type, uint32 respawntime) -{ - Map * map = sMapMgr->FindMap(GetMapId(),GetInstanceId()); - if (!map) - return false; - if (respawntime == 0) - { - Creature *obj = HashMapHolder::Find(m_BgCreatures[type]); - if (obj) - { - //obj->Respawn(); // bugged - obj->SetRespawnTime(0); - sObjectMgr->RemoveCreatureRespawnTime(obj->GetGUIDLow(), GetInstanceID()); - map->Add(obj); - } - } - else - { - Creature *obj = HashMapHolder::Find(m_BgCreatures[type]); - if (obj) - { - obj->setDeathState(DEAD); - obj->SetRespawnTime(respawntime); - map->Add(obj); - } - } -} -*/ bool Battleground::DelCreature(uint32 type) { if (!m_BgCreatures[type]) return true; - Creature *cr = GetBgMap()->GetCreature(m_BgCreatures[type]); - if (!cr) + if (Creature *creature = GetBgMap()->GetCreature(m_BgCreatures[type])) { - sLog->outError("Can't find creature guid: %u",GUID_LOPART(m_BgCreatures[type])); - return false; + creature->AddObjectToRemoveList(); + m_BgCreatures[type] = 0; + return true; } - cr->AddObjectToRemoveList(); + + sLog->outError("Battleground::DelCreature: creature (type: %u, GUID: %u) not found for BG (map: %u, instance id: %u)!", + type, GUID_LOPART(m_BgCreatures[type]), m_MapId, m_InstanceID); m_BgCreatures[type] = 0; - return true; + return false; } bool Battleground::DelObject(uint32 type) @@ -1702,49 +1593,43 @@ bool Battleground::DelObject(uint32 type) if (!m_BgObjects[type]) return true; - GameObject *obj = GetBgMap()->GetGameObject(m_BgObjects[type]); - if (!obj) + if (GameObject* obj = GetBgMap()->GetGameObject(m_BgObjects[type])) { - sLog->outError("Can't find gobject guid: %u",GUID_LOPART(m_BgObjects[type])); - return false; + obj->SetRespawnTime(0); // not save respawn time + obj->Delete(); + m_BgObjects[type] = 0; + return true; } - obj->SetRespawnTime(0); // not save respawn time - obj->Delete(); + sLog->outError("Battleground::DelObject: gameobject (type: %u, GUID: %u) not found for BG (map: %u, instance id: %u)!", + type, GUID_LOPART(m_BgObjects[type]), m_MapId, m_InstanceID); m_BgObjects[type] = 0; - return true; + return false; } bool Battleground::AddSpiritGuide(uint32 type, float x, float y, float z, float o, uint32 team) { - uint32 entry = 0; - - if (team == ALLIANCE) - entry = BG_CREATURE_ENTRY_A_SPIRITGUIDE; - else - entry = BG_CREATURE_ENTRY_H_SPIRITGUIDE; - - Creature* pCreature = AddCreature(entry,type,team,x,y,z,o); - if (!pCreature) - { - sLog->outError("Can't create Spirit guide. Battleground not created!"); - EndNow(); - return false; + uint32 entry = (team == ALLIANCE) ? + BG_CREATURE_ENTRY_A_SPIRITGUIDE : + BG_CREATURE_ENTRY_H_SPIRITGUIDE; + + if (Creature* pCreature = AddCreature(entry, type, team, x, y, z, o)) + { + pCreature->setDeathState(DEAD); + pCreature->SetUInt64Value(UNIT_FIELD_CHANNEL_OBJECT, pCreature->GetGUID()); + // aura + // TODO: Fix display here + // pCreature->SetVisibleAura(0, SPELL_SPIRIT_HEAL_CHANNEL); + // casting visual effect + pCreature->SetUInt32Value(UNIT_CHANNEL_SPELL, SPELL_SPIRIT_HEAL_CHANNEL); + // correct cast speed + pCreature->SetFloatValue(UNIT_MOD_CAST_SPEED, 1.0f); + //pCreature->CastSpell(pCreature, SPELL_SPIRIT_HEAL_CHANNEL, true); + return true; } - - pCreature->setDeathState(DEAD); - - pCreature->SetUInt64Value(UNIT_FIELD_CHANNEL_OBJECT, pCreature->GetGUID()); - // aura - //TODO: Fix display here - //pCreature->SetVisibleAura(0, SPELL_SPIRIT_HEAL_CHANNEL); - // casting visual effect - pCreature->SetUInt32Value(UNIT_CHANNEL_SPELL, SPELL_SPIRIT_HEAL_CHANNEL); - // correct cast speed - pCreature->SetFloatValue(UNIT_MOD_CAST_SPEED, 1.0f); - - //pCreature->CastSpell(pCreature, SPELL_SPIRIT_HEAL_CHANNEL, true); - - return true; + sLog->outError("Battleground::AddSpiritGuide: cannot create spirit guide (type: %u, entry: %u) for BG (map: %u, instance id: %u)!", + type, entry, m_MapId, m_InstanceID); + EndNow(); + return false; } void Battleground::SendMessageToAll(int32 entry, ChatMsg type, Player const* source) @@ -1769,12 +1654,13 @@ void Battleground::PSendMessageToAll(int32 entry, ChatMsg type, Player const* so void Battleground::SendWarningToAll(int32 entry, ...) { const char *format = sObjectMgr->GetTrinityStringForDBCLocale(entry); + + char str[1024]; va_list ap; - char str [1024]; va_start(ap, entry); - vsnprintf(str,1024,format, ap); + vsnprintf(str, 1024, format, ap); va_end(ap); - std::string msg = (std::string)str; + std::string msg(str); WorldPacket data(SMSG_MESSAGECHAT, 200); @@ -1808,42 +1694,41 @@ void Battleground::EndNow() SetEndTime(0); } -//to be removed -const char *Battleground::GetTrinityString(int32 entry) +// To be removed +const char* Battleground::GetTrinityString(int32 entry) { // FIXME: now we have different DBC locales and need localized message for each target client return sObjectMgr->GetTrinityStringForDBCLocale(entry); } -/* -important notice: -buffs aren't spawned/despawned when players captures anything -buffs are in their positions when battleground starts -*/ -void Battleground::HandleTriggerBuff(uint64 const& go_guid) +// IMPORTANT NOTICE: +// buffs aren't spawned/despawned when players captures anything +// buffs are in their positions when battleground starts +void Battleground::HandleTriggerBuff(const uint64& go_guid) { GameObject *obj = GetBgMap()->GetGameObject(go_guid); if (!obj || obj->GetGoType() != GAMEOBJECT_TYPE_TRAP || !obj->isSpawned()) return; - //change buff type, when buff is used: + // Change buff type, when buff is used: int32 index = m_BgObjects.size() - 1; while (index >= 0 && m_BgObjects[index] != go_guid) index--; if (index < 0) { - sLog->outError("Battleground (Type: %u) has buff gameobject (Guid: %u Entry: %u Type:%u) but it hasn't that object in its internal data",GetTypeID(true),GUID_LOPART(go_guid),obj->GetEntry(),obj->GetGoType()); + sLog->outError("Battleground::HandleTriggerBuff: cannot find buff gameobject (GUID: %u, entry: %u, type: %u) in internal data for BG (map: %u, instance id: %u)!", + GUID_LOPART(go_guid), obj->GetEntry(), obj->GetGoType(), m_MapId, m_InstanceID); return; } - //randomly select new buff + // Randomly select new buff uint8 buff = urand(0, 2); uint32 entry = obj->GetEntry(); if (m_BuffChange && entry != Buff_Entries[buff]) { - //despawn current buff + // Despawn current buff SpawnBGObject(index, RESPAWN_ONE_DAY); - //set index for new one + // Set index for new one for (uint8 currBuffTypeIndex = 0; currBuffTypeIndex < 3; ++currBuffTypeIndex) if (entry == Buff_Entries[currBuffTypeIndex]) { @@ -1855,13 +1740,13 @@ void Battleground::HandleTriggerBuff(uint64 const& go_guid) SpawnBGObject(index, BUFF_RESPAWN_TIME); } -void Battleground::HandleKillPlayer(Player *player, Player *killer) +void Battleground::HandleKillPlayer(Player* player, Player* killer) { - //keep in mind that for arena this will have to be changed a bit + // Keep in mind that for arena this will have to be changed a bit - // add +1 deaths + // Add +1 deaths UpdatePlayerScore(player, SCORE_DEATHS, 1); - // add +1 kills to group and +1 killing_blows to killer + // Add +1 kills to group and +1 killing_blows to killer if (killer) { UpdatePlayerScore(killer, SCORE_HONORABLE_KILLS, 1); @@ -1869,8 +1754,7 @@ void Battleground::HandleKillPlayer(Player *player, Player *killer) for (BattlegroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr) { - Player *plr = sObjectMgr->GetPlayer(itr->first); - + Player* plr = sObjectMgr->GetPlayer(itr->first); if (!plr || plr == killer) continue; @@ -1879,18 +1763,17 @@ void Battleground::HandleKillPlayer(Player *player, Player *killer) } } - // to be able to remove insignia -- ONLY IN Battlegrounds - // give xp only in Battlegrounds if (!isArena()) { + // To be able to remove insignia -- ONLY IN Battlegrounds player->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE); RewardXPAtKill(killer, player); } } -// return the player's team based on battlegroundplayer info -// used in same faction arena matches mainly -uint32 Battleground::GetPlayerTeam(uint64 guid) const +// Return the player's team based on battlegroundplayer info +// Used in same faction arena matches mainly +uint32 Battleground::GetPlayerTeam(const uint64& guid) const { BattlegroundPlayerMap::const_iterator itr = m_Players.find(guid); if (itr != m_Players.end()) @@ -1900,10 +1783,10 @@ uint32 Battleground::GetPlayerTeam(uint64 guid) const uint32 Battleground::GetOtherTeam(uint32 teamId) const { - return (teamId) ? ((teamId == ALLIANCE) ? HORDE : ALLIANCE) : 0; + return teamId ? ((teamId == ALLIANCE) ? HORDE : ALLIANCE) : 0; } -bool Battleground::IsPlayerInBattleground(uint64 guid) const +bool Battleground::IsPlayerInBattleground(const uint64& guid) const { BattlegroundPlayerMap::const_iterator itr = m_Players.find(guid); if (itr != m_Players.end()) @@ -1935,7 +1818,7 @@ uint32 Battleground::GetAlivePlayersCountByTeam(uint32 Team) const { if (itr->second.Team == Team) { - Player * pl = sObjectMgr->GetPlayer(itr->first); + Player* pl = sObjectMgr->GetPlayer(itr->first); if (pl && pl->isAlive() && !pl->HasByteFlag(UNIT_FIELD_BYTES_2, 3, FORM_SPIRITOFREDEMPTION)) ++count; } @@ -1945,22 +1828,20 @@ uint32 Battleground::GetAlivePlayersCountByTeam(uint32 Team) const void Battleground::SetHoliday(bool is_holiday) { - if (is_holiday) - m_HonorMode = BG_HOLIDAY; - else - m_HonorMode = BG_NORMAL; + m_HonorMode = is_holiday ? BG_HOLIDAY : BG_NORMAL; } -int32 Battleground::GetObjectType(uint64 guid) +int32 Battleground::GetObjectType(const uint64& guid) { for (uint32 i = 0; i < m_BgObjects.size(); ++i) if (m_BgObjects[i] == guid) return i; - sLog->outError("Battleground: cheating? a player used a gameobject which isnt supposed to be a usable object!"); + sLog->outError("Battleground::GetObjectType: player used gameobject (GUID: %u) which is not in internal data for BG (map: %u, instance id: %u), cheating?", + GUID_LOPART(guid), m_MapId, m_InstanceID); return -1; } -void Battleground::HandleKillUnit(Creature * /*creature*/, Player * /*killer*/) +void Battleground::HandleKillUnit(Creature* /*creature*/, Player* /*killer*/) { } @@ -1985,9 +1866,11 @@ void Battleground::UpdateArenaWorldState() void Battleground::SetBgRaid(uint32 TeamID, Group *bg_raid) { - Group* &old_raid = TeamID == ALLIANCE ? m_BgRaids[BG_TEAM_ALLIANCE] : m_BgRaids[BG_TEAM_HORDE]; - if (old_raid) old_raid->SetBattlegroundGroup(NULL); - if (bg_raid) bg_raid->SetBattlegroundGroup(this); + Group*& old_raid = TeamID == ALLIANCE ? m_BgRaids[BG_TEAM_ALLIANCE] : m_BgRaids[BG_TEAM_HORDE]; + if (old_raid) + old_raid->SetBattlegroundGroup(NULL); + if (bg_raid) + bg_raid->SetBattlegroundGroup(this); old_raid = bg_raid; } @@ -1998,8 +1881,8 @@ WorldSafeLocsEntry const* Battleground::GetClosestGraveYard(Player* player) bool Battleground::IsTeamScoreInRange(uint32 team, uint32 minScore, uint32 maxScore) const { - BattlegroundTeamId team_idx = GetTeamIndexByTeamId(team); - uint32 score = (m_TeamScores[team_idx] < 0) ? 0 : uint32(m_TeamScores[team_idx]); + BattlegroundTeamId teamIndex = GetTeamIndexByTeamId(team); + uint32 score = std::max(m_TeamScores[teamIndex], 0); return score >= minScore && score <= maxScore; } @@ -2012,95 +1895,12 @@ void Battleground::StartTimedAchievement(AchievementCriteriaTimedTypes type, uin void Battleground::SetBracket(PvPDifficultyEntry const* bracketEntry) { - m_BracketId = bracketEntry->GetBracketId(); - SetLevelRange(bracketEntry->minLevel,bracketEntry->maxLevel); + m_BracketId = bracketEntry->GetBracketId(); + SetLevelRange(bracketEntry->minLevel, bracketEntry->maxLevel); } -void Battleground::RewardXPAtKill(Player* plr, Player* victim) +void Battleground::RewardXPAtKill(Player* killer, Player* victim) { - if (!sWorld->getBoolConfig(CONFIG_BG_XP_FOR_KILL) || !plr || !victim) - return; - - uint32 xp = 0; - Player* member_with_max_level = NULL; - Player* not_gray_member_with_max_level = NULL; - - if (Group *pGroup = plr->GetGroup())//should be always in a raid group while in any bg - { - uint32 count = 0; - uint32 sum_level = 0; - for (GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next()) - { - Player* member = itr->getSource(); - if (!member || !member->isAlive()) // only for alive - continue; - - if (!member->IsAtGroupRewardDistance(victim)) // at req. distance - continue; - - ++count; - sum_level += member->getLevel(); - if (!member_with_max_level || member_with_max_level->getLevel() < member->getLevel()) - member_with_max_level = member; - - uint32 gray_level = Trinity::XP::GetGrayLevel(member->getLevel()); - if (victim->getLevel() > gray_level && (!not_gray_member_with_max_level - || not_gray_member_with_max_level->getLevel() < member->getLevel())) - not_gray_member_with_max_level = member; - } - - if (member_with_max_level) - { - xp = !not_gray_member_with_max_level ? 0 : Trinity::XP::Gain(not_gray_member_with_max_level, victim); - - if (!xp) - return; - - float group_rate = 1.0f; - - for (GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next()) - { - Player* pGroupGuy = itr->getSource(); - if (!pGroupGuy) - continue; - - if (!pGroupGuy->IsAtGroupRewardDistance(victim)) - continue; // member (alive or dead) or his corpse at req. distance - - float rate = group_rate * float(pGroupGuy->getLevel()) / sum_level; - - // XP updated only for alive group member - if (pGroupGuy->isAlive() && not_gray_member_with_max_level && pGroupGuy->getLevel() <= not_gray_member_with_max_level->getLevel()) - { - uint32 itr_xp = (member_with_max_level == not_gray_member_with_max_level) ? uint32(xp * rate) : uint32((xp * rate / 2) + 1); - - // handle SPELL_AURA_MOD_XP_PCT auras - Unit::AuraEffectList const& ModXPPctAuras = plr->GetAuraEffectsByType(SPELL_AURA_MOD_XP_PCT); - for (Unit::AuraEffectList::const_iterator i = ModXPPctAuras.begin(); i != ModXPPctAuras.end(); ++i) - AddPctN(itr_xp, (*i)->GetAmount()); - - pGroupGuy->GiveXP(itr_xp, victim); - if (Pet* pet = pGroupGuy->GetPet()) - pet->GivePetXP(itr_xp / 2); - } - } - } - } - else//should be always in a raid group while in any BG, but you never know... - { - xp = Trinity::XP::Gain(plr, victim); - - if (!xp) - return; - - // handle SPELL_AURA_MOD_XP_PCT auras - Unit::AuraEffectList const& ModXPPctAuras = plr->GetAuraEffectsByType(SPELL_AURA_MOD_XP_PCT); - for (Unit::AuraEffectList::const_iterator i = ModXPPctAuras.begin(); i != ModXPPctAuras.end(); ++i) - AddPctN(xp, (*i)->GetAmount()); - - plr->GiveXP(xp, victim); - - if (Pet* pet = plr->GetPet()) - pet->GivePetXP(xp); - } + if (sWorld->getBoolConfig(CONFIG_BG_XP_FOR_KILL) && killer && victim) + killer->RewardPlayerAndGroupAtKill(victim, true); } diff --git a/src/server/game/Battlegrounds/Battleground.h b/src/server/game/Battlegrounds/Battleground.h index c0f72664088d5..ea518981be907 100755 --- a/src/server/game/Battlegrounds/Battleground.h +++ b/src/server/game/Battlegrounds/Battleground.h @@ -133,7 +133,7 @@ enum BattlegroundBuffObjects enum BattlegroundRandomRewards { BG_REWARD_WINNER_HONOR_FIRST = 30, - BG_REWARD_WINNER_ARENA_FIRST = 0, + BG_REWARD_WINNER_ARENA_FIRST = 25, BG_REWARD_WINNER_HONOR_LAST = 15, BG_REWARD_WINNER_ARENA_LAST = 0, BG_REWARD_LOSER_HONOR_FIRST = 5, @@ -418,13 +418,7 @@ class Battleground void IncreaseInvitedCount(uint32 team) { (team == ALLIANCE) ? ++m_InvitedAlliance : ++m_InvitedHorde; } void SetRandom(bool isRandom) { m_IsRandom = isRandom; } - uint32 GetInvitedCount(uint32 team) const - { - if (team == ALLIANCE) - return m_InvitedAlliance; - else - return m_InvitedHorde; - } + uint32 GetInvitedCount(uint32 team) const { return (team == ALLIANCE) ? m_InvitedAlliance : m_InvitedHorde; } bool HasFreeSlots() const; uint32 GetFreeSlotsForTeam(uint32 Team) const; @@ -443,18 +437,19 @@ class Battleground uint32 GetReviveQueueSize() const { return m_ReviveQueue.size(); } - void AddPlayerToResurrectQueue(uint64 npc_guid, uint64 player_guid); - void RemovePlayerFromResurrectQueue(uint64 player_guid); + void AddPlayerToResurrectQueue(const uint64& npc_guid, const uint64& player_guid); + void RemovePlayerFromResurrectQueue(const uint64& player_guid); void StartBattleground(); GameObject* GetBGObject(uint32 type); Creature* GetBGCreature(uint32 type); - /* Location */ + + // Location void SetMapId(uint32 MapID) { m_MapId = MapID; } uint32 GetMapId() const { return m_MapId; } - /* Map pointers */ + // Map pointers void SetBgMap(BattlegroundMap* map) { m_Map = map; } BattlegroundMap* GetBgMap() { @@ -472,11 +467,11 @@ class Battleground O = m_TeamStartLocO[idx]; } - /* Packet Transfer */ + // Packet Transfer // method that should fill worldpacket with actual world states (not yet implemented for all battlegrounds!) virtual void FillInitialWorldStates(WorldPacket& /*data*/) {} - void SendPacketToTeam(uint32 TeamID, WorldPacket *packet, Player *sender = NULL, bool self = true); - void SendPacketToAll(WorldPacket *packet); + void SendPacketToTeam(uint32 TeamID, WorldPacket* packet, Player* sender = NULL, bool self = true); + void SendPacketToAll(WorldPacket* packet); void YellToAll(Creature* creature, const char* text, uint32 language); template @@ -489,9 +484,9 @@ class Battleground void RewardHonorToTeam(uint32 Honor, uint32 TeamID); void RewardReputationToTeam(uint32 faction_id, uint32 Reputation, uint32 TeamID); void UpdateWorldState(uint32 Field, uint32 Value); - void UpdateWorldStateForPlayer(uint32 Field, uint32 Value, Player *Source); + void UpdateWorldStateForPlayer(uint32 Field, uint32 Value, Player* Source); void EndBattleground(uint32 winner); - void BlockMovement(Player *plr); + void BlockMovement(Player* plr); void SendWarningToAll(int32 entry, ...); void SendMessageToAll(int32 entry, ChatMsg type, Player const* source = NULL); @@ -500,7 +495,7 @@ class Battleground // specialized version with 2 string id args void SendMessage2ToAll(int32 entry, ChatMsg type, Player const* source, int32 strId1 = 0, int32 strId2 = 0); - /* Raid Group */ + // Raid Group Group *GetBgRaid(uint32 TeamID) const { return TeamID == ALLIANCE ? m_BgRaids[BG_TEAM_ALLIANCE] : m_BgRaids[BG_TEAM_HORDE]; } void SetBgRaid(uint32 TeamID, Group *bg_raid); @@ -528,14 +523,14 @@ class Battleground void CheckArenaWinConditions(); void UpdateArenaWorldState(); - /* Triggers handle */ + // Triggers handle // must be implemented in BG subclass virtual void HandleAreaTrigger(Player* /*Source*/, uint32 /*Trigger*/) {} // must be implemented in BG subclass if need AND call base class generic code virtual void HandleKillPlayer(Player *player, Player *killer); virtual void HandleKillUnit(Creature* /*unit*/, Player* /*killer*/); - /* Battleground events */ + // Battleground events virtual void EventPlayerDroppedFlag(Player* /*player*/) {} virtual void EventPlayerClickedOnFlag(Player* /*player*/, GameObject* /*target_obj*/) {} virtual void EventPlayerCapturedFlag(Player* /*player*/) {} @@ -545,21 +540,21 @@ class Battleground virtual void EventPlayerUsedGO(Player* /*player*/, GameObject* /*go*/){} // this function can be used by spell to interact with the BG map - virtual void DoAction(uint32 /*action*/, uint64 /*var*/) {} + virtual void DoAction(uint32 /*action*/, const uint64& /*var*/) {} virtual void HandlePlayerResurrect(Player* /*player*/) {} - /* Death related */ + // Death related virtual WorldSafeLocsEntry const* GetClosestGraveYard(Player* player); - virtual void AddPlayer(Player *plr); // must be implemented in BG subclass + virtual void AddPlayer(Player* plr); // must be implemented in BG subclass - void AddOrSetPlayerToCorrectBgGroup(Player *player, uint32 team); + void AddOrSetPlayerToCorrectBgGroup(Player* player, uint32 team); - virtual void RemovePlayerAtLeave(uint64 guid, bool Transport, bool SendPacket); + virtual void RemovePlayerAtLeave(const uint64& guid, bool Transport, bool SendPacket); // can be extended in in BG subclass - void HandleTriggerBuff(uint64 const& go_guid); + void HandleTriggerBuff(const uint64& go_guid); void SetHoliday(bool is_holiday); // TODO: make this protected: @@ -569,55 +564,62 @@ class Battleground BGCreatures m_BgCreatures; void SpawnBGObject(uint32 type, uint32 respawntime); bool AddObject(uint32 type, uint32 entry, float x, float y, float z, float o, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime = 0); -// void SpawnBGCreature(uint32 type, uint32 respawntime); Creature* AddCreature(uint32 entry, uint32 type, uint32 teamval, float x, float y, float z, float o, uint32 respawntime = 0); bool DelCreature(uint32 type); bool DelObject(uint32 type); bool AddSpiritGuide(uint32 type, float x, float y, float z, float o, uint32 team); - int32 GetObjectType(uint64 guid); + int32 GetObjectType(const uint64& guid); void DoorOpen(uint32 type); void DoorClose(uint32 type); //to be removed - const char *GetTrinityString(int32 entry); + const char* GetTrinityString(int32 entry); virtual bool HandlePlayerUnderMap(Player * /*plr*/) { return false; } // since arenas can be AvA or Hvh, we have to get the "temporary" team of a player - uint32 GetPlayerTeam(uint64 guid) const; + uint32 GetPlayerTeam(const uint64& guid) const; uint32 GetOtherTeam(uint32 teamId) const; - bool IsPlayerInBattleground(uint64 guid) const; + bool IsPlayerInBattleground(const uint64& guid) const; - void SetDeleteThis() {m_SetDeleteThis = true;} + void SetDeleteThis() { m_SetDeleteThis = true; } - /* virtual score-array - get's used in bg-subclasses */ + // virtual score-array - get's used in bg-subclasses int32 m_TeamScores[BG_TEAMS_COUNT]; - void RewardXPAtKill(Player* plr, Player* victim); + void RewardXPAtKill(Player* killer, Player* victim); bool CanAwardArenaPoints() const { return m_LevelMin >= BG_AWARD_ARENA_POINTS_MIN_LEVEL; } protected: - //this method is called, when BG cannot spawn its own spirit guide, or something is wrong, It correctly ends Battleground + // this method is called, when BG cannot spawn its own spirit guide, or something is wrong, It correctly ends Battleground void EndNow(); void PlayerAddedToBGCheckIfBGIsRunning(Player* plr); - /* Scorekeeping */ + Player* _GetPlayer(const uint64& guid, bool offlineRemove, const char* context) const; + Player* _GetPlayer(BattlegroundPlayerMap::iterator itr, const char* context); + Player* _GetPlayer(BattlegroundPlayerMap::const_iterator itr, const char* context) const; + Player* _GetPlayerForTeam(uint32 teamId, BattlegroundPlayerMap::const_iterator itr, const char* context) const; + + void _ProcessOfflineQueue(); + void _ProcessRessurect(uint32 diff); + void _ProcessProgress(uint32 diff); + void _ProcessLeave(uint32 diff); + void _ProcessJoin(uint32 diff); + // Scorekeeping BattlegroundScoreMap m_PlayerScores; // Player scores // must be implemented in BG subclass virtual void RemovePlayer(Player * /*player*/, uint64 /*guid*/) {} - /* Player lists, those need to be accessible by inherited classes */ + // Player lists, those need to be accessible by inherited classes BattlegroundPlayerMap m_Players; - // Spirit Guide guid + Player list GUIDS + // Spirit Guide guid + Player list GUIDS std::map > m_ReviveQueue; - /* - these are important variables used for starting messages - */ + // these are important variables used for starting messages uint8 m_Events; BattlegroundStartTimeIntervals m_StartDelayTimes[BG_STARTING_EVENT_COUNT]; - //this must be filled in constructors! + // this must be filled in constructors! uint32 m_StartMessageIds[BG_STARTING_EVENT_COUNT]; bool m_BuffChange; @@ -625,12 +627,12 @@ class Battleground BGHonorMode m_HonorMode; private: - /* Battleground */ + // Battleground BattlegroundTypeId m_TypeID; BattlegroundTypeId m_RandomTypeID; - uint32 m_InstanceID; //Battleground Instance's GUID! + uint32 m_InstanceID; // Battleground Instance's GUID! BattlegroundStatus m_Status; - uint32 m_ClientInstanceID; //the instance-id which is sent to the client and without any other internal use + uint32 m_ClientInstanceID; // the instance-id which is sent to the client and without any other internal use uint32 m_StartTime; uint32 m_ResetStatTimer; int32 m_EndTime; // it is set to 120000 when bg is ending and it decreases itself @@ -647,29 +649,29 @@ class Battleground uint32 m_PrematureCountDownTimer; char const *m_Name; - /* Player lists */ + // Player lists std::vector m_ResurrectQueue; // Player GUID std::deque m_OfflineQueue; // Player GUID - /* Invited counters are useful for player invitation to BG - do not allow, if BG is started to one faction to have 2 more players than another faction */ - /* Invited counters will be changed only when removing already invited player from queue, removing player from battleground and inviting player to BG */ - /* Invited players counters*/ + // Invited counters are useful for player invitation to BG - do not allow, if BG is started to one faction to have 2 more players than another faction + // Invited counters will be changed only when removing already invited player from queue, removing player from battleground and inviting player to BG + // Invited players counters uint32 m_InvitedAlliance; uint32 m_InvitedHorde; - /* Raid Group */ - Group *m_BgRaids[BG_TEAMS_COUNT]; // 0 - alliance, 1 - horde + // Raid Group + Group *m_BgRaids[BG_TEAMS_COUNT]; // 0 - alliance, 1 - horde - /* Players count by team */ + // Players count by team uint32 m_PlayersCount[BG_TEAMS_COUNT]; - /* Arena team ids by team */ + // Arena team ids by team uint32 m_ArenaTeamIds[BG_TEAMS_COUNT]; int32 m_ArenaTeamRatingChanges[BG_TEAMS_COUNT]; uint32 m_ArenaTeamMMR[BG_TEAMS_COUNT]; - /* Limits */ + // Limits uint32 m_LevelMin; uint32 m_LevelMax; uint32 m_MaxPlayersPerTeam; @@ -677,7 +679,7 @@ class Battleground uint32 m_MinPlayersPerTeam; uint32 m_MinPlayers; - /* Start location */ + // Start location uint32 m_MapId; BattlegroundMap* m_Map; float m_TeamStartLocX[BG_TEAMS_COUNT]; diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp index 284702de0122b..32eb0a163676e 100755 --- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp +++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp @@ -21,7 +21,6 @@ #include "World.h" #include "WorldPacket.h" - #include "ArenaTeam.h" #include "BattlegroundMgr.h" #include "BattlegroundAV.h" @@ -110,6 +109,7 @@ void BattlegroundMgr::Update(uint32 diff) m_Battlegrounds[i].erase(itr); if (!m_ClientBattlegroundIds[i][bg->GetBracketId()].empty()) m_ClientBattlegroundIds[i][bg->GetBracketId()].erase(bg->GetClientInstanceID()); + delete bg; } } @@ -144,7 +144,7 @@ void BattlegroundMgr::Update(uint32 diff) if (m_NextRatingDiscardUpdate < diff) { // forced update for rated arenas (scan all, but skipped non rated) - sLog->outDebug("BattlegroundMgr: UPDATING ARENA QUEUES"); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BattlegroundMgr: UPDATING ARENA QUEUES"); for (int qtype = BATTLEGROUND_QUEUE_2v2; qtype <= BATTLEGROUND_QUEUE_5v5; ++qtype) for (int bracket = BG_BRACKET_ID_FIRST; bracket < MAX_BATTLEGROUND_BRACKETS; ++bracket) m_BattlegroundQueues[qtype].Update( @@ -189,7 +189,7 @@ void BattlegroundMgr::BuildBattlegroundStatusPacket(WorldPacket *data, Battlegro *data << uint32(QueueSlot); // queue id (0...1) - player can be in 2 queues in time // The following segment is read as uint64 in client but can be appended as their original type. *data << uint8(arenatype); - sLog->outDebug("BattlegroundMgr::BuildBattlegroundStatusPacket: arenatype = %u for bg instanceID %u, TypeID %u.", arenatype, bg->GetClientInstanceID(), bg->GetTypeID()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "BattlegroundMgr::BuildBattlegroundStatusPacket: arenatype = %u for bg instanceID %u, TypeID %u.", arenatype, bg->GetClientInstanceID(), bg->GetTypeID()); *data << uint8(bg->isArena() ? 0xC : 0x2); *data << uint32(bg->GetTypeID()); *data << uint16(0x1F90); @@ -245,7 +245,7 @@ void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket *data, Battleground *bg) *data << uint32(pointsLost); // Rating Lost *data << uint32(pointsGained); // Rating gained *data << uint32(MatchmakerRating); // Matchmaking Value - sLog->outDebug("rating change: %d", bg->m_ArenaTeamRatingChanges[i]); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "rating change: %d", bg->m_ArenaTeamRatingChanges[i]); } for (int8 i = 1; i >= 0; --i) { @@ -380,7 +380,7 @@ void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket *data, Battleground *bg) *data << uint32(0); break; default: - sLog->outDebug("Unhandled MSG_PVP_LOG_DATA for BG id %u", bg->GetTypeID()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Unhandled MSG_PVP_LOG_DATA for BG id %u", bg->GetTypeID()); *data << uint32(0); break; } @@ -603,7 +603,10 @@ Battleground * BattlegroundMgr::CreateNewBattleground(BattlegroundTypeId bgTypeI bg->SetBracket(bracketEntry); // generate a new instance id - bg->SetInstanceID(sMapMgr->GenerateInstanceId()); // set instance id + uint32 instanceId = sMapMgr->GenerateInstanceId(); + // set instance id + bg->SetInstanceID(instanceId); + bg->SetClientInstanceID(CreateClientVisibleInstanceId(isRandom ? BATTLEGROUND_RB : bgTypeId, bracketEntry->GetBracketId())); // reset the new bg (set status to status_wait_queue from status_none) @@ -801,15 +804,15 @@ void BattlegroundMgr::InitAutomaticArenaPointDistribution() time_t wstime = time_t(sWorld->getWorldState(WS_ARENA_DISTRIBUTION_TIME)); time_t curtime = time(NULL); - sLog->outDebug("Initializing Automatic Arena Point Distribution"); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Initializing Automatic Arena Point Distribution"); if (wstime < curtime) { m_NextAutoDistributionTime = curtime; // reset will be called in the next update - sLog->outDebug("Battleground: Next arena point distribution time in the past, reseting it now."); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Battleground: Next arena point distribution time in the past, reseting it now."); } else m_NextAutoDistributionTime = wstime; - sLog->outDebug("Automatic Arena Point Distribution initialized."); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Automatic Arena Point Distribution initialized."); } void BattlegroundMgr::DistributeArenaPoints() @@ -1162,6 +1165,7 @@ HolidayIds BattlegroundMgr::BGTypeToWeekendHolidayId(BattlegroundTypeId bgTypeId case BATTLEGROUND_WS: return HOLIDAY_CALL_TO_ARMS_WS; case BATTLEGROUND_SA: return HOLIDAY_CALL_TO_ARMS_SA; case BATTLEGROUND_AB: return HOLIDAY_CALL_TO_ARMS_AB; + case BATTLEGROUND_IC: return HOLIDAY_CALL_TO_ARMS_IC; default: return HOLIDAY_NONE; } } @@ -1175,6 +1179,7 @@ BattlegroundTypeId BattlegroundMgr::WeekendHolidayIdToBGType(HolidayIds holiday) case HOLIDAY_CALL_TO_ARMS_WS: return BATTLEGROUND_WS; case HOLIDAY_CALL_TO_ARMS_SA: return BATTLEGROUND_SA; case HOLIDAY_CALL_TO_ARMS_AB: return BATTLEGROUND_AB; + case HOLIDAY_CALL_TO_ARMS_IC: return BATTLEGROUND_IC; default: return BATTLEGROUND_TYPE_NONE; } } diff --git a/src/server/game/Battlegrounds/BattlegroundQueue.cpp b/src/server/game/Battlegrounds/BattlegroundQueue.cpp index 03ec1f3049c02..f5d2a864a76e7 100755 --- a/src/server/game/Battlegrounds/BattlegroundQueue.cpp +++ b/src/server/game/Battlegrounds/BattlegroundQueue.cpp @@ -151,7 +151,7 @@ GroupQueueInfo * BattlegroundQueue::AddGroup(Player *leader, Group* grp, Battleg index += BG_TEAMS_COUNT; if (ginfo->Team == HORDE) index++; - sLog->outDebug("Adding Group to BattlegroundQueue bgTypeId : %u, bracket_id : %u, index : %u", BgTypeId, bracketId, index); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Adding Group to BattlegroundQueue bgTypeId : %u, bracket_id : %u, index : %u", BgTypeId, bracketId, index); uint32 lastOnlineTime = getMSTime(); @@ -327,7 +327,7 @@ void BattlegroundQueue::RemovePlayer(const uint64& guid, bool decreaseInvitedCou sLog->outError("BattlegroundQueue: ERROR Cannot find groupinfo for player GUID: %u", GUID_LOPART(guid)); return; } - sLog->outDebug("BattlegroundQueue: Removing player GUID %u, from bracket_id %u", GUID_LOPART(guid), (uint32)bracket_id); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BattlegroundQueue: Removing player GUID %u, from bracket_id %u", GUID_LOPART(guid), (uint32)bracket_id); // ALL variables are correctly set // We can ignore leveling up in queue - it should not cause crash @@ -342,7 +342,7 @@ void BattlegroundQueue::RemovePlayer(const uint64& guid, bool decreaseInvitedCou // if invited to bg, and should decrease invited count, then do it if (decreaseInvitedCount && group->IsInvitedToBGInstanceGUID) { - Battleground* bg = sBattlegroundMgr->GetBattleground(group->IsInvitedToBGInstanceGUID, group->BgTypeId); + Battleground* bg = sBattlegroundMgr->GetBattleground(group->IsInvitedToBGInstanceGUID, BATTLEGROUND_AA ? BATTLEGROUND_TYPE_NONE : group->BgTypeId); if (bg) bg->DecreaseInvitedCount(group->Team); } @@ -364,7 +364,7 @@ void BattlegroundQueue::RemovePlayer(const uint64& guid, bool decreaseInvitedCou ArenaTeam * at = sObjectMgr->GetArenaTeamById(group->ArenaTeamId); if (at) { - sLog->outDebug("UPDATING memberLost's personal arena rating for %u by opponents rating: %u", GUID_LOPART(guid), group->OpponentsTeamRating); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "UPDATING memberLost's personal arena rating for %u by opponents rating: %u", GUID_LOPART(guid), group->OpponentsTeamRating); Player *plr = sObjectMgr->GetPlayer(guid); if (plr) at->MemberLost(plr, group->OpponentsMatchmakerRating); @@ -471,7 +471,7 @@ bool BattlegroundQueue::InviteGroupToBG(GroupQueueInfo * ginfo, Battleground * b uint32 queueSlot = plr->GetBattlegroundQueueIndex(bgQueueTypeId); - sLog->outDebug("Battleground: invited plr %s (%u) to BG instance %u queueindex %u bgtype %u, I can't help it if they don't press the enter battle button.",plr->GetName(),plr->GetGUIDLow(),bg->GetInstanceID(),queueSlot,bg->GetTypeID()); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Battleground: invited plr %s (%u) to BG instance %u queueindex %u bgtype %u, I can't help it if they don't press the enter battle button.",plr->GetName(),plr->GetGUIDLow(),bg->GetInstanceID(),queueSlot,bg->GetTypeID()); // send status packet sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, queueSlot, STATUS_WAIT_JOIN, INVITE_ACCEPT_WAIT_TIME, 0, ginfo->ArenaType); @@ -984,10 +984,10 @@ void BattlegroundQueue::Update(BattlegroundTypeId bgTypeId, BattlegroundBracketI (*(itr_team[BG_TEAM_ALLIANCE]))->OpponentsTeamRating = (*(itr_team[BG_TEAM_HORDE]))->ArenaTeamRating; (*(itr_team[BG_TEAM_ALLIANCE]))->OpponentsMatchmakerRating = (*(itr_team[BG_TEAM_HORDE]))->ArenaMatchmakerRating; - sLog->outDebug("setting oposite teamrating for team %u to %u", (*(itr_team[BG_TEAM_ALLIANCE]))->ArenaTeamId, (*(itr_team[BG_TEAM_ALLIANCE]))->OpponentsTeamRating); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "setting oposite teamrating for team %u to %u", (*(itr_team[BG_TEAM_ALLIANCE]))->ArenaTeamId, (*(itr_team[BG_TEAM_ALLIANCE]))->OpponentsTeamRating); (*(itr_team[BG_TEAM_HORDE]))->OpponentsTeamRating = (*(itr_team[BG_TEAM_ALLIANCE]))->ArenaTeamRating; (*(itr_team[BG_TEAM_HORDE]))->OpponentsMatchmakerRating = (*(itr_team[BG_TEAM_ALLIANCE]))->ArenaMatchmakerRating; - sLog->outDebug("setting oposite teamrating for team %u to %u", (*(itr_team[BG_TEAM_HORDE]))->ArenaTeamId, (*(itr_team[BG_TEAM_HORDE]))->OpponentsTeamRating); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "setting oposite teamrating for team %u to %u", (*(itr_team[BG_TEAM_HORDE]))->ArenaTeamId, (*(itr_team[BG_TEAM_HORDE]))->OpponentsTeamRating); // now we must move team if we changed its faction to another faction queue, because then we will spam log by errors in Queue::RemovePlayer if ((*(itr_team[BG_TEAM_ALLIANCE]))->Team != ALLIANCE) { @@ -1009,7 +1009,7 @@ void BattlegroundQueue::Update(BattlegroundTypeId bgTypeId, BattlegroundBracketI InviteGroupToBG(*(itr_team[BG_TEAM_ALLIANCE]), arena, ALLIANCE); InviteGroupToBG(*(itr_team[BG_TEAM_HORDE]), arena, HORDE); - sLog->outDebug("Starting rated arena match!"); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Starting rated arena match!"); arena->StartBattleground(); } @@ -1081,7 +1081,7 @@ bool BGQueueRemoveEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/) BattlegroundQueue &bgQueue = sBattlegroundMgr->m_BattlegroundQueues[m_BgQueueTypeId]; if (bgQueue.IsPlayerInvited(m_PlayerGuid, m_BgInstanceGUID, m_RemoveTime)) { - sLog->outDebug("Battleground: removing player %u from bg queue for instance %u because of not pressing enter battle in time.",plr->GetGUIDLow(),m_BgInstanceGUID); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Battleground: removing player %u from bg queue for instance %u because of not pressing enter battle in time.",plr->GetGUIDLow(),m_BgInstanceGUID); plr->RemoveBattlegroundQueueId(m_BgQueueTypeId); bgQueue.RemovePlayer(m_PlayerGuid, true); diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp index 55be844164375..f15a58f74d53a 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp @@ -58,7 +58,7 @@ void BattlegroundAV::HandleKillPlayer(Player *player, Player *killer) void BattlegroundAV::HandleKillUnit(Creature *unit, Player *killer) { - sLog->outDebug("bg_av HandleKillUnit %i",unit->GetEntry()); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_av HandleKillUnit %i",unit->GetEntry()); if (GetStatus() != STATUS_IN_PROGRESS) return; uint32 entry = unit->GetEntry(); @@ -139,7 +139,7 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player *player) return;//maybe we should log this, cause this must be a cheater or a big bug uint8 team = GetTeamIndexByTeamId(player->GetTeam()); //TODO add reputation, events (including quest not available anymore, next quest availabe, go/npc de/spawning)and maybe honor - sLog->outDebug("BG_AV Quest %i completed",questid); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed",questid); switch(questid) { case AV_QUEST_A_SCRAPS1: @@ -149,7 +149,7 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player *player) m_Team_QuestStatus[team][0]+=20; if (m_Team_QuestStatus[team][0] == 500 || m_Team_QuestStatus[team][0] == 1000 || m_Team_QuestStatus[team][0] == 1500) //25,50,75 turn ins { - sLog->outDebug("BG_AV Quest %i completed starting with unit upgrading..",questid); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed starting with unit upgrading..",questid); for (BG_AV_Nodes i = BG_AV_NODES_FIRSTAID_STATION; i <= BG_AV_NODES_FROSTWOLF_HUT; ++i) if (m_Nodes[i].Owner == player->GetTeam() && m_Nodes[i].State == POINT_CONTROLED) { @@ -164,21 +164,21 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player *player) m_Team_QuestStatus[team][1]++; RewardReputationToTeam(team,1,player->GetTeam()); if (m_Team_QuestStatus[team][1] == 30) - sLog->outDebug("BG_AV Quest %i completed (need to implement some events here",questid); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here",questid); break; case AV_QUEST_A_COMMANDER2: case AV_QUEST_H_COMMANDER2: m_Team_QuestStatus[team][2]++; RewardReputationToTeam(team,1,player->GetTeam()); if (m_Team_QuestStatus[team][2] == 60) - sLog->outDebug("BG_AV Quest %i completed (need to implement some events here",questid); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here",questid); break; case AV_QUEST_A_COMMANDER3: case AV_QUEST_H_COMMANDER3: m_Team_QuestStatus[team][3]++; RewardReputationToTeam(team,1,player->GetTeam()); if (m_Team_QuestStatus[team][1] == 120) - sLog->outDebug("BG_AV Quest %i completed (need to implement some events here",questid); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here",questid); break; case AV_QUEST_A_BOSS1: case AV_QUEST_H_BOSS1: @@ -187,16 +187,16 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player *player) case AV_QUEST_H_BOSS2: m_Team_QuestStatus[team][4]++; if (m_Team_QuestStatus[team][4] >= 200) - sLog->outDebug("BG_AV Quest %i completed (need to implement some events here",questid); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here",questid); break; case AV_QUEST_A_NEAR_MINE: case AV_QUEST_H_NEAR_MINE: m_Team_QuestStatus[team][5]++; if (m_Team_QuestStatus[team][5] == 28) { - sLog->outDebug("BG_AV Quest %i completed (need to implement some events here",questid); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here",questid); if (m_Team_QuestStatus[team][6] == 7) - sLog->outDebug("BG_AV Quest %i completed (need to implement some events here - ground assault ready",questid); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here - ground assault ready",questid); } break; case AV_QUEST_A_OTHER_MINE: @@ -204,9 +204,9 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player *player) m_Team_QuestStatus[team][6]++; if (m_Team_QuestStatus[team][6] == 7) { - sLog->outDebug("BG_AV Quest %i completed (need to implement some events here",questid); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here",questid); if (m_Team_QuestStatus[team][5] == 20) - sLog->outDebug("BG_AV Quest %i completed (need to implement some events here - ground assault ready",questid); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here - ground assault ready",questid); } break; case AV_QUEST_A_RIDER_HIDE: @@ -214,9 +214,9 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player *player) m_Team_QuestStatus[team][7]++; if (m_Team_QuestStatus[team][7] == 25) { - sLog->outDebug("BG_AV Quest %i completed (need to implement some events here",questid); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here",questid); if (m_Team_QuestStatus[team][8] == 25) - sLog->outDebug("BG_AV Quest %i completed (need to implement some events here - rider assault ready",questid); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here - rider assault ready",questid); } break; case AV_QUEST_A_RIDER_TAME: @@ -224,13 +224,13 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player *player) m_Team_QuestStatus[team][8]++; if (m_Team_QuestStatus[team][8] == 25) { - sLog->outDebug("BG_AV Quest %i completed (need to implement some events here",questid); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here",questid); if (m_Team_QuestStatus[team][7] == 25) - sLog->outDebug("BG_AV Quest %i completed (need to implement some events here - rider assault ready",questid); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here - rider assault ready",questid); } break; default: - sLog->outDebug("BG_AV Quest %i completed but is not interesting at all",questid); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed but is not interesting at all",questid); return; //was no interesting quest at all break; } @@ -409,7 +409,7 @@ void BattlegroundAV::StartingEventCloseDoors() void BattlegroundAV::StartingEventOpenDoors() { - sLog->outDebug("BG_AV: start spawning mine stuff"); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV: start spawning mine stuff"); for (uint16 i= BG_AV_OBJECT_MINE_SUPPLY_N_MIN; i <= BG_AV_OBJECT_MINE_SUPPLY_N_MAX; i++) SpawnBGObject(i,RESPAWN_IMMEDIATELY); for (uint16 i= BG_AV_OBJECT_MINE_SUPPLY_S_MIN; i <= BG_AV_OBJECT_MINE_SUPPLY_S_MAX; i++) @@ -519,7 +519,7 @@ void BattlegroundAV::HandleAreaTrigger(Player *Source, uint32 Trigger) //Source->Unmount(); break; default: - sLog->outDebug("WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "WARNING: Unhandled AreaTrigger in Battleground: %u", Trigger); // Source->GetSession()->SendAreaTriggerMessage("Warning: Unhandled AreaTrigger in Battleground: %u", Trigger); break; } @@ -572,7 +572,7 @@ void BattlegroundAV::EventPlayerDestroyedPoint(BG_AV_Nodes node) { uint32 object = GetObjectThroughNode(node); - sLog->outDebug("bg_av: player destroyed point node %i object %i",node,object); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_av: player destroyed point node %i object %i",node,object); //despawn banner SpawnBGObject(object, RESPAWN_ONE_DAY); @@ -645,7 +645,7 @@ void BattlegroundAV::ChangeMineOwner(uint8 mine, uint32 team, bool initial) if (!initial) { - sLog->outDebug("bg_av depopulating mine %i (0=north,1=south)",mine); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_av depopulating mine %i (0=north,1=south)",mine); if (mine == AV_SOUTH_MINE) for (uint16 i=AV_CPLACE_MINE_S_S_MIN; i <= AV_CPLACE_MINE_S_S_MAX; i++) if (m_BgCreatures[i]) @@ -656,7 +656,7 @@ void BattlegroundAV::ChangeMineOwner(uint8 mine, uint32 team, bool initial) } SendMineWorldStates(mine); - sLog->outDebug("bg_av populating mine %i (0=north,1=south)",mine); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_av populating mine %i (0=north,1=south)",mine); uint16 miner; //also neutral team exists.. after a big time, the neutral team tries to conquer the mine if (mine == AV_NORTH_MINE) @@ -678,7 +678,7 @@ void BattlegroundAV::ChangeMineOwner(uint8 mine, uint32 team, bool initial) else miner = AV_NPC_S_MINE_N_1; //vermin - sLog->outDebug("spawning vermin"); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "spawning vermin"); if (team == ALLIANCE) cinfo = AV_NPC_S_MINE_A_3; else if (team == HORDE) @@ -795,7 +795,7 @@ void BattlegroundAV::DePopulateNode(BG_AV_Nodes node) BG_AV_Nodes BattlegroundAV::GetNodeThroughObject(uint32 object) { - sLog->outDebug("bg_AV getnodethroughobject %i",object); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_AV getnodethroughobject %i",object); if (object <= BG_AV_OBJECT_FLAG_A_STONEHEART_BUNKER) return BG_AV_Nodes(object); if (object <= BG_AV_OBJECT_FLAG_C_A_FROSTWOLF_HUT) @@ -817,7 +817,7 @@ BG_AV_Nodes BattlegroundAV::GetNodeThroughObject(uint32 object) uint32 BattlegroundAV::GetObjectThroughNode(BG_AV_Nodes node) { //this function is the counterpart to GetNodeThroughObject() - sLog->outDebug("bg_AV GetObjectThroughNode %i",node); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_AV GetObjectThroughNode %i",node); if (m_Nodes[node].Owner == ALLIANCE) { if (m_Nodes[node].State == POINT_ASSAULTED) @@ -860,7 +860,7 @@ void BattlegroundAV::EventPlayerClickedOnFlag(Player *source, GameObject* target if (GetStatus() != STATUS_IN_PROGRESS) return; int32 object = GetObjectType(target_obj->GetGUID()); - sLog->outDebug("BG_AV using gameobject %i with type %i",target_obj->GetEntry(),object); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV using gameobject %i with type %i",target_obj->GetEntry(),object); if (object < 0) return; switch(target_obj->GetEntry()) @@ -899,7 +899,7 @@ void BattlegroundAV::EventPlayerDefendsPoint(Player* player, uint32 object) EventPlayerAssaultsPoint(player,object); return; } - sLog->outDebug("player defends point object: %i node: %i",object,node); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "player defends point object: %i node: %i",object,node); if (m_Nodes[node].PrevOwner != team) { sLog->outError("BG_AV: player defends point which doesn't belong to his team %i",node); @@ -961,7 +961,7 @@ void BattlegroundAV::EventPlayerAssaultsPoint(Player* player, uint32 object) BG_AV_Nodes node = GetNodeThroughObject(object); uint32 owner = m_Nodes[node].Owner; //maybe name it prevowner uint32 team = player->GetTeam(); - sLog->outDebug("bg_av: player assaults point object %i node %i",object,node); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_av: player assaults point object %i node %i",object,node); if (owner == team || team == m_Nodes[node].TotalOwner) return; //surely a gm used this object @@ -1314,7 +1314,7 @@ bool BattlegroundAV::SetupBattleground() } uint16 i; - sLog->outDebug("Alterac Valley: entering state STATUS_WAIT_JOIN ..."); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Alterac Valley: entering state STATUS_WAIT_JOIN ..."); // Initial Nodes for (i = 0; i < BG_AV_OBJECT_MAX; i++) SpawnBGObject(i, RESPAWN_ONE_DAY); @@ -1345,22 +1345,22 @@ bool BattlegroundAV::SetupBattleground() SpawnBGObject(BG_AV_OBJECT_AURA_N_SNOWFALL_GRAVE,RESPAWN_IMMEDIATELY); //creatures - sLog->outDebug("BG_AV start poputlating nodes"); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV start poputlating nodes"); for (BG_AV_Nodes i= BG_AV_NODES_FIRSTAID_STATION; i < BG_AV_NODES_MAX; ++i) { if (m_Nodes[i].Owner) PopulateNode(i); } //all creatures which don't get despawned through the script are static - sLog->outDebug("BG_AV: start spawning static creatures"); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV: start spawning static creatures"); for (i=0; i < AV_STATICCPLACE_MAX; i++) AddAVCreature(0,i+AV_CPLACE_MAX); //mainspiritguides: - sLog->outDebug("BG_AV: start spawning spiritguides creatures"); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV: start spawning spiritguides creatures"); AddSpiritGuide(7, BG_AV_CreaturePos[7][0], BG_AV_CreaturePos[7][1], BG_AV_CreaturePos[7][2], BG_AV_CreaturePos[7][3], ALLIANCE); AddSpiritGuide(8, BG_AV_CreaturePos[8][0], BG_AV_CreaturePos[8][1], BG_AV_CreaturePos[8][2], BG_AV_CreaturePos[8][3], HORDE); //spawn the marshals (those who get deleted, if a tower gets destroyed) - sLog->outDebug("BG_AV: start spawning marshal creatures"); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV: start spawning marshal creatures"); for (i=AV_NPC_A_MARSHAL_SOUTH; i <= AV_NPC_H_MARSHAL_WTOWER; i++) AddAVCreature(i,AV_CPLACE_A_MARSHAL_SOUTH+(i-AV_NPC_A_MARSHAL_SOUTH)); AddAVCreature(AV_NPC_HERALD,AV_CPLACE_HERALD); @@ -1490,4 +1490,3 @@ void BattlegroundAV::ResetBGSubclass() } - diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp index c93d4f1b2e867..3089a23208af7 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp @@ -171,7 +171,6 @@ void BattlegroundDS::Reset() Battleground::Reset(); } - bool BattlegroundDS::SetupBattleground() { // gates diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundIC.h b/src/server/game/Battlegrounds/Zones/BattlegroundIC.h index 577c46acfcdff..df702d317e399 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundIC.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundIC.h @@ -908,7 +908,6 @@ class BattlegroundIC : public Battleground Transport* gunshipAlliance; Transport* gunshipHorde; - uint32 GetNextBanner(ICNodePoint* nodePoint,uint32 team, bool returnDefinitve); uint32 GetGateIDFromEntry(uint32 id) diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundRV.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundRV.cpp index c6ec424172686..0a74cec74a91f 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundRV.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundRV.cpp @@ -167,7 +167,6 @@ bool BattlegroundRV::HandlePlayerUnderMap(Player *player) return true; } - void BattlegroundRV::HandleAreaTrigger(Player *Source, uint32 Trigger) { if (GetStatus() != STATUS_IN_PROGRESS) diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp index 1bd35caf41fd8..07799c43fc764 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp @@ -24,7 +24,6 @@ #include "ObjectMgr.h" #include "WorldPacket.h" - BattlegroundSA::BattlegroundSA() { m_StartMessageIds[BG_STARTING_EVENT_FIRST] = LANG_BG_SA_START_TWO_MINUTES; @@ -70,7 +69,6 @@ bool BattlegroundSA::ResetObjs() uint32 atF = BG_SA_Factions[Attackers]; uint32 defF = BG_SA_Factions[Attackers ? TEAM_ALLIANCE : TEAM_HORDE]; - for (uint8 i = 0; i outDebug("Respawn Alliance flag"); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Respawn Alliance flag"); m_FlagState[BG_TEAM_ALLIANCE] = BG_WS_FLAG_STATE_ON_BASE; } else { - sLog->outDebug("Respawn Horde flag"); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Respawn Horde flag"); m_FlagState[BG_TEAM_HORDE] = BG_WS_FLAG_STATE_ON_BASE; } @@ -699,7 +699,7 @@ bool BattlegroundWS::SetupBattleground() return false; } - sLog->outDebug("BatteGroundWS: BG objects and spirit guides spawned"); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BatteGroundWS: BG objects and spirit guides spawned"); return true; } diff --git a/src/server/game/Chat/Channels/Channel.cpp b/src/server/game/Chat/Channels/Channel.cpp index 4d85e2a6e730f..692067b3dc3e9 100755 --- a/src/server/game/Chat/Channels/Channel.cpp +++ b/src/server/game/Chat/Channels/Channel.cpp @@ -76,7 +76,7 @@ Channel::Channel(const std::string& name, uint32 channel_id, uint32 Team) uint64 banned_guid = atol(*iter); if (banned_guid) { - sLog->outDebug("Channel(%s) loaded banned guid:" UI64FMTD "",name.c_str(), banned_guid); + sLog->outDebug(LOG_FILTER_CHATSYS,"Channel(%s) loaded banned guid:" UI64FMTD "",name.c_str(), banned_guid); banned.insert(banned_guid); } } @@ -88,7 +88,7 @@ Channel::Channel(const std::string& name, uint32 channel_id, uint32 Team) stmt->setString(0, name); stmt->setUInt32(1, m_Team); CharacterDatabase.Execute(stmt); - sLog->outDebug("Channel(%s) saved in database", name.c_str()); + sLog->outDebug(LOG_FILTER_CHATSYS,"Channel(%s) saved in database", name.c_str()); } m_IsSaved = true; @@ -116,7 +116,7 @@ void Channel::UpdateChannelInDB() const stmt->setUInt32(5, m_Team); CharacterDatabase.Execute(stmt); - sLog->outDebug("Channel(%s) updated in database", m_name.c_str()); + sLog->outDebug(LOG_FILTER_CHATSYS,"Channel(%s) updated in database", m_name.c_str()); } } @@ -133,15 +133,14 @@ void Channel::CleanOldChannelsInDB() { if (sWorld->getIntConfig(CONFIG_PRESERVE_CUSTOM_CHANNEL_DURATION) > 0) { - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_CLEAN_CHANNEL); - stmt->setUInt32(0, sWorld->getIntConfig(CONFIG_PRESERVE_CUSTOM_CHANNEL_DURATION)*DAY); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_OLD_CHANNELS); + stmt->setUInt32(0, sWorld->getIntConfig(CONFIG_PRESERVE_CUSTOM_CHANNEL_DURATION) * DAY); CharacterDatabase.Execute(stmt); - sLog->outDebug("Cleaned out unused custom chat channels."); + sLog->outDebug(LOG_FILTER_CHATSYS,"Cleaned out unused custom chat channels."); } } - void Channel::Join(uint64 p, const char *pass) { WorldPacket data; diff --git a/src/server/game/Chat/Commands/Level1.cpp b/src/server/game/Chat/Commands/Level1.cpp index d5acf4bd8500a..1fa6ba0e0eba2 100755 --- a/src/server/game/Chat/Commands/Level1.cpp +++ b/src/server/game/Chat/Commands/Level1.cpp @@ -187,19 +187,6 @@ bool ChatHandler::HandleGPSCommand(const char* args) cell.GridX(), cell.GridY(), cell.CellX(), cell.CellY(), obj->GetInstanceId(), zone_x, zone_y, ground_z, floor_z, have_map, have_vmap); - sLog->outDebug("Player %s GPS call for %s '%s' (%s: %u):", - m_session ? GetNameLink().c_str() : GetTrinityString(LANG_CONSOLE_COMMAND), - (obj->GetTypeId() == TYPEID_PLAYER ? "player" : "creature"), obj->GetName(), - (obj->GetTypeId() == TYPEID_PLAYER ? "GUID" : "Entry"), (obj->GetTypeId() == TYPEID_PLAYER ? obj->GetGUIDLow(): obj->GetEntry())); - sLog->outDebug(GetTrinityString(LANG_MAP_POSITION), - obj->GetMapId(), (mapEntry ? mapEntry->name[sWorld->GetDefaultDbcLocale()] : ""), - zone_id, (zoneEntry ? zoneEntry->area_name[sWorld->GetDefaultDbcLocale()] : ""), - area_id, (areaEntry ? areaEntry->area_name[sWorld->GetDefaultDbcLocale()] : ""), - obj->GetPhaseMask(), - obj->GetPositionX(), obj->GetPositionY(), obj->GetPositionZ(), obj->GetOrientation(), - cell.GridX(), cell.GridY(), cell.CellX(), cell.CellY(), obj->GetInstanceId(), - zone_x, zone_y, ground_z, floor_z, have_map, have_vmap); - LiquidData liquid_status; ZLiquidStatus res = map->getLiquidStatus(obj->GetPositionX(), obj->GetPositionY(), obj->GetPositionZ(), MAP_ALL_LIQUIDS, &liquid_status); if (res) diff --git a/src/server/game/Chat/Commands/Level3.cpp b/src/server/game/Chat/Commands/Level3.cpp index 649e1ce199fe9..d657781499fcb 100755 --- a/src/server/game/Chat/Commands/Level3.cpp +++ b/src/server/game/Chat/Commands/Level3.cpp @@ -2490,9 +2490,9 @@ bool ChatHandler::HandleResetHonorCommand (const char * args) if (!extractPlayerTarget((char*)args,&target)) return false; + target->SetHonorPoints(0); target->SetUInt32Value(PLAYER_FIELD_KILLS, 0); target->SetUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS, 0); - target->SetHonorPoints(0); target->SetUInt32Value(PLAYER_FIELD_TODAY_CONTRIBUTION, 0); target->SetUInt32Value(PLAYER_FIELD_YESTERDAY_CONTRIBUTION, 0); target->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EARN_HONORABLE_KILL); @@ -4122,8 +4122,11 @@ bool ChatHandler::HandleInstanceUnbindCommand(const char *args) uint16 MapId = 0; if (strcmp(pMap, "all")) - if (!(MapId = uint16(atoi(pMap)))) + { + MapId = uint16(atoi(pMap)); + if (!MapId) return false; + } for(uint8 i = 0; i < MAX_DIFFICULTY; ++i) { @@ -4428,14 +4431,20 @@ bool ChatHandler::HandleChannelSetOwnership(const char *args) { if(chn) chn->SetOwnership(true); - CharacterDatabase.PExecute("UPDATE channels SET m_ownership = 1 WHERE m_name LIKE '%s'", channel); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SET_CHANNEL_OWNERSHIP); + stmt->setUInt8 (0, 1); + stmt->setString(1, channel); + CharacterDatabase.Execute(stmt); PSendSysMessage(LANG_CHANNEL_ENABLE_OWNERSHIP, channel); } else if (strcmp(argstr, "off") == 0) { if(chn) chn->SetOwnership(false); - CharacterDatabase.PExecute("UPDATE channels SET m_ownership = 0 WHERE m_name LIKE '%s'", channel); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SET_CHANNEL_OWNERSHIP); + stmt->setUInt8 (0, 0); + stmt->setString(1, channel); + CharacterDatabase.Execute(stmt); PSendSysMessage(LANG_CHANNEL_DISABLE_OWNERSHIP, channel); } else @@ -4444,7 +4453,6 @@ bool ChatHandler::HandleChannelSetOwnership(const char *args) return true; } - /*------------------------------------------ *-------------TRINITY---------------------- *-------------------------------------*/ @@ -4634,7 +4642,10 @@ bool ChatHandler::HandleGroupLeaderCommand(const char *args) if (GetPlayerGroupAndGUIDByName(cname, plr, group, guid)) if (group && group->GetLeaderGUID() != guid) + { group->ChangeLeader(guid); + group->SendUpdate(); + } return true; } diff --git a/src/server/game/Combat/HostileRefManager.cpp b/src/server/game/Combat/HostileRefManager.cpp index c7b40a9119d8b..91ba2d6903795 100755 --- a/src/server/game/Combat/HostileRefManager.cpp +++ b/src/server/game/Combat/HostileRefManager.cpp @@ -69,7 +69,6 @@ void HostileRefManager::addTempThreat(float fThreat, bool apply) } } - //================================================= void HostileRefManager::addThreatPercent(int32 iPercent) diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index 6e65590581f7a..ca93b89ca88e6 100755 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -17,7 +17,6 @@ */ - #include "Player.h" #include "SpellAuras.h" #include "SpellMgr.h" @@ -34,7 +33,7 @@ bool Condition::Meets(Player * player, Unit* invoker) { if (!player) { - sLog->outDebug("Condition player not found"); + sLog->outDebug(LOG_FILTER_CONDITIONSYS, "Condition player not found"); return false; // player not present, return false } uint32 refId = mConditionValue3;//value 3 can be a 'quick' reference @@ -255,7 +254,7 @@ bool ConditionMgr::IsPlayerMeetToConditionList(Player* player,const ConditionLis std::mapElseGroupMap; for (ConditionList::const_iterator i = conditions.begin(); i != conditions.end(); ++i) { - sLog->outDebug("ConditionMgr::IsPlayerMeetToConditionList condType: %u val1: %u",(*i)->mConditionType,(*i)->mConditionValue1); + sLog->outDebug(LOG_FILTER_CONDITIONSYS, "ConditionMgr::IsPlayerMeetToConditionList condType: %u val1: %u",(*i)->mConditionType,(*i)->mConditionValue1); if ((*i)->isLoaded()) { std::map::const_iterator itr = ElseGroupMap.find((*i)->mElseGroup); @@ -274,7 +273,7 @@ bool ConditionMgr::IsPlayerMeetToConditionList(Player* player,const ConditionLis } else { - sLog->outDebug("IsPlayerMeetToConditionList: Reference template -%u not found", + sLog->outDebug(LOG_FILTER_CONDITIONSYS, "IsPlayerMeetToConditionList: Reference template -%u not found", (*i)->mReferenceId);//checked at loading, should never happen } @@ -301,7 +300,7 @@ bool ConditionMgr::IsPlayerMeetToConditions(Player* player, ConditionList condit if(player) player->m_ConditionErrorMsgId = 0; - sLog->outDebug("ConditionMgr::IsPlayerMeetToConditions"); + sLog->outDebug(LOG_FILTER_CONDITIONSYS, "ConditionMgr::IsPlayerMeetToConditions"); bool result = IsPlayerMeetToConditionList(player, conditions, invoker); if (player && player->m_ConditionErrorMsgId && player->GetSession() && !result) @@ -322,7 +321,7 @@ ConditionList ConditionMgr::GetConditionsForNotGroupedEntry(ConditionSourceType if (i != (*itr).second.end()) { spellCond = (*i).second; - sLog->outDebug("GetConditionsForNotGroupedEntry: found conditions for type %u and entry %u", uint32(sType), uEntry); + sLog->outDebug(LOG_FILTER_CONDITIONSYS, "GetConditionsForNotGroupedEntry: found conditions for type %u and entry %u", uint32(sType), uEntry); } } } @@ -339,7 +338,7 @@ ConditionList ConditionMgr::GetConditionsForVehicleSpell(uint32 creatureID, uint if (i != (*itr).second.end()) { cond = (*i).second; - sLog->outDebug("GetConditionsForVehicleSpell: found conditions for Vehicle entry %u spell %u", creatureID, spellID); + sLog->outDebug(LOG_FILTER_CONDITIONSYS, "GetConditionsForVehicleSpell: found conditions for Vehicle entry %u spell %u", creatureID, spellID); } } return cond; @@ -375,7 +374,6 @@ void ConditionMgr::LoadConditions(bool isReload) sObjectMgr->LoadGossipMenuItems(); } - QueryResult result = WorldDatabase.Query("SELECT SourceTypeOrReferenceId, SourceGroup, SourceEntry, ElseGroup, ConditionTypeOrReference," " ConditionValue1, ConditionValue2, ConditionValue3, ErrorTextId, ScriptName FROM conditions"); @@ -1408,7 +1406,6 @@ void ConditionMgr::Clean() m_ConditionMap.clear(); - for (VehicleSpellConditionMap::iterator itr = m_VehicleSpellConditions.begin(); itr != m_VehicleSpellConditions.end(); ++itr) { for (ConditionTypeMap::iterator it = itr->second.begin(); it != itr->second.end(); ++it) diff --git a/src/server/game/Conditions/DisableMgr.cpp b/src/server/game/Conditions/DisableMgr.cpp index 04d8f9be70519..ac5c43dcefa16 100755 --- a/src/server/game/Conditions/DisableMgr.cpp +++ b/src/server/game/Conditions/DisableMgr.cpp @@ -54,7 +54,6 @@ void DisableMgr::LoadDisables() return; } - Field* fields; do { diff --git a/src/server/game/DataStores/DBCEnums.h b/src/server/game/DataStores/DBCEnums.h index ebda6440e0774..9bc94ae15b4eb 100755 --- a/src/server/game/DataStores/DBCEnums.h +++ b/src/server/game/DataStores/DBCEnums.h @@ -58,7 +58,7 @@ enum AchievementFaction enum AchievementFlags { ACHIEVEMENT_FLAG_COUNTER = 0x00000001, // Just count statistic (never stop and complete) - ACHIEVEMENT_FLAG_TRACKING = 0x00000002, // Not sent to client - internal use only + ACHIEVEMENT_FLAG_HIDDEN = 0x00000002, // Not sent to client - internal use only ACHIEVEMENT_FLAG_STORE_MAX_VALUE = 0x00000004, // Store only max value? used only in "Reach level xx" ACHIEVEMENT_FLAG_SUMM = 0x00000008, // Use summ criteria value from all reqirements (and calculate max value) ACHIEVEMENT_FLAG_MAX_USED = 0x00000010, // Show max criteria (and calculate max value ??) @@ -73,19 +73,20 @@ enum AchievementFlags enum AchievementCriteriaCondition { - ACHIEVEMENT_CRITERIA_CONDITION_NONE = 0, - ACHIEVEMENT_CRITERIA_CONDITION_NO_DEATH = 1, // reset progress on death - ACHIEVEMENT_CRITERIA_CONDITION_UNK1 = 2, // only used in "Complete a daily quest every day for five consecutive days" - ACHIEVEMENT_CRITERIA_CONDITION_MAP = 3, // requires you to be on specific map, reset at change - ACHIEVEMENT_CRITERIA_CONDITION_NO_LOSE = 4, // only used in "Win 10 arenas without losing" - ACHIEVEMENT_CRITERIA_CONDITION_UNK2 = 9, // unk - ACHIEVEMENT_CRITERIA_CONDITION_UNK3 = 13, // unk + ACHIEVEMENT_CRITERIA_CONDITION_NONE = 0, + ACHIEVEMENT_CRITERIA_CONDITION_NO_DEATH = 1, // reset progress on death + ACHIEVEMENT_CRITERIA_CONDITION_UNK1 = 2, // only used in "Complete a daily quest every day for five consecutive days" + ACHIEVEMENT_CRITERIA_CONDITION_MAP = 3, // requires you to be on specific map, reset at change + ACHIEVEMENT_CRITERIA_CONDITION_NO_LOSE = 4, // only used in "Win 10 arenas without losing" + ACHIEVEMENT_CRITERIA_CONDITION_UNK2 = 9, // unk + ACHIEVEMENT_CRITERIA_CONDITION_NOT_IN_GROUP = 10, // requires the player not to be in group + ACHIEVEMENT_CRITERIA_CONDITION_UNK3 = 13, // unk }; -enum AchievementCriteriaCompletionFlags +enum AchievementCriteriaFlags { ACHIEVEMENT_CRITERIA_FLAG_SHOW_PROGRESS_BAR = 0x00000001, // Show progress as bar - ACHIEVEMENT_CRITERIA_FLAG_HIDE_CRITERIA = 0x00000002, // Not show criteria in client + ACHIEVEMENT_CRITERIA_FLAG_HIDDEN = 0x00000002, // Not show criteria in client ACHIEVEMENT_CRITERIA_FLAG_UNK3 = 0x00000004, // BG related?? ACHIEVEMENT_CRITERIA_FLAG_UNK4 = 0x00000008, // ACHIEVEMENT_CRITERIA_FLAG_UNK5 = 0x00000010, // not used diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index 3ece8f93e3902..949baa197fdbc 100755 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -42,7 +42,7 @@ struct AchievementEntry { uint32 ID; // 0 - int32 factionFlag; // 1 -1=all, 0=horde, 1=alliance + int32 requiredFaction; // 1 -1=all, 0=horde, 1=alliance int32 mapID; // 2 -1=none //uint32 parentAchievement; // 3 its Achievement parent (can`t start while parent uncomplete, use its Criteria if don`t have own, use its progress on begin) char *name[16]; // 4-19 @@ -497,11 +497,11 @@ struct AchievementCriteriaEntry { uint32 additionalRequirement_type; uint32 additionalRequirement_value; - } additionalRequrements[MAX_CRITERIA_REQUIREMENTS]; + } additionalRequirements[MAX_CRITERIA_REQUIREMENTS]; //char* name[16]; // 9-24 //uint32 name_flags; // 25 - uint32 completionFlag; // 26 + uint32 flags; // 26 uint32 timedType; // 27 uint32 timerStartEvent; // 28 Alway appears with timed events // for timed spells it is spell id for @@ -1234,7 +1234,6 @@ struct MapDifficultyEntry //char* difficultyString; // 22 }; - struct MovieEntry { uint32 Id; // 0 index @@ -1680,7 +1679,6 @@ struct StableSlotPricesEntry uint32 Price; }; - struct SummonPropertiesEntry { uint32 Id; // 0 @@ -1691,7 +1689,6 @@ struct SummonPropertiesEntry uint32 Flags; // 5 }; - #define MAX_TALENT_RANK 5 #define MAX_PET_TALENT_RANK 3 // use in calculations, expected <= MAX_TALENT_RANK #define MAX_TALENT_TABS 3 @@ -1867,7 +1864,8 @@ struct VehicleSeatEntry bool CanEnterOrExit() const { return m_flags & VEHICLE_SEAT_FLAG_CAN_ENTER_OR_EXIT; } bool CanSwitchFromSeat() const { return m_flags & VEHICLE_SEAT_FLAG_B_CANSWITCH; } - bool IsUsableByAura() const { return m_flagsB & (VEHICLE_SEAT_FLAG_B_USABLE_FORCED | VEHICLE_SEAT_FLAG_B_USABLE_FORCED_2 | VEHICLE_SEAT_FLAG_B_USABLE_FORCED_3); } + bool IsUsableByOverride() const { return (m_flags & VEHICLE_SEAT_FLAG_UNCONTROLLED) + || (m_flagsB & VEHICLE_SEAT_FLAG_B_USABLE_FORCED | VEHICLE_SEAT_FLAG_B_USABLE_FORCED_2 | VEHICLE_SEAT_FLAG_B_USABLE_FORCED_3); } bool IsEjectable() const { return m_flagsB & VEHICLE_SEAT_FLAG_B_EJECTABLE; } }; diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index 7ba7c0838944b..b477a09a5cff2 100755 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -205,7 +205,7 @@ void LFGMgr::Update(uint32 diff) while (!newToQueue.empty()) { uint64 frontguid = newToQueue.front(); - sLog->outDebug("LFGMgr::Update: QueueId %u: checking [" UI64FMTD "] newToQueue(%u), currentQueue(%u)", queueId, frontguid, uint32(newToQueue.size()), uint32(currentQueue.size())); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::Update: QueueId %u: checking [" UI64FMTD "] newToQueue(%u), currentQueue(%u)", queueId, frontguid, uint32(newToQueue.size()), uint32(currentQueue.size())); firstNew.push_back(frontguid); newToQueue.pop_front(); @@ -314,11 +314,11 @@ void LFGMgr::AddToQueue(const uint64& guid, uint8 queueId) LfgGuidList& list = m_newToQueue[queueId]; if (std::find(list.begin(), list.end(), guid) != list.end()) - sLog->outDebug("LFGMgr::AddToQueue: [" UI64FMTD "] already in new queue. ignoring", guid); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::AddToQueue: [" UI64FMTD "] already in new queue. ignoring", guid); else { list.push_back(guid); - sLog->outDebug("LFGMgr::AddToQueue: [" UI64FMTD "] added to m_newToQueue (size: %u)", guid, uint32(list.size())); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::AddToQueue: [" UI64FMTD "] added to m_newToQueue (size: %u)", guid, uint32(list.size())); } } @@ -343,12 +343,12 @@ bool LFGMgr::RemoveFromQueue(const uint64& guid) { delete it->second; m_QueueInfoMap.erase(it); - sLog->outDebug("LFGMgr::RemoveFromQueue: [" UI64FMTD "] removed", guid); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::RemoveFromQueue: [" UI64FMTD "] removed", guid); return true; } else { - sLog->outDebug("LFGMgr::RemoveFromQueue: [" UI64FMTD "] not in queue", guid); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::RemoveFromQueue: [" UI64FMTD "] not in queue", guid); return false; } @@ -551,7 +551,7 @@ void LFGMgr::Join(Player* plr, uint8 roles, const LfgDungeonSet& selectedDungeon // Can't join. Send result if (joinData.result != LFG_JOIN_OK) { - sLog->outDebug("LFGMgr::Join: [" UI64FMTD "] joining with %u members. result: %u", guid, grp ? grp->GetMembersCount() : 1, joinData.result); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::Join: [" UI64FMTD "] joining with %u members. result: %u", guid, grp ? grp->GetMembersCount() : 1, joinData.result); if (!dungeons.empty()) // Only should show lockmap when have no dungeons available joinData.lockmap.clear(); plr->GetSession()->SendLfgJoinResult(joinData); @@ -561,7 +561,7 @@ void LFGMgr::Join(Player* plr, uint8 roles, const LfgDungeonSet& selectedDungeon // FIXME - Raid browser not supported yet if (isRaid) { - sLog->outDebug("LFGMgr::Join: [" UI64FMTD "] trying to join raid browser and it's disabled.", guid); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::Join: [" UI64FMTD "] trying to join raid browser and it's disabled.", guid); return; } @@ -633,7 +633,7 @@ void LFGMgr::Join(Player* plr, uint8 roles, const LfgDungeonSet& selectedDungeon } AddToQueue(guid, uint8(plr->GetTeam())); } - sLog->outDebug("LFGMgr::Join: [" UI64FMTD "] joined with %u members. dungeons: %u", guid, grp ? grp->GetMembersCount() : 1, uint8(dungeons.size())); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::Join: [" UI64FMTD "] joined with %u members. dungeons: %u", guid, grp ? grp->GetMembersCount() : 1, uint8(dungeons.size())); } /** @@ -651,7 +651,7 @@ void LFGMgr::Leave(Player* plr, Group* grp /* = NULL*/) uint64 guid = grp ? grp->GetGUID() : plr->GetGUID(); LfgState state = GetState(guid); - sLog->outDebug("LFGMgr::Leave: [" UI64FMTD "]", guid); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::Leave: [" UI64FMTD "]", guid); switch(state) { case LFG_STATE_QUEUED: @@ -731,7 +731,7 @@ void LFGMgr::OfferContinue(Group* grp) */ LfgProposal* LFGMgr::FindNewGroups(LfgGuidList& check, LfgGuidList& all) { - sLog->outDebug("LFGMgr::FindNewGroup: (%s) - all(%s)", ConcatenateGuids(check).c_str(), ConcatenateGuids(all).c_str()); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::FindNewGroup: (%s) - all(%s)", ConcatenateGuids(check).c_str(), ConcatenateGuids(all).c_str()); LfgProposal* pProposal = NULL; if (!check.size() || check.size() > MAXGROUPSIZE || !CheckCompatibility(check, pProposal)) @@ -764,7 +764,7 @@ bool LFGMgr::CheckCompatibility(LfgGuidList check, LfgProposal*& pProposal) if (check.size() > MAXGROUPSIZE || !check.size()) { - sLog->outDebug("LFGMgr::CheckCompatibility: (%s): Size wrong - Not compatibles", strGuids.c_str()); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::CheckCompatibility: (%s): Size wrong - Not compatibles", strGuids.c_str()); return false; } @@ -775,7 +775,7 @@ bool LFGMgr::CheckCompatibility(LfgGuidList check, LfgProposal*& pProposal) LfgAnswer answer = GetCompatibles(strGuids); if (answer != LFG_ANSWER_PENDING) { - sLog->outDebug("LFGMgr::CheckCompatibility: (%s) compatibles (cached): %d", strGuids.c_str(), answer); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::CheckCompatibility: (%s) compatibles (cached): %d", strGuids.c_str(), answer); return bool(answer); } @@ -788,7 +788,7 @@ bool LFGMgr::CheckCompatibility(LfgGuidList check, LfgProposal*& pProposal) // Check all-but-new compatibilities (New,A,B,C,D) --> check(A,B,C,D) if (!CheckCompatibility(check, pProposal)) // Group not compatible { - sLog->outDebug("LFGMgr::CheckCompatibility: (%s) not compatibles (%s not compatibles)", strGuids.c_str(), ConcatenateGuids(check).c_str()); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::CheckCompatibility: (%s) not compatibles (%s not compatibles)", strGuids.c_str(), ConcatenateGuids(check).c_str()); SetCompatibles(strGuids, false); return false; } @@ -834,9 +834,9 @@ bool LFGMgr::CheckCompatibility(LfgGuidList check, LfgProposal*& pProposal) { SetCompatibles(strGuids, false); if (numLfgGroups > 1) - sLog->outDebug("LFGMgr::CheckCompatibility: (%s) More than one Lfggroup (%u)", strGuids.c_str(), numLfgGroups); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::CheckCompatibility: (%s) More than one Lfggroup (%u)", strGuids.c_str(), numLfgGroups); else - sLog->outDebug("LFGMgr::CheckCompatibility: (%s) Too much players (%u)", strGuids.c_str(), numPlayers); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::CheckCompatibility: (%s) Too much players (%u)", strGuids.c_str(), numPlayers); return false; } @@ -863,7 +863,7 @@ bool LFGMgr::CheckCompatibility(LfgGuidList check, LfgProposal*& pProposal) { Player* plr = sObjectMgr->GetPlayer(it->first); if (!plr) - sLog->outDebug("LFGMgr::CheckCompatibility: (%s) Warning! [" UI64FMTD "] offline! Marking as not compatibles!", strGuids.c_str(), it->first); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::CheckCompatibility: (%s) Warning! [" UI64FMTD "] offline! Marking as not compatibles!", strGuids.c_str(), it->first); else { for (PlayerSet::const_iterator itPlayer = players.begin(); itPlayer != players.end() && plr; ++itPlayer) @@ -871,7 +871,7 @@ bool LFGMgr::CheckCompatibility(LfgGuidList check, LfgProposal*& pProposal) // Do not form a group with ignoring candidates if (plr->GetSocial()->HasIgnore((*itPlayer)->GetGUIDLow()) || (*itPlayer)->GetSocial()->HasIgnore(plr->GetGUIDLow())) { - sLog->outDebug("LFGMgr::CheckCompatibility: (%s) Players [" UI64FMTD "] and [" UI64FMTD "] ignoring", strGuids.c_str(), (*itPlayer)->GetGUID(), plr->GetGUID()); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::CheckCompatibility: (%s) Players [" UI64FMTD "] and [" UI64FMTD "] ignoring", strGuids.c_str(), (*itPlayer)->GetGUID(), plr->GetGUID()); plr = NULL; } } @@ -885,7 +885,7 @@ bool LFGMgr::CheckCompatibility(LfgGuidList check, LfgProposal*& pProposal) if (players.size() != numPlayers || !CheckGroupRoles(rolesMap)) { if (players.size() == numPlayers) - sLog->outDebug("LFGMgr::CheckCompatibility: (%s) Roles not compatible", strGuids.c_str()); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::CheckCompatibility: (%s) Roles not compatible", strGuids.c_str()); SetCompatibles(strGuids, false); return false; } @@ -918,10 +918,10 @@ bool LFGMgr::CheckCompatibility(LfgGuidList check, LfgProposal*& pProposal) // ----- Group is compatible, if we have MAXGROUPSIZE members then match is found if (numPlayers != MAXGROUPSIZE) { - sLog->outDebug("LFGMgr::CheckCompatibility: (%s) Compatibles but not match. Players(%u)", strGuids.c_str(), numPlayers); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::CheckCompatibility: (%s) Compatibles but not match. Players(%u)", strGuids.c_str(), numPlayers); return true; } - sLog->outDebug("LFGMgr::CheckCompatibility: (%s) MATCH! Group formed", strGuids.c_str()); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::CheckCompatibility: (%s) MATCH! Group formed", strGuids.c_str()); // GROUP FORMED! // TODO - Improve algorithm to select proper group based on Item Level @@ -1101,7 +1101,7 @@ void LFGMgr::RemoveFromCompatibles(uint64 guid) out << guid; std::string strGuid = out.str(); - sLog->outDebug("LFGMgr::RemoveFromCompatibles: Removing [" UI64FMTD "]", guid); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::RemoveFromCompatibles: Removing [" UI64FMTD "]", guid); for (LfgCompatibleMap::iterator itNext = m_CompatibleMap.begin(); itNext != m_CompatibleMap.end();) { LfgCompatibleMap::iterator it = itNext++; @@ -1261,7 +1261,7 @@ void LFGMgr::UpdateProposal(uint32 proposalId, const uint64& guid, bool accept) LfgProposalPlayer* ppPlayer = itProposalPlayer->second; ppPlayer->accept = LfgAnswer(accept); - sLog->outDebug("LFGMgr::UpdateProposal: Player [" UI64FMTD "] of proposal %u selected: %u", guid, proposalId, accept); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::UpdateProposal: Player [" UI64FMTD "] of proposal %u selected: %u", guid, proposalId, accept); if (!accept) { RemoveProposal(itProposal, LFG_UPDATETYPE_PROPOSAL_DECLINED); @@ -1345,14 +1345,14 @@ void LFGMgr::UpdateProposal(uint32 proposalId, const uint64& guid, bool accept) if (!grp) { grp = new Group(); - grp->Create(pguid, plr->GetName()); + grp->Create(plr); grp->ConvertToLFG(); uint64 gguid = grp->GetGUID(); SetState(gguid, LFG_STATE_PROPOSAL); sObjectMgr->AddGroup(grp); } else if (group != grp) - grp->AddMember(pguid, plr->GetName()); + grp->AddMember(plr); // Update timers uint8 role = GetRoles(pguid); @@ -1414,7 +1414,7 @@ void LFGMgr::RemoveProposal(LfgProposalMap::iterator itProposal, LfgUpdateType t LfgProposal* pProposal = itProposal->second; pProposal->state = LFG_PROPOSAL_FAILED; - sLog->outDebug("LFGMgr::RemoveProposal: Proposal %u, state FAILED, UpdateType %u", itProposal->first, type); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::RemoveProposal: Proposal %u, state FAILED, UpdateType %u", itProposal->first, type); // Mark all people that didn't answered as no accept if (type == LFG_UPDATETYPE_PROPOSAL_FAILED) for (LfgProposalPlayerMap::const_iterator it = pProposal->players.begin(); it != pProposal->players.end(); ++it) @@ -1458,12 +1458,12 @@ void LFGMgr::RemoveProposal(LfgProposalMap::iterator itProposal, LfgUpdateType t if (it->second->accept == LFG_ANSWER_DENY) { updateData.updateType = type; - sLog->outDebug("LFGMgr::RemoveProposal: [" UI64FMTD "] didn't accept. Removing from queue and compatible cache", guid); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::RemoveProposal: [" UI64FMTD "] didn't accept. Removing from queue and compatible cache", guid); } else { updateData.updateType = LFG_UPDATETYPE_REMOVED_FROM_QUEUE; - sLog->outDebug("LFGMgr::RemoveProposal: [" UI64FMTD "] in same group that someone that didn't accept. Removing from queue and compatible cache", guid); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::RemoveProposal: [" UI64FMTD "] in same group that someone that didn't accept. Removing from queue and compatible cache", guid); } ClearState(guid); if (grp) @@ -1476,7 +1476,7 @@ void LFGMgr::RemoveProposal(LfgProposalMap::iterator itProposal, LfgUpdateType t } else { - sLog->outDebug("LFGMgr::RemoveProposal: Readding [" UI64FMTD "] to queue.", guid); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::RemoveProposal: Readding [" UI64FMTD "] to queue.", guid); SetState(guid, LFG_STATE_QUEUED); if (grp) { @@ -1640,7 +1640,7 @@ void LFGMgr::UpdateBoot(Player* plr, bool accept) */ void LFGMgr::TeleportPlayer(Player* plr, bool out, bool fromOpcode /*= false*/) { - sLog->outDebug("LFGMgr::TeleportPlayer: [" UI64FMTD "] is being teleported %s", plr->GetGUID(), out ? "out" : "in"); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::TeleportPlayer: [" UI64FMTD "] is being teleported %s", plr->GetGUID(), out ? "out" : "in"); if (out) { plr->RemoveAurasDueToSpell(LFG_SPELL_LUCK_OF_THE_DRAW); @@ -1746,7 +1746,7 @@ void LFGMgr::RewardDungeonDoneFor(const uint32 dungeonId, Player* player) Group* group = player->GetGroup(); if (!group || !group->isLFGGroup()) { - sLog->outDebug("LFGMgr::RewardDungeonDoneFor: [" UI64FMTD "] is not in a group or not a LFGGroup. Ignoring", player->GetGUID()); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::RewardDungeonDoneFor: [" UI64FMTD "] is not in a group or not a LFGGroup. Ignoring", player->GetGUID()); return; } @@ -1755,13 +1755,13 @@ void LFGMgr::RewardDungeonDoneFor(const uint32 dungeonId, Player* player) uint32 gDungeonId = GetDungeon(gguid); if (gDungeonId != dungeonId) { - sLog->outDebug("LFGMgr::RewardDungeonDoneFor: [" UI64FMTD "] Finished dungeon %u but group queued for %u. Ignoring", guid, dungeonId, gDungeonId); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::RewardDungeonDoneFor: [" UI64FMTD "] Finished dungeon %u but group queued for %u. Ignoring", guid, dungeonId, gDungeonId); return; } if (GetState(guid) == LFG_STATE_FINISHED_DUNGEON) { - sLog->outDebug("LFGMgr::RewardDungeonDoneFor: [" UI64FMTD "] Already rewarded player. Ignoring", guid); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::RewardDungeonDoneFor: [" UI64FMTD "] Already rewarded player. Ignoring", guid); return; } @@ -1777,7 +1777,7 @@ void LFGMgr::RewardDungeonDoneFor(const uint32 dungeonId, Player* player) LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(rDungeonId); if (!dungeon || dungeon->type != LFG_TYPE_RANDOM) { - sLog->outDebug("LFGMgr::RewardDungeonDoneFor: [" UI64FMTD "] dungeon %u is not random", guid, rDungeonId); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::RewardDungeonDoneFor: [" UI64FMTD "] dungeon %u is not random", guid, rDungeonId); return; } @@ -1808,7 +1808,7 @@ void LFGMgr::RewardDungeonDoneFor(const uint32 dungeonId, Player* player) } // Give rewards - sLog->outDebug("LFGMgr::RewardDungeonDoneFor: [" UI64FMTD "] done dungeon %u,%s previously done.", player->GetGUID(), GetDungeon(gguid), index > 0 ? " " : " not"); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::RewardDungeonDoneFor: [" UI64FMTD "] done dungeon %u,%s previously done.", player->GetGUID(), GetDungeon(gguid), index > 0 ? " " : " not"); player->GetSession()->SendLfgPlayerReward(dungeon->Entry(), GetDungeon(gguid, false), index, reward, qReward); } @@ -1885,10 +1885,9 @@ std::string LFGMgr::ConcatenateGuids(LfgGuidList check) return o.str(); } - LfgState LFGMgr::GetState(const uint64& guid) { - sLog->outDebug("LFGMgr::GetState: [" UI64FMTD "]", guid); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::GetState: [" UI64FMTD "]", guid); if (IS_GROUP(guid)) return m_Groups[guid].GetState(); else @@ -1897,61 +1896,61 @@ LfgState LFGMgr::GetState(const uint64& guid) uint32 LFGMgr::GetDungeon(const uint64& guid, bool asId /*= true*/) { - sLog->outDebug("LFGMgr::GetDungeon: [" UI64FMTD "] asId: %u", guid, asId); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::GetDungeon: [" UI64FMTD "] asId: %u", guid, asId); return m_Groups[guid].GetDungeon(asId); } uint8 LFGMgr::GetRoles(const uint64& guid) { - sLog->outDebug("LFGMgr::GetRoles: [" UI64FMTD "]", guid); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::GetRoles: [" UI64FMTD "]", guid); return m_Players[guid].GetRoles(); } const std::string& LFGMgr::GetComment(const uint64& guid) { - sLog->outDebug("LFGMgr::GetComment: [" UI64FMTD "]", guid); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::GetComment: [" UI64FMTD "]", guid); return m_Players[guid].GetComment(); } const LfgDungeonSet& LFGMgr::GetSelectedDungeons(const uint64& guid) { - sLog->outDebug("LFGMgr::GetSelectedDungeons: [" UI64FMTD "]", guid); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::GetSelectedDungeons: [" UI64FMTD "]", guid); return m_Players[guid].GetSelectedDungeons(); } const LfgLockMap& LFGMgr::GetLockedDungeons(const uint64& guid) { - sLog->outDebug("LFGMgr::GetLockedDungeons: [" UI64FMTD "]", guid); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::GetLockedDungeons: [" UI64FMTD "]", guid); return m_Players[guid].GetLockedDungeons(); } uint8 LFGMgr::GetKicksLeft(const uint64& guid) { - sLog->outDebug("LFGMgr::GetKicksLeft: [" UI64FMTD "]", guid); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::GetKicksLeft: [" UI64FMTD "]", guid); return m_Groups[guid].GetKicksLeft(); } uint8 LFGMgr::GetVotesNeeded(const uint64& guid) { - sLog->outDebug("LFGMgr::GetVotesNeeded: [" UI64FMTD "]", guid); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::GetVotesNeeded: [" UI64FMTD "]", guid); return m_Groups[guid].GetVotesNeeded(); } void LFGMgr::RestoreState(const uint64& guid) { - sLog->outDebug("LFGMgr::RestoreState: [" UI64FMTD "]", guid); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::RestoreState: [" UI64FMTD "]", guid); m_Groups[guid].RestoreState(); } void LFGMgr::ClearState(const uint64& guid) { - sLog->outDebug("LFGMgr::ClearState: [" UI64FMTD "]", guid); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::ClearState: [" UI64FMTD "]", guid); m_Players[guid].ClearState(); } void LFGMgr::SetState(const uint64& guid, LfgState state) { - sLog->outDebug("LFGMgr::SetState: [" UI64FMTD "] state %u", guid, state); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::SetState: [" UI64FMTD "] state %u", guid, state); if (IS_GROUP(guid)) m_Groups[guid].SetState(state); else @@ -1960,43 +1959,43 @@ void LFGMgr::SetState(const uint64& guid, LfgState state) void LFGMgr::SetDungeon(const uint64& guid, uint32 dungeon) { - sLog->outDebug("LFGMgr::SetDungeon: [" UI64FMTD "] dungeon %u", guid, dungeon); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::SetDungeon: [" UI64FMTD "] dungeon %u", guid, dungeon); m_Groups[guid].SetDungeon(dungeon); } void LFGMgr::SetRoles(const uint64& guid, uint8 roles) { - sLog->outDebug("LFGMgr::SetRoles: [" UI64FMTD "] roles: %u", guid, roles); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::SetRoles: [" UI64FMTD "] roles: %u", guid, roles); m_Players[guid].SetRoles(roles); } void LFGMgr::SetComment(const uint64& guid, const std::string& comment) { - sLog->outDebug("LFGMgr::SetComment: [" UI64FMTD "] comment: %s", guid, comment.c_str()); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::SetComment: [" UI64FMTD "] comment: %s", guid, comment.c_str()); m_Players[guid].SetComment(comment); } void LFGMgr::SetSelectedDungeons(const uint64& guid, const LfgDungeonSet& dungeons) { - sLog->outDebug("LFGMgr::SetSelectedDungeons: [" UI64FMTD "]", guid); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::SetSelectedDungeons: [" UI64FMTD "]", guid); m_Players[guid].SetSelectedDungeons(dungeons); } void LFGMgr::SetLockedDungeons(const uint64& guid, const LfgLockMap& lock) { - sLog->outDebug("LFGMgr::SetLockedDungeons: [" UI64FMTD "]", guid); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::SetLockedDungeons: [" UI64FMTD "]", guid); m_Players[guid].SetLockedDungeons(lock); } void LFGMgr::DecreaseKicksLeft(const uint64& guid) { - sLog->outDebug("LFGMgr::DecreaseKicksLeft: [" UI64FMTD "]", guid); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::DecreaseKicksLeft: [" UI64FMTD "]", guid); m_Groups[guid].DecreaseKicksLeft(); } void LFGMgr::RemovePlayerData(const uint64& guid) { - sLog->outDebug("LFGMgr::RemovePlayerData: [" UI64FMTD "]", guid); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::RemovePlayerData: [" UI64FMTD "]", guid); LfgPlayerDataMap::iterator it = m_Players.find(guid); if (it != m_Players.end()) m_Players.erase(it); @@ -2004,7 +2003,7 @@ void LFGMgr::RemovePlayerData(const uint64& guid) void LFGMgr::RemoveGroupData(const uint64& guid) { - sLog->outDebug("LFGMgr::RemoveGroupData: [" UI64FMTD "]", guid); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::RemoveGroupData: [" UI64FMTD "]", guid); LfgGroupDataMap::iterator it = m_Groups.find(guid); if (it != m_Groups.end()) m_Groups.erase(it); diff --git a/src/server/game/DungeonFinding/LFGMgr.h b/src/server/game/DungeonFinding/LFGMgr.h index 493bed3305b8f..2a2850a5b0897 100755 --- a/src/server/game/DungeonFinding/LFGMgr.h +++ b/src/server/game/DungeonFinding/LFGMgr.h @@ -115,7 +115,6 @@ enum LfgAnswer LFG_ANSWER_AGREE = 1 }; - // Forward declaration (just to have all typedef together) struct LfgReward; struct LfgLockStatus; @@ -210,7 +209,6 @@ struct LfgProposalPlayer uint32 groupLowGuid; ///< Original group guid (Low guid) 0 if no original group }; - /// Stores group data related to proposal to join struct LfgProposal { diff --git a/src/server/game/DungeonFinding/LFGScripts.cpp b/src/server/game/DungeonFinding/LFGScripts.cpp index f41f946945693..4d6f90dca4c03 100644 --- a/src/server/game/DungeonFinding/LFGScripts.cpp +++ b/src/server/game/DungeonFinding/LFGScripts.cpp @@ -35,7 +35,7 @@ void LFGScripts::OnAddMember(Group* group, uint64 guid) if (!gguid) return; - sLog->outDebug("LFGScripts::OnAddMember [" UI64FMTD "]: added [" UI64FMTD "]", gguid, guid); + sLog->outDebug(LOG_FILTER_LFG, "LFGScripts::OnAddMember [" UI64FMTD "]: added [" UI64FMTD "]", gguid, guid); LfgUpdateData updateData = LfgUpdateData(LFG_UPDATETYPE_CLEAR_LOCK_LIST); for (GroupReference *itr = group->GetFirstMember(); itr != NULL; itr = itr->next()) { @@ -61,7 +61,7 @@ void LFGScripts::OnRemoveMember(Group* group, uint64 guid, RemoveMethod& method, if (!gguid || method == GROUP_REMOVEMETHOD_DEFAULT) return; - sLog->outDebug("LFGScripts::OnRemoveMember [" UI64FMTD "]: remove [" UI64FMTD "] Method: %d Kicker: [" UI64FMTD "] Reason: %s", gguid, guid, method, kicker, (reason ? reason : "")); + sLog->outDebug(LOG_FILTER_LFG, "LFGScripts::OnRemoveMember [" UI64FMTD "]: remove [" UI64FMTD "] Method: %d Kicker: [" UI64FMTD "] Reason: %s", gguid, guid, method, kicker, (reason ? reason : "")); if (sLFGMgr->GetState(gguid) == LFG_STATE_QUEUED) { // TODO - Do not remove, just remove the one leaving and rejoin queue with all other data @@ -104,7 +104,7 @@ void LFGScripts::OnRemoveMember(Group* group, uint64 guid, RemoveMethod& method, void LFGScripts::OnDisband(Group* group) { uint64 gguid = group->GetGUID(); - sLog->outDebug("LFGScripts::OnDisband [" UI64FMTD "]", gguid); + sLog->outDebug(LOG_FILTER_LFG, "LFGScripts::OnDisband [" UI64FMTD "]", gguid); sLFGMgr->RemoveGroupData(gguid); } @@ -115,14 +115,13 @@ void LFGScripts::OnChangeLeader(Group* group, uint64 newLeaderGuid, uint64 oldLe if (!gguid) return; - sLog->outDebug("LFGScripts::OnChangeLeader [" UI64FMTD "]: old [" UI64FMTD "] new [" UI64FMTD "]", gguid, newLeaderGuid, oldLeaderGuid); + sLog->outDebug(LOG_FILTER_LFG, "LFGScripts::OnChangeLeader [" UI64FMTD "]: old [" UI64FMTD "] new [" UI64FMTD "]", gguid, newLeaderGuid, oldLeaderGuid); Player *plr = sObjectMgr->GetPlayer(newLeaderGuid); LfgUpdateData updateData = LfgUpdateData(LFG_UPDATETYPE_LEADER); if (plr) plr->GetSession()->SendLfgUpdateParty(updateData); - plr = sObjectMgr->GetPlayer(oldLeaderGuid); if (plr) { @@ -137,7 +136,7 @@ void LFGScripts::OnInviteMember(Group* group, uint64 guid) if (!gguid) return; - sLog->outDebug("LFGScripts::OnInviteMember [" UI64FMTD "]: invite [" UI64FMTD "] leader [" UI64FMTD "]", gguid, guid, group->GetLeaderGUID()); + sLog->outDebug(LOG_FILTER_LFG, "LFGScripts::OnInviteMember [" UI64FMTD "]: invite [" UI64FMTD "] leader [" UI64FMTD "]", gguid, guid, group->GetLeaderGUID()); sLFGMgr->Leave(NULL, group); } diff --git a/src/server/game/Entities/Corpse/Corpse.cpp b/src/server/game/Entities/Corpse/Corpse.cpp index 030893c821900..48c7448e32c53 100755 --- a/src/server/game/Entities/Corpse/Corpse.cpp +++ b/src/server/game/Entities/Corpse/Corpse.cpp @@ -190,7 +190,7 @@ bool Corpse::LoadFromDB(uint32 guid, Field *fields) m_isWorldObject = true; uint32 instanceid = fields[14].GetUInt32(); - uint32 phaseMask = fields[15].GetUInt8(); + uint32 phaseMask = fields[15].GetUInt16(); // place SetLocationInstanceId(instanceid); diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 0634d89fba192..07a2ce1b886a2 100755 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -49,7 +49,6 @@ #include "Group.h" // apply implementation of the singletons - TrainerSpell const* TrainerSpellData::Find(uint32 spell_id) const { TrainerSpellMap::const_iterator itr = spellList.find(spell_id); @@ -154,7 +153,6 @@ m_formation(NULL) m_CreatureSpellCooldowns.clear(); m_CreatureCategoryCooldowns.clear(); - m_GlobalCooldown = 0; DisableReputationGain = false; //m_unit_movement_flags = MONSTER_MOVE_WALK; @@ -317,14 +315,10 @@ bool Creature::InitEntry(uint32 Entry, uint32 /*team*/, const CreatureData *data SetByteValue(UNIT_FIELD_BYTES_0, 2, minfo->gender); // Load creature equipment - if (!data || data->equipmentId == 0) - { // use default from the template + if (!data || data->equipmentId == 0) // use default from the template LoadEquipment(cinfo->equipmentId); - } - else if (data && data->equipmentId != -1) - { // override, -1 means no equipment + else if (data && data->equipmentId != -1) // override, -1 means no equipment LoadEquipment(data->equipmentId); - } SetName(normalInfo->Name); // at normal entry always @@ -434,11 +428,6 @@ bool Creature::UpdateEntry(uint32 Entry, uint32 team, const CreatureData *data) void Creature::Update(uint32 diff) { - if (m_GlobalCooldown <= diff) - m_GlobalCooldown = 0; - else - m_GlobalCooldown -= diff; - if (IsAIEnabled && TriggerJustRespawned) { TriggerJustRespawned = false; @@ -712,7 +701,7 @@ bool Creature::AIM_Initialize(CreatureAI* ai) // make sure nothing can change the AI during AI update if (m_AI_locked) { - sLog->outDebug("AIM_Initialize: failed to init, locked."); + sLog->outDebug(LOG_FILTER_TSCR, "AIM_Initialize: failed to init, locked."); return false; } @@ -751,7 +740,7 @@ bool Creature::Create(uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry, CreatureInfo const *cinfo = ObjectMgr::GetCreatureTemplate(Entry); if (!cinfo) { - sLog->outErrorDb("Creature entry %u does not exist.", Entry); + sLog->outErrorDb("Creature::Create(): creature template (guidlow: %u, entry: %u) does not exist.", guidlow, Entry); return false; } @@ -759,66 +748,64 @@ bool Creature::Create(uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry, if (!IsPositionValid()) { - sLog->outError("Creature (guidlow %d, entry %d) not loaded. Suggested coordinates isn't valid (X: %f Y: %f)",guidlow,Entry,x,y); + sLog->outError("Creature::Create(): given coordinates for creature (guidlow %d, entry %d) are not valid (X: %f, Y: %f, Z: %f, O: %f)", guidlow, Entry, x, y, z, ang); return false; } //oX = x; oY = y; dX = x; dY = y; m_moveTime = 0; m_startMove = 0; - const bool bResult = CreateFromProto(guidlow, Entry, vehId, team, data); + if (!CreateFromProto(guidlow, Entry, vehId, team, data)) + return false; - if (bResult) + switch (GetCreatureInfo()->rank) { - switch (GetCreatureInfo()->rank) - { - case CREATURE_ELITE_RARE: - m_corpseDelay = sWorld->getIntConfig(CONFIG_CORPSE_DECAY_RARE); - break; - case CREATURE_ELITE_ELITE: - m_corpseDelay = sWorld->getIntConfig(CONFIG_CORPSE_DECAY_ELITE); - break; - case CREATURE_ELITE_RAREELITE: - m_corpseDelay = sWorld->getIntConfig(CONFIG_CORPSE_DECAY_RAREELITE); - break; - case CREATURE_ELITE_WORLDBOSS: - m_corpseDelay = sWorld->getIntConfig(CONFIG_CORPSE_DECAY_WORLDBOSS); - break; - default: - m_corpseDelay = sWorld->getIntConfig(CONFIG_CORPSE_DECAY_NORMAL); - break; - } - LoadCreaturesAddon(); - CreatureModelInfo const *minfo = sObjectMgr->GetCreatureModelRandomGender(GetNativeDisplayId()); - if (minfo && !isTotem()) // Cancel load if no model defined or if totem - { - uint32 display_id = minfo->modelid; // it can be different (for another gender) + case CREATURE_ELITE_RARE: + m_corpseDelay = sWorld->getIntConfig(CONFIG_CORPSE_DECAY_RARE); + break; + case CREATURE_ELITE_ELITE: + m_corpseDelay = sWorld->getIntConfig(CONFIG_CORPSE_DECAY_ELITE); + break; + case CREATURE_ELITE_RAREELITE: + m_corpseDelay = sWorld->getIntConfig(CONFIG_CORPSE_DECAY_RAREELITE); + break; + case CREATURE_ELITE_WORLDBOSS: + m_corpseDelay = sWorld->getIntConfig(CONFIG_CORPSE_DECAY_WORLDBOSS); + break; + default: + m_corpseDelay = sWorld->getIntConfig(CONFIG_CORPSE_DECAY_NORMAL); + break; + } - SetDisplayId(display_id); - SetNativeDisplayId(display_id); - SetByteValue(UNIT_FIELD_BYTES_0, 2, minfo->gender); - } + LoadCreaturesAddon(); + CreatureModelInfo const *minfo = sObjectMgr->GetCreatureModelRandomGender(GetNativeDisplayId()); + if (minfo && !isTotem()) // Cancel load if no model defined or if totem + { + uint32 display_id = minfo->modelid; // it can be different (for another gender) - if (GetCreatureInfo()->InhabitType & INHABIT_AIR) - { - if (GetDefaultMovementType() == IDLE_MOTION_TYPE) - AddUnitMovementFlag(MOVEMENTFLAG_CAN_FLY); - else - SetFlying(true); - } + SetDisplayId(display_id); + SetNativeDisplayId(display_id); + SetByteValue(UNIT_FIELD_BYTES_0, 2, minfo->gender); + } - if (GetCreatureInfo()->InhabitType & INHABIT_WATER) - { - AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING); - } - LastUsedScriptID = GetCreatureInfo()->ScriptID; + if (GetCreatureInfo()->InhabitType & INHABIT_AIR) + { + if (GetDefaultMovementType() == IDLE_MOTION_TYPE) + AddUnitMovementFlag(MOVEMENTFLAG_CAN_FLY); + else + SetFlying(true); } + if (GetCreatureInfo()->InhabitType & INHABIT_WATER) + AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING); + + LastUsedScriptID = GetCreatureInfo()->ScriptID; + // TODO: Replace with spell, handle from DB if (isSpiritHealer()) { m_serverSideVisibility.SetValue(SERVERSIDE_VISIBILITY_GHOST, GHOST_VISIBILITY_GHOST); m_serverSideVisibilityDetect.SetValue(SERVERSIDE_VISIBILITY_GHOST, GHOST_VISIBILITY_GHOST); } - else if(isSpiritGuide()) + else if (isSpiritGuide()) { m_serverSideVisibility.SetValue(SERVERSIDE_VISIBILITY_GHOST, GHOST_VISIBILITY_GHOST | GHOST_VISIBILITY_ALIVE); m_serverSideVisibilityDetect.SetValue(SERVERSIDE_VISIBILITY_GHOST, GHOST_VISIBILITY_GHOST | GHOST_VISIBILITY_ALIVE); @@ -827,7 +814,7 @@ bool Creature::Create(uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry, if (Entry == VISUAL_WAYPOINT) SetVisible(false); - return bResult; + return true; } bool Creature::isCanTrainingOf(Player* pPlayer, bool msg) const @@ -1254,7 +1241,7 @@ bool Creature::CreateFromProto(uint32 guidlow, uint32 Entry, uint32 vehId, uint3 CreatureInfo const *cinfo = ObjectMgr::GetCreatureTemplate(Entry); if (!cinfo) { - sLog->outErrorDb("Creature entry %u does not exist.", Entry); + sLog->outErrorDb("Creature::CreateFromProto(): creature template (guidlow: %u, entry: %u) does not exist.", guidlow, Entry); return false; } @@ -1263,7 +1250,7 @@ bool Creature::CreateFromProto(uint32 guidlow, uint32 Entry, uint32 vehId, uint3 if (!vehId) vehId = cinfo->VehicleId; - if (vehId && !CreateVehicleKit(vehId)) + if (vehId && !CreateVehicleKit(vehId, Entry)) vehId = 0; Object::_Create(guidlow, Entry, vehId ? HIGHGUID_VEHICLE : HIGHGUID_UNIT); @@ -1395,7 +1382,7 @@ void Creature::DeleteFromDB() { if (!m_DBTableGuid) { - sLog->outDebug("Trying to delete not saved creature!"); + sLog->outError("Trying to delete not saved creature! LowGUID: %u, Entry: %u", GetGUIDLow(), GetEntry()); return; } @@ -1437,6 +1424,9 @@ bool Creature::canStartAttack(Unit const* who, bool force) const if (isCivilian()) return false; + if (HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PASSIVE)) + return false; + if (!canFly() && (GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE + m_CombatDistance)) //|| who->IsControlledByPlayer() && who->IsFlying())) // we cannot check flying for other creatures, too much map/vmap calculation @@ -1558,7 +1548,7 @@ void Creature::setDeathState(DeathState s) if (GetCreatureInfo()->InhabitType & INHABIT_WATER) AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING); SetUInt32Value(UNIT_NPC_FLAGS, cinfo->npcflag); - ClearUnitState(UNIT_STAT_ALL_STATE); + ClearUnitState(uint32(UNIT_STAT_ALL_STATE)); SetMeleeDamageSchool(SpellSchools(cinfo->dmgschool)); LoadCreaturesAddon(true); Motion_Initialize(); @@ -1621,7 +1611,7 @@ void Creature::Respawn(bool force) { setDeathState(JUST_DIED); i_motionMaster.Clear(); - ClearUnitState(UNIT_STAT_ALL_STATE); + ClearUnitState(uint32(UNIT_STAT_ALL_STATE)); LoadCreaturesAddon(true); } else @@ -1673,7 +1663,7 @@ void Creature::ForcedDespawn(uint32 timeMSToDespawn) void Creature::DespawnOrUnsummon(uint32 msTimeToDespawn /*= 0*/) { if (TempSummon* summon = this->ToTempSummon()) - summon->UnSummon(); + summon->UnSummon(msTimeToDespawn); else ForcedDespawn(msTimeToDespawn); } @@ -1859,7 +1849,7 @@ void Creature::SendAIReaction(AiReaction reactionType) ((WorldObject*)this)->SendMessageToSet(&data, true); - sLog->outDebug("WORLD: Sent SMSG_AI_REACTION, type %u.", reactionType); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_AI_REACTION, type %u.", reactionType); } void Creature::CallAssistance() @@ -1935,6 +1925,9 @@ bool Creature::CanAssistTo(const Unit* u, const Unit* enemy, bool checkfaction / if (isCivilian()) return false; + if (HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_PASSIVE)) + return false; + // skip fighting creature if (isInCombat()) return false; @@ -2112,7 +2105,7 @@ bool Creature::LoadCreaturesAddon(bool reload) } AddAura(AdditionalSpellInfo, cAura->effectMask, this); - sLog->outDebug("Spell: %u with AuraEffectMask %u added to creature (GUID: %u Entry: %u)", cAura->spell_id, cAura->effectMask,GetGUIDLow(),GetEntry()); + sLog->outDebug(LOG_FILTER_UNITS, "Spell: %u with AuraEffectMask %u added to creature (GUID: %u Entry: %u)", cAura->spell_id, cAura->effectMask,GetGUIDLow(),GetEntry()); } } return true; @@ -2191,8 +2184,6 @@ void Creature::AddCreatureSpellCooldown(uint32 spellid) if (spellInfo->Category) _AddCreatureCategoryCooldown(spellInfo->Category, time(NULL)); - - m_GlobalCooldown = spellInfo->StartRecoveryTime; } bool Creature::HasCategoryCooldown(uint32 spell_id) const @@ -2201,10 +2192,6 @@ bool Creature::HasCategoryCooldown(uint32 spell_id) const if (!spellInfo) return false; - // check global cooldown if spell affected by it - if (spellInfo->StartRecoveryCategory > 0 && m_GlobalCooldown > 0) - return true; - CreatureSpellCooldowns::const_iterator itr = m_CreatureCategoryCooldowns.find(spellInfo->Category); return(itr != m_CreatureCategoryCooldowns.end() && time_t(itr->second + (spellInfo->CategoryRecoveryTime / IN_MILLISECONDS)) > time(NULL)); } diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h index 43ff73df08c67..4933428bf4e26 100755 --- a/src/server/game/Entities/Creature/Creature.h +++ b/src/server/game/Entities/Creature/Creature.h @@ -577,7 +577,6 @@ class Creature : public Unit, public GridObject uint32 m_spells[CREATURE_MAX_SPELLS]; CreatureSpellCooldowns m_CreatureSpellCooldowns; CreatureSpellCooldowns m_CreatureCategoryCooldowns; - uint32 m_GlobalCooldown; bool canStartAttack(Unit const* u, bool force) const; float GetAttackDistance(Unit const* pl) const; @@ -646,8 +645,6 @@ class Creature : public Unit, public GridObject void GetHomePosition(float &x, float &y, float &z, float &ori) { m_homePosition.GetPosition(x, y, z, ori); } Position GetHomePosition() { return m_homePosition; } - uint32 GetGlobalCooldown() const { return m_GlobalCooldown; } - uint32 GetWaypointPath(){return m_path_id;} void LoadPath(uint32 pathid) { m_path_id = pathid; } diff --git a/src/server/game/Entities/Creature/CreatureGroups.cpp b/src/server/game/Entities/Creature/CreatureGroups.cpp index 63f3be8d430b9..4dd9ce885f951 100755 --- a/src/server/game/Entities/Creature/CreatureGroups.cpp +++ b/src/server/game/Entities/Creature/CreatureGroups.cpp @@ -37,13 +37,13 @@ void CreatureGroupManager::AddCreatureToGroup(uint32 groupId, Creature *member) //Add member to an existing group if (itr != map->CreatureGroupHolder.end()) { - sLog->outDebug("Group found: %u, inserting creature GUID: %u, Group InstanceID %u", groupId, member->GetGUIDLow(), member->GetInstanceId()); + sLog->outDebug(LOG_FILTER_UNITS, "Group found: %u, inserting creature GUID: %u, Group InstanceID %u", groupId, member->GetGUIDLow(), member->GetInstanceId()); itr->second->AddMember(member); } //Create new group else { - sLog->outDebug("Group not found: %u. Creating new group.", groupId); + sLog->outDebug(LOG_FILTER_UNITS, "Group not found: %u. Creating new group.", groupId); CreatureGroup* group = new CreatureGroup(groupId); map->CreatureGroupHolder[groupId] = group; group->AddMember(member); @@ -52,7 +52,7 @@ void CreatureGroupManager::AddCreatureToGroup(uint32 groupId, Creature *member) void CreatureGroupManager::RemoveCreatureFromGroup(CreatureGroup *group, Creature *member) { - sLog->outDebug("Deleting member pointer to GUID: %u from group %u", group->GetId(), member->GetDBTableGUIDLow()); + sLog->outDebug(LOG_FILTER_UNITS, "Deleting member pointer to GUID: %u from group %u", group->GetId(), member->GetDBTableGUIDLow()); group->RemoveMember(member); if (group->isEmpty()) @@ -61,7 +61,7 @@ void CreatureGroupManager::RemoveCreatureFromGroup(CreatureGroup *group, Creatur if (!map) return; - sLog->outDebug("Deleting group with InstanceID %u", member->GetInstanceId()); + sLog->outDebug(LOG_FILTER_UNITS, "Deleting group with InstanceID %u", member->GetInstanceId()); map->CreatureGroupHolder.erase(group->GetId()); delete group; } @@ -153,12 +153,12 @@ void CreatureGroupManager::LoadCreatureFormations() void CreatureGroup::AddMember(Creature *member) { - sLog->outDebug("CreatureGroup::AddMember: Adding unit GUID: %u.", member->GetGUIDLow()); + sLog->outDebug(LOG_FILTER_UNITS, "CreatureGroup::AddMember: Adding unit GUID: %u.", member->GetGUIDLow()); //Check if it is a leader if (member->GetDBTableGUIDLow() == m_groupID) { - sLog->outDebug("Unit GUID: %u is formation leader. Adding group.", member->GetGUIDLow()); + sLog->outDebug(LOG_FILTER_UNITS, "Unit GUID: %u is formation leader. Adding group.", member->GetGUIDLow()); m_leader = member; } @@ -187,7 +187,7 @@ void CreatureGroup::MemberAttackStart(Creature *member, Unit *target) for (CreatureGroupMemberType::iterator itr = m_members.begin(); itr != m_members.end(); ++itr) { if (m_leader) // avoid crash if leader was killed and reset. - sLog->outDebug("GROUP ATTACK: group instance id %u calls member instid %u", m_leader->GetInstanceId(), member->GetInstanceId()); + sLog->outDebug(LOG_FILTER_UNITS, "GROUP ATTACK: group instance id %u calls member instid %u", m_leader->GetInstanceId(), member->GetInstanceId()); //Skip one check if (itr->first == member) @@ -214,7 +214,7 @@ void CreatureGroup::FormationReset(bool dismiss) itr->first->GetMotionMaster()->Initialize(); else itr->first->GetMotionMaster()->MoveIdle(MOTION_SLOT_IDLE); - sLog->outDebug("Set %s movement for member GUID: %u", dismiss ? "default" : "idle", itr->first->GetGUIDLow()); + sLog->outDebug(LOG_FILTER_UNITS, "Set %s movement for member GUID: %u", dismiss ? "default" : "idle", itr->first->GetGUIDLow()); } } m_Formed = !dismiss; diff --git a/src/server/game/Entities/Creature/CreatureGroups.h b/src/server/game/Entities/Creature/CreatureGroups.h index ff35ee05ed108..5f1863f83c333 100755 --- a/src/server/game/Entities/Creature/CreatureGroups.h +++ b/src/server/game/Entities/Creature/CreatureGroups.h @@ -59,7 +59,7 @@ class CreatureGroup public: //Group cannot be created empty explicit CreatureGroup(uint32 id) : m_leader(NULL), m_groupID(id), m_Formed(false) {} - ~CreatureGroup() { sLog->outDebug("Destroying group"); } + ~CreatureGroup() { sLog->outDebug(LOG_FILTER_UNITS, "Destroying group"); } Creature* getLeader() const { return m_leader; } uint32 GetId() const { return m_groupID; } diff --git a/src/server/game/Entities/Creature/GossipDef.cpp b/src/server/game/Entities/Creature/GossipDef.cpp index 5dd0b9a53476a..4a801f5607c47 100755 --- a/src/server/game/Entities/Creature/GossipDef.cpp +++ b/src/server/game/Entities/Creature/GossipDef.cpp @@ -198,7 +198,7 @@ void PlayerMenu::SendPointOfInterest(float X, float Y, uint32 Icon, uint32 Flags data << locName; pSession->SendPacket(&data); - //sLog->outDebug("WORLD: Sent SMSG_GOSSIP_POI"); + //sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: Sent SMSG_GOSSIP_POI"); } void PlayerMenu::SendPointOfInterest(uint32 poi_id) @@ -226,7 +226,7 @@ void PlayerMenu::SendPointOfInterest(uint32 poi_id) data << icon_name; pSession->SendPacket(&data); - //sLog->outDebug("WORLD: Sent SMSG_GOSSIP_POI"); + //sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: Sent SMSG_GOSSIP_POI"); } void PlayerMenu::SendTalking(uint32 textID) @@ -297,7 +297,7 @@ void PlayerMenu::SendTalking(uint32 textID) } pSession->SendPacket(&data); - sLog->outDebug("WORLD: Sent SMSG_NPC_TEXT_UPDATE "); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_NPC_TEXT_UPDATE "); } void PlayerMenu::SendTalking(char const * title, char const * text) @@ -320,7 +320,7 @@ void PlayerMenu::SendTalking(char const * title, char const * text) pSession->SendPacket(&data); - sLog->outDebug("WORLD: Sent SMSG_NPC_TEXT_UPDATE "); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_NPC_TEXT_UPDATE "); } /*********************************************************/ @@ -406,7 +406,7 @@ void PlayerMenu::SendQuestGiverQuestList(QEmote eEmote, const std::string& Title data.put(count_pos, count); pSession->SendPacket(&data); - sLog->outDebug("WORLD: Sent SMSG_QUESTGIVER_QUEST_LIST NPC Guid=%u", GUID_LOPART(npcGUID)); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTGIVER_QUEST_LIST NPC Guid=%u", GUID_LOPART(npcGUID)); } void PlayerMenu::SendQuestGiverStatus(uint8 questStatus, uint64 npcGUID) @@ -416,7 +416,7 @@ void PlayerMenu::SendQuestGiverStatus(uint8 questStatus, uint64 npcGUID) data << uint8(questStatus); pSession->SendPacket(&data); - sLog->outDebug("WORLD: Sent SMSG_QUESTGIVER_STATUS NPC Guid=%u, status=%u", GUID_LOPART(npcGUID), questStatus); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTGIVER_STATUS NPC Guid=%u, status=%u", GUID_LOPART(npcGUID), questStatus); } void PlayerMenu::SendQuestGiverQuestDetails(Quest const *pQuest, uint64 npcGUID, bool ActivateAccept) @@ -527,7 +527,7 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const *pQuest, uint64 npcGUID, } pSession->SendPacket(&data); - sLog->outDebug("WORLD: Sent SMSG_QUESTGIVER_QUEST_DETAILS NPCGuid=%u, questid=%u", GUID_LOPART(npcGUID), pQuest->GetQuestId()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTGIVER_QUEST_DETAILS NPCGuid=%u, questid=%u", GUID_LOPART(npcGUID), pQuest->GetQuestId()); } void PlayerMenu::SendQuestQueryResponse(Quest const *pQuest) @@ -667,7 +667,7 @@ void PlayerMenu::SendQuestQueryResponse(Quest const *pQuest) data << ObjectiveText[iI]; pSession->SendPacket(&data); - sLog->outDebug("WORLD: Sent SMSG_QUEST_QUERY_RESPONSE questid=%u", pQuest->GetQuestId()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUEST_QUERY_RESPONSE questid=%u", pQuest->GetQuestId()); } void PlayerMenu::SendQuestGiverOfferReward(Quest const* pQuest, uint64 npcGUID, bool EnableNext) @@ -764,7 +764,7 @@ void PlayerMenu::SendQuestGiverOfferReward(Quest const* pQuest, uint64 npcGUID, data << uint32(pQuest->RewRepValue[i]); pSession->SendPacket(&data); - sLog->outDebug("WORLD: Sent SMSG_QUESTGIVER_OFFER_REWARD NPCGuid=%u, questid=%u", GUID_LOPART(npcGUID), pQuest->GetQuestId()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTGIVER_OFFER_REWARD NPCGuid=%u, questid=%u", GUID_LOPART(npcGUID), pQuest->GetQuestId()); } void PlayerMenu::SendQuestGiverRequestItems(Quest const *pQuest, uint64 npcGUID, bool Completable, bool CloseOnCancel) @@ -844,5 +844,5 @@ void PlayerMenu::SendQuestGiverRequestItems(Quest const *pQuest, uint64 npcGUID, data << uint32(0x10); pSession->SendPacket(&data); - sLog->outDebug("WORLD: Sent SMSG_QUESTGIVER_REQUEST_ITEMS NPCGuid=%u, questid=%u", GUID_LOPART(npcGUID), pQuest->GetQuestId()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTGIVER_REQUEST_ITEMS NPCGuid=%u, questid=%u", GUID_LOPART(npcGUID), pQuest->GetQuestId()); } diff --git a/src/server/game/Entities/Creature/TemporarySummon.cpp b/src/server/game/Entities/Creature/TemporarySummon.cpp index 1204a104d9c50..62174fe8c9cef 100755 --- a/src/server/game/Entities/Creature/TemporarySummon.cpp +++ b/src/server/game/Entities/Creature/TemporarySummon.cpp @@ -224,8 +224,16 @@ void TempSummon::SetTempSummonType(TempSummonType type) m_type = type; } -void TempSummon::UnSummon() +void TempSummon::UnSummon(uint32 msTime) { + if (msTime) + { + ForcedUnsummonDelayEvent *pEvent = new ForcedUnsummonDelayEvent(*this); + + m_Events.AddEvent(pEvent, m_Events.CalculateTime(msTime)); + return; + } + //ASSERT(!isPet()); if (isPet()) { @@ -241,6 +249,12 @@ void TempSummon::UnSummon() AddObjectToRemoveList(); } +bool ForcedUnsummonDelayEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/) +{ + m_owner.UnSummon(); + return true; +} + void TempSummon::RemoveFromWorld() { if (!IsInWorld()) diff --git a/src/server/game/Entities/Creature/TemporarySummon.h b/src/server/game/Entities/Creature/TemporarySummon.h index 985f9dc0e303a..82f63d887abd4 100755 --- a/src/server/game/Entities/Creature/TemporarySummon.h +++ b/src/server/game/Entities/Creature/TemporarySummon.h @@ -29,12 +29,13 @@ class TempSummon : public Creature void Update(uint32 time); virtual void InitStats(uint32 lifetime); virtual void InitSummon(); - void UnSummon(); + void UnSummon(uint32 msTime = 0); void RemoveFromWorld(); void SetTempSummonType(TempSummonType type); void SaveToDB(uint32 /*mapid*/, uint8 /*spawnMask*/, uint32 /*phaseMask*/) {} Unit* GetSummoner() const; uint64 const& GetSummonerGUID() { return m_summonerGUID; } + TempSummonType const& GetSummonType() { return m_type; } const SummonPropertiesEntry * const m_Properties; private: @@ -96,5 +97,14 @@ class Puppet : public Minion Player *m_owner; }; +class ForcedUnsummonDelayEvent : public BasicEvent +{ +public: + ForcedUnsummonDelayEvent(TempSummon& owner) : BasicEvent(), m_owner(owner) { } + bool Execute(uint64 e_time, uint32 p_time); + +private: + TempSummon& m_owner; +}; #endif diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index 453adcbba0559..c657675abfe46 100755 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -306,7 +306,7 @@ void GameObject::Update(uint32 diff) udata.BuildPacket(&packet); caster->ToPlayer()->GetSession()->SendPacket(&packet); - SendCustomAnim(); + SendCustomAnim(GetGoAnimProgress()); } m_lootState = GO_READY; // can be successfully open with some chance @@ -451,7 +451,7 @@ void GameObject::Update(uint32 diff) if (goInfo->trap.spellId) CastSpell(ok, goInfo->trap.spellId); - m_cooldownTime = time(NULL) + 4; // 4 seconds + m_cooldownTime = time(NULL) + (goInfo->trap.cooldown ? goInfo->trap.cooldown : uint32(4)); // template or 4 seconds if (owner || (goInfo->trap.spellId == 34709)) SetLootState(GO_JUST_DEACTIVATED); @@ -537,8 +537,12 @@ void GameObject::Update(uint32 diff) SetGoState(GO_STATE_READY); //any return here in case battleground traps + if (GetGOInfo()->flags & GO_FLAG_NODESPAWN) + return; } + loot.clear(); + if (GetOwnerGUID()) { if (Unit* owner = GetOwner()) @@ -550,6 +554,8 @@ void GameObject::Update(uint32 diff) return; } + SetLootState(GO_READY); + //burning flags in some battlegrounds, if you find better condition, just add it if (GetGOInfo()->IsDespawnAtAction() || GetGoAnimProgress() > 0) { @@ -558,9 +564,6 @@ void GameObject::Update(uint32 diff) SetUInt32Value(GAMEOBJECT_FLAGS, GetGOInfo()->flags); } - loot.clear(); - SetLootState(GO_READY); - if (!m_respawnDelayTime) return; @@ -827,7 +830,6 @@ bool GameObject::IsDynTransport() const return gInfo->type == GAMEOBJECT_TYPE_MO_TRANSPORT || (gInfo->type == GAMEOBJECT_TYPE_TRANSPORT && !gInfo->transport.pause); } - Unit* GameObject::GetOwner() const { return ObjectAccessor::GetUnit(*this, GetOwnerGUID()); @@ -1048,7 +1050,16 @@ void GameObject::Use(Unit* user) AI()->GossipHello(playerUser); } - switch(GetGoType()) + // If cooldown data present in template + if (uint32 cooldown = GetGOInfo()->GetCooldown()) + { + if (m_cooldownTime > sWorld->GetGameTime()) + return; + + m_cooldownTime = sWorld->GetGameTime() + cooldown; + } + + switch (GetGoType()) { case GAMEOBJECT_TYPE_DOOR: //0 case GAMEOBJECT_TYPE_BUTTON: //1 @@ -1064,7 +1075,7 @@ void GameObject::Use(Unit* user) if (user->GetTypeId() != TYPEID_PLAYER) return; - Player* player = (Player*)user; + Player* player = user->ToPlayer(); player->PrepareGossipMenu(this, GetGOInfo()->questgiver.gossipID); player->SendPreparedGossip(this); @@ -1089,7 +1100,7 @@ void GameObject::Use(Unit* user) ChairListSlots[0] = 0; // error in DB, make one default slot } - Player* player = (Player*)user; + Player* player = user->ToPlayer(); // a chair may have n slots. we have to calculate their positions and teleport the player to the nearest one @@ -1167,7 +1178,7 @@ void GameObject::Use(Unit* user) if (user->GetTypeId() == TYPEID_PLAYER) { - Player* player = (Player*)user; + Player* player = user->ToPlayer(); if (info->goober.pageId) // show page... { @@ -1183,7 +1194,7 @@ void GameObject::Use(Unit* user) if (info->goober.eventId) { - sLog->outDebug("Goober ScriptStart id %u for GO entry %u (GUID %u).", info->goober.eventId, GetEntry(), GetDBTableGUIDLow()); + sLog->outDebug(LOG_FILTER_MAPSCRIPTS, "Goober ScriptStart id %u for GO entry %u (GUID %u).", info->goober.eventId, GetEntry(), GetDBTableGUIDLow()); GetMap()->ScriptsStart(sEventScripts, info->goober.eventId, player, this); EventInform(info->goober.eventId); } @@ -1212,7 +1223,7 @@ void GameObject::Use(Unit* user) // this appear to be ok, however others exist in addition to this that should have custom (ex: 190510, 188692, 187389) if (time_to_restore && info->goober.customAnim) - SendCustomAnim(); + SendCustomAnim(GetGoAnimProgress()); else SetGoState(GO_STATE_ACTIVE); @@ -1233,7 +1244,7 @@ void GameObject::Use(Unit* user) if (user->GetTypeId() != TYPEID_PLAYER) return; - Player* player = (Player*)user; + Player* player = user->ToPlayer(); if (info->camera.cinematicId) player->SendCinematicStart(info->camera.cinematicId); @@ -1437,7 +1448,7 @@ void GameObject::Use(Unit* user) if (user->GetTypeId() != TYPEID_PLAYER) return; - Player* player = (Player*)user; + Player* player = user->ToPlayer(); Player* targetPlayer = ObjectAccessor::FindPlayer(player->GetSelection()); @@ -1466,7 +1477,7 @@ void GameObject::Use(Unit* user) if (user->GetTypeId() != TYPEID_PLAYER) return; - Player* player = (Player*)user; + Player* player = user->ToPlayer(); if (player->CanUseBattlegroundObject()) { @@ -1494,7 +1505,7 @@ void GameObject::Use(Unit* user) if (user->GetTypeId() != TYPEID_PLAYER) return; - Player* player = (Player*)user; + Player* player = user->ToPlayer(); player->SendLoot(GetGUID(), LOOT_FISHINGHOLE); player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_FISH_IN_GAMEOBJECT, GetGOInfo()->id); @@ -1506,7 +1517,7 @@ void GameObject::Use(Unit* user) if (user->GetTypeId() != TYPEID_PLAYER) return; - Player* player = (Player*)user; + Player* player = user->ToPlayer(); if (player->CanUseBattlegroundObject()) { @@ -1557,7 +1568,7 @@ void GameObject::Use(Unit* user) if (user->GetTypeId() != TYPEID_PLAYER) return; - Player* player = (Player*)user; + Player* player = user->ToPlayer(); // fallback, will always work player->TeleportTo(GetMapId(), GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation(),TELE_TO_NOT_LEAVE_TRANSPORT | TELE_TO_NOT_LEAVE_COMBAT | TELE_TO_NOT_UNSUMMON_PET); @@ -1569,7 +1580,8 @@ void GameObject::Use(Unit* user) return; } default: - sLog->outDebug("Unknown Object Type %u", GetGoType()); + sLog->outError("GameObject::Use(): unit (type: %u, guid: %u) tries to use object (guid: %u) of unknown type (%u)", + user->GetTypeId(), user->GetGUIDLow(), GetGUIDLow(), GetGoType()); break; } @@ -1579,10 +1591,10 @@ void GameObject::Use(Unit* user) SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId); if (!spellInfo) { - if (user->GetTypeId() != TYPEID_PLAYER || !sOutdoorPvPMgr->HandleCustomSpell((Player*)user,spellId,this)) + if (user->GetTypeId() != TYPEID_PLAYER || !sOutdoorPvPMgr->HandleCustomSpell(user->ToPlayer(), spellId, this)) sLog->outError("WORLD: unknown spell id %u at use action for gameobject (Entry: %u GoType: %u)", spellId,GetEntry(),GetGoType()); else - sLog->outDebug("WORLD: %u non-dbc spell was handled by OutdoorPvP", spellId); + sLog->outDebug(LOG_FILTER_OUTDOORPVP, "WORLD: %u non-dbc spell was handled by OutdoorPvP", spellId); return; } @@ -1636,11 +1648,11 @@ void GameObject::CastSpell(Unit* target, uint32 spellId) //trigger->RemoveCorpse(); } -void GameObject::SendCustomAnim() +void GameObject::SendCustomAnim(uint32 anim) { WorldPacket data(SMSG_GAMEOBJECT_CUSTOM_ANIM,8+4); data << GetGUID(); - data << uint32(GetGoAnimProgress()); + data << uint32(anim); SendMessageToSet(&data, true); } diff --git a/src/server/game/Entities/GameObject/GameObject.h b/src/server/game/Entities/GameObject/GameObject.h index c913c31777272..604a3c8ba559e 100755 --- a/src/server/game/Entities/GameObject/GameObject.h +++ b/src/server/game/Entities/GameObject/GameObject.h @@ -495,6 +495,7 @@ struct GameObjectInfo default: return 0; } } + uint32 GetGossipMenuId() const { switch(type) @@ -504,6 +505,7 @@ struct GameObjectInfo default: return 0; } } + uint32 GetEventScriptId() const { switch(type) @@ -514,6 +516,16 @@ struct GameObjectInfo default: return 0; } } + + uint32 GetCooldown() const // Cooldown preventing goober and traps to cast spell + { + switch (type) + { + case GAMEOBJECT_TYPE_TRAP: return trap.cooldown; + case GAMEOBJECT_TYPE_GOOBER: return goober.cooldown; + default: return 0; + } + } }; class OPvPCapturePoint; @@ -748,7 +760,7 @@ class GameObject : public WorldObject, public GridObject GameObject* LookupFishingHoleAround(float range); void CastSpell(Unit *target, uint32 spell); - void SendCustomAnim(); + void SendCustomAnim(uint32 anim); bool IsInRange(float x, float y, float z, float radius) const; void TakenDamage(uint32 damage, Unit* who = NULL); void Rebuild(); diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp index eb8b56a5d0a9f..5089db095e96e 100755 --- a/src/server/game/Entities/Item/Item.cpp +++ b/src/server/game/Entities/Item/Item.cpp @@ -281,12 +281,21 @@ bool Item::Create(uint32 guidlow, uint32 itemid, Player const* owner) return true; } +// Returns true if Item is a bag AND it is not empty. +// Returns false if Item is not a bag OR it is an empty bag. +bool Item::IsNotEmptyBag() const +{ + if (Bag const* bag = ToBag()) + return !bag->IsEmpty(); + return false; +} + void Item::UpdateDuration(Player* owner, uint32 diff) { if (!GetUInt32Value(ITEM_FIELD_DURATION)) return; - sLog->outDebug("Item::UpdateDuration Item (Entry: %u Duration %u Diff %u)",GetEntry(),GetUInt32Value(ITEM_FIELD_DURATION),diff); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Item::UpdateDuration Item (Entry: %u Duration %u Diff %u)",GetEntry(),GetUInt32Value(ITEM_FIELD_DURATION),diff); if (GetUInt32Value(ITEM_FIELD_DURATION) <= diff) { @@ -451,20 +460,32 @@ bool Item::LoadFromDB(uint32 guid, uint64 owner_guid, Field* fields, uint32 entr return true; } -void Item::DeleteFromDB(SQLTransaction& trans) +/*static*/ +void Item::DeleteFromDB(SQLTransaction& trans, uint32 itemGuid) { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEM_INSTANCE); - stmt->setUInt32(0, GetGUIDLow()); + stmt->setUInt32(0, itemGuid); trans->Append(stmt); } -void Item::DeleteFromInventoryDB(SQLTransaction& trans) +void Item::DeleteFromDB(SQLTransaction& trans) +{ + DeleteFromDB(trans, GetGUIDLow()); +} + +/*static*/ +void Item::DeleteFromInventoryDB(SQLTransaction& trans, uint32 itemGuid) { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_INVENTORY_ITEM); - stmt->setUInt32(0, GetGUIDLow()); + stmt->setUInt32(0, itemGuid); trans->Append(stmt); } +void Item::DeleteFromInventoryDB(SQLTransaction& trans) +{ + DeleteFromInventoryDB(trans, GetGUIDLow()); +} + ItemPrototype const *Item::GetProto() const { return ObjectMgr::GetItemPrototype(GetEntry()); @@ -680,7 +701,7 @@ void Item::AddToUpdateQueueOf(Player *player) if (player->GetGUID() != GetOwnerGUID()) { - sLog->outDebug("Item::AddToUpdateQueueOf - Owner's guid (%u) and player's guid (%u) don't match!", GUID_LOPART(GetOwnerGUID()), player->GetGUIDLow()); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Item::AddToUpdateQueueOf - Owner's guid (%u) and player's guid (%u) don't match!", GUID_LOPART(GetOwnerGUID()), player->GetGUIDLow()); return; } @@ -700,7 +721,7 @@ void Item::RemoveFromUpdateQueueOf(Player *player) if (player->GetGUID() != GetOwnerGUID()) { - sLog->outDebug("Item::RemoveFromUpdateQueueOf - Owner's guid (%u) and player's guid (%u) don't match!", GUID_LOPART(GetOwnerGUID()), player->GetGUIDLow()); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Item::RemoveFromUpdateQueueOf - Owner's guid (%u) and player's guid (%u) don't match!", GUID_LOPART(GetOwnerGUID()), player->GetGUIDLow()); return; } @@ -746,7 +767,6 @@ bool Item::CanBeTraded(bool mail, bool trade) const return true; } - bool Item::HasEnchantRequiredSkill(const Player *pPlayer) const { @@ -760,7 +780,6 @@ bool Item::HasEnchantRequiredSkill(const Player *pPlayer) const return true; } - uint32 Item::GetEnchantRequiredLevel() const { diff --git a/src/server/game/Entities/Item/Item.h b/src/server/game/Entities/Item/Item.h index 3696916eba5f0..df0769db710b8 100755 --- a/src/server/game/Entities/Item/Item.h +++ b/src/server/game/Entities/Item/Item.h @@ -246,13 +246,19 @@ class Item : public Object bool IsBoundByEnchant() const; virtual void SaveToDB(SQLTransaction& trans); virtual bool LoadFromDB(uint32 guid, uint64 owner_guid, Field* fields, uint32 entry); + static void DeleteFromDB(SQLTransaction& trans, uint32 itemGuid); virtual void DeleteFromDB(SQLTransaction& trans); + static void DeleteFromInventoryDB(SQLTransaction& trans, uint32 itemGuid); void DeleteFromInventoryDB(SQLTransaction& trans); void SaveRefundDataToDB(); void DeleteRefundDataFromDB(); + Bag* ToBag() { if (IsBag()) return reinterpret_cast(this); else return NULL; } + const Bag* ToBag() const { if (IsBag()) return reinterpret_cast(this); else return NULL; } + bool IsLocked() const { return !HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_UNLOCKED); } bool IsBag() const { return GetProto()->InventoryType == INVTYPE_BAG; } + bool IsNotEmptyBag() const; bool IsBroken() const { return GetUInt32Value(ITEM_FIELD_MAXDURABILITY) > 0 && GetUInt32Value(ITEM_FIELD_DURABILITY) == 0; } bool CanBeTraded(bool mail = false, bool trade = false) const; void SetInTrade(bool b = true) { mb_in_trade = b; } diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index 51aaa55aafe71..9e78c4e8727f0 100755 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -1279,6 +1279,16 @@ void WorldObject::_Create(uint32 guidlow, HighGuid guidhigh, uint32 phaseMask) m_phaseMask = phaseMask; } +float WorldObject::GetObjectSize() const +{ + if (GetTypeId() == TYPEID_UNIT) + { + if (this->ToCreature()->isHunterPet()) + return DEFAULT_WORLD_OBJECT_SIZE; + } + return (m_valuesCount > UNIT_FIELD_COMBATREACH) ? m_floatValues[UNIT_FIELD_COMBATREACH] : DEFAULT_WORLD_OBJECT_SIZE; +} + uint32 WorldObject::GetZoneId() const { return GetBaseMap()->GetZoneId(m_positionX, m_positionY, m_positionZ); @@ -1728,6 +1738,19 @@ bool WorldObject::canSeeOrDetect(WorldObject const* obj, bool ignoreStealth, boo return false; } + // Traps can only be detected within melee distance + if (const GameObject *thisGO = obj->ToGameObject()) + { + if (thisGO->GetGoType() == GAMEOBJECT_TYPE_TRAP && thisGO->GetOwnerGUID() && ToPlayer()) + { + if (thisGO->GetOwner() == ToPlayer() || + obj->IsWithinDist(this, ToPlayer()->HasAura(2836) ? 20.0f : 4.0f, false)) // Detect Traps increases chance to detect traps + return true; + + return false; + } + } + if (!obj->isVisibleForInState(this)) return false; diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h index 12ef8d93f25dd..03194a01387d2 100755 --- a/src/server/game/Entities/Object/Object.h +++ b/src/server/game/Entities/Object/Object.h @@ -626,10 +626,7 @@ class WorldObject : public Object, public WorldLocation GetNearPoint(obj,x,y,z,obj->GetObjectSize(),distance2d,GetAngle(obj)); } - float GetObjectSize() const - { - return (m_valuesCount > UNIT_FIELD_COMBATREACH) ? m_floatValues[UNIT_FIELD_COMBATREACH] : DEFAULT_WORLD_OBJECT_SIZE; - } + float GetObjectSize() const; void UpdateGroundPositionZ(float x, float y, float &z) const; void GetRandomPoint(const Position &srcPos, float distance, float &rand_x, float &rand_y, float &rand_z) const; diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp index 462023209ac1c..871c06c565bdf 100755 --- a/src/server/game/Entities/Pet/Pet.cpp +++ b/src/server/game/Entities/Pet/Pet.cpp @@ -308,7 +308,7 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petentry, uint32 petnumber, bool c CleanupActionBar(); // remove unknown spells from action bar after load - sLog->outDebug("New Pet has guid %u", GetGUIDLow()); + sLog->outDebug(LOG_FILTER_PETS, "New Pet has guid %u", GetGUIDLow()); owner->PetSpellInitialize(); @@ -786,7 +786,7 @@ bool Pet::CreateBaseAtCreatureInfo(CreatureInfo const* cinfo, Unit * owner) bool Pet::CreateBaseAtTamed(CreatureInfo const * cinfo, Map * map, uint32 phaseMask) { - sLog->outDebug("Pet::CreateBaseForTamed"); + sLog->outDebug(LOG_FILTER_PETS, "Pet::CreateBaseForTamed"); uint32 guid=sObjectMgr->GenerateLowGuid(HIGHGUID_PET); uint32 pet_number = sObjectMgr->GeneratePetNumber(); if (!Create(guid, map, phaseMask, cinfo->Entry, pet_number)) @@ -853,25 +853,11 @@ bool Guardian::InitStatsForLevel(uint8 petlevel) { float scale; if (getLevel() >= cFamily->maxScaleLevel) - scale = cFamily->maxScale; + scale = 1.0f; else if (getLevel() <= cFamily->minScaleLevel) - scale = cFamily->minScale; + scale = 0.5f; else - scale = cFamily->minScale + float(getLevel() - cFamily->minScaleLevel) / cFamily->maxScaleLevel * (cFamily->maxScale - cFamily->minScale); - - // some creatures have 3x scale - switch (cinfo->family) - { - case CREATURE_FAMILY_CHIMAERA: - case CREATURE_FAMILY_SPIDER: - case CREATURE_FAMILY_DEVILSAUR: - case CREATURE_FAMILY_CORE_HOUND: - case CREATURE_FAMILY_RHINO: - scale *= 3.0f; - break; - default: - break; - } + scale = 0.4f + float(getLevel() / 100.0f); SetFloatValue(OBJECT_FIELD_SCALE_X, scale); } @@ -907,8 +893,9 @@ bool Guardian::InitStatsForLevel(uint8 petlevel) else // not exist in DB, use some default fake data { // remove elite bonuses included in DB values - //SetCreateHealth(uint32(((float(cinfo->maxhealth) / cinfo->maxlevel) / (1 + 2 * cinfo->rank)) * petlevel)); - //SetCreateMana(uint32(((float(cinfo->maxmana) / cinfo->maxlevel) / (1 + 2 * cinfo->rank)) * petlevel)); + CreatureBaseStats const* stats = sObjectMgr->GetCreatureBaseStats(petlevel, cinfo->unit_class); + SetCreateHealth(stats->BaseHealth[cinfo->expansion]); + SetCreateMana(stats->BaseMana); SetCreateStat(STAT_STRENGTH, 22); SetCreateStat(STAT_AGILITY, 22); @@ -1044,11 +1031,41 @@ bool Guardian::InitStatsForLevel(uint8 petlevel) SetCreateMana(28 + 10*petlevel); SetCreateHealth(28 + 30*petlevel); } - SetBonusDamage(int32(m_owner->GetTotalAttackPowerValue(BASE_ATTACK) * 0.5f)); + // Impurity + float impurityMod = 1.0f; + if (Player * p_owner = m_owner->ToPlayer()) + { + PlayerSpellMap playerSpells = p_owner->GetSpellMap(); + for (PlayerSpellMap::const_iterator itr = playerSpells.begin(); itr != playerSpells.end(); ++itr) + { + if (itr->second->state == PLAYERSPELL_REMOVED || itr->second->disabled) + continue; + switch (itr->first) + { + case 49220: + case 49633: + case 49635: + case 49636: + case 49638: + { + if (const SpellEntry *proto=sSpellStore.LookupEntry(itr->first)) + AddFlatPctN(impurityMod, impurityMod, SpellMgr::CalculateSpellEffectAmount(proto, 0)); + } + break; + } + } + } + SetBonusDamage(int32(m_owner->GetTotalAttackPowerValue(BASE_ATTACK) * 0.5f * impurityMod)); SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, float(petlevel - (petlevel / 4))); SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, float(petlevel + (petlevel / 4))); break; } + case 28017: // Bloodworms + { + SetCreateHealth(4 * petlevel); + SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, float(petlevel - 30 - (petlevel / 4)) + m_owner->GetTotalAttackPowerValue(BASE_ATTACK) * 0.006f); + SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, float(petlevel - 30 + (petlevel / 4)) + m_owner->GetTotalAttackPowerValue(BASE_ATTACK) * 0.006f); + } } break; } @@ -1132,7 +1149,7 @@ void Pet::_LoadSpellCooldowns() _AddCreatureSpellCooldown(spell_id,db_time); - sLog->outDebug("Pet (Number: %u) spell %u cooldown loaded (%u secs).", m_charmInfo->GetPetNumber(), spell_id, uint32(db_time-curTime)); + sLog->outDebug(LOG_FILTER_PETS, "Pet (Number: %u) spell %u cooldown loaded (%u secs).", m_charmInfo->GetPetNumber(), spell_id, uint32(db_time-curTime)); } while (result->NextRow()); @@ -1208,7 +1225,7 @@ void Pet::_SaveSpells(SQLTransaction& trans) void Pet::_LoadAuras(uint32 timediff) { - sLog->outDebug("Loading auras for pet %u",GetGUIDLow()); + sLog->outDebug(LOG_FILTER_PETS, "Loading auras for pet %u",GetGUIDLow()); QueryResult result = CharacterDatabase.PQuery("SELECT caster_guid,spell,effect_mask,recalculate_mask,stackcount,amount0,amount1,amount2,base_amount0,base_amount1,base_amount2,maxduration,remaintime,remaincharges FROM pet_aura WHERE guid = '%u'",m_charmInfo->GetPetNumber()); diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index e6c302045edcc..e1fe11d621b68 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -382,6 +382,229 @@ void TradeData::SetAccepted(bool state, bool crosssend /*= false*/) } } +// == KillRewarder ==================================================== +// KillRewarder incapsulates logic of rewarding player upon kill with: +// * XP; +// * honor; +// * reputation; +// * kill credit (for quest objectives). +// Rewarding is initiated in two cases: when player kills unit in Unit::Kill() +// and on battlegrounds in Battleground::RewardXPAtKill(). +// +// Rewarding algorithm is: +// 1. Initialize internal variables to default values. +// 2. In case when player is in group, initialize variables necessary for group calculations: +// 2.1. _count - number of alive group members within reward distance; +// 2.2. _sumLevel - sum of levels of alive group members within reward distance; +// 2.3. _maxLevel - maximum level of alive group member within reward distance; +// 2.4. _maxNotGrayMember - maximum level of alive group member within reward distance, +// for whom victim is not gray; +// 2.5. _isFullXP - flag identifying that for all group members victim is not gray, +// so 100% XP will be rewarded (50% otherwise). +// 3. Reward killer (and group, if necessary). +// 3.1. If killer is in group, reward group. +// 3.1.1. Initialize initial XP amount based on maximum level of group member, +// for whom victim is not gray. +// 3.1.2. Alter group rate if group is in raid (not for battlegrounds). +// 3.1.3. Reward each group member (even dead) within reward distance (see 4. for more details). +// 3.2. Reward single killer (not group case). +// 3.2.1. Initialize initial XP amount based on killer's level. +// 3.2.2. Reward killer (see 4. for more details). +// 4. Reward player. +// 4.1. Give honor (player must be alive and not on BG). +// 4.2. Give XP. +// 4.2.1. If player is in group, adjust XP: +// * set to 0 if player's level is more than maximum level of not gray member; +// * cut XP in half if _isFullXP is false. +// 4.2.2. Apply auras modifying rewarded XP. +// 4.2.3. Give XP to player. +// 4.2.4. If player has pet, reward pet with XP (100% for single player, 50% for group case). +// 4.3. Give reputation (player must not be on BG). +// 4.4. Give kill credit (player must not be in group, or he must be alive or without corpse). +// 5. Credit instance encounter. +KillRewarder::KillRewarder(Player* killer, Unit* victim, bool isBattleGround) : + // 1. Initialize internal variables to default values. + _killer(killer), _victim(victim), _isBattleGround(isBattleGround), + _isPvP(victim->isCharmedOwnedByPlayerOrPlayer()), _group(killer->GetGroup()), _groupRate(1.0f), + _maxLevel(0), _maxNotGrayMember(NULL), _count(0), _sumLevel(0), _isFullXP(false), _xp(0) +{ + _InitGroupData(); +} + +inline void KillRewarder::_InitGroupData() +{ + if (_group) + { + // 2. In case when player is in group, initialize variables necessary for group calculations: + for (GroupReference *itr = _group->GetFirstMember(); itr != NULL; itr = itr->next()) + if (Player* member = itr->getSource()) + if (member->isAlive() && member->IsAtGroupRewardDistance(_victim)) + { + const uint8 lvl = member->getLevel(); + // 2.1. _count - number of alive group members within reward distance; + ++_count; + // 2.2. _sumLevel - sum of levels of alive group members within reward distance; + _sumLevel += lvl; + // 2.3. _maxLevel - maximum level of alive group member within reward distance; + if (_maxLevel < lvl) + _maxLevel = lvl; + // 2.4. _maxNotGrayMember - maximum level of alive group member within reward distance, + // for whom victim is not gray; + uint32 grayLevel = Trinity::XP::GetGrayLevel(lvl); + if (_victim->getLevel() > grayLevel && (!_maxNotGrayMember || _maxNotGrayMember->getLevel() < lvl)) + _maxNotGrayMember = member; + } + // 2.5. _isFullXP - flag identifying that for all group members victim is not gray, + // so 100% XP will be rewarded (50% otherwise). + _isFullXP = _maxNotGrayMember && (_maxLevel == _maxNotGrayMember->getLevel()); + } + else + _count = 1; +} + +inline void KillRewarder::_InitXP(Player* player) +{ + // Get initial value of XP for kill. + // XP is given: + // * on battlegrounds; + // * otherwise, not in PvP; + // * not if killer is on vehicle. + if (_isBattleGround || !_isPvP || !_killer->GetVehicle()) + _xp = Trinity::XP::Gain(player, _victim); +} + +inline void KillRewarder::_RewardHonor(Player* player) +{ + // Rewarded player must be alive. + if (player->isAlive()) + player->RewardHonor(_victim, _count, -1, true); +} + +inline void KillRewarder::_RewardXP(Player* player, float rate) +{ + uint32 xp(_xp); + if (_group) + // 4.2.1. If player is in group, adjust XP: + // * set to 0 if player's level is more than maximum level of not gray member; + // * cut XP in half if _isFullXP is false. + if (_maxNotGrayMember && player->isAlive() && + _maxNotGrayMember->getLevel() >= player->getLevel()) + xp = _isFullXP ? + uint32(xp * rate) : // Reward FULL XP if all group members are not gray. + uint32(xp * rate / 2) + 1; // Reward only HALF of XP if some of group members are gray. + else + xp = 0; + if (xp) + { + // 4.2.2. Apply auras modifying rewarded XP (SPELL_AURA_MOD_XP_PCT). + Unit::AuraEffectList const& auras = player->GetAuraEffectsByType(SPELL_AURA_MOD_XP_PCT); + for (Unit::AuraEffectList::const_iterator i = auras.begin(); i != auras.end(); ++i) + AddPctN(xp, (*i)->GetAmount()); + + // 4.2.3. Give XP to player. + player->GiveXP(xp, _victim, _groupRate); + if (Pet* pet = player->GetPet()) + // 4.2.4. If player has pet, reward pet with XP (100% for single player, 50% for group case). + pet->GivePetXP(_group ? xp / 2 : xp); + } +} + +inline void KillRewarder::_RewardReputation(Player* player, float rate) +{ + // 4.3. Give reputation (player must not be on BG). + // Even dead players and corpses are rewarded. + player->RewardReputation(_victim, rate); +} + +inline void KillRewarder::_RewardKillCredit(Player* player) +{ + // 4.4. Give kill credit (player must not be in group, or he must be alive or without corpse). + if (!_group || player->isAlive() || !player->GetCorpse()) + if (_victim->GetTypeId() == TYPEID_UNIT) + player->KilledMonster(_victim->ToCreature()->GetCreatureInfo(), _victim->GetGUID()); +} + +void KillRewarder::_RewardPlayer(Player* player, bool isDungeon) +{ + // 4. Reward player. + if (!_isBattleGround) + // 4.1. Give honor (player must be alive and not on BG). + _RewardHonor(player); + // Give XP only in PvE or in battlegrounds. + // Give reputation and kill credit only in PvE. + if (!_isPvP || _isBattleGround) + { + const float rate = _group ? + _groupRate * float(player->getLevel()) / _sumLevel : // Group rate depends on summary level. + 1.0f; // Personal rate is 100%. + if (_xp) + // 4.2. Give XP. + _RewardXP(player, rate); + if (!_isBattleGround) + { + // If killer is in dungeon then all members receive full reputation at kill. + _RewardReputation(player, isDungeon ? 1.0f : rate); + _RewardKillCredit(player); + } + } +} + +void KillRewarder::_RewardGroup() +{ + if (_maxLevel) + { + if (_maxNotGrayMember) + // 3.1.1. Initialize initial XP amount based on maximum level of group member, + // for whom victim is not gray. + _InitXP(_maxNotGrayMember); + // To avoid unnecessary calculations and calls, + // proceed only if XP is not ZERO or player is not on battleground + // (battleground rewards only XP, that's why). + if (!_isBattleGround || _xp) + { + const bool isDungeon = !_isPvP && sMapStore.LookupEntry(_killer->GetMapId())->IsDungeon(); + if (!_isBattleGround) + { + // 3.1.2. Alter group rate if group is in raid (not for battlegrounds). + const bool isRaid = !_isPvP && sMapStore.LookupEntry(_killer->GetMapId())->IsRaid() && _group->isRaidGroup(); + _groupRate = Trinity::XP::xp_in_group_rate(_count, isRaid); + } + + // 3.1.3. Reward each group member (even dead or corpse) within reward distance. + for (GroupReference *itr = _group->GetFirstMember(); itr != NULL; itr = itr->next()) + if (Player* member = itr->getSource()) + if (member->IsAtGroupRewardDistance(_victim)) + _RewardPlayer(member, isDungeon); + } + } +} + +void KillRewarder::Reward() +{ + // 3. Reward killer (and group, if necessary). + if (_group) + // 3.1. If killer is in group, reward group. + _RewardGroup(); + else + { + // 3.2. Reward single killer (not group case). + // 3.2.1. Initialize initial XP amount based on killer's level. + _InitXP(_killer); + // To avoid unnecessary calculations and calls, + // proceed only if XP is not ZERO or player is not on battleground + // (battleground rewards only XP, that's why). + if (!_isBattleGround || _xp) + // 3.2.2. Reward killer. + _RewardPlayer(_killer, false); + } + + // 5. Credit instance encounter. + if (Creature* victim = _victim->ToCreature()) + if (victim->IsDungeonBoss()) + if (InstanceScript* instance = _victim->GetInstanceScript()) + instance->UpdateEncounterState(ENCOUNTER_CREDIT_KILL_CREATURE, _victim->GetEntry(), _victim); +} + // == Player ==================================================== UpdateMask Player::updateVisualBits; @@ -597,11 +820,6 @@ Player::Player (WorldSession *session): Unit(), m_achievementMgr(this), m_reputa m_summon_y = 0.0f; m_summon_z = 0.0f; - //Default movement to run mode - //m_unit_movement_flags = 0; - - m_AreaID = 0; - m_mover = this; m_movedPlayer = this; m_seer = this; @@ -962,7 +1180,7 @@ bool Player::Create(uint32 guidlow, const std::string& name, uint8 race, uint8 c bool Player::StoreNewItemInBestSlots(uint32 titem_id, uint32 titem_amount) { - sLog->outDebug("STORAGE: Creating initial item, itemId = %u, count = %u",titem_id, titem_amount); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: Creating initial item, itemId = %u, count = %u",titem_id, titem_amount); // attempt equip by one while (titem_amount > 0) @@ -1526,7 +1744,9 @@ void Player::Update(uint32 p_time) { if (_pendingBindTimer <= p_time) { - BindToInstance(); + // Player left the instance + if (_pendingBind->GetInstanceId() == GetInstanceId()) + BindToInstance(); SetPendingBind(NULL, 0); } else @@ -1869,13 +2089,14 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati if (!MapManager::IsValidMapCoord(mapid, x, y, z, orientation)) { - sLog->outError("TeleportTo: invalid map %d or absent instance template.", mapid); + sLog->outError("TeleportTo: invalid map (%d) or invalid coordinates (X: %f, Y: %f, Z: %f, O: %f) given when teleporting player (GUID: %u, name: %s, map: %d, X: %f, Y: %f, Z: %f, O: %f).", + mapid, x, y, z, orientation, GetGUIDLow(), GetName(), GetMapId(), GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation()); return false; } if ((GetSession()->GetSecurity() < SEC_GAMEMASTER) && sDisableMgr->IsDisabledFor(DISABLE_TYPE_MAP, mapid, this)) { - sLog->outError("Player %s tried to enter a forbidden map %u", GetName(), mapid); + sLog->outError("Player (GUID: %u, name: %s) tried to enter a forbidden map %u", GetGUIDLow(), GetName(), mapid); SendTransferAborted(mapid, TRANSFER_ABORT_MAP_NOT_ALLOWED); return false; } @@ -1893,7 +2114,7 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati // client without expansion support if (GetSession()->Expansion() < mEntry->Expansion()) { - sLog->outDebug("Player %s using client without required expansion tried teleport to non accessible map %u", GetName(), mapid); + sLog->outDebug(LOG_FILTER_MAPS, "Player %s using client without required expansion tried teleport to non accessible map %u", GetName(), mapid); if (GetTransport()) { @@ -1910,7 +2131,7 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati return false; // normal client can't teleport to this map... } else - sLog->outDebug("Player %s is being teleported to map %u", GetName(), mapid); + sLog->outDebug(LOG_FILTER_MAPS, "Player %s is being teleported to map %u", GetName(), mapid); // reset movement flags at teleport, because player will continue move with these flags after teleport SetUnitMovementFlags(0); @@ -2057,22 +2278,12 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati if (!GetSession()->PlayerLogout()) { // send transfer packets - WorldPacket data(SMSG_TRANSFER_PENDING, (4+4+4)); + WorldPacket data(SMSG_TRANSFER_PENDING, 4 + 4 + 4); data << uint32(mapid); if (m_transport) - { data << m_transport->GetEntry() << GetMapId(); - } - GetSession()->SendPacket(&data); - - data.Initialize(SMSG_NEW_WORLD, (20)); - if (m_transport) - data << (uint32)mapid << m_movementInfo.t_pos.PositionXYZOStream(); - else - data << (uint32)mapid << (float)x << (float)y << (float)z << (float)orientation; GetSession()->SendPacket(&data); - SendSavedInstances(); } // remove from old map now @@ -2098,6 +2309,19 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati // if the player is saved before worldportack (at logout for example) // this will be used instead of the current location in SaveToDB + if (!GetSession()->PlayerLogout()) + { + WorldPacket data(SMSG_NEW_WORLD, 4 + 4 + 4 + 4 + 4); + data << uint32(mapid); + if (m_transport) + data << m_movementInfo.t_pos.PositionXYZOStream(); + else + data << m_teleport_dest.PositionXYZOStream(); + + GetSession()->SendPacket(&data); + SendSavedInstances(); + } + // move packet sent by client always after far teleport // code for finish transfer to new map called in WorldSession::HandleMoveWorldportAckOpcode at client packet SetSemaphoreTeleportFar(true); @@ -2521,7 +2745,7 @@ GameObject* Player::GetGameObjectIfCanInteractWith(uint64 guid, GameobjectTypes if (go->IsWithinDistInMap(this, maxdist)) return go; - sLog->outDebug("IsGameObjectOfTypeInRange: GameObject '%s' [GUID: %u] is too far away from player %s [GUID: %u] to be used by him (distance=%f, maximal 10 is allowed)", go->GetGOInfo()->name, + sLog->outDebug(LOG_FILTER_MAPS, "IsGameObjectOfTypeInRange: GameObject '%s' [GUID: %u] is too far away from player %s [GUID: %u] to be used by him (distance=%f, maximal 10 is allowed)", go->GetGOInfo()->name, go->GetGUIDLow(), GetName(), GetGUIDLow(), go->GetDistance(this)); } } @@ -2572,7 +2796,7 @@ void Player::SetGameMaster(bool on) getHostileRefManager().setOnlineOfflineState(false); CombatStopWithPets(); - SetPhaseMask(PHASEMASK_ANYWHERE, false); // see and visible in all phases + SetPhaseMask(uint32(PHASEMASK_ANYWHERE), false); // see and visible in all phases m_serverSideVisibilityDetect.SetValue(SERVERSIDE_VISIBILITY_GM, GetSession()->GetSecurity()); } else @@ -2664,12 +2888,12 @@ void Player::UninviteFromGroup() if (group->IsCreated()) { group->Disband(true); - sObjectMgr->RemoveGroup(group); } else + { group->RemoveAllInvites(); - - delete group; + delete group; + } } } @@ -2677,14 +2901,8 @@ void Player::RemoveFromGroup(Group* group, uint64 guid, RemoveMethod method /* = { if (group) { - if (group->RemoveMember(guid, method, kicker, reason) <= 1) - { - // group->Disband(); already disbanded in RemoveMember - sObjectMgr->RemoveGroup(group); - delete group; - group = NULL; - // removemember sets the player's group pointer to NULL - } + group->RemoveMember(guid, method, kicker, reason); + group = NULL; } } @@ -2776,10 +2994,10 @@ void Player::GiveLevel(uint8 level) sScriptMgr->OnPlayerLevelChanged(this, level); PlayerLevelInfo info; - sObjectMgr->GetPlayerLevelInfo(getRace(),getClass(),level,&info); + sObjectMgr->GetPlayerLevelInfo(getRace(), getClass(), level, &info); PlayerClassLevelInfo classInfo; - sObjectMgr->GetPlayerClassLevelInfo(getClass(),level,&classInfo); + sObjectMgr->GetPlayerClassLevelInfo(getClass(), level, &classInfo); // send levelup info to client WorldPacket data(SMSG_LEVELUP_INFO, (4+4+MAX_POWERS*4+MAX_STATS*4)); @@ -3017,10 +3235,11 @@ void Player::InitStatsForLevel(bool reapplyMods) // cleanup unit flags (will be re-applied if need at aura load). RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_NOT_ATTACKABLE_1 | + UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_PASSIVE | UNIT_FLAG_LOOTING | UNIT_FLAG_PET_IN_COMBAT | UNIT_FLAG_SILENCED | UNIT_FLAG_PACIFIED | UNIT_FLAG_STUNNED | UNIT_FLAG_IN_COMBAT | UNIT_FLAG_DISARMED | UNIT_FLAG_CONFUSED | UNIT_FLAG_FLEEING | UNIT_FLAG_NOT_SELECTABLE | - UNIT_FLAG_SKINNABLE | UNIT_FLAG_MOUNT | UNIT_FLAG_TAXI_FLIGHT); + UNIT_FLAG_SKINNABLE | UNIT_FLAG_MOUNT | UNIT_FLAG_TAXI_FLIGHT ); SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE); // must be set SetFlag(UNIT_FIELD_FLAGS_2,UNIT_FLAG2_REGENERATE_POWER);// must be set @@ -4045,7 +4264,7 @@ void Player::_LoadSpellCooldowns(PreparedQueryResult result) AddSpellCooldown(spell_id, item_id, db_time); - sLog->outDebug("Player (GUID: %u) spell %u, item %u cooldown loaded (%u secs).", GetGUIDLow(), spell_id, item_id, uint32(db_time-curTime)); + sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Player (GUID: %u) spell %u, item %u cooldown loaded (%u secs).", GetGUIDLow(), spell_id, item_id, uint32(db_time-curTime)); } while (result->NextRow()); } @@ -4534,7 +4753,7 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC // the player was uninvited already on logout so just remove from group QueryResult resultGroup = CharacterDatabase.PQuery("SELECT guid FROM group_member WHERE memberGuid=%u", guid); if (resultGroup) - if (Group* group = sObjectMgr->GetGroupByGUID((*resultGroup)[0].GetUInt32())) + if (Group* group = sObjectMgr->GetGroupByStorageId((*resultGroup)[0].GetUInt32())) RemoveFromGroup(group, playerguid); // Remove signs from petitions (also remove petitions if owner); @@ -4653,7 +4872,9 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC } trans->PAppend("DELETE FROM characters WHERE guid = '%u'",guid); - trans->PAppend("DELETE FROM character_account_data WHERE guid = '%u'",guid); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PLAYER_ACCOUNT_DATA); + stmt->setUInt32(0, guid); + trans->Append(stmt); trans->PAppend("DELETE FROM character_declinedname WHERE guid = '%u'",guid); trans->PAppend("DELETE FROM character_action WHERE guid = '%u'",guid); trans->PAppend("DELETE FROM character_aura WHERE guid = '%u'",guid); @@ -5048,7 +5269,7 @@ void Player::DurabilityLossAll(double percent, bool inventory) //for (int i = KEYRING_SLOT_START; i < KEYRING_SLOT_END; i++) for (uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++) - if (Bag* pBag = (Bag*)GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (Bag* pBag = GetBagByPos(i)) for (uint32 j = 0; j < pBag->GetBagSize(); j++) if (Item* pItem = GetItemByPos(i, j)) DurabilityLoss(pItem,percent); @@ -5307,7 +5528,7 @@ void Player::CleanupChannels() cMgr->LeftChannel(ch->GetName()); // deleted channel if empty } - sLog->outDebug("Player: channels cleaned up!"); + sLog->outDebug(LOG_FILTER_CHATSYS, "Player: channels cleaned up!"); } void Player::UpdateLocalChannels(uint32 newZone) @@ -5839,7 +6060,7 @@ inline int SkillGainChance(uint32 SkillValue, uint32 GrayLevel, uint32 GreenLeve bool Player::UpdateCraftSkill(uint32 spellid) { - sLog->outDebug("UpdateCraftSkill spellid %d", spellid); + sLog->outDebug(LOG_FILTER_PLAYER_SKILLS, "UpdateCraftSkill spellid %d", spellid); SkillLineAbilityMapBounds bounds = sSpellMgr->GetSkillLineAbilityMapBounds(spellid); @@ -5871,7 +6092,7 @@ bool Player::UpdateCraftSkill(uint32 spellid) bool Player::UpdateGatherSkill(uint32 SkillId, uint32 SkillValue, uint32 RedLevel, uint32 Multiplicator) { - sLog->outDebug("UpdateGatherSkill(SkillId %d SkillLevel %d RedLevel %d)", SkillId, SkillValue, RedLevel); + sLog->outDebug(LOG_FILTER_PLAYER_SKILLS, "UpdateGatherSkill(SkillId %d SkillLevel %d RedLevel %d)", SkillId, SkillValue, RedLevel); uint32 gathering_skill_gain = sWorld->getIntConfig(CONFIG_SKILL_GAIN_GATHERING); @@ -5899,7 +6120,7 @@ bool Player::UpdateGatherSkill(uint32 SkillId, uint32 SkillValue, uint32 RedLeve bool Player::UpdateFishingSkill() { - sLog->outDebug("UpdateFishingSkill"); + sLog->outDebug(LOG_FILTER_PLAYER_SKILLS, "UpdateFishingSkill"); uint32 SkillValue = GetPureSkillValue(SKILL_FISHING); @@ -5917,13 +6138,13 @@ static uint32 bonusSkillLevels[] = {75,150,225,300,375,450}; bool Player::UpdateSkillPro(uint16 SkillId, int32 Chance, uint32 step) { - sLog->outDebug("UpdateSkillPro(SkillId %d, Chance %3.1f%%)", SkillId, Chance/10.0); + sLog->outDebug(LOG_FILTER_PLAYER_SKILLS, "UpdateSkillPro(SkillId %d, Chance %3.1f%%)", SkillId, Chance/10.0); if (!SkillId) return false; if (Chance <= 0) // speedup in 0 chance case { - sLog->outDebug("Player::UpdateSkillPro Chance=%3.1f%% missed", Chance/10.0); + sLog->outDebug(LOG_FILTER_PLAYER_SKILLS, "Player::UpdateSkillPro Chance=%3.1f%% missed", Chance/10.0); return false; } @@ -5961,11 +6182,11 @@ bool Player::UpdateSkillPro(uint16 SkillId, int32 Chance, uint32 step) } UpdateSkillEnchantments(SkillId, SkillValue, new_value); GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL,SkillId); - sLog->outDebug("Player::UpdateSkillPro Chance=%3.1f%% taken", Chance/10.0); + sLog->outDebug(LOG_FILTER_PLAYER_SKILLS, "Player::UpdateSkillPro Chance=%3.1f%% taken", Chance/10.0); return true; } - sLog->outDebug("Player::UpdateSkillPro Chance=%3.1f%% missed", Chance/10.0); + sLog->outDebug(LOG_FILTER_PLAYER_SKILLS, "Player::UpdateSkillPro Chance=%3.1f%% missed", Chance/10.0); return false; } @@ -6562,11 +6783,6 @@ void Player::CheckAreaExploreAndOutdoor() if (isInFlight()) return; - if (!m_AreaID) - m_AreaID = GetAreaId(); - if (m_AreaID != GetAreaId()) - m_AreaID = GetAreaId(); - bool isOutdoor; uint16 areaFlag = GetBaseMap()->GetAreaFlag(GetPositionX(),GetPositionY(),GetPositionZ(), &isOutdoor); @@ -6637,39 +6853,27 @@ void Player::CheckAreaExploreAndOutdoor() uint32 Player::TeamForRace(uint8 race) { - ChrRacesEntry const* rEntry = sChrRacesStore.LookupEntry(race); - if (!rEntry) + if (ChrRacesEntry const* rEntry = sChrRacesStore.LookupEntry(race)) { - sLog->outError("Race %u not found in DBC: wrong DBC files?",uint32(race)); - return ALLIANCE; - } - - switch(rEntry->TeamID) - { - case 7: return ALLIANCE; - case 1: return HORDE; + switch (rEntry->TeamID) + { + case 1: return HORDE; + case 7: return ALLIANCE; + } + sLog->outError("Race (%u) has wrong teamid (%u) in DBC: wrong DBC files?", uint32(race), rEntry->TeamID); } + else + sLog->outError("Race (%u) not found in DBC: wrong DBC files?", uint32(race)); - sLog->outError("Race %u have wrong teamid %u in DBC: wrong DBC files?",uint32(race),rEntry->TeamID); return ALLIANCE; } -uint32 Player::getFactionForRace(uint8 race) -{ - ChrRacesEntry const* rEntry = sChrRacesStore.LookupEntry(race); - if (!rEntry) - { - sLog->outError("Race %u not found in DBC: wrong DBC files?",uint32(race)); - return 0; - } - - return rEntry->FactionID; -} - void Player::setFactionForRace(uint8 race) { m_team = TeamForRace(race); - setFaction(getFactionForRace(race)); + + ChrRacesEntry const* rEntry = sChrRacesStore.LookupEntry(race); + setFaction(rEntry ? rEntry->FactionID : 0); } ReputationRank Player::GetReputationRank(uint32 faction) const @@ -7022,30 +7226,38 @@ bool Player::RewardHonor(Unit *uVictim, uint32 groupsize, int32 honor, bool pvpt return true; } +void Player::SetHonorPoints(uint32 value) +{ + if (value > sWorld->getIntConfig(CONFIG_MAX_HONOR_POINTS)) + value = sWorld->getIntConfig(CONFIG_MAX_HONOR_POINTS); + SetUInt32Value(PLAYER_FIELD_HONOR_CURRENCY, value); + if (value) + AddKnownCurrency(ITEM_HONOR_POINTS_ID); +} + +void Player::SetArenaPoints(uint32 value) +{ + if (value > sWorld->getIntConfig(CONFIG_MAX_ARENA_POINTS)) + value = sWorld->getIntConfig(CONFIG_MAX_ARENA_POINTS); + SetUInt32Value(PLAYER_FIELD_ARENA_CURRENCY, value); + if (value) + AddKnownCurrency(ITEM_ARENA_POINTS_ID); +} + void Player::ModifyHonorPoints(int32 value) { - if (value < 0) - { - if (GetHonorPoints() > sWorld->getIntConfig(CONFIG_MAX_HONOR_POINTS)) - SetHonorPoints(sWorld->getIntConfig(CONFIG_MAX_HONOR_POINTS) + value); - else - SetHonorPoints(GetHonorPoints() > uint32(-value) ? GetHonorPoints() + value : 0); - } - else - SetHonorPoints(GetHonorPoints() < sWorld->getIntConfig(CONFIG_MAX_HONOR_POINTS) - value ? GetHonorPoints() + value : sWorld->getIntConfig(CONFIG_MAX_HONOR_POINTS)); + int32 newValue = int32(GetHonorPoints()) + value; + if (newValue < 0) + newValue = 0; + SetHonorPoints(uint32(newValue)); } void Player::ModifyArenaPoints(int32 value) { - if (value < 0) - { - if (GetArenaPoints() > sWorld->getIntConfig(CONFIG_MAX_ARENA_POINTS)) - SetArenaPoints(sWorld->getIntConfig(CONFIG_MAX_ARENA_POINTS) + value); - else - SetArenaPoints(GetArenaPoints() > uint32(-value) ? GetArenaPoints() + value : 0); - } - else - SetArenaPoints(GetArenaPoints() < sWorld->getIntConfig(CONFIG_MAX_ARENA_POINTS) - value ? GetArenaPoints() + value : sWorld->getIntConfig(CONFIG_MAX_ARENA_POINTS)); + int32 newValue = int32(GetArenaPoints()) + value; + if (newValue < 0) + newValue = 0; + SetArenaPoints(uint32(newValue)); } uint32 Player::GetGuildIdFromDB(uint64 guid) @@ -7133,6 +7345,17 @@ void Player::UpdateArea(uint32 newArea) UpdatePvPState(true); UpdateAreaDependentAuras(newArea); + + // previously this was in UpdateZone (but after UpdateArea) so nothing will break + pvpInfo.inNoPvPArea = false; + if (area && area->IsSanctuary()) // in sanctuary + { + SetByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_SANCTUARY); + pvpInfo.inNoPvPArea = true; + CombatStopWithPets(); + } + else + RemoveByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_SANCTUARY); } void Player::UpdateZone(uint32 newZone, uint32 newArea) @@ -7188,16 +7411,6 @@ void Player::UpdateZone(uint32 newZone, uint32 newArea) break; } - pvpInfo.inNoPvPArea = false; - if (zone->IsSanctuary()) // in sanctuary - { - SetByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_SANCTUARY); - pvpInfo.inNoPvPArea = true; - CombatStopWithPets(); - } - else - RemoveByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_SANCTUARY); - if (zone->flags & AREA_FLAG_CAPITAL) // in capital city { if (!pvpInfo.inHostileArea || zone->IsSanctuary()) @@ -7243,7 +7456,7 @@ void Player::UpdateZone(uint32 newZone, uint32 newArea) // group update if (GetGroup()) - SetGroupUpdateFlag(GROUP_UPDATE_FLAG_ZONE); + SetGroupUpdateFlag(GROUP_UPDATE_FULL); UpdateZoneDependentAuras(newZone); } @@ -7294,7 +7507,7 @@ void Player::DuelComplete(DuelCompleteType type) if (!duel) return; - sLog->outDebug("Duel Complete %s %s", GetName(), duel->opponent->GetName()); + sLog->outDebug(LOG_FILTER_UNITS, "Duel Complete %s %s", GetName(), duel->opponent->GetName()); WorldPacket data(SMSG_DUEL_COMPLETE, (1)); data << (uint8)((type != DUEL_INTERUPTED) ? 1 : 0); @@ -7434,7 +7647,7 @@ void Player::_ApplyItemMods(Item *item, uint8 slot,bool apply) ApplyItemEquipSpell(item,apply); ApplyEnchantment(item, apply); - sLog->outDebug("_ApplyItemMods complete."); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "_ApplyItemMods complete."); } void Player::_ApplyItemBonuses(ItemPrototype const *proto, uint8 slot, bool apply, bool only_level_scale /*= false*/) @@ -8077,7 +8290,8 @@ void Player::CastItemCombatSpell(Unit *target, WeaponAttackType attType, uint32 SpellEntry const *spellInfo = sSpellStore.LookupEntry(pEnchant->spellid[s]); if (!spellInfo) { - sLog->outError("Player::CastItemCombatSpell Enchant %i, cast unknown spell %i", pEnchant->ID, pEnchant->spellid[s]); + sLog->outError("Player::CastItemCombatSpell(GUID: %u, name: %s, enchant: %i): unknown spell %i is casted, ignoring...", + GetGUIDLow(), GetName(), pEnchant->ID, pEnchant->spellid[s]); continue; } @@ -8198,7 +8412,7 @@ void Player::CastItemUseSpell(Item *item,SpellCastTargets const& targets,uint8 c void Player::_RemoveAllItemMods() { - sLog->outDebug("_RemoveAllItemMods start."); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "_RemoveAllItemMods start."); for (uint8 i = 0; i < INVENTORY_SLOT_BAG_END; ++i) { @@ -8241,12 +8455,12 @@ void Player::_RemoveAllItemMods() } } - sLog->outDebug("_RemoveAllItemMods complete."); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "_RemoveAllItemMods complete."); } void Player::_ApplyAllItemMods() { - sLog->outDebug("_ApplyAllItemMods start."); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "_ApplyAllItemMods start."); for (uint8 i = 0; i < INVENTORY_SLOT_BAG_END; ++i) { @@ -8290,7 +8504,7 @@ void Player::_ApplyAllItemMods() } } - sLog->outDebug("_ApplyAllItemMods complete."); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "_ApplyAllItemMods complete."); } void Player::_ApplyAllLevelScaleItemMods(bool apply) @@ -8418,10 +8632,10 @@ void Player::SendLoot(uint64 guid, LootType loot_type) Loot *loot = 0; PermissionTypes permission = ALL_PERMISSION; - sLog->outDebug("Player::SendLoot"); + sLog->outDebug(LOG_FILTER_LOOT, "Player::SendLoot"); if (IS_GAMEOBJECT_GUID(guid)) { - sLog->outDebug(" IS_GAMEOBJECT_GUID(guid)"); + sLog->outDebug(LOG_FILTER_LOOT, "IS_GAMEOBJECT_GUID(guid)"); GameObject *go = GetMap()->GetGameObject(guid); // not check distance for GO in case owned GO (fishing bobber case, for example) @@ -8549,8 +8763,8 @@ void Player::SendLoot(uint64 guid, LootType loot_type) loot->FillLoot(item->GetEntry(), LootTemplates_Milling, this,true); break; default: - loot->FillLoot(item->GetEntry(), LootTemplates_Item, this,true); loot->generateMoneyLoot(item->GetProto()->MinMoneyLoot,item->GetProto()->MaxMoneyLoot); + loot->FillLoot(item->GetEntry(), LootTemplates_Item, this, true, loot->gold != 0); break; } } @@ -8752,8 +8966,9 @@ void Player::SendInitWorldStates(uint32 zoneid, uint32 areaid) uint16 NumberOfFields = 0; uint32 mapid = GetMapId(); OutdoorPvP * pvp = sOutdoorPvPMgr->GetOutdoorPvPToZoneId(zoneid); + InstanceScript* instance = GetInstanceScript(); - sLog->outDebug("Sending SMSG_INIT_WORLD_STATES to Map: %u, Zone: %u", mapid, zoneid); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Sending SMSG_INIT_WORLD_STATES to Map: %u, Zone: %u", mapid, zoneid); // may be exist better way to do this... switch (zoneid) @@ -8822,6 +9037,9 @@ void Player::SendInitWorldStates(uint32 zoneid, uint32 areaid) case 4710: NumberOfFields = 28; break; + case 4812: + NumberOfFields = 13; + break; default: NumberOfFields = 12; break; @@ -9340,6 +9558,19 @@ void Player::SendInitWorldStates(uint32 zoneid, uint32 areaid) data << uint32(4345) << uint32(1); // 24 unknown } break; + // Icecrown Citadel + case 4812: + if (instance && mapid == 631) + instance->FillInitialWorldStates(data); + else + { + data << uint32(4903) << uint32(0); // 9 WORLDSTATE_SHOW_TIMER (Blood Quickening weekly) + data << uint32(4904) << uint32(30); // 10 WORLDSTATE_EXECUTION_TIME + data << uint32(4940) << uint32(0); // 11 WORLDSTATE_SHOW_ATTEMPTS + data << uint32(4941) << uint32(50); // 12 WORLDSTATE_ATTEMPTS_REMAINING + data << uint32(4942) << uint32(50); // 13 WORLDSTATE_ATTEMPTS_MAX + } + break; default: data << uint32(0x914) << uint32(0x0); // 7 data << uint32(0x913) << uint32(0x0); // 8 @@ -9469,7 +9700,7 @@ void Player::SetSheath(SheathState sheathed) uint8 Player::FindEquipSlot(ItemPrototype const* proto, uint32 slot, bool swap) const { - uint8 pClass = getClass(); + uint8 playerClass = getClass(); uint8 slots[4]; slots[0] = NULL_SLOT; @@ -9520,7 +9751,7 @@ uint8 Player::FindEquipSlot(ItemPrototype const* proto, uint32 slot, bool swap) slots[1] = EQUIPMENT_SLOT_TRINKET2; break; case INVTYPE_CLOAK: - slots[0] = EQUIPMENT_SLOT_BACK; + slots[0] = EQUIPMENT_SLOT_BACK; break; case INVTYPE_WEAPON: { @@ -9531,7 +9762,7 @@ uint8 Player::FindEquipSlot(ItemPrototype const* proto, uint32 slot, bool swap) if (CanDualWield()) slots[1] = EQUIPMENT_SLOT_OFFHAND; break; - }; + } case INVTYPE_SHIELD: slots[0] = EQUIPMENT_SLOT_OFFHAND; break; @@ -9540,13 +9771,26 @@ uint8 Player::FindEquipSlot(ItemPrototype const* proto, uint32 slot, bool swap) break; case INVTYPE_2HWEAPON: slots[0] = EQUIPMENT_SLOT_MAINHAND; - if (Item *mhWeapon = GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND)) - if (ItemPrototype const *mhWeaponProto = mhWeapon->GetProto()) + if (Item* mhWeapon = GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND)) + { + if (ItemPrototype const* mhWeaponProto = mhWeapon->GetProto()) + { if (mhWeaponProto->SubClass == ITEM_SUBCLASS_WEAPON_POLEARM || mhWeaponProto->SubClass == ITEM_SUBCLASS_WEAPON_STAFF) { - const_cast(this)->AutoUnequipOffhandIfNeed(true); + const_cast(this)->AutoUnequipOffhandIfNeed(true); break; } + } + } + + if (Item* ohWeapon = GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND)) + { + if (proto->SubClass == ITEM_SUBCLASS_WEAPON_POLEARM || proto->SubClass == ITEM_SUBCLASS_WEAPON_STAFF) + { + const_cast(this)->AutoUnequipOffhandIfNeed(true); + break; + } + } if (CanDualWield() && CanTitanGrip() && proto->SubClass != ITEM_SUBCLASS_WEAPON_POLEARM && proto->SubClass != ITEM_SUBCLASS_WEAPON_STAFF) slots[1] = EQUIPMENT_SLOT_OFFHAND; break; @@ -9576,26 +9820,26 @@ uint8 Player::FindEquipSlot(ItemPrototype const* proto, uint32 slot, bool swap) break; case INVTYPE_RELIC: { - switch(proto->SubClass) + switch (proto->SubClass) { case ITEM_SUBCLASS_ARMOR_LIBRAM: - if (pClass == CLASS_PALADIN) + if (playerClass == CLASS_PALADIN) slots[0] = EQUIPMENT_SLOT_RANGED; break; case ITEM_SUBCLASS_ARMOR_IDOL: - if (pClass == CLASS_DRUID) + if (playerClass == CLASS_DRUID) slots[0] = EQUIPMENT_SLOT_RANGED; break; case ITEM_SUBCLASS_ARMOR_TOTEM: - if (pClass == CLASS_SHAMAN) + if (playerClass == CLASS_SHAMAN) slots[0] = EQUIPMENT_SLOT_RANGED; break; case ITEM_SUBCLASS_ARMOR_MISC: - if (pClass == CLASS_WARLOCK) + if (playerClass == CLASS_WARLOCK) slots[0] = EQUIPMENT_SLOT_RANGED; break; case ITEM_SUBCLASS_ARMOR_SIGIL: - if (pClass == CLASS_DEATH_KNIGHT) + if (playerClass == CLASS_DEATH_KNIGHT) slots[0] = EQUIPMENT_SLOT_RANGED; break; } @@ -9671,7 +9915,7 @@ uint8 Player::CanUnequipItems(uint32 item, uint32 count) const } for (uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i) - if (Bag *pBag = (Bag*)GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (Bag *pBag = GetBagByPos(i)) for (uint32 j = 0; j < pBag->GetBagSize(); ++j) if (Item *pItem = GetItemByPos(i, j)) if (pItem->GetEntry() == item) @@ -9699,8 +9943,8 @@ uint32 Player::GetItemCount(uint32 item, bool inBankAlso, Item* skipItem) const count += pItem->GetCount(); for (uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i) - if (Bag* pBag = (Bag*)GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - count += pBag->GetItemCount(item,skipItem); + if (Bag* pBag = GetBagByPos(i)) + count += pBag->GetItemCount(item, skipItem); if (skipItem && skipItem->GetProto()->GemProperties) for (uint8 i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_ITEM_END; ++i) @@ -9716,8 +9960,8 @@ uint32 Player::GetItemCount(uint32 item, bool inBankAlso, Item* skipItem) const count += pItem->GetCount(); for (uint8 i = BANK_SLOT_BAG_START; i < BANK_SLOT_BAG_END; ++i) - if (Bag* pBag = (Bag*)GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - count += pBag->GetItemCount(item,skipItem); + if (Bag* pBag = GetBagByPos(i)) + count += pBag->GetItemCount(item, skipItem); if (skipItem && skipItem->GetProto()->GemProperties) for (uint8 i = BANK_SLOT_ITEM_START; i < BANK_SLOT_ITEM_END; ++i) @@ -9747,7 +9991,7 @@ uint32 Player::GetItemCountWithLimitCategory(uint32 limitCategory, Item* skipIte count += pItem->GetCount(); for (int i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i) - if (Bag* pBag = (Bag*) GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (Bag* pBag = GetBagByPos(i)) count += pBag->GetItemCountWithLimitCategory(limitCategory, skipItem); for (int i = BANK_SLOT_ITEM_START; i < BANK_SLOT_ITEM_END; ++i) @@ -9758,7 +10002,7 @@ uint32 Player::GetItemCountWithLimitCategory(uint32 limitCategory, Item* skipIte count += pItem->GetCount(); for (int i = BANK_SLOT_BAG_START; i < BANK_SLOT_BAG_END; ++i) - if (Bag* pBag = (Bag*) GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (Bag* pBag = GetBagByPos(i)) count += pBag->GetItemCountWithLimitCategory(limitCategory, skipItem); return count; @@ -9776,15 +10020,20 @@ Item* Player::GetItemByGuid(uint64 guid) const if (pItem->GetGUID() == guid) return pItem; + for (int i = BANK_SLOT_ITEM_START; i < BANK_SLOT_ITEM_END; ++i) + if (Item *pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (pItem->GetGUID() == guid) + return pItem; + for (uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i) - if (Bag *pBag = (Bag*)GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (Bag *pBag = GetBagByPos(i)) for (uint32 j = 0; j < pBag->GetBagSize(); ++j) if (Item* pItem = pBag->GetItemByPos(j)) if (pItem->GetGUID() == guid) return pItem; for (uint8 i = BANK_SLOT_BAG_START; i < BANK_SLOT_BAG_END; ++i) - if (Bag *pBag = (Bag*)GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (Bag *pBag = GetBagByPos(i)) for (uint32 j = 0; j < pBag->GetBagSize(); ++j) if (Item* pItem = pBag->GetItemByPos(j)) if (pItem->GetGUID() == guid) @@ -9804,12 +10053,17 @@ Item* Player::GetItemByPos(uint8 bag, uint8 slot) const { if (bag == INVENTORY_SLOT_BAG_0 && (slot < BANK_SLOT_BAG_END || (slot >= KEYRING_SLOT_START && slot < CURRENCYTOKEN_SLOT_END))) return m_items[slot]; - else if ((bag >= INVENTORY_SLOT_BAG_START && bag < INVENTORY_SLOT_BAG_END) + else if (Bag *pBag = GetBagByPos(bag)) + return pBag->GetItemByPos(slot); + return NULL; +} + +Bag* Player::GetBagByPos(uint8 bag) const +{ + if ((bag >= INVENTORY_SLOT_BAG_START && bag < INVENTORY_SLOT_BAG_END) || (bag >= BANK_SLOT_BAG_START && bag < BANK_SLOT_BAG_END)) - { - if (Bag *pBag = (Bag*)GetItemByPos(INVENTORY_SLOT_BAG_0, bag)) - return pBag->GetItemByPos(slot); - } + if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, bag)) + return item->ToBag(); return NULL; } @@ -9955,26 +10209,9 @@ bool Player::IsValidPos(uint8 bag, uint8 slot, bool explicit_pos) } // bag content slots - if (bag >= INVENTORY_SLOT_BAG_START && bag < INVENTORY_SLOT_BAG_END) - { - Bag* pBag = (Bag*)GetItemByPos (INVENTORY_SLOT_BAG_0, bag); - if (!pBag) - return false; - - // any post selected - if (slot == NULL_SLOT && !explicit_pos) - return true; - - return slot < pBag->GetBagSize(); - } - // bank bag content slots - if (bag >= BANK_SLOT_BAG_START && bag < BANK_SLOT_BAG_END) + if (Bag* pBag = GetBagByPos(bag)) { - Bag* pBag = (Bag*)GetItemByPos (INVENTORY_SLOT_BAG_0, bag); - if (!pBag) - return false; - // any post selected if (slot == NULL_SLOT && !explicit_pos) return true; @@ -10011,7 +10248,7 @@ bool Player::HasItemCount(uint32 item, uint32 count, bool inBankAlso) const } for (uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++) { - if (Bag* pBag = (Bag*)GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (Bag* pBag = GetBagByPos(i)) { for (uint32 j = 0; j < pBag->GetBagSize(); j++) { @@ -10040,7 +10277,7 @@ bool Player::HasItemCount(uint32 item, uint32 count, bool inBankAlso) const } for (uint8 i = BANK_SLOT_BAG_START; i < BANK_SLOT_BAG_END; i++) { - if (Bag* pBag = (Bag*)GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (Bag* pBag = GetBagByPos(i)) { for (uint32 j = 0; j < pBag->GetBagSize(); j++) { @@ -10202,7 +10439,7 @@ bool Player::HasItemTotemCategory(uint32 TotemCategory) const } for (uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i) { - if (Bag *pBag = (Bag*)GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (Bag *pBag = GetBagByPos(i)) { for (uint32 j = 0; j < pBag->GetBagSize(); ++j) { @@ -10225,7 +10462,7 @@ uint8 Player::_CanStoreItem_InSpecificSlot(uint8 bag, uint8 slot, ItemPosCountVe uint32 need_space; - if (pSrcItem && pSrcItem->IsBag() && !((Bag*)pSrcItem)->IsEmpty() && !IsBagPos(uint16(bag) << 8 | slot)) + if (pSrcItem && pSrcItem->IsNotEmptyBag() && !IsBagPos(uint16(bag) << 8 | slot)) return EQUIP_ERR_CAN_ONLY_DO_WITH_EMPTY_BAGS; // empty specific slot - check item fit to slot @@ -10247,7 +10484,7 @@ uint8 Player::_CanStoreItem_InSpecificSlot(uint8 bag, uint8 slot, ItemPosCountVe } else { - Bag* pBag = (Bag*)GetItemByPos(INVENTORY_SLOT_BAG_0, bag); + Bag* pBag = GetBagByPos(bag); if (!pBag) return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG; @@ -10296,11 +10533,11 @@ uint8 Player::_CanStoreItem_InBag(uint8 bag, ItemPosCountVec &dest, ItemPrototyp return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG; // skip not existed bag or self targeted bag - Bag* pBag = (Bag*)GetItemByPos(INVENTORY_SLOT_BAG_0, bag); + Bag* pBag = GetBagByPos(bag); if (!pBag || pBag == pSrcItem) return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG; - if (pSrcItem && pSrcItem->IsBag() && !((Bag*)pSrcItem)->IsEmpty()) + if (pSrcItem && pSrcItem->IsNotEmptyBag()) return EQUIP_ERR_CAN_ONLY_DO_WITH_EMPTY_BAGS; ItemPrototype const* pBagProto = pBag->GetProto(); @@ -10362,7 +10599,7 @@ uint8 Player::_CanStoreItem_InBag(uint8 bag, ItemPosCountVec &dest, ItemPrototyp uint8 Player::_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 { //this is never called for non-bag slots so we can do this - if (pSrcItem && pSrcItem->IsBag() && !((Bag*)pSrcItem)->IsEmpty()) + if (pSrcItem && pSrcItem->IsNotEmptyBag()) return EQUIP_ERR_CAN_ONLY_DO_WITH_EMPTY_BAGS; for (uint32 j = slot_begin; j < slot_end; j++) @@ -10412,7 +10649,7 @@ uint8 Player::_CanStoreItem_InInventorySlots(uint8 slot_begin, uint8 slot_end, I uint8 Player::_CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32 entry, uint32 count, Item *pItem, bool swap, uint32* no_space_count) const { - sLog->outDebug("STORAGE: CanStoreItem bag = %u, slot = %u, item = %u, count = %u", bag, slot, entry, count); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanStoreItem bag = %u, slot = %u, item = %u, count = %u", bag, slot, entry, count); ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(entry); if (!pProto) @@ -10797,7 +11034,7 @@ uint8 Player::_CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32 } } - if (pItem && pItem->IsBag() && !((Bag*)pItem)->IsEmpty()) + if (pItem && pItem->IsNotEmptyBag()) return EQUIP_ERR_NONEMPTY_BAG_OVER_OTHER_BAG; // search free slot @@ -10890,7 +11127,7 @@ uint8 Player::CanStoreItems(Item **pItems,int count) const for (uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++) { - if (Bag* pBag = (Bag*)GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (Bag* pBag = GetBagByPos(i)) { for (uint32 j = 0; j < pBag->GetBagSize(); j++) { @@ -10911,7 +11148,7 @@ uint8 Player::CanStoreItems(Item **pItems,int count) const // no item if (!pItem) continue; - sLog->outDebug("STORAGE: CanStoreItems %i. item = %u, count = %u", k+1, pItem->GetEntry(), pItem->GetCount()); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanStoreItems %i. item = %u, count = %u", k+1, pItem->GetEntry(), pItem->GetCount()); ItemPrototype const *pProto = pItem->GetProto(); // strange item @@ -10977,17 +11214,19 @@ uint8 Player::CanStoreItems(Item **pItems,int count) const for (int t = INVENTORY_SLOT_BAG_START; !b_found && t < INVENTORY_SLOT_BAG_END; ++t) { - pBag = (Bag*)GetItemByPos(INVENTORY_SLOT_BAG_0, t); - if (pBag && ItemCanGoIntoBag(pItem->GetProto(), pBag->GetProto())) + if (pBag = GetBagByPos(t)) { - for (uint32 j = 0; j < pBag->GetBagSize(); j++) + if (ItemCanGoIntoBag(pItem->GetProto(), pBag->GetProto())) { - pItem2 = GetItemByPos(t, j); - if( pItem2 && pItem2->CanBeMergedPartlyWith(pProto) == EQUIP_ERR_OK && inv_bags[t-INVENTORY_SLOT_BAG_START][j] + pItem->GetCount() <= pProto->GetMaxStackSize()) + for (uint32 j = 0; j < pBag->GetBagSize(); j++) { - inv_bags[t-INVENTORY_SLOT_BAG_START][j] += pItem->GetCount(); - b_found = true; - break; + pItem2 = GetItemByPos(t, j); + if( pItem2 && pItem2->CanBeMergedPartlyWith(pProto) == EQUIP_ERR_OK && inv_bags[t-INVENTORY_SLOT_BAG_START][j] + pItem->GetCount() <= pProto->GetMaxStackSize()) + { + inv_bags[t-INVENTORY_SLOT_BAG_START][j] += pItem->GetCount(); + b_found = true; + break; + } } } } @@ -11032,8 +11271,7 @@ uint8 Player::CanStoreItems(Item **pItems,int count) const for (int t = INVENTORY_SLOT_BAG_START; !b_found && t < INVENTORY_SLOT_BAG_END; ++t) { - pBag = (Bag*)GetItemByPos(INVENTORY_SLOT_BAG_0, t); - if (pBag) + if (pBag = GetBagByPos(t)) { pBagProto = pBag->GetProto(); @@ -11072,8 +11310,7 @@ uint8 Player::CanStoreItems(Item **pItems,int count) const // search free slot in bags for (int t = INVENTORY_SLOT_BAG_START; !b_found && t < INVENTORY_SLOT_BAG_END; ++t) { - pBag = (Bag*)GetItemByPos(INVENTORY_SLOT_BAG_0, t); - if (pBag) + if (pBag = GetBagByPos(t)) { pBagProto = pBag->GetProto(); @@ -11121,7 +11358,7 @@ uint8 Player::CanEquipItem(uint8 slot, uint16 &dest, Item *pItem, bool swap, boo dest = 0; if (pItem) { - sLog->outDebug("STORAGE: CanEquipItem slot = %u, item = %u, count = %u", slot, pItem->GetEntry(), pItem->GetCount()); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanEquipItem slot = %u, item = %u, count = %u", slot, pItem->GetEntry(), pItem->GetCount()); ItemPrototype const *pProto = pItem->GetProto(); if (pProto) { @@ -11272,7 +11509,7 @@ uint8 Player::CanUnequipItem(uint16 pos, bool swap) const if (!pItem) return EQUIP_ERR_OK; - sLog->outDebug("STORAGE: CanUnequipItem slot = %u, item = %u, count = %u", pos, pItem->GetEntry(), pItem->GetCount()); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanUnequipItem slot = %u, item = %u, count = %u", pos, pItem->GetEntry(), pItem->GetCount()); ItemPrototype const *pProto = pItem->GetProto(); if (!pProto) @@ -11295,7 +11532,7 @@ uint8 Player::CanUnequipItem(uint16 pos, bool swap) const return EQUIP_ERR_NOT_DURING_ARENA_MATCH; } - if (!swap && pItem->IsBag() && !((Bag*)pItem)->IsEmpty()) + if (!swap && pItem->IsNotEmptyBag()) return EQUIP_ERR_CAN_ONLY_DO_WITH_EMPTY_BAGS; return EQUIP_ERR_OK; @@ -11308,7 +11545,7 @@ uint8 Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, Item *pI uint32 count = pItem->GetCount(); - sLog->outDebug("STORAGE: CanBankItem bag = %u, slot = %u, item = %u, count = %u", bag, slot, pItem->GetEntry(), pItem->GetCount()); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanBankItem bag = %u, slot = %u, item = %u, count = %u", bag, slot, pItem->GetEntry(), pItem->GetCount()); ItemPrototype const *pProto = pItem->GetProto(); if (!pProto) return swap ? EQUIP_ERR_ITEMS_CANT_BE_SWAPPED : EQUIP_ERR_ITEM_NOT_FOUND; @@ -11363,12 +11600,8 @@ uint8 Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, Item *pI // in specific bag if (bag != NULL_BAG) { - if (pProto->InventoryType == INVTYPE_BAG) - { - Bag *pBag = (Bag*)pItem; - if (pBag && !pBag->IsEmpty()) - return EQUIP_ERR_NONEMPTY_BAG_OVER_OTHER_BAG; - } + if (pItem->IsNotEmptyBag()) + return EQUIP_ERR_NONEMPTY_BAG_OVER_OTHER_BAG; // search stack in bag for merge to if (pProto->Stackable != 1) @@ -11496,7 +11729,7 @@ uint8 Player::CanUseItem(Item *pItem, bool not_loading) const { if (pItem) { - sLog->outDebug("STORAGE: CanUseItem item = %u", pItem->GetEntry()); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanUseItem item = %u", pItem->GetEntry()); if (!isAlive() && not_loading) return EQUIP_ERR_YOU_ARE_DEAD; @@ -11584,7 +11817,7 @@ uint8 Player::CanUseItem(ItemPrototype const *pProto) const uint8 Player::CanUseAmmo(uint32 item) const { - sLog->outDebug("STORAGE: CanUseAmmo item = %u", item); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanUseAmmo item = %u", item); if (!isAlive()) return EQUIP_ERR_YOU_ARE_DEAD; //if (isStunned()) @@ -11735,7 +11968,7 @@ Item* Player::_StoreItem(uint16 pos, Item *pItem, uint32 count, bool clone, bool uint8 bag = pos >> 8; uint8 slot = pos & 255; - sLog->outDebug("STORAGE: StoreItem bag = %u, slot = %u, item = %u, count = %u, guid = %u", bag, slot, pItem->GetEntry(), count, pItem->GetGUIDLow()); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: StoreItem bag = %u, slot = %u, item = %u, count = %u, guid = %u", bag, slot, pItem->GetEntry(), count, pItem->GetGUIDLow()); Item *pItem2 = GetItemByPos(bag, slot); @@ -11754,7 +11987,8 @@ Item* Player::_StoreItem(uint16 pos, Item *pItem, uint32 count, bool clone, bool (pItem->GetProto()->Bonding == BIND_WHEN_EQUIPED && IsBagPos(pos))) pItem->SetBinding(true); - if (bag == INVENTORY_SLOT_BAG_0) + Bag* pBag = (bag == INVENTORY_SLOT_BAG_0) ? NULL : GetBagByPos(bag); + if (!pBag) { m_items[slot] = pItem; SetUInt64Value(PLAYER_FIELD_INV_SLOT_HEAD + (slot * 2), pItem->GetGUID()); @@ -11767,27 +12001,20 @@ Item* Player::_StoreItem(uint16 pos, Item *pItem, uint32 count, bool clone, bool // need update known currency if (slot >= CURRENCYTOKEN_SLOT_START && slot < CURRENCYTOKEN_SLOT_END) AddKnownCurrency(pItem->GetEntry()); - - if (IsInWorld() && update) - { - pItem->AddToWorld(); - pItem->SendUpdateToPlayer(this); - } - - pItem->SetState(ITEM_CHANGED, this); } - else if (Bag *pBag = (Bag*)GetItemByPos(INVENTORY_SLOT_BAG_0, bag)) - { + else pBag->StoreItem(slot, pItem, update); - if (IsInWorld() && update) - { - pItem->AddToWorld(); - pItem->SendUpdateToPlayer(this); - } - pItem->SetState(ITEM_CHANGED, this); - pBag->SetState(ITEM_CHANGED, this); + + if (IsInWorld() && update) + { + pItem->AddToWorld(); + pItem->SendUpdateToPlayer(this); } + pItem->SetState(ITEM_CHANGED, this); + if (pBag) + pBag->SetState(ITEM_CHANGED, this); + AddEnchantmentDurations(pItem); AddItemDurations(pItem); @@ -12001,7 +12228,7 @@ void Player::VisualizeItem(uint8 slot, Item *pItem) if (pItem->GetProto()->Bonding == BIND_WHEN_EQUIPED || pItem->GetProto()->Bonding == BIND_WHEN_PICKED_UP || pItem->GetProto()->Bonding == BIND_QUEST_ITEM) pItem->SetBinding(true); - sLog->outDebug("STORAGE: EquipItem slot = %u, item = %u", slot, pItem->GetEntry()); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: EquipItem slot = %u, item = %u", slot, pItem->GetEntry()); m_items[slot] = pItem; SetUInt64Value(PLAYER_FIELD_INV_SLOT_HEAD + (slot * 2), pItem->GetGUID()); @@ -12026,7 +12253,7 @@ void Player::RemoveItem(uint8 bag, uint8 slot, bool update) Item *pItem = GetItemByPos(bag, slot); if (pItem) { - sLog->outDebug("STORAGE: RemoveItem bag = %u, slot = %u, item = %u", bag, slot, pItem->GetEntry()); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: RemoveItem bag = %u, slot = %u, item = %u", bag, slot, pItem->GetEntry()); RemoveEnchantmentDurations(pItem); RemoveItemDurations(pItem); @@ -12086,11 +12313,9 @@ void Player::RemoveItem(uint8 bag, uint8 slot, bool update) if (slot < EQUIPMENT_SLOT_END) SetVisibleItemSlot(slot, NULL); } - else - { - if (Bag *pBag = (Bag*)GetItemByPos(INVENTORY_SLOT_BAG_0, bag)) - pBag->RemoveItem(slot, update); - } + else if (Bag *pBag = GetBagByPos(bag)) + pBag->RemoveItem(slot, update); + pItem->SetUInt64Value(ITEM_FIELD_CONTAINED, 0); // pItem->SetUInt64Value(ITEM_FIELD_OWNER, 0); not clear owner at remove (it will be set at store). This used in mail and auction code pItem->SetSlot(NULL_SLOT); @@ -12147,14 +12372,12 @@ void Player::DestroyItem(uint8 bag, uint8 slot, bool update) Item *pItem = GetItemByPos(bag, slot); if (pItem) { - sLog->outDebug("STORAGE: DestroyItem bag = %u, slot = %u, item = %u", bag, slot, pItem->GetEntry()); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: DestroyItem bag = %u, slot = %u, item = %u", bag, slot, pItem->GetEntry()); // Also remove all contained items if the item is a bag. // This if() prevents item saving crashes if the condition for a bag to be empty before being destroyed was bypassed somehow. - if (pItem->IsBag() && !((Bag*)pItem)->IsEmpty()) - { + if (pItem->IsNotEmptyBag()) for (uint8 i = 0; i < MAX_BAG_SIZE; ++i) DestroyItem(slot, i, update); - } if (pItem->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_WRAPPED)) CharacterDatabase.PExecute("DELETE FROM character_gifts WHERE item_guid = '%u'", pItem->GetGUIDLow()); @@ -12227,7 +12450,7 @@ void Player::DestroyItem(uint8 bag, uint8 slot, bool update) m_items[slot] = NULL; } - else if (Bag *pBag = (Bag*)GetItemByPos(INVENTORY_SLOT_BAG_0, bag)) + else if (Bag *pBag = GetBagByPos(bag)) pBag->RemoveItem(slot, update); if (IsInWorld() && update) @@ -12245,7 +12468,7 @@ void Player::DestroyItem(uint8 bag, uint8 slot, bool update) void Player::DestroyItemCount(uint32 item, uint32 count, bool update, bool unequip_check) { - sLog->outDebug("STORAGE: DestroyItemCount item = %u, count = %u", item, count); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: DestroyItemCount item = %u, count = %u", item, count); uint32 remcount = 0; // in inventory @@ -12308,7 +12531,7 @@ void Player::DestroyItemCount(uint32 item, uint32 count, bool update, bool unequ // in inventory bags for (uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++) { - if (Bag *pBag = (Bag*)GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (Bag *pBag = GetBagByPos(i)) { for (uint32 j = 0; j < pBag->GetBagSize(); j++) { @@ -12374,7 +12597,7 @@ void Player::DestroyItemCount(uint32 item, uint32 count, bool update, bool unequ void Player::DestroyZoneLimitedItem(bool update, uint32 new_zone) { - sLog->outDebug("STORAGE: DestroyZoneLimitedItem in map %u and area %u", GetMapId(), new_zone); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: DestroyZoneLimitedItem in map %u and area %u", GetMapId(), new_zone); // in inventory for (uint8 i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; i++) @@ -12389,7 +12612,7 @@ void Player::DestroyZoneLimitedItem(bool update, uint32 new_zone) // in inventory bags for (uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++) - if (Bag* pBag = (Bag*)GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (Bag* pBag = GetBagByPos(i)) for (uint32 j = 0; j < pBag->GetBagSize(); j++) if (Item* pItem = pBag->GetItemByPos(j)) if (pItem->IsLimitedToAnotherMapOrZone(GetMapId(), new_zone)) @@ -12406,7 +12629,7 @@ void Player::DestroyConjuredItems(bool update) { // used when entering arena // destroys all conjured items - sLog->outDebug("STORAGE: DestroyConjuredItems"); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: DestroyConjuredItems"); // in inventory for (uint8 i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; i++) @@ -12416,7 +12639,7 @@ void Player::DestroyConjuredItems(bool update) // in inventory bags for (uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++) - if (Bag* pBag = (Bag*)GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (Bag* pBag = GetBagByPos(i)) for (uint32 j = 0; j < pBag->GetBagSize(); j++) if (Item* pItem = pBag->GetItemByPos(j)) if (pItem->IsConjuredConsumable()) @@ -12433,33 +12656,21 @@ Item* Player::GetItemByEntry(uint32 entry) const { // in inventory for (int i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; ++i) - { if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) if (pItem->GetEntry() == entry) return pItem; - } - for (int i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i) - { - if (Bag* pBag = (Bag*)GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - { + if (Bag* pBag = GetBagByPos(i)) for (uint32 j = 0; j < pBag->GetBagSize(); ++j) - { if (Item* pItem = pBag->GetItemByPos(j)) if (pItem->GetEntry() == entry) return pItem; - } - } - } - for (int i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_BAG_END; ++i) - { if (Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) if (pItem->GetEntry() == entry) return pItem; - } return NULL; } @@ -12469,7 +12680,7 @@ void Player::DestroyItemCount(Item* pItem, uint32 &count, bool update) if (!pItem) return; - sLog->outDebug("STORAGE: DestroyItemCount item (GUID: %u, Entry: %u) count = %u", pItem->GetGUIDLow(),pItem->GetEntry(), count); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: DestroyItemCount item (GUID: %u, Entry: %u) count = %u", pItem->GetGUIDLow(),pItem->GetEntry(), count); if (pItem->GetCount() <= count) { @@ -12524,7 +12735,7 @@ void Player::SplitItem(uint16 src, uint16 dst, uint32 count) return; } - sLog->outDebug("STORAGE: SplitItem bag = %u, slot = %u, item = %u, count = %u", dstbag, dstslot, pSrcItem->GetEntry(), count); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: SplitItem bag = %u, slot = %u, item = %u, count = %u", dstbag, dstslot, pSrcItem->GetEntry(), count); Item *pNewItem = pSrcItem->CloneItem(count, this); if (!pNewItem) { @@ -12609,7 +12820,7 @@ void Player::SwapItem(uint16 src, uint16 dst) if (!pSrcItem) return; - sLog->outDebug("STORAGE: SwapItem bag = %u, slot = %u, item = %u", dstbag, dstslot, pSrcItem->GetEntry()); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: SwapItem bag = %u, slot = %u, item = %u", dstbag, dstslot, pSrcItem->GetEntry()); if (!isAlive()) { @@ -12627,10 +12838,10 @@ void Player::SwapItem(uint16 src, uint16 dst) } // check unequip potability for equipped items and bank bags - if (IsEquipmentPos (src) || IsBagPos (src)) + if (IsEquipmentPos(src) || IsBagPos(src)) { // bags can be swapped with empty bag slots, or with empty bag (items move possibility checked later) - uint8 msg = CanUnequipItem(src, !IsBagPos (src) || IsBagPos (dst) || (pDstItem && pDstItem->IsBag() && ((Bag*)pDstItem)->IsEmpty())); + uint8 msg = CanUnequipItem(src, !IsBagPos(src) || IsBagPos(dst) || (pDstItem && pDstItem->ToBag() && pDstItem->ToBag()->IsEmpty())); if (msg != EQUIP_ERR_OK) { SendEquipError(msg, pSrcItem, pDstItem); @@ -12664,10 +12875,10 @@ void Player::SwapItem(uint16 src, uint16 dst) } // check unequip potability for equipped items and bank bags - if (IsEquipmentPos (dst) || IsBagPos (dst)) + if (IsEquipmentPos(dst) || IsBagPos(dst)) { // bags can be swapped with empty bag slots, or with empty bag (items move possibility checked later) - uint8 msg = CanUnequipItem(dst, !IsBagPos (dst) || IsBagPos (src) || (pSrcItem->IsBag() && ((Bag*)pSrcItem)->IsEmpty())); + uint8 msg = CanUnequipItem(dst, !IsBagPos(dst) || IsBagPos(src) || (pSrcItem->ToBag() && pSrcItem->ToBag()->IsEmpty())); if (msg != EQUIP_ERR_OK) { SendEquipError(msg, pSrcItem, pDstItem); @@ -12819,65 +13030,68 @@ void Player::SwapItem(uint16 src, uint16 dst) } // Check bag swap with item exchange (one from empty in not bag possition (equipped (not possible in fact) or store) - if (pSrcItem->IsBag() && pDstItem->IsBag()) + if (Bag* srcBag = pSrcItem->ToBag()) { - Bag* emptyBag = NULL; - Bag* fullBag = NULL; - if (((Bag*)pSrcItem)->IsEmpty() && !IsBagPos(src)) - { - emptyBag = (Bag*)pSrcItem; - fullBag = (Bag*)pDstItem; - } - else if (((Bag*)pDstItem)->IsEmpty() && !IsBagPos(dst)) + if (Bag* dstBag = pDstItem->ToBag()) { - emptyBag = (Bag*)pDstItem; - fullBag = (Bag*)pSrcItem; - } + Bag* emptyBag = NULL; + Bag* fullBag = NULL; + if (srcBag->IsEmpty() && !IsBagPos(src)) + { + emptyBag = srcBag; + fullBag = dstBag; + } + else if (dstBag->IsEmpty() && !IsBagPos(dst)) + { + emptyBag = dstBag; + fullBag = srcBag; + } - // bag swap (with items exchange) case - if (emptyBag && fullBag) - { - ItemPrototype const* emptyProto = emptyBag->GetProto(); + // bag swap (with items exchange) case + if (emptyBag && fullBag) + { + ItemPrototype const* emptyProto = emptyBag->GetProto(); - uint32 count = 0; + uint32 count = 0; - for (uint32 i=0; i < fullBag->GetBagSize(); ++i) - { - Item *bagItem = fullBag->GetItemByPos(i); - if (!bagItem) - continue; + for (uint32 i=0; i < fullBag->GetBagSize(); ++i) + { + Item *bagItem = fullBag->GetItemByPos(i); + if (!bagItem) + continue; - ItemPrototype const* bagItemProto = bagItem->GetProto(); - if (!bagItemProto || !ItemCanGoIntoBag(bagItemProto, emptyProto)) + ItemPrototype const* bagItemProto = bagItem->GetProto(); + if (!bagItemProto || !ItemCanGoIntoBag(bagItemProto, emptyProto)) + { + // one from items not go to empty target bag + SendEquipError(EQUIP_ERR_NONEMPTY_BAG_OVER_OTHER_BAG, pSrcItem, pDstItem); + return; + } + + ++count; + } + + if (count > emptyBag->GetBagSize()) { - // one from items not go to empty target bag - SendEquipError(EQUIP_ERR_NONEMPTY_BAG_OVER_OTHER_BAG, pSrcItem, pDstItem); + // too small targeted bag + SendEquipError(EQUIP_ERR_ITEMS_CANT_BE_SWAPPED, pSrcItem, pDstItem); return; } - ++count; - } - - if (count > emptyBag->GetBagSize()) - { - // too small targeted bag - SendEquipError(EQUIP_ERR_ITEMS_CANT_BE_SWAPPED, pSrcItem, pDstItem); - return; - } - - // Items swap - count = 0; // will pos in new bag - for (uint32 i = 0; i< fullBag->GetBagSize(); ++i) - { - Item *bagItem = fullBag->GetItemByPos(i); - if (!bagItem) - continue; + // Items swap + count = 0; // will pos in new bag + for (uint32 i = 0; i< fullBag->GetBagSize(); ++i) + { + Item *bagItem = fullBag->GetItemByPos(i); + if (!bagItem) + continue; - fullBag->RemoveItem(i, true); - emptyBag->StoreItem(count, bagItem, true); - bagItem->SetState(ITEM_CHANGED, this); + fullBag->RemoveItem(i, true); + emptyBag->StoreItem(count, bagItem, true); + bagItem->SetState(ITEM_CHANGED, this); - ++count; + ++count; + } } } } @@ -12909,7 +13123,7 @@ void Player::SwapItem(uint16 src, uint16 dst) bool released = false; if (IsBagPos(src)) { - Bag* bag = (Bag*)pSrcItem; + Bag* bag = pSrcItem->ToBag(); for (uint32 i = 0; i < bag->GetBagSize(); ++i) { if (Item *bagItem = bag->GetItemByPos(i)) @@ -12926,7 +13140,7 @@ void Player::SwapItem(uint16 src, uint16 dst) if (!released && IsBagPos(dst) && pDstItem) { - Bag* bag = (Bag*)pDstItem; + Bag* bag = pDstItem->ToBag(); for (uint32 i = 0; i < bag->GetBagSize(); ++i) { if (Item *bagItem = bag->GetItemByPos(i)) @@ -12979,7 +13193,7 @@ void Player::AddItemToBuyBackSlot(Item *pItem) } RemoveItemFromBuyBackSlot(slot, true); - sLog->outDebug("STORAGE: AddItemToBuyBackSlot item = %u, slot = %u", pItem->GetEntry(), slot); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: AddItemToBuyBackSlot item = %u, slot = %u", pItem->GetEntry(), slot); m_items[slot] = pItem; time_t base = time(NULL); @@ -13001,7 +13215,7 @@ void Player::AddItemToBuyBackSlot(Item *pItem) Item* Player::GetItemFromBuyBackSlot(uint32 slot) { - sLog->outDebug("STORAGE: GetItemFromBuyBackSlot slot = %u", slot); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: GetItemFromBuyBackSlot slot = %u", slot); if (slot >= BUYBACK_SLOT_START && slot < BUYBACK_SLOT_END) return m_items[slot]; return NULL; @@ -13009,7 +13223,7 @@ Item* Player::GetItemFromBuyBackSlot(uint32 slot) void Player::RemoveItemFromBuyBackSlot(uint32 slot, bool del) { - sLog->outDebug("STORAGE: RemoveItemFromBuyBackSlot slot = %u", slot); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: RemoveItemFromBuyBackSlot slot = %u", slot); if (slot >= BUYBACK_SLOT_START && slot < BUYBACK_SLOT_END) { Item *pItem = m_items[slot]; @@ -13035,7 +13249,7 @@ void Player::RemoveItemFromBuyBackSlot(uint32 slot, bool del) void Player::SendEquipError(uint8 msg, Item* pItem, Item *pItem2, uint32 itemid) { - sLog->outDebug("WORLD: Sent SMSG_INVENTORY_CHANGE_FAILURE (%u)", msg); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_INVENTORY_CHANGE_FAILURE (%u)", msg); WorldPacket data(SMSG_INVENTORY_CHANGE_FAILURE, (msg == EQUIP_ERR_CANT_EQUIP_LEVEL_I ? 22 : 18)); data << uint8(msg); @@ -13078,7 +13292,7 @@ void Player::SendEquipError(uint8 msg, Item* pItem, Item *pItem2, uint32 itemid) void Player::SendBuyError(uint8 msg, Creature* pCreature, uint32 item, uint32 param) { - sLog->outDebug("WORLD: Sent SMSG_BUY_FAILED"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_BUY_FAILED"); WorldPacket data(SMSG_BUY_FAILED, (8+4+4+1)); data << uint64(pCreature ? pCreature->GetGUID() : 0); data << uint32(item); @@ -13090,7 +13304,7 @@ void Player::SendBuyError(uint8 msg, Creature* pCreature, uint32 item, uint32 pa void Player::SendSellError(uint8 msg, Creature* pCreature, uint64 guid, uint32 param) { - sLog->outDebug("WORLD: Sent SMSG_SELL_ITEM"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_SELL_ITEM"); WorldPacket data(SMSG_SELL_ITEM,(8+8+(param?4:0)+1)); // last check 2.0.10 data << uint64(pCreature ? pCreature->GetGUID() : 0); data << uint64(guid); @@ -13164,7 +13378,7 @@ void Player::UpdateItemDuration(uint32 time, bool realtimeonly) if (m_itemDuration.empty()) return; - sLog->outDebug("Player::UpdateItemDuration(%u,%u)", time, realtimeonly); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Player::UpdateItemDuration(%u,%u)", time, realtimeonly); for (ItemDurationList::const_iterator itr = m_itemDuration.begin(); itr != m_itemDuration.end();) { @@ -13266,7 +13480,7 @@ void Player::RemoveArenaEnchantments(EnchantmentSlot slot) // in inventory bags for (uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i) - if (Bag* pBag = (Bag*)GetItemByPos(INVENTORY_SLOT_BAG_0, i)) + if (Bag* pBag = GetBagByPos(i)) for (uint32 j = 0; j < pBag->GetBagSize(); j++) if (Item* pItem = pBag->GetItemByPos(j)) if (pItem->GetEnchantmentId(slot)) @@ -13433,81 +13647,81 @@ void Player::ApplyEnchantment(Item *item, EnchantmentSlot slot, bool apply, bool } } - sLog->outDebug("Adding %u to stat nb %u",enchant_amount,enchant_spell_id); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Adding %u to stat nb %u",enchant_amount,enchant_spell_id); switch (enchant_spell_id) { case ITEM_MOD_MANA: - sLog->outDebug("+ %u MANA",enchant_amount); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u MANA",enchant_amount); HandleStatModifier(UNIT_MOD_MANA, BASE_VALUE, float(enchant_amount), apply); break; case ITEM_MOD_HEALTH: - sLog->outDebug("+ %u HEALTH",enchant_amount); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u HEALTH",enchant_amount); HandleStatModifier(UNIT_MOD_HEALTH, BASE_VALUE, float(enchant_amount), apply); break; case ITEM_MOD_AGILITY: - sLog->outDebug("+ %u AGILITY",enchant_amount); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u AGILITY",enchant_amount); HandleStatModifier(UNIT_MOD_STAT_AGILITY, TOTAL_VALUE, float(enchant_amount), apply); ApplyStatBuffMod(STAT_AGILITY, (float)enchant_amount, apply); break; case ITEM_MOD_STRENGTH: - sLog->outDebug("+ %u STRENGTH",enchant_amount); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u STRENGTH",enchant_amount); HandleStatModifier(UNIT_MOD_STAT_STRENGTH, TOTAL_VALUE, float(enchant_amount), apply); ApplyStatBuffMod(STAT_STRENGTH, (float)enchant_amount, apply); break; case ITEM_MOD_INTELLECT: - sLog->outDebug("+ %u INTELLECT",enchant_amount); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u INTELLECT",enchant_amount); HandleStatModifier(UNIT_MOD_STAT_INTELLECT, TOTAL_VALUE, float(enchant_amount), apply); ApplyStatBuffMod(STAT_INTELLECT, (float)enchant_amount, apply); break; case ITEM_MOD_SPIRIT: - sLog->outDebug("+ %u SPIRIT",enchant_amount); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u SPIRIT",enchant_amount); HandleStatModifier(UNIT_MOD_STAT_SPIRIT, TOTAL_VALUE, float(enchant_amount), apply); ApplyStatBuffMod(STAT_SPIRIT, (float)enchant_amount, apply); break; case ITEM_MOD_STAMINA: - sLog->outDebug("+ %u STAMINA",enchant_amount); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u STAMINA",enchant_amount); HandleStatModifier(UNIT_MOD_STAT_STAMINA, TOTAL_VALUE, float(enchant_amount), apply); ApplyStatBuffMod(STAT_STAMINA, (float)enchant_amount, apply); break; case ITEM_MOD_DEFENSE_SKILL_RATING: ApplyRatingMod(CR_DEFENSE_SKILL, enchant_amount, apply); - sLog->outDebug("+ %u DEFENCE", enchant_amount); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u DEFENCE", enchant_amount); break; case ITEM_MOD_DODGE_RATING: ApplyRatingMod(CR_DODGE, enchant_amount, apply); - sLog->outDebug("+ %u DODGE", enchant_amount); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u DODGE", enchant_amount); break; case ITEM_MOD_PARRY_RATING: ApplyRatingMod(CR_PARRY, enchant_amount, apply); - sLog->outDebug("+ %u PARRY", enchant_amount); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u PARRY", enchant_amount); break; case ITEM_MOD_BLOCK_RATING: ApplyRatingMod(CR_BLOCK, enchant_amount, apply); - sLog->outDebug("+ %u SHIELD_BLOCK", enchant_amount); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u SHIELD_BLOCK", enchant_amount); break; case ITEM_MOD_HIT_MELEE_RATING: ApplyRatingMod(CR_HIT_MELEE, enchant_amount, apply); - sLog->outDebug("+ %u MELEE_HIT", enchant_amount); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u MELEE_HIT", enchant_amount); break; case ITEM_MOD_HIT_RANGED_RATING: ApplyRatingMod(CR_HIT_RANGED, enchant_amount, apply); - sLog->outDebug("+ %u RANGED_HIT", enchant_amount); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u RANGED_HIT", enchant_amount); break; case ITEM_MOD_HIT_SPELL_RATING: ApplyRatingMod(CR_HIT_SPELL, enchant_amount, apply); - sLog->outDebug("+ %u SPELL_HIT", enchant_amount); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u SPELL_HIT", enchant_amount); break; case ITEM_MOD_CRIT_MELEE_RATING: ApplyRatingMod(CR_CRIT_MELEE, enchant_amount, apply); - sLog->outDebug("+ %u MELEE_CRIT", enchant_amount); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u MELEE_CRIT", enchant_amount); break; case ITEM_MOD_CRIT_RANGED_RATING: ApplyRatingMod(CR_CRIT_RANGED, enchant_amount, apply); - sLog->outDebug("+ %u RANGED_CRIT", enchant_amount); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u RANGED_CRIT", enchant_amount); break; case ITEM_MOD_CRIT_SPELL_RATING: ApplyRatingMod(CR_CRIT_SPELL, enchant_amount, apply); - sLog->outDebug("+ %u SPELL_CRIT", enchant_amount); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u SPELL_CRIT", enchant_amount); break; // Values from ITEM_STAT_MELEE_HA_RATING to ITEM_MOD_HASTE_RANGED_RATING are never used // in Enchantments @@ -13542,13 +13756,13 @@ void Player::ApplyEnchantment(Item *item, EnchantmentSlot slot, bool apply, bool ApplyRatingMod(CR_HIT_MELEE, enchant_amount, apply); ApplyRatingMod(CR_HIT_RANGED, enchant_amount, apply); ApplyRatingMod(CR_HIT_SPELL, enchant_amount, apply); - sLog->outDebug("+ %u HIT", enchant_amount); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u HIT", enchant_amount); break; case ITEM_MOD_CRIT_RATING: ApplyRatingMod(CR_CRIT_MELEE, enchant_amount, apply); ApplyRatingMod(CR_CRIT_RANGED, enchant_amount, apply); ApplyRatingMod(CR_CRIT_SPELL, enchant_amount, apply); - sLog->outDebug("+ %u CRITICAL", enchant_amount); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u CRITICAL", enchant_amount); break; // Values ITEM_MOD_HIT_TAKEN_RATING and ITEM_MOD_CRIT_TAKEN_RATING are never used in Enchantment // case ITEM_MOD_HIT_TAKEN_RATING: @@ -13565,55 +13779,55 @@ void Player::ApplyEnchantment(Item *item, EnchantmentSlot slot, bool apply, bool ApplyRatingMod(CR_CRIT_TAKEN_MELEE, enchant_amount, apply); ApplyRatingMod(CR_CRIT_TAKEN_RANGED, enchant_amount, apply); ApplyRatingMod(CR_CRIT_TAKEN_SPELL, enchant_amount, apply); - sLog->outDebug("+ %u RESILIENCE", enchant_amount); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u RESILIENCE", enchant_amount); break; case ITEM_MOD_HASTE_RATING: ApplyRatingMod(CR_HASTE_MELEE, enchant_amount, apply); ApplyRatingMod(CR_HASTE_RANGED, enchant_amount, apply); ApplyRatingMod(CR_HASTE_SPELL, enchant_amount, apply); - sLog->outDebug("+ %u HASTE", enchant_amount); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u HASTE", enchant_amount); break; case ITEM_MOD_EXPERTISE_RATING: ApplyRatingMod(CR_EXPERTISE, enchant_amount, apply); - sLog->outDebug("+ %u EXPERTISE", enchant_amount); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u EXPERTISE", enchant_amount); break; case ITEM_MOD_ATTACK_POWER: HandleStatModifier(UNIT_MOD_ATTACK_POWER, TOTAL_VALUE, float(enchant_amount), apply); HandleStatModifier(UNIT_MOD_ATTACK_POWER_RANGED, TOTAL_VALUE, float(enchant_amount), apply); - sLog->outDebug("+ %u ATTACK_POWER", enchant_amount); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u ATTACK_POWER", enchant_amount); break; case ITEM_MOD_RANGED_ATTACK_POWER: HandleStatModifier(UNIT_MOD_ATTACK_POWER_RANGED, TOTAL_VALUE, float(enchant_amount), apply); - sLog->outDebug("+ %u RANGED_ATTACK_POWER", enchant_amount); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u RANGED_ATTACK_POWER", enchant_amount); break; // case ITEM_MOD_FERAL_ATTACK_POWER: // ApplyFeralAPBonus(enchant_amount, apply); -// sLog->outDebug("+ %u FERAL_ATTACK_POWER", enchant_amount); +// sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u FERAL_ATTACK_POWER", enchant_amount); // break; case ITEM_MOD_MANA_REGENERATION: ApplyManaRegenBonus(enchant_amount, apply); - sLog->outDebug("+ %u MANA_REGENERATION", enchant_amount); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u MANA_REGENERATION", enchant_amount); break; case ITEM_MOD_ARMOR_PENETRATION_RATING: ApplyRatingMod(CR_ARMOR_PENETRATION, enchant_amount, apply); - sLog->outDebug("+ %u ARMOR PENETRATION", enchant_amount); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u ARMOR PENETRATION", enchant_amount); break; case ITEM_MOD_SPELL_POWER: ApplySpellPowerBonus(enchant_amount, apply); - sLog->outDebug("+ %u SPELL_POWER", enchant_amount); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u SPELL_POWER", enchant_amount); break; case ITEM_MOD_HEALTH_REGEN: ApplyHealthRegenBonus(enchant_amount, apply); - sLog->outDebug("+ %u HEALTH_REGENERATION", enchant_amount); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u HEALTH_REGENERATION", enchant_amount); break; case ITEM_MOD_SPELL_PENETRATION: ApplyModInt32Value(PLAYER_FIELD_MOD_TARGET_RESISTANCE, enchant_amount, apply); m_spellPenetrationItemMod += apply ? int32(enchant_amount) : -int32(enchant_amount); - sLog->outDebug("+ %u SPELL_PENETRATION", enchant_amount); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u SPELL_PENETRATION", enchant_amount); break; case ITEM_MOD_BLOCK_VALUE: HandleBaseModValue(SHIELD_BLOCK_VALUE, FLAT_MOD, float(enchant_amount), apply); - sLog->outDebug("+ %u BLOCK_VALUE", enchant_amount); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u BLOCK_VALUE", enchant_amount); break; case ITEM_MOD_SPELL_HEALING_DONE: // deprecated case ITEM_MOD_SPELL_DAMAGE_DONE: // deprecated @@ -14829,7 +15043,7 @@ void Player::RewardQuest(Quest const *pQuest, uint32 reward, Object* questGiver, // Custom Random Experience Boost Buff if (XP > 0 && getLevel() < sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) { - uint8 boost_chance = 5; + uint8 boost_chance = 20; if (urand(0,99) < boost_chance) { CastSpell(this, 29175, true); // Cast Buff @@ -14949,7 +15163,7 @@ bool Player::SatisfyQuestLog(bool msg) { WorldPacket data(SMSG_QUESTLOG_FULL, 0); GetSession()->SendPacket(&data); - sLog->outDebug("WORLD: Sent SMSG_QUESTLOG_FULL"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTLOG_FULL"); } return false; } @@ -15001,7 +15215,6 @@ bool Player::SatisfyQuestPreviousQuest(Quest const* qInfo, bool msg) return true; } - // If any of the negative previous quests active, return true if (*iter < 0 && GetQuestStatus(prevId) != QUEST_STATUS_NONE) { @@ -15098,7 +15311,7 @@ bool Player::SatisfyQuestConditions(Quest const* qInfo, bool msg) { if (msg) SendCanTakeQuestResponse(INVALIDREASON_DONT_HAVE_REQ); - sLog->outDebug("Player::SatisfyQuestConditions: conditions not met for quest %u", qInfo->GetQuestId()); + sLog->outDebug(LOG_FILTER_CONDITIONSYS, "Player::SatisfyQuestConditions: conditions not met for quest %u", qInfo->GetQuestId()); return false; } return true; @@ -15900,14 +16113,14 @@ void Player::SendQuestComplete(uint32 quest_id) WorldPacket data(SMSG_QUESTUPDATE_COMPLETE, 4); data << uint32(quest_id); GetSession()->SendPacket(&data); - sLog->outDebug("WORLD: Sent SMSG_QUESTUPDATE_COMPLETE quest = %u", quest_id); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTUPDATE_COMPLETE quest = %u", quest_id); } } void Player::SendQuestReward(Quest const *pQuest, uint32 XP, Object * questGiver) { uint32 questid = pQuest->GetQuestId(); - sLog->outDebug("WORLD: Sent SMSG_QUESTGIVER_QUEST_COMPLETE quest = %u", questid); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTGIVER_QUEST_COMPLETE quest = %u", questid); sGameEventMgr->HandleQuestComplete(questid); WorldPacket data(SMSG_QUESTGIVER_QUEST_COMPLETE, (4+4+4+4+4)); data << uint32(questid); @@ -15940,7 +16153,7 @@ void Player::SendQuestFailed(uint32 quest_id) data << uint32(quest_id); data << uint32(0); // failed reason (4 for inventory is full) GetSession()->SendPacket(&data); - sLog->outDebug("WORLD: Sent SMSG_QUESTGIVER_QUEST_FAILED"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTGIVER_QUEST_FAILED"); } } @@ -15951,7 +16164,7 @@ void Player::SendQuestTimerFailed(uint32 quest_id) WorldPacket data(SMSG_QUESTUPDATE_FAILEDTIMER, 4); data << uint32(quest_id); GetSession()->SendPacket(&data); - sLog->outDebug("WORLD: Sent SMSG_QUESTUPDATE_FAILEDTIMER"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTUPDATE_FAILEDTIMER"); } } @@ -15960,7 +16173,7 @@ void Player::SendCanTakeQuestResponse(uint32 msg) WorldPacket data(SMSG_QUESTGIVER_QUEST_INVALID, 4); data << uint32(msg); GetSession()->SendPacket(&data); - sLog->outDebug("WORLD: Sent SMSG_QUESTGIVER_QUEST_INVALID"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTGIVER_QUEST_INVALID"); } void Player::SendQuestConfirmAccept(const Quest* pQuest, Player* pReceiver) @@ -15980,7 +16193,7 @@ void Player::SendQuestConfirmAccept(const Quest* pQuest, Player* pReceiver) data << uint64(GetGUID()); pReceiver->GetSession()->SendPacket(&data); - sLog->outDebug("WORLD: Sent SMSG_QUEST_CONFIRM_ACCEPT"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUEST_CONFIRM_ACCEPT"); } } @@ -15992,14 +16205,14 @@ void Player::SendPushToPartyResponse(Player *pPlayer, uint32 msg) data << uint64(pPlayer->GetGUID()); data << uint8(msg); // valid values: 0-8 GetSession()->SendPacket(&data); - sLog->outDebug("WORLD: Sent MSG_QUEST_PUSH_RESULT"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent MSG_QUEST_PUSH_RESULT"); } } void Player::SendQuestUpdateAddItem(Quest const* /*pQuest*/, uint32 /*item_idx*/, uint16 /*count*/) { WorldPacket data(SMSG_QUESTUPDATE_ADD_ITEM, 0); - sLog->outDebug("WORLD: Sent SMSG_QUESTUPDATE_ADD_ITEM"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTUPDATE_ADD_ITEM"); //data << pQuest->ReqItemId[item_idx]; //data << count; GetSession()->SendPacket(&data); @@ -16015,7 +16228,7 @@ void Player::SendQuestUpdateAddCreatureOrGo(Quest const* pQuest, uint64 guid, ui entry = (-entry) | 0x80000000; WorldPacket data(SMSG_QUESTUPDATE_ADD_KILL, (4*4+8)); - sLog->outDebug("WORLD: Sent SMSG_QUESTUPDATE_ADD_KILL"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTUPDATE_ADD_KILL"); data << uint32(pQuest->GetQuestId()); data << uint32(entry); data << uint32(old_count + add_count); @@ -16289,6 +16502,9 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) SetFloatValue(UNIT_FIELD_COMBATREACH, 1.5f); SetFloatValue(UNIT_FIELD_HOVERHEIGHT, 1.0f); + // load achievements before anything else to prevent multiple gains for the same achievement/criteria on every loading (as loading does call UpdateAchievementCriteria) + m_achievementMgr.LoadFromDB(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADACHIEVEMENTS), holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADCRITERIAPROGRESS)); + uint32 money = fields[8].GetUInt32(); if (money > MAX_MONEY_AMOUNT) money = MAX_MONEY_AMOUNT; @@ -16319,7 +16535,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) m_items[slot] = NULL; } - sLog->outDebug("Load Basic value of player %s is: ", m_name.c_str()); + sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Load Basic value of player %s is: ", m_name.c_str()); outDebugValues(); //Need to call it to initialize m_team (m_team can be calculated from race) @@ -16356,11 +16572,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) _LoadArenaTeamInfo(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADARENAINFO)); _LoadArenaStatsInfo(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADARENASTATS)); - uint32 arena_currency = fields[39].GetUInt32(); - if (arena_currency > sWorld->getIntConfig(CONFIG_MAX_ARENA_POINTS)) - arena_currency = sWorld->getIntConfig(CONFIG_MAX_ARENA_POINTS); - - SetArenaPoints(arena_currency); + SetArenaPoints(fields[39].GetUInt32()); // check arena teams integrity for (uint32 arena_slot = 0; arena_slot < MAX_ARENA_SLOT; ++arena_slot) @@ -16406,10 +16618,10 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) if (player_at_bg && currentBg->GetStatus() != STATUS_WAIT_LEAVE) { - BattlegroundQueueTypeId bgQueueTypeId = sBattlegroundMgr->BGQueueTypeId(currentBg->GetTypeID(true), currentBg->GetArenaType()); + BattlegroundQueueTypeId bgQueueTypeId = sBattlegroundMgr->BGQueueTypeId(currentBg->GetTypeID(false), currentBg->GetArenaType()); AddBattlegroundQueueId(bgQueueTypeId); - m_bgData.bgTypeID = currentBg->GetTypeID(true); + m_bgData.bgTypeID = currentBg->GetTypeID(false); //join player to battleground group currentBg->EventPlayerLoggedIn(this); @@ -16533,7 +16745,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) { if (GetSession()->Expansion() < mapEntry->Expansion()) { - sLog->outDebug("Player %s using client without required expansion tried login at non accessible map %u", GetName(), mapId); + sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Player %s using client without required expansion tried login at non accessible map %u", GetName(), mapId); RelocateToHomebind(); } @@ -16788,7 +17000,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) SetPower(Powers(i),savedPower > GetMaxPower(Powers(i)) ? GetMaxPower(Powers(i)) : savedPower); } - sLog->outDebug("The value of player %s after load item and aura is: ", m_name.c_str()); + sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "The value of player %s after load item and aura is: ", m_name.c_str()); outDebugValues(); // GM state @@ -16852,7 +17064,6 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) _LoadDeclinedNames(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADDECLINEDNAMES)); - m_achievementMgr.LoadFromDB(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADACHIEVEMENTS), holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADCRITERIAPROGRESS)); m_achievementMgr.CheckAllAchievementCriteria(); _LoadEquipmentSets(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADEQUIPMENTSETS)); @@ -16932,7 +17143,7 @@ void Player::_LoadActions(PreparedQueryResult result) void Player::_LoadAuras(PreparedQueryResult result, uint32 timediff) { - sLog->outDebug("Loading auras for player %u",GetGUIDLow()); + sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Loading auras for player %u",GetGUIDLow()); /* 0 1 2 3 4 5 6 7 8 9 10 QueryResult *result = CharacterDatabase.PQuery("SELECT caster_guid,spell,effect_mask,recalculate_mask,stackcount,amount0,amount1,amount2,base_amount0,base_amount1,base_amount2, @@ -17050,87 +17261,146 @@ void Player::LoadCorpse() } } -void Player::_LoadInventory(PreparedQueryResult result, uint32 timediff) +void Player::_LoadInventory(PreparedQueryResult result, uint32 timeDiff) { //QueryResult *result = CharacterDatabase.PQuery("SELECT data,text,bag,slot,item,item_template FROM character_inventory JOIN item_instance ON character_inventory.item = item_instance.guid WHERE character_inventory.guid = '%u' ORDER BY bag,slot", GetGUIDLow()); - std::map bagMap; // fast guid lookup for bags //NOTE: the "order by `bag`" is important because it makes sure //the bagMap is filled before items in the bags are loaded //NOTE2: the "order by `slot`" is needed because mainhand weapons are (wrongly?) //expected to be equipped before offhand items (TODO: fixme) - uint32 zone = GetZoneId(); - if (result) { + uint32 zoneId = GetZoneId(); + + std::map bagMap; // fast guid lookup for bags std::list problematicItems; SQLTransaction trans = CharacterDatabase.BeginTransaction(); - // prevent items from being added to the queue when stored + // Prevent items from being added to the queue while loading m_itemUpdateQueueBlocked = true; do { Field* fields = result->Fetch(); + if (Item* item = _LoadItem(trans, zoneId, timeDiff, fields)) + { + uint32 bagGuid = fields[11].GetUInt32(); + uint8 slot = fields[12].GetUInt8(); - uint32 bag_guid = fields[11].GetUInt32(); - uint8 slot = fields[12].GetUInt8(); - uint32 item_guid = fields[13].GetUInt32(); - uint32 item_id = fields[14].GetUInt32(); + uint8 err = EQUIP_ERR_OK; + // Item is not in bag + if (!bagGuid) + { + item->SetContainer(NULL); + item->SetSlot(slot); - ItemPrototype const * proto = ObjectMgr::GetItemPrototype(item_id); + if (IsInventoryPos(INVENTORY_SLOT_BAG_0, slot)) + { + ItemPosCountVec dest; + err = CanStoreItem(INVENTORY_SLOT_BAG_0, slot, dest, item, false); + if (err == EQUIP_ERR_OK) + item = StoreItem(dest, item, true); + } + else if (IsEquipmentPos(INVENTORY_SLOT_BAG_0, slot)) + { + uint16 dest; + err = CanEquipItem(slot, dest, item, false, false); + if (err == EQUIP_ERR_OK) + QuickEquipItem(dest, item); + } + else if (IsBankPos(INVENTORY_SLOT_BAG_0, slot)) + { + ItemPosCountVec dest; + err = CanBankItem(INVENTORY_SLOT_BAG_0, slot, dest, item, false, false); + if (err == EQUIP_ERR_OK) + item = BankItem(dest, item, true); + } - if (!proto) - { - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_INVENTORY_ITEM); - stmt->setUInt32(0, item_guid); - trans->Append(stmt); - stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEM_INSTANCE); - stmt->setUInt32(0, item_guid); - trans->Append(stmt); - sLog->outError("Player::_LoadInventory: Player %s has an unknown item (id: #%u) in inventory, deleted.", GetName(),item_id); - continue; + // Remember bags that may contain items in them + if (err == EQUIP_ERR_OK) + if (IsBagPos(item->GetPos())) + if (Bag* pBag = item->ToBag()) + bagMap[item->GetGUIDLow()] = pBag; + } + else + { + item->SetSlot(NULL_SLOT); + // Item is in the bag, find the bag + std::map::iterator itr = bagMap.find(bagGuid); + if (itr != bagMap.end()) + { + ItemPosCountVec dest; + err = CanStoreItem(itr->second->GetSlot(), slot, dest, item); + if (err == EQUIP_ERR_OK) + itr->second->StoreItem(slot, item, true); + } + } + + // Item's state may have changed after storing + if (err == EQUIP_ERR_OK) + item->SetState(ITEM_UNCHANGED, this); + else + { + sLog->outError("Player::_LoadInventory: player (GUID: %u, name: '%s') has item (GUID: %u, entry: %u) which can't be loaded into inventory (Bag GUID: %u, slot: %u) by reason %u. Item will be sent by mail.", + GetGUIDLow(), GetName(), item->GetGUIDLow(), item->GetEntry(), bagGuid, slot, err); + item->DeleteFromInventoryDB(trans); + problematicItems.push_back(item); + } } + } while (result->NextRow()); - Item *item = NewItemOrBag(proto); + m_itemUpdateQueueBlocked = false; - if (!item->LoadFromDB(item_guid, GetGUID(), fields, item_id)) + // Send problematic items by mail + while (!problematicItems.empty()) + { + std::string subject = GetSession()->GetTrinityString(LANG_NOT_EQUIPPED_ITEM); + + MailDraft draft(subject, "There were problems with equipping item(s)."); + for (uint8 i = 0; !problematicItems.empty() && i < MAX_MAIL_ITEMS; ++i) { - sLog->outError("Player::_LoadInventory: Player %s has broken item (id: #%u) in inventory, deleted.", GetName(),item_id); - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_INVENTORY_ITEM); - stmt->setUInt32(0, item_guid); - trans->Append(stmt); - item->FSetState(ITEM_REMOVED); - item->SaveToDB(trans); // it also deletes item object ! - continue; + draft.AddItem(problematicItems.front()); + problematicItems.pop_front(); } + draft.SendMailTo(trans, this, MailSender(this, MAIL_STATIONERY_GM), MAIL_CHECK_MASK_COPIED); + } + CharacterDatabase.CommitTransaction(trans); + } + //if (isAlive()) + _ApplyAllItemMods(); +} - // not allow have in alive state item limited to another map/zone - if (isAlive() && item->IsLimitedToAnotherMapOrZone(GetMapId(), zone)) +Item* Player::_LoadItem(SQLTransaction& trans, uint32 zoneId, uint32 timeDiff, Field* fields) +{ + Item* item = NULL; + uint32 itemGuid = fields[13].GetUInt32(); + uint32 itemEntry = fields[14].GetUInt32(); + if (ItemPrototype const * proto = ObjectMgr::GetItemPrototype(itemEntry)) + { + bool remove = false; + item = NewItemOrBag(proto); + if (item->LoadFromDB(itemGuid, GetGUID(), fields, itemEntry)) + { + // Do not allow to have item limited to another map/zone in alive state + if (isAlive() && item->IsLimitedToAnotherMapOrZone(GetMapId(), zoneId)) { - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_INVENTORY_ITEM); - stmt->setUInt32(0, item_guid); - trans->Append(stmt); - item->FSetState(ITEM_REMOVED); - item->SaveToDB(trans); // it also deletes item object ! - continue; + sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Player::_LoadInventory: player (GUID: %u, name: '%s', map: %u) has item (GUID: %u, entry: %u) limited to another map (%u). Deleting item.", + GetGUIDLow(), GetName(), GetMapId(), item->GetGUIDLow(), item->GetEntry(), zoneId); + remove = true; } - // "Conjured items disappear if you are logged out for more than 15 minutes" - if (timediff > 15*MINUTE && proto->Flags & ITEM_PROTO_FLAG_CONJURED) + else if (timeDiff > 15 * MINUTE && proto->Flags & ITEM_PROTO_FLAG_CONJURED) { - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_INVENTORY_ITEM); - stmt->setUInt32(0, item_guid); - trans->Append(stmt); - item->FSetState(ITEM_REMOVED); - item->SaveToDB(trans); // it also deletes item object ! - continue; + sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Player::_LoadInventory: player (GUID: %u, name: '%s', diff: %u) has conjured item (GUID: %u, entry: %u) with expired lifetime (15 minutes). Deleting item.", + GetGUIDLow(), GetName(), timeDiff, item->GetGUIDLow(), item->GetEntry()); + remove = true; } - - if (item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_REFUNDABLE)) + else if (item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_REFUNDABLE)) { - if (item->GetPlayedTime() > (2*HOUR)) + if (item->GetPlayedTime() > (2 * HOUR)) { - sLog->outDebug("Item::LoadFromDB, Item GUID: %u: refund time expired, deleting refund data and removing refundable flag.", item->GetGUIDLow()); + sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Player::_LoadInventory: player (GUID: %u, name: '%s') has item (GUID: %u, entry: %u) with expired refund time (%u). Deleting refund data and removing refundable flag.", + GetGUIDLow(), GetName(), item->GetGUIDLow(), item->GetEntry(), item->GetPlayedTime()); trans->PAppend("DELETE FROM item_refund_instance WHERE item_guid = '%u'", item->GetGUIDLow()); item->RemoveFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_REFUNDABLE); } @@ -17139,19 +17409,18 @@ void Player::_LoadInventory(PreparedQueryResult result, uint32 timediff) PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_ITEM_REFUNDS); stmt->setUInt32(0, item->GetGUIDLow()); stmt->setUInt32(1, GetGUIDLow()); - PreparedQueryResult result2 = CharacterDatabase.Query(stmt); - if (!result2) + if (PreparedQueryResult result = CharacterDatabase.Query(stmt)) { - sLog->outDebug("Item::LoadFromDB, Item GUID: %u has field flags & ITEM_FLAGS_REFUNDABLE but has no data in item_refund_instance, removing flag.", item->GetGUIDLow()); - item->RemoveFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_REFUNDABLE); + item->SetRefundRecipient((*result)[0].GetUInt32()); + item->SetPaidMoney((*result)[1].GetUInt32()); + item->SetPaidExtendedCost((*result)[2].GetUInt16()); + AddRefundReference(item->GetGUIDLow()); } else { - Field* fields2 = result2->Fetch(); - item->SetRefundRecipient(fields2[0].GetUInt32()); - item->SetPaidMoney(fields2[1].GetUInt32()); - item->SetPaidExtendedCost(fields2[2].GetUInt16()); - AddRefundReference(item->GetGUIDLow()); + sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Player::_LoadInventory: player (GUID: %u, name: '%s') has item (GUID: %u, entry: %u) with refundable flags, but without data in item_refund_instance. Removing flag.", + GetGUIDLow(), GetName(), item->GetGUIDLow(), item->GetEntry()); + item->RemoveFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_REFUNDABLE); } } } @@ -17159,16 +17428,9 @@ void Player::_LoadInventory(PreparedQueryResult result, uint32 timediff) { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_ITEM_BOP_TRADE); stmt->setUInt32(0, item->GetGUIDLow()); - PreparedQueryResult result2 = CharacterDatabase.Query(stmt); - if (!result2) + if (PreparedQueryResult result = CharacterDatabase.Query(stmt)) { - sLog->outDebug("Item::LoadFromDB, Item GUID: %u has flag ITEM_FLAG_BOP_TRADEABLE but has no data in item_soulbound_trade_data, removing flag.", item->GetGUIDLow()); - item->RemoveFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_BOP_TRADEABLE); - } - else - { - Field* fields2 = result2->Fetch(); - std::string strGUID = fields2[0].GetString(); + std::string strGUID = (*result)[0].GetString(); Tokens GUIDlist(strGUID, ' '); AllowedLooterSet looters; for (Tokens::iterator itr = GUIDlist.begin(); itr != GUIDlist.end(); ++itr) @@ -17176,106 +17438,37 @@ void Player::_LoadInventory(PreparedQueryResult result, uint32 timediff) item->SetSoulboundTradeable(&looters, this, true); m_itemSoulboundTradeable.push_back(item); } - } - - bool success = true; - - if (!bag_guid) - { - // the item is not in a bag - item->SetContainer(NULL); - item->SetSlot(slot); - - if (IsInventoryPos(INVENTORY_SLOT_BAG_0, slot)) - { - ItemPosCountVec dest; - if (CanStoreItem(INVENTORY_SLOT_BAG_0, slot, dest, item, false) == EQUIP_ERR_OK) - item = StoreItem(dest, item, true); - else - success = false; - } - else if (IsEquipmentPos(INVENTORY_SLOT_BAG_0, slot)) - { - uint16 dest; - if (CanEquipItem(slot, dest, item, false, false) == EQUIP_ERR_OK) - QuickEquipItem(dest, item); - else - success = false; - } - else if (IsBankPos(INVENTORY_SLOT_BAG_0, slot)) - { - ItemPosCountVec dest; - if (CanBankItem(INVENTORY_SLOT_BAG_0, slot, dest, item, false, false) == EQUIP_ERR_OK) - item = BankItem(dest, item, true); - else - success = false; - } - - if (success) - { - // store bags that may contain items in them - if (item->IsBag() && IsBagPos(item->GetPos())) - bagMap[item_guid] = (Bag*)item; - } - } - else - { - item->SetSlot(NULL_SLOT); - // the item is in a bag, find the bag - std::map::iterator itr = bagMap.find(bag_guid); - if (itr != bagMap.end()) + else { - ItemPosCountVec dest; - uint8 result = CanStoreItem(itr->second->GetSlot(), slot, dest, item); - if (result == EQUIP_ERR_OK) - itr->second->StoreItem(slot, item, true); - else - { - sLog->outError("Player::_LoadInventory: Player %s has item (GUID: %u Entry: %u) can't be loaded to inventory (Bag GUID: %u Slot: %u) by reason %u.", GetName(),item_guid, item_id, bag_guid, slot, result); - success = false; - } + sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Player::_LoadInventory: player (GUID: %u, name: '%s') has item (GUID: %u, entry: %u) with ITEM_FLAG_BOP_TRADEABLE flag, but without data in item_soulbound_trade_data. Removing flag.", + GetGUIDLow(), GetName(), item->GetGUIDLow(), item->GetEntry()); + item->RemoveFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_BOP_TRADEABLE); } - else - success = false; - } - - // item's state may have changed after stored - if (success) - item->SetState(ITEM_UNCHANGED, this); - else - { - sLog->outError("Player::_LoadInventory: Player %s has item (GUID: %u Entry: %u) can't be loaded to inventory (Bag GUID: %u Slot: %u) by some reason, will send by mail.", GetName(),item_guid, item_id, bag_guid, slot); - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_INVENTORY_ITEM); - stmt->setUInt32(0, item_guid); - trans->Append(stmt); - problematicItems.push_back(item); } - } while (result->NextRow()); - - m_itemUpdateQueueBlocked = false; - - // send by mail problematic items - while (!problematicItems.empty()) + } + else { - std::string subject = GetSession()->GetTrinityString(LANG_NOT_EQUIPPED_ITEM); - - // fill mail - MailDraft draft(subject, "There's were problems with equipping item(s)."); - - for (uint8 i = 0; !problematicItems.empty() && i < MAX_MAIL_ITEMS; ++i) - { - Item* item = problematicItems.front(); - problematicItems.pop_front(); - - draft.AddItem(item); - } - - draft.SendMailTo(trans, this, MailSender(this, MAIL_STATIONERY_GM), MAIL_CHECK_MASK_COPIED); + sLog->outError("Player::_LoadInventory: player (GUID: %u, name: '%s') has broken item (GUID: %u, entry: %u) in inventory. Deleting item.", + GetGUIDLow(), GetName(), itemGuid, itemEntry); + remove = true; + } + // Remove item from inventory if necessary + if (remove) + { + Item::DeleteFromInventoryDB(trans, itemGuid); + item->FSetState(ITEM_REMOVED); + item->SaveToDB(trans); // it also deletes item object! + item = NULL; } - CharacterDatabase.CommitTransaction(trans); } - //if (isAlive()) - _ApplyAllItemMods(); + else + { + sLog->outError("Player::_LoadInventory: player (GUID: %u, name: '%s') has unknown item (entry: %u) in inventory. Deleting item.", + GetGUIDLow(), GetName(), itemEntry); + Item::DeleteFromInventoryDB(trans, itemGuid); + Item::DeleteFromDB(trans, itemGuid); + } + return item; } // load mailed item which should receive current player @@ -17470,7 +17663,7 @@ void Player::_LoadQuestStatus(PreparedQueryResult result) ++slot; } - sLog->outDebug("Quest status is {%u} for quest {%u} for player (GUID: %u)", questStatusData.m_status, quest_id, GetGUIDLow()); + sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Quest status is {%u} for quest {%u} for player (GUID: %u)", questStatusData.m_status, quest_id, GetGUIDLow()); } } while (result->NextRow()); @@ -17560,7 +17753,7 @@ void Player::_LoadDailyQuestStatus(PreparedQueryResult result) SetUInt32Value(PLAYER_FIELD_DAILY_QUESTS_1+quest_daily_idx, quest_id); ++quest_daily_idx; - sLog->outDebug("Daily quest (%u) cooldown for player (GUID: %u)", quest_id, GetGUIDLow()); + sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Daily quest (%u) cooldown for player (GUID: %u)", quest_id, GetGUIDLow()); } while (result->NextRow()); } @@ -17582,7 +17775,7 @@ void Player::_LoadWeeklyQuestStatus(PreparedQueryResult result) continue; m_weeklyquests.insert(quest_id); - sLog->outDebug("Weekly quest {%u} cooldown for player (GUID: %u)", quest_id, GetGUIDLow()); + sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Weekly quest {%u} cooldown for player (GUID: %u)", quest_id, GetGUIDLow()); } while (result->NextRow()); } @@ -17607,7 +17800,7 @@ void Player::_LoadGroup(PreparedQueryResult result) //QueryResult *result = CharacterDatabase.PQuery("SELECT guid FROM group_member WHERE memberGuid=%u", GetGUIDLow()); if (result) { - if (Group* group = sObjectMgr->GetGroupByGUID((*result)[0].GetUInt32())) + if (Group* group = sObjectMgr->GetGroupByStorageId((*result)[0].GetUInt32())) { uint8 subgroup = group->GetMemberGroup(GetGUID()); SetGroup(group, subgroup); @@ -17755,7 +17948,7 @@ InstancePlayerBind* Player::BindToInstance(InstanceSave *save, bool permanent, b bind.save = save; bind.perm = permanent; if (!load) - sLog->outDebug("Player::BindToInstance: %s(%d) is now bound to map %d, instance %d, difficulty %d", GetName(), GetGUIDLow(), save->GetMapId(), save->GetInstanceId(), save->GetDifficulty()); + sLog->outDebug(LOG_FILTER_MAPS, "Player::BindToInstance: %s(%d) is now bound to map %d, instance %d, difficulty %d", GetName(), GetGUIDLow(), save->GetMapId(), save->GetInstanceId(), save->GetDifficulty()); sScriptMgr->OnPlayerBindToInstance(this, save->GetDifficulty(), save->GetMapId(), permanent); return &bind; } @@ -17765,10 +17958,6 @@ InstancePlayerBind* Player::BindToInstance(InstanceSave *save, bool permanent, b void Player::BindToInstance() { - // Player left the instance - if (_pendingBind->GetInstanceId() != GetInstanceId()) - return; - WorldPacket data(SMSG_INSTANCE_SAVE_CREATED, 4); data << uint32(0); GetSession()->SendPacket(&data); @@ -17850,50 +18039,26 @@ void Player::SendSavedInstances() } /// convert the player's binds to the group -void Player::ConvertInstancesToGroup(Player *player, Group *group, uint64 player_guid) +void Player::ConvertInstancesToGroup(Player *player, Group *group, bool switchLeader) { - bool has_binds = false; - bool has_solo = false; - - if (player) - { - player_guid = player->GetGUID(); - if (!group) - group = player->GetGroup(); - } - ASSERT(player_guid); - // copy all binds to the group, when changing leader it's assumed the character // will not have any solo binds - if (player) + for (uint8 i = 0; i < MAX_DIFFICULTY; ++i) { - for (uint8 i = 0; i < MAX_DIFFICULTY; ++i) + for (BoundInstancesMap::iterator itr = player->m_boundInstances[i].begin(); itr != player->m_boundInstances[i].end();) { - for (BoundInstancesMap::iterator itr = player->m_boundInstances[i].begin(); itr != player->m_boundInstances[i].end();) + group->BindToInstance(itr->second.save, itr->second.perm, false); + // permanent binds are not removed + if (switchLeader && !itr->second.perm) { - has_binds = true; - if (group) - group->BindToInstance(itr->second.save, itr->second.perm, true); - // permanent binds are not removed - if (!itr->second.perm) - { - // increments itr in call - player->UnbindInstance(itr, Difficulty(i), true); - has_solo = true; - } - else - ++itr; + // increments itr in call + player->UnbindInstance(itr, Difficulty(i), false); } + else + ++itr; } } - - // if the player's not online we don't know what binds it has - if (!player || !group || has_binds) - CharacterDatabase.PExecute("INSERT INTO group_instance SELECT guid, instance, permanent FROM character_instance WHERE guid = '%u'", GUID_LOPART(player_guid)); - // the following should not get executed when changing leaders - if (!player || has_solo) - CharacterDatabase.PExecute("DELETE FROM character_instance WHERE guid = '%d' AND permanent = 0", GUID_LOPART(player_guid)); } bool Player::Satisfy(AccessRequirement const* ar, uint32 target_map, bool report) @@ -18055,7 +18220,7 @@ void Player::SaveToDB() // first save/honor gain after midnight will also update the player's honor fields UpdateHonorFields(); - sLog->outDebug("The value of player %s at save: ", m_name.c_str()); + sLog->outDebug(LOG_FILTER_UNITS, "The value of player %s at save: ", m_name.c_str()); outDebugValues(); std::string sql_name = m_name; @@ -18638,7 +18803,7 @@ void Player::_SaveSpells(SQLTransaction& trans) // add only changed/new not dependent spells if (!itr->second->dependent && (itr->second->state == PLAYERSPELL_NEW || itr->second->state == PLAYERSPELL_CHANGED)) - trans->PAppend("INSERT INTO character_spell (guid,spell,active,disabled) VALUES ('%u', '%u', '%u', '%u')", GetGUIDLow(), itr->first, itr->second->active ? 1 : 0,itr->second->disabled ? 1 : 0); + trans->PAppend("INSERT IGNORE INTO character_spell (guid,spell,active,disabled) VALUES ('%u', '%u', '%u', '%u')", GetGUIDLow(), itr->first, itr->second->active ? 1 : 0,itr->second->disabled ? 1 : 0); if (itr->second->state == PLAYERSPELL_REMOVED) { @@ -18692,18 +18857,18 @@ void Player::outDebugValues() const if (!sLog->IsOutDebug()) // optimize disabled debug output return; - sLog->outDebug("HP is: \t\t\t%u\t\tMP is: \t\t\t%u",GetMaxHealth(), GetMaxPower(POWER_MANA)); - sLog->outDebug("AGILITY is: \t\t%f\t\tSTRENGTH is: \t\t%f",GetStat(STAT_AGILITY), GetStat(STAT_STRENGTH)); - sLog->outDebug("INTELLECT is: \t\t%f\t\tSPIRIT is: \t\t%f",GetStat(STAT_INTELLECT), GetStat(STAT_SPIRIT)); - sLog->outDebug("STAMINA is: \t\t%f",GetStat(STAT_STAMINA)); - sLog->outDebug("Armor is: \t\t%u\t\tBlock is: \t\t%f",GetArmor(), GetFloatValue(PLAYER_BLOCK_PERCENTAGE)); - sLog->outDebug("HolyRes is: \t\t%u\t\tFireRes is: \t\t%u",GetResistance(SPELL_SCHOOL_HOLY), GetResistance(SPELL_SCHOOL_FIRE)); - sLog->outDebug("NatureRes is: \t\t%u\t\tFrostRes is: \t\t%u",GetResistance(SPELL_SCHOOL_NATURE), GetResistance(SPELL_SCHOOL_FROST)); - sLog->outDebug("ShadowRes is: \t\t%u\t\tArcaneRes is: \t\t%u",GetResistance(SPELL_SCHOOL_SHADOW), GetResistance(SPELL_SCHOOL_ARCANE)); - sLog->outDebug("MIN_DAMAGE is: \t\t%f\tMAX_DAMAGE is: \t\t%f",GetFloatValue(UNIT_FIELD_MINDAMAGE), GetFloatValue(UNIT_FIELD_MAXDAMAGE)); - sLog->outDebug("MIN_OFFHAND_DAMAGE is: \t%f\tMAX_OFFHAND_DAMAGE is: \t%f",GetFloatValue(UNIT_FIELD_MINOFFHANDDAMAGE), GetFloatValue(UNIT_FIELD_MAXOFFHANDDAMAGE)); - sLog->outDebug("MIN_RANGED_DAMAGE is: \t%f\tMAX_RANGED_DAMAGE is: \t%f",GetFloatValue(UNIT_FIELD_MINRANGEDDAMAGE), GetFloatValue(UNIT_FIELD_MAXRANGEDDAMAGE)); - sLog->outDebug("ATTACK_TIME is: \t%u\t\tRANGE_ATTACK_TIME is: \t%u",GetAttackTime(BASE_ATTACK), GetAttackTime(RANGED_ATTACK)); + sLog->outDebug(LOG_FILTER_UNITS, "HP is: \t\t\t%u\t\tMP is: \t\t\t%u",GetMaxHealth(), GetMaxPower(POWER_MANA)); + sLog->outDebug(LOG_FILTER_UNITS, "AGILITY is: \t\t%f\t\tSTRENGTH is: \t\t%f",GetStat(STAT_AGILITY), GetStat(STAT_STRENGTH)); + sLog->outDebug(LOG_FILTER_UNITS, "INTELLECT is: \t\t%f\t\tSPIRIT is: \t\t%f",GetStat(STAT_INTELLECT), GetStat(STAT_SPIRIT)); + sLog->outDebug(LOG_FILTER_UNITS, "STAMINA is: \t\t%f",GetStat(STAT_STAMINA)); + sLog->outDebug(LOG_FILTER_UNITS, "Armor is: \t\t%u\t\tBlock is: \t\t%f",GetArmor(), GetFloatValue(PLAYER_BLOCK_PERCENTAGE)); + sLog->outDebug(LOG_FILTER_UNITS, "HolyRes is: \t\t%u\t\tFireRes is: \t\t%u",GetResistance(SPELL_SCHOOL_HOLY), GetResistance(SPELL_SCHOOL_FIRE)); + sLog->outDebug(LOG_FILTER_UNITS, "NatureRes is: \t\t%u\t\tFrostRes is: \t\t%u",GetResistance(SPELL_SCHOOL_NATURE), GetResistance(SPELL_SCHOOL_FROST)); + sLog->outDebug(LOG_FILTER_UNITS, "ShadowRes is: \t\t%u\t\tArcaneRes is: \t\t%u",GetResistance(SPELL_SCHOOL_SHADOW), GetResistance(SPELL_SCHOOL_ARCANE)); + sLog->outDebug(LOG_FILTER_UNITS, "MIN_DAMAGE is: \t\t%f\tMAX_DAMAGE is: \t\t%f",GetFloatValue(UNIT_FIELD_MINDAMAGE), GetFloatValue(UNIT_FIELD_MAXDAMAGE)); + sLog->outDebug(LOG_FILTER_UNITS, "MIN_OFFHAND_DAMAGE is: \t%f\tMAX_OFFHAND_DAMAGE is: \t%f",GetFloatValue(UNIT_FIELD_MINOFFHANDDAMAGE), GetFloatValue(UNIT_FIELD_MAXOFFHANDDAMAGE)); + sLog->outDebug(LOG_FILTER_UNITS, "MIN_RANGED_DAMAGE is: \t%f\tMAX_RANGED_DAMAGE is: \t%f",GetFloatValue(UNIT_FIELD_MINRANGEDDAMAGE), GetFloatValue(UNIT_FIELD_MAXRANGEDDAMAGE)); + sLog->outDebug(LOG_FILTER_UNITS, "ATTACK_TIME is: \t%u\t\tRANGE_ATTACK_TIME is: \t%u",GetAttackTime(BASE_ATTACK), GetAttackTime(RANGED_ATTACK)); } /*********************************************************/ @@ -18762,7 +18927,7 @@ void Player::SavePositionInDB(uint32 mapid, float x,float y,float z,float o,uint << "',position_z='"<outDebug("%s", ss.str().c_str()); + sLog->outDebug(LOG_FILTER_UNITS, "%s", ss.str().c_str()); CharacterDatabase.Execute(ss.str().c_str()); } @@ -19006,7 +19171,7 @@ void Player::RemovePet(Pet* pet, PetSaveMode mode, bool returnreagent) if (pet) { - sLog->outDebug("RemovePet %u, %u, %u", pet->GetEntry(), mode, returnreagent); + sLog->outDebug(LOG_FILTER_PETS,"RemovePet %u, %u, %u", pet->GetEntry(), mode, returnreagent); if (pet->m_removed) return; @@ -19198,7 +19363,7 @@ void Player::PetSpellInitialize() if (!pet) return; - sLog->outDebug("Pet Spells Groups"); + sLog->outDebug(LOG_FILTER_PETS,"Pet Spells Groups"); CharmInfo *charmInfo = pet->GetCharmInfo(); @@ -19319,7 +19484,7 @@ void Player::VehicleSpellInitialize() ConditionList conditions = sConditionMgr->GetConditionsForVehicleSpell(veh->ToCreature()->GetEntry(), spellId); if (!sConditionMgr->IsPlayerMeetToConditions(this, conditions)) { - sLog->outDebug("VehicleSpellInitialize: conditions not met for Vehicle entry %u spell %u", veh->ToCreature()->GetEntry(), spellId); + sLog->outDebug(LOG_FILTER_CONDITIONSYS, "VehicleSpellInitialize: conditions not met for Vehicle entry %u spell %u", veh->ToCreature()->GetEntry(), spellId); continue; } if (IsPassiveSpell(spellId)) @@ -19418,7 +19583,7 @@ bool Player::IsAffectedBySpellmod(SpellEntry const *spellInfo, SpellModifier *mo void Player::AddSpellMod(SpellModifier* mod, bool apply) { - sLog->outDebug("Player::AddSpellMod %d", mod->spellId); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Player::AddSpellMod %d", mod->spellId); uint16 Opcode = (mod->type == SPELLMOD_FLAT) ? SMSG_SET_FLAT_SPELL_MODIFIER : SMSG_SET_PCT_SPELL_MODIFIER; int i = 0; @@ -19855,7 +20020,7 @@ bool Player::ActivateTaxiPathTo(std::vector const& nodes, Creature* npc WorldPacket data(SMSG_ACTIVATETAXIREPLY, 4); data << uint32(ERR_TAXIOK); GetSession()->SendPacket(&data); - sLog->outDebug("WORLD: Sent SMSG_ACTIVATETAXIREPLY"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_ACTIVATETAXIREPLY"); GetSession()->SendDoFlight(mount_display_id, sourcepath); } return true; @@ -19890,7 +20055,7 @@ void Player::ContinueTaxiFlight() if (!sourceNode) return; - sLog->outDebug("WORLD: Restart character %u taxi flight", GetGUIDLow()); + sLog->outDebug(LOG_FILTER_UNITS, "WORLD: Restart character %u taxi flight", GetGUIDLow()); uint32 mountDisplayId = sObjectMgr->GetTaxiMountDisplayId(sourceNode, GetTeam(),true); uint32 path = m_taxi.GetCurrentTaxiPath(); @@ -20131,7 +20296,7 @@ bool Player::BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32 Creature *pCreature = GetNPCIfCanInteractWith(vendorguid,UNIT_NPC_FLAG_VENDOR); if (!pCreature) { - sLog->outDebug("WORLD: BuyItemFromVendor - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(vendorguid))); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: BuyItemFromVendor - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(vendorguid))); SendBuyError(BUY_ERR_DISTANCE_TOO_FAR, NULL, item, 0); return false; } @@ -20251,7 +20416,7 @@ bool Player::BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32 return crItem->maxcount != 0; } -uint32 Player::GetMaxPersonalArenaRatingRequirement(uint32 minarenaslot) +uint32 Player::GetMaxPersonalArenaRatingRequirement(uint32 minarenaslot) const { // returns the maximal personal arena rating that can be used to purchase items requiring this condition // the personal rating of the arena team must match the required limit as well @@ -20306,7 +20471,7 @@ void Player::UpdateHomebindTime(uint32 time) data << uint32(m_HomebindTimer); data << uint32(1); GetSession()->SendPacket(&data); - sLog->outDebug("PLAYER: Player '%s' (GUID: %u) will be teleported to homebind in 60 seconds", GetName(),GetGUIDLow()); + sLog->outDebug(LOG_FILTER_MAPS, "PLAYER: Player '%s' (GUID: %u) will be teleported to homebind in 60 seconds", GetName(),GetGUIDLow()); } } @@ -20466,10 +20631,10 @@ void Player::AddSpellCooldown(uint32 spellid, uint32 itemid, time_t end_time) void Player::SendCooldownEvent(SpellEntry const *spellInfo, uint32 itemId, Spell* spell) { // start cooldowns at server side, if any - AddSpellAndCategoryCooldowns(spellInfo,itemId,spell); + AddSpellAndCategoryCooldowns(spellInfo, itemId, spell); // Send activate cooldown timer (possible 0) at client side - WorldPacket data(SMSG_COOLDOWN_EVENT, (4+8)); + WorldPacket data(SMSG_COOLDOWN_EVENT, 4 + 8); data << uint32(spellInfo->Id); data << uint64(GetGUID()); SendDirectMessage(&data); @@ -20578,7 +20743,7 @@ bool Player::EnchantmentFitsRequirements(uint32 enchantmentcondition, int8 slot) } } - sLog->outDebug("Checking Condition %u, there are %u Meta Gems, %u Red Gems, %u Yellow Gems and %u Blue Gems, Activate:%s", enchantmentcondition, curcount[0], curcount[1], curcount[2], curcount[3], activate ? "yes" : "no"); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Checking Condition %u, there are %u Meta Gems, %u Red Gems, %u Yellow Gems and %u Blue Gems, Activate:%s", enchantmentcondition, curcount[0], curcount[1], curcount[2], curcount[3], activate ? "yes" : "no"); return activate; } @@ -20896,8 +21061,7 @@ void Player::UpdateVisibilityOf(WorldObject* target) m_clientGUIDs.erase(target->GetGUID()); #ifdef TRINITY_DEBUG - if ((sLog->getLogFilter() & LOG_FILTER_VISIBILITY_CHANGES) == 0) - sLog->outDebug("Object %u (Type: %u) out of range for player %u. Distance = %f",target->GetGUIDLow(),target->GetTypeId(),GetGUIDLow(),GetDistance(target)); + sLog->outDebug(LOG_FILTER_MAPS, "Object %u (Type: %u) out of range for player %u. Distance = %f",target->GetGUIDLow(),target->GetTypeId(),GetGUIDLow(),GetDistance(target)); #endif } } @@ -20912,8 +21076,7 @@ void Player::UpdateVisibilityOf(WorldObject* target) m_clientGUIDs.insert(target->GetGUID()); #ifdef TRINITY_DEBUG - if ((sLog->getLogFilter() & LOG_FILTER_VISIBILITY_CHANGES) == 0) - sLog->outDebug("Object %u (Type: %u) is visible now for player %u. Distance = %f",target->GetGUIDLow(),target->GetTypeId(),GetGUIDLow(),GetDistance(target)); + sLog->outDebug(LOG_FILTER_MAPS, "Object %u (Type: %u) is visible now for player %u. Distance = %f",target->GetGUIDLow(),target->GetTypeId(),GetGUIDLow(),GetDistance(target)); #endif // target aura duration for caster show only if target exist at caster client @@ -20971,8 +21134,7 @@ void Player::UpdateVisibilityOf(T* target, UpdateData& data, std::set& vi m_clientGUIDs.erase(target->GetGUID()); #ifdef TRINITY_DEBUG - if ((sLog->getLogFilter() & LOG_FILTER_VISIBILITY_CHANGES) == 0) - sLog->outDebug("Object %u (Type: %u, Entry: %u) is out of range for player %u. Distance = %f",target->GetGUIDLow(),target->GetTypeId(),target->GetEntry(),GetGUIDLow(),GetDistance(target)); + sLog->outDebug(LOG_FILTER_MAPS, "Object %u (Type: %u, Entry: %u) is out of range for player %u. Distance = %f",target->GetGUIDLow(),target->GetTypeId(),target->GetEntry(),GetGUIDLow(),GetDistance(target)); #endif } } @@ -20987,8 +21149,7 @@ void Player::UpdateVisibilityOf(T* target, UpdateData& data, std::set& vi UpdateVisibilityOf_helper(m_clientGUIDs,target,visibleNow); #ifdef TRINITY_DEBUG - if ((sLog->getLogFilter() & LOG_FILTER_VISIBILITY_CHANGES) == 0) - sLog->outDebug("Object %u (Type: %u, Entry: %u) is visible now for player %u. Distance = %f",target->GetGUIDLow(),target->GetTypeId(),target->GetEntry(),GetGUIDLow(),GetDistance(target)); + sLog->outDebug(LOG_FILTER_MAPS, "Object %u (Type: %u, Entry: %u) is visible now for player %u. Distance = %f",target->GetGUIDLow(),target->GetTypeId(),target->GetEntry(),GetGUIDLow(),GetDistance(target)); #endif } } @@ -21420,7 +21581,7 @@ void Player::learnDefaultSpells() for (PlayerCreateInfoSpells::const_iterator itr = info->spell.begin(); itr != info->spell.end(); ++itr) { uint32 tspell = *itr; - sLog->outDebug("PLAYER (Class: %u Race: %u): Adding initial spell, id = %u",uint32(getClass()),uint32(getRace()), tspell); + sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "PLAYER (Class: %u Race: %u): Adding initial spell, id = %u",uint32(getClass()),uint32(getRace()), tspell); if (!IsInWorld()) // will send in INITIAL_SPELLS in list anyway at map add addSpell(tspell,true,true,true,false); else // but send in normal spell in game learn case @@ -21617,7 +21778,6 @@ void Player::SetDailyQuestStatus(uint32 quest_id) } } - void Player::SetWeeklyQuestStatus(uint32 quest_id) { m_weeklyquests.insert(quest_id); @@ -22082,119 +22242,9 @@ bool Player::GetsRecruitAFriendBonus(bool forXP) return recruitAFriend; } -bool Player::RewardPlayerAndGroupAtKill(Unit* pVictim) +void Player::RewardPlayerAndGroupAtKill(Unit* pVictim, bool isBattleGround) { - bool PvP = pVictim->isCharmedOwnedByPlayerOrPlayer(); - - // prepare data for near group iteration (PvP and !PvP cases) - uint32 xp = 0; - bool honored_kill = false; - - if (Group *pGroup = GetGroup()) - { - uint32 count = 0; - uint32 sum_level = 0; - Player* member_with_max_level = NULL; - Player* not_gray_member_with_max_level = NULL; - - pGroup->GetDataForXPAtKill(pVictim,count,sum_level,member_with_max_level,not_gray_member_with_max_level); - - if (member_with_max_level) - { - // PvP kills doesn't yield experience - // also no XP gained if there is no member below gray level - xp = (PvP || !not_gray_member_with_max_level || GetVehicle()) ? 0 : Trinity::XP::Gain(not_gray_member_with_max_level, pVictim); - - /// skip in check PvP case (for speed, not used) - bool is_raid = PvP ? false : sMapStore.LookupEntry(GetMapId())->IsRaid() && pGroup->isRaidGroup(); - bool is_dungeon = PvP ? false : sMapStore.LookupEntry(GetMapId())->IsDungeon(); - float group_rate = Trinity::XP::xp_in_group_rate(count,is_raid); - - for (GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next()) - { - Player* pGroupGuy = itr->getSource(); - if (!pGroupGuy) - continue; - - if (!pGroupGuy->IsAtGroupRewardDistance(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) - honored_kill = true; - - // xp and reputation only in !PvP case - if (!PvP) - { - float rate = group_rate * float(pGroupGuy->getLevel()) / sum_level; - - // if is in dungeon then all receive full reputation at kill - // rewarded any alive/dead/near_corpse group member - pGroupGuy->RewardReputation(pVictim,is_dungeon ? 1.0f : rate); - - // XP updated only for alive group member - if (pGroupGuy->isAlive() && not_gray_member_with_max_level && - pGroupGuy->getLevel() <= not_gray_member_with_max_level->getLevel()) - { - uint32 itr_xp = (member_with_max_level == not_gray_member_with_max_level) ? uint32(xp * rate) : uint32((xp * rate / 2) + 1); - - // handle SPELL_AURA_MOD_XP_PCT auras - Unit::AuraEffectList const& ModXPPctAuras = GetAuraEffectsByType(SPELL_AURA_MOD_XP_PCT); - for (Unit::AuraEffectList::const_iterator i = ModXPPctAuras.begin(); i != ModXPPctAuras.end(); ++i) - AddPctN(itr_xp, (*i)->GetAmount()); - - pGroupGuy->GiveXP(itr_xp, pVictim, group_rate); - if (Pet* pet = pGroupGuy->GetPet()) - pet->GivePetXP(itr_xp / 2); - } - - // quest objectives updated only for alive group member or dead but with not released body - if (pGroupGuy->isAlive()|| !pGroupGuy->GetCorpse()) - { - // normal creature (not pet/etc) can be only in !PvP case - if (pVictim->GetTypeId() == TYPEID_UNIT) - pGroupGuy->KilledMonster(pVictim->ToCreature()->GetCreatureInfo(), pVictim->GetGUID()); - } - } - } - } - } - else // if (!pGroup) - { - 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)) - honored_kill = true; - - // xp and reputation only in !PvP case - if (!PvP) - { - RewardReputation(pVictim,1); - - // handle SPELL_AURA_MOD_XP_PCT auras - Unit::AuraEffectList const& ModXPPctAuras = GetAuraEffectsByType(SPELL_AURA_MOD_XP_PCT); - for (Unit::AuraEffectList::const_iterator i = ModXPPctAuras.begin(); i != ModXPPctAuras.end(); ++i) - AddPctN(xp, (*i)->GetAmount()); - - GiveXP(xp, pVictim); - - if (Pet* pet = GetPet()) - pet->GivePetXP(xp); - - // normal creature (not pet/etc) can be only in !PvP case - if (pVictim->GetTypeId() == TYPEID_UNIT) - KilledMonster(pVictim->ToCreature()->GetCreatureInfo(), pVictim->GetGUID()); - } - } - - // Credit encounter in instance - if (Creature* victim = pVictim->ToCreature()) - if (victim->IsDungeonBoss()) - if (InstanceScript* instance = pVictim->GetInstanceScript()) - instance->UpdateEncounterState(ENCOUNTER_CREDIT_KILL_CREATURE, pVictim->GetEntry(), pVictim); - - return xp || honored_kill; + KillRewarder(this, pVictim, isBattleGround).Reward(); } void Player::RewardPlayerAndGroupAtEvent(uint32 creature_id, WorldObject* pRewardSource) @@ -22629,9 +22679,9 @@ void Player::StopCastingBindSight() { if (target->isType(TYPEMASK_UNIT)) { - ((Unit*)target)->RemoveAura(SPELL_AURA_BIND_SIGHT, GetGUID()); - ((Unit*)target)->RemoveAura(SPELL_AURA_MOD_POSSESS, GetGUID()); - ((Unit*)target)->RemoveAura(SPELL_AURA_MOD_POSSESS_PET, GetGUID()); + ((Unit*)target)->RemoveAurasByType(SPELL_AURA_BIND_SIGHT, GetGUID()); + ((Unit*)target)->RemoveAurasByType(SPELL_AURA_MOD_POSSESS, GetGUID()); + ((Unit*)target)->RemoveAurasByType(SPELL_AURA_MOD_POSSESS_PET, GetGUID()); } } } @@ -22640,7 +22690,7 @@ void Player::SetViewpoint(WorldObject* target, bool apply) { if (apply) { - sLog->outDebug("Player::CreateViewpoint: Player %s create seer %u (TypeId: %u).", GetName(), target->GetEntry(), target->GetTypeId()); + sLog->outDebug(LOG_FILTER_MAPS, "Player::CreateViewpoint: Player %s create seer %u (TypeId: %u).", GetName(), target->GetEntry(), target->GetTypeId()); if (!AddUInt64Value(PLAYER_FARSIGHT, target->GetGUID())) { @@ -22656,7 +22706,7 @@ void Player::SetViewpoint(WorldObject* target, bool apply) } else { - sLog->outDebug("Player::CreateViewpoint: Player %s remove seer", GetName()); + sLog->outDebug(LOG_FILTER_MAPS, "Player::CreateViewpoint: Player %s remove seer", GetName()); if (!RemoveUInt64Value(PLAYER_FARSIGHT, target->GetGUID())) { @@ -22908,7 +22958,7 @@ bool Player::HasGlobalCooldown(SpellEntry const *spellInfo) const void Player::RemoveGlobalCooldown(SpellEntry const *spellInfo) { - if (!spellInfo) + if (!spellInfo || !spellInfo->StartRecoveryTime) return; m_globalCooldowns[spellInfo->StartRecoveryCategory] = 0; @@ -24209,6 +24259,11 @@ void Player::ActivateSpec(uint8 spec) if (GetPet()) GetPet()->RemoveAllAurasOnDeath();*/ + // Hack: Remove DK Presences, to avoid some exploits + RemoveAurasDueToSpell(48263); + RemoveAurasDueToSpell(48265); + RemoveAurasDueToSpell(48266); + //RemoveAllAuras(GetGUID(), NULL, false, true); // removes too many auras //ExitVehicle(); // should be impossible to switch specs from inside a vehicle.. @@ -24385,13 +24440,13 @@ void Player::SendRefundInfo(Item *item) if (!item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_REFUNDABLE)) { - sLog->outDebug("Item refund: item not refundable!"); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Item refund: item not refundable!"); return; } if (GetGUIDLow() != item->GetRefundRecipient()) // Formerly refundable item got traded { - sLog->outDebug("Item refund: item was traded!"); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Item refund: item was traded!"); item->SetNotRefundable(this); return; } @@ -24399,7 +24454,7 @@ void Player::SendRefundInfo(Item *item) ItemExtendedCostEntry const* iece = sItemExtendedCostStore.LookupEntry(item->GetPaidExtendedCost()); if (!iece) { - sLog->outDebug("Item refund: cannot find extendedcost data."); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Item refund: cannot find extendedcost data."); return; } @@ -24445,7 +24500,7 @@ void Player::RefundItem(Item *item) { if (!item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_REFUNDABLE)) { - sLog->outDebug("Item refund: item not refundable!"); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Item refund: item not refundable!"); return; } @@ -24461,7 +24516,7 @@ void Player::RefundItem(Item *item) if (GetGUIDLow() != item->GetRefundRecipient()) // Formerly refundable item got traded { - sLog->outDebug("Item refund: item was traded!"); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Item refund: item was traded!"); item->SetNotRefundable(this); return; } @@ -24469,7 +24524,7 @@ void Player::RefundItem(Item *item) ItemExtendedCostEntry const* iece = sItemExtendedCostStore.LookupEntry(item->GetPaidExtendedCost()); if (!iece) { - sLog->outDebug("Item refund: cannot find extendedcost data."); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Item refund: cannot find extendedcost data."); return; } @@ -24616,12 +24671,6 @@ void Player::_SaveInstanceTimeRestrictions(SQLTransaction& trans) } } -void Player::SendClearFocus(Unit* target) -{ - WorldPacket data(SMSG_BREAK_TARGET, target->GetPackGUID().size()); - data.append(target->GetPackGUID()); - GetSession()->SendPacket(&data); -} /** World of Warcraft Armory **/ void Player::WriteWowArmoryDatabaseLog(uint32 type, uint32 data) diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 38c5f4e9b0ad9..bbdab83c9a158 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1001,6 +1001,41 @@ struct AnticheatData bool reported; }; +class KillRewarder +{ +public: + KillRewarder(Player* killer, Unit* victim, bool isBattleGround); + + void Reward(); + +private: + void _InitXP(Player* player); + void _InitGroupData(); + + void _RewardHonor(Player* player); + void _RewardXP(Player* player, float rate); + void _RewardReputation(Player* player, float rate); + void _RewardKillCredit(Player* player); + void _RewardPlayer(Player* player, bool isDungeon); + void _RewardGroup(); + + Player* _killer; + Unit* _victim; + bool _isBattleGround; + + bool _isPvP; + + Group* _group; + float _groupRate; + uint8 _maxLevel; + Player* _maxNotGrayMember; + uint32 _count; + uint32 _sumLevel; + bool _isFullXP; + + uint32 _xp; +}; + class Player : public Unit, public GridObject { friend class WorldSession; @@ -1155,6 +1190,7 @@ class Player : public Unit, public GridObject Item* GetItemByEntry(uint32 entry) const; Item* GetItemByPos(uint16 pos) const; Item* GetItemByPos(uint8 bag, uint8 slot) const; + Bag* GetBagByPos(uint8 slot) const; inline Item* GetUseableItemByPos(uint8 bag, uint8 slot) const //Does additional check for disarmed weapons { if (!CanUseAttackType(GetAttackBySlot(slot))) @@ -1655,6 +1691,8 @@ class Player : public Unit, public GridObject void RemoveSpellCategoryCooldown(uint32 cat, bool update = false); void SendClearCooldown(uint32 spell_id, Unit* target); + GlobalCooldownMgr& GetGlobalCooldownMgr() { return m_GlobalCooldownMgr; } + void RemoveCategoryCooldown(uint32 cat); void RemoveArenaSpellCooldowns(bool removeActivePetCooldowns = false); void RemoveAllSpellCooldown(); @@ -1760,12 +1798,12 @@ class Player : public Unit, public GridObject { SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (slot * ARENA_TEAM_END) + type, value); } - uint32 GetArenaTeamId(uint8 slot) { return GetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (slot * ARENA_TEAM_END) + ARENA_TEAM_ID); } - uint32 GetArenaPersonalRating(uint8 slot) { return GetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (slot * ARENA_TEAM_END) + ARENA_TEAM_PERSONAL_RATING); } static uint32 GetArenaTeamIdFromDB(uint64 guid, uint8 slot); + static void LeaveAllArenaTeams(uint64 guid); + uint32 GetArenaTeamId(uint8 slot) const { return GetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (slot * ARENA_TEAM_END) + ARENA_TEAM_ID); } + uint32 GetArenaPersonalRating(uint8 slot) const { return GetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (slot * ARENA_TEAM_END) + ARENA_TEAM_PERSONAL_RATING); } void SetArenaTeamIdInvited(uint32 ArenaTeamId) { m_ArenaTeamIdInvited = ArenaTeamId; } uint32 GetArenaTeamIdInvited() { return m_ArenaTeamIdInvited; } - static void LeaveAllArenaTeams(uint64 guid); Difficulty GetDifficulty(bool isRaid) const { return isRaid ? m_raidDifficulty : m_dungeonDifficulty; } Difficulty GetDungeonDifficulty() const { return m_dungeonDifficulty; } @@ -1942,15 +1980,14 @@ class Player : public Unit, public GridObject static uint32 TeamForRace(uint8 race); uint32 GetTeam() const { return m_team; } TeamId GetTeamId() const { return m_team == ALLIANCE ? TEAM_ALLIANCE : TEAM_HORDE; } - static uint32 getFactionForRace(uint8 race); void setFactionForRace(uint8 race); void InitDisplayIds(); bool IsAtGroupRewardDistance(WorldObject const* pRewardSource) const; bool IsAtRecruitAFriendDistance(WorldObject const* pOther) const; - bool RewardPlayerAndGroupAtKill(Unit* pVictim); - void RewardPlayerAndGroupAtEvent(uint32 creature_id,WorldObject* pRewardSource); + void RewardPlayerAndGroupAtKill(Unit* pVictim, bool isBattleGround); + void RewardPlayerAndGroupAtEvent(uint32 creature_id, WorldObject* pRewardSource); bool isHonorOrXPTarget(Unit* pVictim); bool GetsRecruitAFriendBonus(bool forXP); @@ -1971,23 +2008,13 @@ class Player : public Unit, public GridObject /*********************************************************/ void UpdateHonorFields(); 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); } + uint32 GetHonorPoints() const { return GetUInt32Value(PLAYER_FIELD_HONOR_CURRENCY); } + uint32 GetArenaPoints() const { return GetUInt32Value(PLAYER_FIELD_ARENA_CURRENCY); } void ModifyHonorPoints(int32 value); void ModifyArenaPoints(int32 value); - uint32 GetMaxPersonalArenaRatingRequirement(uint32 minarenaslot); - void SetHonorPoints(uint32 value) - { - SetUInt32Value(PLAYER_FIELD_HONOR_CURRENCY, value); - if (value) - AddKnownCurrency(ITEM_HONOR_POINTS_ID); // Arena Points - } - void SetArenaPoints(uint32 value) - { - SetUInt32Value(PLAYER_FIELD_ARENA_CURRENCY, value); - if (value) - AddKnownCurrency(ITEM_ARENA_POINTS_ID); // Arena Points - } + uint32 GetMaxPersonalArenaRatingRequirement(uint32 minarenaslot) const; + void SetHonorPoints(uint32 value); + void SetArenaPoints(uint32 value); //End of PvP System @@ -2298,7 +2325,6 @@ class Player : public Unit, public GridObject void SendCinematicStart(uint32 CinematicSequenceId); void SendMovieStart(uint32 MovieId); - void SendClearFocus(Unit* target); /*********************************************************/ /*** INSTANCE SYSTEM ***/ @@ -2323,7 +2349,7 @@ class Player : public Unit, public GridObject bool HasPendingBind() const { return _pendingBind != NULL; } void SendRaidInfo(); void SendSavedInstances(); - static void ConvertInstancesToGroup(Player *player, Group *group = NULL, uint64 player_guid = 0); + static void ConvertInstancesToGroup(Player *player, Group *group, bool switchLeader); bool Satisfy(AccessRequirement const* ar, uint32 target_map, bool report = false); bool CheckInstanceLoginValid(); bool CheckInstanceCount(uint32 instanceId) const @@ -2420,7 +2446,6 @@ class Player : public Unit, public GridObject bool isDebugAreaTriggers; protected: - uint32 m_AreaID; uint32 m_regenTimerCount; float m_powerFraction[MAX_POWERS]; uint32 m_contestedPvPTimer; @@ -2463,7 +2488,7 @@ class Player : public Unit, public GridObject void _LoadAuras(PreparedQueryResult result, uint32 timediff); void _LoadGlyphAuras(); void _LoadBoundInstances(PreparedQueryResult result); - void _LoadInventory(PreparedQueryResult result, uint32 timediff); + void _LoadInventory(PreparedQueryResult result, uint32 timeDiff); void _LoadMailInit(PreparedQueryResult resultUnread, PreparedQueryResult resultDelivery); void _LoadMail(); void _LoadMailedItems(Mail *mail); @@ -2564,6 +2589,8 @@ class Player : public Unit, public GridObject PlayerTalentMap *m_talents[MAX_TALENT_SPECS]; uint32 m_lastPotionId; // last used health/mana potion in combat, that block next potion use + GlobalCooldownMgr m_GlobalCooldownMgr; + uint8 m_activeSpec; uint8 m_specsCount; @@ -2677,6 +2704,7 @@ class Player : public Unit, public GridObject uint8 _CanStoreItem_InBag(uint8 bag, ItemPosCountVec& dest, ItemPrototype const *pProto, uint32& count, bool merge, bool non_specialized, Item *pSrcItem, uint8 skip_bag, uint8 skip_slot) const; 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); + Item* _LoadItem(SQLTransaction& trans, uint32 zoneId, uint32 timeDiff, Field* fields); std::set m_refundableItems; void SendRefundInfo(Item* item); @@ -2747,11 +2775,13 @@ void AddItemsSetItem(Player*player,Item *item); void RemoveItemsSetItem(Player*player,ItemPrototype const *proto); // "the bodies of template functions must be made available in a header file" -template T Player::ApplySpellMod(uint32 spellId, SpellModOp op, T &basevalue, Spell * spell) +template T Player::ApplySpellMod(uint32 spellId, SpellModOp op, T &basevalue, Spell* spell) { - SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId); - if (!spellInfo) return 0; + SpellEntry const* spellInfo = sSpellStore.LookupEntry(spellId); + if (!spellInfo) + return 0; float totalmul = 1.0f; + float neg_totalmul = 1.0f; int32 totalflat = 0; // Drop charges for triggering spells instead of triggered ones @@ -2766,7 +2796,7 @@ template T Player::ApplySpellMod(uint32 spellId, SpellModOp op, T &bas if (!mod->ownerAura) ASSERT(mod->charges == 0); - if (!IsAffectedBySpellmod(spellInfo,mod,spell)) + if (!IsAffectedBySpellmod(spellInfo, mod, spell)) continue; if (mod->type == SPELLMOD_FLAT) @@ -2777,16 +2807,16 @@ template T Player::ApplySpellMod(uint32 spellId, SpellModOp op, T &bas if (basevalue == T(0)) continue; - // special case (skip >10sec spell casts for instant cast setting) - if (mod->op == SPELLMOD_CASTING_TIME && basevalue >= T(10000) && mod->value <= -100) + // special case (skip > 10sec spell casts for instant cast setting) + if (mod->op == SPELLMOD_CASTING_TIME && basevalue >= T(10000) && mod->value <= -100) continue; - AddFlatPctN(totalmul, mod->value); + AddFlatPctN(totalmul, neg_totalmul, mod->value); } DropModCharge(mod, spell); } - float diff = (float)basevalue * (totalmul - 1.0f) + (float)totalflat; + float diff = (float)basevalue * (totalmul * neg_totalmul - 1.0f) + (float)totalflat; basevalue = T((float)basevalue + diff); return T(diff); } diff --git a/src/server/game/Entities/Player/SocialMgr.cpp b/src/server/game/Entities/Player/SocialMgr.cpp index 4f7037cfbdca8..dbf9e29f87a08 100755 --- a/src/server/game/Entities/Player/SocialMgr.cpp +++ b/src/server/game/Entities/Player/SocialMgr.cpp @@ -144,7 +144,7 @@ void PlayerSocial::SendSocialList(Player* plr) } plr->GetSession()->SendPacket(&data); - sLog->outDebug("WORLD: Sent SMSG_CONTACT_LIST"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_CONTACT_LIST"); } bool PlayerSocial::HasFriend(uint32 friend_guid) diff --git a/src/server/game/Entities/Transport/Transport.cpp b/src/server/game/Entities/Transport/Transport.cpp index 7381f05994044..e60f415dc1511 100755 --- a/src/server/game/Entities/Transport/Transport.cpp +++ b/src/server/game/Entities/Transport/Transport.cpp @@ -176,6 +176,7 @@ void MapManager::LoadTransportNPCs() Transport::Transport(uint32 period, uint32 script) : GameObject(), m_period(period), ScriptId(script) { m_updateFlag = (UPDATEFLAG_TRANSPORT | UPDATEFLAG_HIGHGUID | UPDATEFLAG_HAS_POSITION | UPDATEFLAG_ROTATION); + currenttguid = 0; } Transport::~Transport() @@ -575,11 +576,10 @@ void Transport::Update(uint32 p_diff) m_nextNodeTime = m_curr->first; - if (m_curr == m_WayPoints.begin() && (sLog->getLogFilter() & LOG_FILTER_TRANSPORT_MOVES) == 0) - sLog->outDetail(" ************ BEGIN ************** %s", m_name.c_str()); + if (m_curr == m_WayPoints.begin()) + sLog->outDebug(LOG_FILTER_TRANSPORTS," ************ BEGIN ************** %s", m_name.c_str()); - if ((sLog->getLogFilter() & LOG_FILTER_TRANSPORT_MOVES) == 0) - sLog->outDetail("%s moved to %d %f %f %f %d", m_name.c_str(), m_curr->second.id, m_curr->second.x, m_curr->second.y, m_curr->second.z, m_curr->second.mapid); + sLog->outDebug(LOG_FILTER_TRANSPORTS, "%s moved to %d %f %f %f %d", m_name.c_str(), m_curr->second.id, m_curr->second.x, m_curr->second.y, m_curr->second.z, m_curr->second.mapid); } sScriptMgr->OnTransportUpdate(this, p_diff); @@ -622,7 +622,7 @@ 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()); + sLog->outDebug(LOG_FILTER_MAPSCRIPTS, "Taxi %s event %u of node %u of %s path", departure ? "departure" : "arrival", eventid, node.first, GetName()); GetMap()->ScriptsStart(sEventScripts, eventid, this, this); EventInform(eventid); } @@ -687,6 +687,7 @@ uint32 Transport::AddNPCPassenger(uint32 tguid, uint32 entry, float x, float y, else currenttguid = std::max(tguid, currenttguid); + pCreature->setActive(true); pCreature->SetGUIDTransport(tguid); sScriptMgr->OnAddCreaturePassenger(this, pCreature); return tguid; diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp index 0371bcb192bd5..cfb628b7cfb45 100755 --- a/src/server/game/Entities/Unit/StatSystem.cpp +++ b/src/server/game/Entities/Unit/StatSystem.cpp @@ -327,38 +327,47 @@ void Player::UpdateAttackPowerAndDamage(bool ranged) case CLASS_SHAMAN: val2 = level * 2.0f + GetStat(STAT_STRENGTH) + GetStat(STAT_AGILITY) - 20.0f; break; case CLASS_DRUID: { - ShapeshiftForm form = GetShapeshiftForm(); // Check if Predatory Strikes is skilled float mLevelMult = 0.0f; - switch (form) + float weapon_bonus = 0.0f; + if (IsInFeralForm()) { - case FORM_CAT: - case FORM_BEAR: - case FORM_DIREBEAR: - case FORM_MOONKIN: + Unit::AuraEffectList const& mDummy = GetAuraEffectsByType(SPELL_AURA_DUMMY); + for (Unit::AuraEffectList::const_iterator itr = mDummy.begin(); itr != mDummy.end(); ++itr) { - Unit::AuraEffectList const& mDummy = GetAuraEffectsByType(SPELL_AURA_DUMMY); - for (Unit::AuraEffectList::const_iterator itr = mDummy.begin(); itr != mDummy.end(); ++itr) + if ((*itr)->GetSpellProto()->SpellIconID == 1563) { - // Predatory Strikes (effect 0) - if ((*itr)->GetEffIndex() == 0 && (*itr)->GetSpellProto()->SpellIconID == 1563) + switch ((*itr)->GetEffIndex()) { - mLevelMult = CalculatePctN(1.0f, (*itr)->GetAmount()); - break; + case 0: // Predatory Strikes (effect 0) + mLevelMult = CalculatePctN(1.0f, (*itr)->GetAmount()); + break; + case 1: // Predatory Strikes (effect 1) + if (m_items[EQUIPMENT_SLOT_MAINHAND]) + { + // also gains % attack power from equipped weapon + ItemPrototype const *proto = m_items[EQUIPMENT_SLOT_MAINHAND]->GetProto(); + if (!proto) + continue; + + weapon_bonus = CalculatePctN(proto->getFeralBonus(), (*itr)->GetAmount()); + } + break; + default: + break; } } - break; } - default: break; } + ShapeshiftForm form = GetShapeshiftForm(); switch (form) { case FORM_CAT: - val2 = getLevel() * (mLevelMult + 2.0f) + GetStat(STAT_STRENGTH) * 2.0f + GetStat(STAT_AGILITY) - 20.0f + m_baseFeralAP; break; + val2 = getLevel() * (mLevelMult + 2.0f) + GetStat(STAT_STRENGTH) * 2.0f + GetStat(STAT_AGILITY) - 20.0f + weapon_bonus + m_baseFeralAP; break; case FORM_BEAR: case FORM_DIREBEAR: - val2 = getLevel() * (mLevelMult + 3.0f) + GetStat(STAT_STRENGTH) * 2.0f - 20.0f + m_baseFeralAP; break; + val2 = getLevel() * (mLevelMult + 3.0f) + GetStat(STAT_STRENGTH) * 2.0f - 20.0f + weapon_bonus + m_baseFeralAP; break; case FORM_MOONKIN: val2 = getLevel() * (mLevelMult + 1.5f) + GetStat(STAT_STRENGTH) * 2.0f - 20.0f + m_baseFeralAP; break; default: @@ -587,6 +596,41 @@ void Player::UpdateAllCritPercentages() UpdateCritPercentage(RANGED_ATTACK); } +// Avoidance Diminishing Returns +// Constants +#define DR_K_WARRIOR 0.956 +#define DR_K_PALADIN 0.956 +#define DR_K_HUNTER 0.988 +#define DR_K_ROGUE 0.988 +#define DR_K_PRIEST 0.953 +#define DR_K_DEATH_KNIGHT 0.956 +#define DR_K_SHAMAN 0.988 +#define DR_K_MAGE 0.953 +#define DR_K_WARLOCK 0.953 +#define DR_K_DRUID 0.972 +// Parry Caps +#define DR_PARRY_CAP_WARRIOR 47.003525 +#define DR_PARRY_CAP_PALADIN 47.003525 +#define DR_PARRY_CAP_HUNTER 145.560408 +#define DR_PARRY_CAP_ROGUE 145.560408 +#define DR_PARRY_CAP_PRIEST 0 +#define DR_PARRY_CAP_DEATH_KNIGHT 47.003525 +#define DR_PARRY_CAP_SHAMAN 145.560408 +#define DR_PARRY_CAP_MAGE 0 +#define DR_PARRY_CAP_WARLOCK 0 +#define DR_PARRY_CAP_DRUID 0 +// Dodge Caps +#define DR_DODGE_CAP_WARRIOR 88.129021 +#define DR_DODGE_CAP_PALADIN 88.129021 +#define DR_DODGE_CAP_HUNTER 145.560408 +#define DR_DODGE_CAP_ROGUE 145.560408 +#define DR_DODGE_CAP_PRIEST 150.375940 +#define DR_DODGE_CAP_DEATH_KNIGHT 88.129021 +#define DR_DODGE_CAP_SHAMAN 145.560408 +#define DR_DODGE_CAP_MAGE 150.375940 +#define DR_DODGE_CAP_WARLOCK 150.375940 +#define DR_DODGE_CAP_DRUID 116.890707 + void Player::UpdateParryPercentage() { // No parry @@ -597,10 +641,58 @@ void Player::UpdateParryPercentage() value = 5.0f; // Modify value from defense skill value += (int32(GetDefenseSkillValue()) - int32(GetMaxSkillValueForLevel())) * 0.04f; - // Parry from SPELL_AURA_MOD_PARRY_PERCENT aura - value += GetTotalAuraModifier(SPELL_AURA_MOD_PARRY_PERCENT); // Parry from rating value += GetRatingBonusValue(CR_PARRY); + //Diminishing Returns + float dr_k = 0.0f; + float dr_cap = 0.0f; + switch (getClass()) + { + case CLASS_WARRIOR: + dr_k = DR_K_WARRIOR; + dr_cap = DR_PARRY_CAP_WARRIOR; + break; + case CLASS_PALADIN: + dr_k = DR_K_PALADIN; + dr_cap = DR_PARRY_CAP_PALADIN; + break; + case CLASS_HUNTER: + dr_k = DR_K_HUNTER; + dr_cap = DR_PARRY_CAP_HUNTER; + break; + case CLASS_ROGUE: + dr_k = DR_K_ROGUE; + dr_cap = DR_PARRY_CAP_ROGUE; + break; + case CLASS_PRIEST: + dr_k = DR_K_PRIEST; + dr_cap = DR_PARRY_CAP_PRIEST; + break; + case CLASS_DEATH_KNIGHT: + dr_k = DR_K_DEATH_KNIGHT; + dr_cap = DR_PARRY_CAP_DEATH_KNIGHT; + break; + case CLASS_SHAMAN: + dr_k = DR_K_SHAMAN; + dr_cap = DR_PARRY_CAP_SHAMAN; + break; + case CLASS_MAGE: + dr_k = DR_K_MAGE; + dr_cap = DR_PARRY_CAP_MAGE; + break; + case CLASS_WARLOCK: + dr_k = DR_K_WARLOCK; + dr_cap = DR_PARRY_CAP_WARLOCK; + break; + case CLASS_DRUID: + dr_k = DR_K_DRUID; + dr_cap = DR_PARRY_CAP_DRUID; + break; + } + value = (value * dr_cap) / (value + dr_cap * dr_k); + // Parry from SPELL_AURA_MOD_PARRY_PERCENT aura + value += GetTotalAuraModifier(SPELL_AURA_MOD_PARRY_PERCENT); + value = value < 0.0f ? 0.0f : value; } SetStatFloatValue(PLAYER_PARRY_PERCENTAGE, value); @@ -612,10 +704,58 @@ void Player::UpdateDodgePercentage() float value = GetDodgeFromAgility(); // Modify value from defense skill value += (int32(GetDefenseSkillValue()) - int32(GetMaxSkillValueForLevel())) * 0.04f; - // Dodge from SPELL_AURA_MOD_DODGE_PERCENT aura - value += GetTotalAuraModifier(SPELL_AURA_MOD_DODGE_PERCENT); // Dodge from rating value += GetRatingBonusValue(CR_DODGE); + //Diminishing Returns + float dr_k = 0.0f; + float dr_cap = 0.0f; + switch (getClass()) + { + case CLASS_WARRIOR: + dr_k = DR_K_WARRIOR; + dr_cap = DR_DODGE_CAP_WARRIOR; + break; + case CLASS_PALADIN: + dr_k = DR_K_PALADIN; + dr_cap = DR_DODGE_CAP_PALADIN; + break; + case CLASS_HUNTER: + dr_k = DR_K_HUNTER; + dr_cap = DR_DODGE_CAP_HUNTER; + break; + case CLASS_ROGUE: + dr_k = DR_K_ROGUE; + dr_cap = DR_DODGE_CAP_ROGUE; + break; + case CLASS_PRIEST: + dr_k = DR_K_PRIEST; + dr_cap = DR_DODGE_CAP_PRIEST; + break; + case CLASS_DEATH_KNIGHT: + dr_k = DR_K_DEATH_KNIGHT; + dr_cap = DR_DODGE_CAP_DEATH_KNIGHT; + break; + case CLASS_SHAMAN: + dr_k = DR_K_SHAMAN; + dr_cap = DR_DODGE_CAP_SHAMAN; + break; + case CLASS_MAGE: + dr_k = DR_K_MAGE; + dr_cap = DR_DODGE_CAP_MAGE; + break; + case CLASS_WARLOCK: + dr_k = DR_K_WARLOCK; + dr_cap = DR_DODGE_CAP_WARLOCK; + break; + case CLASS_DRUID: + dr_k = DR_K_DRUID; + dr_cap = DR_DODGE_CAP_DRUID; + break; + } + value = (value * dr_cap) / (value + dr_cap * dr_k); + // Dodge from SPELL_AURA_MOD_DODGE_PERCENT aura + value += GetTotalAuraModifier(SPELL_AURA_MOD_DODGE_PERCENT); + value = value < 0.0f ? 0.0f : value; SetStatFloatValue(PLAYER_DODGE_PERCENTAGE, value); } @@ -931,6 +1071,7 @@ void Creature::UpdateDamagePhysical(WeaponAttackType attType) #define ENTRY_FIRE_ELEMENTAL 15438 #define ENTRY_GHOUL 26125 #define ENTRY_FERAL_SPIRIT 29264 +#define ENTRY_BLOODWORM 28017 bool Guardian::UpdateStats(Stats stat) { @@ -1094,14 +1235,14 @@ void Guardian::UpdateMaxHealth() case ENTRY_SUCCUBUS: multiplicator = 9.1f; break; case ENTRY_FELHUNTER: multiplicator = 9.5f; break; case ENTRY_FELGUARD: multiplicator = 11.0f; break; - case ENTRY_GHOUL: multiplicator = 10.0f; break; + case ENTRY_BLOODWORM: multiplicator = 1.0f; break; default: multiplicator = 10.0f; break; } - float value = GetModifierValue(unitMod, BASE_VALUE) + GetCreateHealth(); - value *= GetModifierValue(unitMod, BASE_PCT); - value += GetModifierValue(unitMod, TOTAL_VALUE) + stamina * multiplicator; - value *= GetModifierValue(unitMod, TOTAL_PCT); + float value = GetModifierValue(unitMod, BASE_VALUE) + GetCreateHealth(); + value *= GetModifierValue(unitMod, BASE_PCT); + value += GetModifierValue(unitMod, TOTAL_VALUE) + stamina * multiplicator; + value *= GetModifierValue(unitMod, TOTAL_PCT); SetMaxHealth((uint32)value); } diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 4ce28f79c6d4e..503e5ef78c419 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -193,6 +193,26 @@ m_vehicleKit(NULL), m_unitTypeMask(UNIT_MASK_NONE), m_HostileRefManager(this) m_serverSideVisibility.SetValue(SERVERSIDE_VISIBILITY_GHOST, GHOST_VISIBILITY_ALIVE); } +//////////////////////////////////////////////////////////// +// Methods of class GlobalCooldownMgr +bool GlobalCooldownMgr::HasGlobalCooldown(SpellEntry const* spellInfo) const +{ + GlobalCooldownList::const_iterator itr = m_GlobalCooldowns.find(spellInfo->StartRecoveryCategory); + return itr != m_GlobalCooldowns.end() && itr->second.duration && getMSTimeDiff(itr->second.cast_time, getMSTime()) < itr->second.duration; +} + +void GlobalCooldownMgr::AddGlobalCooldown(SpellEntry const* spellInfo, uint32 gcd) +{ + m_GlobalCooldowns[spellInfo->StartRecoveryCategory] = GlobalCooldown(gcd, getMSTime()); +} + +void GlobalCooldownMgr::CancelGlobalCooldown(SpellEntry const* spellInfo) +{ + m_GlobalCooldowns[spellInfo->StartRecoveryCategory].duration = 0; +} + +//////////////////////////////////////////////////////////// +// Methods of class Unit Unit::~Unit() { // set current spells as deletable @@ -293,7 +313,6 @@ void Unit::SendMonsterMoveWithSpeedToCurrentDestination(Player* player) SendMonsterMoveWithSpeed(x, y, z, 0, player); } - void Unit::SendMonsterMoveWithSpeed(float x, float y, float z, uint32 transitTime, Player* player) { if (!transitTime) @@ -416,6 +435,27 @@ void Unit::SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint32 M SendMessageToSet(&data, true); } +void Unit::SendMonsterMoveExitVehicle(Position const* newPos) +{ + WorldPacket data(SMSG_MONSTER_MOVE, 1+12+4+1+4+4+4+12+GetPackGUID().size()); + data.append(GetPackGUID()); + + data << uint8(GetTypeId() == TYPEID_PLAYER ? 1 : 0); // new in 3.1, bool + data << GetPositionX() << GetPositionY() << GetPositionZ(); + data << getMSTime(); + + data << uint8(SPLINETYPE_FACING_ANGLE); + data << float(GetOrientation()); // guess + data << uint32(SPLINEFLAG_EXIT_VEHICLE); + data << uint32(0); // Time in between points + data << uint32(1); // 1 single waypoint + data << newPos->GetPositionX(); + data << newPos->GetPositionY(); + data << newPos->GetPositionZ(); + + SendMessageToSet(&data, true); +} + void Unit::SendMonsterMoveTransport(Unit *vehicleOwner) { // TODO: Turn into BuildMonsterMoveTransport packet and allow certain variables (for npc movement aboard vehicles) @@ -423,7 +463,7 @@ void Unit::SendMonsterMoveTransport(Unit *vehicleOwner) data.append(GetPackGUID()); data.append(vehicleOwner->GetPackGUID()); data << int8(GetTransSeat()); - data << uint8(0); // unk boolean + data << uint8(GetTypeId() == TYPEID_PLAYER ? 1 : 0); // boolean data << GetPositionX() - vehicleOwner->GetPositionX(); data << GetPositionY() - vehicleOwner->GetPositionY(); data << GetPositionZ() - vehicleOwner->GetPositionZ(); @@ -516,7 +556,7 @@ bool Unit::HasAuraTypeWithFamilyFlags(AuraType auraType, uint32 familyName, uint void Unit::DealDamageMods(Unit *pVictim, uint32 &damage, uint32* absorb) { - if (!pVictim->isAlive() || pVictim->HasUnitState(UNIT_STAT_IN_FLIGHT) || (pVictim->HasUnitState(UNIT_STAT_ONVEHICLE) && !pVictim->IsHostileTo(this)) || (pVictim->GetTypeId() == TYPEID_UNIT && pVictim->ToCreature()->IsInEvadeMode())) + if (!pVictim->isAlive() || pVictim->HasUnitState(UNIT_STAT_IN_FLIGHT) || (pVictim->GetTypeId() == TYPEID_UNIT && pVictim->ToCreature()->IsInEvadeMode())) { if (absorb) *absorb += damage; @@ -961,12 +1001,6 @@ void Unit::CalculateSpellDamageTaken(SpellNonMeleeDamage *damageInfo, int32 dama if (damage < 0) return; - if (spellInfo->AttributesEx4 & SPELL_ATTR4_FIXED_DAMAGE) - { - damageInfo->damage = damage; - return; - } - Unit *pVictim = damageInfo->target; if (!pVictim || !pVictim->isAlive()) return; @@ -974,6 +1008,14 @@ void Unit::CalculateSpellDamageTaken(SpellNonMeleeDamage *damageInfo, int32 dama SpellSchoolMask damageSchoolMask = SpellSchoolMask(damageInfo->schoolMask); uint32 crTypeMask = pVictim->GetCreatureTypeMask(); + if (spellInfo->AttributesEx4 & SPELL_ATTR4_FIXED_DAMAGE) + { + CalcAbsorbResist(pVictim, damageSchoolMask, SPELL_DIRECT_DAMAGE, damage, &damageInfo->absorb, &damageInfo->resist, spellInfo); + damage -= damageInfo->absorb + damageInfo->resist; + damageInfo->damage = damage; + return; + } + if (IsDamageReducedByArmor(damageSchoolMask, spellInfo)) damage = CalcArmorReducedDamage(pVictim, damage, spellInfo, attackType); @@ -1008,10 +1050,11 @@ void Unit::CalculateSpellDamageTaken(SpellNonMeleeDamage *damageInfo, int32 dama if (attackType == RANGED_ATTACK) critPctDamageMod += pVictim->GetTotalAuraModifier(SPELL_AURA_MOD_ATTACKER_RANGED_CRIT_DAMAGE); else - { critPctDamageMod += pVictim->GetTotalAuraModifier(SPELL_AURA_MOD_ATTACKER_MELEE_CRIT_DAMAGE); - critPctDamageMod += GetTotalAuraModifier(SPELL_AURA_MOD_CRIT_DAMAGE_BONUS_MELEE); - } + + // Increase crit damage from SPELL_AURA_MOD_CRIT_DAMAGE_BONUS + critPctDamageMod += GetTotalAuraModifier(SPELL_AURA_MOD_CRIT_DAMAGE_BONUS); + // Increase crit damage from SPELL_AURA_MOD_CRIT_PERCENT_VERSUS critPctDamageMod += GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_CRIT_PERCENT_VERSUS, crTypeMask); @@ -1081,7 +1124,7 @@ void Unit::DealSpellDamage(SpellNonMeleeDamage *damageInfo, bool durabilityLoss) SpellEntry const *spellProto = sSpellStore.LookupEntry(damageInfo->SpellID); if (spellProto == NULL) { - sLog->outDebug("Unit::DealSpellDamage have wrong damageInfo->SpellID: %u", damageInfo->SpellID); + sLog->outDebug(LOG_FILTER_UNITS, "Unit::DealSpellDamage have wrong damageInfo->SpellID: %u", damageInfo->SpellID); return; } @@ -1208,10 +1251,10 @@ void Unit::CalculateMeleeDamage(Unit *pVictim, uint32 damage, CalcDamageInfo *da if (damageInfo->attackType == RANGED_ATTACK) mod += damageInfo->target->GetTotalAuraModifier(SPELL_AURA_MOD_ATTACKER_RANGED_CRIT_DAMAGE); else - { mod += damageInfo->target->GetTotalAuraModifier(SPELL_AURA_MOD_ATTACKER_MELEE_CRIT_DAMAGE); - mod += GetTotalAuraModifier(SPELL_AURA_MOD_CRIT_DAMAGE_BONUS_MELEE); - } + + // Increase crit damage from SPELL_AURA_MOD_CRIT_DAMAGE_BONUS + mod += GetTotalAuraModifier(SPELL_AURA_MOD_CRIT_DAMAGE_BONUS); uint32 crTypeMask = damageInfo->target->GetCreatureTypeMask(); @@ -1379,8 +1422,11 @@ void Unit::DealMeleeDamage(CalcDamageInfo *damageInfo, bool durabilityLoss) if (pVictim->getLevel() < 30) Probability = 0.65f * pVictim->getLevel() + 0.5f; - uint32 VictimDefense=pVictim->GetDefenseSkillValue(); - uint32 AttackerMeleeSkill=GetUnitMeleeSkill(); + int32 VictimDefense=pVictim->GetDefenseSkillValue(); + if (pVictim->GetTypeId() == TYPEID_PLAYER) + VictimDefense += pVictim->ToPlayer()->GetRatingBonusValue(CR_DEFENSE_SKILL); + + int32 AttackerMeleeSkill=GetUnitMeleeSkill(); Probability += ((AttackerMeleeSkill - VictimDefense) / 140.0f) * 20.0f; @@ -1618,6 +1664,10 @@ void Unit::CalcAbsorbResist(Unit *pVictim, SpellSchoolMask schoolMask, DamageEff if ((*j)->GetMiscValue() & schoolMask) AddPctN(damageResisted, -(*j)->GetAmount()); + // Chaos Bolt should not be resisted + if (spellInfo && spellInfo->SpellIconID == 3178) + damageResisted = 0; + dmgInfo.ResistDamage(uint32(damageResisted)); } @@ -1931,7 +1981,7 @@ void Unit::AttackerStateUpdate (Unit *pVictim, WeaponAttackType attType, bool ex DealDamageMods(pVictim, damageInfo.damage, &damageInfo.absorb); SendAttackStateUpdate(&damageInfo); - ProcDamageAndSpell(damageInfo.target, damageInfo.procAttacker, damageInfo.procVictim, damageInfo.procEx, damageInfo.damage, damageInfo.attackType); + ProcDamageAndSpell(damageInfo.target, damageInfo.procAttacker, damageInfo.procVictim, damageInfo.procEx, damageInfo.damage + damageInfo.absorb, damageInfo.attackType); DealMeleeDamage(&damageInfo,true); if (GetTypeId() == TYPEID_PLAYER) @@ -2231,7 +2281,7 @@ void Unit::SendMeleeAttackStop(Unit* victim) sLog->outDetail("%s %u stopped attacking %s %u", (GetTypeId() == TYPEID_PLAYER ? "player" : "creature"), GetGUIDLow(), (victim->GetTypeId() == TYPEID_PLAYER ? "player" : "creature"),victim->GetGUIDLow()); } -bool Unit::isSpellBlocked(Unit *pVictim, SpellEntry const * /*spellProto*/, WeaponAttackType attackType) +bool Unit::isSpellBlocked(Unit *pVictim, SpellEntry const * spellProto, WeaponAttackType attackType) { if (pVictim->HasInArc(M_PI,this) || pVictim->HasAuraType(SPELL_AURA_IGNORE_HIT_DIRECTION)) { @@ -2240,6 +2290,9 @@ bool Unit::isSpellBlocked(Unit *pVictim, SpellEntry const * /*spellProto*/, Weap pVictim->ToCreature()->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_BLOCK) return false; + if (spellProto->Attributes & SPELL_ATTR0_IMPOSSIBLE_DODGE_PARRY_BLOCK) + return false; + float blockChance = pVictim->GetUnitBlockChance(); blockChance += (int32(GetWeaponSkillValue(attackType)) - int32(pVictim->GetMaxSkillValueForLevel()))*0.04f; if (roll_chance_f(blockChance)) @@ -2576,10 +2629,6 @@ SpellMissInfo Unit::MagicSpellHitResult(Unit *pVictim, SpellEntry const *spell) // Resist SpellMissInfo Unit::SpellHitResult(Unit *pVictim, SpellEntry const *spell, bool CanReflect) { - // Return evade for units in evade mode - if (pVictim->GetTypeId() == TYPEID_UNIT && pVictim->ToCreature()->IsInEvadeMode() && this != pVictim) - return SPELL_MISS_EVADE; - // Check for immune if (pVictim->IsImmunedToSpell(spell)) return SPELL_MISS_IMMUNE; @@ -2595,9 +2644,15 @@ SpellMissInfo Unit::SpellHitResult(Unit *pVictim, SpellEntry const *spell, bool if (this == pVictim) return SPELL_MISS_NONE; + // Magic melee spells cannot be reflected if (spell->DmgClass == SPELL_DAMAGE_CLASS_MAGIC && (spell->AttributesEx & SPELL_ATTR1_UNK9)) CanReflect = false; + + // Return evade for units in evade mode + if (pVictim->GetTypeId() == TYPEID_UNIT && pVictim->ToCreature()->IsInEvadeMode()) + return SPELL_MISS_EVADE; + // Try victim reflect spell if (CanReflect) { @@ -2997,7 +3052,7 @@ void Unit::InterruptSpell(CurrentSpellTypes spellType, bool withDelayed, bool wi { ASSERT(spellType < CURRENT_MAX_SPELL); - //sLog->outDebug("Interrupt spell for unit %u.", GetEntry()); + //sLog->outDebug(LOG_FILTER_UNITS, "Interrupt spell for unit %u.", GetEntry()); Spell *spell = m_currentSpells[spellType]; if (spell && (withDelayed || spell->getState() != SPELL_STATE_DELAYED) @@ -3007,8 +3062,6 @@ void Unit::InterruptSpell(CurrentSpellTypes spellType, bool withDelayed, bool wi if (!spell->IsInterruptable()) return; - m_currentSpells[spellType] = NULL; - // send autorepeat cancel message for autorepeat spells if (spellType == CURRENT_AUTOREPEAT_SPELL) { @@ -3018,6 +3071,8 @@ void Unit::InterruptSpell(CurrentSpellTypes spellType, bool withDelayed, bool wi if (spell->getState() != SPELL_STATE_FINISHED) spell->cancel(); + + m_currentSpells[spellType] = NULL; spell->SetReferencedFromCurrent(false); } } @@ -3291,7 +3346,7 @@ void Unit::_UnapplyAura(AuraApplicationMap::iterator &i, AuraRemoveMode removeMo ASSERT(aurApp->GetTarget() == this); aurApp->SetRemoveMode(removeMode); Aura * aura = aurApp->GetBase(); - sLog->outDebug("Aura %u now is remove mode %d", aura->GetId(), removeMode); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS,"Aura %u now is remove mode %d", aura->GetId(), removeMode); // dead loop is killing the server probably ASSERT(m_removedAurasCount < 0xFFFFFFFF); @@ -3743,7 +3798,6 @@ void Unit::RemoveAurasDueToSpellBySteal(uint32 spellId, uint64 casterGUID, Unit else RemoveAuraFromStack(iter, AURA_REMOVE_BY_ENEMY_SPELL); - if (Aura * newAura = stealCharge ? stealer->GetAura(aura->GetId(), aura->GetCasterGUID()) : NULL) { uint8 newCharges = newAura->GetCharges() + 1; @@ -3793,7 +3847,7 @@ void Unit::RemoveAurasByType(AuraType auraType, uint64 casterGUID, Aura * except for (AuraEffectList::iterator iter = m_modAuras[auraType].begin(); iter != m_modAuras[auraType].end();) { Aura * aura = (*iter)->GetBase(); - AuraApplication * aurApp = aura ->GetApplicationOfTarget(GetGUID()); + AuraApplication * aurApp = aura->GetApplicationOfTarget(GetGUID()); ++iter; if (aura != except && (!casterGUID || aura->GetCasterGUID() == casterGUID) @@ -3859,7 +3913,6 @@ void Unit::RemoveNotOwnSingleTargetAuras(uint32 newPhase) } } - void Unit::RemoveAurasWithInterruptFlags(uint32 flag, uint32 except) { if (!(m_interruptMask & flag)) @@ -3980,7 +4033,7 @@ void Unit::RemoveAllAuras() void Unit::RemoveArenaAuras(bool onleave) { - // in join, remove positive buffs, on end, remove negative + // in join, remove positive and negative buffs, on end, remove negative // used to remove positive visible auras in arenas for (AuraApplicationMap::iterator iter = m_appliedAuras.begin(); iter != m_appliedAuras.end();) { @@ -3989,7 +4042,7 @@ void Unit::RemoveArenaAuras(bool onleave) if (!(aura->GetSpellProto()->AttributesEx4 & SPELL_ATTR4_UNK21) // don't remove stances, shadowform, pally/hunter auras && !aura->IsPassive() // don't remove passive auras && (!(aura->GetSpellProto()->Attributes & SPELL_ATTR0_UNAFFECTED_BY_INVULNERABILITY) || !(aura->GetSpellProto()->Attributes & SPELL_ATTR0_UNK8)) // not unaffected by invulnerability auras or not having that unknown flag (that seemed the most probable) - && (aurApp->IsPositive() ^ onleave)) // remove positive buffs on enter, negative buffs on leave + && !(aurApp->IsPositive() && onleave)) // remove positive and negative buffs on enter, negative buffs on leave RemoveAura(iter); else ++iter; @@ -4054,7 +4107,7 @@ void Unit::DelayOwnedAuras(uint32 spellId, uint64 caster, int32 delaytime) // update for out of range group members (on 1 slot use) aura->SetNeedClientUpdateForTargets(); - sLog->outDebug("Aura %u partially interrupted on unit %u, new duration: %u ms",aura->GetId() , GetGUIDLow(), aura->GetDuration()); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Aura %u partially interrupted on unit %u, new duration: %u ms",aura->GetId() , GetGUIDLow(), aura->GetDuration()); } } } @@ -4338,12 +4391,13 @@ int32 Unit::GetTotalAuraModifier(AuraType auratype) const float Unit::GetTotalAuraMultiplier(AuraType auratype) const { float multiplier = 1.0f; + float neg_multiplier = 1.0f; AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auratype); for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i) - AddFlatPctN(multiplier, (*i)->GetAmount()); + AddFlatPctN(multiplier, neg_multiplier, (*i)->GetAmount()); - return multiplier; + return multiplier * neg_multiplier; } int32 Unit::GetMaxPositiveAuraModifier(AuraType auratype) @@ -4388,14 +4442,15 @@ int32 Unit::GetTotalAuraModifierByMiscMask(AuraType auratype, uint32 misc_mask) float Unit::GetTotalAuraMultiplierByMiscMask(AuraType auratype, uint32 misc_mask) const { float multiplier = 1.0f; + float neg_multiplier = 1.0f; AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auratype); for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i) { if ((*i)->GetMiscValue()& misc_mask) - AddFlatPctN(multiplier, (*i)->GetAmount()); + AddFlatPctN(multiplier, neg_multiplier, (*i)->GetAmount()); } - return multiplier; + return multiplier * neg_multiplier; } int32 Unit::GetMaxPositiveAuraModifierByMiscMask(AuraType auratype, uint32 misc_mask, const AuraEffect* except) const @@ -4442,14 +4497,15 @@ int32 Unit::GetTotalAuraModifierByMiscValue(AuraType auratype, int32 misc_value) float Unit::GetTotalAuraMultiplierByMiscValue(AuraType auratype, int32 misc_value) const { float multiplier = 1.0f; + float neg_multiplier = 1.0f; AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auratype); for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i) { if ((*i)->GetMiscValue() == misc_value) - AddFlatPctN(multiplier, (*i)->GetAmount()); + AddFlatPctN(multiplier, neg_multiplier, (*i)->GetAmount()); } - return multiplier; + return multiplier * neg_multiplier; } int32 Unit::GetMaxPositiveAuraModifierByMiscValue(AuraType auratype, int32 misc_value) const @@ -4496,14 +4552,15 @@ int32 Unit::GetTotalAuraModifierByAffectMask(AuraType auratype, SpellEntry const float Unit::GetTotalAuraMultiplierByAffectMask(AuraType auratype, SpellEntry const * affectedSpell) const { float multiplier = 1.0f; + float neg_multiplier = 1.0f; AuraEffectList const& mTotalAuraList = GetAuraEffectsByType(auratype); for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i) { if ((*i)->IsAffectedOnSpell(affectedSpell)) - AddFlatPctN(multiplier, (*i)->GetAmount()); + AddFlatPctN(multiplier, neg_multiplier, (*i)->GetAmount()); } - return multiplier; + return multiplier * neg_multiplier; } int32 Unit::GetMaxPositiveAuraModifierByAffectMask(AuraType auratype, SpellEntry const * affectedSpell) const @@ -4797,7 +4854,7 @@ void Unit::SendSpellDamageImmune(Unit * target, uint32 spellId) void Unit::SendAttackStateUpdate(CalcDamageInfo *damageInfo) { - sLog->outDebug("WORLD: Sending SMSG_ATTACKERSTATEUPDATE"); + sLog->outDebug(LOG_FILTER_UNITS, "WORLD: Sending SMSG_ATTACKERSTATEUPDATE"); uint32 count = 1; size_t maxsize = 4+5+5+4+4+1+4+4+4+4+4+1+4+4+4+4+4*12; @@ -4895,7 +4952,7 @@ bool Unit::HandleHasteAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger case 33735: { target = SelectNearbyTarget(); - if (!target || target == pVictim) + if (!target) return false; basepoints0 = damage; triggered_spell_id = 22482; @@ -5038,11 +5095,15 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger { // return damage % to attacker but < 50% own total health basepoints0 = int32(std::min(CalculatePctN(damage, triggerAmount), CountPctFromMaxHealth(50))); - - sLog->outDebug("DEBUG LINE: Data about Eye for an Eye ID %u, damage taken %u, unit max health %u, damage done %u", dummySpell->Id, damage, GetMaxHealth(), basepoints0); - triggered_spell_id = 25997; - + break; + } + // Grim Reprisal + case 63305: + { + // return 60% damage to the attacker + basepoints0 = int32(CalculatePctU(damage, 60)); + triggered_spell_id = 64039; break; } // Sweeping Strikes @@ -5541,6 +5602,57 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger basepoints0 = CalculatePctN(int32(damage), triggerAmount); break; } + // Meteor Fists + case 66725: + { + target = getVictim(); + triggered_spell_id = 66765; + break; + } + // Item - Icecrown 25 Normal Dagger Proc + case 71880: + { + switch (getPowerType()) + { + case POWER_MANA: + triggered_spell_id = 71881; + break; + case POWER_RAGE: + triggered_spell_id = 71883; + break; + case POWER_ENERGY: + triggered_spell_id = 71882; + break; + case POWER_RUNIC_POWER: + triggered_spell_id = 71884; + break; + default: + return false; + } + break; + } + // Item - Icecrown 25 Heroic Dagger Proc + case 71892: + { + switch (getPowerType()) + { + case POWER_MANA: + triggered_spell_id = 71888; + break; + case POWER_RAGE: + triggered_spell_id = 71886; + break; + case POWER_ENERGY: + triggered_spell_id = 71887; + break; + case POWER_RUNIC_POWER: + triggered_spell_id = 71885; + break; + default: + return false; + } + break; + } } break; } @@ -5792,7 +5904,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger return false; target = SelectNearbyTarget(); - if (!target || target == pVictim) + if (!target) return false; CastSpell(target, 58567, true); @@ -6282,6 +6394,8 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger if (!triggeredSpell) return false; basepoints0 = CalculatePctN(int32(damage), triggerAmount) / (GetSpellMaxDuration(triggeredSpell) / triggeredSpell->EffectAmplitude[0]); + // Add remaining ticks to damage done + basepoints0 += pVictim->GetRemainingDotDamage(GetGUID(), triggered_spell_id); } break; } @@ -6499,11 +6613,22 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger } break; } - // Glyph of Mend Pet - if(dummySpell->Id == 57870) + + switch (dummySpell->Id) { - pVictim->CastSpell(pVictim, 57894, true, NULL, NULL, GetGUID()); - return true; + // Glyph of Mend Pet + case 57870: + { + pVictim->CastSpell(pVictim, 57894, true, NULL, NULL, GetGUID()); + return true; + } + // Misdirection + case 34477: + { + RemoveAura(dummySpell->Id, GetGUID(), 0, AURA_REMOVE_BY_DEFAULT); + CastSpell(this, 35079, true); + return true; + } } break; } @@ -8583,8 +8708,8 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig target->CastSpell(target,trigger_spell_id,true,castItem,triggeredByAura); - if (cooldown && GetTypeId() == TYPEID_PLAYER) - this->ToPlayer()->AddSpellCooldown(trigger_spell_id,0,time(NULL) + cooldown); + if (cooldown && target->GetTypeId() == TYPEID_PLAYER) + target->ToPlayer()->AddSpellCooldown(trigger_spell_id,0,time(NULL) + cooldown); return true; } // Cast positive spell on enemy target @@ -9571,7 +9696,7 @@ Unit* Unit::GetCharm() const void Unit::SetMinion(Minion *minion, bool apply) { - sLog->outDebug("SetMinion %u for %u, apply %u", minion->GetEntry(), GetEntry(), apply); + sLog->outDebug(LOG_FILTER_UNITS, "SetMinion %u for %u, apply %u", minion->GetEntry(), GetEntry(), apply); if (apply) { @@ -9641,7 +9766,7 @@ void Unit::SetMinion(Minion *minion, bool apply) // Send infinity cooldown - client does that automatically but after relog cooldown needs to be set again SpellEntry const *spellInfo = sSpellStore.LookupEntry(minion->GetUInt32Value(UNIT_CREATED_BY_SPELL)); if (spellInfo && (spellInfo->Attributes & SPELL_ATTR0_DISABLED_WHILE_ACTIVE)) - this->ToPlayer()->AddSpellAndCategoryCooldowns(spellInfo, 0, NULL ,true); + this->ToPlayer()->AddSpellAndCategoryCooldowns(spellInfo, 0, NULL, true); } } else @@ -10094,6 +10219,7 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3 // Taken/Done total percent damage auras float DoneTotalMod = 1.0f; + float NegativeDoneTotalMod = 1.0f; float ApCoeffMod = 1.0f; int32 DoneTotal = 0; int32 TakenTotal = 0; @@ -10111,17 +10237,17 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3 { if ((*i)->GetSpellProto()->EquippedItemClass == -1) { - AddFlatPctN(DoneTotalMod, (*i)->GetAmount()); + AddFlatPctN(DoneTotalMod, NegativeDoneTotalMod, (*i)->GetAmount()); } else if (!((*i)->GetSpellProto()->AttributesEx5 & SPELL_ATTR5_SPECIAL_ITEM_CLASS_CHECK)) { if ((*i)->GetSpellProto()->EquippedItemClass & spellProto->EquippedItemClass) if (((*i)->GetSpellProto()->EquippedItemSubClassMask == 0) || ((*i)->GetSpellProto()->EquippedItemSubClassMask & spellProto->EquippedItemSubClassMask)) - AddFlatPctN(DoneTotalMod, (*i)->GetAmount()); + AddFlatPctN(DoneTotalMod, NegativeDoneTotalMod, (*i)->GetAmount()); } else if (ToPlayer() && ToPlayer()->HasItemFitToSpellRequirements((*i)->GetSpellProto())) - AddFlatPctN(DoneTotalMod, (*i)->GetAmount()); + AddFlatPctN(DoneTotalMod, NegativeDoneTotalMod, (*i)->GetAmount()); } } @@ -10131,13 +10257,13 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3 AuraEffectList const &mDamageDoneVersus = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_DONE_VERSUS); for (AuraEffectList::const_iterator i = mDamageDoneVersus.begin(); i != mDamageDoneVersus.end(); ++i) if (creatureTypeMask & uint32((*i)->GetMiscValue())) - AddFlatPctN(DoneTotalMod, (*i)->GetAmount()); + AddFlatPctN(DoneTotalMod, NegativeDoneTotalMod, (*i)->GetAmount()); // bonus against aurastate AuraEffectList const &mDamageDoneVersusAurastate = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_DONE_VERSUS_AURASTATE); for (AuraEffectList::const_iterator i = mDamageDoneVersusAurastate.begin(); i != mDamageDoneVersusAurastate.end(); ++i) if (pVictim->HasAuraState(AuraState((*i)->GetMiscValue()))) - AddFlatPctN(DoneTotalMod, (*i)->GetAmount()); + AddFlatPctN(DoneTotalMod, NegativeDoneTotalMod, (*i)->GetAmount()); // done scripted mod (take it from owner) Unit * owner = GetOwner() ? GetOwner() : this; @@ -10156,7 +10282,7 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3 case 6928: { if (pVictim->HasAuraState(AURA_STATE_HEALTHLESS_35_PERCENT, spellProto, this)) - AddFlatPctN(DoneTotalMod, (*i)->GetAmount()); + AddFlatPctN(DoneTotalMod, NegativeDoneTotalMod, (*i)->GetAmount()); break; } // Soul Siphon @@ -10183,19 +10309,19 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3 break; } } - AddFlatPctN(DoneTotalMod, modPercent); + AddFlatPctN(DoneTotalMod, NegativeDoneTotalMod, modPercent); break; } case 6916: // Death's Embrace case 6925: case 6927: if (HasAuraState(AURA_STATE_HEALTHLESS_20_PERCENT, spellProto, this)) - AddFlatPctN(DoneTotalMod, (*i)->GetAmount()); + AddFlatPctN(DoneTotalMod, NegativeDoneTotalMod, (*i)->GetAmount()); break; case 5481: // Starfire Bonus { if (pVictim->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_DRUID, 0x200002, 0, 0)) - AddFlatPctN(DoneTotalMod, (*i)->GetAmount()); + AddFlatPctN(DoneTotalMod, NegativeDoneTotalMod, (*i)->GetAmount()); break; } case 4418: // Increased Shock Damage @@ -10218,14 +10344,14 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3 if ((*i)->GetSpellProto()->SpellIconID == 2656) { if (!pVictim->HealthAbovePct(35)) - AddFlatPctN(DoneTotalMod, (*i)->GetAmount()); + AddFlatPctN(DoneTotalMod, NegativeDoneTotalMod, (*i)->GetAmount()); } // Tundra Stalker else { // Frost Fever (target debuff) if (pVictim->HasAura(55095)) - AddFlatPctN(DoneTotalMod, (*i)->GetAmount()); + AddFlatPctN(DoneTotalMod, NegativeDoneTotalMod, (*i)->GetAmount()); break; } break; @@ -10236,7 +10362,7 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3 if (pVictim->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_DEATHKNIGHT, 0,0x02000000,0)) { if (SpellChainNode const *chain = sSpellMgr->GetSpellChainNode((*i)->GetId())) - AddFlatPctF(DoneTotalMod, chain->rank * 2.0f); + AddFlatPctF(DoneTotalMod, NegativeDoneTotalMod, chain->rank * 2.0f); } break; } @@ -10244,7 +10370,7 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3 case 7377: { if (pVictim->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_PRIEST, 0x8000, 0,0, GetGUID())) - AddFlatPctN(DoneTotalMod, (*i)->GetAmount()); + AddFlatPctN(DoneTotalMod, NegativeDoneTotalMod, (*i)->GetAmount()); break; } // Marked for Death @@ -10255,7 +10381,7 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3 case 7602: { if (pVictim->GetAuraEffect(SPELL_AURA_MOD_STALKED, SPELLFAMILY_HUNTER, 0x400, 0, 0)) - AddFlatPctN(DoneTotalMod, (*i)->GetAmount()); + AddFlatPctN(DoneTotalMod, NegativeDoneTotalMod, (*i)->GetAmount()); break; } case 6427: // Dirty Deeds @@ -10263,7 +10389,7 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3 if (pVictim->HasAuraState(AURA_STATE_HEALTHLESS_35_PERCENT, spellProto, this)) { AuraEffect * eff0 = (*i)->GetBase()->GetEffect(0); - DoneTotalMod *= (-eff0->GetAmount() + 100.0f) / 100.0f; + DoneTotalMod, NegativeDoneTotalMod *= (-eff0->GetAmount() + 100.0f) / 100.0f; } break; } @@ -10294,7 +10420,7 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3 for (AuraEffectList::const_iterator i = mDumyAuras.begin(); i != mDumyAuras.end(); ++i) if ((*i)->GetSpellProto()->SpellIconID == 3263) { - AddFlatPctN(DoneTotalMod, (*i)->GetAmount()); + AddFlatPctN(DoneTotalMod, NegativeDoneTotalMod, (*i)->GetAmount()); break; } } @@ -10307,13 +10433,13 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3 if (AuraEffect * aurEff = GetAuraEffect(55687, 0)) // Increase Mind Flay damage if Shadow Word: Pain present on target if (pVictim->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_PRIEST, 0x8000, 0,0, GetGUID())) - AddFlatPctN(DoneTotalMod, aurEff->GetAmount()); + AddFlatPctN(DoneTotalMod, NegativeDoneTotalMod, aurEff->GetAmount()); // Twisted Faith - Mind Flay part if (AuraEffect * aurEff = GetAuraEffect(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS, SPELLFAMILY_PRIEST, 2848, 1)) // Increase Mind Flay damage if Shadow Word: Pain present on target if (pVictim->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_PRIEST, 0x8000, 0,0, GetGUID())) - AddFlatPctN(DoneTotalMod, aurEff->GetAmount()); + AddFlatPctN(DoneTotalMod, NegativeDoneTotalMod, aurEff->GetAmount()); } // Smite else if (spellProto->SpellFamilyFlags[0] & 0x80) @@ -10321,7 +10447,7 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3 // Glyph of Smite if (AuraEffect * aurEff = GetAuraEffect(55692, 0)) if (pVictim->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_PRIEST, 0x100000, 0, 0, GetGUID())) - AddFlatPctN(DoneTotalMod, aurEff->GetAmount()); + AddFlatPctN(DoneTotalMod, NegativeDoneTotalMod, aurEff->GetAmount()); } break; case SPELLFAMILY_PALADIN: @@ -10339,7 +10465,7 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3 } // + 10% for each application of Holy Vengeance/Blood Corruption on the target if (stacks) - AddFlatPctU(DoneTotalMod, 10 * stacks); + AddFlatPctU(DoneTotalMod, NegativeDoneTotalMod, 10 * stacks); } break; case SPELLFAMILY_WARLOCK: @@ -10351,7 +10477,7 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3 for (AuraEffectList::const_iterator i = mDumyAuras.begin(); i != mDumyAuras.end(); ++i) if ((*i)->GetSpellProto()->SpellIconID == 3173) { - AddFlatPctN(DoneTotalMod, (*i)->GetAmount()); + AddFlatPctN(DoneTotalMod, NegativeDoneTotalMod, (*i)->GetAmount()); break; } } @@ -10360,17 +10486,24 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3 if (HasAura(200000)) DoneTotalMod *= 4; break; + case SPELLFAMILY_HUNTER: + // Steady Shot + if(spellProto->SpellFamilyFlags[1] & 0x1) + if (AuraEffect * aurEff = GetAuraEffect(56826, 0)) // Glyph of Steady Shot + if (pVictim->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_HUNTER, 0x00004000, 0, 0, GetGUID())) + AddFlatPctN(DoneTotalMod, NegativeDoneTotalMod, aurEff->GetAmount()); + break; case SPELLFAMILY_DEATHKNIGHT: // Improved Icy Touch if (spellProto->SpellFamilyFlags[0] & 0x2) if (AuraEffect * aurEff = GetDummyAuraEffect(SPELLFAMILY_DEATHKNIGHT, 2721, 0)) - AddFlatPctN(DoneTotalMod, aurEff->GetAmount()); + AddFlatPctN(DoneTotalMod, NegativeDoneTotalMod, aurEff->GetAmount()); // Glacier Rot if (spellProto->SpellFamilyFlags[0] & 0x2 || spellProto->SpellFamilyFlags[1] & 0x6) if (AuraEffect * aurEff = GetDummyAuraEffect(SPELLFAMILY_DEATHKNIGHT, 196, 0)) if (pVictim->GetDiseasesByCaster(owner->GetGUID()) > 0) - AddFlatPctN(DoneTotalMod, aurEff->GetAmount()); + AddFlatPctN(DoneTotalMod, NegativeDoneTotalMod, aurEff->GetAmount()); // Sigil of the Vengeful Heart (Death Coil part) if (spellProto->SpellFamilyFlags[0] & 0x2000) @@ -10394,7 +10527,7 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3 case 49638: { if (const SpellEntry *proto=sSpellStore.LookupEntry(itr->first)) - AddFlatPctN(ApCoeffMod, SpellMgr::CalculateSpellEffectAmount(proto, 0)); + AddFlatPctN(ApCoeffMod, ApCoeffMod, SpellMgr::CalculateSpellEffectAmount(proto, 0)); } break; } @@ -10405,7 +10538,7 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3 // ..taken int32 maxPositiveMod = 0; // max of the positive amount aura (that increase the damage taken) - int32 sumNegativeMod = 0; // sum the negative amount aura (that reduce the damage taken) + float sumNegativeMod = 1.0f; // sum the negative amount aura (that reduce the damage taken) AuraEffectList const& mModDamagePercentTaken = pVictim->GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN); for (AuraEffectList::const_iterator i = mModDamagePercentTaken.begin(); i != mModDamagePercentTaken.end(); ++i) if ((*i)->GetMiscValue() & GetSpellSchoolMask(spellProto)) @@ -10416,7 +10549,7 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3 maxPositiveMod = (*i)->GetAmount(); } else - sumNegativeMod += (*i)->GetAmount(); + AddPctN(sumNegativeMod, (*i)->GetAmount()); } // .. taken pct: dummy auras @@ -10434,7 +10567,7 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3 float mod = pVictim->ToPlayer()->GetRatingBonusValue(CR_CRIT_TAKEN_MELEE)*(-8.0f); if (mod < (*i)->GetAmount()) mod = (float)(*i)->GetAmount(); - sumNegativeMod += int32(mod); + AddPctN(sumNegativeMod, mod); } break; // Ebon Plague @@ -10452,7 +10585,7 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3 AuraEffectList const& mOwnerTaken = pVictim->GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_FROM_CASTER); for (AuraEffectList::const_iterator i = mOwnerTaken.begin(); i != mOwnerTaken.end(); ++i) if ((*i)->GetCasterGUID() == GetGUID() && (*i)->IsAffectedOnSpell(spellProto)) - sumNegativeMod += (*i)->GetAmount(); + AddPctN(sumNegativeMod, (*i)->GetAmount()); // Mod damage from spell mechanic if (uint32 mechanicMask = GetAllSpellMechanicMask(spellProto)) @@ -10460,10 +10593,10 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3 AuraEffectList const& mDamageDoneMechanic = pVictim->GetAuraEffectsByType(SPELL_AURA_MOD_MECHANIC_DAMAGE_TAKEN_PERCENT); for (AuraEffectList::const_iterator i = mDamageDoneMechanic.begin(); i != mDamageDoneMechanic.end(); ++i) if (mechanicMask & uint32(1<<((*i)->GetMiscValue()))) - sumNegativeMod += (*i)->GetAmount(); + AddPctN(sumNegativeMod, (*i)->GetAmount()); } - float TakenTotalMod = (sumNegativeMod + maxPositiveMod + 100.0f) / 100.0f; + float TakenTotalMod = sumNegativeMod * (maxPositiveMod + 100.0f) / 100.0f; // Taken/Done fixed damage bonus auras int32 DoneAdvertisedBenefit = SpellBaseDamageBonus(GetSpellSchoolMask(spellProto)); @@ -10587,7 +10720,7 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3 DoneTotalMod = 1.0f; } - float tmpDamage = (int32(pdamage) + DoneTotal) * DoneTotalMod; + float tmpDamage = (int32(pdamage) + DoneTotal) * DoneTotalMod * NegativeDoneTotalMod; // apply spellmod to Done damage (flat and pct) if (Player* modOwner = GetSpellModOwner()) modOwner->ApplySpellMod(spellProto->Id, damagetype == DOT ? SPELLMOD_DOT : SPELLMOD_DAMAGE, tmpDamage); @@ -10659,8 +10792,8 @@ 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())) + // Mobs can't crit with spells but creatures owned by a player CAN crit. + if (IS_CREATURE_GUID(GetGUID()) && !(GetOwner() && GetOwner()->GetTypeId() == TYPEID_PLAYER)) return false; // not critting spell @@ -10781,7 +10914,8 @@ bool Unit::isSpellCrit(Unit *pVictim, SpellEntry const *spellProto, SpellSchoolM if (spellProto->SpellFamilyFlags[1] & 0x00001000) { if (pVictim->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_SHAMAN, 0x10000000, 0,0, GetGUID())) - return true; + if (pVictim->GetTotalAuraModifier(SPELL_AURA_MOD_ATTACKER_SPELL_AND_WEAPON_CRIT_CHANCE) > -100) + return true; break; } break; @@ -10847,6 +10981,9 @@ uint32 Unit::SpellCriticalDamageBonus(SpellEntry const *spellProto, uint32 damag break; } + // adds additional damage to crit_bonus (from SPELL_AURA_MOD_CRIT_DAMAGE_BONUS) + crit_bonus = int32(crit_bonus * float(100.0f + GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_CRIT_DAMAGE_BONUS, spellProto->SchoolMask))/100.0f); + // adds additional damage to crit_bonus (from talents) if (Player* modOwner = GetSpellModOwner()) modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_CRIT_DAMAGE_BONUS, crit_bonus); @@ -10910,14 +11047,16 @@ uint32 Unit::SpellHealingBonus(Unit *pVictim, SpellEntry const *spellProto, uint // Healing Done // Taken/Done total percent damage auras float DoneTotalMod = 1.0f; + float NegativeDoneTotalMod = 1.0f; float TakenTotalMod = 1.0f; + float NegativeTakenTotalMod = 1.0f; int32 DoneTotal = 0; int32 TakenTotal = 0; // Healing done percent AuraEffectList const& mHealingDonePct = GetAuraEffectsByType(SPELL_AURA_MOD_HEALING_DONE_PERCENT); for (AuraEffectList::const_iterator i = mHealingDonePct.begin(); i != mHealingDonePct.end(); ++i) - AddFlatPctN(DoneTotalMod, (*i)->GetAmount()); + AddFlatPctN(DoneTotalMod, NegativeDoneTotalMod, (*i)->GetAmount()); // done scripted mod (take it from owner) Unit *owner = GetOwner() ? GetOwner() : this; @@ -10937,12 +11076,12 @@ uint32 Unit::SpellHealingBonus(Unit *pVictim, SpellEntry const *spellProto, uint case 6935: case 6918: if (pVictim->HealthBelowPct(50)) - AddFlatPctN(DoneTotalMod, (*i)->GetAmount()); + AddFlatPctN(DoneTotalMod, NegativeDoneTotalMod, (*i)->GetAmount()); break; case 7798: // Glyph of Regrowth { if (pVictim->GetAuraEffect(SPELL_AURA_PERIODIC_HEAL, SPELLFAMILY_DRUID, 0x40, 0, 0)) - AddFlatPctN(DoneTotalMod, (*i)->GetAmount()); + AddFlatPctN(DoneTotalMod, NegativeDoneTotalMod, (*i)->GetAmount()); break; } case 8477: // Nourish Heal Boost @@ -10961,13 +11100,13 @@ uint32 Unit::SpellHealingBonus(Unit *pVictim, SpellEntry const *spellProto, uint continue; modPercent += stepPercent * aura->GetStackAmount(); } - AddFlatPctN(DoneTotalMod, modPercent); + AddFlatPctN(DoneTotalMod, NegativeDoneTotalMod, modPercent); break; } case 7871: // Glyph of Lesser Healing Wave { if (pVictim->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_SHAMAN, 0 , 0x00000400, 0, GetGUID())) - AddFlatPctN(DoneTotalMod, (*i)->GetAmount()); + AddFlatPctN(DoneTotalMod, NegativeDoneTotalMod, (*i)->GetAmount()); break; } default: @@ -11115,7 +11254,7 @@ uint32 Unit::SpellHealingBonus(Unit *pVictim, SpellEntry const *spellProto, uint DoneTotal = SpellMgr::CalculateSpellEffectAmount(spellProto, 0, this, &DoneTotal, NULL); // use float as more appropriate for negative values and percent applying - float heal = (int32(healamount) + DoneTotal) * DoneTotalMod; + float heal = (int32(healamount) + DoneTotal) * DoneTotalMod * NegativeDoneTotalMod; // apply spellmod to Done amount if (Player* modOwner = GetSpellModOwner()) modOwner->ApplySpellMod(spellProto->Id, damagetype == DOT ? SPELLMOD_DOT : SPELLMOD_DAMAGE, heal); @@ -11133,39 +11272,39 @@ uint32 Unit::SpellHealingBonus(Unit *pVictim, SpellEntry const *spellProto, uint // Tenacity increase healing % taken if (AuraEffect const* Tenacity = pVictim->GetAuraEffect(58549, 0)) - AddFlatPctN(TakenTotalMod, Tenacity->GetAmount()); + AddFlatPctN(TakenTotalMod, NegativeTakenTotalMod, Tenacity->GetAmount()); // Healing taken percent float minval = (float)pVictim->GetMaxNegativeAuraModifier(SPELL_AURA_MOD_HEALING_PCT); if (minval) - AddFlatPctF(TakenTotalMod, minval); + AddFlatPctF(TakenTotalMod, NegativeTakenTotalMod, minval); float maxval = (float)pVictim->GetMaxPositiveAuraModifier(SPELL_AURA_MOD_HEALING_PCT); if (maxval) - AddFlatPctF(TakenTotalMod, maxval); + AddFlatPctF(TakenTotalMod, NegativeTakenTotalMod, maxval); if (damagetype == DOT) { // Healing over time taken percent float minval_hot = (float)pVictim->GetMaxNegativeAuraModifier(SPELL_AURA_MOD_HOT_PCT); if (minval_hot) - AddFlatPctF(TakenTotalMod, minval_hot); + AddFlatPctF(TakenTotalMod, NegativeTakenTotalMod, minval_hot); float maxval_hot = (float)pVictim->GetMaxPositiveAuraModifier(SPELL_AURA_MOD_HOT_PCT); if (maxval_hot) - AddFlatPctF(TakenTotalMod, maxval_hot); + AddFlatPctF(TakenTotalMod, NegativeTakenTotalMod, maxval_hot); } AuraEffectList const& mHealingGet= pVictim->GetAuraEffectsByType(SPELL_AURA_MOD_HEALING_RECEIVED); for (AuraEffectList::const_iterator i = mHealingGet.begin(); i != mHealingGet.end(); ++i) if (GetGUID() == (*i)->GetCasterGUID() && (*i)->IsAffectedOnSpell(spellProto)) - AddFlatPctN(TakenTotalMod, (*i)->GetAmount()); + AddFlatPctN(TakenTotalMod, NegativeTakenTotalMod, (*i)->GetAmount()); // Do not apply/remove mods to Earth Shield twice, mods will be applied to triggered spell if (spellProto->SpellFamilyName == SPELLFAMILY_SHAMAN && spellProto->SpellFamilyFlags[1] & 0x400) - TakenTotalMod = 1.0f / DoneTotalMod; + TakenTotalMod = 1.0f / (DoneTotalMod * NegativeDoneTotalMod); - heal = (int32(heal) + TakenTotal) * TakenTotalMod; + heal = (int32(heal) + TakenTotal) * TakenTotalMod * NegativeTakenTotalMod; return uint32(std::max(heal, 0.0f)); } @@ -11362,6 +11501,12 @@ bool Unit::IsDamageToThreatSpell(SpellEntry const * spellInfo) const case SPELLFAMILY_DEATHKNIGHT: if (spellInfo->SpellFamilyFlags[1] == 0x20000000) // Rune Strike return true; + if (spellInfo->SpellFamilyFlags[2] == 0x8) // Death and Decay + return true; + break; + case SPELLFAMILY_WARRIOR: + if (spellInfo->SpellFamilyFlags[0] == 0x80) // Thunder Clap + return true; break; } @@ -11441,7 +11586,9 @@ void Unit::MeleeDamageBonus(Unit *pVictim, uint32 *pdamage, WeaponAttackType att // Done/Taken total percent damage auras float DoneTotalMod = 1.0f; + float NegativeDoneTotalMod = 1.0f; float TakenTotalMod = 1.0f; + float NegativeTakenTotalMod = 1.0f; // ..done AuraEffectList const &mModDamagePercentDone = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE); @@ -11452,17 +11599,17 @@ void Unit::MeleeDamageBonus(Unit *pVictim, uint32 *pdamage, WeaponAttackType att { if ((*i)->GetSpellProto()->EquippedItemClass == -1) { - AddFlatPctN(DoneTotalMod, (*i)->GetAmount()); + AddFlatPctN(DoneTotalMod, NegativeDoneTotalMod, (*i)->GetAmount()); } else if (!((*i)->GetSpellProto()->AttributesEx5 & SPELL_ATTR5_SPECIAL_ITEM_CLASS_CHECK)) { if ((*i)->GetSpellProto()->EquippedItemClass & spellProto->EquippedItemClass) if (((*i)->GetSpellProto()->EquippedItemSubClassMask == 0) || ((*i)->GetSpellProto()->EquippedItemSubClassMask & spellProto->EquippedItemSubClassMask)) - AddFlatPctN(DoneTotalMod, (*i)->GetAmount()); + AddFlatPctN(DoneTotalMod, NegativeDoneTotalMod, (*i)->GetAmount()); } else if (ToPlayer() && ToPlayer()->HasItemFitToSpellRequirements((*i)->GetSpellProto())) - AddFlatPctN(DoneTotalMod, (*i)->GetAmount()); + AddFlatPctN(DoneTotalMod, NegativeDoneTotalMod, (*i)->GetAmount()); } } else if (ToPlayer()) @@ -11482,25 +11629,25 @@ void Unit::MeleeDamageBonus(Unit *pVictim, uint32 *pdamage, WeaponAttackType att Item * item = ToPlayer()->GetItemByPos(INVENTORY_SLOT_BAG_0, slot); if (item && !item->IsBroken() && item->IsFitToSpellRequirements((*i)->GetSpellProto())) - AddFlatPctN(DoneTotalMod, (*i)->GetAmount()); + AddFlatPctN(DoneTotalMod, NegativeDoneTotalMod, (*i)->GetAmount()); } else if (ToPlayer()->HasItemFitToSpellRequirements((*i)->GetSpellProto())) - AddFlatPctN(DoneTotalMod, (*i)->GetAmount()); + AddFlatPctN(DoneTotalMod, NegativeDoneTotalMod, (*i)->GetAmount()); } // Creatures' melee else if ((*i)->GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL) - AddFlatPctN(DoneTotalMod, (*i)->GetAmount()); + AddFlatPctN(DoneTotalMod, NegativeDoneTotalMod, (*i)->GetAmount()); AuraEffectList const &mDamageDoneVersus = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_DONE_VERSUS); for (AuraEffectList::const_iterator i = mDamageDoneVersus.begin(); i != mDamageDoneVersus.end(); ++i) if (creatureTypeMask & uint32((*i)->GetMiscValue())) - AddFlatPctN(DoneTotalMod, (*i)->GetAmount()); + AddFlatPctN(DoneTotalMod, NegativeDoneTotalMod, (*i)->GetAmount()); // bonus against aurastate AuraEffectList const &mDamageDoneVersusAurastate = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_DONE_VERSUS_AURASTATE); for (AuraEffectList::const_iterator i = mDamageDoneVersusAurastate.begin(); i != mDamageDoneVersusAurastate.end(); ++i) if (pVictim->HasAuraState(AuraState((*i)->GetMiscValue()))) - AddFlatPctN(DoneTotalMod, (*i)->GetAmount()); + AddFlatPctN(DoneTotalMod, NegativeDoneTotalMod, (*i)->GetAmount()); // done scripted mod (take it from owner) Unit * owner = GetOwner() ? GetOwner() : this; @@ -11520,14 +11667,14 @@ void Unit::MeleeDamageBonus(Unit *pVictim, uint32 *pdamage, WeaponAttackType att if ((*i)->GetSpellProto()->SpellIconID == 2656) { if (!pVictim->HealthAbovePct(35)) - AddFlatPctN(DoneTotalMod, (*i)->GetAmount()); + AddFlatPctN(DoneTotalMod, NegativeDoneTotalMod, (*i)->GetAmount()); } // Tundra Stalker else { // Frost Fever (target debuff) if (pVictim->HasAura(55095)) - AddFlatPctN(DoneTotalMod, (*i)->GetAmount()); + AddFlatPctN(DoneTotalMod, NegativeDoneTotalMod, (*i)->GetAmount()); } break; } @@ -11536,7 +11683,7 @@ void Unit::MeleeDamageBonus(Unit *pVictim, uint32 *pdamage, WeaponAttackType att { if (pVictim->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_DEATHKNIGHT, 0,0x02000000,0)) if (SpellChainNode const *chain = sSpellMgr->GetSpellChainNode((*i)->GetId())) - AddFlatPctF(DoneTotalMod, chain->rank * 2.0f); + AddFlatPctF(DoneTotalMod, NegativeDoneTotalMod, chain->rank * 2.0f); break; } // Marked for Death @@ -11547,7 +11694,7 @@ void Unit::MeleeDamageBonus(Unit *pVictim, uint32 *pdamage, WeaponAttackType att case 7602: { if (pVictim->GetAuraEffect(SPELL_AURA_MOD_STALKED, SPELLFAMILY_HUNTER, 0x400, 0, 0)) - AddFlatPctN(DoneTotalMod, (*i)->GetAmount()); + AddFlatPctN(DoneTotalMod, NegativeDoneTotalMod, (*i)->GetAmount()); break; } } @@ -11562,7 +11709,36 @@ void Unit::MeleeDamageBonus(Unit *pVictim, uint32 *pdamage, WeaponAttackType att if (spellProto->SpellFamilyFlags[0] & 0x2 || spellProto->SpellFamilyFlags[1] & 0x6) if (AuraEffect * aurEff = GetDummyAuraEffect(SPELLFAMILY_DEATHKNIGHT, 196, 0)) if (pVictim->GetDiseasesByCaster(owner->GetGUID()) > 0) - AddFlatPctN(DoneTotalMod, aurEff->GetAmount()); + AddFlatPctN(DoneTotalMod, NegativeDoneTotalMod, aurEff->GetAmount()); + // Rune Strike + if (spellProto->SpellFamilyFlags[1] & 0x20000000) + { + float ApCoeffMod = 1.0f; + // Impurity (dummy effect) + if (GetTypeId() == TYPEID_PLAYER) + { + PlayerSpellMap playerSpells = this->ToPlayer()->GetSpellMap(); + for (PlayerSpellMap::const_iterator itr = playerSpells.begin(); itr != playerSpells.end(); ++itr) + { + if (itr->second->state == PLAYERSPELL_REMOVED || itr->second->disabled) + continue; + switch (itr->first) + { + case 49220: + case 49633: + case 49635: + case 49636: + case 49638: + { + if (const SpellEntry *proto=sSpellStore.LookupEntry(itr->first)) + AddFlatPctN(ApCoeffMod, ApCoeffMod, SpellMgr::CalculateSpellEffectAmount(proto, 0)); + } + break; + } + } + } + DoneFlatBenefit += GetTotalAttackPowerValue(BASE_ATTACK) * 0.2 * ApCoeffMod; + } break; } @@ -11570,13 +11746,13 @@ void Unit::MeleeDamageBonus(Unit *pVictim, uint32 *pdamage, WeaponAttackType att AuraEffectList const& mModDamagePercentTaken = pVictim->GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN); for (AuraEffectList::const_iterator i = mModDamagePercentTaken.begin(); i != mModDamagePercentTaken.end(); ++i) if ((*i)->GetMiscValue() & GetMeleeDamageSchoolMask()) - AddFlatPctN(TakenTotalMod, (*i)->GetAmount()); + AddFlatPctN(TakenTotalMod, NegativeTakenTotalMod, (*i)->GetAmount()); // From caster spells AuraEffectList const& mOwnerTaken = pVictim->GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_FROM_CASTER); for (AuraEffectList::const_iterator i = mOwnerTaken.begin(); i != mOwnerTaken.end(); ++i) if ((*i)->GetCasterGUID() == GetGUID() && (*i)->IsAffectedOnSpell(spellProto)) - AddFlatPctN(TakenTotalMod, (*i)->GetAmount()); + AddFlatPctN(TakenTotalMod, NegativeTakenTotalMod, (*i)->GetAmount()); // .. taken pct (special attacks) if (spellProto) @@ -11593,7 +11769,7 @@ void Unit::MeleeDamageBonus(Unit *pVictim, uint32 *pdamage, WeaponAttackType att AuraEffectList const& mDamageDoneMechanic = pVictim->GetAuraEffectsByType(SPELL_AURA_MOD_MECHANIC_DAMAGE_TAKEN_PERCENT); for (AuraEffectList::const_iterator i = mDamageDoneMechanic.begin(); i != mDamageDoneMechanic.end(); ++i) if (mechanicMask & uint32(1<<((*i)->GetMiscValue()))) - AddFlatPctN(TakenTotalMod, (*i)->GetAmount()); + AddFlatPctN(TakenTotalMod, NegativeTakenTotalMod, (*i)->GetAmount()); } } @@ -11610,12 +11786,12 @@ void Unit::MeleeDamageBonus(Unit *pVictim, uint32 *pdamage, WeaponAttackType att if (pVictim->GetTypeId() != TYPEID_PLAYER) continue; float mod = pVictim->ToPlayer()->GetRatingBonusValue(CR_CRIT_TAKEN_MELEE)*(-8.0f); - AddFlatPctF(TakenTotalMod, std::max(mod, float((*i)->GetAmount()))); + AddFlatPctF(TakenTotalMod, NegativeTakenTotalMod, std::max(mod, float((*i)->GetAmount()))); } break; // Renewed Hope case 329: - AddFlatPctN(TakenTotalMod, (*i)->GetAmount()); + AddFlatPctN(TakenTotalMod, NegativeTakenTotalMod, (*i)->GetAmount()); break; // Blessing of Sanctuary // Greater Blessing of Sanctuary @@ -11626,13 +11802,13 @@ void Unit::MeleeDamageBonus(Unit *pVictim, uint32 *pdamage, WeaponAttackType att continue; if ((*i)->GetMiscValue() & (spellProto ? GetSpellSchoolMask(spellProto) : 0)) - AddFlatPctN(TakenTotalMod, (*i)->GetAmount()); + AddFlatPctN(TakenTotalMod, NegativeTakenTotalMod, (*i)->GetAmount()); break; } // Ebon Plague case 1933: if ((*i)->GetMiscValue() & (spellProto ? GetSpellSchoolMask(spellProto) : 0)) - AddFlatPctN(TakenTotalMod, (*i)->GetAmount()); + AddFlatPctN(TakenTotalMod, NegativeTakenTotalMod, (*i)->GetAmount()); break; } } @@ -11654,7 +11830,7 @@ void Unit::MeleeDamageBonus(Unit *pVictim, uint32 *pdamage, WeaponAttackType att } // effect 0 have expected value but in negative state - AddFlatPctN(TakenTotalMod, -eff0->GetAmount()); + AddFlatPctN(TakenTotalMod, NegativeTakenTotalMod, -eff0->GetAmount()); } break; } @@ -11664,23 +11840,23 @@ void Unit::MeleeDamageBonus(Unit *pVictim, uint32 *pdamage, WeaponAttackType att { AuraEffectList const& mModMeleeDamageTakenPercent = pVictim->GetAuraEffectsByType(SPELL_AURA_MOD_MELEE_DAMAGE_TAKEN_PCT); for (AuraEffectList::const_iterator i = mModMeleeDamageTakenPercent.begin(); i != mModMeleeDamageTakenPercent.end(); ++i) - AddFlatPctN(TakenTotalMod, (*i)->GetAmount()); + AddFlatPctN(TakenTotalMod, NegativeTakenTotalMod, (*i)->GetAmount()); } else { AuraEffectList const& mModRangedDamageTakenPercent = pVictim->GetAuraEffectsByType(SPELL_AURA_MOD_RANGED_DAMAGE_TAKEN_PCT); for (AuraEffectList::const_iterator i = mModRangedDamageTakenPercent.begin(); i != mModRangedDamageTakenPercent.end(); ++i) - AddFlatPctN(TakenTotalMod, (*i)->GetAmount()); + AddFlatPctN(TakenTotalMod, NegativeTakenTotalMod, (*i)->GetAmount()); } - float tmpDamage = float(int32(*pdamage) + DoneFlatBenefit) * DoneTotalMod; + float tmpDamage = float(int32(*pdamage) + DoneFlatBenefit) * DoneTotalMod * NegativeDoneTotalMod; // apply spellmod to Done damage if (spellProto) if (Player* modOwner = GetSpellModOwner()) modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_DAMAGE, tmpDamage); - tmpDamage = (tmpDamage + TakenFlatBenefit) * TakenTotalMod; + tmpDamage = (tmpDamage + TakenFlatBenefit) * TakenTotalMod * NegativeTakenTotalMod; // bonus result can be negative *pdamage = uint32(std::max(tmpDamage, 0.0f)); @@ -11790,7 +11966,7 @@ void Unit::Mount(uint32 mount, uint32 VehicleId, uint32 creatureEntry) if (VehicleId) { - if (CreateVehicleKit(VehicleId)) + if (CreateVehicleKit(VehicleId, creatureEntry)) { GetVehicleKit()->Reset(); @@ -11804,7 +11980,7 @@ void Unit::Mount(uint32 mount, uint32 VehicleId, uint32 creatureEntry) plr->GetSession()->SendPacket(&data); // mounts can also have accessories - GetVehicleKit()->InstallAllAccessories(creatureEntry); + GetVehicleKit()->InstallAllAccessories(); } } } @@ -12446,7 +12622,6 @@ void Unit::setDeathState(DeathState s) UnsummonAllTotems(); RemoveAllControlled(); RemoveAllAurasOnDeath(); - ExitVehicle(); } if (s == JUST_DIED) @@ -12458,8 +12633,6 @@ void Unit::setDeathState(DeathState s) ClearDiminishings(); GetMotionMaster()->Clear(false); GetMotionMaster()->MoveIdle(); - if (m_vehicleKit) - m_vehicleKit->Die(); SendMonsterStop(true); //without this when removing IncreaseMaxHealth aura player may stuck with 1 hp //do not why since in IncreaseMaxHealth currenthealth is checked @@ -12703,7 +12876,6 @@ Unit* Creature::SelectVictim() return target; } - Unit::AuraEffectList const& iAuras = GetAuraEffectsByType(SPELL_AURA_MOD_INVISIBILITY); if(!iAuras.empty()) { @@ -14077,7 +14249,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit * pTarget, uint32 procFlag, bool handled = false; if (HandleAuraProc(pTarget, damage, i->aura, procSpell, procFlag, procExtra, cooldown, &handled)) { - sLog->outDebug("ProcDamageAndSpell: casting spell %u (triggered with value by %s aura of spell %u)", spellInfo->Id,(isVictim?"a victim's":"an attacker's"), Id); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting spell %u (triggered with value by %s aura of spell %u)", spellInfo->Id,(isVictim?"a victim's":"an attacker's"), Id); takeCharges = true; } @@ -14094,7 +14266,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit * pTarget, uint32 procFlag, { case SPELL_AURA_PROC_TRIGGER_SPELL: { - sLog->outDebug("ProcDamageAndSpell: casting spell %u (triggered by %s aura of spell %u)", spellInfo->Id,(isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting spell %u (triggered by %s aura of spell %u)", spellInfo->Id,(isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); // Don`t drop charge or add cooldown for not started trigger if (HandleProcTriggerSpell(pTarget, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown)) takeCharges = true; @@ -14102,7 +14274,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit * pTarget, uint32 procFlag, } case SPELL_AURA_PROC_TRIGGER_DAMAGE: { - sLog->outDebug("ProcDamageAndSpell: doing %u damage from spell id %u (triggered by %s aura of spell %u)", triggeredByAura->GetAmount() , spellInfo->Id, (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: doing %u damage from spell id %u (triggered by %s aura of spell %u)", triggeredByAura->GetAmount() , spellInfo->Id, (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); SpellNonMeleeDamage damageInfo(this, pTarget, spellInfo->Id, spellInfo->SchoolMask); uint32 damage = SpellDamageBonus(pTarget, spellInfo, triggeredByAura->GetAmount(), SPELL_DIRECT_DAMAGE); CalculateSpellDamageTaken(&damageInfo, damage, spellInfo); @@ -14115,38 +14287,38 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit * pTarget, uint32 procFlag, case SPELL_AURA_MANA_SHIELD: case SPELL_AURA_DUMMY: { - sLog->outDebug("ProcDamageAndSpell: casting spell id %u (triggered by %s dummy aura of spell %u)", spellInfo->Id,(isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting spell id %u (triggered by %s dummy aura of spell %u)", spellInfo->Id,(isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); if (HandleDummyAuraProc(pTarget, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown)) takeCharges = true; break; } case SPELL_AURA_OBS_MOD_POWER: - sLog->outDebug("ProcDamageAndSpell: casting spell id %u (triggered by %s aura of spell %u)", spellInfo->Id,(isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting spell id %u (triggered by %s aura of spell %u)", spellInfo->Id,(isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); if (HandleObsModEnergyAuraProc(pTarget, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown)) takeCharges = true; break; case SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN: - sLog->outDebug("ProcDamageAndSpell: casting spell id %u (triggered by %s aura of spell %u)", spellInfo->Id,(isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting spell id %u (triggered by %s aura of spell %u)", spellInfo->Id,(isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); if (HandleModDamagePctTakenAuraProc(pTarget, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown)) takeCharges = true; break; case SPELL_AURA_MOD_MELEE_HASTE: { - sLog->outDebug("ProcDamageAndSpell: casting spell id %u (triggered by %s haste aura of spell %u)", spellInfo->Id,(isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting spell id %u (triggered by %s haste aura of spell %u)", spellInfo->Id,(isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); if (HandleHasteAuraProc(pTarget, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown)) takeCharges = true; break; } case SPELL_AURA_OVERRIDE_CLASS_SCRIPTS: { - sLog->outDebug("ProcDamageAndSpell: casting spell id %u (triggered by %s aura of spell %u)", spellInfo->Id,(isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting spell id %u (triggered by %s aura of spell %u)", spellInfo->Id,(isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); if (HandleOverrideClassScriptAuraProc(pTarget, damage, triggeredByAura, procSpell, cooldown)) takeCharges = true; break; } case SPELL_AURA_RAID_PROC_FROM_CHARGE_WITH_VALUE: { - sLog->outDebug("ProcDamageAndSpell: casting mending (triggered by %s dummy aura of spell %u)", + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting mending (triggered by %s dummy aura of spell %u)", (isVictim?"a victim's":"an attacker's"),triggeredByAura->GetId()); HandleAuraRaidProcFromChargeWithValue(triggeredByAura); @@ -14155,7 +14327,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit * pTarget, uint32 procFlag, } case SPELL_AURA_RAID_PROC_FROM_CHARGE: { - sLog->outDebug("ProcDamageAndSpell: casting mending (triggered by %s dummy aura of spell %u)", + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting mending (triggered by %s dummy aura of spell %u)", (isVictim?"a victim's":"an attacker's"),triggeredByAura->GetId()); HandleAuraRaidProcFromCharge(triggeredByAura); @@ -14164,7 +14336,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit * pTarget, uint32 procFlag, } case SPELL_AURA_PROC_TRIGGER_SPELL_WITH_VALUE: { - sLog->outDebug("ProcDamageAndSpell: casting spell %u (triggered with value by %s aura of spell %u)", spellInfo->Id,(isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting spell %u (triggered with value by %s aura of spell %u)", spellInfo->Id,(isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); if (HandleProcTriggerSpell(pTarget, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown)) takeCharges = true; @@ -14185,7 +14357,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit * pTarget, uint32 procFlag, // Skip melee hits and spells ws wrong school or zero cost if (procSpell && (procSpell->manaCost != 0 || procSpell->ManaCostPercentage != 0) && // Cost check - (triggeredByAura->GetMiscValue() & procSpell->SchoolMask) == 0) // School check + (triggeredByAura->GetMiscValue() & procSpell->SchoolMask)) // School check takeCharges = true; break; case SPELL_AURA_MECHANIC_IMMUNITY: @@ -14204,7 +14376,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit * pTarget, uint32 procFlag, takeCharges = true; break; case SPELL_AURA_MOD_SPELL_CRIT_CHANCE: - sLog->outDebug("ProcDamageAndSpell: casting spell id %u (triggered by %s spell crit chance aura of spell %u)", spellInfo->Id,(isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting spell id %u (triggered by %s spell crit chance aura of spell %u)", spellInfo->Id,(isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); if (procSpell && HandleSpellCritChanceAuraProc(pTarget, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown)) takeCharges = true; break; @@ -14248,6 +14420,13 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit * pTarget, uint32 procFlag, break; } } + // Bone Shield DropCharge Cooldown + if (GetTypeId() == TYPEID_PLAYER && cooldown && spellInfo->Id == 49222) + if (this->ToPlayer()->HasSpellCooldown(250000)) + takeCharges = false; + else + this->ToPlayer()->AddSpellCooldown(250000, 0, time(NULL) + cooldown); + // Remove charge (aura can be removed by triggers) if (useCharges && takeCharges) i->aura->DropCharge(); @@ -14525,15 +14704,11 @@ Unit* Unit::SelectNearbyTarget(float dist) const if (getVictim()) targets.remove(getVictim()); - // remove not LoS targets - for (std::list::iterator tIter = targets.begin(); tIter != targets.end();) + // remove not LoS targets, Totems and Critters + for (std::list::iterator tIter = targets.begin(); tIter != targets.end();) { - if (!IsWithinLOSInMap(*tIter)) - { - std::list::iterator tIter2 = tIter; - ++tIter; - targets.erase(tIter2); - } + if (!IsWithinLOSInMap(*tIter) || (*tIter)->isTotem() || (*tIter)->isSpiritService() || (*tIter)->GetCreatureType() == CREATURE_TYPE_CRITTER) + targets.erase(tIter++); else ++tIter; } @@ -14543,11 +14718,8 @@ Unit* Unit::SelectNearbyTarget(float dist) const return NULL; // select random - uint32 rIdx = urand(0,targets.size()-1); - std::list::const_iterator tcIter = targets.begin(); - for (uint32 i = 0; i < rIdx; ++i) - ++tcIter; - + std::list::const_iterator tcIter = targets.begin(); + std::advance(tcIter, urand(0, targets.size()-1)); return *tcIter; } @@ -14947,7 +15119,7 @@ bool Unit::HandleAuraRaidProcFromChargeWithValue(AuraEffect *triggeredByAura) //Currently only Prayer of Mending if (!(spellProto->SpellFamilyName == SPELLFAMILY_PRIEST && spellProto->SpellFamilyFlags[1] & 0x20)) { - sLog->outDebug("Unit::HandleAuraRaidProcFromChargeWithValue, received not handled spell: %u", spellProto->Id); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Unit::HandleAuraRaidProcFromChargeWithValue, received not handled spell: %u", spellProto->Id); return false; } @@ -15135,7 +15307,7 @@ void Unit::Kill(Unit *pVictim, bool durabilityLoss) loot->generateMoneyLoot(creature->GetCreatureInfo()->mingold,creature->GetCreatureInfo()->maxgold); } - player->RewardPlayerAndGroupAtKill(pVictim); + player->RewardPlayerAndGroupAtKill(pVictim, false); } // Do KILL and KILLED procs. KILL proc is called only for the unit who landed the killing blow (and its owner - for pets and totems) regardless of who tapped the victim @@ -15327,6 +15499,9 @@ void Unit::Kill(Unit *pVictim, bool durabilityLoss) sScriptMgr->OnPlayerKilledByCreature(killer, killed); } } + + if (Vehicle* veh = pVictim->GetVehicle()) + pVictim->ExitVehicle(); } void Unit::SetControlled(bool apply, UnitState state) @@ -15448,24 +15623,38 @@ void Unit::SetRooted(bool apply) // AddUnitMovementFlag(MOVEMENTFLAG_ROOT); - WorldPacket data(SMSG_FORCE_MOVE_ROOT, 10); - data.append(GetPackGUID()); - data << m_rootTimes; - SendMessageToSet(&data,true); - - if (GetTypeId() != TYPEID_PLAYER) + if (Player* thisPlr = this->ToPlayer()) + { + WorldPacket data(SMSG_FORCE_MOVE_ROOT, 10); + data.append(GetPackGUID()); + data << m_rootTimes; + SendMessageToSet(&data,true); + } + else + { + WorldPacket data(SMSG_SPLINE_MOVE_ROOT, 8); + data.append(GetPackGUID()); + SendMessageToSet(&data,true); ToCreature()->StopMoving(); + } } else { if (!HasUnitState(UNIT_STAT_STUNNED)) // prevent allow move if have also stun effect { - m_rootTimes++; //blizzard internal check? - - WorldPacket data(SMSG_FORCE_MOVE_UNROOT, 10); - data.append(GetPackGUID()); - data << m_rootTimes; - SendMessageToSet(&data,true); + if (Player* thisPlr = this->ToPlayer()) + { + WorldPacket data(SMSG_FORCE_MOVE_UNROOT, 10); + data.append(GetPackGUID()); + data << ++m_rootTimes; + SendMessageToSet(&data,true); + } + else + { + WorldPacket data(SMSG_SPLINE_MOVE_UNROOT, 8); + data.append(GetPackGUID()); + SendMessageToSet(&data,true); + } // RemoveUnitMovementFlag(MOVEMENTFLAG_ROOT); } @@ -15535,7 +15724,7 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const * a ASSERT(type != CHARM_TYPE_POSSESS || charmer->GetTypeId() == TYPEID_PLAYER); ASSERT((type == CHARM_TYPE_VEHICLE) == IsVehicle()); - sLog->outDebug("SetCharmedBy: charmer %u (GUID %u), charmed %u (GUID %u), type %u.", charmer->GetEntry(), charmer->GetGUIDLow(), GetEntry(), GetGUIDLow(), uint32(type)); + sLog->outDebug(LOG_FILTER_UNITS, "SetCharmedBy: charmer %u (GUID %u), charmed %u (GUID %u), type %u.", charmer->GetEntry(), charmer->GetGUIDLow(), GetEntry(), GetGUIDLow(), uint32(type)); if (this == charmer) { @@ -15737,10 +15926,12 @@ void Unit::RemoveCharmedBy(Unit *charmer) case CHARM_TYPE_VEHICLE: charmer->ToPlayer()->SetClientControl(charmer, 1); charmer->ToPlayer()->SetViewpoint(this, false); + charmer->ToPlayer()->SetClientControl(this, 0); break; case CHARM_TYPE_POSSESS: charmer->ToPlayer()->SetClientControl(charmer, 1); charmer->ToPlayer()->SetViewpoint(this, false); + charmer->ToPlayer()->SetClientControl(this, 0); charmer->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE); break; case CHARM_TYPE_CHARM: @@ -15793,13 +15984,13 @@ void Unit::RestoreFaction() } } -bool Unit::CreateVehicleKit(uint32 id) +bool Unit::CreateVehicleKit(uint32 id, uint32 creatureEntry) { VehicleEntry const *vehInfo = sVehicleStore.LookupEntry(id); if (!vehInfo) return false; - m_vehicleKit = new Vehicle(this, vehInfo); + m_vehicleKit = new Vehicle(this, vehInfo, creatureEntry); m_updateFlag |= UPDATEFLAG_VEHICLE; m_unitTypeMask |= UNIT_MASK_VEHICLE; return true; @@ -16030,34 +16221,23 @@ void Unit::SetAuraStack(uint32 spellId, Unit *target, uint32 stack) aura->SetStackAmount(stack); } -void Unit::ApplyResilience(const Unit *pVictim, float *crit, int32 *damage, bool isCrit, CombatRating type) const +void Unit::ApplyResilience(Unit const* victim, float* crit, int32* damage, bool isCrit, CombatRating type) const { - if (IsVehicle() || pVictim->IsVehicle()) + // player mounted on multi-passenger mount is also classified as vehicle + if (IsVehicle() || (victim->IsVehicle() && victim->GetTypeId() != TYPEID_PLAYER)) return; - const Unit *source = ToPlayer(); - if (!source) - { - source = ToCreature(); - if (source) - { - source = source->ToCreature()->GetOwner(); - if (source) - source = source->ToPlayer(); - } - } + Unit const* source = NULL; + if (GetTypeId() == TYPEID_PLAYER) + source = this; + else if (GetTypeId() == TYPEID_UNIT && GetOwner() && GetOwner()->GetTypeId() == TYPEID_PLAYER) + source = GetOwner(); - const Unit *target = pVictim->ToPlayer(); - if (!target) - { - target = pVictim->ToCreature(); - if (target) - { - target = target->ToCreature()->GetOwner(); - if (target) - target = target->ToPlayer(); - } - } + Unit const* target = NULL; + if (victim->GetTypeId() == TYPEID_PLAYER) + target = victim; + else if (victim->GetTypeId() == TYPEID_UNIT && victim->GetOwner() && victim->GetOwner()->GetTypeId() == TYPEID_PLAYER) + target = victim->GetOwner(); if (!target) return; @@ -16067,34 +16247,34 @@ void Unit::ApplyResilience(const Unit *pVictim, float *crit, int32 *damage, bool case CR_CRIT_TAKEN_MELEE: // Crit chance reduction works against nonpets if (crit) - *crit -= target->ToPlayer()->GetMeleeCritChanceReduction(); + *crit -= target->GetMeleeCritChanceReduction(); if (source && damage) { if (isCrit) - *damage -= target->ToPlayer()->GetMeleeCritDamageReduction(*damage); - *damage -= target->ToPlayer()->GetMeleeDamageReduction(*damage); + *damage -= target->GetMeleeCritDamageReduction(*damage); + *damage -= target->GetMeleeDamageReduction(*damage); } break; case CR_CRIT_TAKEN_RANGED: // Crit chance reduction works against nonpets if (crit) - *crit -= target->ToPlayer()->GetRangedCritChanceReduction(); + *crit -= target->GetRangedCritChanceReduction(); if (source && damage) { if (isCrit) - *damage -= target->ToPlayer()->GetRangedCritDamageReduction(*damage); - *damage -= target->ToPlayer()->GetRangedDamageReduction(*damage); + *damage -= target->GetRangedCritDamageReduction(*damage); + *damage -= target->GetRangedDamageReduction(*damage); } break; case CR_CRIT_TAKEN_SPELL: // Crit chance reduction works against nonpets if (crit) - *crit -= target->ToPlayer()->GetSpellCritChanceReduction(); + *crit -= target->GetSpellCritChanceReduction(); if (source && damage) { if (isCrit) - *damage -= target->ToPlayer()->GetSpellCritDamageReduction(*damage); - *damage -= target->ToPlayer()->GetSpellDamageReduction(*damage); + *damage -= target->GetSpellCritDamageReduction(*damage); + *damage -= target->GetSpellDamageReduction(*damage); } break; default: @@ -16143,7 +16323,7 @@ float Unit::MeleeSpellMissChance(const Unit *pVictim, WeaponAttackType attType, if (pVictim->GetTypeId() == TYPEID_PLAYER) miss_chance += diff > 0 ? diff * 0.04f : diff * 0.02f; else - miss_chance += diff > 10 ? 2 + (diff - 10) * 0.4f : diff * 0.1f; + miss_chance += diff > 10 ? diff * 0.4f - 3.0f : diff * 0.1f; // Limit miss chance from 0 to 60% if (miss_chance < 0.0f) @@ -16227,15 +16407,13 @@ void Unit::KnockbackFrom(float x, float y, float speedXY, float speedZ) float Unit::GetCombatRatingReduction(CombatRating cr) const { - if (GetTypeId() == TYPEID_PLAYER) - return ((Player const*)this)->GetRatingBonusValue(cr); - else if (((Creature const*)this)->isPet()) - { - // Player's pet get resilience from owner + if (Player const* player = ToPlayer()) + return player->GetRatingBonusValue(cr); + // Player's pet get resilience from owner + else if (isPet()) if (Unit* owner = GetOwner()) - if (owner->GetTypeId() == TYPEID_PLAYER) - return ((Player*)owner)->GetRatingBonusValue(cr); - } + if (Player* player = owner->ToPlayer()) + return player->GetRatingBonusValue(cr); return 0.0f; } @@ -16248,7 +16426,7 @@ uint32 Unit::GetCombatRatingDamageReduction(CombatRating cr, float rate, float c uint32 Unit::GetModelForForm(ShapeshiftForm form) { - switch(form) + switch (form) { case FORM_CAT: // Based on Hair color @@ -16417,39 +16595,39 @@ uint32 Unit::GetModelForForm(ShapeshiftForm form) return 21243; return 21244; default: + break; + } + + uint32 modelid = 0; + SpellShapeshiftEntry const* formEntry = sSpellShapeshiftStore.LookupEntry(form); + if (formEntry && formEntry->modelID_A) + { + // Take the alliance modelid as default + if (GetTypeId() != TYPEID_PLAYER) + return formEntry->modelID_A; + else { - uint32 modelid = 0; - SpellShapeshiftEntry const* formEntry = sSpellShapeshiftStore.LookupEntry(form); - if (formEntry && formEntry->modelID_A) - { - // Take the alliance modelid as default - if (GetTypeId() != TYPEID_PLAYER) - return formEntry->modelID_A; - else - { - if (Player::TeamForRace(getRace()) == ALLIANCE) - modelid = formEntry->modelID_A; - else - modelid = formEntry->modelID_H; + if (Player::TeamForRace(getRace()) == ALLIANCE) + modelid = formEntry->modelID_A; + else + modelid = formEntry->modelID_H; - // If the player is horde but there are no values for the horde modelid - take the alliance modelid - if (!modelid && Player::TeamForRace(getRace()) == HORDE) - modelid = formEntry->modelID_A; - } - } - return modelid; + // If the player is horde but there are no values for the horde modelid - take the alliance modelid + if (!modelid && Player::TeamForRace(getRace()) == HORDE) + modelid = formEntry->modelID_A; } } - return 0; + + return modelid; } uint32 Unit::GetModelForTotem(PlayerTotemType totemType) { - switch(getRace()) + switch (getRace()) { case RACE_ORC: { - switch(totemType) + switch (totemType) { case SUMMON_TYPE_TOTEM_FIRE: //fire return 30758; @@ -16464,7 +16642,7 @@ uint32 Unit::GetModelForTotem(PlayerTotemType totemType) } case RACE_DWARF: { - switch(totemType) + switch (totemType) { case SUMMON_TYPE_TOTEM_FIRE: //fire return 30754; @@ -16479,7 +16657,7 @@ uint32 Unit::GetModelForTotem(PlayerTotemType totemType) } case RACE_TROLL: { - switch(totemType) + switch (totemType) { case SUMMON_TYPE_TOTEM_FIRE: //fire return 30762; @@ -16494,7 +16672,7 @@ uint32 Unit::GetModelForTotem(PlayerTotemType totemType) } case RACE_TAUREN: { - switch(totemType) + switch (totemType) { case SUMMON_TYPE_TOTEM_FIRE: //fire return 4589; @@ -16509,7 +16687,7 @@ uint32 Unit::GetModelForTotem(PlayerTotemType totemType) } case RACE_DRAENEI: { - switch(totemType) + switch (totemType) { case SUMMON_TYPE_TOTEM_FIRE: //fire return 19074; @@ -16569,9 +16747,77 @@ bool Unit::CheckPlayerCondition(Player* pPlayer) } } -void Unit::EnterVehicle(Vehicle *vehicle, int8 seatId, AuraApplication const * aurApp) +bool Unit::HandleSpellClick(Unit* clicker, int8 seatId) +{ + bool success = false; + uint32 spellClickEntry = GetVehicleKit() ? GetVehicleKit()->m_creatureEntry : GetEntry(); + SpellClickInfoMapBounds clickPair = sObjectMgr->GetSpellClickInfoMapBounds(spellClickEntry); + for (SpellClickInfoMap::const_iterator itr = clickPair.first; itr != clickPair.second; ++itr) + { + if (itr->second.IsFitToRequirements(clicker, this)) + { + Unit *caster = (itr->second.castFlags & NPC_CLICK_CAST_CASTER_CLICKER) ? clicker : this; + Unit *target = (itr->second.castFlags & NPC_CLICK_CAST_TARGET_CLICKER) ? clicker : this; + uint64 origCasterGUID = (itr->second.castFlags & NPC_CLICK_CAST_ORIG_CASTER_OWNER) ? GetOwnerGUID() : clicker->GetGUID(); + + SpellEntry const* spellEntry = sSpellStore.LookupEntry(itr->second.spellId); + // if(!spellEntry) should be checked at npc_spellclick load + + if (seatId > -1) + { + uint8 i = 0; + bool valid = false; + while (i < MAX_SPELL_EFFECTS && !valid) + { + if (spellEntry->EffectApplyAuraName[i] == SPELL_AURA_CONTROL_VEHICLE) + { + valid = true; + break; + } + ++i; + } + + if (!valid) + { + sLog->outErrorDb("Spell %u specified in npc_spellclick_spells is not a valid vehicle enter aura!", itr->second.spellId); + return false; + } + + if (IsInMap(caster)) + caster->CastCustomSpell(itr->second.spellId, SpellValueMod(SPELLVALUE_BASE_POINT0+i), seatId+1, target, true, NULL, NULL, origCasterGUID); + else // This can happen during Player::_LoadAuras + { + int32 bp0 = seatId; + Aura::TryCreate(spellEntry, this, clicker, &bp0, NULL, origCasterGUID); + } + } + else + { + if (IsInMap(caster)) + caster->CastSpell(target, spellEntry, true, NULL, NULL, origCasterGUID); + else + Aura::TryCreate(spellEntry, this, clicker, NULL, NULL, origCasterGUID); + } + + success = true; + } + } + + if (this->ToCreature() && this->ToCreature()->IsAIEnabled) + this->ToCreature()->AI()->DoAction(EVENT_SPELLCLICK); + + return success; +} + +void Unit::EnterVehicle(Unit *base, int8 seatId) +{ + CastCustomSpell(VEHICLE_SPELL_RIDE_HARDCODED, SPELLVALUE_BASE_POINT0, seatId+1, base, false); +} + +void Unit::_EnterVehicle(Vehicle* vehicle, int8 seatId, AuraApplication const* aurApp) { - if (!isAlive() || GetVehicleKit() == vehicle) + // Must be called only from aura handler + if (!isAlive() || GetVehicleKit() == vehicle || vehicle->GetBase()->IsOnVehicle(this)) return; if (m_vehicle) @@ -16580,18 +16826,21 @@ void Unit::EnterVehicle(Vehicle *vehicle, int8 seatId, AuraApplication const * a { if (seatId >= 0 && seatId != GetTransSeat()) { - sLog->outDebug("EnterVehicle: %u leave vehicle %u seat %d and enter %d.", GetEntry(), m_vehicle->GetBase()->GetEntry(), GetTransSeat(), seatId); - ChangeSeat(seatId, aurApp != NULL); + sLog->outDebug(LOG_FILTER_VEHICLES, "EnterVehicle: %u leave vehicle %u seat %d and enter %d.", GetEntry(), m_vehicle->GetBase()->GetEntry(), GetTransSeat(), seatId); + ChangeSeat(seatId); } return; } else { - sLog->outDebug("EnterVehicle: %u exit %u and enter %u.", GetEntry(), m_vehicle->GetBase()->GetEntry(), vehicle->GetBase()->GetEntry()); + sLog->outDebug(LOG_FILTER_VEHICLES, "EnterVehicle: %u exit %u and enter %u.", GetEntry(), m_vehicle->GetBase()->GetEntry(), vehicle->GetBase()->GetEntry()); ExitVehicle(); } } + if (aurApp && aurApp->GetRemoveMode()) + return; + if (Player* plr = ToPlayer()) { if (vehicle->GetBase()->GetTypeId() == TYPEID_PLAYER && plr->isInCombat()) @@ -16608,40 +16857,29 @@ void Unit::EnterVehicle(Vehicle *vehicle, int8 seatId, AuraApplication const * a bg->EventPlayerDroppedFlag(plr); } - // vehicle is applied by aura, and aura effect remove handler was called during apply handler execution - // prevent undefined behaviour - if (aurApp && aurApp->GetRemoveMode()) - return; + if (Player* thisPlr = this->ToPlayer()) + { + WorldPacket data(SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA, 0); + thisPlr->GetSession()->SendPacket(&data); + } ASSERT(!m_vehicle); m_vehicle = vehicle; - if (!m_vehicle->AddPassenger(this, seatId, aurApp != NULL)) + if (!m_vehicle->AddPassenger(this, seatId)) { m_vehicle = NULL; return; } - - if (Player* thisPlr = this->ToPlayer()) - { - WorldPacket data(SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA, 0); - thisPlr->GetSession()->SendPacket(&data); - thisPlr->SendClearFocus(vehicle->GetBase()); - } - - SetControlled(true, UNIT_STAT_ROOT); - //movementInfo is set in AddPassenger - //packets are sent in AddPassenger - } -void Unit::ChangeSeat(int8 seatId, bool next, bool byAura) +void Unit::ChangeSeat(int8 seatId, bool next) { if (!m_vehicle) return; if (seatId < 0) { - seatId = m_vehicle->GetNextEmptySeat(GetTransSeat(), next, byAura); + seatId = m_vehicle->GetNextEmptySeat(GetTransSeat(), next); if (seatId < 0) return; } @@ -16649,60 +16887,70 @@ void Unit::ChangeSeat(int8 seatId, bool next, bool byAura) return; m_vehicle->RemovePassenger(this); - if (!m_vehicle->AddPassenger(this, seatId, byAura)) + if (!m_vehicle->AddPassenger(this, seatId)) ASSERT(false); } -void Unit::ExitVehicle() +void Unit::ExitVehicle(Position const* exitPosition) { + // This function can be called at upper level code to initialize an exit from the passenger's side. if (!m_vehicle) return; - Unit *vehicleBase = m_vehicle->GetBase(); - const AuraEffectList &modAuras = vehicleBase->GetAuraEffectsByType(SPELL_AURA_CONTROL_VEHICLE); - for (AuraEffectList::const_iterator itr = modAuras.begin(); itr != modAuras.end(); ++itr) - { - if ((*itr)->GetBase()->GetOwner() == this) - { - vehicleBase->RemoveAura((*itr)->GetBase()); - break; // there should be no case that a vehicle has two auras for one owner - } - } + GetVehicleBase()->RemoveAurasByType(SPELL_AURA_CONTROL_VEHICLE, GetGUID()); + _ExitVehicle(exitPosition); +} +void Unit::_ExitVehicle(Position const* exitPosition) +{ if (!m_vehicle) return; - //sLog->outError("exit vehicle"); - m_vehicle->RemovePassenger(this); // This should be done before dismiss, because there may be some aura removal Vehicle *vehicle = m_vehicle; m_vehicle = NULL; - SetControlled(false, UNIT_STAT_ROOT); + SetControlled(false, UNIT_STAT_ROOT); // SMSG_MOVE_FORCE_UNROOT, ~MOVEMENTFLAG_ROOT - RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT); - m_movementInfo.t_pos.Relocate(0, 0, 0, 0); - m_movementInfo.t_time = 0; - m_movementInfo.t_seat = 0; + Position pos; + if (!exitPosition) // Exit position not specified + vehicle->GetBase()->GetPosition(&pos); + else + pos = *exitPosition; - Relocate(vehicle->GetBase()); + AddUnitState(UNIT_STAT_MOVE); - //Send leave vehicle, not correct if (GetTypeId() == TYPEID_PLAYER) - { - //this->ToPlayer()->SetClientControl(this, 1); - this->ToPlayer()->SendTeleportAckPacket(); this->ToPlayer()->SetFallInformation(0, GetPositionZ()); + else if (HasUnitMovementFlag(MOVEMENTFLAG_ROOT)) + { + WorldPacket data(SMSG_SPLINE_MOVE_UNROOT, 8); + data.append(GetPackGUID()); + SendMessageToSet(&data, false); } - WorldPacket data; - BuildHeartBeatMsg(&data); - SendMessageToSet(&data, false); + + SendMonsterMoveExitVehicle(&pos); + Relocate(&pos); + + WorldPacket data2; + BuildHeartBeatMsg(&data2); + SendMessageToSet(&data2, false); if (vehicle->GetBase()->HasUnitTypeMask(UNIT_MASK_MINION)) if (((Minion*)vehicle->GetBase())->GetOwner() == this) vehicle->Dismiss(); + + if (HasUnitTypeMask(UNIT_MASK_ACCESSORY)) + { + // Vehicle just died, we die too + if (vehicle->GetBase()->getDeathState() == JUST_DIED) + setDeathState(JUST_DIED); + // If for other reason we as minion are exiting the vehicle (ejected, master unmounted) - unsummon + else + ToTempSummon()->UnSummon(2000); // Approximation + } } void Unit::BuildMovementPacket(ByteBuffer *data) const @@ -16712,8 +16960,6 @@ void Unit::BuildMovementPacket(ByteBuffer *data) const case TYPEID_UNIT: if (canFly()) const_cast(this)->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - if (IsVehicle()) - const_cast(this)->AddExtraUnitMovementFlag(GetVehicleKit()->GetExtraMovementFlagsForBase()); break; case TYPEID_PLAYER: // remove unknown, unused etc flags for now @@ -16806,7 +17052,7 @@ bool Unit::SetPosition(float x, float y, float z, float orientation, bool telepo // prevent crash when a bad coord is sent by the client if (!Trinity::IsValidMapCoord(x,y,z,orientation)) { - sLog->outDebug("Unit::SetPosition(%f, %f, %f) .. bad coordinates!",x,y,z); + sLog->outDebug(LOG_FILTER_UNITS, "Unit::SetPosition(%f, %f, %f) .. bad coordinates!",x,y,z); return false; } @@ -16839,7 +17085,7 @@ void Unit::SendThreatListUpdate() { if (uint32 count = getThreatManager().getThreatList().size()) { - //sLog->outDebug("WORLD: Send SMSG_THREAT_UPDATE Message"); + //sLog->outDebug(LOG_FILTER_UNITS, "WORLD: Send SMSG_THREAT_UPDATE Message"); WorldPacket data(SMSG_THREAT_UPDATE, 8 + count * 8); data.append(GetPackGUID()); data << uint32(count); @@ -16857,7 +17103,7 @@ void Unit::SendChangeCurrentVictimOpcode(HostileReference* pHostileReference) { if (uint32 count = getThreatManager().getThreatList().size()) { - sLog->outDebug("WORLD: Send SMSG_HIGHEST_THREAT_UPDATE Message"); + sLog->outDebug(LOG_FILTER_UNITS, "WORLD: Send SMSG_HIGHEST_THREAT_UPDATE Message"); WorldPacket data(SMSG_HIGHEST_THREAT_UPDATE, 8 + 8 + count * 8); data.append(GetPackGUID()); data.appendPackGUID(pHostileReference->getUnitGuid()); @@ -16874,7 +17120,7 @@ void Unit::SendChangeCurrentVictimOpcode(HostileReference* pHostileReference) void Unit::SendClearThreatListOpcode() { - sLog->outDebug("WORLD: Send SMSG_THREAT_CLEAR Message"); + sLog->outDebug(LOG_FILTER_UNITS, "WORLD: Send SMSG_THREAT_CLEAR Message"); WorldPacket data(SMSG_THREAT_CLEAR, 8); data.append(GetPackGUID()); SendMessageToSet(&data, false); @@ -16882,7 +17128,7 @@ void Unit::SendClearThreatListOpcode() void Unit::SendRemoveFromThreatListOpcode(HostileReference* pHostileReference) { - sLog->outDebug("WORLD: Send SMSG_THREAT_REMOVE Message"); + sLog->outDebug(LOG_FILTER_UNITS, "WORLD: Send SMSG_THREAT_REMOVE Message"); WorldPacket data(SMSG_THREAT_REMOVE, 8 + 8); data.append(GetPackGUID()); data.appendPackGUID(pHostileReference->getUnitGuid()); @@ -16999,13 +17245,20 @@ uint32 Unit::GetRemainingDotDamage(uint64 caster, uint32 spellId, uint8 effectIn { if ((*i)->GetCasterGUID() != caster || (*i)->GetId() != spellId || (*i)->GetEffIndex() != effectIndex) continue; - amount += ((*i)->GetAmount() * ((*i)->GetTotalTicks() - ((*i)->GetTickNumber()))) / (*i)->GetTotalTicks(); + amount += uint32(((*i)->GetAmount() * std::max((*i)->GetTotalTicks() - int32((*i)->GetTickNumber()), 0)) / (*i)->GetTotalTicks()); break; } return amount; } +void Unit::SendClearTarget() +{ + WorldPacket data(SMSG_BREAK_TARGET, GetPackGUID().size()); + data.append(GetPackGUID()); + SendMessageToSet(&data, false); +} + void CharmInfo::SetIsCommandAttack(bool val) { m_isCommandAttack = val; diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 050770668d8ce..804e05f0bafda 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -556,7 +556,7 @@ enum UnitFlags UNIT_FLAG_UNK_6 = 0x00000040, UNIT_FLAG_NOT_ATTACKABLE_1 = 0x00000080, // ?? (UNIT_FLAG_PVP_ATTACKABLE | UNIT_FLAG_NOT_ATTACKABLE_1) is NON_PVP_ATTACKABLE UNIT_FLAG_OOC_NOT_ATTACKABLE = 0x00000100, // 2.0.8 - (OOC Out Of Combat) Can not be attacked when not in combat. Removed if unit for some reason enter combat. - UNIT_FLAG_UNK_9 = 0x00000200, // 3.0.3 - makes you unable to attack everything + UNIT_FLAG_PASSIVE = 0x00000200, // makes you unable to attack everything. Almost identical to our "civilian"-term. Will ignore it's surroundings and not engage in combat unless "called upon" or engaged by another unit. UNIT_FLAG_LOOTING = 0x00000400, // loot animation UNIT_FLAG_PET_IN_COMBAT = 0x00000800, // in combat?, 2.0.8 UNIT_FLAG_PVP = 0x00001000, // changed in 3.0.3 @@ -622,8 +622,9 @@ enum NPCFlags UNIT_NPC_FLAG_AUCTIONEER = 0x00200000, // 100% UNIT_NPC_FLAG_STABLEMASTER = 0x00400000, // 100% UNIT_NPC_FLAG_GUILD_BANKER = 0x00800000, // cause client to send 997 opcode - UNIT_NPC_FLAG_SPELLCLICK = 0x01000000, // cause client to send 1015 opcode (spell click), dynamic, set at loading and don't must be set in DB + UNIT_NPC_FLAG_SPELLCLICK = 0x01000000, // cause client to send 1015 opcode (spell click) UNIT_NPC_FLAG_PLAYER_VEHICLE = 0x02000000, // players with mounts that have vehicle data should have it set + UNIT_NPC_FLAG_MAILBOX = 0x04000000, // 100% }; enum MovementFlags @@ -721,7 +722,7 @@ enum SplineFlags SPLINEFLAG_UNKNOWN22 = 0x00200000, SPLINEFLAG_UNKNOWN23 = 0x00400000, SPLINEFLAG_TRANSPORT = 0x00800000, - SPLINEFLAG_UNKNOWN25 = 0x01000000, + SPLINEFLAG_EXIT_VEHICLE = 0x01000000, SPLINEFLAG_UNKNOWN26 = 0x02000000, SPLINEFLAG_UNKNOWN27 = 0x04000000, SPLINEFLAG_UNKNOWN28 = 0x08000000, @@ -937,6 +938,30 @@ enum CurrentSpellTypes #define CURRENT_FIRST_NON_MELEE_SPELL 1 #define CURRENT_MAX_SPELL 4 +struct GlobalCooldown +{ + explicit GlobalCooldown(uint32 _dur = 0, uint32 _time = 0) : duration(_dur), cast_time(_time) {} + + uint32 duration; + uint32 cast_time; +}; + +typedef UNORDERED_MAP GlobalCooldownList; + +class GlobalCooldownMgr // Shared by Player and CharmInfo +{ +public: + GlobalCooldownMgr() {} + +public: + bool HasGlobalCooldown(SpellEntry const* spellInfo) const; + void AddGlobalCooldown(SpellEntry const* spellInfo, uint32 gcd); + void CancelGlobalCooldown(SpellEntry const* spellInfo); + +private: + GlobalCooldownList m_GlobalCooldowns; +}; + enum ActiveStates { ACT_PASSIVE = 0x01, // 0x01 - passive @@ -1057,6 +1082,8 @@ struct CharmInfo CharmSpellEntry* GetCharmSpell(uint8 index) { return &(m_charmspells[index]); } + GlobalCooldownMgr& GetGlobalCooldownMgr() { return m_GlobalCooldownMgr; } + void SetIsCommandAttack(bool val); bool IsCommandAttack(); void SetIsAtStay(bool val); @@ -1088,6 +1115,8 @@ struct CharmInfo float m_stayX; float m_stayY; float m_stayZ; + + GlobalCooldownMgr m_GlobalCooldownMgr; }; // for clearing special attacks @@ -1352,7 +1381,6 @@ class Unit : public WorldObject void CalculateSpellDamageTaken(SpellNonMeleeDamage *damageInfo, int32 damage, SpellEntry const *spellInfo, WeaponAttackType attackType = BASE_ATTACK, bool crit = false); void DealSpellDamage(SpellNonMeleeDamage *damageInfo, bool durabilityLoss); - // player or player's pet resilience (-1%) float GetMeleeCritChanceReduction() const { return GetCombatRatingReduction(CR_CRIT_TAKEN_MELEE); } float GetRangedCritChanceReduction() const { return GetCombatRatingReduction(CR_CRIT_TAKEN_RANGED); } @@ -1493,6 +1521,7 @@ class Unit : public WorldObject void SendMonsterStop(bool on_death = false); 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 SendMonsterMoveExitVehicle(Position const* newPos); //void SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint8 type, uint32 MovementFlags, uint32 Time, Player* player = NULL); void SendMonsterMoveTransport(Unit *vehicleOwner); void SendMonsterMoveWithSpeed(float x, float y, float z, uint32 transitTime = 0, Player* player = NULL); @@ -1507,6 +1536,8 @@ class Unit : public WorldObject void SendRemoveFromThreatListOpcode(HostileReference* pHostileReference); void SendThreatListUpdate(); + void SendClearTarget(); + void BuildHeartBeatMsg(WorldPacket *data) const; bool isAlive() const { return (m_deathState == ALIVE); }; @@ -2008,7 +2039,7 @@ class Unit : public WorldObject Unit *GetMisdirectionTarget() { return m_misdirectionTargetGUID ? GetUnit(*this, m_misdirectionTargetGUID) : NULL; } bool IsAIEnabled, NeedChangeAI; - bool CreateVehicleKit(uint32 id); + bool CreateVehicleKit(uint32 id, uint32 creatureEntry); void RemoveVehicleKit(); Vehicle *GetVehicleKit()const { return m_vehicleKit; } Vehicle *GetVehicle() const { return m_vehicle; } @@ -2026,10 +2057,14 @@ class Unit : public WorldObject bool m_ControlledByPlayer; bool CheckPlayerCondition(Player* pPlayer); - void EnterVehicle(Unit *base, int8 seatId = -1, AuraApplication const * aurApp = NULL) { EnterVehicle(base->GetVehicleKit(), seatId, aurApp); } - void EnterVehicle(Vehicle *vehicle, int8 seatId = -1, AuraApplication const * aurApp = NULL); - void ExitVehicle(); - void ChangeSeat(int8 seatId, bool next = true, bool byAura = false); + bool HandleSpellClick(Unit* clicker, int8 seatId = -1); + void EnterVehicle(Unit *base, int8 seatId = -1); + void ExitVehicle(Position const* exitPosition = NULL); + void ChangeSeat(int8 seatId, bool next = true); + + // Should only be called by AuraEffect::HandleAuraControlVehicle(AuraApplication const* auraApp, uint8 mode, bool apply) const; + void _ExitVehicle(Position const* exitPosition = NULL); + void _EnterVehicle(Vehicle* vehicle, int8 seatId, AuraApplication const* aurApp = NULL); void BuildMovementPacket(ByteBuffer *data) const; diff --git a/src/server/game/Entities/Vehicle/Vehicle.cpp b/src/server/game/Entities/Vehicle/Vehicle.cpp index 0ec89755aa57a..43badecf341f2 100755 --- a/src/server/game/Entities/Vehicle/Vehicle.cpp +++ b/src/server/game/Entities/Vehicle/Vehicle.cpp @@ -27,7 +27,8 @@ #include "CreatureAI.h" #include "ZoneScript.h" -Vehicle::Vehicle(Unit *unit, VehicleEntry const *vehInfo) : me(unit), m_vehicleInfo(vehInfo), m_usableSeatNum(0), m_bonusHP(0) +Vehicle::Vehicle(Unit *unit, VehicleEntry const *vehInfo, uint32 creatureEntry) +: me(unit), m_vehicleInfo(vehInfo), m_usableSeatNum(0), m_bonusHP(0), m_creatureEntry(creatureEntry) { for (uint32 i = 0; i < MAX_VEHICLE_SEATS; ++i) { @@ -50,6 +51,9 @@ Vehicle::Vehicle(Unit *unit, VehicleEntry const *vehInfo) : me(unit), m_vehicleI me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK_DEST, true); case 158: me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_HEAL, true); + me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_HEAL_PCT, true); + me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_ATTACK_ME, true); + me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_DISPEL, 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); @@ -57,10 +61,16 @@ Vehicle::Vehicle(Unit *unit, VehicleEntry const *vehInfo) : me(unit), m_vehicleI 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_MECHANIC, MECHANIC_GRIP, true); + me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_SHIELD, true); + me->ApplySpellImmune(0, IMMUNITY_ID, 13810, true); // Frost Trap + me->ApplySpellImmune(0, IMMUNITY_ID, 55741, true); // Desecration Rank 1 + me->ApplySpellImmune(0, IMMUNITY_ID, 68766, true); // Desecration Rank 2 break; default: break; } + + InitMovementInfoForBase(); } Vehicle::~Vehicle() @@ -111,53 +121,34 @@ void Vehicle::Install() } } - Reset(); - if (GetBase()->GetTypeId() == TYPEID_UNIT) sScriptMgr->OnInstall(this); } -void Vehicle::InstallAllAccessories(uint32 entry) +void Vehicle::InstallAllAccessories() { - VehicleAccessoryList const* mVehicleList = sObjectMgr->GetVehicleAccessoryList(entry); + RemoveAllPassengers(); // We might have aura's saved in the DB with now invalid casters - remove + + VehicleAccessoryList const* mVehicleList = sObjectMgr->GetVehicleAccessoryList(this); if (!mVehicleList) return; for (VehicleAccessoryList::const_iterator itr = mVehicleList->begin(); itr != mVehicleList->end(); ++itr) - InstallAccessory(itr->uiAccessory, itr->uiSeat, itr->bMinion); + InstallAccessory(itr->uiAccessory, itr->uiSeat, itr->bMinion, itr->uiSummonType, itr->uiSummonTime); } void Vehicle::Uninstall() { - sLog->outDebug("Vehicle::Uninstall %u", me->GetEntry()); - for (SeatMap::iterator itr = m_Seats.begin(); itr != m_Seats.end(); ++itr) - if (Unit *passenger = ObjectAccessor::GetUnit(*GetBase(), itr->second.passenger)) - if (passenger->HasUnitTypeMask(UNIT_MASK_ACCESSORY)) - passenger->ToTempSummon()->UnSummon(); - + sLog->outDebug(LOG_FILTER_VEHICLES, "Vehicle::Uninstall Entry: %u, GuidLow: %u", m_creatureEntry, me->GetGUIDLow()); RemoveAllPassengers(); if (GetBase()->GetTypeId() == TYPEID_UNIT) sScriptMgr->OnUninstall(this); } -void Vehicle::Die() -{ - sLog->outDebug("Vehicle::Die %u", me->GetEntry()); - for (SeatMap::iterator itr = m_Seats.begin(); itr != m_Seats.end(); ++itr) - if (Unit *passenger = ObjectAccessor::GetUnit(*GetBase(), itr->second.passenger)) - if (passenger->HasUnitTypeMask(UNIT_MASK_ACCESSORY)) - passenger->setDeathState(JUST_DIED); - - RemoveAllPassengers(); - - if (GetBase()->GetTypeId() == TYPEID_UNIT) - sScriptMgr->OnDie(this); -} - void Vehicle::Reset() { - sLog->outDebug("Vehicle::Reset"); + sLog->outDebug(LOG_FILTER_VEHICLES, "Vehicle::Reset"); if (me->GetTypeId() == TYPEID_PLAYER) { if (m_usableSeatNum) @@ -165,7 +156,7 @@ void Vehicle::Reset() } else { - InstallAllAccessories(me->GetEntry()); + InstallAllAccessories(); if (m_usableSeatNum) me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK); } @@ -176,13 +167,15 @@ void Vehicle::Reset() void Vehicle::RemoveAllPassengers() { - sLog->outDebug("Vehicle::RemoveAllPassengers"); + sLog->outDebug(LOG_FILTER_VEHICLES, "Vehicle::RemoveAllPassengers. Entry: %u, GuidLow: %u", m_creatureEntry, me->GetGUIDLow()); + for (SeatMap::iterator itr = m_Seats.begin(); itr != m_Seats.end(); ++itr) if (Unit *passenger = ObjectAccessor::GetUnit(*GetBase(), itr->second.passenger)) { ASSERT(passenger->IsInWorld()); ASSERT(passenger->IsOnVehicle(GetBase())); ASSERT(GetSeatForPassenger(passenger)); + sLog->outDebug(LOG_FILTER_VEHICLES, "Vehicle::RemoveAllPassengers. Entry: %u, GuidLow: %u", m_creatureEntry, me->GetGUIDLow()); if (passenger->IsVehicle()) passenger->GetVehicleKit()->RemoveAllPassengers(); @@ -196,10 +189,6 @@ void Vehicle::RemoveAllPassengers() sLog->outCrash("Vehicle %u cannot remove passenger %u. "UI64FMTD" is still on vehicle.", me->GetEntry(), passenger->GetEntry(), itr->second.passenger); itr->second.passenger = 0; } - - // creature passengers mounted on player mounts should be despawned at dismount - if (GetBase()->GetTypeId() == TYPEID_PLAYER && passenger->ToCreature()) - passenger->ToCreature()->DespawnOrUnsummon(); } } @@ -220,13 +209,13 @@ Unit *Vehicle::GetPassenger(int8 seatId) const return ObjectAccessor::GetUnit(*GetBase(), seat->second.passenger); } -int8 Vehicle::GetNextEmptySeat(int8 seatId, bool next, bool byAura) const +int8 Vehicle::GetNextEmptySeat(int8 seatId, bool next) const { SeatMap::const_iterator seat = m_Seats.find(seatId); if (seat == m_Seats.end()) return -1; - while (seat->second.passenger || (!byAura && !seat->second.seatInfo->CanEnterOrExit()) || (byAura && !seat->second.seatInfo->IsUsableByAura())) + while (seat->second.passenger || (!seat->second.seatInfo->CanEnterOrExit() && !seat->second.seatInfo->IsUsableByOverride())) { if (next) { @@ -248,27 +237,43 @@ int8 Vehicle::GetNextEmptySeat(int8 seatId, bool next, bool byAura) const return seat->first; } -void Vehicle::InstallAccessory(uint32 entry, int8 seatId, bool minion) +void Vehicle::InstallAccessory(uint32 entry, int8 seatId, bool minion, uint8 type, uint32 summonTime) { + sLog->outDebug(LOG_FILTER_VEHICLES, "Vehicle: Installing accessory entry %u on vehicle entry %u (seat:%i)", entry, GetCreatureEntry(), seatId); if (Unit *passenger = GetPassenger(seatId)) { // already installed if (passenger->GetEntry() == entry) { ASSERT(passenger->GetTypeId() == TYPEID_UNIT); - if (me->GetTypeId() == TYPEID_UNIT && me->ToCreature()->IsInEvadeMode() && passenger->ToCreature()->IsAIEnabled) - passenger->ToCreature()->AI()->EnterEvadeMode(); - return; + if (me->GetTypeId() == TYPEID_UNIT) + { + if (me->ToCreature()->IsInEvadeMode() && passenger->ToCreature()->IsAIEnabled) + passenger->ToCreature()->AI()->EnterEvadeMode(); + return; + } } - passenger->ExitVehicle(); // this should not happen + else + passenger->ExitVehicle(); // this should not happen } - if (Creature *accessory = me->SummonCreature(entry, *me, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000)) + if (Creature *accessory = me->SummonCreature(entry, *me, TempSummonType(type), summonTime)) { if (minion) accessory->AddUnitTypeMask(UNIT_MASK_ACCESSORY); - accessory->EnterVehicle(this, seatId); + if (!me->HandleSpellClick(accessory, seatId)) + { + accessory->AddObjectToRemoveList(); + return; + } + + if (!accessory->IsOnVehicle(me)) + { + accessory->AddObjectToRemoveList(); + return; // Something went wrong in the spellsystem + } + // This is not good, we have to send update twice accessory->SendMovementFlagUpdate(); @@ -277,7 +282,7 @@ void Vehicle::InstallAccessory(uint32 entry, int8 seatId, bool minion) } } -bool Vehicle::AddPassenger(Unit *unit, int8 seatId, bool byAura) +bool Vehicle::AddPassenger(Unit *unit, int8 seatId) { if (unit->GetVehicle() != this) return false; @@ -286,7 +291,7 @@ bool Vehicle::AddPassenger(Unit *unit, int8 seatId, bool byAura) if (seatId < 0) // no specific seat requirement { for (seat = m_Seats.begin(); seat != m_Seats.end(); ++seat) - if (!seat->second.passenger && ((!byAura && seat->second.seatInfo->CanEnterOrExit()) || (byAura && seat->second.seatInfo->IsUsableByAura()))) + if (!seat->second.passenger && (seat->second.seatInfo->CanEnterOrExit() || seat->second.seatInfo->IsUsableByOverride())) break; if (seat == m_Seats.end()) // no available seat @@ -309,7 +314,7 @@ bool Vehicle::AddPassenger(Unit *unit, int8 seatId, bool byAura) ASSERT(!seat->second.passenger); } - sLog->outDebug("Unit %s enter vehicle entry %u id %u dbguid %u seat %d", unit->GetName(), me->GetEntry(), m_vehicleInfo->m_ID, me->GetGUIDLow(), (int32)seat->first); + sLog->outDebug(LOG_FILTER_VEHICLES, "Unit %s enter vehicle entry %u id %u dbguid %u seat %d", unit->GetName(), me->GetEntry(), m_vehicleInfo->m_ID, me->GetGUIDLow(), (int32)seat->first); seat->second.passenger = unit->GetGUID(); if (seat->second.seatInfo->CanEnterOrExit()) @@ -344,6 +349,7 @@ bool Vehicle::AddPassenger(Unit *unit, int8 seatId, bool byAura) if (!me->SetCharmedBy(unit, CHARM_TYPE_VEHICLE)) ASSERT(false); + // hack: should be done by aura system if (VehicleScalingInfo const *scalingInfo = sObjectMgr->GetVehicleScalingInfo(m_vehicleInfo->m_ID)) { Player *plr = unit->ToPlayer(); @@ -352,15 +358,19 @@ bool Vehicle::AddPassenger(Unit *unit, int8 seatId, bool byAura) averageItemLevel = scalingInfo->baseItemLevel; averageItemLevel -= scalingInfo->baseItemLevel; + float currentHealthPct = float(me->GetHealth() / me->GetMaxHealth()); m_bonusHP = uint32(me->GetMaxHealth() * (averageItemLevel * scalingInfo->scalingFactor)); me->SetMaxHealth(me->GetMaxHealth() + m_bonusHP); - me->SetHealth(me->GetHealth() + m_bonusHP); + me->SetHealth(uint32((me->GetHealth() + m_bonusHP) * currentHealthPct)); } } if (me->IsInWorld()) { - unit->SendMonsterMoveTransport(me); + unit->SendClearTarget(); // SMSG_BREAK_TARGET + unit->SetControlled(true, UNIT_STAT_ROOT); // SMSG_FORCE_ROOT - In some cases we send SMSG_SPLINE_MOVE_ROOT here (for creatures) + // also adds MOVEMENTFLAG_ROOT + unit->SendMonsterMoveTransport(me); // SMSG_MONSTER_MOVE_TRANSPORT if (me->GetTypeId() == TYPEID_UNIT) { @@ -386,7 +396,7 @@ void Vehicle::RemovePassenger(Unit *unit) SeatMap::iterator seat = GetSeatIteratorForPassenger(unit); ASSERT(seat != m_Seats.end()); - sLog->outDebug("Unit %s exit vehicle entry %u id %u dbguid %u seat %d", unit->GetName(), me->GetEntry(), m_vehicleInfo->m_ID, me->GetGUIDLow(), (int32)seat->first); + sLog->outDebug(LOG_FILTER_VEHICLES, "Unit %s exit vehicle entry %u id %u dbguid %u seat %d", unit->GetName(), me->GetEntry(), m_vehicleInfo->m_ID, me->GetGUIDLow(), (int32)seat->first); seat->second.passenger = 0; if (seat->second.seatInfo->CanEnterOrExit()) @@ -417,6 +427,14 @@ void Vehicle::RemovePassenger(Unit *unit) } } + if (me->IsInWorld()) + { + unit->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT); + unit->m_movementInfo.t_pos.Relocate(0, 0, 0, 0); + unit->m_movementInfo.t_time = 0; + unit->m_movementInfo.t_seat = 0; + } + if (me->GetTypeId() == TYPEID_UNIT && me->ToCreature()->IsAIEnabled) me->ToCreature()->AI()->PassengerBoarded(unit, seat->first, false); @@ -452,31 +470,27 @@ void Vehicle::RelocatePassengers(float x, float y, float z, float ang) void Vehicle::Dismiss() { - sLog->outDebug("Vehicle::Dismiss %u", me->GetEntry()); + sLog->outDebug(LOG_FILTER_VEHICLES, "Vehicle::Dismiss Entry: %u, GuidLow %u", m_creatureEntry, me->GetGUIDLow()); Uninstall(); - me->SendObjectDeSpawnAnim(me->GetGUID()); + me->DestroyForNearbyPlayers(); me->CombatStop(); me->AddObjectToRemoveList(); } -uint16 Vehicle::GetExtraMovementFlagsForBase() const +void Vehicle::InitMovementInfoForBase() { - uint16 movementMask = MOVEMENTFLAG2_NONE; uint32 vehicleFlags = GetVehicleInfo()->m_flags; if (vehicleFlags & VEHICLE_FLAG_NO_STRAFE) - movementMask |= MOVEMENTFLAG2_NO_STRAFE; + me->AddExtraUnitMovementFlag(MOVEMENTFLAG2_NO_STRAFE); if (vehicleFlags & VEHICLE_FLAG_NO_JUMPING) - movementMask |= MOVEMENTFLAG2_NO_JUMPING; + me->AddExtraUnitMovementFlag(MOVEMENTFLAG2_NO_JUMPING); if (vehicleFlags & VEHICLE_FLAG_FULLSPEEDTURNING) - movementMask |= MOVEMENTFLAG2_FULL_SPEED_TURNING; + me->AddExtraUnitMovementFlag(MOVEMENTFLAG2_FULL_SPEED_TURNING); if (vehicleFlags & VEHICLE_FLAG_ALLOW_PITCHING) - movementMask |= MOVEMENTFLAG2_ALWAYS_ALLOW_PITCHING; + me->AddExtraUnitMovementFlag( MOVEMENTFLAG2_ALWAYS_ALLOW_PITCHING); if (vehicleFlags & VEHICLE_FLAG_FULLSPEEDPITCHING) - movementMask |= MOVEMENTFLAG2_FULL_SPEED_PITCHING; - - sLog->outDebug("Vehicle::GetExtraMovementFlagsForBase() returned %u", movementMask); - return movementMask; + me->AddExtraUnitMovementFlag(MOVEMENTFLAG2_FULL_SPEED_PITCHING); } VehicleSeatEntry const* Vehicle::GetSeatForPassenger(Unit* passenger) @@ -498,3 +512,14 @@ SeatMap::iterator Vehicle::GetSeatIteratorForPassenger(Unit* passenger) return m_Seats.end(); } + +uint8 Vehicle::GetAvailableSeatCount() const +{ + uint8 ret = 0; + SeatMap::const_iterator itr; + for (itr = m_Seats.begin(); itr != m_Seats.end(); ++itr) + if (!itr->second.passenger && (itr->second.seatInfo->CanEnterOrExit() || itr->second.seatInfo->IsUsableByOverride())) + ++ret; + + return ret; +} diff --git a/src/server/game/Entities/Vehicle/Vehicle.h b/src/server/game/Entities/Vehicle/Vehicle.h index 4001ae6a0dc59..413d2e24bf299 100755 --- a/src/server/game/Entities/Vehicle/Vehicle.h +++ b/src/server/game/Entities/Vehicle/Vehicle.h @@ -52,6 +52,7 @@ enum VehicleSeatFlags VEHICLE_SEAT_FLAG_HIDE_PASSENGER = 0x00000200, // Passenger is hidden VEHICLE_SEAT_FLAG_UNK11 = 0x00000400, // needed for CGCamera__SyncFreeLookFacing VEHICLE_SEAT_FLAG_CAN_CONTROL = 0x00000800, // Lua_UnitInVehicleControlSeat + VEHICLE_SEAT_FLAG_UNCONTROLLED = 0x00002000, // can override !& VEHICLE_SEAT_FLAG_CAN_ENTER_OR_EXIT VEHICLE_SEAT_FLAG_CAN_ATTACK = 0x00004000, // Can attack, cast spells and use items from vehicle? VEHICLE_SEAT_FLAG_CAN_ENTER_OR_EXIT = 0x02000000, // Lua_CanExitVehicle - can enter and exit at free will VEHICLE_SEAT_FLAG_CAN_SWITCH = 0x04000000, // Lua_CanSwitchVehicleSeats @@ -72,10 +73,10 @@ enum VehicleSeatFlagsB enum VehicleSpells { + VEHICLE_SPELL_RIDE_HARDCODED = 46598, VEHICLE_SPELL_PARACHUTE = 45472 }; - struct VehicleSeat { explicit VehicleSeat(VehicleSeatEntry const *_seatInfo) : seatInfo(_seatInfo), passenger(NULL) {} @@ -85,10 +86,13 @@ struct VehicleSeat struct VehicleAccessory { - explicit VehicleAccessory(uint32 _uiAccessory, int8 _uiSeat, bool _bMinion) : uiAccessory(_uiAccessory), uiSeat(_uiSeat), bMinion(_bMinion) {} + explicit VehicleAccessory(uint32 _uiAccessory, int8 _uiSeat, bool _bMinion, uint8 _uiSummonType, uint32 _uiSummonTime) : + uiAccessory(_uiAccessory), uiSeat(_uiSeat), bMinion(_bMinion), uiSummonType(_uiSummonType), uiSummonTime(_uiSummonTime) {} uint32 uiAccessory; int8 uiSeat; uint32 bMinion; + uint8 uiSummonType; + uint32 uiSummonTime; }; struct VehicleScalingInfo @@ -109,23 +113,24 @@ class Vehicle friend class WorldSession; public: - explicit Vehicle(Unit *unit, VehicleEntry const *vehInfo); + explicit Vehicle(Unit *unit, VehicleEntry const *vehInfo, uint32 creatureEntry); virtual ~Vehicle(); void Install(); void Uninstall(); void Reset(); - void Die(); - void InstallAllAccessories(uint32 entry); + void InstallAllAccessories(); Unit *GetBase() const { return me; } VehicleEntry const *GetVehicleInfo() const { return m_vehicleInfo; } + uint32 const& GetCreatureEntry() const { return m_creatureEntry; } bool HasEmptySeat(int8 seatId) const; Unit *GetPassenger(int8 seatId) const; - int8 GetNextEmptySeat(int8 seatId, bool next, bool byAura = false) const; + int8 GetNextEmptySeat(int8 seatId, bool next) const; + uint8 GetAvailableSeatCount() const; - bool AddPassenger(Unit *passenger, int8 seatId = -1, bool byAura = false); + bool AddPassenger(Unit *passenger, int8 seatId = -1); void EjectPassenger(Unit* passenger, Unit* controller); void RemovePassenger(Unit *passenger); void RelocatePassengers(float x, float y, float z, float ang); @@ -141,13 +146,15 @@ class Vehicle private: SeatMap::iterator GetSeatIteratorForPassenger(Unit* passenger); + void InitMovementInfoForBase(); protected: Unit *me; VehicleEntry const *m_vehicleInfo; uint32 m_usableSeatNum; // Number of seats that match VehicleSeatEntry::UsableByPlayer, used for proper display flags uint32 m_bonusHP; + uint32 m_creatureEntry; // Can be different than me->GetBase()->GetEntry() in case of players - void InstallAccessory(uint32 entry, int8 seatId, bool minion = true); + void InstallAccessory(uint32 entry, int8 seatId, bool minion, uint8 type, uint32 summonTime); }; #endif diff --git a/src/server/game/Events/GameEventMgr.cpp b/src/server/game/Events/GameEventMgr.cpp index d7c0f2e4a9bb9..a857bd94965d1 100755 --- a/src/server/game/Events/GameEventMgr.cpp +++ b/src/server/game/Events/GameEventMgr.cpp @@ -183,9 +183,16 @@ void GameEventMgr::StopEvent(uint16 event_id, bool overwrite) std::map::iterator itr; for (itr = mGameEvent[event_id].conditions.begin(); itr != mGameEvent[event_id].conditions.end(); ++itr) itr->second.done = 0; + SQLTransaction trans = CharacterDatabase.BeginTransaction(); - trans->PAppend("DELETE FROM game_event_save WHERE event_id = '%u'",event_id); - trans->PAppend("DELETE FROM game_event_condition_save WHERE event_id = '%u'",event_id); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ALL_GAME_EVENT_CONDITION_SAVE); + stmt->setUInt8(0, uint8(event_id)); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GAME_EVENT_SAVE); + stmt->setUInt8(0, uint8(event_id)); + trans->Append(stmt); + CharacterDatabase.CommitTransaction(trans); } } @@ -193,739 +200,713 @@ void GameEventMgr::StopEvent(uint16 event_id, bool overwrite) void GameEventMgr::LoadFromDB() { - uint32 oldMSTime = getMSTime(); - - QueryResult result = WorldDatabase.Query("SELECT MAX(entry) FROM game_event"); - if (!result) - { - sLog->outString(">> Loaded 0 weather definitions. DB table `game_event` is empty."); - sLog->outString(); - return; - } - - Field *fields = result->Fetch(); - - uint32 max_event_id = fields[0].GetUInt16(); - - mGameEvent.resize(max_event_id+1); - - result = WorldDatabase.Query("SELECT entry,UNIX_TIMESTAMP(start_time),UNIX_TIMESTAMP(end_time),occurence,length,holiday,description,world_event FROM game_event"); - if (!result) { - mGameEvent.clear(); - sLog->outErrorDb(">> Loaded 0 game events. DB table `game_event` is empty."); - sLog->outString(); - return; - } - - uint32 count = 0; - do - { - ++count; - Field *fields = result->Fetch(); + uint32 oldMSTime = getMSTime(); - - uint16 event_id = fields[0].GetUInt16(); - if (event_id == 0) + QueryResult result = WorldDatabase.Query("SELECT eventEntry,UNIX_TIMESTAMP(start_time),UNIX_TIMESTAMP(end_time),occurence,length,holiday,description,world_event FROM game_event"); + if (!result) { - sLog->outErrorDb("`game_event` game event id (%i) is reserved and can't be used.",event_id); - continue; - } - - GameEventData& pGameEvent = mGameEvent[event_id]; - uint64 starttime = fields[1].GetUInt64(); - pGameEvent.start = time_t(starttime); - uint64 endtime = fields[2].GetUInt64(); - pGameEvent.end = time_t(endtime); - pGameEvent.occurence = fields[3].GetUInt32(); - pGameEvent.length = fields[4].GetUInt32(); - pGameEvent.holiday_id = HolidayIds(fields[5].GetUInt32()); - - pGameEvent.state = (GameEventState)(fields[7].GetUInt8()); - pGameEvent.nextstart = 0; - - if (pGameEvent.length == 0 && pGameEvent.state == GAMEEVENT_NORMAL) // length>0 is validity check - { - sLog->outErrorDb("`game_event` game event id (%i) isn't a world event and has length = 0, thus it can't be used.",event_id); - continue; - } - - if (pGameEvent.holiday_id != HOLIDAY_NONE) - { - if (!sHolidaysStore.LookupEntry(pGameEvent.holiday_id)) - { - sLog->outErrorDb("`game_event` game event id (%i) have not existed holiday id %u.",event_id,pGameEvent.holiday_id); - pGameEvent.holiday_id = HOLIDAY_NONE; - } + mGameEvent.clear(); + sLog->outErrorDb(">> Loaded 0 game events. DB table `game_event` is empty."); + sLog->outString(); + return; } - pGameEvent.description = fields[6].GetString(); - - } while (result->NextRow()); - - sLog->outString(">> Loaded %u game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); - - // load game event saves - - sLog->outString("Loading Game Event Saves Data..."); - oldMSTime = getMSTime(); - - // 0 1 2 - result = CharacterDatabase.Query("SELECT event_id, state, next_start FROM game_event_save"); - - if (!result) - { - sLog->outString(">> Loaded 0 game event saves in game events. DB table `game_event_save` is empty."); - sLog->outString(); - } - else - { - count = 0; + uint32 count = 0; do { Field *fields = result->Fetch(); - uint16 event_id = fields[0].GetUInt16(); - - if (event_id >= mGameEvent.size()) + if (event_id == 0) { - sLog->outErrorDb("`game_event_save` game event id (%i) is out of range compared to max event id in `game_event`",event_id); + sLog->outErrorDb("`game_event` game event entry 0 is reserved and can't be used."); continue; } - if (mGameEvent[event_id].state != GAMEEVENT_NORMAL && mGameEvent[event_id].state != GAMEEVENT_INTERNAL) + GameEventData& pGameEvent = mGameEvent[event_id]; + uint64 starttime = fields[1].GetUInt64(); + pGameEvent.start = time_t(starttime); + uint64 endtime = fields[2].GetUInt64(); + pGameEvent.end = time_t(endtime); + pGameEvent.occurence = fields[3].GetUInt32(); + pGameEvent.length = fields[4].GetUInt32(); + pGameEvent.holiday_id = HolidayIds(fields[5].GetUInt32()); + + pGameEvent.state = (GameEventState)(fields[7].GetUInt8()); + pGameEvent.nextstart = 0; + + if (pGameEvent.length == 0 && pGameEvent.state == GAMEEVENT_NORMAL) // length>0 is validity check { - mGameEvent[event_id].state = (GameEventState)(fields[1].GetUInt8()); - mGameEvent[event_id].nextstart = time_t(fields[2].GetUInt32()); + sLog->outErrorDb("`game_event` game event id (%i) isn't a world event and has length = 0, thus it can't be used.",event_id); + continue; } - else + + if (pGameEvent.holiday_id != HOLIDAY_NONE) { - sLog->outErrorDb("game_event_save includes event save for non-worldevent id %u",event_id); - continue; + if (!sHolidaysStore.LookupEntry(pGameEvent.holiday_id)) + { + sLog->outErrorDb("`game_event` game event id (%i) have not existed holiday id %u.",event_id,pGameEvent.holiday_id); + pGameEvent.holiday_id = HOLIDAY_NONE; + } } - ++count; + pGameEvent.description = fields[6].GetString(); - } while (result->NextRow()); + ++count; + } + while (result->NextRow()); - sLog->outString(">> Loaded %u game event saves in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(">> Loaded %u game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); sLog->outString(); } - // load game event links (prerequisites) + sLog->outString("Loading Game Event Saves Data..."); + { + uint32 oldMSTime = getMSTime(); - sLog->outString("Loading Game Event Prerequisite Data..."); - oldMSTime = getMSTime(); + // 0 1 2 + QueryResult result = CharacterDatabase.Query("SELECT eventEntry, state, next_start FROM game_event_save"); - result = WorldDatabase.Query("SELECT event_id, prerequisite_event FROM game_event_prerequisite"); - if (!result) - { - sLog->outString(">> Loaded 0 game event prerequisites in game events. DB table `game_event_prerequisite` is empty."); - sLog->outString(); - } - else - { - count = 0; - do + if (!result) { - Field *fields = result->Fetch(); + sLog->outString(">> Loaded 0 game event saves in game events. DB table `game_event_save` is empty."); + sLog->outString(); + } + else + { + uint32 count = 0; + do + { + Field *fields = result->Fetch(); + uint16 event_id = fields[0].GetUInt16(); - uint16 event_id = fields[0].GetUInt16(); + if (event_id >= mGameEvent.size()) + { + sLog->outErrorDb("`game_event_save` game event entry (%i) is out of range compared to max event entry in `game_event`", event_id); + continue; + } - if (event_id >= mGameEvent.size()) - { - sLog->outErrorDb("`game_event_prerequisite` game event id (%i) is out of range compared to max event id in `game_event`",event_id); - continue; + if (mGameEvent[event_id].state != GAMEEVENT_NORMAL && mGameEvent[event_id].state != GAMEEVENT_INTERNAL) + { + mGameEvent[event_id].state = (GameEventState)(fields[1].GetUInt8()); + mGameEvent[event_id].nextstart = time_t(fields[2].GetUInt32()); + } + else + { + sLog->outErrorDb("game_event_save includes event save for non-worldevent id %u", event_id); + continue; + } + + ++count; } + while (result->NextRow()); + + sLog->outString(">> Loaded %u game event saves in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); + } + } + + sLog->outString("Loading Game Event Prerequisite Data..."); + { + uint32 oldMSTime = getMSTime(); - if (mGameEvent[event_id].state != GAMEEVENT_NORMAL && mGameEvent[event_id].state != GAMEEVENT_INTERNAL) + QueryResult result = WorldDatabase.Query("SELECT eventEntry, prerequisite_event FROM game_event_prerequisite"); + if (!result) + { + sLog->outString(">> Loaded 0 game event prerequisites in game events. DB table `game_event_prerequisite` is empty."); + sLog->outString(); + } + else + { + uint32 count = 0; + do { - uint16 prerequisite_event = fields[1].GetUInt16(); - if (prerequisite_event >= mGameEvent.size()) + Field *fields = result->Fetch(); + + uint16 event_id = fields[0].GetUInt16(); + + if (event_id >= mGameEvent.size()) { - sLog->outErrorDb("`game_event_prerequisite` game event prerequisite id (%i) is out of range compared to max event id in `game_event`",prerequisite_event); + sLog->outErrorDb("`game_event_prerequisite` game event id (%i) is out of range compared to max event id in `game_event`", event_id); continue; } - mGameEvent[event_id].prerequisite_events.insert(prerequisite_event); - } - else - { - sLog->outErrorDb("game_event_prerequisiste includes event entry for non-worldevent id %u",event_id); - continue; - } - ++count; + if (mGameEvent[event_id].state != GAMEEVENT_NORMAL && mGameEvent[event_id].state != GAMEEVENT_INTERNAL) + { + uint16 prerequisite_event = fields[1].GetUInt16(); + if (prerequisite_event >= mGameEvent.size()) + { + sLog->outErrorDb("`game_event_prerequisite` game event prerequisite id (%i) is out of range compared to max event id in `game_event`", prerequisite_event); + continue; + } + mGameEvent[event_id].prerequisite_events.insert(prerequisite_event); + } + else + { + sLog->outErrorDb("game_event_prerequisiste includes event entry for non-worldevent id %u", event_id); + continue; + } - } while (result->NextRow()); + ++count; + } + while (result->NextRow()); - sLog->outString(">> Loaded %u game event prerequisites in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outString(">> Loaded %u game event prerequisites in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); + } } - // Creatures - sLog->outString("Loading Game Event Creature Data..."); - oldMSTime = getMSTime(); + { + uint32 oldMSTime = getMSTime(); - mGameEventCreatureGuids.resize(mGameEvent.size()*2-1); - // 1 2 - result = WorldDatabase.Query("SELECT creature.guid, game_event_creature.event " - "FROM creature JOIN game_event_creature ON creature.guid = game_event_creature.guid"); + // 1 2 + QueryResult result = WorldDatabase.Query("SELECT creature.guid, game_event_creature.eventEntry FROM creature" + " JOIN game_event_creature ON creature.guid = game_event_creature.guid"); - if (!result) - { - sLog->outString(">> Loaded 0 creatures in game events. DB table `game_event_creature` is empty"); - sLog->outString(); - } - else - { - count = 0; - do + if (!result) { - Field *fields = result->Fetch(); - + sLog->outString(">> Loaded 0 creatures in game events. DB table `game_event_creature` is empty"); + sLog->outString(); + } + else + { + uint32 count = 0; + do + { + Field *fields = result->Fetch(); - uint32 guid = fields[0].GetUInt32(); - int16 event_id = fields[1].GetInt16(); + uint32 guid = fields[0].GetUInt32(); + int16 event_id = fields[1].GetInt16(); - int32 internal_event_id = mGameEvent.size() + event_id - 1; + int32 internal_event_id = mGameEvent.size() + event_id - 1; - if (internal_event_id < 0 || internal_event_id >= int32(mGameEventCreatureGuids.size())) - { - sLog->outErrorDb("`game_event_creature` game event id (%i) is out of range compared to max event id in `game_event`",event_id); - continue; - } + if (internal_event_id < 0 || internal_event_id >= int32(mGameEventCreatureGuids.size())) + { + sLog->outErrorDb("`game_event_creature` game event id (%i) is out of range compared to max event id in `game_event`",event_id); + continue; + } - ++count; - GuidList& crelist = mGameEventCreatureGuids[internal_event_id]; - crelist.push_back(guid); + GuidList& crelist = mGameEventCreatureGuids[internal_event_id]; + crelist.push_back(guid); - } while (result->NextRow()); + ++count; + } + while (result->NextRow()); - sLog->outString(">> Loaded %u creatures in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outString(">> Loaded %u creatures in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); + } } - // Gameobjects - sLog->outString("Loading Game Event GO Data..."); - oldMSTime = getMSTime(); + { + uint32 oldMSTime = getMSTime(); - mGameEventGameobjectGuids.resize(mGameEvent.size()*2-1); - // 1 2 - result = WorldDatabase.Query("SELECT gameobject.guid, game_event_gameobject.event " - "FROM gameobject JOIN game_event_gameobject ON gameobject.guid=game_event_gameobject.guid"); + // 1 2 + QueryResult result = WorldDatabase.Query("SELECT gameobject.guid, game_event_gameobject.eventEntry FROM gameobject" + " JOIN game_event_gameobject ON gameobject.guid=game_event_gameobject.guid"); - if (!result) - { - sLog->outString(">> Loaded 0 gameobjects in game events. DB table `game_event_gameobject` is empty."); - sLog->outString(); - } - else - { - count = 0; - do + if (!result) { - Field *fields = result->Fetch(); - + sLog->outString(">> Loaded 0 gameobjects in game events. DB table `game_event_gameobject` is empty."); + sLog->outString(); + } + else + { + uint32 count = 0; + do + { + Field *fields = result->Fetch(); - uint32 guid = fields[0].GetUInt32(); - int16 event_id = fields[1].GetInt16(); + uint32 guid = fields[0].GetUInt32(); + int16 event_id = fields[1].GetInt16(); - int32 internal_event_id = mGameEvent.size() + event_id - 1; + int32 internal_event_id = mGameEvent.size() + event_id - 1; - if (internal_event_id < 0 || internal_event_id >= int32(mGameEventGameobjectGuids.size())) - { - sLog->outErrorDb("`game_event_gameobject` game event id (%i) is out of range compared to max event id in `game_event`",event_id); - continue; - } + if (internal_event_id < 0 || internal_event_id >= int32(mGameEventGameobjectGuids.size())) + { + sLog->outErrorDb("`game_event_gameobject` game event id (%i) is out of range compared to max event id in `game_event`",event_id); + continue; + } - ++count; - GuidList& golist = mGameEventGameobjectGuids[internal_event_id]; - golist.push_back(guid); + GuidList& golist = mGameEventGameobjectGuids[internal_event_id]; + golist.push_back(guid); - } while (result->NextRow()); + ++count; + } + while (result->NextRow()); - sLog->outString(">> Loaded %u gameobjects in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outString(">> Loaded %u gameobjects in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); + } } - // Model/Equipment Changes - sLog->outString("Loading Game Event Model/Equipment Change Data..."); - oldMSTime = getMSTime(); - - mGameEventModelEquip.resize(mGameEvent.size()); - // 0 1 2 - result = WorldDatabase.Query("SELECT creature.guid, game_event_model_equip.event, game_event_model_equip.modelid," - // 3 - "game_event_model_equip.equipment_id " - "FROM creature JOIN game_event_model_equip ON creature.guid=game_event_model_equip.guid"); - - if (!result) - { - sLog->outString(">> Loaded 0 model/equipment changes in game events. DB table `game_event_model_equip` is empty."); - sLog->outString(); - } - else { - count = 0; - do - { - Field *fields = result->Fetch(); + uint32 oldMSTime = getMSTime(); - uint32 guid = fields[0].GetUInt32(); - uint16 event_id = fields[1].GetUInt16(); + // 0 1 2 3 + QueryResult result = WorldDatabase.Query("SELECT creature.guid, game_event_model_equip.eventEntry, game_event_model_equip.modelid, game_event_model_equip.equipment_id " + "FROM creature JOIN game_event_model_equip ON creature.guid=game_event_model_equip.guid"); - if (event_id >= mGameEventModelEquip.size()) + if (!result) + { + sLog->outString(">> Loaded 0 model/equipment changes in game events. DB table `game_event_model_equip` is empty."); + sLog->outString(); + } + else + { + uint32 count = 0; + do { - sLog->outErrorDb("`game_event_model_equip` game event id (%u) is out of range compared to max event id in `game_event`",event_id); - continue; - } + Field *fields = result->Fetch(); - ++count; - ModelEquipList& equiplist = mGameEventModelEquip[event_id]; - ModelEquip newModelEquipSet; - newModelEquipSet.modelid = fields[2].GetUInt32(); - newModelEquipSet.equipment_id = fields[3].GetUInt32(); - newModelEquipSet.equipement_id_prev = 0; - newModelEquipSet.modelid_prev = 0; - - if (newModelEquipSet.equipment_id > 0) - { - if (!sObjectMgr->GetEquipmentInfo(newModelEquipSet.equipment_id)) + uint32 guid = fields[0].GetUInt32(); + uint16 event_id = fields[1].GetUInt16(); + + if (event_id >= mGameEventModelEquip.size()) { - sLog->outErrorDb("Table `game_event_model_equip` have creature (Guid: %u) with equipment_id %u not found in table `creature_equip_template`, set to no equipment.", guid, newModelEquipSet.equipment_id); + sLog->outErrorDb("`game_event_model_equip` game event id (%u) is out of range compared to max event id in `game_event`",event_id); continue; } - } - equiplist.push_back(std::pair(guid, newModelEquipSet)); + ModelEquipList& equiplist = mGameEventModelEquip[event_id]; + ModelEquip newModelEquipSet; + newModelEquipSet.modelid = fields[2].GetUInt32(); + newModelEquipSet.equipment_id = fields[3].GetUInt32(); + newModelEquipSet.equipement_id_prev = 0; + newModelEquipSet.modelid_prev = 0; - } while (result->NextRow()); + if (newModelEquipSet.equipment_id > 0) + { + if (!sObjectMgr->GetEquipmentInfo(newModelEquipSet.equipment_id)) + { + sLog->outErrorDb("Table `game_event_model_equip` have creature (Guid: %u) with equipment_id %u not found in table `creature_equip_template`, set to no equipment.", + guid, newModelEquipSet.equipment_id); + continue; + } + } - sLog->outString(">> Loaded %u model/equipment changes in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); - } + equiplist.push_back(std::pair(guid, newModelEquipSet)); + + ++count; + } + while (result->NextRow()); - // Quests + sLog->outString(">> Loaded %u model/equipment changes in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); + } + } sLog->outString("Loading Game Event Quest Data..."); - oldMSTime = getMSTime(); + { + uint32 oldMSTime = getMSTime(); - mGameEventCreatureQuests.resize(mGameEvent.size()); - // 0 1 2 - result = WorldDatabase.Query("SELECT id, quest, event FROM game_event_creature_quest"); + // 0 1 2 + QueryResult result = WorldDatabase.Query("SELECT id, quest, eventEntry FROM game_event_creature_quest"); - if (!result) - { - sLog->outString(">> Loaded 0 quests additions in game events. DB table `game_event_creature_quest` is empty."); - sLog->outString(); - } - else - { - count = 0; - do + if (!result) { - Field *fields = result->Fetch(); + sLog->outString(">> Loaded 0 quests additions in game events. DB table `game_event_creature_quest` is empty."); + sLog->outString(); + } + else + { + uint32 count = 0; + do + { + Field *fields = result->Fetch(); - uint32 id = fields[0].GetUInt32(); - uint32 quest = fields[1].GetUInt32(); - uint16 event_id = fields[2].GetUInt16(); + uint32 id = fields[0].GetUInt32(); + uint32 quest = fields[1].GetUInt32(); + uint16 event_id = fields[2].GetUInt16(); - if (event_id >= mGameEventCreatureQuests.size()) - { - sLog->outErrorDb("`game_event_creature_quest` game event id (%u) is out of range compared to max event id in `game_event`",event_id); - continue; - } + if (event_id >= mGameEventCreatureQuests.size()) + { + sLog->outErrorDb("`game_event_creature_quest` game event id (%u) is out of range compared to max event id in `game_event`",event_id); + continue; + } - ++count; - QuestRelList& questlist = mGameEventCreatureQuests[event_id]; - questlist.push_back(QuestRelation(id, quest)); + QuestRelList& questlist = mGameEventCreatureQuests[event_id]; + questlist.push_back(QuestRelation(id, quest)); - } while (result->NextRow()); + ++count; + } + while (result->NextRow()); - sLog->outString(">> Loaded %u quests additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outString(">> Loaded %u quests additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); + } } - // GO Quests - sLog->outString("Loading Game Event GO Quest Data..."); - oldMSTime = getMSTime(); + { + uint32 oldMSTime = getMSTime(); - mGameEventGameObjectQuests.resize(mGameEvent.size()); - // 0 1 2 - result = WorldDatabase.Query("SELECT id, quest, event FROM game_event_gameobject_quest"); + // 0 1 2 + QueryResult result = WorldDatabase.Query("SELECT id, quest, eventEntry FROM game_event_gameobject_quest"); - if (!result) - { - sLog->outString(">> Loaded 0 go quests additions in game events. DB table `game_event_gameobject_quest` is empty."); - sLog->outString(); - } - else - { - count = 0; - do + if (!result) { - Field *fields = result->Fetch(); + sLog->outString(">> Loaded 0 go quests additions in game events. DB table `game_event_gameobject_quest` is empty."); + sLog->outString(); + } + else + { + uint32 count = 0; + do + { + Field *fields = result->Fetch(); - uint32 id = fields[0].GetUInt32(); - uint32 quest = fields[1].GetUInt32(); - uint16 event_id = fields[2].GetUInt16(); + uint32 id = fields[0].GetUInt32(); + uint32 quest = fields[1].GetUInt32(); + uint16 event_id = fields[2].GetUInt16(); - if (event_id >= mGameEventGameObjectQuests.size()) - { - sLog->outErrorDb("`game_event_gameobject_quest` game event id (%u) is out of range compared to max event id in `game_event`",event_id); - continue; - } + if (event_id >= mGameEventGameObjectQuests.size()) + { + sLog->outErrorDb("`game_event_gameobject_quest` game event id (%u) is out of range compared to max event id in `game_event`",event_id); + continue; + } - ++count; - QuestRelList& questlist = mGameEventGameObjectQuests[event_id]; - questlist.push_back(QuestRelation(id, quest)); + QuestRelList& questlist = mGameEventGameObjectQuests[event_id]; + questlist.push_back(QuestRelation(id, quest)); - } while (result->NextRow()); + ++count; + } + while (result->NextRow()); - sLog->outString(">> Loaded %u quests additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outString(">> Loaded %u quests additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); + } } - // Load quest to (event,condition) mapping - // 0 1 2 3 - sLog->outString("Loading Game Event Quest Condition Data..."); - oldMSTime = getMSTime(); + { + uint32 oldMSTime = getMSTime(); - result = WorldDatabase.Query("SELECT quest, event_id, condition_id, num FROM game_event_quest_condition"); + // 0 1 2 3 + QueryResult result = WorldDatabase.Query("SELECT quest, eventEntry, condition_id, num FROM game_event_quest_condition"); - if (!result) - { - sLog->outString(">> Loaded 0 quest event conditions in game events. DB table `game_event_quest_condition` is empty."); - sLog->outString(); - } - else - { - count = 0; - do + if (!result) { - Field *fields = result->Fetch(); + sLog->outString(">> Loaded 0 quest event conditions in game events. DB table `game_event_quest_condition` is empty."); + sLog->outString(); + } + else + { + uint32 count = 0; + do + { + Field *fields = result->Fetch(); - uint32 quest = fields[0].GetUInt32(); - uint16 event_id = fields[1].GetUInt16(); - uint32 condition = fields[2].GetUInt32(); - float num = fields[3].GetFloat(); + uint32 quest = fields[0].GetUInt32(); + uint16 event_id = fields[1].GetUInt16(); + uint32 condition = fields[2].GetUInt32(); + float num = fields[3].GetFloat(); - if (event_id >= mGameEvent.size()) - { - sLog->outErrorDb("`game_event_quest_condition` game event id (%u) is out of range compared to max event id in `game_event`",event_id); - continue; - } + if (event_id >= mGameEvent.size()) + { + sLog->outErrorDb("`game_event_quest_condition` game event id (%u) is out of range compared to max event id in `game_event`",event_id); + continue; + } - ++count; - mQuestToEventConditions[quest].event_id = event_id; - mQuestToEventConditions[quest].condition = condition; - mQuestToEventConditions[quest].num = num; + mQuestToEventConditions[quest].event_id = event_id; + mQuestToEventConditions[quest].condition = condition; + mQuestToEventConditions[quest].num = num; - } while (result->NextRow()); + ++count; + } + while (result->NextRow()); - sLog->outString(">> Loaded %u quest event conditions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outString(">> Loaded %u quest event conditions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); + } } - // Load conditions for events - sLog->outString("Loading Game Event Condition Data..."); - oldMSTime = getMSTime(); - - // 0 1 2 3 4 - result = WorldDatabase.Query("SELECT event_id, condition_id, req_num, max_world_state_field, done_world_state_field FROM game_event_condition"); - - if (!result) { - sLog->outString(">> Loaded 0 conditions in game events. DB table `game_event_condition` is empty."); - sLog->outString(); - } - else - { - count = 0; - do - { - Field *fields = result->Fetch(); + uint32 oldMSTime = getMSTime(); - uint16 event_id = fields[0].GetUInt16(); - uint32 condition = fields[1].GetUInt32(); + // 0 1 2 3 4 + QueryResult result = WorldDatabase.Query("SELECT eventEntry, condition_id, req_num, max_world_state_field, done_world_state_field FROM game_event_condition"); - if (event_id >= mGameEvent.size()) + if (!result) + { + sLog->outString(">> Loaded 0 conditions in game events. DB table `game_event_condition` is empty."); + sLog->outString(); + } + else + { + uint32 count = 0; + do { - sLog->outErrorDb("`game_event_condition` game event id (%u) is out of range compared to max event id in `game_event`",event_id); - continue; - } + Field *fields = result->Fetch(); - mGameEvent[event_id].conditions[condition].reqNum = fields[2].GetFloat(); - mGameEvent[event_id].conditions[condition].done = 0; - mGameEvent[event_id].conditions[condition].max_world_state = fields[3].GetUInt32(); - mGameEvent[event_id].conditions[condition].done_world_state = fields[4].GetUInt32(); + uint16 event_id = fields[0].GetUInt16(); + uint32 condition = fields[1].GetUInt32(); - ++count; + if (event_id >= mGameEvent.size()) + { + sLog->outErrorDb("`game_event_condition` game event id (%u) is out of range compared to max event id in `game_event`",event_id); + continue; + } - } while (result->NextRow()); + mGameEvent[event_id].conditions[condition].reqNum = fields[2].GetFloat(); + mGameEvent[event_id].conditions[condition].done = 0; + mGameEvent[event_id].conditions[condition].max_world_state = fields[3].GetUInt32(); + mGameEvent[event_id].conditions[condition].done_world_state = fields[4].GetUInt32(); - sLog->outString(">> Loaded %u conditions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); - } + ++count; + } + while (result->NextRow()); - // Load condition saves + sLog->outString(">> Loaded %u conditions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); + } + } sLog->outString("Loading Game Event Condition Save Data..."); - oldMSTime = getMSTime(); - - // 0 1 2 - result = CharacterDatabase.Query("SELECT event_id, condition_id, done FROM game_event_condition_save"); - - if (!result) { - sLog->outString(">> Loaded 0 condition saves in game events. DB table `game_event_condition_save` is empty."); - sLog->outString(); - } - else - { - count = 0; - do - { - Field *fields = result->Fetch(); + uint32 oldMSTime = getMSTime(); - uint16 event_id = fields[0].GetUInt16(); - uint32 condition = fields[1].GetUInt32(); + // 0 1 2 + QueryResult result = CharacterDatabase.Query("SELECT eventEntry, condition_id, done FROM game_event_condition_save"); - if (event_id >= mGameEvent.size()) + if (!result) + { + sLog->outString(">> Loaded 0 condition saves in game events. DB table `game_event_condition_save` is empty."); + sLog->outString(); + } + else + { + uint32 count = 0; + do { - sLog->outErrorDb("`game_event_condition_save` game event id (%u) is out of range compared to max event id in `game_event`",event_id); - continue; - } + Field *fields = result->Fetch(); - std::map::iterator itr = mGameEvent[event_id].conditions.find(condition); - if (itr != mGameEvent[event_id].conditions.end()) - { - itr->second.done = fields[2].GetFloat(); - } - else - { - sLog->outErrorDb("game_event_condition_save contains not present condition evt id %u cond id %u",event_id, condition); - continue; - } + uint16 event_id = fields[0].GetUInt16(); + uint32 condition = fields[1].GetUInt32(); - ++count; + if (event_id >= mGameEvent.size()) + { + sLog->outErrorDb("`game_event_condition_save` game event id (%u) is out of range compared to max event id in `game_event`",event_id); + continue; + } - } while (result->NextRow()); + std::map::iterator itr = mGameEvent[event_id].conditions.find(condition); + if (itr != mGameEvent[event_id].conditions.end()) + { + itr->second.done = fields[2].GetFloat(); + } + else + { + sLog->outErrorDb("game_event_condition_save contains not present condition evt id %u cond id %u",event_id, condition); + continue; + } - sLog->outString(">> Loaded %u condition saves in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); - } + ++count; + } + while (result->NextRow()); - // Load game event npcflag + sLog->outString(">> Loaded %u condition saves in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); + } + } sLog->outString("Loading Game Event NPCflag Data..."); - oldMSTime = getMSTime(); - - mGameEventNPCFlags.resize(mGameEvent.size()); - - // 0 1 2 - result = WorldDatabase.Query("SELECT guid, event_id, npcflag FROM game_event_npcflag"); - - if (!result) - { - sLog->outString(">> Loaded 0 npcflags in game events. DB table `game_event_npcflag` is empty."); - sLog->outString(); - } - else { - count = 0; - do - { - Field *fields = result->Fetch(); + uint32 oldMSTime = getMSTime(); - uint32 guid = fields[0].GetUInt32(); - uint16 event_id = fields[1].GetUInt16(); - uint32 npcflag = fields[2].GetUInt32(); + // 0 1 2 + QueryResult result = WorldDatabase.Query("SELECT guid, eventEntry, npcflag FROM game_event_npcflag"); - if (event_id >= mGameEvent.size()) + if (!result) + { + sLog->outString(">> Loaded 0 npcflags in game events. DB table `game_event_npcflag` is empty."); + sLog->outString(); + } + else + { + uint32 count = 0; + do { - sLog->outErrorDb("`game_event_npcflag` game event id (%u) is out of range compared to max event id in `game_event`",event_id); - continue; - } + Field *fields = result->Fetch(); - mGameEventNPCFlags[event_id].push_back(GuidNPCFlagPair(guid,npcflag)); + uint32 guid = fields[0].GetUInt32(); + uint16 event_id = fields[1].GetUInt16(); + uint32 npcflag = fields[2].GetUInt32(); - ++count; + if (event_id >= mGameEvent.size()) + { + sLog->outErrorDb("`game_event_npcflag` game event id (%u) is out of range compared to max event id in `game_event`",event_id); + continue; + } - } while (result->NextRow()); + mGameEventNPCFlags[event_id].push_back(GuidNPCFlagPair(guid,npcflag)); - sLog->outString(">> Loaded %u npcflags in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); - } + ++count; + } + while (result->NextRow()); - // Load game event vendors + sLog->outString(">> Loaded %u npcflags in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); + } + } sLog->outString("Loading Game Event Vendor Additions Data..."); - oldMSTime = getMSTime(); - - mGameEventVendors.resize(mGameEvent.size()); + { + uint32 oldMSTime = getMSTime(); - // 0 1 2 3 4 5 - result = WorldDatabase.Query("SELECT event, guid, item, maxcount, incrtime, ExtendedCost FROM game_event_npc_vendor ORDER BY guid, slot ASC"); + // 0 1 2 3 4 5 + QueryResult result = WorldDatabase.Query("SELECT eventEntry, guid, item, maxcount, incrtime, ExtendedCost FROM game_event_npc_vendor ORDER BY guid, slot ASC"); - if (!result) - { - sLog->outString(">> Loaded 0 vendor additions in game events. DB table `game_event_npc_vendor` is empty."); - sLog->outString(); - } - else - { - count = 0; - do + if (!result) { - Field *fields = result->Fetch(); + sLog->outString(">> Loaded 0 vendor additions in game events. DB table `game_event_npc_vendor` is empty."); + sLog->outString(); + } + else + { + uint32 count = 0; + do + { + Field *fields = result->Fetch(); - uint16 event_id = fields[0].GetUInt16(); + uint16 event_id = fields[0].GetUInt16(); - if (event_id >= mGameEventVendors.size()) - { - sLog->outErrorDb("`game_event_npc_vendor` game event id (%u) is out of range compared to max event id in `game_event`",event_id); - continue; - } + if (event_id >= mGameEventVendors.size()) + { + sLog->outErrorDb("`game_event_npc_vendor` game event id (%u) is out of range compared to max event id in `game_event`",event_id); + continue; + } - NPCVendorList& vendors = mGameEventVendors[event_id]; - NPCVendorEntry newEntry; - uint32 guid = fields[1].GetUInt32(); - newEntry.item = fields[2].GetUInt32(); - newEntry.maxcount = fields[3].GetInt32(); - newEntry.incrtime = fields[4].GetUInt32(); - newEntry.ExtendedCost = fields[5].GetUInt32(); - // get the event npc flag for checking if the npc will be vendor during the event or not - uint32 event_npc_flag = 0; - NPCFlagList& flist = mGameEventNPCFlags[event_id]; - for (NPCFlagList::const_iterator itr = flist.begin(); itr != flist.end(); ++itr) - { - if (itr->first == guid) + NPCVendorList& vendors = mGameEventVendors[event_id]; + NPCVendorEntry newEntry; + uint32 guid = fields[1].GetUInt32(); + newEntry.item = fields[2].GetUInt32(); + newEntry.maxcount = fields[3].GetInt32(); + newEntry.incrtime = fields[4].GetUInt32(); + newEntry.ExtendedCost = fields[5].GetUInt32(); + // get the event npc flag for checking if the npc will be vendor during the event or not + uint32 event_npc_flag = 0; + NPCFlagList& flist = mGameEventNPCFlags[event_id]; + for (NPCFlagList::const_iterator itr = flist.begin(); itr != flist.end(); ++itr) { - event_npc_flag = itr->second; - break; + if (itr->first == guid) + { + event_npc_flag = itr->second; + break; + } } - } - // get creature entry - newEntry.entry = 0; + // get creature entry + newEntry.entry = 0; - if (CreatureData const* data = sObjectMgr->GetCreatureData(guid)) - newEntry.entry = data->id; + if (CreatureData const* data = sObjectMgr->GetCreatureData(guid)) + newEntry.entry = data->id; - // check validity with event's npcflag - if (!sObjectMgr->IsVendorItemValid(newEntry.entry, newEntry.item, newEntry.maxcount, newEntry.incrtime, newEntry.ExtendedCost, NULL, NULL, event_npc_flag)) - continue; - ++count; - vendors.push_back(newEntry); + // check validity with event's npcflag + if (!sObjectMgr->IsVendorItemValid(newEntry.entry, newEntry.item, newEntry.maxcount, newEntry.incrtime, newEntry.ExtendedCost, NULL, NULL, event_npc_flag)) + continue; - } while (result->NextRow()); + vendors.push_back(newEntry); - sLog->outString(">> Loaded %u vendor additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); - } + ++count; + } + while (result->NextRow()); - // Load game event battleground flags + sLog->outString(">> Loaded %u vendor additions in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); + } + } sLog->outString("Loading Game Event Battleground Data..."); - oldMSTime = getMSTime(); - - // set all flags to 0 - mGameEventBattlegroundHolidays.resize(mGameEvent.size(),0); - - // 0 1 - result = WorldDatabase.Query("SELECT event, bgflag FROM game_event_battleground_holiday"); - - if (!result) - { - sLog->outString(">> Loaded 0 battleground holidays in game events. DB table `game_event_condition` is empty."); - sLog->outString(); - } - else { - count = 0; - do - { - Field *fields = result->Fetch(); + uint32 oldMSTime = getMSTime(); + // 0 1 + QueryResult result = WorldDatabase.Query("SELECT eventEntry, bgflag FROM game_event_battleground_holiday"); - uint16 event_id = fields[0].GetUInt16(); - - if (event_id >= mGameEvent.size()) + if (!result) + { + sLog->outString(">> Loaded 0 battleground holidays in game events. DB table `game_event_condition` is empty."); + sLog->outString(); + } + else + { + uint32 count = 0; + do { - sLog->outErrorDb("`game_event_battleground_holiday` game event id (%u) is out of range compared to max event id in `game_event`",event_id); - continue; - } + Field *fields = result->Fetch(); - ++count; + uint16 event_id = fields[0].GetUInt16(); - mGameEventBattlegroundHolidays[event_id] = fields[1].GetUInt32(); + if (event_id >= mGameEvent.size()) + { + sLog->outErrorDb("`game_event_battleground_holiday` game event id (%u) is out of range compared to max event id in `game_event`",event_id); + continue; + } - } while (result->NextRow()); + mGameEventBattlegroundHolidays[event_id] = fields[1].GetUInt32(); - sLog->outString(">> Loaded %u battleground holidays in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); - } + ++count; + } + while (result->NextRow()); - //////////////////////// - // GameEventPool - //////////////////////// + sLog->outString(">> Loaded %u battleground holidays in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); + } + } sLog->outString("Loading Game Event Pool Data..."); - oldMSTime = getMSTime(); - - mGameEventPoolIds.resize(mGameEvent.size()*2-1); + { + uint32 oldMSTime = getMSTime(); - // 1 2 - result = WorldDatabase.Query("SELECT pool_template.entry, game_event_pool.event " - "FROM pool_template JOIN game_event_pool ON pool_template.entry = game_event_pool.pool_entry"); + // 1 2 + QueryResult result = WorldDatabase.Query("SELECT pool_template.entry, game_event_pool.eventEntry FROM pool_template" + " JOIN game_event_pool ON pool_template.entry = game_event_pool.pool_entry"); - if (!result) - { - sLog->outString(">> Loaded 0 pools for game events. DB table `game_event_pool` is empty."); - sLog->outString(); - } - else - { - count = 0; - do + if (!result) { - Field *fields = result->Fetch(); - + sLog->outString(">> Loaded 0 pools for game events. DB table `game_event_pool` is empty."); + sLog->outString(); + } + else + { + uint32 count = 0; + do + { + Field *fields = result->Fetch(); - uint32 entry = fields[0].GetUInt32(); - int16 event_id = fields[1].GetInt16(); + uint32 entry = fields[0].GetUInt32(); + int16 event_id = fields[1].GetInt16(); - int32 internal_event_id = mGameEvent.size() + event_id - 1; + int32 internal_event_id = mGameEvent.size() + event_id - 1; - if (internal_event_id < 0 || internal_event_id >= int32(mGameEventPoolIds.size())) - { - sLog->outErrorDb("`game_event_pool` game event id (%i) is out of range compared to max event id in `game_event`",event_id); - continue; - } + if (internal_event_id < 0 || internal_event_id >= int32(mGameEventPoolIds.size())) + { + sLog->outErrorDb("`game_event_pool` game event id (%i) is out of range compared to max event id in `game_event`",event_id); + continue; + } - if (!sPoolMgr->CheckPool(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.", entry); - continue; - } + if (!sPoolMgr->CheckPool(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.", entry); + continue; + } - ++count; - IdList& poollist = mGameEventPoolIds[internal_event_id]; - poollist.push_back(entry); + IdList& poollist = mGameEventPoolIds[internal_event_id]; + poollist.push_back(entry); - } while (result->NextRow()); + ++count; + } + while (result->NextRow()); - sLog->outString(">> Loaded %u pools for game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outString(">> Loaded %u pools for game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); + } } } @@ -946,7 +927,32 @@ uint32 GameEventMgr::GetNPCFlag(Creature * cr) return mask; } -uint32 GameEventMgr::Initialize() // return the next event delay in ms +void GameEventMgr::Initialize() +{ + QueryResult result = WorldDatabase.Query("SELECT MAX(eventEntry) FROM game_event"); + if (result) + { + Field *fields = result->Fetch(); + + uint32 maxEventId = fields[0].GetUInt16(); + + // Id starts with 1 and vector with 0, thus increment + maxEventId++; + + mGameEvent.resize(maxEventId); + mGameEventCreatureGuids.resize(maxEventId * 2 - 1); + mGameEventGameobjectGuids.resize(maxEventId * 2 - 1); + mGameEventCreatureQuests.resize(maxEventId); + mGameEventGameObjectQuests.resize(maxEventId); + mGameEventVendors.resize(maxEventId); + mGameEventBattlegroundHolidays.resize(maxEventId, 0); + mGameEventPoolIds.resize(maxEventId * 2 - 1); + mGameEventNPCFlags.resize(maxEventId); + mGameEventModelEquip.resize(maxEventId); + } +} + +uint32 GameEventMgr::StartSystem() // return the next event delay in ms { m_ActiveEvents.clear(); uint32 delay = Update(); @@ -956,7 +962,7 @@ uint32 GameEventMgr::Initialize() // return the next e void GameEventMgr::StartArenaSeason() { - QueryResult result = WorldDatabase.PQuery("SELECT event FROM season_linked_event WHERE season = '%i'",sWorld->getIntConfig(CONFIG_ARENA_SEASON_ID)); + QueryResult result = WorldDatabase.PQuery("SELECT eventEntry FROM game_event_arena_seasons WHERE season = '%i'",sWorld->getIntConfig(CONFIG_ARENA_SEASON_ID)); if (!result) { @@ -1487,9 +1493,8 @@ void GameEventMgr::UpdateWorldStates(uint16 event_id, bool Activate) } } -GameEventMgr::GameEventMgr() +GameEventMgr::GameEventMgr() : isSystemInit(false) { - isSystemInit = false; } void GameEventMgr::HandleQuestComplete(uint32 quest_id) @@ -1522,8 +1527,17 @@ void GameEventMgr::HandleQuestComplete(uint32 quest_id) citr->second.done = citr->second.reqNum; // save the change to db SQLTransaction trans = CharacterDatabase.BeginTransaction(); - trans->PAppend("DELETE FROM game_event_condition_save WHERE event_id = '%u' AND condition_id = '%u'",event_id,condition); - trans->PAppend("INSERT INTO game_event_condition_save (event_id, condition_id, done) VALUES (%u,%u,%f)",event_id,condition,citr->second.done); + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GAME_EVENT_CONDITION_SAVE); + stmt->setUInt8(0, uint8(event_id)); + stmt->setUInt32(1, condition); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_ADD_GAME_EVENT_CONDITION_SAVE); + stmt->setUInt8(0, uint8(event_id)); + stmt->setUInt32(1, condition); + stmt->setFloat(2, citr->second.done); + trans->Append(stmt); CharacterDatabase.CommitTransaction(trans); // check if all conditions are met, if so, update the event state if (CheckOneGameEventConditions(event_id)) @@ -1558,11 +1572,16 @@ bool GameEventMgr::CheckOneGameEventConditions(uint16 event_id) void GameEventMgr::SaveWorldEventStateToDB(uint16 event_id) { SQLTransaction trans = CharacterDatabase.BeginTransaction(); - trans->PAppend("DELETE FROM game_event_save WHERE event_id = '%u'",event_id); - if (mGameEvent[event_id].nextstart) - trans->PAppend("INSERT INTO game_event_save (event_id, state, next_start) VALUES ('%u','%u', "UI64FMTD")",event_id,mGameEvent[event_id].state,(uint64)(mGameEvent[event_id].nextstart)); - else - trans->PAppend("INSERT INTO game_event_save (event_id, state, next_start) VALUES ('%u','%u','0')",event_id,mGameEvent[event_id].state); + + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GAME_EVENT_SAVE); + stmt->setUInt8(0, uint8(event_id)); + trans->Append(stmt); + + stmt = CharacterDatabase.GetPreparedStatement(CHAR_ADD_GAME_EVENT_SAVE); + stmt->setUInt8(0, uint8(event_id)); + stmt->setUInt8(1, mGameEvent[event_id].state); + stmt->setUInt32(2, mGameEvent[event_id].nextstart ? uint32(mGameEvent[event_id].nextstart) : 0); + trans->Append(stmt); CharacterDatabase.CommitTransaction(trans); } diff --git a/src/server/game/Events/GameEventMgr.h b/src/server/game/Events/GameEventMgr.h index f030d97a586f4..8e71d4f5a1397 100755 --- a/src/server/game/Events/GameEventMgr.h +++ b/src/server/game/Events/GameEventMgr.h @@ -104,7 +104,8 @@ class GameEventMgr void LoadFromDB(); uint32 Update(); bool IsActiveEvent(uint16 event_id) { return (m_ActiveEvents.find(event_id) != m_ActiveEvents.end()); } - uint32 Initialize(); + uint32 StartSystem(); + void Initialize(); void StartArenaSeason(); void StartInternalEvent(uint16 event_id); bool StartEvent(uint16 event_id, bool overwrite = false); @@ -133,7 +134,7 @@ class GameEventMgr bool hasGameObjectQuestActiveEventExcept(uint32 quest_id, uint16 event_id); bool hasCreatureActiveEventExcept(uint32 creature_guid, uint16 event_id); bool hasGameObjectActiveEventExcept(uint32 go_guid, uint16 event_id); - protected: +protected: typedef std::list GuidList; typedef std::list IdList; typedef std::vector GameEventGuidMap; diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 5ae6328a63ae5..074c62000c1b5 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -195,49 +195,57 @@ LanguageDesc const* GetLanguageDescByID(uint32 lang) return NULL; } -bool SpellClickInfo::IsFitToRequirements(Player const* player, Creature const * clickNpc) const +bool SpellClickInfo::IsFitToRequirements(Unit const* clicker, Unit const* clickee) const { - if (questStart) + Player const* playerClicker = clicker->ToPlayer(); + if (playerClicker) { - // not in expected required quest state - if (!player || ((!questStartCanActive || !player->IsActiveQuest(questStart)) && !player->GetQuestRewardStatus(questStart))) - return false; - } + if (questStart) + { + // not in expected required quest state + if (((!questStartCanActive || !playerClicker->IsActiveQuest(questStart)) && !playerClicker->GetQuestRewardStatus(questStart))) + return false; + } - if (questEnd) - { - // not in expected forbidden quest state - if (!player || player->GetQuestRewardStatus(questEnd)) - return false; + if (questEnd) + { + // not in expected forbidden quest state + if (playerClicker->GetQuestRewardStatus(questEnd)) + return false; + } } if (auraRequired) - if (!player->HasAura(auraRequired)) + if (!clicker->HasAura(auraRequired)) return false; if (auraForbidden) - if (player->HasAura(auraForbidden)) + if (clicker->HasAura(auraForbidden)) return false; Unit const * summoner = NULL; // Check summoners for party - if (clickNpc->isSummon()) - summoner = clickNpc->ToTempSummon()->GetSummoner(); + if (clickee->isSummon()) + summoner = clickee->ToTempSummon()->GetSummoner(); if (!summoner) - summoner = clickNpc; + summoner = clickee; + + if (!playerClicker) + return true; + // This only applies to players switch (userType) { case SPELL_CLICK_USER_FRIEND: - if (!player->IsFriendlyTo(summoner)) + if (!playerClicker->IsFriendlyTo(summoner)) return false; break; case SPELL_CLICK_USER_RAID: - if (!player->IsInRaidWith(summoner)) + if (!playerClicker->IsInRaidWith(summoner)) return false; break; case SPELL_CLICK_USER_PARTY: - if (!player->IsInPartyWith(summoner)) + if (!playerClicker->IsInPartyWith(summoner)) return false; break; default: @@ -266,6 +274,7 @@ ObjectMgr::ObjectMgr() m_guildId = 1; m_arenaTeamId = 1; m_auctionid = 1; + NextGroupStorageId = 1; } ObjectMgr::~ObjectMgr() @@ -289,8 +298,7 @@ ObjectMgr::~ObjectMgr() delete *itr; for (GuildMap::iterator itr = mGuildMap.begin(); itr != mGuildMap.end(); ++itr) - if (*itr) - delete *itr; + delete itr->second; for (ArenaTeamMap::iterator itr = mArenaTeamMap.begin(); itr != mArenaTeamMap.end(); ++itr) delete itr->second; @@ -310,12 +318,21 @@ Group * ObjectMgr::GetGroupByGUID(uint32 guid) const return NULL; } +Group* ObjectMgr::GetGroupByStorageId(uint32 storageId) const +{ + if (storageId < mGroupStorage.size()) + return mGroupStorage[storageId]; + + return NULL; +} + // Guild collection Guild* ObjectMgr::GetGuildById(uint32 guildId) const { - // Make sure given index exists in collection - if (guildId < uint32(mGuildMap.size())) - return mGuildMap[guildId]; + GuildMap::const_iterator itr = mGuildMap.find(guildId); + if (itr != mGuildMap.end()) + return itr->second; + return NULL; } @@ -325,13 +342,10 @@ Guild* ObjectMgr::GetGuildByName(const std::string& guildname) const std::transform(search.begin(), search.end(), search.begin(), ::toupper); for (GuildMap::const_iterator itr = mGuildMap.begin(); itr != mGuildMap.end(); ++itr) { - if (*itr) - { - std::string gname = (*itr)->GetName(); - std::transform(gname.begin(), gname.end(), gname.begin(), ::toupper); - if (search == gname) - return *itr; - } + std::string gname = itr->second->GetName(); + std::transform(gname.begin(), gname.end(), gname.begin(), ::toupper); + if (search == gname) + return itr->second; } return NULL; } @@ -346,29 +360,20 @@ std::string ObjectMgr::GetGuildNameById(uint32 guildId) const Guild* ObjectMgr::GetGuildByLeader(const uint64 &guid) const { for (GuildMap::const_iterator itr = mGuildMap.begin(); itr != mGuildMap.end(); ++itr) - if ((*itr) && (*itr)->GetLeaderGUID() == guid) - return *itr; + if (itr->second->GetLeaderGUID() == guid) + return itr->second; return NULL; } -void ObjectMgr::AddGuild(Guild* pGuild) +void ObjectMgr::AddGuild(Guild* guild) { - uint32 guildId = pGuild->GetId(); - // Allocate space if necessary - if (guildId >= uint32(mGuildMap.size())) - // Reserve a bit more space than necessary. - // 16 is intentional and it will allow creation of next 16 guilds happen - // without reallocation. - mGuildMap.resize(guildId + 16); - mGuildMap[guildId] = pGuild; + mGuildMap[guild->GetId()] = guild; } void ObjectMgr::RemoveGuild(uint32 guildId) { - // Make sure given index exists - if (guildId < uint32(mGuildMap.size())) - mGuildMap[guildId] = NULL; + mGuildMap.erase(guildId); } // Arena teams collection @@ -436,7 +441,6 @@ void ObjectMgr::LoadCreatureLocales() if (!result) return; - do { Field *fields = result->Fetch(); @@ -476,7 +480,6 @@ void ObjectMgr::LoadGossipMenuItemsLocales() if (!result) return; - do { Field *fields = result->Fetch(); @@ -512,7 +515,6 @@ void ObjectMgr::LoadPointOfInterestLocales() if (!result) return; - do { Field *fields = result->Fetch(); @@ -771,12 +773,6 @@ void ObjectMgr::CheckCreatureTemplate(CreatureInfo const* cInfo) if (cInfo->rangeattacktime == 0) const_cast(cInfo)->rangeattacktime = BASE_ATTACK_TIME; - if (cInfo->npcflag & UNIT_NPC_FLAG_SPELLCLICK) - { - sLog->outErrorDb("Creature (Entry: %u) has dynamic flag UNIT_NPC_FLAG_SPELLCLICK (%u) set, it is expected to be set by code handling `npc_spellclick_spells` content.", cInfo->Entry, UNIT_NPC_FLAG_SPELLCLICK); - const_cast(cInfo)->npcflag &= ~UNIT_NPC_FLAG_SPELLCLICK; - } - if ((cInfo->npcflag & UNIT_NPC_FLAG_TRAINER) && cInfo->trainer_type >= MAX_TRAINER_TYPE) sLog->outErrorDb("Creature (Entry: %u) has wrong trainer type %u.", cInfo->Entry, cInfo->trainer_type); @@ -1422,8 +1418,8 @@ void ObjectMgr::LoadCreatures() QueryResult result = WorldDatabase.Query("SELECT creature.guid, id, map, modelid," // 4 5 6 7 8 9 10 11 "equipment_id, position_x, position_y, position_z, orientation, spawntimesecs, spawndist, currentwaypoint," - // 12 13 14 15 16 17 18 19 - "curhealth, curmana, DeathState, MovementType, spawnMask, phaseMask, event, pool_entry," + // 12 13 14 15 16 17 18 19 + "curhealth, curmana, DeathState, MovementType, spawnMask, phaseMask, eventEntry, pool_entry," // 20 21 22 "creature.npcflag, creature.unit_flags, creature.dynamicflags " "FROM creature LEFT OUTER JOIN game_event_creature ON creature.guid = game_event_creature.guid " @@ -1455,7 +1451,6 @@ void ObjectMgr::LoadCreatures() //TODO: remove this //sGameEventMgr->mGameEventCreatureGuids.resize(52*2-1); - do { Field *fields = result->Fetch(); @@ -1682,7 +1677,7 @@ uint32 ObjectMgr::AddGOData(uint32 entry, uint32 mapId, float x, float y, float map->Add(go); } - sLog->outDebug("AddGOData: dbguid %u entry %u map %u x %f y %f z %f o %f", guid, entry, mapId, x, y, z, o); + sLog->outDebug(LOG_FILTER_MAPS, "AddGOData: dbguid %u entry %u map %u x %f y %f z %f o %f", guid, entry, mapId, x, y, z, o); return guid; } @@ -1754,7 +1749,6 @@ uint32 ObjectMgr::AddCreData(uint32 entry, uint32 /*team*/, uint32 mapId, float data.unit_flags = cInfo->unit_flags; data.dynamicflags = cInfo->dynamicflags; - AddCreatureToGrid(guid, &data); // Spawn if necessary (loaded grids only) @@ -1785,8 +1779,8 @@ void ObjectMgr::LoadGameobjects() // 0 1 2 3 4 5 6 QueryResult result = WorldDatabase.Query("SELECT gameobject.guid, id, map, position_x, position_y, position_z, orientation," - // 7 8 9 10 11 12 13 14 15 16 17 - "rotation0, rotation1, rotation2, rotation3, spawntimesecs, animprogress, state, spawnMask, phaseMask, event, pool_entry " + // 7 8 9 10 11 12 13 14 15 16 17 + "rotation0, rotation1, rotation2, rotation3, spawntimesecs, animprogress, state, spawnMask, phaseMask, eventEntry, pool_entry " "FROM gameobject LEFT OUTER JOIN game_event_gameobject ON gameobject.guid = game_event_gameobject.guid " "LEFT OUTER JOIN pool_gameobject ON gameobject.guid = pool_gameobject.guid"); @@ -1805,7 +1799,6 @@ void ObjectMgr::LoadGameobjects() if (GetMapDifficultyData(i,Difficulty(k))) spawnMasks[i] |= (1 << k); - do { Field *fields = result->Fetch(); @@ -2002,7 +1995,6 @@ void ObjectMgr::LoadGameobjectRespawnTimes() return; } - do { Field *fields = result->Fetch(); @@ -2121,7 +2113,6 @@ void ObjectMgr::LoadItemLocales() if (!result) return; - do { Field *fields = result->Fetch(); @@ -2625,7 +2616,6 @@ void ObjectMgr::LoadItemSetNameLocales() if (!result) return; - do { Field *fields = result->Fetch(); @@ -2702,7 +2692,6 @@ void ObjectMgr::LoadItemSetNames() ++count; } while (result->NextRow()); - if (!itemSetItems.empty()) { ItemPrototype const* pProto; @@ -2728,49 +2717,101 @@ void ObjectMgr::LoadItemSetNames() sLog->outString(); } -void ObjectMgr::LoadVehicleAccessories() +void ObjectMgr::LoadVehicleTemplateAccessories() { uint32 oldMSTime = getMSTime(); - m_VehicleAccessoryMap.clear(); // needed for reload case + m_VehicleTemplateAccessoryMap.clear(); // needed for reload case uint32 count = 0; - QueryResult result = WorldDatabase.Query("SELECT `entry`,`accessory_entry`,`seat_id`,`minion` FROM `vehicle_accessory`"); + QueryResult result = WorldDatabase.Query("SELECT `entry`,`accessory_entry`,`seat_id`,`minion`,`summontype`,`summontimer` FROM `vehicle_template_accessory`"); if (!result) { - sLog->outErrorDb(">> Loaded 0 LoadVehicleAccessor. DB table `vehicle_accessory` is empty."); + sLog->outErrorDb(">> Loaded 0 vehicle template accessories. DB table `vehicle_template_accessory` is empty."); sLog->outString(); return; } - do { Field *fields = result->Fetch(); - uint32 uiEntry = fields[0].GetUInt32(); - uint32 uiAccessory = fields[1].GetUInt32(); - int8 uiSeat = int8(fields[2].GetInt16()); - bool bMinion = fields[3].GetBool(); + uint32 uiEntry = fields[0].GetUInt32(); + uint32 uiAccessory = fields[1].GetUInt32(); + int8 uiSeat = int8(fields[2].GetInt16()); + bool bMinion = fields[3].GetBool(); + uint8 uiSummonType = fields[4].GetUInt8(); + uint32 uiSummonTimer= fields[5].GetUInt32(); if (!sCreatureStorage.LookupEntry(uiEntry)) { - sLog->outErrorDb("Table `vehicle_accessory`: creature template entry %u does not exist.", uiEntry); + sLog->outErrorDb("Table `vehicle_template_accessory`: creature template entry %u does not exist.", uiEntry); continue; } + if (!sCreatureStorage.LookupEntry(uiAccessory)) + { + sLog->outErrorDb("Table `vehicle_template_accessory`: Accessory %u does not exist.", uiAccessory); + continue; + } + + if (mSpellClickInfoMap.find(uiEntry) == mSpellClickInfoMap.end()) + { + sLog->outErrorDb("Table `vehicle_template_accessory`: creature template entry %u has no data in npc_spellclick_spells", uiEntry); + continue; + } + + m_VehicleTemplateAccessoryMap[uiEntry].push_back(VehicleAccessory(uiAccessory, uiSeat, bMinion, uiSummonType, uiSummonTimer)); + + ++count; + } + while (result->NextRow()); + + sLog->outString(">> Loaded %u Vehicle Template Accessories in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); +} + +void ObjectMgr::LoadVehicleAccessories() +{ + uint32 oldMSTime = getMSTime(); + + m_VehicleAccessoryMap.clear(); // needed for reload case + + uint32 count = 0; + + QueryResult result = WorldDatabase.Query("SELECT `guid`,`accessory_entry`,`seat_id`,`minion`,`summontype`,`summontimer` FROM `vehicle_accessory`"); + + if (!result) + { + sLog->outString(">> Loaded 0 Vehicle Accessories in %u ms", GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); + return; + } + + do + { + Field *fields = result->Fetch(); + + uint32 uiGUID = fields[0].GetUInt32(); + uint32 uiAccessory = fields[1].GetUInt32(); + int8 uiSeat = int8(fields[2].GetInt16()); + bool bMinion = fields[3].GetBool(); + uint8 uiSummonType = fields[4].GetUInt8(); + uint32 uiSummonTimer= fields[5].GetUInt32(); + if (!sCreatureStorage.LookupEntry(uiAccessory)) { sLog->outErrorDb("Table `vehicle_accessory`: Accessory %u does not exist.", uiAccessory); continue; } - m_VehicleAccessoryMap[uiEntry].push_back(VehicleAccessory(uiAccessory, uiSeat, bMinion)); + m_VehicleAccessoryMap[uiGUID].push_back(VehicleAccessory(uiAccessory, uiSeat, bMinion, uiSummonType, uiSummonTimer)); ++count; - } while (result->NextRow()); + } + while (result->NextRow()); sLog->outString(">> Loaded %u Vehicle Accessories in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); sLog->outString(); @@ -2793,7 +2834,6 @@ void ObjectMgr::LoadVehicleScaling() return; } - do { Field *fields = result->Fetch(); @@ -3611,21 +3651,19 @@ void ObjectMgr::LoadGuilds() } else { - mGuildMap.resize(m_guildId, NULL); // Reserve space and initialize storage for loading guilds //TODOLEAK: fix this shit - uint32 count = 0; - do { - Field* fields = result->Fetch(); Guild* pNewGuild = new Guild(); + if (!pNewGuild->LoadFromDB(fields)) { delete pNewGuild; continue; } AddGuild(pNewGuild); + ++count; } while (result->NextRow()); @@ -3641,7 +3679,7 @@ void ObjectMgr::LoadGuilds() uint32 oldMSTime = getMSTime(); // Delete orphaned guild rank entries before loading the valid ones - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_CLEAN_GUILD_RANKS); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_NONEXISTENT_GUILD_RANKS); CharacterDatabase.Execute(stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_GUILD_RANKS); @@ -3655,14 +3693,14 @@ void ObjectMgr::LoadGuilds() else { uint32 count = 0; - do { - Field* fields = result->Fetch(); uint32 guildId = fields[0].GetUInt32(); + if (Guild* pGuild = GetGuildById(guildId)) - pGuild->LoadRankFromDB(fields); //TODOLEAK: untangle that shit + pGuild->LoadRankFromDB(fields); + ++count; } while (result->NextRow()); @@ -3678,7 +3716,7 @@ void ObjectMgr::LoadGuilds() uint32 oldMSTime = getMSTime(); // Delete orphaned guild member entries before loading the valid ones - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_CLEAN_GUILD_MEMBERS); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_NONEXISTENT_GUILD_MEMBERS); CharacterDatabase.Execute(stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_GUILD_MEMBERS); @@ -3695,11 +3733,12 @@ void ObjectMgr::LoadGuilds() do { - Field* fields = result->Fetch(); uint32 guildId = fields[0].GetUInt32(); + if (Guild* pGuild = GetGuildById(guildId)) pGuild->LoadMemberFromDB(fields); + ++count; } while (result->NextRow()); @@ -3715,7 +3754,7 @@ void ObjectMgr::LoadGuilds() uint32 oldMSTime = getMSTime(); // Delete orphaned guild bank right entries before loading the valid ones - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_CLEAN_GUILD_BANK_RIGHTS); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_NONEXISTENT_GUILD_BANK_RIGHTS); CharacterDatabase.Execute(stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_GUILD_BANK_RIGHTS); @@ -3729,14 +3768,14 @@ void ObjectMgr::LoadGuilds() else { uint32 count = 0; - do { - Field* fields = result->Fetch(); uint32 guildId = fields[0].GetUInt32(); + if (Guild* pGuild = GetGuildById(guildId)) pGuild->LoadBankRightFromDB(fields); + ++count; } while (result->NextRow()); @@ -3766,14 +3805,14 @@ void ObjectMgr::LoadGuilds() else { uint32 count = 0; - do { - Field* fields = result->Fetch(); uint32 guildId = fields[0].GetUInt32(); + if (Guild* pGuild = GetGuildById(guildId)) pGuild->LoadEventLogFromDB(fields); + ++count; } while (result->NextRow()); @@ -3804,14 +3843,14 @@ void ObjectMgr::LoadGuilds() else { uint32 count = 0; - do { - Field* fields = result->Fetch(); uint32 guildId = fields[0].GetUInt32(); + if (Guild* pGuild = GetGuildById(guildId)) pGuild->LoadBankEventLogFromDB(fields); + ++count; } while (result->NextRow()); @@ -3827,7 +3866,7 @@ void ObjectMgr::LoadGuilds() uint32 oldMSTime = getMSTime(); // Delete orphaned guild bank tab entries before loading the valid ones - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_CLEAN_GUILD_BANK_TABS); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_NONEXISTENT_GUILD_BANK_TABS); CharacterDatabase.Execute(stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_GUILD_BANK_TABS); @@ -3841,14 +3880,14 @@ void ObjectMgr::LoadGuilds() else { uint32 count = 0; - do { - Field* fields = result->Fetch(); uint32 guildId = fields[0].GetUInt32(); + if (Guild* pGuild = GetGuildById(guildId)) pGuild->LoadBankTabFromDB(fields); + ++count; } while (result->NextRow()); @@ -3864,7 +3903,7 @@ void ObjectMgr::LoadGuilds() uint32 oldMSTime = getMSTime(); // Delete orphan guild bank items - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_CLEAN_GUILD_BANK_ITEMS); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_NONEXISTENT_GUILD_BANK_ITEMS); CharacterDatabase.Execute(stmt); stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_GUILD_BANK_ITEMS); @@ -3878,14 +3917,14 @@ void ObjectMgr::LoadGuilds() else { uint32 count = 0; - do { - Field* fields = result->Fetch(); uint32 guildId = fields[11].GetUInt32(); + if (Guild* pGuild = GetGuildById(guildId)) pGuild->LoadBankItemFromDB(fields); + ++count; } while (result->NextRow()); @@ -3902,7 +3941,7 @@ void ObjectMgr::LoadGuilds() for (GuildMap::iterator itr = mGuildMap.begin(); itr != mGuildMap.end(); ++itr) { - Guild* pGuild = *itr; + Guild* pGuild = itr->second; if (pGuild) { if (!pGuild->Validate()) @@ -3970,14 +4009,14 @@ void ObjectMgr::LoadGroups() uint32 oldMSTime = getMSTime(); // Delete all groups whose leader does not exist - CharacterDatabase.Execute(CharacterDatabase.GetPreparedStatement(CHAR_DEL_LEADERLESS_GROUPS)); + CharacterDatabase.DirectExecute("DELETE FROM groups WHERE leaderGuid NOT IN (SELECT guid FROM characters)"); // Delete all groups with less than 2 members - CharacterDatabase.Execute(CharacterDatabase.GetPreparedStatement(CHAR_DEL_TINY_GROUPS)); + CharacterDatabase.DirectExecute("DELETE FROM groups WHERE guid NOT IN (SELECT guid FROM group_member GROUP BY guid HAVING COUNT(guid) > 1)"); // 0 1 2 3 4 5 6 7 8 9 QueryResult result = CharacterDatabase.PQuery("SELECT leaderGuid, lootMethod, looterGuid, lootThreshold, icon1, icon2, icon3, icon4, icon5, icon6" // 10 11 12 13 14 15 - ",icon7, icon8, groupType, difficulty, raiddifficulty, guid FROM groups"); + ",icon7, icon8, groupType, difficulty, raiddifficulty, guid FROM groups ORDER BY guid ASC"); if (!result) { sLog->outString(">> Loaded 0 group definitions. DB table `groups` is empty!"); @@ -3990,11 +4029,19 @@ void ObjectMgr::LoadGroups() do { Field *fields = result->Fetch(); - ++count; Group *group = new Group; - group->LoadGroupFromDB(fields[15].GetUInt32(), result, false); - // group load will never be false (we have run consistency sql's before loading) + group->LoadGroupFromDB(fields); AddGroup(group); + + // + uint32 storageId = group->GetStorageId(); + + RegisterGroupStorageId(storageId, group); + + if (storageId == NextGroupStorageId) + NextGroupStorageId++; + + ++count; } while (result->NextRow()); @@ -4007,12 +4054,12 @@ void ObjectMgr::LoadGroups() uint32 oldMSTime = getMSTime(); // Delete all rows from group_member or group_instance with no group - CharacterDatabase.Execute(CharacterDatabase.GetPreparedStatement(CHAR_DEL_NONEXISTENT_GROUP_MEMBERS)); - CharacterDatabase.Execute(CharacterDatabase.GetPreparedStatement(CHAR_DEL_NONEXISTENT_GROUP_INSTANCES)); + CharacterDatabase.DirectExecute("DELETE FROM group_member WHERE guid NOT IN (SELECT guid FROM groups)"); + CharacterDatabase.DirectExecute("DELETE FROM group_instance WHERE guid NOT IN (SELECT guid FROM groups)"); // Delete all members that does not exist - CharacterDatabase.Execute(CharacterDatabase.GetPreparedStatement(CHAR_DEL_NONEXISTENT_CHARACTER_GROUP_MEMBERS)); + CharacterDatabase.DirectExecute("DELETE FROM group_member WHERE memberGuid NOT IN (SELECT guid FROM characters)"); - // 0 1 2 3 4 + // 0 1 2 3 4 QueryResult result = CharacterDatabase.Query("SELECT guid, memberGuid, memberFlags, subgroup, roles FROM group_member ORDER BY guid"); if (!result) { @@ -4021,21 +4068,18 @@ void ObjectMgr::LoadGroups() return; } - uint32 groupLowGuid = 0; uint32 count = 0; - Group* group = NULL; + do { Field* fields = result->Fetch(); - if (groupLowGuid != fields[0].GetUInt32()) - { - groupLowGuid = fields[0].GetUInt32(); - group = GetGroupByGUID(groupLowGuid); - } - if (group) // Should never be null + Group* group = GetGroupByStorageId(fields[0].GetUInt32()); + + if (group) group->LoadMemberFromDB(fields[1].GetUInt32(), fields[2].GetUInt8(), fields[3].GetUInt8(), fields[4].GetUInt8()); else - sLog->outError("ObjectMgr::LoadGroups: Consistency failed, can't find group (lowguid %u)", groupLowGuid); + sLog->outError("ObjectMgr::LoadGroups: Consistency failed, can't find group (storage id: %u)", fields[0].GetUInt32()); + ++count; } while (result->NextRow()); @@ -4044,7 +4088,6 @@ void ObjectMgr::LoadGroups() sLog->outString(); } - sLog->outString("Loading Group instance saves..."); { uint32 oldMSTime = getMSTime(); @@ -4066,7 +4109,7 @@ void ObjectMgr::LoadGroups() do { Field *fields = result->Fetch(); - Group *group = GetGroupByGUID(fields[0].GetUInt32()); + Group *group = GetGroupByStorageId(fields[0].GetUInt32()); // group will never be NULL (we have run consistency sql's before loading) MapEntry const* mapEntry = sMapStore.LookupEntry(fields[1].GetUInt32()); @@ -4625,7 +4668,6 @@ void ObjectMgr::LoadQuests() } } - else if (qinfo->RewRepValue[j] != 0) { sLog->outErrorDb("Quest %u has `RewRepFaction%d` = 0 but `RewRepValue%d` = %i.", @@ -4634,7 +4676,6 @@ void ObjectMgr::LoadQuests() } } - if (qinfo->RewSpell) { SpellEntry const* spellInfo = sSpellStore.LookupEntry(qinfo->RewSpell); @@ -4808,7 +4849,6 @@ void ObjectMgr::LoadQuestLocales() if (!result) return; - do { Field *fields = result->Fetch(); @@ -4877,7 +4917,6 @@ void ObjectMgr::LoadScripts(ScriptsType type) sprintf(buff, "SELECT id,delay,command,datalong,datalong2,dataint,x,y,z,o%s FROM %s", isSpellScriptTable ? ",effIndex" : "", tableName.c_str()); QueryResult result = WorldDatabase.Query(buff); - if (!result) { sLog->outString(">> Loaded 0 script definitions. DB table `%s` is empty!", tableName.c_str()); @@ -5398,7 +5437,6 @@ void ObjectMgr::ValidateSpellScripts() sScriptMgr->CreateSpellScriptLoaders(itr->first, SpellScriptLoaders); itr = mSpellScripts.upper_bound(itr->first); - for (std::vector >::iterator sitr = SpellScriptLoaders.begin(); sitr != SpellScriptLoaders.end(); ++sitr) { SpellScript * spellScript = sitr->first->GetSpellScript(); @@ -5502,7 +5540,6 @@ void ObjectMgr::LoadPageTextLocales() if (!result) return; - do { Field *fields = result->Fetch(); @@ -5664,7 +5701,6 @@ void ObjectMgr::LoadGossipText() int cic; - do { ++count; @@ -5672,7 +5708,6 @@ void ObjectMgr::LoadGossipText() Field *fields = result->Fetch(); - uint32 Text_ID = fields[cic++].GetUInt32(); if (!Text_ID) { @@ -5722,7 +5757,6 @@ void ObjectMgr::LoadNpcTextLocales() if (!result) return; - do { Field *fields = result->Fetch(); @@ -5757,7 +5791,7 @@ void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp) time_t curTime = time(NULL); tm* lt = localtime(&curTime); uint64 basetime(curTime); - sLog->outDebug("Returning mails current time: hour: %d, minute: %d, second: %d ", lt->tm_hour, lt->tm_min, lt->tm_sec); + sLog->outDetail("Returning mails current time: hour: %d, minute: %d, second: %d ", lt->tm_hour, lt->tm_min, lt->tm_sec); // Delete all old mails without item and without body immediately, if starting server if (!serverUp) @@ -6188,7 +6222,6 @@ WorldSafeLocsEntry const *ObjectMgr::GetClosestGraveYard(float x, float y, float return NULL; } - // Simulate std. algorithm: // found some graveyard associated to (ghost_zone,ghost_map) // @@ -6404,7 +6437,6 @@ void ObjectMgr::LoadAreaTriggerTeleports() { Field *fields = result->Fetch(); - ++count; uint32 Trigger_ID = fields[0].GetUInt32(); @@ -6466,7 +6498,6 @@ void ObjectMgr::LoadAccessRequirements() { Field *fields = result->Fetch(); - ++count; uint32 mapid = fields[0].GetUInt32(); @@ -6642,7 +6673,7 @@ void ObjectMgr::SetHighestGuids() result = CharacterDatabase.Query("SELECT MAX(guid) FROM groups"); if (result) - m_hiGroupGuid = (*result)[0].GetUInt32()+1; + mGroupStorage.resize((*result)[0].GetUInt32()+1); } uint32 ObjectMgr::GenerateArenaTeamId() @@ -6667,7 +6698,7 @@ uint32 ObjectMgr::GenerateAuctionID() uint64 ObjectMgr::GenerateEquipmentSetGuid() { - if (m_equipmentSetGuid >= 0xFFFFFFFFFFFFFFFEll) + if (m_equipmentSetGuid >= uint64(0xFFFFFFFFFFFFFFFELL)) { sLog->outError("EquipmentSet guid overflow!! Can't continue, shutting down server. "); World::StopNow(ERROR_EXIT_CODE); @@ -6791,7 +6822,6 @@ void ObjectMgr::LoadGameObjectLocales() if (!result) return; - do { Field *fields = result->Fetch(); @@ -7208,7 +7238,6 @@ void ObjectMgr::LoadReputationRewardRate() return; } - do { @@ -7279,7 +7308,6 @@ void ObjectMgr::LoadReputationOnKill() return; } - do { Field *fields = result->Fetch(); @@ -7348,7 +7376,6 @@ void ObjectMgr::LoadReputationSpilloverTemplate() return; } - do { @@ -7464,7 +7491,6 @@ void ObjectMgr::LoadPointsOfInterest() return; } - do { Field *fields = result->Fetch(); @@ -7515,7 +7541,6 @@ void ObjectMgr::LoadQuestPOI() // 0 1 2 3 QueryResult points = WorldDatabase.PQuery("SELECT questId, id, x, y FROM quest_poi_points ORDER BY questId DESC, idx"); - std::vector > > POIs; if (points) @@ -7597,9 +7622,6 @@ void ObjectMgr::LoadNPCSpellClickSpells() continue; } - if (!(cInfo->npcflag & UNIT_NPC_FLAG_SPELLCLICK)) - const_cast(cInfo)->npcflag |= UNIT_NPC_FLAG_SPELLCLICK; - uint32 spellid = fields[1].GetUInt32(); SpellEntry const *spellinfo = sSpellStore.LookupEntry(spellid); if (!spellinfo) @@ -7671,13 +7693,24 @@ void ObjectMgr::LoadNPCSpellClickSpells() info.userType = SpellClickUserTypes(userType); mSpellClickInfoMap.insert(SpellClickInfoMap::value_type(npc_entry, info)); - // mark creature template as spell clickable - const_cast(cInfo)->npcflag |= UNIT_NPC_FLAG_SPELLCLICK; - ++count; } while (result->NextRow()); + // all spellclick data loaded, now we check if there are creatures with NPC_FLAG_SPELLCLICK but with no data + // NOTE: It *CAN* be the other way around: no spellclick flag but with spellclick data, in case of creature-only vehicle accessories + for (uint32 i = 0; i < sCreatureStorage.MaxEntry; ++i) + { + if (CreatureInfo const* cInfo = GetCreatureTemplate(i)) + { + if ((cInfo->npcflag & UNIT_NPC_FLAG_SPELLCLICK) && mSpellClickInfoMap.find(i) == mSpellClickInfoMap.end()) + { + sLog->outErrorDb("npc_spellclick_spells: Creature template %u has UNIT_NPC_FLAG_SPELLCLICK but no data in spellclick table! Removing flag", i); + const_cast(cInfo)->npcflag &= ~UNIT_NPC_FLAG_SPELLCLICK; + } + } + } + sLog->outString(">> Loaded %u spellclick definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); sLog->outString(); } @@ -7842,7 +7875,6 @@ void ObjectMgr::LoadQuestRelationsHelper(QuestRelations& map, std::string table, return; } - PooledQuestRelation* poolRelationMap = go ? &sPoolMgr->mQuestGORelation : &sPoolMgr->mQuestCreatureRelation; if (starter) poolRelationMap->clear(); @@ -7856,7 +7888,7 @@ void ObjectMgr::LoadQuestRelationsHelper(QuestRelations& map, std::string table, if (mQuestTemplates.find(quest) == mQuestTemplates.end()) { - sLog->outErrorDb("Table `%s: Quest %u listed for entry %u does not exist.", table.c_str(), quest, id); + sLog->outErrorDb("Table `%s`: Quest %u listed for entry %u does not exist.", table.c_str(), quest, id); continue; } @@ -8218,7 +8250,6 @@ bool ObjectMgr::LoadTrinityStrings(char const* table, int32 min_value, int32 max if (!result) { - if (min_value == MIN_TRINITY_STRING_ID) // error only in case internal strings sLog->outErrorDb(">> Loaded 0 trinity strings. DB table `%s` is empty. Cannot continue.",table); else @@ -8229,7 +8260,6 @@ bool ObjectMgr::LoadTrinityStrings(char const* table, int32 min_value, int32 max uint32 count = 0; - do { Field *fields = result->Fetch(); @@ -8265,7 +8295,6 @@ bool ObjectMgr::LoadTrinityStrings(char const* table, int32 min_value, int32 max } } while (result->NextRow()); - if (min_value == MIN_TRINITY_STRING_ID) sLog->outString(">> Loaded %u Trinity strings from table %s in %u ms", count, table, GetMSTimeDiffToNow(oldMSTime)); else @@ -9070,7 +9099,6 @@ void ObjectMgr::LoadScriptNames() return; } - uint32 count = 1; do @@ -9421,3 +9449,44 @@ void ObjectMgr::LoadFactionChangeReputations() sLog->outString(">> Loaded %u faction change reputation pairs in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); sLog->outString(); } + +uint32 ObjectMgr::GenerateNewGroupStorageId() +{ + uint32 newStorageId = NextGroupStorageId; + + for (uint32 i = ++NextGroupStorageId; i < 0xFFFFFFFF; ++i) + { + if ((i < mGroupStorage.size() && mGroupStorage[i] == NULL) || i >= mGroupStorage.size()) + { + NextGroupStorageId = i; + break; + } + } + + if (newStorageId == NextGroupStorageId) + { + sLog->outError("Group storage ID overflow!! Can't continue, shutting down server. "); + World::StopNow(ERROR_EXIT_CODE); + } + + return newStorageId; +} + +void ObjectMgr::RegisterGroupStorageId(uint32 storageId, Group* group) +{ + // Allocate space if necessary. + if (storageId >= uint32(mGroupStorage.size())) + mGroupStorage.resize(storageId + 1); + + mGroupStorage[storageId] = group; +} + +void ObjectMgr::FreeGroupStorageId(Group* group) +{ + uint32 storageId = group->GetStorageId(); + + if (storageId < NextGroupStorageId) + NextGroupStorageId = storageId; + + mGroupStorage[storageId] = NULL; +} diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h index 99e4d8d746425..ce5fd431686d9 100755 --- a/src/server/game/Globals/ObjectMgr.h +++ b/src/server/game/Globals/ObjectMgr.h @@ -335,7 +335,7 @@ struct SpellClickInfo SpellClickUserTypes userType; // helpers - bool IsFitToRequirements(Player const* player, Creature const * clickNpc) const; + bool IsFitToRequirements(Unit const* clicker, Unit const * clickee) const; }; typedef std::multimap SpellClickInfoMap; @@ -592,8 +592,9 @@ class ObjectMgr typedef UNORDERED_MAP ItemMap; typedef std::set GroupSet; + typedef std::vector GroupStorage; - typedef std::vector GuildMap; + typedef UNORDERED_MAP GuildMap; typedef UNORDERED_MAP ArenaTeamMap; @@ -629,6 +630,12 @@ class ObjectMgr void AddGroup(Group* group) { mGroupSet.insert(group); } void RemoveGroup(Group* group) { mGroupSet.erase(group); } + uint32 GenerateNewGroupStorageId(); + void RegisterGroupStorageId(uint32 storageId, Group* group); + void FreeGroupStorageId(Group* group); + void SetNextGroupStorageId(uint32 storageId) { NextGroupStorageId = storageId; }; + Group* GetGroupByStorageId(uint32 storageId) const; + Guild* GetGuildByLeader(uint64 const&guid) const; Guild* GetGuildById(uint32 guildId) const; Guild* GetGuildByName(const std::string& guildname) const; @@ -800,10 +807,19 @@ class ObjectMgr return NULL; } - VehicleAccessoryList const* GetVehicleAccessoryList(uint32 uiEntry) const + VehicleAccessoryList const* GetVehicleAccessoryList(Vehicle* veh) const { - VehicleAccessoryMap::const_iterator itr = m_VehicleAccessoryMap.find(uiEntry); - if (itr != m_VehicleAccessoryMap.end()) + if (Creature* cre = veh->GetBase()->ToCreature()) + { + // Give preference to GUID-based accessories + VehicleAccessoryMap::const_iterator itr = m_VehicleAccessoryMap.find(cre->GetDBTableGUIDLow()); + if (itr != m_VehicleAccessoryMap.end()) + return &itr->second; + } + + // Otherwise return entry-based + VehicleAccessoryMap::const_iterator itr = m_VehicleTemplateAccessoryMap.find(veh->GetCreatureEntry()); + if (itr != m_VehicleTemplateAccessoryMap.end()) return &itr->second; return NULL; } @@ -914,6 +930,7 @@ class ObjectMgr void LoadInstanceTemplate(); void LoadInstanceEncounters(); void LoadMailLevelRewards(); + void LoadVehicleTemplateAccessories(); void LoadVehicleAccessories(); void LoadVehicleScaling(); @@ -1262,6 +1279,10 @@ class ObjectMgr uint32 m_hiGroupGuid; uint32 m_hiMoTransGuid; + // Database storage IDs + + uint32 NextGroupStorageId; + QuestMap mQuestTemplates; typedef UNORDERED_MAP GossipTextMap; @@ -1270,6 +1291,7 @@ class ObjectMgr typedef std::set GameObjectForQuestSet; GroupSet mGroupSet; + GroupStorage mGroupStorage; GuildMap mGuildMap; ArenaTeamMap mArenaTeamMap; @@ -1313,6 +1335,7 @@ class ObjectMgr ItemRequiredTargetMap m_ItemRequiredTarget; + VehicleAccessoryMap m_VehicleTemplateAccessoryMap; VehicleAccessoryMap m_VehicleAccessoryMap; VehicleScalingMap m_VehicleScalingMap; diff --git a/src/server/game/Grids/GridStates.cpp b/src/server/game/Grids/GridStates.cpp index f5106154e70d8..b7f910b60593d 100755 --- a/src/server/game/Grids/GridStates.cpp +++ b/src/server/game/Grids/GridStates.cpp @@ -38,7 +38,7 @@ ActiveState::Update(Map &m, NGridType &grid, GridInfo & info, const uint32 &x, c ObjectGridStoper stoper(grid); stoper.StopN(); grid.SetGridState(GRID_STATE_IDLE); - sLog->outDebug("Grid[%u,%u] on map %u moved to IDLE state", x, y, m.GetId()); + sLog->outDebug(LOG_FILTER_MAPS, "Grid[%u,%u] on map %u moved to IDLE state", x, y, m.GetId()); } else { @@ -52,7 +52,7 @@ IdleState::Update(Map &m, NGridType &grid, GridInfo &, const uint32 &x, const ui { m.ResetGridExpiry(grid); grid.SetGridState(GRID_STATE_REMOVAL); - sLog->outDebug("Grid[%u,%u] on map %u moved to REMOVAL state", x, y, m.GetId()); + sLog->outDebug(LOG_FILTER_MAPS, "Grid[%u,%u] on map %u moved to REMOVAL state", x, y, m.GetId()); } void @@ -65,7 +65,7 @@ RemovalState::Update(Map &m, NGridType &grid, GridInfo &info, const uint32 &x, c { if (!m.UnloadGrid(x, y, false)) { - sLog->outDebug("Grid[%u,%u] for map %u differed unloading due to players or active objects nearby", x, y, m.GetId()); + sLog->outDebug(LOG_FILTER_MAPS, "Grid[%u,%u] for map %u differed unloading due to players or active objects nearby", x, y, m.GetId()); m.ResetGridExpiry(grid); } } diff --git a/src/server/game/Grids/Notifiers/GridNotifiersImpl.h b/src/server/game/Grids/Notifiers/GridNotifiersImpl.h index 532a330d0949b..9c806063721e1 100755 --- a/src/server/game/Grids/Notifiers/GridNotifiersImpl.h +++ b/src/server/game/Grids/Notifiers/GridNotifiersImpl.h @@ -27,7 +27,6 @@ #include "CreatureAI.h" #include "SpellAuras.h" - template inline void Trinity::VisibleNotifier::Visit(GridRefManager &m) diff --git a/src/server/game/Grids/ObjectGridLoader.cpp b/src/server/game/Grids/ObjectGridLoader.cpp index 89bf39b1fe5c1..4a9f11d892cfb 100755 --- a/src/server/game/Grids/ObjectGridLoader.cpp +++ b/src/server/game/Grids/ObjectGridLoader.cpp @@ -230,7 +230,7 @@ void ObjectGridLoader::LoadN(void) loader.Load(i_grid(x, y), *this); } } - sLog->outDebug("%u GameObjects, %u Creatures, and %u Corpses/Bones loaded for grid %u on map %u", i_gameObjects, i_creatures, i_corpses,i_grid.GetGridId(), i_map->GetId()); + sLog->outDebug(LOG_FILTER_MAPS, "%u GameObjects, %u Creatures, and %u Corpses/Bones loaded for grid %u on map %u", i_gameObjects, i_creatures, i_corpses,i_grid.GetGridId(), i_map->GetId()); } void ObjectGridUnloader::MoveToRespawnN() diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp index b798c4df2a619..7d65363bbce96 100755 --- a/src/server/game/Groups/Group.cpp +++ b/src/server/game/Groups/Group.cpp @@ -57,7 +57,7 @@ Loot* Roll::getLoot() Group::Group() : m_leaderGuid(0), m_leaderName(""), m_groupType(GROUPTYPE_NORMAL), m_dungeonDifficulty(DUNGEON_DIFFICULTY_NORMAL), m_raidDifficulty(RAID_DIFFICULTY_10MAN_NORMAL), m_bgGroup(NULL), m_lootMethod(FREE_FOR_ALL), m_lootThreshold(ITEM_QUALITY_UNCOMMON), m_looterGuid(0), -m_subGroupsCounts(NULL), m_guid(0), m_counter(0), m_maxEnchantingLevel(0) +m_subGroupsCounts(NULL), m_guid(0), m_counter(0), m_maxEnchantingLevel(0), m_storageId(0) { for (uint8 i = 0; i < TARGETICONCOUNT; ++i) m_targetIcons[i] = 0; @@ -67,7 +67,7 @@ Group::~Group() { if (m_bgGroup) { - sLog->outDebug("Group::~Group: battleground group being deleted."); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Group::~Group: battleground group being deleted."); if (m_bgGroup->GetBgRaid(ALLIANCE) == this) m_bgGroup->SetBgRaid(ALLIANCE, NULL); else if (m_bgGroup->GetBgRaid(HORDE) == this) m_bgGroup->SetBgRaid(HORDE, NULL); else sLog->outError("Group::~Group: battleground group is not linked to the correct battleground."); @@ -92,12 +92,14 @@ Group::~Group() delete[] m_subGroupsCounts; } -bool Group::Create(const uint64 &guid, const char * name) +bool Group::Create(Player *leader) { + uint64 leaderGuid = leader->GetGUID(); uint32 lowguid = sObjectMgr->GenerateLowGuid(HIGHGUID_GROUP); + m_guid = MAKE_NEW_GUID(lowguid, 0, HIGHGUID_GROUP); - m_leaderGuid = guid; - m_leaderName = name; + m_leaderGuid = leaderGuid; + m_leaderName = leader->GetName(); m_groupType = isBGGroup() ? GROUPTYPE_BGRAID : GROUPTYPE_NORMAL; @@ -106,54 +108,46 @@ bool Group::Create(const uint64 &guid, const char * name) m_lootMethod = GROUP_LOOT; m_lootThreshold = ITEM_QUALITY_UNCOMMON; - m_looterGuid = guid; + m_looterGuid = leaderGuid; m_dungeonDifficulty = DUNGEON_DIFFICULTY_NORMAL; m_raidDifficulty = RAID_DIFFICULTY_10MAN_NORMAL; + if (!isBGGroup()) { - Player *leader = sObjectMgr->GetPlayer(guid); - if (leader) - { - m_dungeonDifficulty = leader->GetDungeonDifficulty(); - m_raidDifficulty = leader->GetRaidDifficulty(); - } + m_dungeonDifficulty = leader->GetDungeonDifficulty(); + m_raidDifficulty = leader->GetRaidDifficulty(); - Player::ConvertInstancesToGroup(leader, this, guid); + m_storageId = sObjectMgr->GenerateNewGroupStorageId(); - if (!AddMember(guid, name)) - return false; + sObjectMgr->RegisterGroupStorageId(m_storageId, this); // store group in database - SQLTransaction trans = CharacterDatabase.BeginTransaction(); - trans->PAppend("DELETE FROM groups WHERE guid ='%u'", lowguid); - trans->PAppend("DELETE FROM group_member WHERE guid = %u OR memberGuid = %u", lowguid, GUID_LOPART(guid)); - trans->PAppend("INSERT INTO group_member (guid, memberGuid, subgroup) VALUES (%u, %u, 0)", lowguid, GUID_LOPART(guid)); - trans->PAppend("INSERT INTO groups (guid,leaderGuid,lootMethod,looterGuid,lootThreshold,icon1,icon2,icon3,icon4,icon5,icon6,icon7,icon8,groupType,difficulty,raiddifficulty) " + CharacterDatabase.PExecute("INSERT INTO groups (guid,leaderGuid,lootMethod,looterGuid,lootThreshold,icon1,icon2,icon3,icon4,icon5,icon6,icon7,icon8,groupType,difficulty,raiddifficulty) " "VALUES ('%u','%u','%u','%u','%u','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','%u','%u','%u')", - lowguid, GUID_LOPART(m_leaderGuid), uint32(m_lootMethod), - GUID_LOPART(m_looterGuid), uint32(m_lootThreshold), m_targetIcons[0], m_targetIcons[1], m_targetIcons[2], m_targetIcons[3], m_targetIcons[4], m_targetIcons[5], m_targetIcons[6], m_targetIcons[7], uint8(m_groupType), uint32(m_dungeonDifficulty), m_raidDifficulty); + m_storageId, GUID_LOPART(m_leaderGuid), uint32(m_lootMethod), + GUID_LOPART(m_looterGuid), uint32(m_lootThreshold), m_targetIcons[0], m_targetIcons[1], m_targetIcons[2], m_targetIcons[3], m_targetIcons[4], m_targetIcons[5], m_targetIcons[6], + m_targetIcons[7], uint8(m_groupType), uint32(m_dungeonDifficulty), m_raidDifficulty); - CharacterDatabase.CommitTransaction(trans); + ASSERT(AddMember(leader)); // If the leader can't be added to a new group because it appears full, something is clearly wrong. + + Player::ConvertInstancesToGroup(leader, this, false); } - else if (!AddMember(guid, name)) + else if (!AddMember(leader)) return false; return true; } -bool Group::LoadGroupFromDB(const uint32 &groupGuid, QueryResult result, bool loadMembers) +void Group::LoadGroupFromDB(Field *fields) { - if (isBGGroup()) - return false; - - Field *fields = result->Fetch(); - m_guid = MAKE_NEW_GUID(groupGuid, 0, HIGHGUID_GROUP); + m_storageId = fields[15].GetUInt32(); + m_guid = MAKE_NEW_GUID(sObjectMgr->GenerateLowGuid(HIGHGUID_GROUP), 0, HIGHGUID_GROUP); m_leaderGuid = MAKE_NEW_GUID(fields[0].GetUInt32(), 0, HIGHGUID_PLAYER); // group leader not exist if (!sObjectMgr->GetPlayerNameByGUID(fields[0].GetUInt32(), m_leaderName)) - return false; + return; m_lootMethod = LootMethod(fields[1].GetUInt8()); m_looterGuid = MAKE_NEW_GUID(fields[2].GetUInt32(), 0, HIGHGUID_PLAYER); @@ -178,27 +172,9 @@ bool Group::LoadGroupFromDB(const uint32 &groupGuid, QueryResult result, bool lo else m_raidDifficulty = Difficulty(r_diff); - if (loadMembers) - { - // 0 1 2 3 - result = CharacterDatabase.PQuery("SELECT memberGuid, memberFlags, subgroup, roles FROM group_member WHERE guid=%u", groupGuid); - if (!result) - return false; - - do - { - fields = result->Fetch(); - LoadMemberFromDB(fields[0].GetUInt32(), fields[1].GetUInt8(), fields[2].GetUInt8(), fields[3].GetUInt8()); - } while (result->NextRow()); - - if (GetMembersCount() < 2) // group too small - return false; - } - - return true; } -bool Group::LoadMemberFromDB(uint32 guidLow, uint8 memberFlags, uint8 subgroup, uint8 roles) +void Group::LoadMemberFromDB(uint32 guidLow, uint8 memberFlags, uint8 subgroup, uint8 roles) { MemberSlot member; member.guid = MAKE_NEW_GUID(guidLow, 0, HIGHGUID_PLAYER); @@ -207,7 +183,7 @@ bool Group::LoadMemberFromDB(uint32 guidLow, uint8 memberFlags, uint8 subgroup, if (!sObjectMgr->GetPlayerNameByGUID(member.guid, member.name)) { CharacterDatabase.PQuery("DELETE FROM group_member WHERE memberGuid=%u", guidLow); - return false; + return; } member.group = subgroup; @@ -217,8 +193,6 @@ bool Group::LoadMemberFromDB(uint32 guidLow, uint8 memberFlags, uint8 subgroup, m_memberSlots.push_back(member); SubGroupCounterIncrease(subgroup); - - return true; } void Group::ConvertToLFG() @@ -226,7 +200,7 @@ void Group::ConvertToLFG() m_groupType = GroupType(m_groupType | GROUPTYPE_LFG | GROUPTYPE_UNK1); m_lootMethod = NEED_BEFORE_GREED; if (!isBGGroup()) - CharacterDatabase.PExecute("UPDATE groups SET groupType='%u' WHERE guid='%u'", uint8(m_groupType), GUID_LOPART(m_guid)); + CharacterDatabase.PExecute("UPDATE groups SET groupType='%u' WHERE guid='%u'", uint8(m_groupType), m_storageId); SendUpdate(); } @@ -237,7 +211,7 @@ void Group::ConvertToRaid() _initRaidSubGroupsCounter(); if (!isBGGroup()) - CharacterDatabase.PExecute("UPDATE groups SET groupType='%u' WHERE guid='%u'", uint8(m_groupType), GUID_LOPART(m_guid)); + CharacterDatabase.PExecute("UPDATE groups SET groupType='%u' WHERE guid='%u'", uint8(m_groupType), m_storageId); SendUpdate(); // update quest related GO states (quest activity dependent from raid membership) @@ -315,15 +289,66 @@ Player* Group::GetInvited(const std::string& name) const return NULL; } -bool Group::AddMember(const uint64 &guid, const char* name) +bool Group::AddMember(Player *player) { - if (!_addMember(guid, name)) - return false; + // Get first not-full group + uint8 subGroup = 0; + if (m_subGroupsCounts) + { + bool groupFound = false; + for (; subGroup < MAX_RAID_SUBGROUPS; ++subGroup) + { + if (m_subGroupsCounts[subGroup] < MAXGROUPSIZE) + { + groupFound = true; + break; + } + } + // We are raid group and no one slot is free + if (!groupFound) + return false; + } + + MemberSlot member; + member.guid = player->GetGUID(); + member.name = player->GetName(); + member.group = subGroup; + member.flags = 0; + member.roles = 0; + m_memberSlots.push_back(member); + + SubGroupCounterIncrease(subGroup); + + if (player) + { + player->SetGroupInvite(NULL); + if (player->GetGroup() && isBGGroup()) //if player is in group and he is being added to BG raid group, then call SetBattlegroundRaid() + player->SetBattlegroundRaid(this, subGroup); + else if (player->GetGroup()) //if player is in bg raid and we are adding him to normal group, then call SetOriginalGroup() + player->SetOriginalGroup(this, subGroup); + else //if player is not in group, then call set group + player->SetGroup(this, subGroup); + + // if the same group invites the player back, cancel the homebind timer + InstanceGroupBind *bind = GetBoundInstance(player); + if (bind && bind->save->GetInstanceId() == player->GetInstanceId()) + player->m_InstanceValid = true; + } + + if (!isRaidGroup()) // reset targetIcons for non-raid-groups + { + for (uint8 i = 0; i < TARGETICONCOUNT; ++i) + m_targetIcons[i] = 0; + } + + // insert into the table if we're not a battleground group + if (!isBGGroup()) + CharacterDatabase.PExecute("INSERT INTO group_member (guid, memberGuid, memberFlags, subgroup, roles) VALUES(%u, %u, %u, %u, %u)", + m_storageId, GUID_LOPART(member.guid), member.flags, member.group, member.roles); SendUpdate(); - sScriptMgr->OnGroupAddMember(this, guid); + sScriptMgr->OnGroupAddMember(this, player->GetGUID()); - Player *player = sObjectMgr->GetPlayer(guid); if (player) { if (!IsLeader(player->GetGUID()) && !isBGGroup()) @@ -361,26 +386,36 @@ bool Group::AddMember(const uint64 &guid, const char* name) return true; } -uint32 Group::RemoveMember(const uint64 &guid, const RemoveMethod &method /* = GROUP_REMOVEMETHOD_DEFAULT */, uint64 kicker /* = 0 */, const char* reason /* = NULL */) +bool Group::RemoveMember(const uint64 &guid, const RemoveMethod &method /*= GROUP_REMOVEMETHOD_DEFAULT*/, uint64 kicker /*= 0*/, const char* reason /*= NULL*/) { BroadcastGroupUpdate(); sScriptMgr->OnGroupRemoveMember(this, guid, method, kicker, reason); - // Lfg group vote kick handled in scripts + // LFG group vote kick handled in scripts if (isLFGGroup() && method == GROUP_REMOVEMETHOD_KICK) return m_memberSlots.size(); // remove member and change leader (if need) only if strong more 2 members _before_ member remove (BG allow 1 member group) if (GetMembersCount() > (isBGGroup() ? 1u : 2u)) { - bool leaderChanged = _removeMember(guid); - - if (Player *player = sObjectMgr->GetPlayer(guid)) + Player *player = sObjectMgr->GetPlayer(guid); + if (player) { - // quest related GO state dependent from raid membership - if (isRaidGroup()) + // Battleground group handling + if (isBGGroup()) + player->RemoveFromBattlegroundRaid(); + else + // Regular group + { + if (player->GetOriginalGroup() == this) + player->SetOriginalGroup(NULL); + else + player->SetGroup(NULL); + + // quest related GO state dependent from raid membership player->UpdateForQuestWorldObjects(); + } WorldPacket data; @@ -390,50 +425,128 @@ uint32 Group::RemoveMember(const uint64 &guid, const RemoveMethod &method /* = G player->GetSession()->SendPacket(&data); } - //we already removed player from group and in player->GetGroup() is his original group! - if (Group* group = player->GetGroup()) - group->SendUpdate(); - else - { - data.Initialize(SMSG_GROUP_LIST, 1+1+1+1+8+4+4+8); - data << uint8(0x10) << uint8(0) << uint8(0) << uint8(0); - data << uint64(m_guid) << uint32(m_counter) << uint32(0) << uint64(0); - player->GetSession()->SendPacket(&data); - } + // Do we really need to send this opcode? + data.Initialize(SMSG_GROUP_LIST, 1+1+1+1+8+4+4+8); + data << uint8(0x10) << uint8(0) << uint8(0) << uint8(0); + data << uint64(m_guid) << uint32(m_counter) << uint32(0) << uint64(0); + player->GetSession()->SendPacket(&data); _homebindIfInstance(player); } - if (leaderChanged) + // Remove player from group in DB + CharacterDatabase.PExecute("DELETE FROM group_member WHERE memberGuid=%u", GUID_LOPART(guid)); + + // Reevaluate group enchanter if the leaving player had enchanting skill or the player is offline + if (player && player->GetSkillValue(SKILL_ENCHANTING) || !player) + ResetMaxEnchantingLevel(); + + // Remove player from loot rolls + for (Rolls::iterator it = RollId.begin(); it != RollId.end(); ++it) { - WorldPacket data(SMSG_GROUP_SET_LEADER, (m_memberSlots.front().name.size()+1)); - data << m_memberSlots.front().name; - BroadcastPacket(&data, true); + Roll* roll = *it; + Roll::PlayerVote::iterator itr2 = roll->playerVote.find(guid); + if (itr2 == roll->playerVote.end()) + continue; + + if (itr2->second == GREED || itr2->second == DISENCHANT) + --roll->totalGreed; + else if (itr2->second == NEED) + --roll->totalNeed; + else if (itr2->second == PASS) + --roll->totalPass; + + if (itr2->second != NOT_VALID) + --roll->totalPlayersRolling; + + roll->playerVote.erase(itr2); + + CountRollVote(guid, roll->itemGUID, GetMembersCount()-1, MAX_ROLL_TYPE); + } + + // Update subgroups + member_witerator slot = _getMemberWSlot(guid); + if (slot != m_memberSlots.end()) + { + SubGroupCounterDecrease(slot->group); + m_memberSlots.erase(slot); + } + + // Pick new leader if necessary + if (m_leaderGuid == guid) + { + for (member_witerator itr = m_memberSlots.begin(); itr != m_memberSlots.end(); ++itr) + { + if (sObjectMgr->GetPlayer(itr->guid)) + { + ChangeLeader(itr->guid); + break; + } + } } SendUpdate(); - ResetMaxEnchantingLevel(); + + return true; } - // if group before remove <= 2 disband it + // If group size before player removal <= 2 then disband it else + { Disband(); - - return m_memberSlots.size(); + return false; + } } void Group::ChangeLeader(const uint64 &guid) { - member_citerator slot = _getMemberCSlot(guid); + member_witerator slot = _getMemberWSlot(guid); if (slot == m_memberSlots.end()) return; - _setLeader(guid); + Player *player = sObjectMgr->GetPlayer(slot->guid); + + // Don't allow switching leader to offline players + if (!player) + return; + + sScriptMgr->OnGroupChangeLeader(this, m_leaderGuid, guid); + + if (!isBGGroup()) + { + // Remove the groups permanent instance bindings + for (uint8 i = 0; i < MAX_DIFFICULTY; ++i) + { + for (BoundInstancesMap::iterator itr = m_boundInstances[i].begin(); itr != m_boundInstances[i].end();) + { + if (itr->second.perm) + { + itr->second.save->RemoveGroup(this); + m_boundInstances[i].erase(itr++); + } + else + ++itr; + } + } + + // Same in the database + CharacterDatabase.PExecute("DELETE FROM group_instance WHERE guid=%u AND (permanent = 1 OR instance IN (SELECT instance FROM character_instance WHERE guid = '%u'))", + m_storageId, player->GetGUIDLow()); + + // Copy the permanent binds from the new leader to the group + Player::ConvertInstancesToGroup(player, this, true); + + // update the group leader + CharacterDatabase.PExecute("UPDATE groups SET leaderGuid='%u' WHERE guid='%u'", player->GetGUIDLow(), m_storageId); + } + + m_leaderGuid = player->GetGUID(); + m_leaderName = player->GetName(); + ToggleGroupMemberFlag(slot, MEMBER_FLAG_ASSISTANT, false); - WorldPacket data(SMSG_GROUP_SET_LEADER, slot->name.size()+1); + WorldPacket data(SMSG_GROUP_SET_LEADER, m_leaderName.size()+1); data << slot->name; BroadcastPacket(&data, true); - SendUpdate(); } void Group::Disband(bool hideDestroy /* = false */) @@ -496,18 +609,18 @@ void Group::Disband(bool hideDestroy /* = false */) if (!isBGGroup()) { - uint32 lowguid = GUID_LOPART(m_guid); SQLTransaction trans = CharacterDatabase.BeginTransaction(); - trans->PAppend("DELETE FROM groups WHERE guid=%u", lowguid); - trans->PAppend("DELETE FROM group_member WHERE guid=%u", lowguid); + trans->PAppend("DELETE FROM groups WHERE guid = %u", m_storageId); + trans->PAppend("DELETE FROM group_member WHERE guid = %u", m_storageId); CharacterDatabase.CommitTransaction(trans); ResetInstances(INSTANCE_RESET_GROUP_DISBAND, false, NULL); ResetInstances(INSTANCE_RESET_GROUP_DISBAND, true, NULL); + + sObjectMgr->FreeGroupStorageId(this); } - m_guid = 0; - m_leaderGuid = 0; - m_leaderName = ""; + sObjectMgr->RemoveGroup(this); + delete this; } /*********************************************************/ @@ -805,7 +918,7 @@ void Group::NeedBeforeGreed(Loot *loot, WorldObject* pLootedObject) void Group::MasterLoot(Loot* /*loot*/, WorldObject* pLootedObject) { - sLog->outDebug("Group::MasterLoot (SMSG_LOOT_MASTER_LIST, 330)"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Group::MasterLoot (SMSG_LOOT_MASTER_LIST, 330)"); uint32 real_count = 0; @@ -1048,28 +1161,6 @@ void Group::SetTargetIcon(uint8 id, uint64 whoGuid, uint64 targetGuid) BroadcastPacket(&data, true); } -void Group::GetDataForXPAtKill(Unit const* victim, uint32& count,uint32& sum_level, Player* & member_with_max_level, Player* & not_gray_member_with_max_level) -{ - for (GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next()) - { - Player* member = itr->getSource(); - if (!member || !member->isAlive()) // only for alive - continue; - - if (!member->IsAtGroupRewardDistance(victim)) // at req. distance - continue; - - ++count; - sum_level += member->getLevel(); - if (!member_with_max_level || member_with_max_level->getLevel() < member->getLevel()) - member_with_max_level = member; - - uint32 gray_level = Trinity::XP::GetGrayLevel(member->getLevel()); - if (victim->getLevel() > gray_level && (!not_gray_member_with_max_level || not_gray_member_with_max_level->getLevel() < member->getLevel())) - not_gray_member_with_max_level = member; - } -} - void Group::SendTargetIconList(WorldSession *session) { if (!session) @@ -1203,199 +1294,6 @@ void Group::OfflineReadyCheck() } } -bool Group::_addMember(const uint64 &guid, const char* name) -{ - // get first not-full group - uint8 groupid = 0; - if (m_subGroupsCounts) - { - bool groupFound = false; - for (; groupid < MAX_RAID_SUBGROUPS; ++groupid) - { - if (m_subGroupsCounts[groupid] < MAXGROUPSIZE) - { - groupFound = true; - break; - } - } - // We are raid group and no one slot is free - if (!groupFound) - return false; - } - - return _addMember(guid, name, groupid); -} - -bool Group::_addMember(const uint64 &guid, const char* name, uint8 group) -{ - if (IsFull()) - return false; - - if (!guid) - return false; - - Player *player = sObjectMgr->GetPlayer(guid); - - MemberSlot member; - member.guid = guid; - member.name = name; - member.group = group; - member.flags = 0; - member.roles = 0; - m_memberSlots.push_back(member); - - SubGroupCounterIncrease(group); - - if (player) - { - player->SetGroupInvite(NULL); - if (player->GetGroup() && isBGGroup()) //if player is in group and he is being added to BG raid group, then call SetBattlegroundRaid() - player->SetBattlegroundRaid(this, group); - else if (player->GetGroup()) //if player is in bg raid and we are adding him to normal group, then call SetOriginalGroup() - player->SetOriginalGroup(this, group); - else //if player is not in group, then call set group - player->SetGroup(this, group); - - // if the same group invites the player back, cancel the homebind timer - InstanceGroupBind *bind = GetBoundInstance(player); - if (bind && bind->save->GetInstanceId() == player->GetInstanceId()) - player->m_InstanceValid = true; - } - - if (!isRaidGroup()) // reset targetIcons for non-raid-groups - { - for (uint8 i = 0; i < TARGETICONCOUNT; ++i) - m_targetIcons[i] = 0; - } - - // insert into the table if we're not a battleground group - if (!isBGGroup()) - CharacterDatabase.PExecute("INSERT INTO group_member (guid, memberGuid, memberFlags, subgroup, roles) VALUES(%u, %u, %u, %u, %u)", GUID_LOPART(m_guid), GUID_LOPART(member.guid), member.flags, member.group, member.roles); - - return true; -} - -bool Group::_removeMember(const uint64 &guid) -{ - Player *player = sObjectMgr->GetPlayer(guid); - if (player) - { - //if we are removing player from battleground raid - if (isBGGroup()) - player->RemoveFromBattlegroundRaid(); - else - { - //we can remove player who is in battleground from his original group - if (player->GetOriginalGroup() == this) - player->SetOriginalGroup(NULL); - else - player->SetGroup(NULL); - } - } - - _removeRolls(guid); - - member_witerator slot = _getMemberWSlot(guid); - if (slot != m_memberSlots.end()) - { - SubGroupCounterDecrease(slot->group); - m_memberSlots.erase(slot); - } - - if (!isBGGroup()) - CharacterDatabase.PExecute("DELETE FROM group_member WHERE memberGuid=%u", GUID_LOPART(guid)); - - if (m_leaderGuid == guid) // leader was removed - { - if (GetMembersCount() > 0) - _setLeader(m_memberSlots.front().guid); - return true; - } - - return false; -} - -void Group::_setLeader(const uint64 &guid) -{ - member_witerator slot = _getMemberWSlot(guid); - if (slot == m_memberSlots.end()) - return; - - sScriptMgr->OnGroupChangeLeader(this, m_leaderGuid, guid); - - if (!isBGGroup()) - { - // TODO: set a time limit to have this function run rarely cause it can be slow - SQLTransaction trans = CharacterDatabase.BeginTransaction(); - - // update the group's bound instances when changing leaders - // remove all permanent binds from the group - // in the DB also remove solo binds that will be replaced with permbinds - // from the new leader - trans->PAppend( - "DELETE FROM group_instance WHERE guid=%u AND (permanent = 1 OR " - "instance IN (SELECT instance FROM character_instance WHERE guid = '%u')" - ")", GUID_LOPART(m_guid), GUID_LOPART(slot->guid) - ); - - Player *player = sObjectMgr->GetPlayer(slot->guid); - if (player) - { - for (uint8 i = 0; i < MAX_DIFFICULTY; ++i) - { - for (BoundInstancesMap::iterator itr = m_boundInstances[i].begin(); itr != m_boundInstances[i].end();) - { - if (itr->second.perm) - { - itr->second.save->RemoveGroup(this); - m_boundInstances[i].erase(itr++); - } - else - ++itr; - } - } - } - - // copy the permanent binds from the new leader to the group - // overwriting the solo binds with permanent ones if necessary - // in the DB those have been deleted already - Player::ConvertInstancesToGroup(player, this, slot->guid); - - // update the group leader - trans->PAppend("UPDATE groups SET leaderGuid='%u' WHERE guid='%u'", GUID_LOPART(slot->guid), GUID_LOPART(m_guid)); - CharacterDatabase.CommitTransaction(trans); - } - - m_leaderGuid = slot->guid; - m_leaderName = slot->name; - ToggleGroupMemberFlag(slot, MEMBER_FLAG_ASSISTANT, false); -} - -void Group::_removeRolls(const uint64 &guid) -{ - for (Rolls::iterator it = RollId.begin(); it != RollId.end(); ++it) - { - Roll* roll = *it; - Roll::PlayerVote::iterator itr2 = roll->playerVote.find(guid); - if (itr2 == roll->playerVote.end()) - continue; - - if (itr2->second == GREED || itr2->second == DISENCHANT) - --roll->totalGreed; - else if (itr2->second == NEED) - --roll->totalNeed; - else if (itr2->second == PASS) - --roll->totalPass; - - if (itr2->second != NOT_VALID) - --roll->totalPlayersRolling; - - roll->playerVote.erase(itr2); - - CountRollVote(guid, roll->itemGUID, GetMembersCount()-1, MAX_ROLL_TYPE); - } -} - bool Group::_setMembersGroup(const uint64 &guid, const uint8 &group) { member_witerator slot = _getMemberWSlot(guid); @@ -1412,50 +1310,6 @@ bool Group::_setMembersGroup(const uint64 &guid, const uint8 &group) return true; } -bool Group::_setAssistantFlag(const uint64 &guid, const bool &apply) -{ - member_witerator slot = _getMemberWSlot(guid); - if (slot == m_memberSlots.end()) - return false; - - ToggleGroupMemberFlag(slot, MEMBER_FLAG_ASSISTANT, apply); - - if (!isBGGroup()) - CharacterDatabase.PExecute("UPDATE group_member SET memberFlags='%u' WHERE memberGuid='%u'", slot->flags, GUID_LOPART(guid)); - - return true; -} - -bool Group::_setMainTank(const uint64 &guid, const bool &apply) -{ - member_witerator slot = _getMemberWSlot(guid); // First check member slots to see if the target exists - if (slot == m_memberSlots.end()) - return false; - - RemoveUniqueGroupMemberFlag(MEMBER_FLAG_MAINTANK); // Remove main tank flag from current if any. - ToggleGroupMemberFlag(slot, MEMBER_FLAG_MAINTANK, apply); // And apply main tank flag on new main tank. - - if (!isBGGroup()) - CharacterDatabase.PExecute("UPDATE group_member SET memberFlags='%u' WHERE memberGuid='%u'", slot->flags, GUID_LOPART(guid)); - - return true; -} - -bool Group::_setMainAssistant(const uint64 &guid, const bool &apply) -{ - member_witerator slot = _getMemberWSlot(guid); - if (slot == m_memberSlots.end()) - return false; - - RemoveUniqueGroupMemberFlag(MEMBER_FLAG_MAINASSIST); // Remove main assist flag from current if any. - ToggleGroupMemberFlag(slot, MEMBER_FLAG_MAINASSIST, apply); // Apply main assist flag on new main assist. - - if (!isBGGroup()) - CharacterDatabase.PExecute("UPDATE group_member SET memberFlags='%u' WHERE memberGuid='%u'", slot->flags, GUID_LOPART(guid)); - - return true; -} - bool Group::SameSubGroup(Player const* member1, Player const* member2) const { if (!member1 || !member2) @@ -1466,55 +1320,53 @@ bool Group::SameSubGroup(Player const* member1, Player const* member2) const return member1->GetSubGroup() == member2->GetSubGroup(); } -// allows setting subgroup for offline members +// Allows setting sub groups both for online or offline members void Group::ChangeMembersGroup(const uint64 &guid, const uint8 &group) { + // Only raid groups have sub groups if (!isRaidGroup()) return; - Player *player = sObjectMgr->GetPlayer(guid); - - if (!player) - { - uint8 prevSubGroup = GetMemberGroup(guid); - if (prevSubGroup == group) - return; - - if (_setMembersGroup(guid, group)) - { - SubGroupCounterDecrease(prevSubGroup); - SendUpdate(); - } - } - else - // This methods handles itself groupcounter decrease - ChangeMembersGroup(player, group); -} - -// only for online members -void Group::ChangeMembersGroup(Player *player, const uint8 &group) -{ - if (!player || !isRaidGroup()) + // Check if player is really in the raid + member_witerator slot = _getMemberWSlot(guid); + if (slot == m_memberSlots.end()) return; - uint8 prevSubGroup = player->GetSubGroup(); + // Abort if the player is already in the target sub group + uint8 prevSubGroup = GetMemberGroup(guid); if (prevSubGroup == group) return; - if (_setMembersGroup(player->GetGUID(), group)) + // Update the player slot with the new sub group setting + slot->group = group; + + // Increase the counter of the new sub group.. + SubGroupCounterIncrease(group); + + // ..and decrease the counter of the previous one + SubGroupCounterDecrease(prevSubGroup); + + // Preserve new sub group in database for non-raid groups + if (!isBGGroup()) + CharacterDatabase.PExecute("UPDATE group_member SET subgroup='%u' WHERE memberGuid='%u'", group, GUID_LOPART(guid)); + + Player *player = sObjectMgr->GetPlayer(guid); + + // In case the moved player is online, update the player object with the new sub group references + if (player) { if (player->GetGroup() == this) player->GetGroupRef().setSubGroup(group); else { - //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 + // 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 prevSubGroup = player->GetOriginalSubGroup(); player->GetOriginalGroupRef().setSubGroup(group); } - - SubGroupCounterDecrease(prevSubGroup); - SendUpdate(); } + + // Broadcast the changes to the group + SendUpdate(); } // Retrieve the next Round-Roubin player for the group @@ -1686,7 +1538,7 @@ void Group::SetDungeonDifficulty(Difficulty difficulty) { m_dungeonDifficulty = difficulty; if (!isBGGroup()) - CharacterDatabase.PExecute("UPDATE groups SET difficulty = %u WHERE guid ='%u'", m_dungeonDifficulty, GUID_LOPART(m_guid)); + CharacterDatabase.PExecute("UPDATE groups SET difficulty = %u WHERE guid ='%u'", m_dungeonDifficulty, m_storageId); for (GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next()) { @@ -1703,7 +1555,7 @@ void Group::SetRaidDifficulty(Difficulty difficulty) { m_raidDifficulty = difficulty; if (!isBGGroup()) - CharacterDatabase.PExecute("UPDATE groups SET raiddifficulty = %u WHERE guid ='%u'", m_raidDifficulty, GUID_LOPART(m_guid)); + CharacterDatabase.PExecute("UPDATE groups SET raiddifficulty = %u WHERE guid ='%u'", m_raidDifficulty, m_storageId); for (GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next()) { @@ -1837,7 +1689,6 @@ InstanceGroupBind* Group::GetBoundInstance(MapEntry const* mapEntry) return NULL; } - InstanceGroupBind* Group::BindToInstance(InstanceSave *save, bool permanent, bool load) { if (!save || isBGGroup()) @@ -1845,7 +1696,7 @@ InstanceGroupBind* Group::BindToInstance(InstanceSave *save, bool permanent, boo InstanceGroupBind& bind = m_boundInstances[save->GetDifficulty()][save->GetMapId()]; if (!load && (!bind.save || permanent != bind.perm || save != bind.save)) - CharacterDatabase.PExecute("REPLACE INTO group_instance (guid, instance, permanent) VALUES (%u, %u, %u)", GUID_LOPART(GetGUID()), save->GetInstanceId(), permanent); + CharacterDatabase.PExecute("REPLACE INTO group_instance (guid, instance, permanent) VALUES (%u, %u, %u)", m_storageId, save->GetInstanceId(), permanent); if (bind.save != save) { @@ -1857,7 +1708,9 @@ InstanceGroupBind* Group::BindToInstance(InstanceSave *save, bool permanent, boo bind.save = save; bind.perm = permanent; if (!load) - sLog->outDebug("Group::BindToInstance: %d is now bound to map %d, instance %d, difficulty %d", GUID_LOPART(GetGUID()), save->GetMapId(), save->GetInstanceId(), save->GetDifficulty()); + sLog->outDebug(LOG_FILTER_MAPS, "Group::BindToInstance: Group (guid: %u, storage id: %u) is now bound to map %d, instance %d, difficulty %d", + GUID_LOPART(GetGUID()), m_storageId, save->GetMapId(), save->GetInstanceId(), save->GetDifficulty()); + return &bind; } @@ -1867,7 +1720,7 @@ void Group::UnbindInstance(uint32 mapid, uint8 difficulty, bool unload) if (itr != m_boundInstances[difficulty].end()) { if (!unload) - CharacterDatabase.PExecute("DELETE FROM group_instance WHERE guid=%u AND instance=%u", GUID_LOPART(GetGUID()), itr->second.save->GetInstanceId()); + CharacterDatabase.PExecute("DELETE FROM group_instance WHERE guid=%u AND instance=%u", m_storageId, itr->second.save->GetInstanceId()); itr->second.save->RemoveGroup(this); // save can become invalid m_boundInstances[difficulty].erase(itr); } @@ -2068,31 +1921,39 @@ void Group::SetBattlegroundGroup(Battleground *bg) m_bgGroup = bg; } -void Group::SetAssistant(uint64 guid, const bool &apply) +void Group::SetGroupMemberFlag(uint64 guid, const bool &apply, GroupMemberFlags flag) { + // Assistants, main assistants and main tanks are only available in raid groups if (!isRaidGroup()) return; - if (_setAssistantFlag(guid, apply)) - SendUpdate(); -} - -void Group::SetMainTank(uint64 guid, const bool &apply) -{ - if (!isRaidGroup()) + // Check if player is really in the raid + member_witerator slot = _getMemberWSlot(guid); + if (slot == m_memberSlots.end()) return; - if (_setMainTank(guid, apply)) - SendUpdate(); -} + // Do flag specific actions, e.g ensure uniqueness + switch (flag) { + case MEMBER_FLAG_MAINASSIST: + RemoveUniqueGroupMemberFlag(MEMBER_FLAG_MAINASSIST); // Remove main assist flag from current if any. + break; + case MEMBER_FLAG_MAINTANK: + RemoveUniqueGroupMemberFlag(MEMBER_FLAG_MAINTANK); // Remove main tank flag from current if any. + break; + case MEMBER_FLAG_ASSISTANT: + break; + default: + return; // This should never happen + } -void Group::SetMainAssistant(uint64 guid, const bool &apply) -{ - if (!isRaidGroup()) - return; + // Switch the actual flag + ToggleGroupMemberFlag(slot, flag, apply); - if (_setMainAssistant(guid, apply)) - SendUpdate(); + // Preserve the new setting in the db + CharacterDatabase.PExecute("UPDATE group_member SET memberFlags='%u' WHERE memberGuid='%u'", slot->flags, GUID_LOPART(guid)); + + // Broadcast the changes to the group + SendUpdate(); } Difficulty Group::GetDifficulty(bool isRaid) const diff --git a/src/server/game/Groups/Group.h b/src/server/game/Groups/Group.h index d7fb7c7530df3..636efd7ca86d8 100755 --- a/src/server/game/Groups/Group.h +++ b/src/server/game/Groups/Group.h @@ -73,6 +73,12 @@ enum GroupMemberFlags MEMBER_FLAG_MAINASSIST = 0x04, }; +enum GroupMemberAssignment +{ + GROUP_ASSIGN_MAINTANK = 0, + GROUP_ASSIGN_MAINASSIST = 1, +}; + enum GroupType { GROUPTYPE_NORMAL = 0x00, @@ -176,15 +182,15 @@ class Group ~Group(); // group manipulation methods - bool Create(const uint64 &guid, const char * name); - bool LoadGroupFromDB(const uint32 &guid, QueryResult result, bool loadMembers = true); - bool LoadMemberFromDB(uint32 guidLow, uint8 memberFlags, uint8 subgroup, uint8 roles); + bool Create(Player *leader); + void LoadGroupFromDB(Field *field); + void LoadMemberFromDB(uint32 guidLow, uint8 memberFlags, uint8 subgroup, uint8 roles); bool AddInvite(Player *player); void RemoveInvite(Player *player); void RemoveAllInvites(); bool AddLeaderInvite(Player *player); - bool AddMember(const uint64 &guid, const char* name); - uint32 RemoveMember(const uint64 &guid, const RemoveMethod &method = GROUP_REMOVEMETHOD_DEFAULT, uint64 kicker = 0, const char* reason = NULL); + bool AddMember(Player *player); + bool RemoveMember(const uint64 &guid, const RemoveMethod &method = GROUP_REMOVEMETHOD_DEFAULT, uint64 kicker = 0, const char* reason = NULL); void ChangeLeader(const uint64 &guid); void SetLootMethod(LootMethod method); void SetLooterGuid(const uint64 &guid); @@ -207,6 +213,8 @@ class Group const uint64& GetLooterGuid() const; ItemQualities GetLootThreshold() const; + uint32 GetStorageId() { return m_storageId; }; + // member manipulation methods bool IsMember(const uint64& guid) const; bool IsLeader(const uint64& guid) const; @@ -224,7 +232,6 @@ class Group MemberSlotList const& GetMemberSlots() const; GroupReference* GetFirstMember(); uint32 GetMembersCount() const; - void GetDataForXPAtKill(Unit const* victim, uint32& count,uint32& sum_level, Player* & member_with_max_level, Player* & not_gray_member_with_max_level); uint8 GetMemberGroup(uint64 guid) const; void ConvertToLFG(); @@ -235,10 +242,9 @@ class Group void ChangeMembersGroup(const uint64 &guid, const uint8 &group); void ChangeMembersGroup(Player *player, const uint8 &group); - void SetAssistant(uint64 guid, const bool &apply); - void SetMainTank(uint64 guid, const bool &apply); - void SetMainAssistant(uint64 guid, const bool &apply); void SetTargetIcon(uint8 id, uint64 whoGuid, uint64 targetGuid); + void SetGroupMemberFlag(uint64 guid, const bool &apply, GroupMemberFlags flag); + void RemoveUniqueGroupMemberFlag(GroupMemberFlags flag); Difficulty GetDifficulty(bool isRaid) const; Difficulty GetDungeonDifficulty() const; @@ -294,18 +300,7 @@ class Group void BroadcastGroupUpdate(void); protected: - bool _addMember(const uint64 &guid, const char* name); - bool _addMember(const uint64 &guid, const char* name, uint8 group); - bool _removeMember(const uint64 &guid); // returns true if leader has changed - void _setLeader(const uint64 &guid); - - void _removeRolls(const uint64 &guid); - bool _setMembersGroup(const uint64 &guid, const uint8 &group); - bool _setAssistantFlag(const uint64 &guid, const bool &apply); - bool _setMainTank(const uint64 &guid, const bool &apply); - bool _setMainAssistant(const uint64 &guid, const bool &apply); - void _homebindIfInstance(Player *player); void _initRaidSubGroupsCounter(); @@ -313,7 +308,6 @@ class Group member_witerator _getMemberWSlot(uint64 Guid); void SubGroupCounterIncrease(uint8 subgroup); void SubGroupCounterDecrease(uint8 subgroup); - void RemoveUniqueGroupMemberFlag(GroupMemberFlags flag); void ToggleGroupMemberFlag(member_witerator slot, uint8 flag, bool apply); MemberSlotList m_memberSlots; @@ -335,5 +329,6 @@ class Group uint64 m_guid; uint32 m_counter; // used only in SMSG_GROUP_LIST uint32 m_maxEnchantingLevel; + uint32 m_storageId; // Represents the ID used in database (Can be reused by other groups if group was disbanded) }; #endif diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index 9e11e3507af14..93a7392e50e83 100755 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -49,7 +49,7 @@ void Guild::SendCommandResult(WorldSession* session, GuildCommandType type, Guil data << uint32(errCode); session->SendPacket(&data); - sLog->outDebug("WORLD: Sent (SMSG_GUILD_COMMAND_RESULT)"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent (SMSG_GUILD_COMMAND_RESULT)"); } void Guild::SendSaveEmblemResult(WorldSession* session, GuildEmblemError errCode) @@ -58,7 +58,7 @@ void Guild::SendSaveEmblemResult(WorldSession* session, GuildEmblemError errCode data << uint32(errCode); session->SendPacket(&data); - sLog->outDebug("WORLD: Sent (MSG_SAVE_GUILD_EMBLEM)"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent (MSG_SAVE_GUILD_EMBLEM)"); } /////////////////////////////////////////////////////////////////////////////// @@ -198,7 +198,7 @@ void Guild::BankEventLogEntry::WritePacket(WorldPacket& data) const /////////////////////////////////////////////////////////////////////////////// // RankInfo -bool Guild::RankInfo::LoadFromDB(Field* fields) +void Guild::RankInfo::LoadFromDB(Field* fields) { m_rankId = fields[1].GetUInt8(); m_name = fields[2].GetString(); @@ -206,7 +206,6 @@ bool Guild::RankInfo::LoadFromDB(Field* fields) m_bankMoneyPerDay = fields[4].GetUInt32(); if (m_rankId == GR_GUILDMASTER) // Prevent loss of leader rights m_rights |= GR_RIGHT_ALL; - return true; } void Guild::RankInfo::SaveToDB(SQLTransaction& trans) const @@ -264,7 +263,7 @@ void Guild::RankInfo::SetRights(uint32 rights) void Guild::RankInfo::SetBankMoneyPerDay(uint32 money) { if (m_rankId == GR_GUILDMASTER) // Prevent loss of leader rights - money = GUILD_WITHDRAW_MONEY_UNLIMITED; + money = uint32(GUILD_WITHDRAW_MONEY_UNLIMITED); if (m_bankMoneyPerDay == money) return; @@ -802,7 +801,7 @@ bool Guild::PlayerMoveItemData::InitItem() if (m_pItem) { // Anti-WPE protection. Do not move non-empty bags to bank. - if (m_pItem->IsBag() && !((Bag*)m_pItem)->IsEmpty()) + if (m_pItem->IsNotEmptyBag()) { m_pPlayer->SendEquipError(EQUIP_ERR_CAN_ONLY_DO_WITH_EMPTY_BAGS, m_pItem); m_pItem = NULL; @@ -914,7 +913,7 @@ Item* Guild::BankMoveItemData::StoreItem(SQLTransaction& trans, Item* pItem) ItemPosCount pos(*itr); ++itr; - sLog->outDebug("GUILD STORAGE: StoreItem tab = %u, slot = %u, item = %u, count = %u", + sLog->outDebug(LOG_FILTER_GUILD, "GUILD STORAGE: StoreItem tab = %u, slot = %u, item = %u, count = %u", m_container, m_slotId, pItem->GetEntry(), pItem->GetCount()); pLastItem = _StoreItem(trans, pTab, pItem, pos, itr != m_vec.end()); } @@ -1023,7 +1022,7 @@ void Guild::BankMoveItemData::_CanStoreItemInTab(Item* pItem, uint8 skipSlotId, uint8 Guild::BankMoveItemData::_CanStore(Item* pItem, bool swap) { - sLog->outDebug("GUILD STORAGE: CanStore() tab = %u, slot = %u, item = %u, count = %u", + sLog->outDebug(LOG_FILTER_GUILD, "GUILD STORAGE: CanStore() tab = %u, slot = %u, item = %u, count = %u", m_container, m_slotId, pItem->GetEntry(), pItem->GetCount()); uint32 count = pItem->GetCount(); @@ -1109,7 +1108,7 @@ bool Guild::Create(Player* pLeader, const std::string& name) m_createdDate = ::time(NULL); _CreateLogHolders(); - sLog->outDebug("GUILD: creating guild [%s] for leader %s (%u)", + sLog->outDebug(LOG_FILTER_GUILD, "GUILD: creating guild [%s] for leader %s (%u)", name.c_str(), pLeader->GetName(), GUID_LOPART(m_leaderGuid)); PreparedStatement* stmt = NULL; @@ -1219,7 +1218,7 @@ void Guild::HandleRoster(WorldSession *session /*= NULL*/) session->SendPacket(&data); else BroadcastPacket(&data); - sLog->outDebug("WORLD: Sent (SMSG_GUILD_ROSTER)"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent (SMSG_GUILD_ROSTER)"); } void Guild::HandleQuery(WorldSession *session) @@ -1241,7 +1240,7 @@ void Guild::HandleQuery(WorldSession *session) data << uint32(0); // Something new in WotLK session->SendPacket(&data); - sLog->outDebug("WORLD: Sent (SMSG_GUILD_QUERY_RESPONSE)"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent (SMSG_GUILD_QUERY_RESPONSE)"); } void Guild::HandleSetMOTD(WorldSession* session, const std::string& motd) @@ -1365,7 +1364,7 @@ void Guild::HandleSetRankInfo(WorldSession* session, uint8 rankId, const std::st SendCommandResult(session, GUILD_INVITE_S, ERR_GUILD_PERMISSIONS); else if (RankInfo* rankInfo = GetRankInfo(rankId)) { - sLog->outDebug("WORLD: Changed RankName to '%s', rights to 0x%08X", name.c_str(), rights); + sLog->outDebug(LOG_FILTER_GUILD, "WORLD: Changed RankName to '%s', rights to 0x%08X", name.c_str(), rights); rankInfo->SetName(name); rankInfo->SetRights(rights); @@ -1397,8 +1396,8 @@ void Guild::HandleBuyBankTab(WorldSession* session, uint8 tabId) return; player->ModifyMoney(-int32(tabCost)); - _SetRankBankMoneyPerDay(player->GetRank(), GUILD_WITHDRAW_MONEY_UNLIMITED); - _SetRankBankTabRightsAndSlots(player->GetRank(), tabId, GuildBankRightsAndSlots(GUILD_BANK_RIGHT_FULL, GUILD_WITHDRAW_SLOT_UNLIMITED)); + _SetRankBankMoneyPerDay(player->GetRank(), uint32(GUILD_WITHDRAW_MONEY_UNLIMITED)); + _SetRankBankTabRightsAndSlots(player->GetRank(), tabId, GuildBankRightsAndSlots(GUILD_BANK_RIGHT_FULL, uint32(GUILD_WITHDRAW_SLOT_UNLIMITED))); HandleRoster(); // Broadcast for tab rights update SendBankTabsInfo(session); } @@ -1440,7 +1439,7 @@ void Guild::HandleInviteMember(WorldSession* session, const std::string& name) return; } - sLog->outDebug("Player %s invited %s to join his Guild", player->GetName(), name.c_str()); + sLog->outDebug(LOG_FILTER_GUILD, "Player %s invited %s to join his Guild", player->GetName(), name.c_str()); pInvitee->SetGuildIdInvited(m_id); _LogEvent(GUILD_EVENT_LOG_INVITE_PLAYER, player->GetGUIDLow(), pInvitee->GetGUIDLow()); @@ -1450,7 +1449,7 @@ void Guild::HandleInviteMember(WorldSession* session, const std::string& name) data << m_name; pInvitee->GetSession()->SendPacket(&data); - sLog->outDebug("WORLD: Sent (SMSG_GUILD_INVITE)"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent (SMSG_GUILD_INVITE)"); } void Guild::HandleAcceptMember(WorldSession* session) @@ -1714,7 +1713,7 @@ void Guild::HandleDisband(WorldSession* session) else { Disband(); - sLog->outDebug("WORLD: Guild Successfully Disbanded"); + sLog->outDebug(LOG_FILTER_GUILD, "WORLD: Guild Successfully Disbanded"); } } @@ -1729,7 +1728,7 @@ void Guild::SendInfo(WorldSession* session) const data << m_accountsNumber; // Number of accounts session->SendPacket(&data); - sLog->outDebug("WORLD: Sent (SMSG_GUILD_INFO)"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent (SMSG_GUILD_INFO)"); } void Guild::SendEventLog(WorldSession *session) const @@ -1737,7 +1736,7 @@ void Guild::SendEventLog(WorldSession *session) const WorldPacket data(MSG_GUILD_EVENT_LOG_QUERY, 1 + m_eventLog->GetSize() * (1 + 8 + 4)); m_eventLog->WritePacket(data); session->SendPacket(&data); - sLog->outDebug("WORLD: Sent (MSG_GUILD_EVENT_LOG_QUERY)"); + sLog->outDebug(LOG_FILTER_GUILD, "WORLD: Sent (MSG_GUILD_EVENT_LOG_QUERY)"); } void Guild::SendBankLog(WorldSession *session, uint8 tabId) const @@ -1750,7 +1749,7 @@ void Guild::SendBankLog(WorldSession *session, uint8 tabId) const data << uint8(tabId); pLog->WritePacket(data); session->SendPacket(&data); - sLog->outDebug("WORLD: Sent (MSG_GUILD_BANK_LOG_QUERY)"); + sLog->outDebug(LOG_FILTER_GUILD, "WORLD: Sent (MSG_GUILD_BANK_LOG_QUERY)"); } } @@ -1779,7 +1778,7 @@ void Guild::SendBankTabsInfo(WorldSession *session) const data << uint8(0); // Do not send tab content session->SendPacket(&data); - sLog->outDebug("WORLD: Sent (SMSG_GUILD_BANK_LIST)"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent (SMSG_GUILD_BANK_LIST)"); } void Guild::SendBankTabText(WorldSession *session, uint8 tabId) const @@ -1805,7 +1804,7 @@ void Guild::SendPermissions(WorldSession *session) const data << uint32(_GetMemberRemainingSlots(guid, tabId)); } session->SendPacket(&data); - sLog->outDebug("WORLD: Sent (MSG_GUILD_PERMISSIONS)"); + sLog->outDebug(LOG_FILTER_GUILD, "WORLD: Sent (MSG_GUILD_PERMISSIONS)"); } void Guild::SendMoneyInfo(WorldSession *session) const @@ -1813,7 +1812,7 @@ void Guild::SendMoneyInfo(WorldSession *session) const WorldPacket data(MSG_GUILD_BANK_MONEY_WITHDRAWN, 4); data << uint32(_GetMemberRemainingMoney(session->GetPlayer()->GetGUID())); session->SendPacket(&data); - sLog->outDebug("WORLD: Sent MSG_GUILD_BANK_MONEY_WITHDRAWN"); + sLog->outDebug(LOG_FILTER_GUILD, "WORLD: Sent MSG_GUILD_BANK_MONEY_WITHDRAWN"); } void Guild::SendLoginInfo(WorldSession* session) const @@ -1823,7 +1822,7 @@ void Guild::SendLoginInfo(WorldSession* session) const data << uint8(1); data << m_motd; session->SendPacket(&data); - sLog->outDebug("WORLD: Sent guild MOTD (SMSG_GUILD_EVENT)"); + sLog->outDebug(LOG_FILTER_GUILD, "WORLD: Sent guild MOTD (SMSG_GUILD_EVENT)"); SendBankTabsInfo(session); @@ -1855,13 +1854,13 @@ bool Guild::LoadFromDB(Field* fields) return true; } -bool Guild::LoadRankFromDB(Field* fields) +void Guild::LoadRankFromDB(Field* fields) { RankInfo rankInfo(m_id); - if (!rankInfo.LoadFromDB(fields)) - return false; + + rankInfo.LoadFromDB(fields); + m_ranks.push_back(rankInfo); - return true; } bool Guild::LoadMemberFromDB(Field* fields) @@ -1878,13 +1877,12 @@ bool Guild::LoadMemberFromDB(Field* fields) return true; } -bool Guild::LoadBankRightFromDB(Field* fields) +void Guild::LoadBankRightFromDB(Field* fields) { // rights slots GuildBankRightsAndSlots rightsAndSlots(fields[3].GetUInt8(), fields[4].GetUInt32()); // rankId tabId _SetRankBankTabRightsAndSlots(fields[2].GetUInt8(), fields[1].GetUInt8(), rightsAndSlots, false); - return true; } bool Guild::LoadEventLogFromDB(Field* fields) @@ -2648,7 +2646,7 @@ void Guild::_SendBankContent(WorldSession *session, uint8 tabId) const session->SendPacket(&data); - sLog->outDebug("WORLD: Sent (SMSG_GUILD_BANK_LIST)"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent (SMSG_GUILD_BANK_LIST)"); } } @@ -2663,7 +2661,7 @@ void Guild::_SendBankMoneyUpdate(WorldSession *session) const data << uint8(0); // No items BroadcastPacket(&data); - sLog->outDebug("WORLD: Sent (SMSG_GUILD_BANK_LIST)"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent (SMSG_GUILD_BANK_LIST)"); } void Guild::_SendBankContentUpdate(MoveItemData* pSrc, MoveItemData* pDest) const @@ -2723,7 +2721,7 @@ void Guild::_SendBankContentUpdate(uint8 tabId, SlotIds slots) const player->GetSession()->SendPacket(&data); } - sLog->outDebug("WORLD: Sent (SMSG_GUILD_BANK_LIST)"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent (SMSG_GUILD_BANK_LIST)"); } } @@ -2747,5 +2745,5 @@ void Guild::_BroadcastEvent(GuildEvents guildEvent, const uint64& guid, const ch BroadcastPacket(&data); - sLog->outDebug("WORLD: Sent SMSG_GUILD_EVENT"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_GUILD_EVENT"); } diff --git a/src/server/game/Guilds/Guild.h b/src/server/game/Guilds/Guild.h index a115cfacc894d..6865ab09b8300 100755 --- a/src/server/game/Guilds/Guild.h +++ b/src/server/game/Guilds/Guild.h @@ -228,11 +228,11 @@ struct GuildBankRightsAndSlots GuildBankRightsAndSlots() : rights(0), slots(0) { } GuildBankRightsAndSlots(uint8 _rights, uint32 _slots) : rights(_rights), slots(_slots) { } - inline bool IsEqual(const GuildBankRightsAndSlots& rhs) const { return rights == rhs.rights && slots == rhs.slots; } + inline bool IsEqual(GuildBankRightsAndSlots const& rhs) const { return rights == rhs.rights && slots == rhs.slots; } void SetGuildMasterValues() { rights = GUILD_BANK_RIGHT_FULL; - slots = GUILD_WITHDRAW_SLOT_UNLIMITED; + slots = uint32(GUILD_WITHDRAW_SLOT_UNLIMITED); } uint8 rights; @@ -387,7 +387,7 @@ class Guild class LogHolder { public: - LogHolder(uint32 guildId, uint32 maxRecords) : m_guildId(guildId), m_maxRecords(maxRecords), m_nextGUID(GUILD_EVENT_LOG_GUID_UNDEFINED) { } + LogHolder(uint32 guildId, uint32 maxRecords) : m_guildId(guildId), m_maxRecords(maxRecords), m_nextGUID(uint32(GUILD_EVENT_LOG_GUID_UNDEFINED)) { } ~LogHolder(); uint8 GetSize() const { return uint8(m_log.size()); } @@ -417,7 +417,7 @@ class Guild RankInfo(uint32 guildId, uint8 rankId, const std::string& name, uint32 rights, uint32 money) : m_guildId(guildId), m_rankId(rankId), m_name(name), m_rights(rights), m_bankMoneyPerDay(money) { } - bool LoadFromDB(Field* fields); + void LoadFromDB(Field* fields); void SaveToDB(SQLTransaction& trans) const; void WritePacket(WorldPacket& data) const; @@ -631,10 +631,10 @@ class Guild // Load from DB bool LoadFromDB(Field* fields); - bool LoadRankFromDB(Field* fields); + void LoadRankFromDB(Field* fields); bool LoadMemberFromDB(Field* fields); bool LoadEventLogFromDB(Field* fields); - bool LoadBankRightFromDB(Field* fields); + void LoadBankRightFromDB(Field* fields); bool LoadBankTabFromDB(Field* fields); bool LoadBankEventLogFromDB(Field* fields); bool LoadBankItemFromDB(Field* fields); diff --git a/src/server/game/Instances/InstanceSaveMgr.cpp b/src/server/game/Instances/InstanceSaveMgr.cpp index ad385a7334de0..a13c5b79ac657 100755 --- a/src/server/game/Instances/InstanceSaveMgr.cpp +++ b/src/server/game/Instances/InstanceSaveMgr.cpp @@ -106,7 +106,7 @@ InstanceSave* InstanceSaveManager::AddInstanceSave(uint32 mapId, uint32 instance } } - sLog->outDebug("InstanceSaveManager::AddInstanceSave: mapid = %d, instanceid = %d", mapId, instanceId); + sLog->outDebug(LOG_FILTER_MAPS, "InstanceSaveManager::AddInstanceSave: mapid = %d, instanceid = %d", mapId, instanceId); InstanceSave *save = new InstanceSave(mapId, instanceId, difficulty, resetTime, canReset); if (!load) @@ -257,13 +257,10 @@ void InstanceSaveManager::_DelHelper(const char *fields, const char *table, cons } } -void InstanceSaveManager::CleanupAndPackInstances() +void InstanceSaveManager::LoadInstances() { uint32 oldMSTime = getMSTime(); - // load reset times and clean expired instances - sInstanceSaveMgr->LoadResetTimes(); - // Delete invalid character_instance and group_instance references CharacterDatabase.DirectExecute("DELETE ci.* FROM character_instance AS ci LEFT JOIN characters AS c ON ci.guid = c.guid WHERE c.guid IS NULL"); CharacterDatabase.DirectExecute("DELETE gi.* FROM group_instance AS gi LEFT JOIN groups AS g ON gi.guid = g.guid WHERE g.guid IS NULL"); @@ -281,26 +278,13 @@ void InstanceSaveManager::CleanupAndPackInstances() CharacterDatabase.DirectExecute("UPDATE corpse AS tmp LEFT JOIN instance ON tmp.instance = instance.id SET tmp.instance = 0 WHERE tmp.instance > 0 AND instance.id IS NULL"); CharacterDatabase.DirectExecute("UPDATE characters AS tmp LEFT JOIN instance ON tmp.instance_id = instance.id SET tmp.instance_id = 0 WHERE tmp.instance_id > 0 AND instance.id IS NULL"); - // Create new index - CharacterDatabase.DirectExecute("ALTER TABLE instance ADD newid INT UNSIGNED AUTO_INCREMENT, ADD INDEX(newid)"); - - // Update old ids - CharacterDatabase.DirectExecute("UPDATE account_instance_times AS tmp LEFT JOIN instance ON tmp.instanceId = instance.id SET tmp.instanceId = instance.newid WHERE tmp.instanceId > 0 AND instance.newid IS NOT NULL"); // can be null and must not be cleaned! its an "already reset" but still limited case - CharacterDatabase.DirectExecute("UPDATE corpse AS tmp LEFT JOIN instance ON tmp.instance = instance.id SET tmp.instance = instance.newid WHERE tmp.instance > 0"); - CharacterDatabase.DirectExecute("UPDATE character_instance AS tmp LEFT JOIN instance ON tmp.instance = instance.id SET tmp.instance = instance.newid WHERE tmp.instance > 0"); - CharacterDatabase.DirectExecute("UPDATE group_instance AS tmp LEFT JOIN instance ON tmp.instance = instance.id SET tmp.instance = instance.newid WHERE tmp.instance > 0"); - CharacterDatabase.DirectExecute("UPDATE characters AS tmp LEFT JOIN instance ON tmp.instance_id = instance.id SET tmp.instance_id = instance.newid WHERE tmp.instance_id > 0"); - CharacterDatabase.DirectExecute("UPDATE creature_respawn AS tmp LEFT JOIN instance ON tmp.instance = instance.id SET tmp.instance = instance.newid WHERE tmp.instance > 0"); - CharacterDatabase.DirectExecute("UPDATE gameobject_respawn AS tmp LEFT JOIN instance ON tmp.instance = instance.id SET tmp.instance = instance.newid WHERE tmp.instance > 0"); + // Initialize instance id storage (Needs to be done after the trash has been clean out) + sMapMgr->InitInstanceIds(); - // Update instance too - CharacterDatabase.DirectExecute("UPDATE instance SET id = newid"); - - // Finally drop the no longer needed column - CharacterDatabase.DirectExecute("ALTER TABLE instance DROP COLUMN newid"); + // Load reset times and clean expired instances + sInstanceSaveMgr->LoadResetTimes(); - // Bake some cookies for click - sLog->outString(">> Cleaned up and packed instances in %u ms", GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(">> Loaded instances in %u ms", GetMSTimeDiffToNow(oldMSTime)); sLog->outString(); } @@ -322,20 +306,30 @@ void InstanceSaveManager::LoadResetTimes() typedef std::multimap ResetTimeMapDiffInstances; ResetTimeMapDiffInstances mapDiffResetInstances; - QueryResult result = CharacterDatabase.Query("SELECT id, map, difficulty, resettime FROM instance WHERE resettime > 0"); + QueryResult result = CharacterDatabase.Query("SELECT id, map, difficulty, resettime FROM instance ORDER BY id ASC"); if (result) { do { Field* fields = result->Fetch(); + uint32 instanceId = fields[0].GetUInt32(); + + // Instances are pulled in ascending order from db and nextInstanceId is initialized with 1, + // so if the instance id is used, increment until we find the first unused one for a potential new instance + if (sMapMgr->GetNextInstanceId() == instanceId) + sMapMgr->SetNextInstanceId(instanceId + 1); + + // Mark instance id as being used + sMapMgr->RegisterInstanceId(instanceId); + if (time_t resettime = time_t(fields[3].GetUInt32())) { - uint32 id = fields[0].GetUInt32(); uint32 mapid = fields[1].GetUInt16(); uint32 difficulty = fields[2].GetUInt8(); - instResetTime[id] = ResetTimeMapDiffType(MAKE_PAIR32(mapid, difficulty), resettime); - mapDiffResetInstances.insert(ResetTimeMapDiffInstances::value_type(MAKE_PAIR32(mapid, difficulty), id)); + + instResetTime[instanceId] = ResetTimeMapDiffType(MAKE_PAIR32(mapid, difficulty), resettime); + mapDiffResetInstances.insert(ResetTimeMapDiffInstances::value_type(MAKE_PAIR32(mapid, difficulty), instanceId)); } } while (result->NextRow()); @@ -547,7 +541,7 @@ void InstanceSaveManager::_ResetSave(InstanceSaveHashMap::iterator &itr) void InstanceSaveManager::_ResetInstance(uint32 mapid, uint32 instanceId) { - sLog->outDebug("InstanceSaveMgr::_ResetInstance %u, %u", mapid, instanceId); + sLog->outDebug(LOG_FILTER_MAPS, "InstanceSaveMgr::_ResetInstance %u, %u", mapid, instanceId); Map *map = (MapInstanced*)sMapMgr->CreateBaseMap(mapid); if (!map->Instanceable()) return; @@ -564,6 +558,9 @@ void InstanceSaveManager::_ResetInstance(uint32 mapid, uint32 instanceId) ((InstanceMap*)iMap)->Reset(INSTANCE_RESET_RESPAWN_DELAY); else sObjectMgr->DeleteRespawnTimeForInstance(instanceId); // even if map is not loaded + + // Free up the instance id and allow it to be reused + sMapMgr->FreeInstanceId(instanceId); } void InstanceSaveManager::_ResetOrWarnAll(uint32 mapid, Difficulty difficulty, bool warn, time_t resetTime) diff --git a/src/server/game/Instances/InstanceSaveMgr.h b/src/server/game/Instances/InstanceSaveMgr.h index 0c5edc56715bd..b1c685c5a2202 100755 --- a/src/server/game/Instances/InstanceSaveMgr.h +++ b/src/server/game/Instances/InstanceSaveMgr.h @@ -123,7 +123,6 @@ class InstanceSaveManager ~InstanceSaveManager(); typedef UNORDERED_MAP InstanceSaveHashMap; - typedef UNORDERED_MAP InstanceSaveMapMap; /* resetTime is a global propery of each (raid/heroic) map all instances of that map reset at the same time */ @@ -141,7 +140,7 @@ class InstanceSaveManager }; typedef std::multimap ResetTimeQueue; - void CleanupAndPackInstances(); + void LoadInstances(); void LoadResetTimes(); time_t GetResetTimeFor(uint32 mapid, Difficulty d) const diff --git a/src/server/game/Instances/InstanceScript.cpp b/src/server/game/Instances/InstanceScript.cpp index 231d6ab6667ae..eb480c72bcc15 100755 --- a/src/server/game/Instances/InstanceScript.cpp +++ b/src/server/game/Instances/InstanceScript.cpp @@ -46,7 +46,7 @@ void InstanceScript::HandleGameObject(uint64 GUID, bool open, GameObject *go) if (go) go->SetGoState(open ? GO_STATE_ACTIVE : GO_STATE_READY); else - sLog->outDebug("TSCR: InstanceScript: HandleGameObject failed"); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: InstanceScript: HandleGameObject failed"); } bool InstanceScript::IsEncounterInProgress() const @@ -67,7 +67,7 @@ void InstanceScript::LoadMinionData(const MinionData *data) ++data; } - sLog->outDebug("InstanceScript::LoadMinionData: " UI64FMTD " minions loaded.", uint64(minions.size())); + sLog->outDebug(LOG_FILTER_TSCR, "InstanceScript::LoadMinionData: " UI64FMTD " minions loaded.", uint64(minions.size())); } void InstanceScript::LoadDoorData(const DoorData *data) @@ -79,7 +79,7 @@ void InstanceScript::LoadDoorData(const DoorData *data) ++data; } - sLog->outDebug("InstanceScript::LoadDoorData: " UI64FMTD " doors loaded.", uint64(doors.size())); + sLog->outDebug(LOG_FILTER_TSCR, "InstanceScript::LoadDoorData: " UI64FMTD " doors loaded.", uint64(doors.size())); } void InstanceScript::UpdateMinionState(Creature *minion, EncounterState state) @@ -299,7 +299,7 @@ void InstanceScript::DoUpdateWorldState(uint32 uiStateId, uint32 uiStateData) pPlayer->SendUpdateWorldState(uiStateId, uiStateData); } else - sLog->outDebug("TSCR: DoUpdateWorldState attempt send data but no players in map."); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: DoUpdateWorldState attempt send data but no players in map."); } // Send Notify to all players in instance @@ -444,7 +444,7 @@ void InstanceScript::UpdateEncounterState(EncounterCreditType type, uint32 credi if ((*itr)->creditType == type && (*itr)->creditEntry == creditEntry) { completedEncounters |= 1 << (*itr)->dbcEntry->encounterIndex; - sLog->outDebug("Instance %s (instanceId %u) completed encounter %s", instance->GetMapName(), instance->GetInstanceId(), (*itr)->dbcEntry->encounterName[0]); + sLog->outDebug(LOG_FILTER_TSCR, "Instance %s (instanceId %u) completed encounter %s", instance->GetMapName(), instance->GetInstanceId(), (*itr)->dbcEntry->encounterName[0]); if (uint32 dungeonId = (*itr)->lastEncounterDungeon) { Map::PlayerList const& players = instance->GetPlayers(); diff --git a/src/server/game/Instances/InstanceScript.h b/src/server/game/Instances/InstanceScript.h index 2ba81c963a4b7..b6b9cc84d4fcf 100755 --- a/src/server/game/Instances/InstanceScript.h +++ b/src/server/game/Instances/InstanceScript.h @@ -25,10 +25,10 @@ //#include "GameObject.h" //#include "Map.h" -#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_SAVE_INST_DATA sLog->outDebug(LOG_FILTER_TSCR, "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(LOG_FILTER_TSCR, "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(LOG_FILTER_TSCR, "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(LOG_FILTER_TSCR, "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()) class Map; @@ -135,7 +135,7 @@ class InstanceScript : public ZoneScript virtual void Initialize() {} //On load - virtual void Load(const char * data) { LoadBossState(data); } + virtual void Load(char const* data) { LoadBossState(data); } //When save is needed, this function generates the data virtual std::string GetSaveData() { return GetBossSaveData(); } @@ -149,30 +149,30 @@ class InstanceScript : public ZoneScript virtual bool IsEncounterInProgress() const; //Called when a player successfully enters the instance. - virtual void OnPlayerEnter(Player *) {} + virtual void OnPlayerEnter(Player* /*player*/) {} //Handle open / close objects //use HandleGameObject(0, boolen, GO); in OnObjectCreate in instance scripts //use HandleGameObject(GUID, boolen, NULL); in any other script - void HandleGameObject(uint64 GUID, bool open, GameObject *go = NULL); + void HandleGameObject(uint64 guid, bool open, GameObject* go = NULL); //change active state of doors or buttons - void DoUseDoorOrButton(uint64 uiGuid, uint32 uiWithRestoreTime = 0, bool bUseAlternativeState = false); + void DoUseDoorOrButton(uint64 guid, uint32 withRestoreTime = 0, bool useAlternativeState = false); //Respawns a GO having negative spawntimesecs in gameobject-table - void DoRespawnGameObject(uint64 uiGuid, uint32 uiTimeToDespawn = MINUTE); + void DoRespawnGameObject(uint64 guid, uint32 timeToDespawn = MINUTE); //sends world state update to all players in instance - void DoUpdateWorldState(uint32 uiStateId, uint32 uiStateData); + void DoUpdateWorldState(uint32 worldstateId, uint32 worldstateValue); // Send Notify to all players in instance - void DoSendNotifyToInstance(const char *format,...); + void DoSendNotifyToInstance(char const* format, ...); // Complete Achievement for all players in instance void DoCompleteAchievement(uint32 achievement); // Update Achievement Criteria for all players in instance - void DoUpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscvalue1=0, uint32 miscvalue2=0, Unit *unit=NULL, uint32 time=0); + void DoUpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscvalue1 = 0, uint32 miscvalue2 = 0, Unit* unit = NULL, uint32 time = 0); // Start/Stop Timed Achievement Criteria for all players in instance void DoStartTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry); @@ -189,7 +189,7 @@ class InstanceScript : public ZoneScript virtual bool SetBossState(uint32 id, EncounterState state); EncounterState GetBossState(uint32 id) const { return id < bosses.size() ? bosses[id].state : TO_BE_DECIDED; } - const BossBoundaryMap * GetBossBoundary(uint32 id) const { return id < bosses.size() ? &bosses[id].boundary : NULL; } + BossBoundaryMap const* GetBossBoundary(uint32 id) const { return id < bosses.size() ? &bosses[id].boundary : NULL; } // Achievement criteria additional requirements check // NOTE: not use this if same can be checked existed requirement types from AchievementCriteriaRequirementType @@ -209,18 +209,20 @@ class InstanceScript : public ZoneScript void SendEncounterUnit(uint32 type, Unit* unit = NULL, uint8 param1 = 0, uint8 param2 = 0); + virtual void FillInitialWorldStates(WorldPacket& /*data*/) {} + protected: void SetBossNumber(uint32 number) { bosses.resize(number); } - void LoadDoorData(const DoorData *data); - void LoadMinionData(const MinionData *data); + void LoadDoorData(DoorData const* data); + void LoadMinionData(MinionData const* data); - void AddDoor(GameObject *door, bool add); - void AddMinion(Creature *minion, bool add); + void AddDoor(GameObject* door, bool add); + void AddMinion(Creature* minion, bool add); void UpdateDoorState(GameObject *door); void UpdateMinionState(Creature *minion, EncounterState state); - std::string LoadBossState(const char * data); + std::string LoadBossState(char const* data); std::string GetBossSaveData(); private: std::vector bosses; diff --git a/src/server/game/Loot/LootMgr.cpp b/src/server/game/Loot/LootMgr.cpp index dd924a31eddf7..f05c18e473570 100755 --- a/src/server/game/Loot/LootMgr.cpp +++ b/src/server/game/Loot/LootMgr.cpp @@ -452,7 +452,7 @@ bool Loot::FillLoot(uint32 lootId, LootStore const& store, Player* lootOwner, bo return true; } -void Loot::FillNotNormalLootFor(Player* pl, bool withCurrency) +void Loot::FillNotNormalLootFor(Player* pl, bool presentAtLooting) { uint32 plguid = pl->GetGUIDLow(); @@ -466,10 +466,10 @@ void Loot::FillNotNormalLootFor(Player* pl, bool withCurrency) qmapitr = PlayerNonQuestNonFFAConditionalItems.find(plguid); if (qmapitr == PlayerNonQuestNonFFAConditionalItems.end()) - FillNonQuestNonFFAConditionalLoot(pl); + FillNonQuestNonFFAConditionalLoot(pl, presentAtLooting); // if not auto-processed player will have to come and pick it up manually - if (!withCurrency) + if (!presentAtLooting) return; // Process currency items @@ -548,7 +548,7 @@ QuestItemList* Loot::FillQuestLoot(Player* player) return ql; } -QuestItemList* Loot::FillNonQuestNonFFAConditionalLoot(Player* player) +QuestItemList* Loot::FillNonQuestNonFFAConditionalLoot(Player* player, bool presentAtLooting) { QuestItemList *ql = new QuestItemList(); @@ -557,7 +557,8 @@ QuestItemList* Loot::FillNonQuestNonFFAConditionalLoot(Player* player) LootItem &item = items[i]; if (!item.is_looted && !item.freeforall && item.AllowedForPlayer(player)) { - item.AddAllowedLooter(player); + if (presentAtLooting) + item.AddAllowedLooter(player); if (!item.conditions.empty()) { ql->push_back(QuestItem(i)); diff --git a/src/server/game/Loot/LootMgr.h b/src/server/game/Loot/LootMgr.h index 91e880831ba65..e0c46fe575a8a 100755 --- a/src/server/game/Loot/LootMgr.h +++ b/src/server/game/Loot/LootMgr.h @@ -339,10 +339,10 @@ struct Loot bool hasOverThresholdItem() const; private: - void FillNotNormalLootFor(Player* player, bool withCurrency); + void FillNotNormalLootFor(Player* player, bool presentAtLooting); QuestItemList* FillFFALoot(Player* player); QuestItemList* FillQuestLoot(Player* player); - QuestItemList* FillNonQuestNonFFAConditionalLoot(Player* player); + QuestItemList* FillNonQuestNonFFAConditionalLoot(Player* player, bool presentAtLooting); std::vector quest_items; std::set PlayersLooting; diff --git a/src/server/game/Mails/Mail.cpp b/src/server/game/Mails/Mail.cpp index 0956faeaa20bc..8653db0fa7b86 100755 --- a/src/server/game/Mails/Mail.cpp +++ b/src/server/game/Mails/Mail.cpp @@ -67,7 +67,6 @@ MailSender::MailSender(Player* sender) m_senderId = sender->GetGUIDLow(); } - MailReceiver::MailReceiver(Player* receiver) : m_receiver(receiver), m_receiver_lowguid(receiver->GetGUIDLow()) { } diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index 1e2e55a7cde55..46cb52f6b0005 100755 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -317,7 +317,7 @@ Map::EnsureGridCreated(const GridPair &p) 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); + sLog->outDebug(LOG_FILTER_MAPS, "Creating grid[%u,%u] for map %u instance %u", p.x_coord, p.y_coord, GetId(), i_InstanceId); setNGrid(new NGridType(p.x_coord*MAX_NUMBER_OF_GRIDS + p.y_coord, p.x_coord, p.y_coord, i_gridExpiry, sWorld->getBoolConfig(CONFIG_GRID_UNLOAD)), p.x_coord, p.y_coord); @@ -369,7 +369,7 @@ bool Map::EnsureGridLoaded(const Cell &cell) ASSERT(grid != NULL); if (!isGridObjectDataLoaded(cell.GridX(), cell.GridY())) { - sLog->outDebug("Loading grid[%u,%u] for map %u instance %u", cell.GridX(), cell.GridY(), GetId(), i_InstanceId); + sLog->outDebug(LOG_FILTER_MAPS, "Loading grid[%u,%u] for map %u instance %u", cell.GridX(), cell.GridY(), GetId(), i_InstanceId); setGridObjectDataLoaded(true,cell.GridX(), cell.GridY()); @@ -770,8 +770,7 @@ Map::CreatureRelocation(Creature *creature, float x, float y, float z, float ang if (old_cell.DiffCell(new_cell) || old_cell.DiffGrid(new_cell)) { #ifdef TRINITY_DEBUG - if ((sLog->getLogFilter() & LOG_FILTER_CREATURE_MOVES) == 0) - sLog->outDebug("Creature (GUID: %u Entry: %u) added to moving list from grid[%u,%u]cell[%u,%u] to grid[%u,%u]cell[%u,%u].", creature->GetGUIDLow(), creature->GetEntry(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.GridX(), new_cell.GridY(), new_cell.CellX(), new_cell.CellY()); + sLog->outDebug(LOG_FILTER_MAPS, "Creature (GUID: %u Entry: %u) added to moving list from grid[%u,%u]cell[%u,%u] to grid[%u,%u]cell[%u,%u].", creature->GetGUIDLow(), creature->GetEntry(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.GridX(), new_cell.GridY(), new_cell.CellX(), new_cell.CellY()); #endif AddCreatureToMoveList(creature, x, y, z, ang); // in diffcell/diffgrid case notifiers called at finishing move creature in Map::MoveAllCreaturesInMoveList @@ -823,8 +822,7 @@ void Map::MoveAllCreaturesInMoveList() { // ... or unload (if respawn grid also not loaded) #ifdef TRINITY_DEBUG - if ((sLog->getLogFilter() & LOG_FILTER_CREATURE_MOVES) == 0) - sLog->outDebug("Creature (GUID: %u Entry: %u) cannot be move to unloaded respawn grid.",c->GetGUIDLow(),c->GetEntry()); + sLog->outDebug(LOG_FILTER_MAPS, "Creature (GUID: %u Entry: %u) cannot be move to unloaded respawn grid.",c->GetGUIDLow(),c->GetEntry()); #endif AddObjectToRemoveList(c); } @@ -841,8 +839,7 @@ bool Map::CreatureCellRelocation(Creature *c, Cell new_cell) if (old_cell.DiffCell(new_cell)) { #ifdef TRINITY_DEBUG - if ((sLog->getLogFilter() & LOG_FILTER_CREATURE_MOVES) == 0) - sLog->outDebug("Creature (GUID: %u Entry: %u) moved in grid[%u,%u] from cell[%u,%u] to cell[%u,%u].", c->GetGUIDLow(), c->GetEntry(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.CellX(), new_cell.CellY()); + sLog->outDebug(LOG_FILTER_MAPS, "Creature (GUID: %u Entry: %u) moved in grid[%u,%u] from cell[%u,%u] to cell[%u,%u].", c->GetGUIDLow(), c->GetEntry(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.CellX(), new_cell.CellY()); #endif RemoveFromGrid(c,getNGrid(old_cell.GridX(), old_cell.GridY()),old_cell); @@ -851,8 +848,7 @@ bool Map::CreatureCellRelocation(Creature *c, Cell new_cell) else { #ifdef TRINITY_DEBUG - if ((sLog->getLogFilter() & LOG_FILTER_CREATURE_MOVES) == 0) - sLog->outDebug("Creature (GUID: %u Entry: %u) moved in same grid[%u,%u]cell[%u,%u].", c->GetGUIDLow(), c->GetEntry(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY()); + sLog->outDebug(LOG_FILTER_MAPS, "Creature (GUID: %u Entry: %u) moved in same grid[%u,%u]cell[%u,%u].", c->GetGUIDLow(), c->GetEntry(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY()); #endif } @@ -865,8 +861,7 @@ bool Map::CreatureCellRelocation(Creature *c, Cell new_cell) EnsureGridLoadedAtEnter(new_cell); #ifdef TRINITY_DEBUG - if ((sLog->getLogFilter() & LOG_FILTER_CREATURE_MOVES) == 0) - sLog->outDebug("Active creature (GUID: %u Entry: %u) moved from grid[%u,%u]cell[%u,%u] to grid[%u,%u]cell[%u,%u].", c->GetGUIDLow(), c->GetEntry(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.GridX(), new_cell.GridY(), new_cell.CellX(), new_cell.CellY()); + sLog->outDebug(LOG_FILTER_MAPS, "Active creature (GUID: %u Entry: %u) moved from grid[%u,%u]cell[%u,%u] to grid[%u,%u]cell[%u,%u].", c->GetGUIDLow(), c->GetEntry(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.GridX(), new_cell.GridY(), new_cell.CellX(), new_cell.CellY()); #endif RemoveFromGrid(c,getNGrid(old_cell.GridX(), old_cell.GridY()),old_cell); @@ -879,8 +874,7 @@ bool Map::CreatureCellRelocation(Creature *c, Cell new_cell) if (loaded(GridPair(new_cell.GridX(), new_cell.GridY()))) { #ifdef TRINITY_DEBUG - if ((sLog->getLogFilter() & LOG_FILTER_CREATURE_MOVES) == 0) - sLog->outDebug("Creature (GUID: %u Entry: %u) moved from grid[%u,%u]cell[%u,%u] to grid[%u,%u]cell[%u,%u].", c->GetGUIDLow(), c->GetEntry(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.GridX(), new_cell.GridY(), new_cell.CellX(), new_cell.CellY()); + sLog->outDebug(LOG_FILTER_MAPS, "Creature (GUID: %u Entry: %u) moved from grid[%u,%u]cell[%u,%u] to grid[%u,%u]cell[%u,%u].", c->GetGUIDLow(), c->GetEntry(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.GridX(), new_cell.GridY(), new_cell.CellX(), new_cell.CellY()); #endif RemoveFromGrid(c,getNGrid(old_cell.GridX(), old_cell.GridY()),old_cell); @@ -892,8 +886,7 @@ bool Map::CreatureCellRelocation(Creature *c, Cell new_cell) // fail to move: normal creature attempt move to unloaded grid #ifdef TRINITY_DEBUG - if ((sLog->getLogFilter() & LOG_FILTER_CREATURE_MOVES) == 0) - sLog->outDebug("Creature (GUID: %u Entry: %u) attempted to move from grid[%u,%u]cell[%u,%u] to unloaded grid[%u,%u]cell[%u,%u].", c->GetGUIDLow(), c->GetEntry(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.GridX(), new_cell.GridY(), new_cell.CellX(), new_cell.CellY()); + sLog->outDebug(LOG_FILTER_MAPS, "Creature (GUID: %u Entry: %u) attempted to move from grid[%u,%u]cell[%u,%u] to unloaded grid[%u,%u]cell[%u,%u].", c->GetGUIDLow(), c->GetEntry(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.GridX(), new_cell.GridY(), new_cell.CellX(), new_cell.CellY()); #endif return false; } @@ -910,8 +903,7 @@ bool Map::CreatureRespawnRelocation(Creature *c) c->GetMotionMaster()->Clear(); #ifdef TRINITY_DEBUG - if ((sLog->getLogFilter() & LOG_FILTER_CREATURE_MOVES) == 0) - sLog->outDebug("Creature (GUID: %u Entry: %u) moved from grid[%u,%u]cell[%u,%u] to respawn grid[%u,%u]cell[%u,%u].", c->GetGUIDLow(), c->GetEntry(), c->GetCurrentCell().GridX(), c->GetCurrentCell().GridY(), c->GetCurrentCell().CellX(), c->GetCurrentCell().CellY(), resp_cell.GridX(), resp_cell.GridY(), resp_cell.CellX(), resp_cell.CellY()); + sLog->outDebug(LOG_FILTER_MAPS, "Creature (GUID: %u Entry: %u) moved from grid[%u,%u]cell[%u,%u] to respawn grid[%u,%u]cell[%u,%u].", c->GetGUIDLow(), c->GetEntry(), c->GetCurrentCell().GridX(), c->GetCurrentCell().GridY(), c->GetCurrentCell().CellX(), c->GetCurrentCell().CellY(), resp_cell.GridX(), resp_cell.GridY(), resp_cell.CellX(), resp_cell.CellY()); #endif // teleport it to respawn point (like normal respawn if player see) @@ -936,7 +928,7 @@ bool Map::UnloadGrid(const uint32 &x, const uint32 &y, bool unloadAll) if (!unloadAll && ActiveObjectsNearGrid(x, y)) return false; - sLog->outDebug("Unloading grid[%u,%u] for map %u", x,y, GetId()); + sLog->outDebug(LOG_FILTER_MAPS, "Unloading grid[%u,%u] for map %u", x,y, GetId()); ObjectGridUnloader unloader(*grid); @@ -1726,7 +1718,7 @@ ZLiquidStatus Map::getLiquidStatus(float x, float y, float z, uint8 ReqLiquidTyp uint32 liquid_type; if (vmgr->GetLiquidLevel(GetId(), x, y, z, ReqLiquidType, liquid_level, ground_level, liquid_type)) { - sLog->outDebug("getLiquidStatus(): vmap liquid level: %f ground: %f type: %u", liquid_level, ground_level, liquid_type); + sLog->outDebug(LOG_FILTER_MAPS, "getLiquidStatus(): vmap liquid level: %f ground: %f type: %u", liquid_level, ground_level, liquid_type); // Check water level and ground level if (liquid_level > ground_level && z > ground_level - 2) { @@ -1834,7 +1826,7 @@ bool Map::CheckGridIntegrity(Creature* c, bool moved) const Cell xy_cell(xy_val); if (xy_cell != cur_cell) { - sLog->outDebug("Creature (GUID: %u) X: %f Y: %f (%s) is in grid[%u,%u]cell[%u,%u] instead of grid[%u,%u]cell[%u,%u]", + sLog->outDebug(LOG_FILTER_MAPS, "Creature (GUID: %u) X: %f Y: %f (%s) is in grid[%u,%u]cell[%u,%u] instead of grid[%u,%u]cell[%u,%u]", c->GetGUIDLow(), c->GetPositionX(),c->GetPositionY(),(moved ? "final" : "original"), cur_cell.GridX(), cur_cell.GridY(), cur_cell.CellX(), cur_cell.CellY(), @@ -1992,7 +1984,7 @@ void Map::AddObjectToRemoveList(WorldObject *obj) obj->CleanupsBeforeDelete(false); // remove or simplify at least cross referenced links i_objectsToRemove.insert(obj); - //sLog->outDebug("Object (GUID: %u TypeId: %u) added to removing list.",obj->GetGUIDLow(),obj->GetTypeId()); + //sLog->outDebug(LOG_FILTER_MAPS, "Object (GUID: %u TypeId: %u) added to removing list.",obj->GetGUIDLow(),obj->GetTypeId()); } void Map::AddObjectToSwitchList(WorldObject *obj, bool on) @@ -2028,7 +2020,7 @@ void Map::RemoveAllObjectsInRemoveList() } } - //sLog->outDebug("Object remover 1 check."); + //sLog->outDebug(LOG_FILTER_MAPS, "Object remover 1 check."); while (!i_objectsToRemove.empty()) { std::set::iterator itr = i_objectsToRemove.begin(); @@ -2065,7 +2057,7 @@ void Map::RemoveAllObjectsInRemoveList() i_objectsToRemove.erase(itr); } - //sLog->outDebug("Object remover 2 check."); + //sLog->outDebug(LOG_FILTER_MAPS, "Object remover 2 check."); } uint32 Map::GetPlayersCountExceptGMs() const @@ -2368,7 +2360,7 @@ bool InstanceMap::Add(Player *player) // for normal instances cancel the reset schedule when the // first player enters (no players yet) - SetResetSchedule(false); + SetResetSchedule(false, player); sLog->outDetail("MAP: Player '%s' entered instance '%u' of map '%s'", player->GetName(), GetInstanceId(), GetMapName()); // initialize unload state @@ -2402,7 +2394,7 @@ void InstanceMap::Remove(Player *player, bool remove) m_unloadTimer = m_unloadWhenEmpty ? MIN_UNLOAD_DELAY : std::max(sWorld->getIntConfig(CONFIG_INSTANCE_UNLOAD_DELAY), (uint32)MIN_UNLOAD_DELAY); Map::Remove(player, remove); // for normal instances schedule the reset after all players have left - SetResetSchedule(true); + SetResetSchedule(true, player); } void InstanceMap::CreateInstanceData(bool load) @@ -2433,7 +2425,7 @@ void InstanceMap::CreateInstanceData(bool load) i_data->SetCompletedEncountersMask(fields[1].GetUInt32()); if (data != "") { - sLog->outDebug("Loading instance data for `%s` with id %u", sObjectMgr->GetScriptName(i_script_id), i_InstanceId); + sLog->outDebug(LOG_FILTER_MAPS, "Loading instance data for `%s` with id %u", sObjectMgr->GetScriptName(i_script_id), i_InstanceId); i_data->Load(data.c_str()); } } @@ -2529,18 +2521,19 @@ void InstanceMap::SendResetWarnings(uint32 timeLeft) const itr->getSource()->SendInstanceResetWarning(GetId(), itr->getSource()->GetDifficulty(IsRaid()), timeLeft); } -void InstanceMap::SetResetSchedule(bool on) +void InstanceMap::SetResetSchedule(bool on, Player* player) { // only for normal instances // the reset time is only scheduled when there are no payers inside // it is assumed that the reset time will rarely (if ever) change while the reset is scheduled if (IsDungeon() && !HavePlayers() && !IsRaidOrHeroicDungeon()) { - InstanceSave *save = sInstanceSaveMgr->GetInstanceSave(GetInstanceId()); - if (!save) - sLog->outError("InstanceMap::SetResetSchedule: cannot turn schedule %s, no save available for instance %d of %d", on ? "on" : "off", GetInstanceId(), GetId()); - else + if (InstanceSave *save = sInstanceSaveMgr->GetInstanceSave(GetInstanceId())) sInstanceSaveMgr->ScheduleReset(on, save->GetResetTime(), InstanceSaveManager::InstResetEvent(0, GetId(), Difficulty(GetSpawnMode()), GetInstanceId())); + else + sLog->outError("InstanceMap::SetResetSchedule: cannot turn schedule %s, there is no save information for instance (map [id: %u, name: %s], instance id: %u) due to player (GUID: %u, name: %s) %s", + on ? "on" : "off", GetId(), GetMapName(), GetInstanceId(), + player->GetGUIDLow(), player->GetName(), on ? "leave" : "entrance"); } } diff --git a/src/server/game/Maps/Map.h b/src/server/game/Maps/Map.h index c98bdce473b59..b98e65811a66f 100755 --- a/src/server/game/Maps/Map.h +++ b/src/server/game/Maps/Map.h @@ -595,7 +595,7 @@ class InstanceMap : public Map void UnloadAll(); bool CanEnter(Player* player); void SendResetWarnings(uint32 timeLeft) const; - void SetResetSchedule(bool on); + void SetResetSchedule(bool on, Player* player); uint32 GetMaxPlayers() const; uint32 GetMaxResetDelay() const; diff --git a/src/server/game/Maps/MapInstanced.cpp b/src/server/game/Maps/MapInstanced.cpp index ddcef2dc8261b..7dc126ce2379a 100755 --- a/src/server/game/Maps/MapInstanced.cpp +++ b/src/server/game/Maps/MapInstanced.cpp @@ -189,7 +189,7 @@ InstanceMap* MapInstanced::CreateInstance(uint32 InstanceId, InstanceSave *save, // some instances only have one difficulty GetDownscaledMapDifficultyData(GetId(),difficulty); - sLog->outDebug("MapInstanced::CreateInstance: %s map instance %d for %d created with difficulty %s", save?"":"new ", InstanceId, GetId(), difficulty?"heroic":"normal"); + sLog->outDebug(LOG_FILTER_MAPS, "MapInstanced::CreateInstance: %s map instance %d for %d created with difficulty %s", save?"":"new ", InstanceId, GetId(), difficulty?"heroic":"normal"); InstanceMap *map = new InstanceMap(GetId(), GetGridExpiry(), InstanceId, difficulty, this); ASSERT(map->IsDungeon()); @@ -206,7 +206,7 @@ BattlegroundMap* MapInstanced::CreateBattleground(uint32 InstanceId, Battlegroun // load/create a map ACE_GUARD_RETURN(ACE_Thread_Mutex, Guard, Lock, NULL); - sLog->outDebug("MapInstanced::CreateBattleground: map bg %d for %d created.", InstanceId, GetId()); + sLog->outDebug(LOG_FILTER_MAPS, "MapInstanced::CreateBattleground: map bg %d for %d created.", InstanceId, GetId()); PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bg->GetMapId(),bg->GetMinLevel()); @@ -245,9 +245,15 @@ bool MapInstanced::DestroyInstance(InstancedMaps::iterator &itr) // so in the next map creation, (EnsureGridCreated actually) VMaps will be reloaded Map::UnloadAll(); } + + // Free up the instance id and allow it to be reused for bgs and arenas (other instances are handled in the InstanceSaveMgr) + if (itr->second->IsBattlegroundOrArena()) + sMapMgr->FreeInstanceId(itr->second->GetInstanceId()); + // erase map delete itr->second; m_InstancedMaps.erase(itr++); + return true; } diff --git a/src/server/game/Maps/MapManager.cpp b/src/server/game/Maps/MapManager.cpp index 2317f2296f1a7..7d880ad89e8f1 100755 --- a/src/server/game/Maps/MapManager.cpp +++ b/src/server/game/Maps/MapManager.cpp @@ -62,8 +62,6 @@ void MapManager::Initialize() // Start mtmaps if needed. if (num_threads > 0 && m_updater.activate(num_threads) == -1) abort(); - - InitMaxInstanceId(); } void MapManager::InitializeVisibilityDistanceInfo() @@ -187,7 +185,7 @@ bool MapManager::CanPlayerEnter(uint32 mapid, Player* player, bool loginCheck) // 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 player->GetSession()->SendAreaTriggerMessage(player->GetSession()->GetTrinityString(LANG_INSTANCE_RAID_GROUP_ONLY), mapName); - sLog->outDebug("MAP: Player '%s' must be in a raid group to enter instance '%s'", player->GetName(), mapName); + sLog->outDebug(LOG_FILTER_MAPS, "MAP: Player '%s' must be in a raid group to enter instance '%s'", player->GetName(), mapName); return false; } } @@ -211,13 +209,13 @@ bool MapManager::CanPlayerEnter(uint32 mapid, Player* player, bool loginCheck) { WorldPacket data(SMSG_CORPSE_NOT_IN_INSTANCE); player->GetSession()->SendPacket(&data); - sLog->outDebug("MAP: Player '%s' does not have a corpse in instance '%s' and cannot enter.", player->GetName(), mapName); + sLog->outDebug(LOG_FILTER_MAPS, "MAP: Player '%s' does not have a corpse in instance '%s' and cannot enter.", player->GetName(), mapName); return false; } - sLog->outDebug("MAP: Player '%s' has corpse in instance '%s' and can enter.", player->GetName(), mapName); + sLog->outDebug(LOG_FILTER_MAPS, "MAP: Player '%s' has corpse in instance '%s' and can enter.", player->GetName(), mapName); } else - sLog->outDebug("Map::CanPlayerEnter - player '%s' is dead but does not have a corpse!", player->GetName()); + sLog->outDebug(LOG_FILTER_MAPS, "Map::CanPlayerEnter - player '%s' is dead but does not have a corpse!", player->GetName()); } //Get instance where player's group is bound & its map @@ -328,15 +326,6 @@ void MapManager::UnloadAll() Map::DeleteStateMachine(); } -void MapManager::InitMaxInstanceId() -{ - i_MaxInstanceId = 0; - - QueryResult result = CharacterDatabase.Query("SELECT MAX(id) FROM instance"); - if (result) - i_MaxInstanceId = result->Fetch()[0].GetUInt32(); -} - uint32 MapManager::GetNumInstances() { ACE_GUARD_RETURN(ACE_Thread_Mutex, Guard, Lock, NULL); @@ -371,3 +360,69 @@ uint32 MapManager::GetNumPlayersInInstances() } return ret; } + +void MapManager::InitInstanceIds() +{ + _nextInstanceId = 1; + + QueryResult result = CharacterDatabase.Query("SELECT MAX(id) FROM instance"); + if (result) + { + uint32 maxId = (*result)[0].GetUInt32(); + + // Resize to multiples of 32 (vector allocates memory the same way) + _instanceIds.resize((maxId / 32) * 32 + (maxId % 32 > 0 ? 32 : 0)); + } +} + +void MapManager::RegisterInstanceId(uint32 instanceId) +{ + // Allocation and sizing was done in InitInstanceIds() + _instanceIds[instanceId] = true; +} + +uint32 MapManager::GenerateInstanceId() +{ + uint32 newInstanceId = _nextInstanceId; + + // Find the lowest available id starting from the current NextInstanceId (which should be the lowest according to the logic in FreeInstanceId() + for (uint32 i = ++_nextInstanceId; i < 0xFFFFFFFF; ++i) + { + if ((i < _instanceIds.size() && !_instanceIds[i]) || i >= _instanceIds.size()) + { + _nextInstanceId = i; + break; + } + } + + if (newInstanceId == _nextInstanceId) + { + sLog->outError("Instance ID overflow!! Can't continue, shutting down server. "); + World::StopNow(ERROR_EXIT_CODE); + } + + // Allocate space if necessary + if (newInstanceId >= uint32(_instanceIds.size())) + { + // Due to the odd memory allocation behavior of vector we match size to capacity before triggering a new allocation + if (_instanceIds.size() < _instanceIds.capacity()) + { + _instanceIds.resize(_instanceIds.capacity()); + } + else + _instanceIds.resize((newInstanceId / 32) * 32 + (newInstanceId % 32 > 0 ? 32 : 0)); + } + + _instanceIds[newInstanceId] = true; + + return newInstanceId; +} + +void MapManager::FreeInstanceId(uint32 instanceId) +{ + // If freed instance id is lower than the next id available for new instances, use the freed one instead + if (instanceId < _nextInstanceId) + SetNextInstanceId(instanceId); + + _instanceIds[instanceId] = false; +} diff --git a/src/server/game/Maps/MapManager.h b/src/server/game/Maps/MapManager.h index 040b771af64c7..4362d305edd7b 100755 --- a/src/server/game/Maps/MapManager.h +++ b/src/server/game/Maps/MapManager.h @@ -34,7 +34,7 @@ class MapManager { friend class ACE_Singleton; typedef UNORDERED_MAP MapMapType; - typedef std::pair::iterator, bool> MapMapPair; + typedef std::vector InstanceIds; public: @@ -133,14 +133,21 @@ class MapManager TransportMap m_TransportsByMap; bool CanPlayerEnter(uint32 mapid, Player* player, bool loginCheck = false); - uint32 GenerateInstanceId() { return ++i_MaxInstanceId; } - void InitMaxInstanceId(); void InitializeVisibilityDistanceInfo(); /* statistics */ uint32 GetNumInstances(); uint32 GetNumPlayersInInstances(); + // Instance ID management + void InitInstanceIds(); + uint32 GenerateInstanceId(); + void RegisterInstanceId(uint32 instanceId); + void FreeInstanceId(uint32 instanceId); + + uint32 GetNextInstanceId() { return _nextInstanceId; }; + void SetNextInstanceId(uint32 nextInstanceId) { _nextInstanceId = nextInstanceId; }; + private: // debugging code, should be deleted some day void checkAndCorrectGridStatesArray(); // just for debugging to find some memory overwrites @@ -165,7 +172,8 @@ class MapManager MapMapType i_maps; IntervalTimer i_timer; - uint32 i_MaxInstanceId; + InstanceIds _instanceIds; + uint32 _nextInstanceId; MapUpdater m_updater; }; #define sMapMgr ACE_Singleton::instance() diff --git a/src/server/game/Maps/ZoneScript.h b/src/server/game/Maps/ZoneScript.h index 0147e333f41f2..e3a0de7f22b03 100755 --- a/src/server/game/Maps/ZoneScript.h +++ b/src/server/game/Maps/ZoneScript.h @@ -30,13 +30,13 @@ class ZoneScript public: explicit ZoneScript() {} - virtual uint32 GetCreatureEntry(uint32 /*guidlow*/, const CreatureData *data) { return data->id; } + virtual uint32 GetCreatureEntry(uint32 /*guidlow*/, CreatureData const* data) { return data->id; } virtual uint32 GetGameObjectEntry(uint32 /*guidlow*/, uint32 entry) { return entry; } - virtual void OnCreatureCreate(Creature *) {} - virtual void OnCreatureRemove(Creature *) {} - virtual void OnGameObjectCreate(GameObject *) {} - virtual void OnGameObjectRemove(GameObject *) {} + virtual void OnCreatureCreate(Creature* /*creature*/) {} + virtual void OnCreatureRemove(Creature* /*creature*/) {} + virtual void OnGameObjectCreate(GameObject* /*go*/) {} + virtual void OnGameObjectRemove(GameObject* /*go*/) {} virtual void OnCreatureDeath(Creature* /*creature*/) {} @@ -48,7 +48,7 @@ class ZoneScript virtual uint32 GetData(uint32 /*DataId*/) { return 0; } virtual void SetData(uint32 /*DataId*/, uint32 /*Value*/) {} - virtual void ProcessEvent(GameObject * /*obj*/, uint32 /*eventId*/) {} + virtual void ProcessEvent(GameObject* /*obj*/, uint32 /*eventId*/) {} virtual void ProcessEvent(Unit* /*unit*/, uint32 /*eventId*/) {} }; diff --git a/src/server/game/Miscellaneous/Language.h b/src/server/game/Miscellaneous/Language.h index 24c4114f23043..56b9dfe2239d7 100755 --- a/src/server/game/Miscellaneous/Language.h +++ b/src/server/game/Miscellaneous/Language.h @@ -25,7 +25,6 @@ enum TrinityStrings LANG_SELECT_CHAR_OR_CREATURE = 1, LANG_SELECT_CREATURE = 2, - // level 0 chat LANG_SYSTEMMESSAGE = 3, LANG_EVENTMESSAGE = 4, @@ -951,7 +950,6 @@ enum TrinityStrings LANG_MAIL_SENDER_REQ = 6611, LANG_MAIL_RECEIVER_REQ = 6612, - // Used for GM Announcements LANG_GM_BROADCAST = 6613, LANG_GM_NOTIFY = 6614, diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index d8d120f527d63..484f1052bf982 100755 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -553,9 +553,12 @@ enum SpellClickUserTypes SPELL_CLICK_USER_MAX = 4 }; -#define NPC_CLICK_CAST_CASTER_PLAYER 0x01 -#define NPC_CLICK_CAST_TARGET_PLAYER 0x02 -#define NPC_CLICK_CAST_ORIG_CASTER_OWNER 0x04 +enum SpellClickCastFlags +{ + NPC_CLICK_CAST_CASTER_CLICKER = 0x01, + NPC_CLICK_CAST_TARGET_CLICKER = 0x02, + NPC_CLICK_CAST_ORIG_CASTER_OWNER = 0x04, +}; enum SheathTypes { @@ -1004,6 +1007,90 @@ enum SpellCastResult SPELL_CAST_OK = 255 // custom value, don't must be send to client }; +enum SpellCustomErrors +{ + SPELL_CUSTOM_ERROR_NONE = 0, + SPELL_CUSTOM_ERROR_CUSTOM_MSG = 1, // Something bad happened, and we want to display a custom message! + SPELL_CUSTOM_ERROR_ALEX_BROKE_QUEST = 2, // Alex broke your quest! Thank him later! + SPELL_CUSTOM_ERROR_NEED_HELPLESS_VILLAGER = 3, // This spell may only be used on Helpless Wintergarde Villagers that have not been rescued. + SPELL_CUSTOM_ERROR_NEED_WARSONG_DISGUISE = 4, // Requires that you be wearing the Warsong Orc Disguise. + SPELL_CUSTOM_ERROR_REQUIRES_PLAGUE_WAGON = 5, // You must be closer to a plague wagon in order to drop off your 7th Legion Siege Engineer. + SPELL_CUSTOM_ERROR_CANT_TARGET_FRIENDLY_NONPARTY = 6, // You cannot target friendly units outside your party. + SPELL_CUSTOM_ERROR_NEED_CHILL_NYMPH = 7, // You must target a weakened chill nymph. + SPELL_CUSTOM_ERROR_MUST_BE_IN_ENKILAH = 8, // The Imbued Scourge Shroud will only work when equipped in the Temple City of En'kilah. + SPELL_CUSTOM_ERROR_REQUIRES_CORPSE_DUST = 9, // Requires Corpse Dust + SPELL_CUSTOM_ERROR_CANT_SUMMON_GARGOYLE = 10, // You cannot summon another gargoyle yet. + SPELL_CUSTOM_ERROR_NEED_CORPSE_DUST_IF_NO_TARGET = 11, // Requires Corpse Dust if the target is not dead and humanoid. + SPELL_CUSTOM_ERROR_MUST_BE_AT_SHATTERHORN = 12, // Can only be placed near Shatterhorn + SPELL_CUSTOM_ERROR_MUST_TARGET_PROTO_DRAKE_EGG = 13, // You must first select a Proto-Drake Egg. + SPELL_CUSTOM_ERROR_MUST_BE_CLOSE_TO_TREE = 14, // You must be close to a marked tree. + SPELL_CUSTOM_ERROR_MUST_TARGET_TURKEY = 15, // You must target a Fjord Turkey. + SPELL_CUSTOM_ERROR_MUST_TARGET_HAWK = 16, // You must target a Fjord Hawk. + SPELL_CUSTOM_ERROR_TOO_FAR_FROM_BOUY = 17, // You are too far from the bouy. + SPELL_CUSTOM_ERROR_MUST_BE_CLOSE_TO_OIL_SLICK = 18, // Must be used near an oil slick. + SPELL_CUSTOM_ERROR_MUST_BE_CLOSE_TO_BOUY = 19, // You must be closer to the buoy! + SPELL_CUSTOM_ERROR_WYRMREST_VANQUISHER = 20, // You may only call for the aid of a Wyrmrest Vanquisher in Wyrmrest Temple, The Dragon Wastes, Galakrond's Rest or The Wicked Coil. + SPELL_CUSTOM_ERROR_MUST_TARGET_ICE_HEART_JORMUNGAR = 21, // That can only be used on a Ice Heart Jormungar Spawn. + SPELL_CUSTOM_ERROR_MUST_BE_CLOSE_TO_SINKHOLE = 22, // You must be closer to a sinkhole to use your map. + SPELL_CUSTOM_ERROR_REQUIRES_HAROLD_LANE = 23, // You may only call down a stampede on Harold Lane. + SPELL_CUSTOM_ERROR_REQUIRES_GAMMOTH_MAGNATAUR = 24, // You may only use the Pouch of Crushed Bloodspore on Gammothra or other magnataur in the Bloodspore Plains and Gammoth. + SPELL_CUSTOM_ERROR_MUST_BE_IN_RESURRECTION_CHAMBER = 25, // Requires the magmawyrm resurrection chamber in the back of the Maw of Neltharion. + SPELL_CUSTOM_ERROR_CANT_CALL_WINTERGARDE_HERE = 26, // You may only call down a Wintergarde Gryphon in Wintergarde Keep or the Carrion Fields. + SPELL_CUSTOM_ERROR_MUST_TARGET_WILHELM = 27, // What are you doing? Only aim that thing at Wilhelm! + SPELL_CUSTOM_ERROR_NOT_ENOUGH_HEALTH = 28, // Not enough health! + SPELL_CUSTOM_ERROR_NO_NEARBY_CORPSES = 29, // There are no nearby corpses to use + SPELL_CUSTOM_ERROR_TOO_MANY_GHOULS = 30, // You've created enough ghouls. Return to Gothik the Harvester at Death's Breach. + SPELL_CUSTOM_ERROR_GO_FURTHER_FROM_SUNDERED_SHARD = 31, // Your companion does not want to come here. Go further from the Sundered Shard. + SPELL_CUSTOM_ERROR_MUST_BE_IN_CAT_FORM = 32, // Must be in Cat Form + SPELL_CUSTOM_ERROR_MUST_BE_DEATH_KNIGHT = 33, // Only Death Knights may enter Ebon Hold. + SPELL_CUSTOM_ERROR_MUST_BE_IN_FERAL_FORM = 34, // Must be in Cat Form, Bear Form, or Dire Bear Form + SPELL_CUSTOM_ERROR_MUST_BE_NEAR_HELPLESS_VILLAGER = 35, // You must be within range of a Helpless Wintergarde Villager. + SPELL_CUSTOM_ERROR_CANT_TARGET_ELEMENTAL_MECHANICAL = 36, // You cannot target an elemental or mechanical corpse. + SPELL_CUSTOM_ERROR_MUST_HAVE_USED_DALARAN_CRYSTAL = 37, // This teleport crystal cannot be used until the teleport crystal in Dalaran has been used at least once. + SPELL_CUSTOM_ERROR_YOU_ALREADY_HOLD_SOMETHING = 38, // You are already holding something in your hand. You must throw the creature in your hand before picking up another. + SPELL_CUSTOM_ERROR_YOU_DONT_HOLD_ANYTHING = 39, // You don't have anything to throw! Find a Vargul and use Gymer Grab to pick one up! + SPELL_CUSTOM_ERROR_MUST_BE_CLOSE_TO_VALDURAN = 40, // Bouldercrag's War Horn can only be used within 10 yards of Valduran the Stormborn. + SPELL_CUSTOM_ERROR_NO_PASSENGER = 41, // You are not carrying a passenger. There is nobody to drop off. + SPELL_CUSTOM_ERROR_CANT_BUILD_MORE_VEHICLES = 42, // You cannot build any more siege vehicles. + SPELL_CUSTOM_ERROR_ALREADY_CARRYING_CRUSADER = 43, // You are already carrying a captured Argent Crusader. You must return to the Argent Vanguard infirmary and drop off your passenger before you may pick up another. + SPELL_CUSTOM_ERROR_CANT_DO_WHILE_ROOTED = 44, // You can't do that while rooted. + SPELL_CUSTOM_ERROR_REQUIRES_NEARBY_TARGET = 45, // Requires a nearby target. + SPELL_CUSTOM_ERROR_NOTHING_TO_DISCOVER = 46, // Nothing left to discover. + SPELL_CUSTOM_ERROR_NOT_ENOUGH_TARGETS = 47, // No targets close enough to bluff. + SPELL_CUSTOM_ERROR_CONSTRUCT_TOO_FAR = 48, // Your Iron Rune Construct is out of range. + SPELL_CUSTOM_ERROR_REQUIRES_GRAND_MASTER_ENGINEER = 49, // Requires Grand Master Engineer + SPELL_CUSTOM_ERROR_CANT_USE_THAT_MOUNT = 50, // You can't use that mount. + SPELL_CUSTOM_ERROR_NOONE_TO_EJECT = 51, // There is nobody to eject! + SPELL_CUSTOM_ERROR_TARGET_MUST_BE_BOUND = 52, // The target must be bound to you. + SPELL_CUSTOM_ERROR_TARGET_MUST_BE_UNDEAD = 53, // Target must be undead. + SPELL_CUSTOM_ERROR_TARGET_TOO_FAR = 54, // You have no target or your target is too far away. + SPELL_CUSTOM_ERROR_MISSING_DARK_MATTER = 55, // Missing Reagents: Dark Matter + SPELL_CUSTOM_ERROR_CANT_USE_THAT_ITEM = 56, // You can't use that item + SPELL_CUSTOM_ERROR_CANT_DO_WHILE_CYCYLONED = 57, // You can't do that while Cycloned + SPELL_CUSTOM_ERROR_TARGET_HAS_SCROLL = 58, // Target is already affected by a scroll + SPELL_CUSTOM_ERROR_POISON_TOO_STRONG = 59, // That anti-venom is not strong enough to dispel that poison + SPELL_CUSTOM_ERROR_MUST_HAVE_LANCE_EQUIPPED = 60, // You must have a lance equipped. + SPELL_CUSTOM_ERROR_MUST_BE_CLOSE_TO_MAIDEN = 61, // You must be near the Maiden of Winter's Breath Lake. + SPELL_CUSTOM_ERROR_LEARNED_EVERYTHING = 62, // You have learned everything from that book + SPELL_CUSTOM_ERROR_PET_IS_DEAD = 63, // Your pet is dead + SPELL_CUSTOM_ERROR_NO_VALID_TARGETS = 64, // There are no valid targets within range. + SPELL_CUSTOM_ERROR_GM_ONLY = 65, // Only GMs may use that. Your account has been reported for investigation. + SPELL_CUSTOM_ERROR_REQUIRES_LEVEL_58 = 66, // You must reach level 58 to use this portal. + SPELL_CUSTOM_ERROR_AT_HONOR_CAP = 67, // You already have the maximum amount of honor. + SPELL_CUSTOM_ERROR_MUST_HAVE_DEMONIC_CIRCLE = 75, // You must have a demonic circle active. + SPELL_CUSTOM_ERROR_AT_MAX_RAGE = 76, // You already have maximum rage + SPELL_CUSTOM_ERROR_REQUIRES_350_ENGINEERING = 77, // Requires Engineering (350) + SPELL_CUSTOM_ERROR_SOUL_BELONGS_TO_LICH_KING = 78, // Your soul belongs to the Lich King + SPELL_CUSTOM_ERROR_ATTENDANT_HAS_PONY = 79, // Your attendant already has an Argent Pony + SPELL_CUSTOM_ERROR_MUST_HAVE_FIRE_TOTEM = 83, // You must have a Fire Totem active. + SPELL_CUSTOM_ERROR_CANT_TARGET_VAMPIRES = 84, // You may not bite other vampires. + SPELL_CUSTOM_ERROR_PET_ALREADY_AT_YOUR_LEVEL = 85, // Your pet is already at your level. + SPELL_CUSTOM_ERROR_MISSING_ITEM_REQUIREMENS = 86, // You do not meet the level requirements for this item. + SPELL_CUSTOM_ERROR_TOO_MANY_ABOMINATIONS = 87, // There are too many Mutated Abominations. + SPELL_CUSTOM_ERROR_ALL_POTIONS_USED = 88, // The potions have all been depleted by Professor Putricide. + SPELL_CUSTOM_ERROR_REQUIRES_LEVEL_65 = 90, // Requires level 65 +}; + enum StealthType { STEALTH_GENERAL = 0, @@ -1218,7 +1305,7 @@ enum Targets TARGET_DEST_CASTER_LEFT = 50, TARGET_GAMEOBJECT_AREA_SRC = 51, // If used with SPELL_EFFECT_ACTIVATE_OBJECT, appliccable GO entries should be specified in conditions table TARGET_GAMEOBJECT_AREA_DST = 52, // If used with SPELL_EFFECT_ACTIVATE_OBJECT, appliccable GO entries should be specified in conditions table - TARGET_DST_TARGET_ENEMY = 53, // set unit coordinates as dest, only 16 target B imlemented + TARGET_DST_TARGET_ENEMY = 53, TARGET_UNIT_CONE_ENEMY_UNKNOWN = 54, // 180 degree, or different angle TARGET_DEST_CASTER_FRONT_LEAP = 55, // for a leap spell TARGET_UNIT_RAID_CASTER = 56, @@ -1230,7 +1317,7 @@ enum Targets TARGET_TEST = 62, // for a test spell TARGET_DEST_TARGET_ANY = 63, TARGET_DEST_TARGET_FRONT = 64, - TARGET_DEST_TARGET_BACK = 65, // uses in teleport behind spells + TARGET_DEST_TARGET_BACK = 65, // uses in teleport behind spells TARGET_DEST_TARGET_RIGHT = 66, TARGET_DEST_TARGET_LEFT = 67, TARGET_DEST_TARGET_FRONT_LEFT = 68, @@ -1361,8 +1448,6 @@ enum GameobjectTypes #define MAX_GAMEOBJECT_TYPE 36 // sending to client this or greater value can crash client. -#define GAMEOBJECT_FISHINGNODE_ENTRY 35591 // Better to define it somewhere instead of hardcoding everywhere - enum GameObjectFlags { GO_FLAG_IN_USE = 0x00000001, //disables interaction while animated @@ -2134,7 +2219,7 @@ enum HolidayIds HOLIDAY_PILGRIMS_BOUNTY = 404, HOLIDAY_WOTLK_LAUNCH = 406, HOLIDAY_DAY_OF_DEAD = 409, - HOLIDAY_CALL_TO_ARMS_ISLE_OF_C = 420 + HOLIDAY_CALL_TO_ARMS_IC = 420 }; // values based at QuestInfo.dbc diff --git a/src/server/game/Movement/MotionMaster.cpp b/src/server/game/Movement/MotionMaster.cpp index 4474aa11a792e..5407e64dd69a4 100755 --- a/src/server/game/Movement/MotionMaster.cpp +++ b/src/server/game/Movement/MotionMaster.cpp @@ -305,7 +305,7 @@ void MotionMaster::MoveKnockbackFrom(float srcX, float srcY, float speedXY, floa float x, y, z; float dist = speedXY * speedZ * 0.1f; i_owner->GetNearPoint(i_owner, x, y, z, i_owner->GetObjectSize(), dist, i_owner->GetAngle(srcX, srcY) + M_PI); - MoveJump(x, y, z, speedXY, speedZ); + MoveJump(x, y, z, speedXY/speedZ, speedZ); } void MotionMaster::MoveJumpTo(float angle, float speedXY, float speedZ) @@ -323,7 +323,7 @@ void MotionMaster::MoveJumpTo(float angle, float speedXY, float speedZ) void MotionMaster::MoveJump(float x, float y, float z, float speedXY, float speedZ) { uint32 moveFlag = SPLINEFLAG_TRAJECTORY | SPLINEFLAG_WALKING; - uint32 time = uint32(speedXY * 100); + uint32 time = uint32(speedZ * 100); // Instantly interrupt non melee spells being casted if (i_owner->IsNonMeleeSpellCasted(true)) diff --git a/src/server/game/Movement/MovementGenerator.cpp b/src/server/game/Movement/MovementGenerator.cpp index fd5a840a66ed5..eee874f05acd9 100755 --- a/src/server/game/Movement/MovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerator.cpp @@ -22,4 +22,3 @@ MovementGenerator::~MovementGenerator() { } - diff --git a/src/server/game/Movement/MovementGenerator.h b/src/server/game/Movement/MovementGenerator.h index 67e280fc23e4b..5934a14d9be09 100755 --- a/src/server/game/Movement/MovementGenerator.h +++ b/src/server/game/Movement/MovementGenerator.h @@ -97,4 +97,3 @@ typedef FactoryHolder::FactoryHolderReg typedef FactoryHolder::FactoryHolderRepository MovementGeneratorRepository; #endif - diff --git a/src/server/game/Movement/MovementGeneratorImpl.h b/src/server/game/Movement/MovementGeneratorImpl.h index a6a7dab873742..6e6bf4b6e6249 100755 --- a/src/server/game/Movement/MovementGeneratorImpl.h +++ b/src/server/game/Movement/MovementGeneratorImpl.h @@ -29,4 +29,3 @@ MovementGeneratorFactory::Create(void * /*data*/) const } #endif - diff --git a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp index 91e24a167cc1f..9b4cf3f123172 100755 --- a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp @@ -182,4 +182,3 @@ template void ConfusedMovementGenerator::Reset(Creature &creature); template bool ConfusedMovementGenerator::Update(Player &player, const uint32 &diff); template bool ConfusedMovementGenerator::Update(Creature &creature, const uint32 &diff); - diff --git a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.h b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.h index ba234e936ef5f..597a85af53006 100755 --- a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.h @@ -54,4 +54,3 @@ class ConfusedMovementGenerator }; #endif - diff --git a/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.h b/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.h index df04eacbafaa4..2cccb99f81ee2 100755 --- a/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.h @@ -78,4 +78,3 @@ class TimedFleeingMovementGenerator #endif - diff --git a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp index 9a83d18efd4d0..461d27461fb32 100755 --- a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp @@ -60,7 +60,7 @@ HomeMovementGenerator::_setTargetLocation(Creature & owner) uint32 travel_time = i_destinationHolder.SetDestination(traveller, x, y, z); modifyTravelTime(travel_time); - owner.ClearUnitState(UNIT_STAT_ALL_STATE & ~UNIT_STAT_EVADE); + owner.ClearUnitState(uint32(UNIT_STAT_ALL_STATE & ~UNIT_STAT_EVADE)); } bool @@ -94,4 +94,3 @@ HomeMovementGenerator::Update(Creature &owner, const uint32& time_diff return true; } - diff --git a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.h b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.h index 8b2a38d52d528..82284bee0ce11 100755 --- a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.h @@ -55,4 +55,3 @@ class HomeMovementGenerator }; #endif - diff --git a/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.h b/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.h index 0b9604ff0ba77..12eb40777ed22 100755 --- a/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/IdleMovementGenerator.h @@ -77,4 +77,3 @@ class AssistanceDistractMovementGenerator : public DistractMovementGenerator #endif - diff --git a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h index 64bd51406e11a..03c547b5cdcdc 100755 --- a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h @@ -63,4 +63,3 @@ class AssistanceMovementGenerator #endif - diff --git a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp index 83e0f86f16da3..9918ad579b077 100755 --- a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp @@ -198,4 +198,3 @@ RandomMovementGenerator::Update(Creature &creature, const uint32 &diff return true; } - diff --git a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.h b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.h index 959d00606de6a..b7d7c7196d642 100755 --- a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.h @@ -51,4 +51,3 @@ class RandomMovementGenerator }; #endif - diff --git a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp index a6fddd0d098b1..8080b842e52f0 100755 --- a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp @@ -275,4 +275,3 @@ template bool TargetedMovementGenerator::Update(Creature &, const uint template Unit* TargetedMovementGenerator::GetTarget() const; template Unit* TargetedMovementGenerator::GetTarget() const; - diff --git a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h index 60e00d6764563..60ced2e8e413f 100755 --- a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h @@ -71,4 +71,3 @@ class TargetedMovementGenerator }; #endif - diff --git a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp index efae233df29a6..e3599b73cbd46 100755 --- a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp @@ -361,13 +361,12 @@ void FlightPathMovementGenerator::DoEventIfAny(Player& player, TaxiPathNodeEntry { 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()); + sLog->outDebug(LOG_FILTER_MAPSCRIPTS, "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... // @@ -694,4 +693,3 @@ int GetFCost(int to, int num, int parentNum, float *gcost) } #endif //__PATHFINDING__ - diff --git a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h index 8e6b5ec877c4d..3139f8cf104a4 100755 --- a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h @@ -129,4 +129,3 @@ public PathMovementBase }; #endif - diff --git a/src/server/game/OutdoorPvP/OutdoorPvP.cpp b/src/server/game/OutdoorPvP/OutdoorPvP.cpp index 53cf325ac379f..4d5fc13ac41e3 100755 --- a/src/server/game/OutdoorPvP/OutdoorPvP.cpp +++ b/src/server/game/OutdoorPvP/OutdoorPvP.cpp @@ -117,7 +117,7 @@ bool OPvPCapturePoint::AddCreature(uint32 type, uint32 entry, uint32 team, uint3 bool OPvPCapturePoint::SetCapturePointData(uint32 entry, uint32 map, float x, float y, float z, float o, float rotation0, float rotation1, float rotation2, float rotation3) { - sLog->outDebug("Creating capture point %u", entry); + sLog->outDebug(LOG_FILTER_OUTDOORPVP, "Creating capture point %u", entry); // check info existence GameObjectInfo const* goinfo = ObjectMgr::GetGameObjectInfo(entry); @@ -144,7 +144,7 @@ bool OPvPCapturePoint::DelCreature(uint32 type) { if (!m_Creatures[type]) { - sLog->outDebug("opvp creature type %u was already deleted",type); + sLog->outDebug(LOG_FILTER_OUTDOORPVP, "opvp creature type %u was already deleted",type); return false; } @@ -155,7 +155,7 @@ bool OPvPCapturePoint::DelCreature(uint32 type) m_Creatures[type] = 0; return false; } - sLog->outDebug("deleting opvp creature type %u",type); + sLog->outDebug(LOG_FILTER_OUTDOORPVP, "deleting opvp creature type %u",type); uint32 guid = cr->GetDBTableGUIDLow(); // Don't save respawn time cr->SetRespawnTime(0); @@ -250,7 +250,7 @@ void OutdoorPvP::HandlePlayerLeaveZone(Player * plr, uint32 /*zone*/) if (!plr->GetSession()->PlayerLogout()) SendRemoveWorldStates(plr); m_players[plr->GetTeamId()].erase(plr); - sLog->outDebug("Player %s left an outdoorpvp zone", plr->GetName()); + sLog->outDebug(LOG_FILTER_OUTDOORPVP, "Player %s left an outdoorpvp zone", plr->GetName()); } void OutdoorPvP::HandlePlayerResurrects(Player * /*plr*/, uint32 /*zone*/) diff --git a/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp b/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp index 4ccc31a47374f..ac79831a1da66 100755 --- a/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp +++ b/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp @@ -24,12 +24,12 @@ OutdoorPvPMgr::OutdoorPvPMgr() { m_UpdateTimer = 0; - //sLog->outDebug("Instantiating OutdoorPvPMgr"); + //sLog->outDebug(LOG_FILTER_OUTDOORPVP, "Instantiating OutdoorPvPMgr"); } OutdoorPvPMgr::~OutdoorPvPMgr() { - //sLog->outDebug("Deleting OutdoorPvPMgr"); + //sLog->outDebug(LOG_FILTER_OUTDOORPVP, "Deleting OutdoorPvPMgr"); for (OutdoorPvPSet::iterator itr = m_OutdoorPvPSet.begin(); itr != m_OutdoorPvPSet.end(); ++itr) delete *itr; @@ -125,7 +125,7 @@ void OutdoorPvPMgr::HandlePlayerEnterZone(Player *plr, uint32 zoneid) return; itr->second->HandlePlayerEnterZone(plr, zoneid); - sLog->outDebug("Player %u entered outdoorpvp id %u", plr->GetGUIDLow(), itr->second->GetTypeId()); + sLog->outDebug(LOG_FILTER_OUTDOORPVP, "Player %u entered outdoorpvp id %u", plr->GetGUIDLow(), itr->second->GetTypeId()); } void OutdoorPvPMgr::HandlePlayerLeaveZone(Player *plr, uint32 zoneid) @@ -139,7 +139,7 @@ void OutdoorPvPMgr::HandlePlayerLeaveZone(Player *plr, uint32 zoneid) return; itr->second->HandlePlayerLeaveZone(plr, zoneid); - sLog->outDebug("Player %u left outdoorpvp id %u",plr->GetGUIDLow(), itr->second->GetTypeId()); + sLog->outDebug(LOG_FILTER_OUTDOORPVP, "Player %u left outdoorpvp id %u",plr->GetGUIDLow(), itr->second->GetTypeId()); } OutdoorPvP * OutdoorPvPMgr::GetOutdoorPvPToZoneId(uint32 zoneid) diff --git a/src/server/game/Pools/PoolMgr.cpp b/src/server/game/Pools/PoolMgr.cpp index 519c64c9c5be5..fe79583ce52f4 100755 --- a/src/server/game/Pools/PoolMgr.cpp +++ b/src/server/game/Pools/PoolMgr.cpp @@ -364,7 +364,7 @@ void PoolGroup::Spawn1Object(PoolObject* obj) if (!map->Instanceable() && map->IsLoaded(data->posX, data->posY)) { Creature* pCreature = new Creature; - //sLog->outDebug("Spawning creature %u",guid); + //sLog->outDebug(LOG_FILTER_POOLSYS, "Spawning creature %u",guid); if (!pCreature->LoadFromDB(obj->guid, map)) { delete pCreature; @@ -390,7 +390,7 @@ void PoolGroup::Spawn1Object(PoolObject* obj) if (!map->Instanceable() && map->IsLoaded(data->posX, data->posY)) { GameObject* pGameobject = new GameObject; - //sLog->outDebug("Spawning gameobject %u", guid); + //sLog->outDebug(LOG_FILTER_POOLSYS, "Spawning gameobject %u", guid); if (!pGameobject->LoadFromDB(obj->guid, map)) { delete pGameobject; @@ -421,7 +421,7 @@ void PoolGroup::Spawn1Object(PoolObject* obj) PooledQuestRelationBoundsNC qr = sPoolMgr->mQuestCreatureRelation.equal_range(obj->guid); for (PooledQuestRelation::iterator itr = qr.first; itr != qr.second; ++itr) { - sLog->outDebug("PoolGroup: Adding quest %u to creature %u", itr->first, itr->second); + sLog->outDebug(LOG_FILTER_POOLSYS, "PoolGroup: Adding quest %u to creature %u", itr->first, itr->second); questMap->insert(QuestRelations::value_type(itr->second, itr->first)); } @@ -430,7 +430,7 @@ void PoolGroup::Spawn1Object(PoolObject* obj) qr = sPoolMgr->mQuestGORelation.equal_range(obj->guid); for (PooledQuestRelation::iterator itr = qr.first; itr != qr.second; ++itr) { - sLog->outDebug("PoolGroup: Adding quest %u to GO %u", itr->first, itr->second); + sLog->outDebug(LOG_FILTER_POOLSYS, "PoolGroup: Adding quest %u to GO %u", itr->first, itr->second); questMap->insert(QuestRelations::value_type(itr->second, itr->first)); } } @@ -438,7 +438,7 @@ void PoolGroup::Spawn1Object(PoolObject* obj) template <> void PoolGroup::SpawnObject(ActivePoolData& spawns, uint32 limit, uint32 triggerFrom) { - sLog->outDebug("PoolGroup: Spawning pool %u", poolId); + sLog->outDebug(LOG_FILTER_POOLSYS, "PoolGroup: Spawning pool %u", poolId); // load state from db if (!triggerFrom) { @@ -536,403 +536,419 @@ void PoolGroup::ReSpawn1Object(PoolObject* /*obj*/) //////////////////////////////////////////////////////////// // Methods of class PoolMgr -PoolMgr::PoolMgr() +PoolMgr::PoolMgr() : max_pool_id(0) { } -void PoolMgr::LoadFromDB() +void PoolMgr::Initialize() { - uint32 oldMSTime = getMSTime(); - QueryResult result = WorldDatabase.Query("SELECT MAX(entry) FROM pool_template"); - if (!result) - { - sLog->outString(">> Loaded 0 object pools. DB table `pool_template` is empty."); - sLog->outString(); - return; - } - else + if (result) { Field *fields = result->Fetch(); max_pool_id = fields[0].GetUInt32(); } mPoolTemplate.resize(max_pool_id + 1); + mPoolCreatureGroups.resize(max_pool_id + 1); + mPoolGameobjectGroups.resize(max_pool_id + 1); + mPoolPoolGroups.resize(max_pool_id + 1); + mPoolQuestGroups.resize(max_pool_id + 1); - result = WorldDatabase.Query("SELECT entry,max_limit FROM pool_template"); - if (!result) - { - mPoolTemplate.clear(); - sLog->outString(">> Loaded 0 object pools. DB table `pool_template` is empty."); - sLog->outString(); - return; - } - - uint32 count = 0; + mQuestSearchMap.clear(); + mGameobjectSearchMap.clear(); + mCreatureSearchMap.clear(); +} - do +void PoolMgr::LoadFromDB() +{ + // Pool templates { - ++count; - Field *fields = result->Fetch(); - - - uint32 pool_id = fields[0].GetUInt32(); + uint32 oldMSTime = getMSTime(); - PoolTemplateData& pPoolTemplate = mPoolTemplate[pool_id]; - pPoolTemplate.MaxLimit = fields[1].GetUInt32(); - - } while (result->NextRow()); + QueryResult result = WorldDatabase.Query("SELECT entry,max_limit FROM pool_template"); + if (!result) + { + mPoolTemplate.clear(); + sLog->outString(">> Loaded 0 object pools. DB table `pool_template` is empty."); + sLog->outString(); + return; + } - sLog->outString(">> Loaded %u objects pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + uint32 count = 0; + do + { + Field *fields = result->Fetch(); - // Creatures + uint32 pool_id = fields[0].GetUInt32(); - sLog->outString("Loading Creatures Pooling Data..."); - oldMSTime = getMSTime(); + PoolTemplateData& pPoolTemplate = mPoolTemplate[pool_id]; + pPoolTemplate.MaxLimit = fields[1].GetUInt32(); - mPoolCreatureGroups.resize(max_pool_id + 1); - mCreatureSearchMap.clear(); - // 1 2 3 - result = WorldDatabase.Query("SELECT guid, pool_entry, chance FROM pool_creature"); + ++count; + } + while (result->NextRow()); - count = 0; - if (!result) - { - sLog->outString(">> Loaded 0 creatures in pools. DB table `pool_creature` is empty."); + sLog->outString(">> Loaded %u objects pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); sLog->outString(); } - else - { - do - { - Field *fields = result->Fetch(); + // Creatures + sLog->outString("Loading Creatures Pooling Data..."); + { + uint32 oldMSTime = getMSTime(); - uint32 guid = fields[0].GetUInt32(); - uint32 pool_id = fields[1].GetUInt32(); - float chance = fields[2].GetFloat(); + // 1 2 3 + QueryResult result = WorldDatabase.Query("SELECT guid, pool_entry, chance FROM pool_creature"); - CreatureData const* data = sObjectMgr->GetCreatureData(guid); - if (!data) - { - sLog->outErrorDb("`pool_creature` has a non existing creature spawn (GUID: %u) defined for pool id (%u), skipped.", guid, pool_id); - continue; - } - if (pool_id > max_pool_id) - { - sLog->outErrorDb("`pool_creature` pool id (%u) is out of range compared to max pool id in `pool_template`, skipped.",pool_id); - continue; - } - if (chance < 0 || chance > 100) + if (!result) + { + sLog->outString(">> Loaded 0 creatures in pools. DB table `pool_creature` is empty."); + sLog->outString(); + } + else + { + uint32 count = 0; + do { - sLog->outErrorDb("`pool_creature` has an invalid chance (%f) for creature guid (%u) in pool id (%u), skipped.", chance, guid, pool_id); - continue; - } - PoolTemplateData *pPoolTemplate = &mPoolTemplate[pool_id]; - ++count; - - PoolObject plObject = PoolObject(guid, chance); - PoolGroup& cregroup = mPoolCreatureGroups[pool_id]; - cregroup.SetPoolId(pool_id); - cregroup.AddEntry(plObject, pPoolTemplate->MaxLimit); - SearchPair p(guid, pool_id); - mCreatureSearchMap.insert(p); + Field *fields = result->Fetch(); - } while (result->NextRow()); + uint32 guid = fields[0].GetUInt32(); + uint32 pool_id = fields[1].GetUInt32(); + float chance = fields[2].GetFloat(); + CreatureData const* data = sObjectMgr->GetCreatureData(guid); + if (!data) + { + sLog->outErrorDb("`pool_creature` has a non existing creature spawn (GUID: %u) defined for pool id (%u), skipped.", guid, pool_id); + continue; + } + if (pool_id > max_pool_id) + { + sLog->outErrorDb("`pool_creature` pool id (%u) is out of range compared to max pool id in `pool_template`, skipped.",pool_id); + continue; + } + if (chance < 0 || chance > 100) + { + sLog->outErrorDb("`pool_creature` has an invalid chance (%f) for creature guid (%u) in pool id (%u), skipped.", chance, guid, pool_id); + continue; + } + PoolTemplateData *pPoolTemplate = &mPoolTemplate[pool_id]; + PoolObject plObject = PoolObject(guid, chance); + PoolGroup& cregroup = mPoolCreatureGroups[pool_id]; + cregroup.SetPoolId(pool_id); + cregroup.AddEntry(plObject, pPoolTemplate->MaxLimit); + SearchPair p(guid, pool_id); + mCreatureSearchMap.insert(p); + + ++count; + } + while (result->NextRow()); - sLog->outString(">> Loaded %u creatures in pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + sLog->outString(">> Loaded %u creatures in pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); + } } // Gameobjects sLog->outString("Loading Gameobject Pooling Data..."); - - mPoolGameobjectGroups.resize(max_pool_id + 1); - mGameobjectSearchMap.clear(); - // 1 2 3 - result = WorldDatabase.Query("SELECT guid, pool_entry, chance FROM pool_gameobject"); - - count = 0; - if (!result) - { - sLog->outString(">> Loaded 0 gameobjects in pools. DB table `pool_gameobject` is empty."); - sLog->outString(); - } - else { + uint32 oldMSTime = getMSTime(); - do + // 1 2 3 + QueryResult result = WorldDatabase.Query("SELECT guid, pool_entry, chance FROM pool_gameobject"); + + if (!result) { - Field *fields = result->Fetch(); + sLog->outString(">> Loaded 0 gameobjects in pools. DB table `pool_gameobject` is empty."); + sLog->outString(); + } + else + { + uint32 count = 0; + do + { + Field *fields = result->Fetch(); + uint32 guid = fields[0].GetUInt32(); + uint32 pool_id = fields[1].GetUInt32(); + float chance = fields[2].GetFloat(); - uint32 guid = fields[0].GetUInt32(); - uint32 pool_id = fields[1].GetUInt32(); - float chance = fields[2].GetFloat(); + GameObjectData const* data = sObjectMgr->GetGOData(guid); + if (!data) + { + sLog->outErrorDb("`pool_gameobject` has a non existing gameobject spawn (GUID: %u) defined for pool id (%u), skipped.", guid, pool_id); + continue; + } - GameObjectData const* data = sObjectMgr->GetGOData(guid); - if (!data) - { - sLog->outErrorDb("`pool_gameobject` has a non existing gameobject spawn (GUID: %u) defined for pool id (%u), skipped.", guid, pool_id); - continue; - } - GameObjectInfo const* goinfo = ObjectMgr::GetGameObjectInfo(data->id); - if (goinfo->type != GAMEOBJECT_TYPE_CHEST && - goinfo->type != GAMEOBJECT_TYPE_GOOBER && - goinfo->type != GAMEOBJECT_TYPE_FISHINGHOLE) - { - sLog->outErrorDb("`pool_gameobject` has a not lootable gameobject spawn (GUID: %u, type: %u) defined for pool id (%u), skipped.", guid, goinfo->type, pool_id); - continue; - } - if (pool_id > max_pool_id) - { - sLog->outErrorDb("`pool_gameobject` pool id (%u) is out of range compared to max pool id in `pool_template`, skipped.",pool_id); - continue; - } - if (chance < 0 || chance > 100) - { - sLog->outErrorDb("`pool_gameobject` has an invalid chance (%f) for gameobject guid (%u) in pool id (%u), skipped.", chance, guid, pool_id); - continue; - } - PoolTemplateData *pPoolTemplate = &mPoolTemplate[pool_id]; + GameObjectInfo const* goinfo = ObjectMgr::GetGameObjectInfo(data->id); + if (goinfo->type != GAMEOBJECT_TYPE_CHEST && + goinfo->type != GAMEOBJECT_TYPE_GOOBER && + goinfo->type != GAMEOBJECT_TYPE_FISHINGHOLE) + { + sLog->outErrorDb("`pool_gameobject` has a not lootable gameobject spawn (GUID: %u, type: %u) defined for pool id (%u), skipped.", guid, goinfo->type, pool_id); + continue; + } - ++count; + if (pool_id > max_pool_id) + { + sLog->outErrorDb("`pool_gameobject` pool id (%u) is out of range compared to max pool id in `pool_template`, skipped.",pool_id); + continue; + } - PoolObject plObject = PoolObject(guid, chance); - PoolGroup& gogroup = mPoolGameobjectGroups[pool_id]; - gogroup.SetPoolId(pool_id); - gogroup.AddEntry(plObject, pPoolTemplate->MaxLimit); - SearchPair p(guid, pool_id); - mGameobjectSearchMap.insert(p); + if (chance < 0 || chance > 100) + { + sLog->outErrorDb("`pool_gameobject` has an invalid chance (%f) for gameobject guid (%u) in pool id (%u), skipped.", chance, guid, pool_id); + continue; + } - } while (result->NextRow()); + PoolTemplateData *pPoolTemplate = &mPoolTemplate[pool_id]; + PoolObject plObject = PoolObject(guid, chance); + PoolGroup& gogroup = mPoolGameobjectGroups[pool_id]; + gogroup.SetPoolId(pool_id); + gogroup.AddEntry(plObject, pPoolTemplate->MaxLimit); + SearchPair p(guid, pool_id); + mGameobjectSearchMap.insert(p); - sLog->outString(">> Loaded %u gameobject in pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); + ++count; + } + while (result->NextRow()); + + sLog->outString(">> Loaded %u gameobject in pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); + } } // Pool of pools sLog->outString("Loading Mother Pooling Data..."); - oldMSTime = getMSTime(); - - mPoolPoolGroups.resize(max_pool_id + 1); - // 1 2 3 - result = WorldDatabase.Query("SELECT pool_id, mother_pool, chance FROM pool_pool"); - - count = 0; - if (!result) - { - sLog->outString(">> Loaded 0 pools in pools"); - sLog->outString(); - } - else { + uint32 oldMSTime = getMSTime(); - do - { - Field *fields = result->Fetch(); + // 1 2 3 + QueryResult result = WorldDatabase.Query("SELECT pool_id, mother_pool, chance FROM pool_pool"); + if (!result) + { + sLog->outString(">> Loaded 0 pools in pools"); + sLog->outString(); + } + else + { + uint32 count = 0; + do + { + Field *fields = result->Fetch(); - uint32 child_pool_id = fields[0].GetUInt32(); - uint32 mother_pool_id = fields[1].GetUInt32(); - float chance = fields[2].GetFloat(); + uint32 child_pool_id = fields[0].GetUInt32(); + uint32 mother_pool_id = fields[1].GetUInt32(); + float chance = fields[2].GetFloat(); - if (mother_pool_id > max_pool_id) - { - sLog->outErrorDb("`pool_pool` mother_pool id (%u) is out of range compared to max pool id in `pool_template`, skipped.",mother_pool_id); - continue; - } - if (child_pool_id > max_pool_id) - { - sLog->outErrorDb("`pool_pool` included pool_id (%u) is out of range compared to max pool id in `pool_template`, skipped.",child_pool_id); - continue; - } - if (mother_pool_id == child_pool_id) - { - sLog->outErrorDb("`pool_pool` pool_id (%u) includes itself, dead-lock detected, skipped.",child_pool_id); - continue; + if (mother_pool_id > max_pool_id) + { + sLog->outErrorDb("`pool_pool` mother_pool id (%u) is out of range compared to max pool id in `pool_template`, skipped.",mother_pool_id); + continue; + } + if (child_pool_id > max_pool_id) + { + sLog->outErrorDb("`pool_pool` included pool_id (%u) is out of range compared to max pool id in `pool_template`, skipped.",child_pool_id); + continue; + } + if (mother_pool_id == child_pool_id) + { + sLog->outErrorDb("`pool_pool` pool_id (%u) includes itself, dead-lock detected, skipped.",child_pool_id); + continue; + } + if (chance < 0 || chance > 100) + { + sLog->outErrorDb("`pool_pool` has an invalid chance (%f) for pool id (%u) in mother pool id (%u), skipped.", chance, child_pool_id, mother_pool_id); + continue; + } + PoolTemplateData *pPoolTemplateMother = &mPoolTemplate[mother_pool_id]; + PoolObject plObject = PoolObject(child_pool_id, chance); + PoolGroup& plgroup = mPoolPoolGroups[mother_pool_id]; + plgroup.SetPoolId(mother_pool_id); + plgroup.AddEntry(plObject, pPoolTemplateMother->MaxLimit); + SearchPair p(child_pool_id, mother_pool_id); + mPoolSearchMap.insert(p); + + ++count; } - if (chance < 0 || chance > 100) + while (result->NextRow()); + + // Now check for circular reference + for (uint32 i=0; ioutErrorDb("`pool_pool` has an invalid chance (%f) for pool id (%u) in mother pool id (%u), skipped.", chance, child_pool_id, mother_pool_id); - continue; + std::set checkedPools; + for (SearchMap::iterator poolItr = mPoolSearchMap.find(i); poolItr != mPoolSearchMap.end(); poolItr = mPoolSearchMap.find(poolItr->second)) + { + checkedPools.insert(poolItr->first); + if (checkedPools.find(poolItr->second) != checkedPools.end()) + { + std::ostringstream ss; + ss<< "The pool(s) "; + for (std::set::const_iterator itr=checkedPools.begin(); itr != checkedPools.end(); ++itr) + ss << *itr << " "; + ss << "create(s) a circular reference, which can cause the server to freeze.\nRemoving the last link between mother pool " + << poolItr->first << " and child pool " << poolItr->second; + sLog->outErrorDb("%s", ss.str().c_str()); + mPoolPoolGroups[poolItr->second].RemoveOneRelation(poolItr->first); + mPoolSearchMap.erase(poolItr); + --count; + break; + } + } } - PoolTemplateData *pPoolTemplateMother = &mPoolTemplate[mother_pool_id]; - ++count; + sLog->outString(">> Loaded %u pools in mother pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); + } + } - PoolObject plObject = PoolObject(child_pool_id, chance); - PoolGroup& plgroup = mPoolPoolGroups[mother_pool_id]; - plgroup.SetPoolId(mother_pool_id); - plgroup.AddEntry(plObject, pPoolTemplateMother->MaxLimit); - SearchPair p(child_pool_id, mother_pool_id); - mPoolSearchMap.insert(p); + sLog->outString("Loading Quest Pooling Data..."); + { + uint32 oldMSTime = getMSTime(); - } while (result->NextRow()); + PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_LOAD_QUEST_POOLS); + PreparedQueryResult result = WorldDatabase.Query(stmt); - // Now check for circular reference - for (uint32 i=0; i checkedPools; - for (SearchMap::iterator poolItr = mPoolSearchMap.find(i); poolItr != mPoolSearchMap.end(); poolItr = mPoolSearchMap.find(poolItr->second)) - { - checkedPools.insert(poolItr->first); - if (checkedPools.find(poolItr->second) != checkedPools.end()) - { - std::ostringstream ss; - ss<< "The pool(s) "; - for (std::set::const_iterator itr=checkedPools.begin(); itr != checkedPools.end(); ++itr) - ss << *itr << " "; - ss << "create(s) a circular reference, which can cause the server to freeze.\nRemoving the last link between mother pool " - << poolItr->first << " and child pool " << poolItr->second; - sLog->outErrorDb("%s", ss.str().c_str()); - mPoolPoolGroups[poolItr->second].RemoveOneRelation(poolItr->first); - mPoolSearchMap.erase(poolItr); - --count; - break; - } - } + sLog->outString(">> Loaded 0 quests in pools"); + sLog->outString(); } + else + { + PooledQuestRelationBounds creBounds; + PooledQuestRelationBounds goBounds; - sLog->outString(">> Loaded %u pools in mother pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); - } -} + enum eQuestTypes + { + QUEST_NONE = 0, + QUEST_DAILY = 1, + QUEST_WEEKLY = 2 + }; -void PoolMgr::LoadQuestPools() -{ - uint32 oldMSTime = getMSTime(); + std::map poolTypeMap; + uint32 count = 0; + do + { + Field* fields = result->Fetch(); - PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_LOAD_QUEST_POOLS); - PreparedQueryResult result = WorldDatabase.Query(stmt); + uint32 entry = fields[0].GetUInt32(); + uint32 pool_id = fields[1].GetUInt32(); - mQuestSearchMap.clear(); - mPoolQuestGroups.resize(max_pool_id + 1); + Quest const* pQuest = sObjectMgr->GetQuestTemplate(entry); + if (!pQuest) + { + sLog->outErrorDb("`pool_quest` has a non existing quest template (Entry: %u) defined for pool id (%u), skipped.", entry, pool_id); + continue; + } - uint32 count = 0; - if (!result) - { - sLog->outString(">> Loaded 0 quests in pools"); - sLog->outString(); - return; - } + if (pool_id > max_pool_id) + { + sLog->outErrorDb("`pool_quest` pool id (%u) is out of range compared to max pool id in `pool_template`, skipped.",pool_id); + continue; + } - PooledQuestRelationBounds creBounds; - PooledQuestRelationBounds goBounds; + if (!pQuest->IsDailyOrWeekly()) + { + sLog->outErrorDb("`pool_quest` has an quest (%u) which is not daily or weekly in pool id (%u), use ExclusiveGroup instead, skipped.", entry, pool_id); + continue; + } - enum eQuestTypes - { - QUEST_NONE = 0, - QUEST_DAILY = 1, - QUEST_WEEKLY = 2 - }; + if (poolTypeMap[pool_id] == QUEST_NONE) + poolTypeMap[pool_id] = pQuest->IsDaily() ? QUEST_DAILY : QUEST_WEEKLY; - std::map poolTypeMap; + int32 currType = pQuest->IsDaily() ? QUEST_DAILY : QUEST_WEEKLY; - do - { + if (poolTypeMap[pool_id] != currType) + { + sLog->outErrorDb("`pool_quest` quest %u is %s but pool (%u) is specified for %s, mixing not allowed, skipped.", + entry, currType == QUEST_DAILY ? "QUEST_DAILY" : "QUEST_WEEKLY", pool_id, poolTypeMap[pool_id] == QUEST_DAILY ? "QUEST_DAILY" : "QUEST_WEEKLY"); + continue; + } - Field* fields = result->Fetch(); + creBounds = mQuestCreatureRelation.equal_range(entry); + goBounds = mQuestGORelation.equal_range(entry); - uint32 entry = fields[0].GetUInt32(); - uint32 pool_id = fields[1].GetUInt32(); + if (creBounds.first == creBounds.second && goBounds.first == goBounds.second) + { + sLog->outErrorDb("`pool_quest` lists entry (%u) as member of pool (%u) but is not started anywhere, skipped.", entry, pool_id); + continue; + } - Quest const* pQuest = sObjectMgr->GetQuestTemplate(entry); - if (!pQuest) - { - sLog->outErrorDb("`pool_quest` has a non existing quest template (Entry: %u) defined for pool id (%u), skipped.", entry, pool_id); - continue; - } + PoolTemplateData *pPoolTemplate = &mPoolTemplate[pool_id]; + PoolObject plObject = PoolObject(entry, 0.0f); + PoolGroup& questgroup = mPoolQuestGroups[pool_id]; + questgroup.SetPoolId(pool_id); + questgroup.AddEntry(plObject, pPoolTemplate->MaxLimit); + SearchPair p(entry, pool_id); + mQuestSearchMap.insert(p); - if (pool_id > max_pool_id) - { - sLog->outErrorDb("`pool_quest` pool id (%u) is out of range compared to max pool id in `pool_template`, skipped.",pool_id); - continue; - } + ++count; + } + while (result->NextRow()); - if (!pQuest->IsDailyOrWeekly()) - { - sLog->outErrorDb("`pool_quest` has an quest (%u) which is not daily or weekly in pool id (%u), use ExclusiveGroup instead, skipped.", entry, pool_id); - continue; + sLog->outString(">> Loaded %u quests in pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); } + } - if (poolTypeMap[pool_id] == QUEST_NONE) - poolTypeMap[pool_id] = pQuest->IsDaily() ? QUEST_DAILY : QUEST_WEEKLY; + // 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 + sLog->outString("Starting objects pooling system..."); + { + uint32 oldMSTime = getMSTime(); - int32 currType = pQuest->IsDaily() ? QUEST_DAILY : QUEST_WEEKLY; + QueryResult 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"); - if (poolTypeMap[pool_id] != currType) + if (!result) { - sLog->outErrorDb("`pool_quest` quest %u is %s but pool (%u) is specified for %s, mixing not allowed, skipped.", entry, currType == QUEST_DAILY ? "QUEST_DAILY" : "QUEST_WEEKLY", pool_id, poolTypeMap[pool_id] == QUEST_DAILY ? "QUEST_DAILY" : "QUEST_WEEKLY"); - continue; + sLog->outString(">> Pool handling system initialized, 0 pools spawned."); + sLog->outString(); } - - creBounds = mQuestCreatureRelation.equal_range(entry); - goBounds = mQuestGORelation.equal_range(entry); - - if (creBounds.first == creBounds.second && goBounds.first == goBounds.second) + else { - sLog->outErrorDb("`pool_quest` lists entry (%u) as member of pool (%u) but is not started anywhere, skipped.", entry, pool_id); - continue; - } - + uint32 count = 0; + do + { + Field *fields = result->Fetch(); + uint32 pool_entry = fields[0].GetUInt32(); + uint32 pool_pool_id = fields[1].GetUInt32(); - PoolTemplateData *pPoolTemplate = &mPoolTemplate[pool_id]; - ++count; + if (!CheckPool(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].GetUInt32()); + 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; + } - PoolObject plObject = PoolObject(entry, 0.0f); - PoolGroup& questgroup = mPoolQuestGroups[pool_id]; - questgroup.SetPoolId(pool_id); - questgroup.AddEntry(plObject, pPoolTemplate->MaxLimit); - SearchPair p(entry, pool_id); - mQuestSearchMap.insert(p); + // Don't spawn child pools, they are spawned recursively by their parent pools + if (!pool_pool_id) + { + SpawnPool(pool_entry); + count++; + } + } + while (result->NextRow()); + sLog->outBasic("Pool handling system initialized, %u pools spawned in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); + } } - while (result->NextRow()); - - sLog->outString(">> Loaded %u quests in pools in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); } -// 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 PoolMgr::Initialize() +void PoolMgr::LoadQuestPools() { - QueryResult 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) - { - do - { - Field *fields = result->Fetch(); - uint32 pool_entry = fields[0].GetUInt32(); - uint32 pool_pool_id = fields[1].GetUInt32(); - - if (!CheckPool(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].GetUInt32()); - 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; - } - - // Don't spawn child pools, they are spawned recursively by their parent pools - if (!pool_pool_id) - { - SpawnPool(pool_entry); - count++; - } - } while (result->NextRow()); - } - sLog->outBasic("Pool handling system initialized, %u pools spawned.", count); } void PoolMgr::SaveQuestsToDB() diff --git a/src/server/game/Scripting/MapScripts.cpp b/src/server/game/Scripting/MapScripts.cpp index 507e40b67d3cc..7460acf43ef24 100755 --- a/src/server/game/Scripting/MapScripts.cpp +++ b/src/server/game/Scripting/MapScripts.cpp @@ -324,7 +324,7 @@ void Map::ScriptsProcess() { if ((*iter)->GetGUID() == step.sourceGUID) { - source = reinterpret_cast(*iter); + source = *iter; break; } } diff --git a/src/server/game/Scripting/ScriptLoader.cpp b/src/server/game/Scripting/ScriptLoader.cpp index 0d4461e76e59f..ecdfec6bc6da4 100755 --- a/src/server/game/Scripting/ScriptLoader.cpp +++ b/src/server/game/Scripting/ScriptLoader.cpp @@ -17,7 +17,6 @@ #include "ScriptLoader.h" - //examples void AddSC_example_creature(); void AddSC_example_escort(); @@ -320,6 +319,7 @@ void AddSC_wailing_caverns(); //Wailing caverns void AddSC_instance_wailing_caverns(); void AddSC_zulfarrak(); //Zul'Farrak generic void AddSC_instance_zulfarrak(); //Zul'Farrak instance script +void AddSC_npc_pusillin(); //Dire Maul Pusillin void AddSC_ashenvale(); void AddSC_azshara(); @@ -401,6 +401,8 @@ void AddSC_boss_varos(); void AddSC_boss_eregos(); void AddSC_instance_oculus(); void AddSC_oculus(); +void AddSC_boss_malygos(); // The Nexus: Eye of Eternity +void AddSC_instance_eye_of_eternity(); void AddSC_boss_sartharion(); //Obsidian Sanctum void AddSC_instance_obsidian_sanctum(); void AddSC_boss_bjarngrim(); //Ulduar Halls of Lightning @@ -927,6 +929,7 @@ void AddKalimdorScripts() AddSC_instance_wailing_caverns(); AddSC_zulfarrak(); //Zul'Farrak generic AddSC_instance_zulfarrak(); //Zul'Farrak instance script + AddSC_npc_pusillin(); //Dire maul npc Pusillin AddSC_ashenvale(); AddSC_azshara(); @@ -1098,6 +1101,8 @@ void AddNorthrendScripts() AddSC_boss_eregos(); AddSC_instance_oculus(); AddSC_oculus(); + AddSC_boss_malygos(); // The Nexus: Eye of Eternity + AddSC_instance_eye_of_eternity(); AddSC_boss_sartharion(); //Obsidian Sanctum AddSC_instance_obsidian_sanctum(); AddSC_boss_bjarngrim(); //Ulduar Halls of Lightning @@ -1218,6 +1223,7 @@ void AddBattlegroundScripts() void AddSC_npc_guildhouses(); void AddSC_npc_lottery(); void AddSC_npcs_mini_boss(); +void AddSC_npc_zingara(); #endif void AddCustomScripts() @@ -1227,5 +1233,6 @@ void AddCustomScripts() AddSC_npc_guildhouses(); AddSC_npc_lottery(); AddSC_npcs_mini_boss(); + AddSC_npc_zingara(); #endif } diff --git a/src/server/game/Scripting/ScriptMgr.cpp b/src/server/game/Scripting/ScriptMgr.cpp index 8b97aa2a03ffe..ff127a45889ad 100755 --- a/src/server/game/Scripting/ScriptMgr.cpp +++ b/src/server/game/Scripting/ScriptMgr.cpp @@ -78,7 +78,7 @@ void DoScriptText(int32 iTextEntry, WorldObject* pSource, Unit* pTarget) return; } - sLog->outDebug("TSCR: DoScriptText: text entry=%i, Sound=%u, Type=%u, Language=%u, Emote=%u", iTextEntry, pData->uiSoundId, pData->uiType, pData->uiLanguage, pData->uiEmote); + sLog->outDebug(LOG_FILTER_TSCR, "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) { @@ -140,6 +140,25 @@ ScriptMgr::ScriptMgr() } ScriptMgr::~ScriptMgr() +{ +} + +void ScriptMgr::Initialize() +{ + uint32 oldMSTime = getMSTime(); + + LoadDatabase(); + + sLog->outString("Loading C++ scripts"); + + FillSpellSummary(); + AddScripts(); + + sLog->outString(">> Loaded %u C++ scripts in %u ms", GetScriptCount(), GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(); +} + +void ScriptMgr::Unload() { #define SCR_CLEAR(T) \ FOR_SCRIPTS(T, itr, end) \ @@ -175,21 +194,6 @@ ScriptMgr::~ScriptMgr() #undef SCR_CLEAR } -void ScriptMgr::Initialize() -{ - uint32 oldMSTime = getMSTime(); - - LoadDatabase(); - - sLog->outString("Loading C++ scripts"); - - FillSpellSummary(); - AddScripts(); - - sLog->outString(">> Loaded %u C++ scripts in %u ms", GetScriptCount(), GetMSTimeDiffToNow(oldMSTime)); - sLog->outString(); -} - void ScriptMgr::LoadDatabase() { sScriptSystemMgr->LoadVersion(); @@ -418,7 +422,7 @@ void ScriptMgr::OnShutdownCancel() void ScriptMgr::OnWorldUpdate(uint32 diff) { - FOREACH_SCRIPT(WorldScript)->OnUpdate(NULL, diff); + FOREACH_SCRIPT(WorldScript)->OnUpdate(diff); } void ScriptMgr::OnHonorCalculation(float& honor, uint8 level, float multiplier) @@ -954,15 +958,6 @@ void ScriptMgr::OnUninstall(Vehicle* veh) tmpscript->OnUninstall(veh); } -void ScriptMgr::OnDie(Vehicle* veh) -{ - ASSERT(veh); - ASSERT(veh->GetBase()->GetTypeId() == TYPEID_UNIT); - - GET_SCRIPT(VehicleScript, veh->GetBase()->ToCreature()->GetScriptId(), tmpscript); - tmpscript->OnDie(veh); -} - void ScriptMgr::OnReset(Vehicle* veh) { ASSERT(veh); diff --git a/src/server/game/Scripting/ScriptMgr.h b/src/server/game/Scripting/ScriptMgr.h index 090da69903207..85c8dfbc86620 100755 --- a/src/server/game/Scripting/ScriptMgr.h +++ b/src/server/game/Scripting/ScriptMgr.h @@ -261,7 +261,7 @@ class WorldScript : public ScriptObject, public UpdatableScript virtual void OnShutdownCancel() { } // Called on every world tick (don't execute too heavy code here). - virtual void OnUpdate(void* /*null*/, uint32 /*diff*/) { } + virtual void OnUpdate(uint32 /*diff*/) { } // Called when the world is started. virtual void OnStartup() { } @@ -584,9 +584,6 @@ class VehicleScript : public ScriptObject // Called after a vehicle is uninstalled. virtual void OnUninstall(Vehicle* /*veh*/) { } - // Called after a vehicle dies. - virtual void OnDie(Vehicle* /*veh*/) { } - // Called when a vehicle resets. virtual void OnReset(Vehicle* /*veh*/) { } @@ -763,7 +760,7 @@ class ScriptMgr friend class ScriptObject; ScriptMgr(); - ~ScriptMgr(); + virtual ~ScriptMgr(); uint32 _scriptCount; @@ -778,6 +775,9 @@ class ScriptMgr void IncrementScriptCount() { ++_scriptCount; } uint32 GetScriptCount() const { return _scriptCount; } + public: /* Unloading */ + void Unload(); + public: /* SpellScriptLoader */ void CreateSpellScripts(uint32 spell_id, std::list& script_vector); @@ -898,7 +898,6 @@ class ScriptMgr void OnInstall(Vehicle* veh); void OnUninstall(Vehicle* veh); - void OnDie(Vehicle* veh); void OnReset(Vehicle* veh); void OnInstallAccessory(Vehicle* veh, Creature* accessory); void OnAddPassenger(Vehicle* veh, Unit* passenger, int8 seatId); diff --git a/src/server/game/Server/Protocol/Handlers/AddonHandler.cpp b/src/server/game/Server/Protocol/Handlers/AddonHandler.cpp index 8ee110a6b528c..784126d96ce29 100755 --- a/src/server/game/Server/Protocol/Handlers/AddonHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/AddonHandler.cpp @@ -98,7 +98,7 @@ bool AddonHandler::BuildAddonPacket(WorldPacket *Source, WorldPacket *Target) AddOnPacked >> enabled >> crc >> unk2; - sLog->outDebug("ADDON: Name: %s, Enabled: 0x%x, CRC: 0x%x, Unknown2: 0x%x", addonName.c_str(), enabled, crc, unk2); + sLog->outDebug(LOG_FILTER_NETWORKIO, "ADDON: Name: %s, Enabled: 0x%x, CRC: 0x%x, Unknown2: 0x%x", addonName.c_str(), enabled, crc, unk2); uint8 state = (enabled ? 2 : 1); *Target << uint8(state); @@ -131,7 +131,7 @@ bool AddonHandler::BuildAddonPacket(WorldPacket *Source, WorldPacket *Target) *Target << uint32(count); if(AddOnPacked.rpos() != AddOnPacked.size()) - sLog->outDebug("packet under read!"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "packet under read!"); } else { diff --git a/src/server/game/Server/Protocol/Handlers/ArenaTeamHandler.cpp b/src/server/game/Server/Protocol/Handlers/ArenaTeamHandler.cpp index d51282be41b1f..c0e83dd222860 100755 --- a/src/server/game/Server/Protocol/Handlers/ArenaTeamHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/ArenaTeamHandler.cpp @@ -29,11 +29,11 @@ void WorldSession::HandleInspectArenaTeamsOpcode(WorldPacket & recv_data) { - sLog->outDebug("MSG_INSPECT_ARENA_TEAMS"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "MSG_INSPECT_ARENA_TEAMS"); uint64 guid; recv_data >> guid; - sLog->outDebug("Inspect Arena stats (GUID: %u TypeId: %u)", GUID_LOPART(guid),GuidHigh2TypeId(GUID_HIPART(guid))); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Inspect Arena stats (GUID: %u TypeId: %u)", GUID_LOPART(guid),GuidHigh2TypeId(GUID_HIPART(guid))); if (Player *plr = sObjectMgr->GetPlayer(guid)) { @@ -50,7 +50,7 @@ void WorldSession::HandleInspectArenaTeamsOpcode(WorldPacket & recv_data) void WorldSession::HandleArenaTeamQueryOpcode(WorldPacket & recv_data) { - sLog->outDebug("WORLD: Received CMSG_ARENA_TEAM_QUERY"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_ARENA_TEAM_QUERY"); uint32 ArenaTeamId; recv_data >> ArenaTeamId; @@ -64,7 +64,7 @@ void WorldSession::HandleArenaTeamQueryOpcode(WorldPacket & recv_data) void WorldSession::HandleArenaTeamRosterOpcode(WorldPacket & recv_data) { - sLog->outDebug("WORLD: Received CMSG_ARENA_TEAM_ROSTER"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_ARENA_TEAM_ROSTER"); uint32 ArenaTeamId; // arena team id recv_data >> ArenaTeamId; @@ -75,7 +75,7 @@ void WorldSession::HandleArenaTeamRosterOpcode(WorldPacket & recv_data) void WorldSession::HandleArenaTeamInviteOpcode(WorldPacket & recv_data) { - sLog->outDebug("CMSG_ARENA_TEAM_INVITE"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_ARENA_TEAM_INVITE"); uint32 ArenaTeamId; // arena team id std::string Invitedname; @@ -139,7 +139,7 @@ void WorldSession::HandleArenaTeamInviteOpcode(WorldPacket & recv_data) return; } - sLog->outDebug("Player %s Invited %s to Join his ArenaTeam", GetPlayer()->GetName(), Invitedname.c_str()); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Player %s Invited %s to Join his ArenaTeam", GetPlayer()->GetName(), Invitedname.c_str()); player->SetArenaTeamIdInvited(arenateam->GetId()); @@ -148,12 +148,12 @@ void WorldSession::HandleArenaTeamInviteOpcode(WorldPacket & recv_data) data << arenateam->GetName(); player->GetSession()->SendPacket(&data); - sLog->outDebug("WORLD: Sent SMSG_ARENA_TEAM_INVITE"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_ARENA_TEAM_INVITE"); } void WorldSession::HandleArenaTeamAcceptOpcode(WorldPacket & /*recv_data*/) { - sLog->outDebug("CMSG_ARENA_TEAM_ACCEPT"); // empty opcode + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_ARENA_TEAM_ACCEPT"); // empty opcode ArenaTeam *at = sObjectMgr->GetArenaTeamById(_player->GetArenaTeamIdInvited()); if (!at) @@ -186,14 +186,14 @@ void WorldSession::HandleArenaTeamAcceptOpcode(WorldPacket & /*recv_data*/) void WorldSession::HandleArenaTeamDeclineOpcode(WorldPacket & /*recv_data*/) { - sLog->outDebug("CMSG_ARENA_TEAM_DECLINE"); // empty opcode + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_ARENA_TEAM_DECLINE"); // empty opcode _player->SetArenaTeamIdInvited(0); // no more invited } void WorldSession::HandleArenaTeamLeaveOpcode(WorldPacket & recv_data) { - sLog->outDebug("CMSG_ARENA_TEAM_LEAVE"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_ARENA_TEAM_LEAVE"); uint32 ArenaTeamId; // arena team id recv_data >> ArenaTeamId; @@ -228,7 +228,7 @@ void WorldSession::HandleArenaTeamLeaveOpcode(WorldPacket & recv_data) void WorldSession::HandleArenaTeamDisbandOpcode(WorldPacket & recv_data) { - sLog->outDebug("CMSG_ARENA_TEAM_DISBAND"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_ARENA_TEAM_DISBAND"); uint32 ArenaTeamId; // arena team id recv_data >> ArenaTeamId; @@ -248,7 +248,7 @@ void WorldSession::HandleArenaTeamDisbandOpcode(WorldPacket & recv_data) void WorldSession::HandleArenaTeamRemoveOpcode(WorldPacket & recv_data) { - sLog->outDebug("CMSG_ARENA_TEAM_REMOVE"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_ARENA_TEAM_REMOVE"); uint32 ArenaTeamId; std::string name; @@ -290,7 +290,7 @@ void WorldSession::HandleArenaTeamRemoveOpcode(WorldPacket & recv_data) void WorldSession::HandleArenaTeamLeaderOpcode(WorldPacket & recv_data) { - sLog->outDebug("CMSG_ARENA_TEAM_LEADER"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_ARENA_TEAM_LEADER"); uint32 ArenaTeamId; std::string name; diff --git a/src/server/game/Server/Protocol/Handlers/AuctionHouseHandler.cpp b/src/server/game/Server/Protocol/Handlers/AuctionHouseHandler.cpp index 6288fb65b263a..099309b9d128d 100755 --- a/src/server/game/Server/Protocol/Handlers/AuctionHouseHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/AuctionHouseHandler.cpp @@ -40,7 +40,7 @@ void WorldSession::HandleAuctionHelloOpcode(WorldPacket & recv_data) Creature *unit = GetPlayer()->GetNPCIfCanInteractWith(guid,UNIT_NPC_FLAG_AUCTIONEER); if (!unit) { - sLog->outDebug("WORLD: HandleAuctionHelloOpcode - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleAuctionHelloOpcode - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); return; } @@ -132,24 +132,20 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data) Creature *pCreature = GetPlayer()->GetNPCIfCanInteractWith(auctioneer,UNIT_NPC_FLAG_AUCTIONEER); if (!pCreature) { - sLog->outDebug("WORLD: HandleAuctionSellItem - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(auctioneer))); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleAuctionSellItem - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(auctioneer))); return; } AuctionHouseEntry const* auctionHouseEntry = AuctionHouseMgr::GetAuctionHouseEntry(pCreature->getFaction()); if (!auctionHouseEntry) { - sLog->outDebug("WORLD: HandleAuctionSellItem - Unit (GUID: %u) has wrong faction.", uint32(GUID_LOPART(auctioneer))); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleAuctionSellItem - Unit (GUID: %u) has wrong faction.", uint32(GUID_LOPART(auctioneer))); return; } - sLog->outDebug("WORLD: HandleAuctionSellItem - ETIME: %u", etime); - // client send time in minutes, convert to common used sec time etime *= MINUTE; - sLog->outDebug("WORLD: HandleAuctionSellItem - ETIME: %u", etime); - // client understand only 3 auction time switch(etime) { @@ -192,7 +188,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data) return; } - if (it->IsBag() && !((Bag*)it)->IsEmpty()) + if (it->IsNotEmptyBag()) { SendAuctionCommandResult(0, AUCTION_SELL_ITEM, AUCTION_INTERNAL_ERROR); return; @@ -268,7 +264,7 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket & recv_data) Creature *pCreature = GetPlayer()->GetNPCIfCanInteractWith(auctioneer, UNIT_NPC_FLAG_AUCTIONEER); if (!pCreature) { - sLog->outDebug("WORLD: HandleAuctionPlaceBid - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(auctioneer))); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleAuctionPlaceBid - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(auctioneer))); return; } @@ -386,7 +382,7 @@ void WorldSession::HandleAuctionRemoveItem(WorldPacket & recv_data) Creature *pCreature = GetPlayer()->GetNPCIfCanInteractWith(auctioneer,UNIT_NPC_FLAG_AUCTIONEER); if (!pCreature) { - sLog->outDebug("WORLD: HandleAuctionRemoveItem - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(auctioneer))); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleAuctionRemoveItem - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(auctioneer))); return; } @@ -471,7 +467,7 @@ void WorldSession::HandleAuctionListBidderItems(WorldPacket & recv_data) Creature *pCreature = GetPlayer()->GetNPCIfCanInteractWith(guid,UNIT_NPC_FLAG_AUCTIONEER); if (!pCreature) { - sLog->outDebug("WORLD: HandleAuctionListBidderItems - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleAuctionListBidderItems - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); return; } @@ -518,7 +514,7 @@ void WorldSession::HandleAuctionListOwnerItems(WorldPacket & recv_data) Creature *pCreature = GetPlayer()->GetNPCIfCanInteractWith(guid,UNIT_NPC_FLAG_AUCTIONEER); if (!pCreature) { - sLog->outDebug("WORLD: HandleAuctionListOwnerItems - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleAuctionListOwnerItems - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); return; } @@ -571,7 +567,7 @@ void WorldSession::HandleAuctionListItems(WorldPacket & recv_data) Creature *pCreature = GetPlayer()->GetNPCIfCanInteractWith(guid,UNIT_NPC_FLAG_AUCTIONEER); if (!pCreature) { - sLog->outDebug("WORLD: HandleAuctionListItems - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleAuctionListItems - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); return; } @@ -609,7 +605,7 @@ void WorldSession::HandleAuctionListItems(WorldPacket & recv_data) void WorldSession::HandleAuctionListPendingSales(WorldPacket & recv_data) { - sLog->outDebug("CMSG_AUCTION_LIST_PENDING_SALES"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_AUCTION_LIST_PENDING_SALES"); recv_data.read_skip(); diff --git a/src/server/game/Server/Protocol/Handlers/BattleGroundHandler.cpp b/src/server/game/Server/Protocol/Handlers/BattleGroundHandler.cpp index 0641007b5c106..51ca4d9d9591f 100755 --- a/src/server/game/Server/Protocol/Handlers/BattleGroundHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/BattleGroundHandler.cpp @@ -39,7 +39,7 @@ void WorldSession::HandleBattlemasterHelloOpcode(WorldPacket & recv_data) { uint64 guid; recv_data >> guid; - sLog->outDebug("WORLD: Recvd CMSG_BATTLEMASTER_HELLO Message from (GUID: %u TypeId:%u)", GUID_LOPART(guid),GuidHigh2TypeId(GUID_HIPART(guid))); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_BATTLEMASTER_HELLO Message from (GUID: %u TypeId:%u)", GUID_LOPART(guid),GuidHigh2TypeId(GUID_HIPART(guid))); Creature *unit = GetPlayer()->GetMap()->GetCreature(guid); if (!unit) @@ -98,7 +98,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recv_data) BattlegroundTypeId bgTypeId = BattlegroundTypeId(bgTypeId_); - sLog->outDebug("WORLD: Recvd CMSG_BATTLEMASTER_JOIN Message from (GUID: %u TypeId:%u)", GUID_LOPART(guid), GuidHigh2TypeId(GUID_HIPART(guid))); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_BATTLEMASTER_JOIN Message from (GUID: %u TypeId:%u)", GUID_LOPART(guid), GuidHigh2TypeId(GUID_HIPART(guid))); // can do this, since it's battleground, not arena BattlegroundQueueTypeId bgQueueTypeId = BattlegroundMgr::BGQueueTypeId(bgTypeId, 0); @@ -189,7 +189,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recv_data) // send status packet (in queue) sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, queueSlot, STATUS_WAIT_QUEUE, avgTime, 0, ginfo->ArenaType); SendPacket(&data); - sLog->outDebug("Battleground: player joined queue for bg queue type %u bg type %u: GUID %u, NAME %s",bgQueueTypeId,bgTypeId,_player->GetGUIDLow(), _player->GetName()); + sLog->outDebug(LOG_FILTER_BATTLEGROUND,"Battleground: player joined queue for bg queue type %u bg type %u: GUID %u, NAME %s",bgQueueTypeId,bgTypeId,_player->GetGUIDLow(), _player->GetName()); } else { @@ -208,7 +208,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recv_data) if (err > 0) { - sLog->outDebug("Battleground: the following players are joining as group:"); + sLog->outDebug(LOG_FILTER_BATTLEGROUND,"Battleground: the following players are joining as group:"); ginfo = bgQueue.AddGroup(_player, grp, bgTypeId, bracketEntry, 0, false, isPremade, 0, 0); avgTime = bgQueue.GetAverageQueueWaitTime(ginfo, bracketEntry->GetBracketId()); } @@ -235,9 +235,9 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recv_data) member->GetSession()->SendPacket(&data); sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data, err); member->GetSession()->SendPacket(&data); - sLog->outDebug("Battleground: player joined queue for bg queue type %u bg type %u: GUID %u, NAME %s",bgQueueTypeId,bgTypeId,member->GetGUIDLow(), member->GetName()); + sLog->outDebug(LOG_FILTER_BATTLEGROUND,"Battleground: player joined queue for bg queue type %u bg type %u: GUID %u, NAME %s",bgQueueTypeId,bgTypeId,member->GetGUIDLow(), member->GetName()); } - sLog->outDebug("Battleground: group end"); + sLog->outDebug(LOG_FILTER_BATTLEGROUND,"Battleground: group end"); } sBattlegroundMgr->ScheduleQueueUpdate(0, 0, bgQueueTypeId, bgTypeId, bracketEntry->GetBracketId()); @@ -246,7 +246,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recv_data) void WorldSession::HandleBattlegroundPlayerPositionsOpcode(WorldPacket & /*recv_data*/) { // empty opcode - sLog->outDebug("WORLD: Recvd MSG_BATTLEGROUND_PLAYER_POSITIONS Message"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd MSG_BATTLEGROUND_PLAYER_POSITIONS Message"); Battleground *bg = _player->GetBattleground(); if (!bg) // can't be received if player not in battleground @@ -313,7 +313,7 @@ void WorldSession::HandleBattlegroundPlayerPositionsOpcode(WorldPacket & /*recv_ void WorldSession::HandlePVPLogDataOpcode(WorldPacket & /*recv_data*/) { - sLog->outDebug("WORLD: Recvd MSG_PVP_LOG_DATA Message"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd MSG_PVP_LOG_DATA Message"); Battleground *bg = _player->GetBattleground(); if (!bg) @@ -323,12 +323,12 @@ void WorldSession::HandlePVPLogDataOpcode(WorldPacket & /*recv_data*/) sBattlegroundMgr->BuildPvpLogDataPacket(&data, bg); SendPacket(&data); - sLog->outDebug("WORLD: Sent MSG_PVP_LOG_DATA Message"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent MSG_PVP_LOG_DATA Message"); } void WorldSession::HandleBattlefieldListOpcode(WorldPacket &recv_data) { - sLog->outDebug("WORLD: Recvd CMSG_BATTLEFIELD_LIST Message"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_BATTLEFIELD_LIST Message"); uint32 bgTypeId; recv_data >> bgTypeId; // id from DBC @@ -353,7 +353,7 @@ void WorldSession::HandleBattlefieldListOpcode(WorldPacket &recv_data) void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recv_data) { - sLog->outDebug("WORLD: Recvd CMSG_BATTLEFIELD_PORT Message"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_BATTLEFIELD_PORT Message"); uint8 type; // arenatype if arena uint8 unk2; // unk, can be 0x0 (may be if was invited?) and 0x1 @@ -419,7 +419,7 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recv_data) sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data2, ERR_GROUP_JOIN_BATTLEGROUND_DESERTERS); _player->GetSession()->SendPacket(&data2); action = 0; - sLog->outDebug("Battleground: player %s (%u) has a deserter debuff, do not port him to battleground!", _player->GetName(), _player->GetGUIDLow()); + sLog->outDebug(LOG_FILTER_BATTLEGROUND,"Battleground: player %s (%u) has a deserter debuff, do not port him to battleground!", _player->GetName(), _player->GetGUIDLow()); } //if player don't match battleground max level, then do not allow him to enter! (this might happen when player leveled up during his waiting in queue if (_player->getLevel() > bg->GetMaxLevel()) @@ -470,7 +470,7 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recv_data) sBattlegroundMgr->SendToBattleground(_player, ginfo.IsInvitedToBGInstanceGUID, bgTypeId); // add only in HandleMoveWorldPortAck() // bg->AddPlayer(_player,team); - sLog->outDebug("Battleground: player %s (%u) joined battle for bg %u, bgtype %u, queue type %u.", _player->GetName(), _player->GetGUIDLow(), bg->GetInstanceID(), bg->GetTypeID(), bgQueueTypeId); + sLog->outDebug(LOG_FILTER_BATTLEGROUND,"Battleground: player %s (%u) joined battle for bg %u, bgtype %u, queue type %u.", _player->GetName(), _player->GetGUIDLow(), bg->GetInstanceID(), bg->GetTypeID(), bgQueueTypeId); break; case 0: // leave queue // if player leaves rated arena match before match start, it is counted as he played but he lost @@ -479,7 +479,7 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recv_data) ArenaTeam * at = sObjectMgr->GetArenaTeamById(ginfo.Team); if (at) { - sLog->outDebug("UPDATING memberLost's personal arena rating for %u by opponents rating: %u, because he has left queue!", GUID_LOPART(_player->GetGUID()), ginfo.OpponentsTeamRating); + sLog->outDebug(LOG_FILTER_BATTLEGROUND,"UPDATING memberLost's personal arena rating for %u by opponents rating: %u, because he has left queue!", GUID_LOPART(_player->GetGUID()), ginfo.OpponentsTeamRating); at->MemberLost(_player, ginfo.OpponentsMatchmakerRating); at->SaveToDB(); } @@ -491,7 +491,7 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recv_data) if (!ginfo.ArenaType) sBattlegroundMgr->ScheduleQueueUpdate(ginfo.ArenaMatchmakerRating, ginfo.ArenaType, bgQueueTypeId, bgTypeId, bracketEntry->GetBracketId()); SendPacket(&data); - sLog->outDebug("Battleground: player %s (%u) left queue for bgtype %u, queue type %u.", _player->GetName(), _player->GetGUIDLow(), bg->GetTypeID(), bgQueueTypeId); + sLog->outDebug(LOG_FILTER_BATTLEGROUND,"Battleground: player %s (%u) left queue for bgtype %u, queue type %u.", _player->GetName(), _player->GetGUIDLow(), bg->GetTypeID(), bgQueueTypeId); break; default: sLog->outError("Battleground port: unknown action %u", action); @@ -501,7 +501,7 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recv_data) void WorldSession::HandleLeaveBattlefieldOpcode(WorldPacket& recv_data) { - sLog->outDebug("WORLD: Recvd CMSG_LEAVE_BATTLEFIELD Message"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_LEAVE_BATTLEFIELD Message"); recv_data.read_skip(); // unk1 recv_data.read_skip(); // unk2 @@ -520,7 +520,7 @@ void WorldSession::HandleLeaveBattlefieldOpcode(WorldPacket& recv_data) void WorldSession::HandleBattlefieldStatusOpcode(WorldPacket & /*recv_data*/) { // empty opcode - sLog->outDebug("WORLD: Battleground status"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Battleground status"); WorldPacket data; // we must update all queues here @@ -583,7 +583,7 @@ void WorldSession::HandleBattlefieldStatusOpcode(WorldPacket & /*recv_data*/) void WorldSession::HandleAreaSpiritHealerQueryOpcode(WorldPacket & recv_data) { - sLog->outDebug("WORLD: CMSG_AREA_SPIRIT_HEALER_QUERY"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_AREA_SPIRIT_HEALER_QUERY"); Battleground *bg = _player->GetBattleground(); @@ -601,10 +601,9 @@ void WorldSession::HandleAreaSpiritHealerQueryOpcode(WorldPacket & recv_data) sBattlegroundMgr->SendAreaSpiritHealerQueryOpcode(_player, bg, guid); } - void WorldSession::HandleAreaSpiritHealerQueueOpcode(WorldPacket & recv_data) { - sLog->outDebug("WORLD: CMSG_AREA_SPIRIT_HEALER_QUEUE"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_AREA_SPIRIT_HEALER_QUEUE"); Battleground *bg = _player->GetBattleground(); @@ -622,10 +621,9 @@ void WorldSession::HandleAreaSpiritHealerQueueOpcode(WorldPacket & recv_data) bg->AddPlayerToResurrectQueue(guid, _player->GetGUID()); } - void WorldSession::HandleBattlemasterJoinArena(WorldPacket & recv_data) { - sLog->outDebug("WORLD: CMSG_BATTLEMASTER_JOIN_ARENA"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_BATTLEMASTER_JOIN_ARENA"); //recv_data.hexlike(); uint64 guid; // arena Battlemaster guid @@ -738,10 +736,10 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket & recv_data) if (err > 0) { - sLog->outDebug("Battleground: arena join as group start"); + sLog->outDebug(LOG_FILTER_BATTLEGROUND,"Battleground: arena join as group start"); if (isRated) { - sLog->outDebug("Battleground: arena team id %u, leader %s queued with matchmaker rating %u for type %u",_player->GetArenaTeamId(arenaslot),_player->GetName(),matchmakerRating,arenatype); + sLog->outDebug(LOG_FILTER_BATTLEGROUND,"Battleground: arena team id %u, leader %s queued with matchmaker rating %u for type %u",_player->GetArenaTeamId(arenaslot),_player->GetName(),matchmakerRating,arenatype); bg->SetRated(true); } else @@ -774,7 +772,7 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket & recv_data) member->GetSession()->SendPacket(&data); sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data, err); member->GetSession()->SendPacket(&data); - sLog->outDebug("Battleground: player joined queue for arena as group bg queue type %u bg type %u: GUID %u, NAME %s",bgQueueTypeId,bgTypeId,member->GetGUIDLow(), member->GetName()); + sLog->outDebug(LOG_FILTER_BATTLEGROUND,"Battleground: player joined queue for arena as group bg queue type %u bg type %u: GUID %u, NAME %s",bgQueueTypeId,bgTypeId,member->GetGUIDLow(), member->GetName()); } } else @@ -787,7 +785,7 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket & recv_data) // send status packet (in queue) sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, queueSlot, STATUS_WAIT_QUEUE, avgTime, 0, arenatype); SendPacket(&data); - sLog->outDebug("Battleground: player joined queue for arena, skirmish, bg queue type %u bg type %u: GUID %u, NAME %s",bgQueueTypeId,bgTypeId,_player->GetGUIDLow(), _player->GetName()); + sLog->outDebug(LOG_FILTER_BATTLEGROUND,"Battleground: player joined queue for arena, skirmish, bg queue type %u bg type %u: GUID %u, NAME %s",bgQueueTypeId,bgTypeId,_player->GetGUIDLow(), _player->GetName()); } sBattlegroundMgr->ScheduleQueueUpdate(matchmakerRating, arenatype, bgQueueTypeId, bgTypeId, bracketEntry->GetBracketId()); } @@ -800,11 +798,11 @@ void WorldSession::HandleReportPvPAFK(WorldPacket & recv_data) if (!reportedPlayer) { - sLog->outDebug("WorldSession::HandleReportPvPAFK: player not found"); + sLog->outDebug(LOG_FILTER_BATTLEGROUND,"WorldSession::HandleReportPvPAFK: player not found"); return; } - sLog->outDebug("WorldSession::HandleReportPvPAFK: %s reported %s", _player->GetName(), reportedPlayer->GetName()); + sLog->outDebug(LOG_FILTER_BATTLEGROUND,"WorldSession::HandleReportPvPAFK: %s reported %s", _player->GetName(), reportedPlayer->GetName()); reportedPlayer->ReportedAfkBy(_player); } diff --git a/src/server/game/Server/Protocol/Handlers/CalendarHandler.cpp b/src/server/game/Server/Protocol/Handlers/CalendarHandler.cpp index f4b97b5e8ff03..6553f2b3f9388 100755 --- a/src/server/game/Server/Protocol/Handlers/CalendarHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/CalendarHandler.cpp @@ -27,7 +27,7 @@ void WorldSession::HandleCalendarGetCalendar(WorldPacket & /*recv_data*/) { - sLog->outDebug("WORLD: CMSG_CALENDAR_GET_CALENDAR"); // empty + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CALENDAR_GET_CALENDAR"); // empty time_t cur_time = time(NULL); @@ -126,21 +126,21 @@ void WorldSession::HandleCalendarGetCalendar(WorldPacket & /*recv_data*/) } */ - sLog->outDebug("Sending calendar"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Sending calendar"); data.hexlike(); SendPacket(&data); } void WorldSession::HandleCalendarGetEvent(WorldPacket &recv_data) { - sLog->outDebug("WORLD: CMSG_CALENDAR_GET_EVENT"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CALENDAR_GET_EVENT"); recv_data.hexlike(); recv_data.read_skip(); // unk } void WorldSession::HandleCalendarGuildFilter(WorldPacket &recv_data) { - sLog->outDebug("WORLD: CMSG_CALENDAR_GUILD_FILTER"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CALENDAR_GUILD_FILTER"); recv_data.hexlike(); recv_data.read_skip(); // unk1 recv_data.read_skip(); // unk2 @@ -149,14 +149,14 @@ void WorldSession::HandleCalendarGuildFilter(WorldPacket &recv_data) void WorldSession::HandleCalendarArenaTeam(WorldPacket &recv_data) { - sLog->outDebug("WORLD: CMSG_CALENDAR_ARENA_TEAM"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CALENDAR_ARENA_TEAM"); recv_data.hexlike(); recv_data.read_skip(); // unk } void WorldSession::HandleCalendarAddEvent(WorldPacket &recv_data) { - sLog->outDebug("WORLD: CMSG_CALENDAR_ADD_EVENT"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CALENDAR_ADD_EVENT"); recv_data.hexlike(); recv_data.rpos(recv_data.wpos()); // set to end to avoid warnings spam @@ -192,7 +192,7 @@ void WorldSession::HandleCalendarAddEvent(WorldPacket &recv_data) void WorldSession::HandleCalendarUpdateEvent(WorldPacket &recv_data) { - sLog->outDebug("WORLD: CMSG_CALENDAR_UPDATE_EVENT"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CALENDAR_UPDATE_EVENT"); recv_data.hexlike(); recv_data.rpos(recv_data.wpos()); // set to end to avoid warnings spam @@ -211,7 +211,7 @@ void WorldSession::HandleCalendarUpdateEvent(WorldPacket &recv_data) void WorldSession::HandleCalendarRemoveEvent(WorldPacket &recv_data) { - sLog->outDebug("WORLD: CMSG_CALENDAR_REMOVE_EVENT"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CALENDAR_REMOVE_EVENT"); recv_data.hexlike(); recv_data.rpos(recv_data.wpos()); // set to end to avoid warnings spam @@ -223,7 +223,7 @@ void WorldSession::HandleCalendarRemoveEvent(WorldPacket &recv_data) void WorldSession::HandleCalendarCopyEvent(WorldPacket &recv_data) { - sLog->outDebug("WORLD: CMSG_CALENDAR_COPY_EVENT"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CALENDAR_COPY_EVENT"); recv_data.hexlike(); recv_data.rpos(recv_data.wpos()); // set to end to avoid warnings spam @@ -235,7 +235,7 @@ void WorldSession::HandleCalendarCopyEvent(WorldPacket &recv_data) void WorldSession::HandleCalendarEventInvite(WorldPacket &recv_data) { - sLog->outDebug("WORLD: CMSG_CALENDAR_EVENT_INVITE"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CALENDAR_EVENT_INVITE"); recv_data.hexlike(); recv_data.rpos(recv_data.wpos()); // set to end to avoid warnings spam @@ -249,7 +249,7 @@ void WorldSession::HandleCalendarEventInvite(WorldPacket &recv_data) void WorldSession::HandleCalendarEventRsvp(WorldPacket &recv_data) { - sLog->outDebug("WORLD: CMSG_CALENDAR_EVENT_RSVP"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CALENDAR_EVENT_RSVP"); recv_data.hexlike(); recv_data.rpos(recv_data.wpos()); // set to end to avoid warnings spam @@ -261,7 +261,7 @@ void WorldSession::HandleCalendarEventRsvp(WorldPacket &recv_data) void WorldSession::HandleCalendarEventRemoveInvite(WorldPacket &recv_data) { - sLog->outDebug("WORLD: CMSG_CALENDAR_EVENT_REMOVE_INVITE"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CALENDAR_EVENT_REMOVE_INVITE"); recv_data.hexlike(); recv_data.rpos(recv_data.wpos()); // set to end to avoid warnings spam @@ -273,7 +273,7 @@ void WorldSession::HandleCalendarEventRemoveInvite(WorldPacket &recv_data) void WorldSession::HandleCalendarEventStatus(WorldPacket &recv_data) { - sLog->outDebug("WORLD: CMSG_CALENDAR_EVENT_STATUS"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CALENDAR_EVENT_STATUS"); recv_data.hexlike(); recv_data.rpos(recv_data.wpos()); // set to end to avoid warnings spam @@ -286,7 +286,7 @@ void WorldSession::HandleCalendarEventStatus(WorldPacket &recv_data) void WorldSession::HandleCalendarEventModeratorStatus(WorldPacket &recv_data) { - sLog->outDebug("WORLD: CMSG_CALENDAR_EVENT_MODERATOR_STATUS"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CALENDAR_EVENT_MODERATOR_STATUS"); recv_data.hexlike(); recv_data.rpos(recv_data.wpos()); // set to end to avoid warnings spam @@ -299,7 +299,7 @@ void WorldSession::HandleCalendarEventModeratorStatus(WorldPacket &recv_data) void WorldSession::HandleCalendarComplain(WorldPacket &recv_data) { - sLog->outDebug("WORLD: CMSG_CALENDAR_COMPLAIN"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CALENDAR_COMPLAIN"); recv_data.hexlike(); recv_data.rpos(recv_data.wpos()); // set to end to avoid warnings spam @@ -310,7 +310,7 @@ void WorldSession::HandleCalendarComplain(WorldPacket &recv_data) void WorldSession::HandleCalendarGetNumPending(WorldPacket & /*recv_data*/) { - sLog->outDebug("WORLD: CMSG_CALENDAR_GET_NUM_PENDING"); // empty + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CALENDAR_GET_NUM_PENDING"); // empty WorldPacket data(SMSG_CALENDAR_SEND_NUM_PENDING, 4); data << uint32(0); // 0 - no pending invites, 1 - some pending invites diff --git a/src/server/game/Server/Protocol/Handlers/ChannelHandler.cpp b/src/server/game/Server/Protocol/Handlers/ChannelHandler.cpp index 87ba2fd9c15c2..0ccfce64045bd 100755 --- a/src/server/game/Server/Protocol/Handlers/ChannelHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/ChannelHandler.cpp @@ -21,7 +21,7 @@ void WorldSession::HandleJoinChannel(WorldPacket& recvPacket) { - sLog->outDebug("Opcode %u", recvPacket.GetOpcode()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Opcode %u", recvPacket.GetOpcode()); uint32 channel_id; uint8 unknown1, unknown2; @@ -60,7 +60,7 @@ void WorldSession::HandleJoinChannel(WorldPacket& recvPacket) void WorldSession::HandleLeaveChannel(WorldPacket& recvPacket) { - sLog->outDebug("Opcode %u", recvPacket.GetOpcode()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Opcode %u", recvPacket.GetOpcode()); //recvPacket.hexlike(); uint32 unk; @@ -81,7 +81,7 @@ void WorldSession::HandleLeaveChannel(WorldPacket& recvPacket) void WorldSession::HandleChannelList(WorldPacket& recvPacket) { - sLog->outDebug("Opcode %u", recvPacket.GetOpcode()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Opcode %u", recvPacket.GetOpcode()); //recvPacket.hexlike(); std::string channelname; recvPacket >> channelname; @@ -93,7 +93,7 @@ void WorldSession::HandleChannelList(WorldPacket& recvPacket) void WorldSession::HandleChannelPassword(WorldPacket& recvPacket) { - sLog->outDebug("Opcode %u", recvPacket.GetOpcode()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Opcode %u", recvPacket.GetOpcode()); //recvPacket.hexlike(); std::string channelname, pass; recvPacket >> channelname; @@ -107,7 +107,7 @@ void WorldSession::HandleChannelPassword(WorldPacket& recvPacket) void WorldSession::HandleChannelSetOwner(WorldPacket& recvPacket) { - sLog->outDebug("Opcode %u", recvPacket.GetOpcode()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Opcode %u", recvPacket.GetOpcode()); //recvPacket.hexlike(); std::string channelname, newp; recvPacket >> channelname; @@ -124,7 +124,7 @@ void WorldSession::HandleChannelSetOwner(WorldPacket& recvPacket) void WorldSession::HandleChannelOwner(WorldPacket& recvPacket) { - sLog->outDebug("Opcode %u", recvPacket.GetOpcode()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Opcode %u", recvPacket.GetOpcode()); //recvPacket.hexlike(); std::string channelname; recvPacket >> channelname; @@ -135,7 +135,7 @@ void WorldSession::HandleChannelOwner(WorldPacket& recvPacket) void WorldSession::HandleChannelModerator(WorldPacket& recvPacket) { - sLog->outDebug("Opcode %u", recvPacket.GetOpcode()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Opcode %u", recvPacket.GetOpcode()); //recvPacket.hexlike(); std::string channelname, otp; recvPacket >> channelname; @@ -152,7 +152,7 @@ void WorldSession::HandleChannelModerator(WorldPacket& recvPacket) void WorldSession::HandleChannelUnmoderator(WorldPacket& recvPacket) { - sLog->outDebug("Opcode %u", recvPacket.GetOpcode()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Opcode %u", recvPacket.GetOpcode()); //recvPacket.hexlike(); std::string channelname, otp; recvPacket >> channelname; @@ -169,7 +169,7 @@ void WorldSession::HandleChannelUnmoderator(WorldPacket& recvPacket) void WorldSession::HandleChannelMute(WorldPacket& recvPacket) { - sLog->outDebug("Opcode %u", recvPacket.GetOpcode()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Opcode %u", recvPacket.GetOpcode()); //recvPacket.hexlike(); std::string channelname, otp; recvPacket >> channelname; @@ -186,7 +186,7 @@ void WorldSession::HandleChannelMute(WorldPacket& recvPacket) void WorldSession::HandleChannelUnmute(WorldPacket& recvPacket) { - sLog->outDebug("Opcode %u", recvPacket.GetOpcode()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Opcode %u", recvPacket.GetOpcode()); //recvPacket.hexlike(); std::string channelname, otp; @@ -204,7 +204,7 @@ void WorldSession::HandleChannelUnmute(WorldPacket& recvPacket) void WorldSession::HandleChannelInvite(WorldPacket& recvPacket) { - sLog->outDebug("Opcode %u", recvPacket.GetOpcode()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Opcode %u", recvPacket.GetOpcode()); //recvPacket.hexlike(); std::string channelname, otp; recvPacket >> channelname; @@ -221,7 +221,7 @@ void WorldSession::HandleChannelInvite(WorldPacket& recvPacket) void WorldSession::HandleChannelKick(WorldPacket& recvPacket) { - sLog->outDebug("Opcode %u", recvPacket.GetOpcode()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Opcode %u", recvPacket.GetOpcode()); //recvPacket.hexlike(); std::string channelname, otp; recvPacket >> channelname; @@ -237,7 +237,7 @@ void WorldSession::HandleChannelKick(WorldPacket& recvPacket) void WorldSession::HandleChannelBan(WorldPacket& recvPacket) { - sLog->outDebug("Opcode %u", recvPacket.GetOpcode()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Opcode %u", recvPacket.GetOpcode()); //recvPacket.hexlike(); std::string channelname, otp; recvPacket >> channelname; @@ -254,7 +254,7 @@ void WorldSession::HandleChannelBan(WorldPacket& recvPacket) void WorldSession::HandleChannelUnban(WorldPacket& recvPacket) { - sLog->outDebug("Opcode %u", recvPacket.GetOpcode()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Opcode %u", recvPacket.GetOpcode()); //recvPacket.hexlike(); std::string channelname, otp; @@ -272,7 +272,7 @@ void WorldSession::HandleChannelUnban(WorldPacket& recvPacket) void WorldSession::HandleChannelAnnouncements(WorldPacket& recvPacket) { - sLog->outDebug("Opcode %u", recvPacket.GetOpcode()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Opcode %u", recvPacket.GetOpcode()); //recvPacket.hexlike(); std::string channelname; recvPacket >> channelname; @@ -289,7 +289,7 @@ void WorldSession::HandleChannelDisplayListQuery(WorldPacket &recvPacket) void WorldSession::HandleGetChannelMemberCount(WorldPacket &recvPacket) { - sLog->outDebug("Opcode %u", recvPacket.GetOpcode()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Opcode %u", recvPacket.GetOpcode()); //recvPacket.hexlike(); std::string channelname; recvPacket >> channelname; @@ -308,7 +308,7 @@ void WorldSession::HandleGetChannelMemberCount(WorldPacket &recvPacket) void WorldSession::HandleSetChannelWatch(WorldPacket &recvPacket) { - sLog->outDebug("Opcode %u", recvPacket.GetOpcode()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Opcode %u", recvPacket.GetOpcode()); //recvPacket.hexlike(); std::string channelname; recvPacket >> channelname; diff --git a/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp b/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp index 059897e392f46..aa1df02d84a93 100755 --- a/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp @@ -166,7 +166,7 @@ bool LoginQueryHolder::Initialize() stmt->setUInt32(0, lowGuid); res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOADTALENTS, stmt); - stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_PLAYER_ACCOUNTDATA); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_PLAYER_ACCOUNT_DATA); stmt->setUInt32(0, lowGuid); res &= SetPreparedQuery(PLAYER_LOGIN_QUERY_LOADACCOUNTDATA, stmt); @@ -295,13 +295,20 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data) } ChrClassesEntry const* classEntry = sChrClassesStore.LookupEntry(class_); - ChrRacesEntry const* raceEntry = sChrRacesStore.LookupEntry(race_); + if (!classEntry) + { + data << (uint8)CHAR_CREATE_FAILED; + SendPacket(&data); + sLog->outError("Class (%u) not found in DBC while creating new char for account (ID: %u): wrong DBC files or cheater?", class_, GetAccountId()); + return; + } - if (!classEntry || !raceEntry) + ChrRacesEntry const* raceEntry = sChrRacesStore.LookupEntry(race_); + if (!raceEntry) { data << (uint8)CHAR_CREATE_FAILED; SendPacket(&data); - sLog->outError("Class: %u or Race %u not found in DBC (Wrong DBC files?) or Cheater?", class_, race_); + sLog->outError("Race (%u) not found in DBC while creating new char for account (ID: %u): wrong DBC files or cheater?", race_, GetAccountId()); return; } @@ -536,7 +543,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data) { uint8 unk; recv_data >> unk; - sLog->outDebug("Character creation %s (account %u) has unhandled tail data: [%u]", name.c_str(), GetAccountId(), unk); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Character creation %s (account %u) has unhandled tail data: [%u]", name.c_str(), GetAccountId(), unk); } Player * pNewChar = new Player(this); @@ -940,33 +947,29 @@ void WorldSession::HandleMeetingStoneInfo(WorldPacket & /*recv_data*/) void WorldSession::HandleTutorialFlag(WorldPacket & recv_data) { - uint32 iFlag; - recv_data >> iFlag; + uint32 data; + recv_data >> data; - uint32 wInt = (iFlag / 32); - if (wInt >= 8) - { - //sLog->outError("CHEATER? Account:[%d] Guid[%u] tried to send wrong CMSG_TUTORIAL_FLAG", GetAccountId(),GetGUID()); + uint8 index = uint8(data / 32); + if (index >= MAX_ACCOUNT_TUTORIAL_VALUES) return; - } - uint32 rInt = (iFlag % 32); - uint32 tutflag = GetTutorialInt(wInt); - tutflag |= (1 << rInt); - SetTutorialInt(wInt, tutflag); + uint32 value = (data % 32); - //sLog->outDebug("Received Tutorial Flag Set {%u}.", iFlag); + uint32 flag = GetTutorialInt(index); + flag |= (1 << value); + SetTutorialInt(index, flag); } void WorldSession::HandleTutorialClear(WorldPacket & /*recv_data*/) { - for (int i = 0; i < MAX_CHARACTER_TUTORIAL_VALUES; ++i) + for (uint8 i = 0; i < MAX_ACCOUNT_TUTORIAL_VALUES; ++i) SetTutorialInt(i, 0xFFFFFFFF); } void WorldSession::HandleTutorialReset(WorldPacket & /*recv_data*/) { - for (int i = 0; i < MAX_CHARACTER_TUTORIAL_VALUES; ++i) + for (uint8 i = 0; i < MAX_ACCOUNT_TUTORIAL_VALUES; ++i) SetTutorialInt(i, 0x00000000); } @@ -1164,7 +1167,7 @@ void WorldSession::HandleSetPlayerDeclinedNames(WorldPacket& recv_data) void WorldSession::HandleAlterAppearance(WorldPacket & recv_data) { - sLog->outDebug("CMSG_ALTER_APPEARANCE"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_ALTER_APPEARANCE"); uint32 Hair, Color, FacialHair, SkinColor; recv_data >> Hair >> Color >> FacialHair >> SkinColor; @@ -1224,7 +1227,7 @@ void WorldSession::HandleRemoveGlyph(WorldPacket & recv_data) if (slot >= MAX_GLYPH_SLOT_INDEX) { - sLog->outDebug("Client sent wrong glyph slot number in opcode CMSG_REMOVE_GLYPH %u", slot); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Client sent wrong glyph slot number in opcode CMSG_REMOVE_GLYPH %u", slot); return; } @@ -1335,7 +1338,7 @@ void WorldSession::HandleCharCustomize(WorldPacket& recv_data) void WorldSession::HandleEquipmentSetSave(WorldPacket &recv_data) { - sLog->outDebug("CMSG_EQUIPMENT_SET_SAVE"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_EQUIPMENT_SET_SAVE"); uint64 setGuid; recv_data.readPackGUID(setGuid); @@ -1379,7 +1382,7 @@ void WorldSession::HandleEquipmentSetSave(WorldPacket &recv_data) void WorldSession::HandleEquipmentSetDelete(WorldPacket &recv_data) { - sLog->outDebug("CMSG_EQUIPMENT_SET_DELETE"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_EQUIPMENT_SET_DELETE"); uint64 setGuid; recv_data.readPackGUID(setGuid); @@ -1389,7 +1392,7 @@ void WorldSession::HandleEquipmentSetDelete(WorldPacket &recv_data) void WorldSession::HandleEquipmentSetUse(WorldPacket &recv_data) { - sLog->outDebug("CMSG_EQUIPMENT_SET_USE"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_EQUIPMENT_SET_USE"); recv_data.hexlike(); for (uint32 i = 0; i < EQUIPMENT_SLOT_END; ++i) @@ -1400,7 +1403,7 @@ void WorldSession::HandleEquipmentSetUse(WorldPacket &recv_data) uint8 srcbag, srcslot; recv_data >> srcbag >> srcslot; - sLog->outDebug("Item " UI64FMTD ": srcbag %u, srcslot %u", itemGuid, srcbag, srcslot); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Item " UI64FMTD ": srcbag %u, srcslot %u", itemGuid, srcbag, srcslot); Item *item = _player->GetItemByGuid(itemGuid); @@ -1760,7 +1763,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) CharacterDatabase.CommitTransaction(trans); std::string IP_str = GetRemoteAddress(); - sLog->outDebug("Account: %d (IP: %s), Character guid: %u Change Race/Faction to: %s", GetAccountId(), IP_str.c_str(), lowGuid, newname.c_str()); + sLog->outDebug(LOG_FILTER_UNITS, "Account: %d (IP: %s), Character guid: %u Change Race/Faction to: %s", GetAccountId(), IP_str.c_str(), lowGuid, newname.c_str()); WorldPacket data(SMSG_CHAR_FACTION_CHANGE, 1 + 8 + (newname.size() + 1) + 1 + 1 + 1 + 1 + 1 + 1 + 1); data << uint8(RESPONSE_SUCCESS); diff --git a/src/server/game/Server/Protocol/Handlers/ChatHandler.cpp b/src/server/game/Server/Protocol/Handlers/ChatHandler.cpp index 9981dfe214390..ebaef36fe30fe 100755 --- a/src/server/game/Server/Protocol/Handlers/ChatHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/ChatHandler.cpp @@ -112,12 +112,9 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data) recv_data >> msg; if (msg.empty()) - { - sLog->outDebug("Player %s send empty addon msg", GetPlayer()->GetName()); return; - } - sScriptMgr->OnPlayerChat(GetPlayer(), CHAT_MSG_ADDON, lang, msg); + sScriptMgr->OnPlayerChat(GetPlayer(), uint32(CHAT_MSG_ADDON), lang, msg); } // Disabled addon channel? @@ -310,7 +307,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data) sScriptMgr->OnPlayerChat(GetPlayer(), type, lang, msg, group); WorldPacket data; - ChatHandler::FillMessageData(&data, this, type, lang, NULL, 0, msg.c_str(), NULL); + ChatHandler::FillMessageData(&data, this, uint8(type), lang, NULL, 0, msg.c_str(), NULL); group->BroadcastPacket(&data, false, group->GetMemberGroup(GetPlayer()->GetGUID())); } break; case CHAT_MSG_GUILD: @@ -581,7 +578,7 @@ void WorldSession::HandleChatIgnoredOpcode(WorldPacket& recv_data) { uint64 iguid; uint8 unk; - //sLog->outDebug("WORLD: Received CMSG_CHAT_IGNORED"); + //sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: Received CMSG_CHAT_IGNORED"); recv_data >> iguid; recv_data >> unk; // probably related to spam reporting @@ -597,7 +594,7 @@ void WorldSession::HandleChatIgnoredOpcode(WorldPacket& recv_data) void WorldSession::HandleChannelDeclineInvite(WorldPacket &recvPacket) { - sLog->outDebug("Opcode %u", recvPacket.GetOpcode()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Opcode %u", recvPacket.GetOpcode()); } void WorldSession::SendPlayerNotFoundNotice(std::string name) diff --git a/src/server/game/Server/Protocol/Handlers/CombatHandler.cpp b/src/server/game/Server/Protocol/Handlers/CombatHandler.cpp index 2b05238cca233..6ef0671b67985 100755 --- a/src/server/game/Server/Protocol/Handlers/CombatHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/CombatHandler.cpp @@ -65,7 +65,7 @@ void WorldSession::HandleSetSheathedOpcode(WorldPacket & recv_data) uint32 sheathed; recv_data >> sheathed; - //sLog->outDebug("WORLD: Recvd CMSG_SETSHEATHED Message guidlow:%u value1:%u", GetPlayer()->GetGUIDLow(), sheathed); + //sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: Recvd CMSG_SETSHEATHED Message guidlow:%u value1:%u", GetPlayer()->GetGUIDLow(), sheathed); if (sheathed >= MAX_SHEATH_STATE) { diff --git a/src/server/game/Server/Protocol/Handlers/DuelHandler.cpp b/src/server/game/Server/Protocol/Handlers/DuelHandler.cpp index dbdaf8f9f41ce..9703c3716a994 100755 --- a/src/server/game/Server/Protocol/Handlers/DuelHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/DuelHandler.cpp @@ -41,7 +41,7 @@ void WorldSession::HandleDuelAcceptedOpcode(WorldPacket& recvPacket) if (pl == pl->duel->initiator || !plTarget || pl == plTarget || pl->duel->startTime != 0 || plTarget->duel->startTime != 0) return; - //sLog->outDebug("WORLD: received CMSG_DUEL_ACCEPTED"); + //sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: Received CMSG_DUEL_ACCEPTED"); sLog->outStaticDebug("Player 1 is: %u (%s)", pl->GetGUIDLow(),pl->GetName()); sLog->outStaticDebug("Player 2 is: %u (%s)", plTarget->GetGUIDLow(),plTarget->GetName()); @@ -55,7 +55,7 @@ void WorldSession::HandleDuelAcceptedOpcode(WorldPacket& recvPacket) void WorldSession::HandleDuelCancelledOpcode(WorldPacket& recvPacket) { - //sLog->outDebug("WORLD: received CMSG_DUEL_CANCELLED"); + //sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: Received CMSG_DUEL_CANCELLED"); // no duel requested if (!GetPlayer()->duel) diff --git a/src/server/game/Server/Protocol/Handlers/GroupHandler.cpp b/src/server/game/Server/Protocol/Handlers/GroupHandler.cpp index d23a937e365ef..6feda85469957 100755 --- a/src/server/game/Server/Protocol/Handlers/GroupHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/GroupHandler.cpp @@ -57,6 +57,8 @@ void WorldSession::SendPartyResult(PartyOperation operation, const std::string& void WorldSession::HandleGroupInviteOpcode(WorldPacket & recv_data) { + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_INVITE"); + std::string membername; recv_data >> membername; recv_data.read_skip(); @@ -84,7 +86,7 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket & recv_data) return; // can't group with - if (!sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP) && GetPlayer()->GetTeam() != player->GetTeam()) + if (!GetPlayer()->isGameMaster() && !sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP) && GetPlayer()->GetTeam() != player->GetTeam()) { SendPartyResult(PARTY_OP_INVITE, membername, ERR_PLAYER_WRONG_FACTION); return; @@ -191,9 +193,16 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket & recv_data) void WorldSession::HandleGroupAcceptOpcode(WorldPacket& recv_data) { + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_ACCEPT"); + recv_data.read_skip(); Group *group = GetPlayer()->GetGroupInvite(); - if (!group) return; + + if (!group) + return; + + // Remove player from invitees in any case + group->RemoveInvite(GetPlayer()); if (group->GetLeaderGUID() == GetPlayer()->GetGUID()) { @@ -201,13 +210,7 @@ void WorldSession::HandleGroupAcceptOpcode(WorldPacket& recv_data) return; } - // remove in from ivites in any case - group->RemoveInvite(GetPlayer()); - - /** error handling **/ - /********************/ - - // not have place + // Group is full if (group->IsFull()) { SendPartyResult(PARTY_OP_INVITE, "", ERR_GROUP_FULL); @@ -216,17 +219,25 @@ void WorldSession::HandleGroupAcceptOpcode(WorldPacket& recv_data) Player* leader = sObjectMgr->GetPlayer(group->GetLeaderGUID()); - // forming a new group, create it + // Forming a new group, create it if (!group->IsCreated()) { - if (leader) - group->RemoveInvite(leader); - group->Create(group->GetLeaderGUID(), group->GetLeaderName()); + // This can happen if the leader is zoning. To be removed once delayed actions for zoning are implemented + if (!leader) + { + group->RemoveAllInvites(); + return; + } + + // If we're about to create a group there really should be a leader present + ASSERT(leader); + group->RemoveInvite(leader); + group->Create(leader); sObjectMgr->AddGroup(group); } - // everything's fine, do it, PLAYER'S GROUP IS SET IN ADDMEMBER!!! - if (!group->AddMember(GetPlayer()->GetGUID(), GetPlayer()->GetName())) + // Everything is fine, do it, PLAYER'S GROUP IS SET IN ADDMEMBER!!! + if (!group->AddMember(GetPlayer())) return; group->BroadcastGroupUpdate(); @@ -234,6 +245,8 @@ void WorldSession::HandleGroupAcceptOpcode(WorldPacket& recv_data) void WorldSession::HandleGroupDeclineOpcode(WorldPacket & /*recv_data*/) { + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_DECLINE"); + Group *group = GetPlayer()->GetGroupInvite(); if (!group) return; @@ -255,6 +268,8 @@ void WorldSession::HandleGroupDeclineOpcode(WorldPacket & /*recv_data*/) void WorldSession::HandleGroupUninviteGuidOpcode(WorldPacket & recv_data) { + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_UNINVITE_GUID"); + uint64 guid; std::string reason; recv_data >> guid; @@ -301,6 +316,8 @@ void WorldSession::HandleGroupUninviteGuidOpcode(WorldPacket & recv_data) void WorldSession::HandleGroupUninviteOpcode(WorldPacket & recv_data) { + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_UNINVITE"); + std::string membername; recv_data >> membername; @@ -343,6 +360,8 @@ void WorldSession::HandleGroupUninviteOpcode(WorldPacket & recv_data) void WorldSession::HandleGroupSetLeaderOpcode(WorldPacket & recv_data) { + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_SET_LEADER"); + Group *group = GetPlayer()->GetGroup(); if (!group) return; @@ -357,12 +376,16 @@ void WorldSession::HandleGroupSetLeaderOpcode(WorldPacket & recv_data) return; /********************/ - // everything's fine, do it + // Everything's fine, do it group->ChangeLeader(guid); + + group->SendUpdate(); } void WorldSession::HandleGroupDisbandOpcode(WorldPacket & /*recv_data*/) { + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_DISBAND"); + Group *grp = GetPlayer()->GetGroup(); if (!grp) return; @@ -384,6 +407,8 @@ void WorldSession::HandleGroupDisbandOpcode(WorldPacket & /*recv_data*/) void WorldSession::HandleLootMethodOpcode(WorldPacket & recv_data) { + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_LOOT_METHOD"); + Group *group = GetPlayer()->GetGroup(); if (!group) return; @@ -439,6 +464,8 @@ void WorldSession::HandleLootRoll(WorldPacket &recv_data) void WorldSession::HandleMinimapPingOpcode(WorldPacket& recv_data) { + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_MINIMAP_PING"); + if (!GetPlayer()->GetGroup()) return; @@ -461,6 +488,8 @@ void WorldSession::HandleMinimapPingOpcode(WorldPacket& recv_data) void WorldSession::HandleRandomRollOpcode(WorldPacket& recv_data) { + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_RANDOM_ROLL"); + uint32 minimum, maximum, roll; recv_data >> minimum; recv_data >> maximum; @@ -488,6 +517,8 @@ void WorldSession::HandleRandomRollOpcode(WorldPacket& recv_data) void WorldSession::HandleRaidTargetUpdateOpcode(WorldPacket & recv_data) { + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_RAID_TARGET_UPDATE"); + Group *group = GetPlayer()->GetGroup(); if (!group) return; @@ -516,6 +547,8 @@ void WorldSession::HandleRaidTargetUpdateOpcode(WorldPacket & recv_data) void WorldSession::HandleGroupRaidConvertOpcode(WorldPacket & /*recv_data*/) { + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_RAID_CONVERT"); + Group *group = GetPlayer()->GetGroup(); if (!group) return; @@ -535,6 +568,8 @@ void WorldSession::HandleGroupRaidConvertOpcode(WorldPacket & /*recv_data*/) void WorldSession::HandleGroupChangeSubGroupOpcode(WorldPacket & recv_data) { + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_CHANGE_SUB_GROUP"); + // we will get correct pointer for group here, so we don't have to check if group is BG raid Group *group = GetPlayer()->GetGroup(); if (!group) @@ -548,78 +583,87 @@ void WorldSession::HandleGroupChangeSubGroupOpcode(WorldPacket & recv_data) if (groupNr >= MAX_RAID_SUBGROUPS) return; - /** error handling **/ uint64 senderGuid = GetPlayer()->GetGUID(); if (!group->IsLeader(senderGuid) && !group->IsAssistant(senderGuid)) return; if (!group->HasFreeSlotSubGroup(groupNr)) return; - /********************/ Player *movedPlayer = sObjectMgr->GetPlayer(name.c_str()); + uint64 guid; if (movedPlayer) { - //Do not allow leader to change group of player in combat - if (movedPlayer->isInCombat()) - return; - - // everything's fine, do it - group->ChangeMembersGroup(movedPlayer, groupNr); + guid = movedPlayer->GetGUID(); } else - group->ChangeMembersGroup(sObjectMgr->GetPlayerGUIDByName(name.c_str()), groupNr); + { + CharacterDatabase.escape_string(name); + guid = sObjectMgr->GetPlayerGUIDByName(name.c_str()); + } + + group->ChangeMembersGroup(guid, groupNr); } void WorldSession::HandleGroupAssistantLeaderOpcode(WorldPacket & recv_data) { + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_ASSISTANT_LEADER"); + Group *group = GetPlayer()->GetGroup(); if (!group) return; + if (!group->IsLeader(GetPlayer()->GetGUID())) + return; + uint64 guid; - uint8 flag; + bool apply; recv_data >> guid; - recv_data >> flag; + recv_data >> apply; - /** error handling **/ - if (!group->IsLeader(GetPlayer()->GetGUID())) - return; - /********************/ + group->SetGroupMemberFlag(guid, apply, MEMBER_FLAG_ASSISTANT); - // everything's fine, do it - group->SetAssistant(guid, (flag != 0)); + group->SendUpdate(); } void WorldSession::HandlePartyAssignmentOpcode(WorldPacket & recv_data) { - sLog->outDebug("MSG_PARTY_ASSIGNMENT"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_PARTY_ASSIGNMENT"); Group *group = GetPlayer()->GetGroup(); if (!group) return; - uint8 flag, apply; - uint64 guid; - recv_data >> flag >> apply; - recv_data >> guid; - - /** error handling **/ uint64 senderGuid = GetPlayer()->GetGUID(); if (!group->IsLeader(senderGuid) && !group->IsAssistant(senderGuid)) return; - /********************/ - // everything's fine, do it - if (flag == 0) - group->SetMainTank(guid, apply); + uint8 assignment; + bool apply; + uint64 guid; + recv_data >> assignment >> apply; + recv_data >> guid; + + switch (assignment) + { + case GROUP_ASSIGN_MAINASSIST: + group->RemoveUniqueGroupMemberFlag(MEMBER_FLAG_MAINASSIST); + group->SetGroupMemberFlag(guid, apply, MEMBER_FLAG_MAINASSIST); + break; + case GROUP_ASSIGN_MAINTANK: + group->RemoveUniqueGroupMemberFlag(MEMBER_FLAG_MAINTANK); // Remove main assist flag from current if any. + group->SetGroupMemberFlag(guid, apply, MEMBER_FLAG_MAINTANK); + default: + break; + } - else if (flag == 1) - group->SetMainAssistant(guid, apply); + group->SendUpdate(); } void WorldSession::HandleRaidReadyCheckOpcode(WorldPacket & recv_data) { + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_RAID_READY_CHECK"); + Group *group = GetPlayer()->GetGroup(); if (!group) return; @@ -835,7 +879,7 @@ void WorldSession::BuildPartyMemberStatsChangedPacket(Player *player, WorldPacke /*this procedure handles clients CMSG_REQUEST_PARTY_MEMBER_STATS request*/ void WorldSession::HandleRequestPartyMemberStatsOpcode(WorldPacket &recv_data) { - sLog->outDebug("WORLD: Received CMSG_REQUEST_PARTY_MEMBER_STATS"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_REQUEST_PARTY_MEMBER_STATS"); uint64 Guid; recv_data >> Guid; @@ -936,7 +980,7 @@ void WorldSession::HandleRequestPartyMemberStatsOpcode(WorldPacket &recv_data) void WorldSession::HandleOptOutOfLootOpcode(WorldPacket & recv_data) { - sLog->outDebug("WORLD: Received CMSG_OPT_OUT_OF_LOOT"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_OPT_OUT_OF_LOOT"); uint32 passOnLoot; recv_data >> passOnLoot; // 1 always pass, 0 do not pass diff --git a/src/server/game/Server/Protocol/Handlers/GuildHandler.cpp b/src/server/game/Server/Protocol/Handlers/GuildHandler.cpp index 9fae9ab7b9c31..625cd3f616064 100755 --- a/src/server/game/Server/Protocol/Handlers/GuildHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/GuildHandler.cpp @@ -41,7 +41,7 @@ inline Guild* _GetPlayerGuild(WorldSession* session, bool sendError = false) void WorldSession::HandleGuildQueryOpcode(WorldPacket& recvPacket) { - sLog->outDebug("WORLD: Received CMSG_GUILD_QUERY"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_QUERY"); uint32 guildId; recvPacket >> guildId; @@ -54,7 +54,7 @@ void WorldSession::HandleGuildQueryOpcode(WorldPacket& recvPacket) void WorldSession::HandleGuildCreateOpcode(WorldPacket& recvPacket) { - sLog->outDebug("WORLD: Received CMSG_GUILD_CREATE"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_CREATE"); std::string name; recvPacket >> name; @@ -71,7 +71,7 @@ void WorldSession::HandleGuildCreateOpcode(WorldPacket& recvPacket) void WorldSession::HandleGuildInviteOpcode(WorldPacket& recvPacket) { - sLog->outDebug("WORLD: Received CMSG_GUILD_INVITE"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_INVITE"); std::string invitedName; recvPacket >> invitedName; @@ -83,7 +83,7 @@ void WorldSession::HandleGuildInviteOpcode(WorldPacket& recvPacket) void WorldSession::HandleGuildRemoveOpcode(WorldPacket& recvPacket) { - sLog->outDebug("WORLD: Received CMSG_GUILD_REMOVE"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_REMOVE"); std::string playerName; recvPacket >> playerName; @@ -95,7 +95,7 @@ void WorldSession::HandleGuildRemoveOpcode(WorldPacket& recvPacket) void WorldSession::HandleGuildAcceptOpcode(WorldPacket& /*recvPacket*/) { - sLog->outDebug("WORLD: Received CMSG_GUILD_ACCEPT"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_ACCEPT"); // Player cannot be in guild if (!GetPlayer()->GetGuildId()) // Guild where player was invited must exist @@ -105,7 +105,7 @@ void WorldSession::HandleGuildAcceptOpcode(WorldPacket& /*recvPacket*/) void WorldSession::HandleGuildDeclineOpcode(WorldPacket& /*recvPacket*/) { - sLog->outDebug("WORLD: Received CMSG_GUILD_DECLINE"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_DECLINE"); GetPlayer()->SetGuildIdInvited(0); GetPlayer()->SetInGuild(0); @@ -113,7 +113,7 @@ void WorldSession::HandleGuildDeclineOpcode(WorldPacket& /*recvPacket*/) void WorldSession::HandleGuildInfoOpcode(WorldPacket& /*recvPacket*/) { - sLog->outDebug("WORLD: Received CMSG_GUILD_INFO"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_INFO"); if (Guild* pGuild = _GetPlayerGuild(this, true)) pGuild->SendInfo(this); @@ -121,7 +121,7 @@ void WorldSession::HandleGuildInfoOpcode(WorldPacket& /*recvPacket*/) void WorldSession::HandleGuildRosterOpcode(WorldPacket& /*recvPacket*/) { - sLog->outDebug("WORLD: Received CMSG_GUILD_ROSTER"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_ROSTER"); if (Guild* pGuild = _GetPlayerGuild(this)) pGuild->HandleRoster(this); @@ -129,7 +129,7 @@ void WorldSession::HandleGuildRosterOpcode(WorldPacket& /*recvPacket*/) void WorldSession::HandleGuildPromoteOpcode(WorldPacket& recvPacket) { - sLog->outDebug("WORLD: Received CMSG_GUILD_PROMOTE"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_PROMOTE"); std::string playerName; recvPacket >> playerName; @@ -141,7 +141,7 @@ void WorldSession::HandleGuildPromoteOpcode(WorldPacket& recvPacket) void WorldSession::HandleGuildDemoteOpcode(WorldPacket& recvPacket) { - sLog->outDebug("WORLD: Received CMSG_GUILD_DEMOTE"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_DEMOTE"); std::string playerName; recvPacket >> playerName; @@ -153,7 +153,7 @@ void WorldSession::HandleGuildDemoteOpcode(WorldPacket& recvPacket) void WorldSession::HandleGuildLeaveOpcode(WorldPacket& /*recvPacket*/) { - sLog->outDebug("WORLD: Received CMSG_GUILD_LEAVE"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_LEAVE"); if (Guild* pGuild = _GetPlayerGuild(this, true)) pGuild->HandleLeaveMember(this); @@ -161,7 +161,7 @@ void WorldSession::HandleGuildLeaveOpcode(WorldPacket& /*recvPacket*/) void WorldSession::HandleGuildDisbandOpcode(WorldPacket& /*recvPacket*/) { - sLog->outDebug("WORLD: Received CMSG_GUILD_DISBAND"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_DISBAND"); if (Guild* pGuild = _GetPlayerGuild(this, true)) pGuild->HandleDisband(this); @@ -169,7 +169,7 @@ void WorldSession::HandleGuildDisbandOpcode(WorldPacket& /*recvPacket*/) void WorldSession::HandleGuildLeaderOpcode(WorldPacket& recvPacket) { - sLog->outDebug("WORLD: Received CMSG_GUILD_LEADER"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_LEADER"); std::string name; recvPacket >> name; @@ -181,7 +181,7 @@ void WorldSession::HandleGuildLeaderOpcode(WorldPacket& recvPacket) void WorldSession::HandleGuildMOTDOpcode(WorldPacket& recvPacket) { - sLog->outDebug("WORLD: Received CMSG_GUILD_MOTD"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_MOTD"); std::string motd; // Empty by default if (!recvPacket.empty()) @@ -193,7 +193,7 @@ void WorldSession::HandleGuildMOTDOpcode(WorldPacket& recvPacket) void WorldSession::HandleGuildSetPublicNoteOpcode(WorldPacket& recvPacket) { - sLog->outDebug("WORLD: Received CMSG_GUILD_SET_PUBLIC_NOTE"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_SET_PUBLIC_NOTE"); std::string playerName; recvPacket >> playerName; @@ -208,7 +208,7 @@ void WorldSession::HandleGuildSetPublicNoteOpcode(WorldPacket& recvPacket) void WorldSession::HandleGuildSetOfficerNoteOpcode(WorldPacket& recvPacket) { - sLog->outDebug("WORLD: Received CMSG_GUILD_SET_OFFICER_NOTE"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_SET_OFFICER_NOTE"); std::string playerName; recvPacket >> playerName; @@ -223,7 +223,7 @@ void WorldSession::HandleGuildSetOfficerNoteOpcode(WorldPacket& recvPacket) void WorldSession::HandleGuildRankOpcode(WorldPacket& recvPacket) { - sLog->outDebug("WORLD: Received CMSG_GUILD_RANK"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_RANK"); Guild* pGuild = _GetPlayerGuild(this, true); if (!pGuild) @@ -261,7 +261,7 @@ void WorldSession::HandleGuildRankOpcode(WorldPacket& recvPacket) void WorldSession::HandleGuildAddRankOpcode(WorldPacket& recvPacket) { - sLog->outDebug("WORLD: Received CMSG_GUILD_ADD_RANK"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_ADD_RANK"); std::string rankName; recvPacket >> rankName; @@ -272,7 +272,7 @@ void WorldSession::HandleGuildAddRankOpcode(WorldPacket& recvPacket) void WorldSession::HandleGuildDelRankOpcode(WorldPacket& /*recvPacket*/) { - sLog->outDebug("WORLD: Received CMSG_GUILD_DEL_RANK"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_DEL_RANK"); if (Guild* pGuild = _GetPlayerGuild(this, true)) pGuild->HandleRemoveLowestRank(this); @@ -280,7 +280,7 @@ void WorldSession::HandleGuildDelRankOpcode(WorldPacket& /*recvPacket*/) void WorldSession::HandleGuildChangeInfoTextOpcode(WorldPacket& recvPacket) { - sLog->outDebug("WORLD: Received CMSG_GUILD_INFO_TEXT"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GUILD_INFO_TEXT"); std::string info; recvPacket >> info; @@ -291,7 +291,7 @@ void WorldSession::HandleGuildChangeInfoTextOpcode(WorldPacket& recvPacket) void WorldSession::HandleSaveGuildEmblemOpcode(WorldPacket& recvPacket) { - sLog->outDebug("WORLD: Received MSG_SAVE_GUILD_EMBLEM"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_SAVE_GUILD_EMBLEM"); uint64 vendorGuid; recvPacket >> vendorGuid; @@ -315,13 +315,13 @@ void WorldSession::HandleSaveGuildEmblemOpcode(WorldPacket& recvPacket) { // "That's not an emblem vendor!" Guild::SendSaveEmblemResult(this, ERR_GUILDEMBLEM_INVALIDVENDOR); - sLog->outDebug("WORLD: HandleSaveGuildEmblemOpcode - Unit (GUID: %u) not found or you can't interact with him.", GUID_LOPART(vendorGuid)); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleSaveGuildEmblemOpcode - Unit (GUID: %u) not found or you can't interact with him.", GUID_LOPART(vendorGuid)); } } void WorldSession::HandleGuildEventLogQueryOpcode(WorldPacket& /* recvPacket */) { - sLog->outDebug("WORLD: Received (MSG_GUILD_EVENT_LOG_QUERY)"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received (MSG_GUILD_EVENT_LOG_QUERY)"); if (Guild* pGuild = _GetPlayerGuild(this)) pGuild->SendEventLog(this); @@ -329,7 +329,7 @@ void WorldSession::HandleGuildEventLogQueryOpcode(WorldPacket& /* recvPacket */) void WorldSession::HandleGuildBankMoneyWithdrawn(WorldPacket & /* recv_data */) { - sLog->outDebug("WORLD: Received (MSG_GUILD_BANK_MONEY_WITHDRAWN)"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received (MSG_GUILD_BANK_MONEY_WITHDRAWN)"); if (Guild* pGuild = _GetPlayerGuild(this)) pGuild->SendMoneyInfo(this); @@ -337,7 +337,7 @@ void WorldSession::HandleGuildBankMoneyWithdrawn(WorldPacket & /* recv_data */) void WorldSession::HandleGuildPermissions(WorldPacket& /* recv_data */) { - sLog->outDebug("WORLD: Received (MSG_GUILD_PERMISSIONS)"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received (MSG_GUILD_PERMISSIONS)"); if (Guild* pGuild = _GetPlayerGuild(this)) pGuild->SendPermissions(this); @@ -346,7 +346,7 @@ void WorldSession::HandleGuildPermissions(WorldPacket& /* recv_data */) // Called when clicking on Guild bank gameobject void WorldSession::HandleGuildBankerActivate(WorldPacket & recv_data) { - sLog->outDebug("WORLD: Received (CMSG_GUILD_BANKER_ACTIVATE)"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received (CMSG_GUILD_BANKER_ACTIVATE)"); uint64 GoGuid; recv_data >> GoGuid; @@ -366,7 +366,7 @@ void WorldSession::HandleGuildBankerActivate(WorldPacket & recv_data) // Called when opening pGuild bank tab only (first one) void WorldSession::HandleGuildBankQueryTab(WorldPacket & recv_data) { - sLog->outDebug("WORLD: Received (CMSG_GUILD_BANK_QUERY_TAB)"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received (CMSG_GUILD_BANK_QUERY_TAB)"); uint64 GoGuid; recv_data >> GoGuid; @@ -384,7 +384,7 @@ void WorldSession::HandleGuildBankQueryTab(WorldPacket & recv_data) void WorldSession::HandleGuildBankDepositMoney(WorldPacket & recv_data) { - sLog->outDebug("WORLD: Received (CMSG_GUILD_BANK_DEPOSIT_MONEY)"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received (CMSG_GUILD_BANK_DEPOSIT_MONEY)"); uint64 GoGuid; recv_data >> GoGuid; @@ -400,7 +400,7 @@ void WorldSession::HandleGuildBankDepositMoney(WorldPacket & recv_data) void WorldSession::HandleGuildBankWithdrawMoney(WorldPacket & recv_data) { - sLog->outDebug("WORLD: Received (CMSG_GUILD_BANK_WITHDRAW_MONEY)"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received (CMSG_GUILD_BANK_WITHDRAW_MONEY)"); uint64 GoGuid; recv_data >> GoGuid; @@ -416,7 +416,7 @@ void WorldSession::HandleGuildBankWithdrawMoney(WorldPacket & recv_data) void WorldSession::HandleGuildBankSwapItems(WorldPacket & recv_data) { - sLog->outDebug("WORLD: Received (CMSG_GUILD_BANK_SWAP_ITEMS)"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received (CMSG_GUILD_BANK_SWAP_ITEMS)"); uint64 GoGuid; recv_data >> GoGuid; @@ -497,7 +497,7 @@ void WorldSession::HandleGuildBankSwapItems(WorldPacket & recv_data) void WorldSession::HandleGuildBankBuyTab(WorldPacket & recv_data) { - sLog->outDebug("WORLD: Received (CMSG_GUILD_BANK_BUY_TAB)"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received (CMSG_GUILD_BANK_BUY_TAB)"); uint64 GoGuid; recv_data >> GoGuid; @@ -512,7 +512,7 @@ void WorldSession::HandleGuildBankBuyTab(WorldPacket & recv_data) void WorldSession::HandleGuildBankUpdateTab(WorldPacket & recv_data) { - sLog->outDebug("WORLD: Received (CMSG_GUILD_BANK_UPDATE_TAB)"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received (CMSG_GUILD_BANK_UPDATE_TAB)"); uint64 GoGuid; recv_data >> GoGuid; @@ -534,7 +534,7 @@ void WorldSession::HandleGuildBankUpdateTab(WorldPacket & recv_data) void WorldSession::HandleGuildBankLogQuery(WorldPacket & recv_data) { - sLog->outDebug("WORLD: Received (MSG_GUILD_BANK_LOG_QUERY)"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received (MSG_GUILD_BANK_LOG_QUERY)"); uint8 tabId; recv_data >> tabId; @@ -545,7 +545,7 @@ void WorldSession::HandleGuildBankLogQuery(WorldPacket & recv_data) void WorldSession::HandleQueryGuildBankTabText(WorldPacket &recv_data) { - sLog->outDebug("WORLD: Received MSG_QUERY_GUILD_BANK_TEXT"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_QUERY_GUILD_BANK_TEXT"); uint8 tabId; recv_data >> tabId; @@ -556,7 +556,7 @@ void WorldSession::HandleQueryGuildBankTabText(WorldPacket &recv_data) void WorldSession::HandleSetGuildBankTabText(WorldPacket &recv_data) { - sLog->outDebug("WORLD: Received CMSG_SET_GUILD_BANK_TEXT"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_SET_GUILD_BANK_TEXT"); uint8 tabId; recv_data >> tabId; diff --git a/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp b/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp index 514461b5dfd31..770ed41badb67 100755 --- a/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp @@ -29,7 +29,7 @@ void WorldSession::HandleSplitItemOpcode(WorldPacket & recv_data) { - //sLog->outDebug("WORLD: CMSG_SPLIT_ITEM"); + //sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: CMSG_SPLIT_ITEM"); uint8 srcbag, srcslot, dstbag, dstslot; uint32 count; @@ -62,7 +62,7 @@ void WorldSession::HandleSplitItemOpcode(WorldPacket & recv_data) void WorldSession::HandleSwapInvItemOpcode(WorldPacket & recv_data) { - //sLog->outDebug("WORLD: CMSG_SWAP_INV_ITEM"); + //sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: CMSG_SWAP_INV_ITEM"); uint8 srcslot, dstslot; recv_data >> dstslot >> srcslot; @@ -111,7 +111,7 @@ void WorldSession::HandleAutoEquipItemSlotOpcode(WorldPacket & recv_data) void WorldSession::HandleSwapItem(WorldPacket & recv_data) { - //sLog->outDebug("WORLD: CMSG_SWAP_ITEM"); + //sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: CMSG_SWAP_ITEM"); uint8 dstbag, dstslot, srcbag, srcslot; recv_data >> dstbag >> dstslot >> srcbag >> srcslot ; @@ -141,7 +141,7 @@ void WorldSession::HandleSwapItem(WorldPacket & recv_data) void WorldSession::HandleAutoEquipItemOpcode(WorldPacket & recv_data) { - //sLog->outDebug("WORLD: CMSG_AUTOEQUIP_ITEM"); + //sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: CMSG_AUTOEQUIP_ITEM"); uint8 srcbag, srcslot; recv_data >> srcbag >> srcslot; @@ -235,7 +235,7 @@ void WorldSession::HandleAutoEquipItemOpcode(WorldPacket & recv_data) void WorldSession::HandleDestroyItemOpcode(WorldPacket & recv_data) { - //sLog->outDebug("WORLD: CMSG_DESTROYITEM"); + //sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: CMSG_DESTROYITEM"); uint8 bag, slot, count, data1, data2, data3; recv_data >> bag >> slot >> count >> data1 >> data2 >> data3; @@ -279,7 +279,7 @@ void WorldSession::HandleDestroyItemOpcode(WorldPacket & recv_data) // Only _static_ data send in this packet !!! void WorldSession::HandleItemQuerySingleOpcode(WorldPacket & recv_data) { - //sLog->outDebug("WORLD: CMSG_ITEM_QUERY_SINGLE"); + //sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: CMSG_ITEM_QUERY_SINGLE"); uint32 item; recv_data >> item; @@ -429,7 +429,7 @@ void WorldSession::HandleItemQuerySingleOpcode(WorldPacket & recv_data) } else { - sLog->outDebug("WORLD: CMSG_ITEM_QUERY_SINGLE - NO item INFO! (ENTRY: %u)", item); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_ITEM_QUERY_SINGLE - NO item INFO! (ENTRY: %u)", item); WorldPacket data(SMSG_ITEM_QUERY_SINGLE_RESPONSE, 4); data << uint32(item | 0x80000000); SendPacket(&data); @@ -438,7 +438,7 @@ void WorldSession::HandleItemQuerySingleOpcode(WorldPacket & recv_data) void WorldSession::HandleReadItem(WorldPacket & recv_data) { - //sLog->outDebug("WORLD: CMSG_READ_ITEM"); + //sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: CMSG_READ_ITEM"); uint8 bag, slot; recv_data >> bag >> slot; @@ -471,7 +471,7 @@ void WorldSession::HandleReadItem(WorldPacket & recv_data) void WorldSession::HandlePageQuerySkippedOpcode(WorldPacket & recv_data) { - sLog->outDebug("WORLD: Received CMSG_PAGE_TEXT_QUERY"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_PAGE_TEXT_QUERY"); uint32 itemid; uint64 guid; @@ -484,7 +484,7 @@ void WorldSession::HandlePageQuerySkippedOpcode(WorldPacket & recv_data) void WorldSession::HandleSellItemOpcode(WorldPacket & recv_data) { - sLog->outDebug("WORLD: Received CMSG_SELL_ITEM"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_SELL_ITEM"); uint64 vendorguid, itemguid; uint32 count; @@ -496,7 +496,7 @@ void WorldSession::HandleSellItemOpcode(WorldPacket & recv_data) Creature *pCreature = GetPlayer()->GetNPCIfCanInteractWith(vendorguid,UNIT_NPC_FLAG_VENDOR); if (!pCreature) { - sLog->outDebug("WORLD: HandleSellItemOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(vendorguid))); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleSellItemOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(vendorguid))); _player->SendSellError(SELL_ERR_CANT_FIND_VENDOR, NULL, itemguid, 0); return; } @@ -516,7 +516,7 @@ void WorldSession::HandleSellItemOpcode(WorldPacket & recv_data) } // prevent sell non empty bag by drag-and-drop at vendor's item list - if (pItem->IsBag() && !((Bag*)pItem)->IsEmpty()) + if (pItem->IsNotEmptyBag()) { _player->SendSellError(SELL_ERR_CANT_SELL_ITEM, pCreature, itemguid, 0); return; @@ -598,7 +598,7 @@ void WorldSession::HandleSellItemOpcode(WorldPacket & recv_data) void WorldSession::HandleBuybackItem(WorldPacket & recv_data) { - sLog->outDebug("WORLD: Received CMSG_BUYBACK_ITEM"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_BUYBACK_ITEM"); uint64 vendorguid; uint32 slot; @@ -607,7 +607,7 @@ void WorldSession::HandleBuybackItem(WorldPacket & recv_data) Creature *pCreature = GetPlayer()->GetNPCIfCanInteractWith(vendorguid,UNIT_NPC_FLAG_VENDOR); if (!pCreature) { - sLog->outDebug("WORLD: HandleBuybackItem - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(vendorguid))); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleBuybackItem - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(vendorguid))); _player->SendSellError(SELL_ERR_CANT_FIND_VENDOR, NULL, 0, 0); return; } @@ -646,7 +646,7 @@ void WorldSession::HandleBuybackItem(WorldPacket & recv_data) void WorldSession::HandleBuyItemInSlotOpcode(WorldPacket & recv_data) { - sLog->outDebug("WORLD: Received CMSG_BUY_ITEM_IN_SLOT"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_BUY_ITEM_IN_SLOT"); uint64 vendorguid, bagguid; uint32 item, slot, count; uint8 bagslot; @@ -668,7 +668,7 @@ void WorldSession::HandleBuyItemInSlotOpcode(WorldPacket & recv_data) { for (int i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i) { - if (Bag *pBag = (Bag*)_player->GetItemByPos(INVENTORY_SLOT_BAG_0,i)) + if (Bag* pBag = _player->GetBagByPos(i)) { if (bagguid == pBag->GetGUID()) { @@ -688,7 +688,7 @@ void WorldSession::HandleBuyItemInSlotOpcode(WorldPacket & recv_data) void WorldSession::HandleBuyItemOpcode(WorldPacket & recv_data) { - sLog->outDebug("WORLD: Received CMSG_BUY_ITEM"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_BUY_ITEM"); uint64 vendorguid; uint32 item, slot, count; uint8 unk1; @@ -713,19 +713,19 @@ void WorldSession::HandleListInventoryOpcode(WorldPacket & recv_data) if (!GetPlayer()->isAlive()) return; - sLog->outDebug("WORLD: Recvd CMSG_LIST_INVENTORY"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_LIST_INVENTORY"); SendListInventory(guid); } void WorldSession::SendListInventory(uint64 vendorguid) { - sLog->outDebug("WORLD: Sent SMSG_LIST_INVENTORY"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_LIST_INVENTORY"); Creature *pCreature = GetPlayer()->GetNPCIfCanInteractWith(vendorguid,UNIT_NPC_FLAG_VENDOR); if (!pCreature) { - sLog->outDebug("WORLD: SendListInventory - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(vendorguid))); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: SendListInventory - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(vendorguid))); _player->SendSellError(SELL_ERR_CANT_FIND_VENDOR, NULL, 0, 0); return; } @@ -802,7 +802,7 @@ void WorldSession::SendListInventory(uint64 vendorguid) void WorldSession::HandleAutoStoreBagItemOpcode(WorldPacket & recv_data) { - //sLog->outDebug("WORLD: CMSG_AUTOSTORE_BAG_ITEM"); + //sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: CMSG_AUTOSTORE_BAG_ITEM"); uint8 srcbag, srcslot, dstbag; recv_data >> srcbag >> srcslot >> dstbag; @@ -853,7 +853,7 @@ void WorldSession::HandleAutoStoreBagItemOpcode(WorldPacket & recv_data) void WorldSession::HandleBuyBankSlotOpcode(WorldPacket& recvPacket) { - sLog->outDebug("WORLD: CMSG_BUY_BANK_SLOT"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_BUY_BANK_SLOT"); uint64 guid; recvPacket >> guid; @@ -906,11 +906,11 @@ void WorldSession::HandleBuyBankSlotOpcode(WorldPacket& recvPacket) void WorldSession::HandleAutoBankItemOpcode(WorldPacket& recvPacket) { - sLog->outDebug("WORLD: CMSG_AUTOBANK_ITEM"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_AUTOBANK_ITEM"); uint8 srcbag, srcslot; recvPacket >> srcbag >> srcslot; - sLog->outDebug("STORAGE: receive srcbag = %u, srcslot = %u", srcbag, srcslot); + sLog->outDebug(LOG_FILTER_NETWORKIO, "STORAGE: receive srcbag = %u, srcslot = %u", srcbag, srcslot); Item *pItem = _player->GetItemByPos(srcbag, srcslot); if (!pItem) @@ -936,11 +936,11 @@ void WorldSession::HandleAutoBankItemOpcode(WorldPacket& recvPacket) void WorldSession::HandleAutoStoreBankItemOpcode(WorldPacket& recvPacket) { - sLog->outDebug("WORLD: CMSG_AUTOSTORE_BANK_ITEM"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_AUTOSTORE_BANK_ITEM"); uint8 srcbag, srcslot; recvPacket >> srcbag >> srcslot; - sLog->outDebug("STORAGE: receive srcbag = %u, srcslot = %u", srcbag, srcslot); + sLog->outDebug(LOG_FILTER_NETWORKIO, "STORAGE: receive srcbag = %u, srcslot = %u", srcbag, srcslot); Item *pItem = _player->GetItemByPos(srcbag, srcslot); if (!pItem) @@ -982,7 +982,7 @@ void WorldSession::HandleSetAmmoOpcode(WorldPacket & recv_data) return; } - sLog->outDebug("WORLD: CMSG_SET_AMMO"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_SET_AMMO"); uint32 item; recv_data >> item; @@ -1021,7 +1021,7 @@ void WorldSession::HandleItemNameQueryOpcode(WorldPacket & recv_data) recv_data >> itemid; recv_data.read_skip(); // guid - sLog->outDebug("WORLD: CMSG_ITEM_NAME_QUERY %u", itemid); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_ITEM_NAME_QUERY %u", itemid); ItemSetNameEntry const *pName = sObjectMgr->GetItemSetNameEntry(itemid); if (pName) { @@ -1041,7 +1041,7 @@ void WorldSession::HandleItemNameQueryOpcode(WorldPacket & recv_data) void WorldSession::HandleWrapItemOpcode(WorldPacket& recv_data) { - sLog->outDebug("Received opcode CMSG_WRAP_ITEM"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode CMSG_WRAP_ITEM"); uint8 gift_bag, gift_slot, item_bag, item_slot; //recv_data.hexlike(); @@ -1049,7 +1049,7 @@ void WorldSession::HandleWrapItemOpcode(WorldPacket& recv_data) recv_data >> gift_bag >> gift_slot; // paper recv_data >> item_bag >> item_slot; // item - sLog->outDebug("WRAP: receive gift_bag = %u, gift_slot = %u, item_bag = %u, item_slot = %u", gift_bag, gift_slot, item_bag, item_slot); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WRAP: receive gift_bag = %u, gift_slot = %u, item_bag = %u, item_slot = %u", gift_bag, gift_slot, item_bag, item_slot); Item *gift = _player->GetItemByPos(gift_bag, gift_slot); if (!gift) @@ -1146,7 +1146,7 @@ void WorldSession::HandleWrapItemOpcode(WorldPacket& recv_data) void WorldSession::HandleSocketOpcode(WorldPacket& recv_data) { - sLog->outDebug("WORLD: CMSG_SOCKET_GEMS"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_SOCKET_GEMS"); uint64 item_guid; uint64 gem_guids[MAX_GEM_SOCKETS]; @@ -1340,7 +1340,7 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recv_data) void WorldSession::HandleCancelTempEnchantmentOpcode(WorldPacket& recv_data) { - sLog->outDebug("WORLD: CMSG_CANCEL_TEMP_ENCHANTMENT"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CANCEL_TEMP_ENCHANTMENT"); uint32 eslot; @@ -1364,7 +1364,7 @@ void WorldSession::HandleCancelTempEnchantmentOpcode(WorldPacket& recv_data) void WorldSession::HandleItemRefundInfoRequest(WorldPacket& recv_data) { - sLog->outDebug("WORLD: CMSG_ITEM_REFUND_INFO"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_ITEM_REFUND_INFO"); uint64 guid; recv_data >> guid; // item guid @@ -1372,7 +1372,7 @@ void WorldSession::HandleItemRefundInfoRequest(WorldPacket& recv_data) Item *item = _player->GetItemByGuid(guid); if (!item) { - sLog->outDebug("Item refund: item not found!"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Item refund: item not found!"); return; } @@ -1381,14 +1381,14 @@ void WorldSession::HandleItemRefundInfoRequest(WorldPacket& recv_data) void WorldSession::HandleItemRefund(WorldPacket &recv_data) { - sLog->outDebug("WORLD: CMSG_ITEM_REFUND"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_ITEM_REFUND"); uint64 guid; recv_data >> guid; // item guid Item *item = _player->GetItemByGuid(guid); if (!item) { - sLog->outDebug("Item refund: item not found!"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Item refund: item not found!"); return; } @@ -1405,7 +1405,7 @@ void WorldSession::HandleItemTextQuery(WorldPacket & recv_data ) uint64 itemGuid; recv_data >> itemGuid; - sLog->outDebug("CMSG_ITEM_TEXT_QUERY item guid: %u", GUID_LOPART(itemGuid)); + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_ITEM_TEXT_QUERY item guid: %u", GUID_LOPART(itemGuid)); WorldPacket data(SMSG_ITEM_TEXT_QUERY_RESPONSE, (4+10)); // guess size diff --git a/src/server/game/Server/Protocol/Handlers/LFGHandler.cpp b/src/server/game/Server/Protocol/Handlers/LFGHandler.cpp index ac8ce189f4b00..5e8532f351bac 100755 --- a/src/server/game/Server/Protocol/Handlers/LFGHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/LFGHandler.cpp @@ -62,7 +62,7 @@ void WorldSession::HandleLfgJoinOpcode(WorldPacket& recv_data) recv_data >> numDungeons; if (!numDungeons) { - sLog->outDebug("CMSG_LFG_JOIN [" UI64FMTD "] no dungeons selected", GetPlayer()->GetGUID()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LFG_JOIN [" UI64FMTD "] no dungeons selected", GetPlayer()->GetGUID()); recv_data.rpos(recv_data.wpos()); return; } @@ -78,7 +78,7 @@ void WorldSession::HandleLfgJoinOpcode(WorldPacket& recv_data) std::string comment; recv_data >> comment; - sLog->outDebug("CMSG_LFG_JOIN [" UI64FMTD "] roles: %u, Dungeons: %u, Comment: %s", GetPlayer()->GetGUID(), roles, uint8(newDungeons.size()), comment.c_str()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LFG_JOIN [" UI64FMTD "] roles: %u, Dungeons: %u, Comment: %s", GetPlayer()->GetGUID(), roles, uint8(newDungeons.size()), comment.c_str()); sLFGMgr->Join(GetPlayer(), uint8(roles), newDungeons, comment); } @@ -86,7 +86,7 @@ void WorldSession::HandleLfgLeaveOpcode(WorldPacket& /*recv_data*/) { Group* grp = GetPlayer()->GetGroup(); - sLog->outDebug("CMSG_LFG_LEAVE [" UI64FMTD "] in group: %u", GetPlayer()->GetGUID(), grp ? 1 : 0); + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LFG_LEAVE [" UI64FMTD "] in group: %u", GetPlayer()->GetGUID(), grp ? 1 : 0); // Check cheating - only leader can leave the queue if (!grp || grp->GetLeaderGUID() == GetPlayer()->GetGUID()) @@ -100,7 +100,7 @@ void WorldSession::HandleLfgProposalResultOpcode(WorldPacket& recv_data) recv_data >> lfgGroupID; recv_data >> accept; - sLog->outDebug("CMSG_LFG_PROPOSAL_RESULT [" UI64FMTD "] proposal: %u accept: %u", GetPlayer()->GetGUID(), lfgGroupID, accept ? 1 : 0); + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LFG_PROPOSAL_RESULT [" UI64FMTD "] proposal: %u accept: %u", GetPlayer()->GetGUID(), lfgGroupID, accept ? 1 : 0); sLFGMgr->UpdateProposal(lfgGroupID, GetPlayer()->GetGUID(), accept); } @@ -112,11 +112,11 @@ void WorldSession::HandleLfgSetRolesOpcode(WorldPacket& recv_data) Group* grp = GetPlayer()->GetGroup(); if (!grp) { - sLog->outDebug("CMSG_LFG_SET_ROLES [" UI64FMTD "] Not in group", guid); + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LFG_SET_ROLES [" UI64FMTD "] Not in group", guid); return; } uint64 gguid = grp->GetGUID(); - sLog->outDebug("CMSG_LFG_SET_ROLES: Group [" UI64FMTD "], Player [" UI64FMTD "], Roles: %u", gguid, guid, roles); + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LFG_SET_ROLES: Group [" UI64FMTD "], Player [" UI64FMTD "], Roles: %u", gguid, guid, roles); sLFGMgr->UpdateRoleCheck(gguid, guid, roles); } @@ -125,7 +125,7 @@ void WorldSession::HandleLfgSetCommentOpcode(WorldPacket& recv_data) std::string comment; recv_data >> comment; uint64 guid = GetPlayer()->GetGUID(); - sLog->outDebug("CMSG_SET_LFG_COMMENT [" UI64FMTD "] comment: %s", guid, comment.c_str()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_SET_LFG_COMMENT [" UI64FMTD "] comment: %s", guid, comment.c_str()); sLFGMgr->SetComment(guid, comment); } @@ -135,7 +135,7 @@ void WorldSession::HandleLfgSetBootVoteOpcode(WorldPacket& recv_data) bool agree; // Agree to kick player recv_data >> agree; - sLog->outDebug("CMSG_LFG_SET_BOOT_VOTE [" UI64FMTD "] agree: %u", GetPlayer()->GetGUID(), agree ? 1 : 0); + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LFG_SET_BOOT_VOTE [" UI64FMTD "] agree: %u", GetPlayer()->GetGUID(), agree ? 1 : 0); sLFGMgr->UpdateBoot(GetPlayer(), agree); } @@ -144,14 +144,14 @@ void WorldSession::HandleLfgTeleportOpcode(WorldPacket& recv_data) bool out; recv_data >> out; - sLog->outDebug("CMSG_LFG_TELEPORT [" UI64FMTD "] out: %u", GetPlayer()->GetGUID(), out ? 1 : 0); + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LFG_TELEPORT [" UI64FMTD "] out: %u", GetPlayer()->GetGUID(), out ? 1 : 0); sLFGMgr->TeleportPlayer(GetPlayer(), out, true); } void WorldSession::HandleLfgPlayerLockInfoRequestOpcode(WorldPacket& /*recv_data*/) { uint64 guid = GetPlayer()->GetGUID(); - sLog->outDebug("CMSG_LFD_PLAYER_LOCK_INFO_REQUEST [" UI64FMTD "]", guid); + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LFD_PLAYER_LOCK_INFO_REQUEST [" UI64FMTD "]", guid); // Get Random dungeons that can be done at a certain level and expansion // FIXME - Should return seasonals (when not disabled) @@ -171,7 +171,7 @@ void WorldSession::HandleLfgPlayerLockInfoRequestOpcode(WorldPacket& /*recv_data uint32 rsize = uint32(randomDungeons.size()); uint32 lsize = uint32(lock.size()); - sLog->outDebug("SMSG_LFG_PLAYER_INFO [" UI64FMTD "]", guid); + sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_LFG_PLAYER_INFO [" UI64FMTD "]", guid); WorldPacket data(SMSG_LFG_PLAYER_INFO, 1 + rsize * (4 + 1 + 4 + 4 + 4 + 4 + 1 + 4 + 4 + 4) + 4 + lsize * (1 + 4 + 4 + 4 + 4 + 1 + 4 + 4 + 4)); data << uint8(randomDungeons.size()); // Random Dungeon count @@ -232,7 +232,7 @@ void WorldSession::HandleLfgPlayerLockInfoRequestOpcode(WorldPacket& /*recv_data void WorldSession::HandleLfgPartyLockInfoRequestOpcode(WorldPacket& /*recv_data*/) { uint64 guid = GetPlayer()->GetGUID(); - sLog->outDebug("CMSG_LFD_PARTY_LOCK_INFO_REQUEST [" UI64FMTD "]", guid); + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LFD_PARTY_LOCK_INFO_REQUEST [" UI64FMTD "]", guid); Group* grp = GetPlayer()->GetGroup(); if (!grp) @@ -257,7 +257,7 @@ void WorldSession::HandleLfgPartyLockInfoRequestOpcode(WorldPacket& /*recv_data for (LfgLockPartyMap::const_iterator it = lockMap.begin(); it != lockMap.end(); ++it) size += 8 + 4 + uint32(it->second.size()) * (4 + 4); - sLog->outDebug("SMSG_LFG_PARTY_INFO [" UI64FMTD "]", guid); + sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_LFG_PARTY_INFO [" UI64FMTD "]", guid); WorldPacket data(SMSG_LFG_PARTY_INFO, 1 + size); BuildPartyLockDungeonBlock(data, lockMap); SendPacket(&data); @@ -267,7 +267,7 @@ void WorldSession::HandleLfrSearchOpcode(WorldPacket& recv_data) { uint32 entry; // Raid id to search recv_data >> entry; - sLog->outDebug("CMSG_SEARCH_LFG_JOIN [" UI64FMTD "] dungeon entry: %u", GetPlayer()->GetGUID(), entry); + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_SEARCH_LFG_JOIN [" UI64FMTD "] dungeon entry: %u", GetPlayer()->GetGUID(), entry); //SendLfrUpdateListOpcode(entry); } @@ -275,7 +275,7 @@ void WorldSession::HandleLfrLeaveOpcode(WorldPacket& recv_data) { uint32 dungeonId; // Raid id queue to leave recv_data >> dungeonId; - sLog->outDebug("CMSG_SEARCH_LFG_LEAVE [" UI64FMTD "] dungeonId: %u", GetPlayer()->GetGUID(), dungeonId); + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_SEARCH_LFG_LEAVE [" UI64FMTD "] dungeonId: %u", GetPlayer()->GetGUID(), dungeonId); //sLFGMgr->LeaveLfr(GetPlayer(), dungeonId); } @@ -302,7 +302,7 @@ void WorldSession::SendLfgUpdatePlayer(const LfgUpdateData& updateData) uint64 guid = GetPlayer()->GetGUID(); uint8 size = uint8(updateData.dungeons.size()); - sLog->outDebug("SMSG_LFG_UPDATE_PLAYER [" UI64FMTD "] updatetype: %u", guid, updateData.updateType); + sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_LFG_UPDATE_PLAYER [" UI64FMTD "] updatetype: %u", guid, updateData.updateType); WorldPacket data(SMSG_LFG_UPDATE_PLAYER, 1 + 1 + (extrainfo ? 1 : 0) * (1 + 1 + 1 + 1 + size * 4 + updateData.comment.length())); data << uint8(updateData.updateType); // Lfg Update type data << uint8(extrainfo); // Extra info @@ -352,7 +352,7 @@ void WorldSession::SendLfgUpdateParty(const LfgUpdateData& updateData) uint64 guid = GetPlayer()->GetGUID(); uint8 size = uint8(updateData.dungeons.size()); - sLog->outDebug("SMSG_LFG_UPDATE_PARTY [" UI64FMTD "] updatetype: %u", guid, updateData.updateType); + sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_LFG_UPDATE_PARTY [" UI64FMTD "] updatetype: %u", guid, updateData.updateType); WorldPacket data(SMSG_LFG_UPDATE_PARTY, 1 + 1 + (extrainfo ? 1 : 0) * (1 + 1 + 1 + 1 + 1 + size * 4 + updateData.comment.length())); data << uint8(updateData.updateType); // Lfg Update type data << uint8(extrainfo); // Extra info @@ -376,7 +376,7 @@ void WorldSession::SendLfgUpdateParty(const LfgUpdateData& updateData) void WorldSession::SendLfgRoleChosen(uint64 guid, uint8 roles) { - sLog->outDebug("SMSG_LFG_ROLE_CHOSEN [" UI64FMTD "] guid: [" UI64FMTD "] roles: %u", GetPlayer()->GetGUID(), guid, roles); + sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_LFG_ROLE_CHOSEN [" UI64FMTD "] guid: [" UI64FMTD "] roles: %u", GetPlayer()->GetGUID(), guid, roles); WorldPacket data(SMSG_LFG_ROLE_CHOSEN, 8 + 1 + 4); data << uint64(guid); // Guid @@ -394,7 +394,7 @@ void WorldSession::SendLfgRoleCheckUpdate(const LfgRoleCheck* pRoleCheck) else dungeons = pRoleCheck->dungeons; - sLog->outDebug("SMSG_LFG_ROLE_CHECK_UPDATE [" UI64FMTD "]", GetPlayer()->GetGUID()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_LFG_ROLE_CHECK_UPDATE [" UI64FMTD "]", GetPlayer()->GetGUID()); WorldPacket data(SMSG_LFG_ROLE_CHECK_UPDATE, 4 + 1 + 1 + dungeons.size() * 4 + 1 + pRoleCheck->roles.size() * (8 + 1 + 4 + 1)); data << uint32(pRoleCheck->state); // Check result @@ -444,7 +444,7 @@ void WorldSession::SendLfgJoinResult(const LfgJoinResultData& joinData) for (LfgLockPartyMap::const_iterator it = joinData.lockmap.begin(); it != joinData.lockmap.end(); ++it) size += 8 + 4 + uint32(it->second.size()) * (4 + 4); - sLog->outDebug("SMSG_LFG_JOIN_RESULT [" UI64FMTD "] checkResult: %u checkValue: %u", GetPlayer()->GetGUID(), joinData.result, joinData.state); + sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_LFG_JOIN_RESULT [" UI64FMTD "] checkResult: %u checkValue: %u", GetPlayer()->GetGUID(), joinData.result, joinData.state); WorldPacket data(SMSG_LFG_JOIN_RESULT, 4 + 4 + size); data << uint32(joinData.result); // Check Result data << uint32(joinData.state); // Check Value @@ -455,7 +455,7 @@ void WorldSession::SendLfgJoinResult(const LfgJoinResultData& joinData) void WorldSession::SendLfgQueueStatus(uint32 dungeon, int32 waitTime, int32 avgWaitTime, int32 waitTimeTanks, int32 waitTimeHealer, int32 waitTimeDps, uint32 queuedTime, uint8 tanks, uint8 healers, uint8 dps) { - sLog->outDebug("SMSG_LFG_QUEUE_STATUS [" UI64FMTD "] dungeon: %u - waitTime: %d - avgWaitTime: %d - waitTimeTanks: %d - waitTimeHealer: %d - waitTimeDps: %d - queuedTime: %u - tanks: %u - healers: %u - dps: %u", GetPlayer()->GetGUID(), dungeon, waitTime, avgWaitTime, waitTimeTanks, waitTimeHealer, waitTimeDps, queuedTime, tanks, healers, dps); + sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_LFG_QUEUE_STATUS [" UI64FMTD "] dungeon: %u - waitTime: %d - avgWaitTime: %d - waitTimeTanks: %d - waitTimeHealer: %d - waitTimeDps: %d - queuedTime: %u - tanks: %u - healers: %u - dps: %u", GetPlayer()->GetGUID(), dungeon, waitTime, avgWaitTime, waitTimeTanks, waitTimeHealer, waitTimeDps, queuedTime, tanks, healers, dps); WorldPacket data(SMSG_LFG_QUEUE_STATUS, 4 + 4 + 4 + 4 + 4 +4 + 1 + 1 + 1 + 4); data << uint32(dungeon); // Dungeon @@ -478,7 +478,7 @@ void WorldSession::SendLfgPlayerReward(uint32 rdungeonEntry, uint32 sdungeonEntr uint8 itemNum = uint8(qRew ? qRew->GetRewItemsCount() : 0); - sLog->outDebug("SMSG_LFG_PLAYER_REWARD [" UI64FMTD "] rdungeonEntry: %u - sdungeonEntry: %u - done: %u", GetPlayer()->GetGUID(), rdungeonEntry, sdungeonEntry, done); + sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_LFG_PLAYER_REWARD [" UI64FMTD "] rdungeonEntry: %u - sdungeonEntry: %u - done: %u", GetPlayer()->GetGUID(), rdungeonEntry, sdungeonEntry, done); WorldPacket data(SMSG_LFG_PLAYER_REWARD, 4 + 4 + 1 + 4 + 4 + 4 + 4 + 4 + 1 + itemNum * (4 + 4 + 4)); data << uint32(rdungeonEntry); // Random Dungeon Finished data << uint32(sdungeonEntry); // Dungeon Finished @@ -523,7 +523,7 @@ void WorldSession::SendLfgBootPlayer(const LfgPlayerBoot* pBoot) ++agreeNum; } } - sLog->outDebug("SMSG_LFG_BOOT_PLAYER [" UI64FMTD "] inProgress: %u - didVote: %u - agree: %u - victim: [" UI64FMTD "] votes: %u - agrees: %u - left: %u - needed: %u - reason %s", + sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_LFG_BOOT_PLAYER [" UI64FMTD "] inProgress: %u - didVote: %u - agree: %u - victim: [" UI64FMTD "] votes: %u - agrees: %u - left: %u - needed: %u - reason %s", guid, uint8(pBoot->inProgress), uint8(playerVote != LFG_ANSWER_PENDING), uint8(playerVote == LFG_ANSWER_AGREE), pBoot->victim, votesNum, agreeNum, secsleft, pBoot->votedNeeded, pBoot->reason.c_str()); WorldPacket data(SMSG_LFG_BOOT_PLAYER, 1 + 1 + 1 + 8 + 4 + 4 + 4 + 4 + pBoot->reason.length()); data << uint8(pBoot->inProgress); // Vote in progress @@ -563,7 +563,7 @@ void WorldSession::SendLfgUpdateProposal(uint32 proposalId, const LfgProposal* p isSameDungeon = GetPlayer()->GetGroup() == grp && isContinue; } - sLog->outDebug("SMSG_LFG_PROPOSAL_UPDATE [" UI64FMTD "] state: %u", GetPlayer()->GetGUID(), pProp->state); + sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_LFG_PROPOSAL_UPDATE [" UI64FMTD "] state: %u", GetPlayer()->GetGUID(), pProp->state); WorldPacket data(SMSG_LFG_PROPOSAL_UPDATE, 4 + 1 + 4 + 4 + 1 + 1 + pProp->players.size() * (4 + 1 + 1 + 1 + 1 +1)); if (!isContinue) // Only show proposal dungeon if it's continue @@ -623,7 +623,7 @@ void WorldSession::SendLfgUpdateProposal(uint32 proposalId, const LfgProposal* p void WorldSession::SendLfgUpdateSearch(bool update) { - sLog->outDebug("SMSG_LFG_UPDATE_SEARCH [" UI64FMTD "] update: %u", GetPlayer()->GetGUID(), update ? 1 : 0); + sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_LFG_UPDATE_SEARCH [" UI64FMTD "] update: %u", GetPlayer()->GetGUID(), update ? 1 : 0); WorldPacket data(SMSG_LFG_UPDATE_SEARCH, 1); data << uint8(update); // In Lfg Queue? SendPacket(&data); @@ -631,14 +631,14 @@ void WorldSession::SendLfgUpdateSearch(bool update) void WorldSession::SendLfgDisabled() { - sLog->outDebug("SMSG_LFG_DISABLED [" UI64FMTD "]", GetPlayer()->GetGUID()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_LFG_DISABLED [" UI64FMTD "]", GetPlayer()->GetGUID()); WorldPacket data(SMSG_LFG_DISABLED, 0); SendPacket(&data); } void WorldSession::SendLfgOfferContinue(uint32 dungeonEntry) { - sLog->outDebug("SMSG_LFG_OFFER_CONTINUE [" UI64FMTD "] dungeon entry: %u", GetPlayer()->GetGUID(), dungeonEntry); + sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_LFG_OFFER_CONTINUE [" UI64FMTD "] dungeon entry: %u", GetPlayer()->GetGUID(), dungeonEntry); WorldPacket data(SMSG_LFG_OFFER_CONTINUE, 4); data << uint32(dungeonEntry); SendPacket(&data); @@ -646,7 +646,7 @@ void WorldSession::SendLfgOfferContinue(uint32 dungeonEntry) void WorldSession::SendLfgTeleportError(uint8 err) { - sLog->outDebug("SMSG_LFG_TELEPORT_DENIED [" UI64FMTD "] reason: %u", GetPlayer()->GetGUID(), err); + sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_LFG_TELEPORT_DENIED [" UI64FMTD "] reason: %u", GetPlayer()->GetGUID(), err); WorldPacket data(SMSG_LFG_TELEPORT_DENIED, 4); data << uint32(err); // Error SendPacket(&data); @@ -655,7 +655,7 @@ void WorldSession::SendLfgTeleportError(uint8 err) /* void WorldSession::SendLfrUpdateListOpcode(uint32 dungeonEntry) { - sLog->outDebug("SMSG_UPDATE_LFG_LIST [" UI64FMTD "] dungeon entry: %u", GetPlayer()->GetGUID(), dungeonEntry); + sLog->outDebug(LOG_FILTER_PACKETIO, "SMSG_UPDATE_LFG_LIST [" UI64FMTD "] dungeon entry: %u", GetPlayer()->GetGUID(), dungeonEntry); WorldPacket data(SMSG_UPDATE_LFG_LIST); SendPacket(&data); } diff --git a/src/server/game/Server/Protocol/Handlers/LootHandler.cpp b/src/server/game/Server/Protocol/Handlers/LootHandler.cpp index 222d9bbe5254d..916ad8579e8e5 100755 --- a/src/server/game/Server/Protocol/Handlers/LootHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/LootHandler.cpp @@ -32,7 +32,7 @@ void WorldSession::HandleAutostoreLootItemOpcode(WorldPacket & recv_data) { - sLog->outDebug("WORLD: CMSG_AUTOSTORE_LOOT_ITEM"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_AUTOSTORE_LOOT_ITEM"); Player* player = GetPlayer(); uint64 lguid = player->GetLootGUID(); Loot* loot = NULL; @@ -96,7 +96,7 @@ void WorldSession::HandleAutostoreLootItemOpcode(WorldPacket & recv_data) void WorldSession::HandleLootMoneyOpcode(WorldPacket & /*recv_data*/) { - sLog->outDebug("WORLD: CMSG_LOOT_MONEY"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_LOOT_MONEY"); Player *player = GetPlayer(); uint64 guid = player->GetLootGUID(); @@ -187,7 +187,7 @@ void WorldSession::HandleLootMoneyOpcode(WorldPacket & /*recv_data*/) void WorldSession::HandleLootOpcode(WorldPacket & recv_data) { - sLog->outDebug("WORLD: CMSG_LOOT"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_LOOT"); uint64 guid; recv_data >> guid; @@ -205,7 +205,7 @@ void WorldSession::HandleLootOpcode(WorldPacket & recv_data) void WorldSession::HandleLootReleaseOpcode(WorldPacket & recv_data) { - sLog->outDebug("WORLD: CMSG_LOOT_RELEASE"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_LOOT_RELEASE"); // cheaters can modify lguid to prevent correct apply loot release code and re-loot // use internal stored guid @@ -426,7 +426,7 @@ void WorldSession::HandleLootMasterGiveOpcode(WorldPacket & recv_data) if (!target) return; - sLog->outDebug("WorldSession::HandleLootMasterGiveOpcode (CMSG_LOOT_MASTER_GIVE, 0x02A3) Target = [%s].", target->GetName()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WorldSession::HandleLootMasterGiveOpcode (CMSG_LOOT_MASTER_GIVE, 0x02A3) Target = [%s].", target->GetName()); if (_player->GetLootGUID() != lootguid) return; @@ -455,7 +455,7 @@ void WorldSession::HandleLootMasterGiveOpcode(WorldPacket & recv_data) if (slotid > pLoot->items.size()) { - sLog->outDebug("MasterLootItem: Player %s might be using a hack! (slot %d, size %lu)",GetPlayer()->GetName(), slotid, (unsigned long)pLoot->items.size()); + sLog->outDebug(LOG_FILTER_LOOT, "MasterLootItem: Player %s might be using a hack! (slot %d, size %lu)",GetPlayer()->GetName(), slotid, (unsigned long)pLoot->items.size()); return; } diff --git a/src/server/game/Server/Protocol/Handlers/MailHandler.cpp b/src/server/game/Server/Protocol/Handlers/MailHandler.cpp index 7d910b4b96c4d..89f574cf9bbf0 100755 --- a/src/server/game/Server/Protocol/Handlers/MailHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/MailHandler.cpp @@ -69,7 +69,8 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data) // packet read complete, now do check if (!GetPlayer()->GetGameObjectIfCanInteractWith(mailbox, GAMEOBJECT_TYPE_MAILBOX)) - return; + if (!GetPlayer()->GetNPCIfCanInteractWith(mailbox, UNIT_NPC_FLAG_MAILBOX)) + return; if (receiver.empty()) return; @@ -219,7 +220,7 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data) return; } - if (item->IsBag() && !((Bag*)item)->IsEmpty()) + if (item->IsNotEmptyBag()) { pl->SendMailResult(0, MAIL_SEND, MAIL_ERR_EQUIP_ERROR, EQUIP_ERR_CAN_ONLY_DO_WITH_EMPTY_BAGS); return; @@ -299,7 +300,8 @@ void WorldSession::HandleMailMarkAsRead(WorldPacket & recv_data) recv_data >> mailId; if (!GetPlayer()->GetGameObjectIfCanInteractWith(mailbox, GAMEOBJECT_TYPE_MAILBOX)) - return; + if (!GetPlayer()->GetNPCIfCanInteractWith(mailbox, UNIT_NPC_FLAG_MAILBOX)) + return; Player *pl = _player; Mail *m = pl->GetMail(mailId); @@ -323,7 +325,8 @@ void WorldSession::HandleMailDelete(WorldPacket & recv_data) recv_data.read_skip(); // mailTemplateId if (!GetPlayer()->GetGameObjectIfCanInteractWith(mailbox, GAMEOBJECT_TYPE_MAILBOX)) - return; + if (!GetPlayer()->GetNPCIfCanInteractWith(mailbox, UNIT_NPC_FLAG_MAILBOX)) + return; Mail *m = _player->GetMail(mailId); Player* pl = _player; @@ -351,7 +354,8 @@ void WorldSession::HandleMailReturnToSender(WorldPacket & recv_data) recv_data.read_skip(); // original sender GUID for return to, not used if (!GetPlayer()->GetGameObjectIfCanInteractWith(mailbox, GAMEOBJECT_TYPE_MAILBOX)) - return; + if (!GetPlayer()->GetNPCIfCanInteractWith(mailbox, UNIT_NPC_FLAG_MAILBOX)) + return; Player *pl = _player; Mail *m = pl->GetMail(mailId); @@ -408,7 +412,8 @@ void WorldSession::HandleMailTakeItem(WorldPacket & recv_data) recv_data >> itemId; // item guid low if (!GetPlayer()->GetGameObjectIfCanInteractWith(mailbox, GAMEOBJECT_TYPE_MAILBOX)) - return; + if (!GetPlayer()->GetNPCIfCanInteractWith(mailbox, UNIT_NPC_FLAG_MAILBOX)) + return; Player* pl = _player; @@ -501,7 +506,8 @@ void WorldSession::HandleMailTakeMoney(WorldPacket & recv_data) recv_data >> mailId; if (!GetPlayer()->GetGameObjectIfCanInteractWith(mailbox, GAMEOBJECT_TYPE_MAILBOX)) - return; + if (!GetPlayer()->GetNPCIfCanInteractWith(mailbox, UNIT_NPC_FLAG_MAILBOX)) + return; Player *pl = _player; @@ -533,7 +539,8 @@ void WorldSession::HandleGetMailList(WorldPacket & recv_data) recv_data >> mailbox; if (!GetPlayer()->GetGameObjectIfCanInteractWith(mailbox, GAMEOBJECT_TYPE_MAILBOX)) - return; + if (!GetPlayer()->GetNPCIfCanInteractWith(mailbox, UNIT_NPC_FLAG_MAILBOX)) + return; Player* pl = _player; @@ -658,7 +665,8 @@ void WorldSession::HandleMailCreateTextItem(WorldPacket & recv_data) recv_data >> mailId; if (!GetPlayer()->GetGameObjectIfCanInteractWith(mailbox, GAMEOBJECT_TYPE_MAILBOX)) - return; + if (!GetPlayer()->GetNPCIfCanInteractWith(mailbox, UNIT_NPC_FLAG_MAILBOX)) + return; Player *pl = _player; diff --git a/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp b/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp index 8b659d82c0279..e220eaae2bd36 100755 --- a/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp @@ -52,7 +52,7 @@ void WorldSession::HandleRepopRequestOpcode(WorldPacket & recv_data) { - sLog->outDebug("WORLD: Recvd CMSG_REPOP_REQUEST Message"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_REPOP_REQUEST Message"); recv_data.read_skip(); @@ -66,7 +66,7 @@ void WorldSession::HandleRepopRequestOpcode(WorldPacket & recv_data) // release spirit after he's killed but before he is updated if (GetPlayer()->getDeathState() == JUST_DIED) { - sLog->outDebug("HandleRepopRequestOpcode: got request after player %s(%d) was killed and before he was updated", GetPlayer()->GetName(), GetPlayer()->GetGUIDLow()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "HandleRepopRequestOpcode: got request after player %s(%d) was killed and before he was updated", GetPlayer()->GetName(), GetPlayer()->GetGUIDLow()); GetPlayer()->KillPlayer(); } @@ -78,7 +78,7 @@ void WorldSession::HandleRepopRequestOpcode(WorldPacket & recv_data) void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket & recv_data) { - sLog->outDebug("WORLD: CMSG_GOSSIP_SELECT_OPTION"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_GOSSIP_SELECT_OPTION"); uint32 gossipListId; uint32 menuId; @@ -88,12 +88,7 @@ void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket & recv_data) recv_data >> guid >> menuId >> gossipListId; if (_player->PlayerTalkClass->GossipOptionCoded(gossipListId)) - { - // recheck - sLog->outBasic("reading string"); recv_data >> code; - sLog->outBasic("string read: %s", code.c_str()); - } Creature *unit = NULL; GameObject *go = NULL; @@ -102,7 +97,7 @@ void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket & recv_data) unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_NONE); if (!unit) { - sLog->outDebug("WORLD: HandleGossipSelectOptionOpcode - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleGossipSelectOptionOpcode - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); return; } } @@ -111,13 +106,13 @@ void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket & recv_data) go = _player->GetMap()->GetGameObject(guid); if (!go) { - sLog->outDebug("WORLD: HandleGossipSelectOptionOpcode - GameObject (GUID: %u) not found.", uint32(GUID_LOPART(guid))); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleGossipSelectOptionOpcode - GameObject (GUID: %u) not found.", uint32(GUID_LOPART(guid))); return; } } else { - sLog->outDebug("WORLD: HandleGossipSelectOptionOpcode - unsupported GUID type for highguid %u. lowpart %u.", uint32(GUID_HIPART(guid)), uint32(GUID_LOPART(guid))); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleGossipSelectOptionOpcode - unsupported GUID type for highguid %u. lowpart %u.", uint32(GUID_HIPART(guid)), uint32(GUID_LOPART(guid))); return; } @@ -127,7 +122,7 @@ void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket & recv_data) if ((unit && unit->GetCreatureInfo()->ScriptID != unit->LastUsedScriptID) || (go && go->GetGOInfo()->ScriptId != go->LastUsedScriptID)) { - sLog->outDebug("WORLD: HandleGossipSelectOptionOpcode - Script reloaded while in use, ignoring and set new scipt id"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleGossipSelectOptionOpcode - Script reloaded while in use, ignoring and set new scipt id"); if (unit) unit->LastUsedScriptID = unit->GetCreatureInfo()->ScriptID; if (go) @@ -167,7 +162,7 @@ void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket & recv_data) void WorldSession::HandleWhoOpcode(WorldPacket & recv_data) { - sLog->outDebug("WORLD: Recvd CMSG_WHO Message"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_WHO Message"); //recv_data.hexlike(); uint32 matchcount = 0; @@ -194,7 +189,7 @@ void WorldSession::HandleWhoOpcode(WorldPacket & recv_data) uint32 temp; recv_data >> temp; // zone id, 0 if zone is unknown... zoneids[i] = temp; - sLog->outDebug("Zone %u: %u", i, zoneids[i]); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Zone %u: %u", i, zoneids[i]); } recv_data >> str_count; // user entered strings count, client limit=4 (checked on 2.0.10) @@ -202,7 +197,7 @@ void WorldSession::HandleWhoOpcode(WorldPacket & recv_data) if (str_count > 4) return; // can't be received from real client or broken packet - sLog->outDebug("Minlvl %u, maxlvl %u, name %s, guild %s, racemask %u, classmask %u, zones %u, strings %u", level_min, level_max, player_name.c_str(), guild_name.c_str(), racemask, classmask, zones_count, str_count); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Minlvl %u, maxlvl %u, name %s, guild %s, racemask %u, classmask %u, zones %u, strings %u", level_min, level_max, player_name.c_str(), guild_name.c_str(), racemask, classmask, zones_count, str_count); std::wstring str[4]; // 4 is client limit for (uint32 i = 0; i < str_count; ++i) @@ -215,7 +210,7 @@ void WorldSession::HandleWhoOpcode(WorldPacket & recv_data) wstrToLower(str[i]); - sLog->outDebug("String %u: %s", i, temp.c_str()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "String %u: %s", i, temp.c_str()); } std::wstring wplayer_name; @@ -355,12 +350,12 @@ void WorldSession::HandleWhoOpcode(WorldPacket & recv_data) data.put(4, matchcount); // insert right count, count of matches SendPacket(&data); - sLog->outDebug("WORLD: Send SMSG_WHO Message"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Send SMSG_WHO Message"); } void WorldSession::HandleLogoutRequestOpcode(WorldPacket & /*recv_data*/) { - sLog->outDebug("WORLD: Recvd CMSG_LOGOUT_REQUEST Message, security - %u", GetSecurity()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_LOGOUT_REQUEST Message, security - %u", GetSecurity()); if (uint64 lguid = GetPlayer()->GetLootGUID()) DoLootRelease(lguid); @@ -417,12 +412,12 @@ void WorldSession::HandleLogoutRequestOpcode(WorldPacket & /*recv_data*/) void WorldSession::HandlePlayerLogoutOpcode(WorldPacket & /*recv_data*/) { - sLog->outDebug("WORLD: Recvd CMSG_PLAYER_LOGOUT Message"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_PLAYER_LOGOUT Message"); } void WorldSession::HandleLogoutCancelOpcode(WorldPacket & /*recv_data*/) { - sLog->outDebug("WORLD: Recvd CMSG_LOGOUT_CANCEL Message"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_LOGOUT_CANCEL Message"); LogoutRequest(0); @@ -445,7 +440,7 @@ void WorldSession::HandleLogoutCancelOpcode(WorldPacket & /*recv_data*/) GetPlayer()->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED); } - sLog->outDebug("WORLD: sent SMSG_LOGOUT_CANCEL_ACK Message"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_LOGOUT_CANCEL_ACK Message"); } void WorldSession::HandleTogglePvP(WorldPacket & recv_data) @@ -527,7 +522,7 @@ void WorldSession::HandleSetSelectionOpcode(WorldPacket & recv_data) void WorldSession::HandleStandStateChangeOpcode(WorldPacket & recv_data) { - // sLog->outDebug("WORLD: Received CMSG_STANDSTATECHANGE"); -- too many spam in log at lags/debug stop + // sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: Received CMSG_STANDSTATECHANGE"); -- too many spam in log at lags/debug stop uint32 animstate; recv_data >> animstate; @@ -536,16 +531,16 @@ void WorldSession::HandleStandStateChangeOpcode(WorldPacket & recv_data) void WorldSession::HandleContactListOpcode(WorldPacket & recv_data) { - sLog->outDebug("WORLD: Received CMSG_CONTACT_LIST"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_CONTACT_LIST"); uint32 unk; recv_data >> unk; - sLog->outDebug("unk value is %u", unk); + sLog->outDebug(LOG_FILTER_NETWORKIO, "unk value is %u", unk); _player->GetSocial()->SendSocialList(_player); } void WorldSession::HandleAddFriendOpcode(WorldPacket & recv_data) { - sLog->outDebug("WORLD: Received CMSG_ADD_FRIEND"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_ADD_FRIEND"); std::string friendName = GetTrinityString(LANG_FRIEND_IGNORE_UNKNOWN); std::string friendNote; @@ -559,7 +554,7 @@ void WorldSession::HandleAddFriendOpcode(WorldPacket & recv_data) CharacterDatabase.escape_string(friendName); // prevent SQL injection - normal name don't must changed by this call - sLog->outDebug("WORLD: %s asked to add friend : '%s'", + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: %s asked to add friend : '%s'", GetPlayer()->GetName(), friendName.c_str()); m_addFriendCallback.SetParam(friendNote); @@ -607,7 +602,7 @@ void WorldSession::HandleAddFriendOpcodeCallBack(QueryResult result, std::string if (!GetPlayer()->GetSocial()->AddToSocialList(GUID_LOPART(friendGuid), false)) { friendResult = FRIEND_LIST_FULL; - sLog->outDebug("WORLD: %s's friend list is full.", GetPlayer()->GetName()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: %s's friend list is full.", GetPlayer()->GetName()); } } GetPlayer()->GetSocial()->SetFriendNote(GUID_LOPART(friendGuid), friendNote); @@ -617,14 +612,14 @@ void WorldSession::HandleAddFriendOpcodeCallBack(QueryResult result, std::string sSocialMgr->SendFriendStatus(GetPlayer(), friendResult, GUID_LOPART(friendGuid), false); - sLog->outDebug("WORLD: Sent (SMSG_FRIEND_STATUS)"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent (SMSG_FRIEND_STATUS)"); } void WorldSession::HandleDelFriendOpcode(WorldPacket & recv_data) { uint64 FriendGUID; - sLog->outDebug("WORLD: Received CMSG_DEL_FRIEND"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_DEL_FRIEND"); recv_data >> FriendGUID; @@ -632,12 +627,12 @@ void WorldSession::HandleDelFriendOpcode(WorldPacket & recv_data) sSocialMgr->SendFriendStatus(GetPlayer(), FRIEND_REMOVED, GUID_LOPART(FriendGUID), false); - sLog->outDebug("WORLD: Sent motd (SMSG_FRIEND_STATUS)"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent motd (SMSG_FRIEND_STATUS)"); } void WorldSession::HandleAddIgnoreOpcode(WorldPacket & recv_data) { - sLog->outDebug("WORLD: Received CMSG_ADD_IGNORE"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_ADD_IGNORE"); std::string IgnoreName = GetTrinityString(LANG_FRIEND_IGNORE_UNKNOWN); @@ -648,7 +643,7 @@ void WorldSession::HandleAddIgnoreOpcode(WorldPacket & recv_data) CharacterDatabase.escape_string(IgnoreName); // prevent SQL injection - normal name don't must changed by this call - sLog->outDebug("WORLD: %s asked to Ignore: '%s'", + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: %s asked to Ignore: '%s'", GetPlayer()->GetName(), IgnoreName.c_str()); m_addIgnoreCallback = CharacterDatabase.AsyncPQuery("SELECT guid FROM characters WHERE name = '%s'", IgnoreName.c_str()); @@ -688,14 +683,14 @@ void WorldSession::HandleAddIgnoreOpcodeCallBack(QueryResult result) sSocialMgr->SendFriendStatus(GetPlayer(), ignoreResult, GUID_LOPART(IgnoreGuid), false); - sLog->outDebug("WORLD: Sent (SMSG_FRIEND_STATUS)"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent (SMSG_FRIEND_STATUS)"); } void WorldSession::HandleDelIgnoreOpcode(WorldPacket & recv_data) { uint64 IgnoreGUID; - sLog->outDebug("WORLD: Received CMSG_DEL_IGNORE"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_DEL_IGNORE"); recv_data >> IgnoreGUID; @@ -703,12 +698,12 @@ void WorldSession::HandleDelIgnoreOpcode(WorldPacket & recv_data) sSocialMgr->SendFriendStatus(GetPlayer(), FRIEND_IGNORE_REMOVED, GUID_LOPART(IgnoreGUID), false); - sLog->outDebug("WORLD: Sent motd (SMSG_FRIEND_STATUS)"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent motd (SMSG_FRIEND_STATUS)"); } void WorldSession::HandleSetContactNotesOpcode(WorldPacket & recv_data) { - sLog->outDebug("CMSG_SET_CONTACT_NOTES"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_SET_CONTACT_NOTES"); uint64 guid; std::string note; recv_data >> guid >> note; @@ -725,12 +720,12 @@ void WorldSession::HandleBugOpcode(WorldPacket & recv_data) recv_data >> typelen >> type; if (suggestion == 0) - sLog->outDebug("WORLD: Received CMSG_BUG [Bug Report]"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_BUG [Bug Report]"); else - sLog->outDebug("WORLD: Received CMSG_BUG [Suggestion]"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_BUG [Suggestion]"); - sLog->outDebug("%s", type.c_str()); - sLog->outDebug("%s", content.c_str()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "%s", type.c_str()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "%s", content.c_str()); CharacterDatabase.escape_string(type); CharacterDatabase.escape_string(content); @@ -817,29 +812,29 @@ void WorldSession::SendAreaTriggerMessage(const char* Text, ...) void WorldSession::HandleAreaTriggerOpcode(WorldPacket & recv_data) { - sLog->outDebug("WORLD: Received CMSG_AREATRIGGER"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_AREATRIGGER"); uint32 Trigger_ID; recv_data >> Trigger_ID; - sLog->outDebug("Trigger ID:%u",Trigger_ID); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Trigger ID:%u",Trigger_ID); if (GetPlayer()->isInFlight()) { - sLog->outDebug("Player '%s' (GUID: %u) in flight, ignore Area Trigger ID:%u",GetPlayer()->GetName(),GetPlayer()->GetGUIDLow(), Trigger_ID); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Player '%s' (GUID: %u) in flight, ignore Area Trigger ID:%u",GetPlayer()->GetName(),GetPlayer()->GetGUIDLow(), Trigger_ID); return; } AreaTriggerEntry const* atEntry = sAreaTriggerStore.LookupEntry(Trigger_ID); if (!atEntry) { - sLog->outDebug("Player '%s' (GUID: %u) send unknown (by DBC) Area Trigger ID:%u",GetPlayer()->GetName(),GetPlayer()->GetGUIDLow(), Trigger_ID); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Player '%s' (GUID: %u) send unknown (by DBC) Area Trigger ID:%u",GetPlayer()->GetName(),GetPlayer()->GetGUIDLow(), Trigger_ID); return; } if (GetPlayer()->GetMapId() != atEntry->mapid) { - sLog->outDebug("Player '%s' (GUID: %u) too far (trigger map: %u player map: %u), ignore Area Trigger ID: %u", GetPlayer()->GetName(), atEntry->mapid, GetPlayer()->GetMapId(), GetPlayer()->GetGUIDLow(), Trigger_ID); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Player '%s' (GUID: %u) too far (trigger map: %u player map: %u), ignore Area Trigger ID: %u", GetPlayer()->GetName(), atEntry->mapid, GetPlayer()->GetMapId(), GetPlayer()->GetGUIDLow(), Trigger_ID); return; } @@ -854,7 +849,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket & recv_data) float dist = pl->GetDistance(atEntry->x,atEntry->y,atEntry->z); if (dist > atEntry->radius + delta) { - sLog->outDebug("Player '%s' (GUID: %u) too far (radius: %f distance: %f), ignore Area Trigger ID: %u", + sLog->outDebug(LOG_FILTER_NETWORKIO, "Player '%s' (GUID: %u) too far (radius: %f distance: %f), ignore Area Trigger ID: %u", pl->GetName(), pl->GetGUIDLow(), atEntry->radius, dist, Trigger_ID); return; } @@ -885,7 +880,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket & recv_data) (fabs(dy) > atEntry->box_y/2 + delta) || (fabs(dz) > atEntry->box_z/2 + delta)) { - sLog->outDebug("Player '%s' (GUID: %u) too far (1/2 box X: %f 1/2 box Y: %f 1/2 box Z: %f rotatedPlayerX: %f rotatedPlayerY: %f dZ:%f), ignore Area Trigger ID: %u", + sLog->outDebug(LOG_FILTER_NETWORKIO, "Player '%s' (GUID: %u) too far (1/2 box X: %f 1/2 box Y: %f 1/2 box Z: %f rotatedPlayerX: %f rotatedPlayerY: %f dZ:%f), ignore Area Trigger ID: %u", pl->GetName(), pl->GetGUIDLow(), atEntry->box_x/2, atEntry->box_y/2, atEntry->box_z/2, rotPlayerX, rotPlayerY, dz, Trigger_ID); return; } @@ -961,7 +956,7 @@ void WorldSession::HandleUpdateAccountData(WorldPacket &recv_data) uint32 type, timestamp, decompressedSize; recv_data >> type >> timestamp >> decompressedSize; - sLog->outDebug("UAD: type %u, time %u, decompressedSize %u", type, timestamp, decompressedSize); + sLog->outDebug(LOG_FILTER_NETWORKIO, "UAD: type %u, time %u, decompressedSize %u", type, timestamp, decompressedSize); if (type > NUM_ACCOUNT_DATA_TYPES) return; @@ -1016,7 +1011,7 @@ void WorldSession::HandleRequestAccountData(WorldPacket& recv_data) uint32 type; recv_data >> type; - sLog->outDebug("RAD: type %u", type); + sLog->outDebug(LOG_FILTER_NETWORKIO, "RAD: type %u", type); if (type > NUM_ACCOUNT_DATA_TYPES) return; @@ -1032,7 +1027,7 @@ void WorldSession::HandleRequestAccountData(WorldPacket& recv_data) if (size && compress(const_cast(dest.contents()), &destSize, (uint8*)adata->Data.c_str(), size) != Z_OK) { - sLog->outDebug("RAD: Failed to compress account data"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "RAD: Failed to compress account data"); return; } @@ -1049,7 +1044,7 @@ void WorldSession::HandleRequestAccountData(WorldPacket& recv_data) void WorldSession::HandleSetActionButtonOpcode(WorldPacket& recv_data) { - sLog->outDebug("WORLD: Received CMSG_SET_ACTION_BUTTON"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_SET_ACTION_BUTTON"); uint8 button; uint32 packetData; recv_data >> button >> packetData; @@ -1111,7 +1106,7 @@ void WorldSession::HandleMoveTimeSkippedOpcode(WorldPacket & recv_data) uint32 time_skipped; recv_data >> guid; recv_data >> time_skipped; - sLog->outDebug("WORLD: CMSG_MOVE_TIME_SKIPPED"); + sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: CMSG_MOVE_TIME_SKIPPED"); /// TODO must be need use in Trinity @@ -1144,7 +1139,7 @@ void WorldSession::HandleMoveUnRootAck(WorldPacket& recv_data) return; } - sLog->outDebug("WORLD: CMSG_FORCE_MOVE_UNROOT_ACK"); + sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: CMSG_FORCE_MOVE_UNROOT_ACK"); recv_data.read_skip(); // unk @@ -1170,7 +1165,7 @@ void WorldSession::HandleMoveRootAck(WorldPacket& recv_data) return; } - sLog->outDebug("WORLD: CMSG_FORCE_MOVE_ROOT_ACK"); + sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: CMSG_FORCE_MOVE_ROOT_ACK"); recv_data.read_skip(); // unk @@ -1295,7 +1290,7 @@ void WorldSession::HandleWorldTeleportOpcode(WorldPacket& recv_data) //sLog->outDebug("Received opcode CMSG_WORLD_TELEPORT"); if (GetPlayer()->isInFlight()) { - sLog->outDebug("Player '%s' (GUID: %u) in flight, ignore worldport command.",GetPlayer()->GetName(),GetPlayer()->GetGUIDLow()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Player '%s' (GUID: %u) in flight, ignore worldport command.",GetPlayer()->GetName(),GetPlayer()->GetGUIDLow()); return; } @@ -1305,12 +1300,12 @@ void WorldSession::HandleWorldTeleportOpcode(WorldPacket& recv_data) GetPlayer()->TeleportTo(mapid,PositionX,PositionY,PositionZ,Orientation); else SendNotification(LANG_YOU_NOT_HAVE_PERMISSION); - sLog->outDebug("Received worldport command from player %s", GetPlayer()->GetName()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Received worldport command from player %s", GetPlayer()->GetName()); } void WorldSession::HandleWhoisOpcode(WorldPacket& recv_data) { - sLog->outDebug("Received opcode CMSG_WHOIS"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode CMSG_WHOIS"); std::string charname; recv_data >> charname; @@ -1360,12 +1355,12 @@ void WorldSession::HandleWhoisOpcode(WorldPacket& recv_data) data << msg; _player->GetSession()->SendPacket(&data); - sLog->outDebug("Received whois command from player %s for character %s", GetPlayer()->GetName(), charname.c_str()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Received whois command from player %s for character %s", GetPlayer()->GetName(), charname.c_str()); } void WorldSession::HandleComplainOpcode(WorldPacket & recv_data) { - sLog->outDebug("WORLD: CMSG_COMPLAIN"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_COMPLAIN"); recv_data.hexlike(); uint8 spam_type; // 0 - mail, 1 - chat @@ -1401,12 +1396,12 @@ void WorldSession::HandleComplainOpcode(WorldPacket & recv_data) data << uint8(0); SendPacket(&data); - sLog->outDebug("REPORT SPAM: type %u, guid %u, unk1 %u, unk2 %u, unk3 %u, unk4 %u, message %s", spam_type, GUID_LOPART(spammer_guid), unk1, unk2, unk3, unk4, description.c_str()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "REPORT SPAM: type %u, guid %u, unk1 %u, unk2 %u, unk3 %u, unk4 %u, message %s", spam_type, GUID_LOPART(spammer_guid), unk1, unk2, unk3, unk4, description.c_str()); } void WorldSession::HandleRealmSplitOpcode(WorldPacket & recv_data) { - sLog->outDebug("CMSG_REALM_SPLIT"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_REALM_SPLIT"); uint32 unk; std::string split_date = "01/01/01"; @@ -1426,7 +1421,7 @@ void WorldSession::HandleRealmSplitOpcode(WorldPacket & recv_data) void WorldSession::HandleFarSightOpcode(WorldPacket & recv_data) { - sLog->outDebug("WORLD: CMSG_FAR_SIGHT"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_FAR_SIGHT"); //recv_data.hexlike(); uint8 apply; @@ -1435,18 +1430,18 @@ void WorldSession::HandleFarSightOpcode(WorldPacket & recv_data) switch(apply) { case 0: - sLog->outDebug("Player %u set vision to self", _player->GetGUIDLow()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Player %u set vision to self", _player->GetGUIDLow()); _player->SetSeer(_player); break; case 1: - sLog->outDebug("Added FarSight " UI64FMTD " to player %u", _player->GetUInt64Value(PLAYER_FARSIGHT), _player->GetGUIDLow()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Added FarSight " UI64FMTD " to player %u", _player->GetUInt64Value(PLAYER_FARSIGHT), _player->GetGUIDLow()); if (WorldObject *target = _player->GetViewpoint()) _player->SetSeer(target); else sLog->outError("Player %s requests non-existing seer", _player->GetName()); break; default: - sLog->outDebug("Unhandled mode in CMSG_FAR_SIGHT: %u", apply); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Unhandled mode in CMSG_FAR_SIGHT: %u", apply); return; } @@ -1455,7 +1450,7 @@ void WorldSession::HandleFarSightOpcode(WorldPacket & recv_data) void WorldSession::HandleSetTitleOpcode(WorldPacket & recv_data) { - sLog->outDebug("CMSG_SET_TITLE"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_SET_TITLE"); int32 title; recv_data >> title; @@ -1474,27 +1469,27 @@ void WorldSession::HandleSetTitleOpcode(WorldPacket & recv_data) void WorldSession::HandleTimeSyncResp(WorldPacket & recv_data) { - sLog->outDebug("CMSG_TIME_SYNC_RESP"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_TIME_SYNC_RESP"); uint32 counter, clientTicks; recv_data >> counter >> clientTicks; if (counter != _player->m_timeSyncCounter - 1) - sLog->outDebug("Wrong time sync counter from player %s (cheater?)", _player->GetName()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Wrong time sync counter from player %s (cheater?)", _player->GetName()); - sLog->outDebug("Time sync received: counter %u, client ticks %u, time since last sync %u", counter, clientTicks, clientTicks - _player->m_timeSyncClient); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Time sync received: counter %u, client ticks %u, time since last sync %u", counter, clientTicks, clientTicks - _player->m_timeSyncClient); uint32 ourTicks = clientTicks + (getMSTime() - _player->m_timeSyncServer); // diff should be small - sLog->outDebug("Our ticks: %u, diff %u, latency %u", ourTicks, ourTicks - clientTicks, GetLatency()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Our ticks: %u, diff %u, latency %u", ourTicks, ourTicks - clientTicks, GetLatency()); _player->m_timeSyncClient = clientTicks; } void WorldSession::HandleResetInstancesOpcode(WorldPacket & /*recv_data*/) { - sLog->outDebug("WORLD: CMSG_RESET_INSTANCES"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_RESET_INSTANCES"); Group *pGroup = _player->GetGroup(); if (pGroup) { @@ -1513,7 +1508,7 @@ void WorldSession::HandleResetInstancesOpcode(WorldPacket & /*recv_data*/) void WorldSession::HandleSetDungeonDifficultyOpcode(WorldPacket & recv_data) { - sLog->outDebug("MSG_SET_DUNGEON_DIFFICULTY"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "MSG_SET_DUNGEON_DIFFICULTY"); uint32 mode; recv_data >> mode; @@ -1574,7 +1569,7 @@ void WorldSession::HandleSetDungeonDifficultyOpcode(WorldPacket & recv_data) void WorldSession::HandleSetRaidDifficultyOpcode(WorldPacket & recv_data) { - sLog->outDebug("MSG_SET_RAID_DIFFICULTY"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "MSG_SET_RAID_DIFFICULTY"); uint32 mode; recv_data >> mode; @@ -1635,7 +1630,7 @@ void WorldSession::HandleSetRaidDifficultyOpcode(WorldPacket & recv_data) void WorldSession::HandleCancelMountAuraOpcode(WorldPacket & /*recv_data*/) { - sLog->outDebug("WORLD: CMSG_CANCEL_MOUNT_AURA"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CANCEL_MOUNT_AURA"); //If player is not mounted, so go out :) if (!_player->IsMounted()) // not blizz like; no any messages on blizz @@ -1657,13 +1652,12 @@ void WorldSession::HandleCancelMountAuraOpcode(WorldPacket & /*recv_data*/) void WorldSession::HandleMoveSetCanFlyAckOpcode(WorldPacket & recv_data) { // fly mode on/off - sLog->outDebug("WORLD: CMSG_MOVE_SET_CAN_FLY_ACK"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_MOVE_SET_CAN_FLY_ACK"); //recv_data.hexlike(); uint64 guid; // guid - unused recv_data.readPackGUID(guid); - recv_data.read_skip(); // unk MovementInfo movementInfo; @@ -1678,7 +1672,7 @@ void WorldSession::HandleMoveSetCanFlyAckOpcode(WorldPacket & recv_data) void WorldSession::HandleRequestPetInfoOpcode(WorldPacket & /*recv_data */) { /* - sLog->outDebug("WORLD: CMSG_REQUEST_PET_INFO"); + sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: CMSG_REQUEST_PET_INFO"); recv_data.hexlike(); */ } @@ -1688,7 +1682,7 @@ void WorldSession::HandleSetTaxiBenchmarkOpcode(WorldPacket & recv_data) uint8 mode; recv_data >> mode; - sLog->outDebug("Client used \"/timetest %d\" command", mode); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Client used \"/timetest %d\" command", mode); } void WorldSession::HandleQueryInspectAchievements(WorldPacket & recv_data) @@ -1706,7 +1700,7 @@ void WorldSession::HandleQueryInspectAchievements(WorldPacket & recv_data) void WorldSession::HandleWorldStateUITimerUpdate(WorldPacket& /*recv_data*/) { // empty opcode - sLog->outDebug("WORLD: CMSG_WORLD_STATE_UI_TIMER_UPDATE"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_WORLD_STATE_UI_TIMER_UPDATE"); WorldPacket data(SMSG_WORLD_STATE_UI_TIMER_UPDATE, 4); data << uint32(time(NULL)); @@ -1716,7 +1710,7 @@ void WorldSession::HandleWorldStateUITimerUpdate(WorldPacket& /*recv_data*/) void WorldSession::HandleReadyForAccountDataTimes(WorldPacket& /*recv_data*/) { // empty opcode - sLog->outDebug("WORLD: CMSG_READY_FOR_ACCOUNT_DATA_TIMES"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_READY_FOR_ACCOUNT_DATA_TIMES"); SendAccountDataTimes(GLOBAL_CACHE_MASK); } diff --git a/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp b/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp index 52f57fa10a839..bb215f1c8d702 100755 --- a/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp @@ -24,7 +24,6 @@ #include "Log.h" #include "Corpse.h" #include "Player.h" -#include "Vehicle.h" #include "SpellAuras.h" #include "MapManager.h" #include "Transport.h" @@ -35,7 +34,7 @@ void WorldSession::HandleMoveWorldportAckOpcode(WorldPacket & /*recv_data*/) { - sLog->outDebug("WORLD: got MSG_MOVE_WORLDPORT_ACK."); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: got MSG_MOVE_WORLDPORT_ACK."); HandleMoveWorldportAckOpcode(); } @@ -192,7 +191,7 @@ void WorldSession::HandleMoveWorldportAckOpcode() void WorldSession::HandleMoveTeleportAck(WorldPacket& recv_data) { - sLog->outDebug("MSG_MOVE_TELEPORT_ACK"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "MSG_MOVE_TELEPORT_ACK"); uint64 guid; recv_data.readPackGUID(guid); @@ -399,7 +398,7 @@ void WorldSession::HandleMovementOpcodes(WorldPacket & recv_data) void WorldSession::HandleForceSpeedChangeAck(WorldPacket &recv_data) { uint32 opcode = recv_data.GetOpcode(); - sLog->outDebug("WORLD: Recvd %s (%u, 0x%X) opcode", LookupOpcodeName(opcode), opcode, opcode); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd %s (%u, 0x%X) opcode", LookupOpcodeName(opcode), opcode, opcode); /* extract packet */ uint64 guid; @@ -477,7 +476,7 @@ void WorldSession::HandleForceSpeedChangeAck(WorldPacket &recv_data) void WorldSession::HandleSetActiveMoverOpcode(WorldPacket &recv_data) { - sLog->outDebug("WORLD: Recvd CMSG_SET_ACTIVE_MOVER"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_SET_ACTIVE_MOVER"); uint64 guid; recv_data >> guid; @@ -505,7 +504,7 @@ void WorldSession::HandleSetActiveMoverOpcode(WorldPacket &recv_data) void WorldSession::HandleMoveNotActiveMover(WorldPacket &recv_data) { - sLog->outDebug("WORLD: Recvd CMSG_MOVE_NOT_ACTIVE_MOVER"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_MOVE_NOT_ACTIVE_MOVER"); uint64 old_mover_guid; recv_data.readPackGUID(old_mover_guid); @@ -517,206 +516,6 @@ void WorldSession::HandleMoveNotActiveMover(WorldPacket &recv_data) _player->m_movementInfo = mi; } -void WorldSession::HandleDismissControlledVehicle(WorldPacket &recv_data) -{ - sLog->outDebug("WORLD: Recvd CMSG_DISMISS_CONTROLLED_VEHICLE"); - recv_data.hexlike(); - - uint64 vehicleGUID = _player->GetCharmGUID(); - - if (!vehicleGUID) // something wrong here... - { - recv_data.rpos(recv_data.wpos()); // prevent warnings spam - return; - } - - uint64 guid; - - recv_data.readPackGUID(guid); - - MovementInfo mi; - mi.guid = guid; - ReadMovementInfo(recv_data, &mi); - - _player->m_movementInfo = mi; - - _player->ExitVehicle(); -} - -void WorldSession::HandleChangeSeatsOnControlledVehicle(WorldPacket &recv_data) -{ - sLog->outDebug("WORLD: Recvd CMSG_CHANGE_SEATS_ON_CONTROLLED_VEHICLE"); - recv_data.hexlike(); - - Unit* vehicle_base = GetPlayer()->GetVehicleBase(); - if (!vehicle_base) - return; - - VehicleSeatEntry const* seat = GetPlayer()->GetVehicle()->GetSeatForPassenger(GetPlayer()); - if (!seat->CanSwitchFromSeat()) - { - sLog->outError("HandleChangeSeatsOnControlledVehicle, Opcode: %u, Player %u tried to switch seats but current seatflags %u don't permit that.", - recv_data.GetOpcode(), GetPlayer()->GetGUIDLow(), seat->m_flags); - return; - } - - switch (recv_data.GetOpcode()) - { - case CMSG_REQUEST_VEHICLE_PREV_SEAT: - GetPlayer()->ChangeSeat(-1, false); - break; - case CMSG_REQUEST_VEHICLE_NEXT_SEAT: - GetPlayer()->ChangeSeat(-1, true); - break; - case CMSG_CHANGE_SEATS_ON_CONTROLLED_VEHICLE: - { - uint64 guid; // current vehicle guid - recv_data.readPackGUID(guid); - - ReadMovementInfo(recv_data, &vehicle_base->m_movementInfo); - - uint64 accessory; // accessory guid - recv_data.readPackGUID(accessory); - - int8 seatId; - recv_data >> seatId; - - if (vehicle_base->GetGUID() != guid) - return; - - if (!accessory) - GetPlayer()->ChangeSeat(-1, seatId > 0); // prev/next - else if (Unit *vehUnit = Unit::GetUnit(*GetPlayer(), accessory)) - { - if (Vehicle *vehicle = vehUnit->GetVehicleKit()) - if (vehicle->HasEmptySeat(seatId)) - GetPlayer()->EnterVehicle(vehicle, seatId); - } - } - break; - case CMSG_REQUEST_VEHICLE_SWITCH_SEAT: - { - uint64 guid; // current vehicle guid - recv_data.readPackGUID(guid); - - int8 seatId; - recv_data >> seatId; - - if (vehicle_base->GetGUID() == guid) - GetPlayer()->ChangeSeat(seatId); - else if (Unit *vehUnit = Unit::GetUnit(*GetPlayer(), guid)) - if (Vehicle *vehicle = vehUnit->GetVehicleKit()) - if (vehicle->HasEmptySeat(seatId)) - GetPlayer()->EnterVehicle(vehicle, seatId); - } - break; - default: - break; - } -} - -void WorldSession::HandleEnterPlayerVehicle(WorldPacket &data) -{ - // Read guid - uint64 guid; - data >> guid; - - if (Player* pl=ObjectAccessor::FindPlayer(guid)) - { - if (!pl->GetVehicleKit()) - return; - if (!pl->IsInRaidWith(_player)) - return; - if (!pl->IsWithinDistInMap(_player,INTERACTION_DISTANCE)) - return; - _player->EnterVehicle(pl); - } -} - -void WorldSession::HandleEjectPassenger(WorldPacket &data) -{ - Vehicle* vehicle = _player->GetVehicleKit(); - if (!vehicle) - { - sLog->outError("HandleEjectPassenger: Player %u is not in a vehicle!", GetPlayer()->GetGUIDLow()); - return; - } - - uint64 guid; - data >> guid; - - if (IS_PLAYER_GUID(guid)) - { - Player *plr = ObjectAccessor::FindPlayer(guid); - if (!plr) - { - sLog->outError("Player %u tried to eject player %u from vehicle, but the latter was not found in world!", GetPlayer()->GetGUIDLow(), GUID_LOPART(guid)); - return; - } - - if (!plr->IsOnVehicle(vehicle->GetBase())) - { - sLog->outError("Player %u tried to eject player %u, but they are not in the same vehicle", GetPlayer()->GetGUIDLow(), GUID_LOPART(guid)); - return; - } - - VehicleSeatEntry const* seat = vehicle->GetSeatForPassenger(plr); - ASSERT(seat); - if (seat->IsEjectable()) - plr->ExitVehicle(); - else - sLog->outError("Player %u attempted to eject player %u from non-ejectable seat.", GetPlayer()->GetGUIDLow(), GUID_LOPART(guid)); - } - - else if (IS_CREATURE_GUID(guid)) - { - Unit *unit = ObjectAccessor::GetUnit(*_player, guid); - if (!unit) // creatures can be ejected too from player mounts - { - sLog->outError("Player %u tried to eject creature guid %u from vehicle, but the latter was not found in world!", GetPlayer()->GetGUIDLow(), GUID_LOPART(guid)); - return; - } - - if (!unit->IsOnVehicle(vehicle->GetBase())) - { - sLog->outError("Player %u tried to eject unit %u, but they are not in the same vehicle", GetPlayer()->GetGUIDLow(), GUID_LOPART(guid)); - return; - } - - VehicleSeatEntry const* seat = vehicle->GetSeatForPassenger(unit); - ASSERT(seat); - if (seat->IsEjectable()) - { - ASSERT(GetPlayer() == vehicle->GetBase()); - unit->ExitVehicle(); - unit->ToCreature()->DespawnOrUnsummon(1000); - ASSERT(!unit->IsOnVehicle(vehicle->GetBase())); - } - else - sLog->outError("Player %u attempted to eject creature GUID %u from non-ejectable seat.", GetPlayer()->GetGUIDLow(), GUID_LOPART(guid)); - } - else - sLog->outError("HandleEjectPassenger: Player %u tried to eject invalid GUID "UI64FMTD, GetPlayer()->GetGUIDLow(), guid); -} - -void WorldSession::HandleRequestVehicleExit(WorldPacket &recv_data) -{ - sLog->outDebug("WORLD: Recvd CMSG_REQUEST_VEHICLE_EXIT"); - recv_data.hexlike(); - - if (Vehicle* vehicle = GetPlayer()->GetVehicle()) - { - if (VehicleSeatEntry const* seat = vehicle->GetSeatForPassenger(GetPlayer())) - { - if (seat->CanEnterOrExit()) - GetPlayer()->ExitVehicle(); - else - sLog->outError("Player %u tried to exit vehicle, but seatflags %u (ID: %u) don't permit that.", - GetPlayer()->GetGUIDLow(), seat->m_ID, seat->m_flags); - } - } -} - void WorldSession::HandleMountSpecialAnimOpcode(WorldPacket& /*recv_data*/) { WorldPacket data(SMSG_MOUNTSPECIAL_ANIM, 8); @@ -727,7 +526,7 @@ void WorldSession::HandleMountSpecialAnimOpcode(WorldPacket& /*recv_data*/) void WorldSession::HandleMoveKnockBackAck(WorldPacket & recv_data) { - sLog->outDebug("CMSG_MOVE_KNOCK_BACK_ACK"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_MOVE_KNOCK_BACK_ACK"); uint64 guid; // guid - unused recv_data.readPackGUID(guid); @@ -740,7 +539,7 @@ void WorldSession::HandleMoveKnockBackAck(WorldPacket & recv_data) void WorldSession::HandleMoveHoverAck(WorldPacket& recv_data) { - sLog->outDebug("CMSG_MOVE_HOVER_ACK"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_MOVE_HOVER_ACK"); uint64 guid; // guid - unused recv_data.readPackGUID(guid); @@ -755,7 +554,7 @@ void WorldSession::HandleMoveHoverAck(WorldPacket& recv_data) void WorldSession::HandleMoveWaterWalkAck(WorldPacket& recv_data) { - sLog->outDebug("CMSG_MOVE_WATER_WALK_ACK"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_MOVE_WATER_WALK_ACK"); uint64 guid; // guid - unused recv_data.readPackGUID(guid); diff --git a/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp b/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp index 48fa099eb8141..eda793d2a9467 100755 --- a/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp @@ -54,7 +54,7 @@ void WorldSession::HandleTabardVendorActivateOpcode(WorldPacket & recv_data) Creature *unit = GetPlayer()->GetNPCIfCanInteractWith(guid,UNIT_NPC_FLAG_TABARDDESIGNER); if (!unit) { - sLog->outDebug("WORLD: HandleTabardVendorActivateOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(guid))); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleTabardVendorActivateOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(guid))); return; } @@ -76,14 +76,14 @@ void WorldSession::HandleBankerActivateOpcode(WorldPacket & recv_data) { uint64 guid; - sLog->outDebug("WORLD: Received CMSG_BANKER_ACTIVATE"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_BANKER_ACTIVATE"); recv_data >> guid; Creature *unit = GetPlayer()->GetNPCIfCanInteractWith(guid,UNIT_NPC_FLAG_BANKER); if (!unit) { - sLog->outDebug("WORLD: HandleBankerActivateOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(guid))); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleBankerActivateOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(guid))); return; } @@ -117,12 +117,12 @@ void WorldSession::SendTrainerList(uint64 guid) void WorldSession::SendTrainerList(uint64 guid, const std::string& strTitle) { - sLog->outDebug("WORLD: SendTrainerList"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: SendTrainerList"); Creature *unit = GetPlayer()->GetNPCIfCanInteractWith(guid,UNIT_NPC_FLAG_TRAINER); if (!unit) { - sLog->outDebug("WORLD: SendTrainerList - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(guid))); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: SendTrainerList - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(guid))); return; } @@ -138,14 +138,14 @@ void WorldSession::SendTrainerList(uint64 guid, const std::string& strTitle) if (!ci) { - sLog->outDebug("WORLD: SendTrainerList - (GUID: %u) NO CREATUREINFO!",GUID_LOPART(guid)); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: SendTrainerList - (GUID: %u) NO CREATUREINFO!",GUID_LOPART(guid)); return; } TrainerSpellData const* trainer_spells = unit->GetTrainerSpells(); if (!trainer_spells) { - sLog->outDebug("WORLD: SendTrainerList - Training spells not found for creature (GUID: %u Entry: %u)", + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: SendTrainerList - Training spells not found for creature (GUID: %u Entry: %u)", GUID_LOPART(guid), unit->GetEntry()); return; } @@ -241,12 +241,12 @@ void WorldSession::HandleTrainerBuySpellOpcode(WorldPacket & recv_data) uint32 spellId = 0; recv_data >> guid >> spellId; - sLog->outDebug("WORLD: Received CMSG_TRAINER_BUY_SPELL NpcGUID=%u, learn spell id is: %u",uint32(GUID_LOPART(guid)), spellId); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_TRAINER_BUY_SPELL NpcGUID=%u, learn spell id is: %u",uint32(GUID_LOPART(guid)), spellId); Creature *unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_TRAINER); if (!unit) { - sLog->outDebug("WORLD: HandleTrainerBuySpellOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(guid))); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleTrainerBuySpellOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(guid))); return; } @@ -304,7 +304,7 @@ void WorldSession::HandleTrainerBuySpellOpcode(WorldPacket & recv_data) void WorldSession::HandleGossipHelloOpcode(WorldPacket & recv_data) { - sLog->outDebug("WORLD: Received CMSG_GOSSIP_HELLO"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GOSSIP_HELLO"); uint64 guid; recv_data >> guid; @@ -312,7 +312,7 @@ void WorldSession::HandleGossipHelloOpcode(WorldPacket & recv_data) Creature *unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_NONE); if (!unit) { - sLog->outDebug("WORLD: HandleGossipHelloOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(guid))); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleGossipHelloOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(guid))); return; } @@ -349,7 +349,7 @@ void WorldSession::HandleGossipHelloOpcode(WorldPacket & recv_data) /*void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket & recv_data) { - sLog->outDebug("WORLD: CMSG_GOSSIP_SELECT_OPTION"); + sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: CMSG_GOSSIP_SELECT_OPTION"); uint32 option; uint32 unk; @@ -360,15 +360,15 @@ void WorldSession::HandleGossipHelloOpcode(WorldPacket & recv_data) if (_player->PlayerTalkClass->GossipOptionCoded(option)) { - sLog->outDebug("reading string"); + sLog->outDebug(LOG_FILTER_PACKETIO, "reading string"); recv_data >> code; - sLog->outDebug("string read: %s", code.c_str()); + sLog->outDebug(LOG_FILTER_PACKETIO, "string read: %s", code.c_str()); } Creature *unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_NONE); if (!unit) { - sLog->outDebug("WORLD: HandleGossipSelectOptionOpcode - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); + sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: HandleGossipSelectOptionOpcode - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); return; } @@ -390,7 +390,7 @@ void WorldSession::HandleGossipHelloOpcode(WorldPacket & recv_data) void WorldSession::HandleSpiritHealerActivateOpcode(WorldPacket & recv_data) { - sLog->outDebug("WORLD: CMSG_SPIRIT_HEALER_ACTIVATE"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_SPIRIT_HEALER_ACTIVATE"); uint64 guid; @@ -399,7 +399,7 @@ void WorldSession::HandleSpiritHealerActivateOpcode(WorldPacket & recv_data) Creature *unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_SPIRITHEALER); if (!unit) { - sLog->outDebug("WORLD: HandleSpiritHealerActivateOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(guid))); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleSpiritHealerActivateOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(guid))); return; } @@ -454,7 +454,7 @@ void WorldSession::HandleBinderActivateOpcode(WorldPacket & recv_data) Creature *unit = GetPlayer()->GetNPCIfCanInteractWith(npcGUID,UNIT_NPC_FLAG_INNKEEPER); if (!unit) { - sLog->outDebug("WORLD: HandleBinderActivateOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(npcGUID))); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleBinderActivateOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(npcGUID))); return; } @@ -495,7 +495,7 @@ void WorldSession::SendBindPoint(Creature *npc) void WorldSession::HandleListStabledPetsOpcode(WorldPacket & recv_data) { - sLog->outDebug("WORLD: Recv MSG_LIST_STABLED_PETS"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recv MSG_LIST_STABLED_PETS"); uint64 npcGUID; recv_data >> npcGUID; @@ -528,7 +528,7 @@ void WorldSession::SendStablePetCallback(QueryResult result, uint64 guid) if (!GetPlayer()) return; - sLog->outDebug("WORLD: Recv MSG_LIST_STABLED_PETS Send."); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recv MSG_LIST_STABLED_PETS Send."); WorldPacket data(MSG_LIST_STABLED_PETS, 200); // guess size @@ -585,7 +585,7 @@ void WorldSession::SendStableResult(uint8 res) void WorldSession::HandleStablePet(WorldPacket & recv_data) { - sLog->outDebug("WORLD: Recv CMSG_STABLE_PET"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recv CMSG_STABLE_PET"); uint64 npcGUID; recv_data >> npcGUID; @@ -656,7 +656,7 @@ void WorldSession::HandleStablePetCallback(QueryResult result) void WorldSession::HandleUnstablePet(WorldPacket & recv_data) { - sLog->outDebug("WORLD: Recv CMSG_UNSTABLE_PET."); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recv CMSG_UNSTABLE_PET."); uint64 npcGUID; uint32 petnumber; @@ -733,7 +733,7 @@ void WorldSession::HandleUnstablePetCallback(QueryResult result, uint32 petnumbe void WorldSession::HandleBuyStableSlot(WorldPacket & recv_data) { - sLog->outDebug("WORLD: Recv CMSG_BUY_STABLE_SLOT."); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recv CMSG_BUY_STABLE_SLOT."); uint64 npcGUID; recv_data >> npcGUID; @@ -766,12 +766,12 @@ void WorldSession::HandleBuyStableSlot(WorldPacket & recv_data) void WorldSession::HandleStableRevivePet(WorldPacket &/* recv_data */) { - sLog->outDebug("HandleStableRevivePet: Not implemented"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "HandleStableRevivePet: Not implemented"); } void WorldSession::HandleStableSwapPet(WorldPacket & recv_data) { - sLog->outDebug("WORLD: Recv CMSG_STABLE_SWAP_PET."); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recv CMSG_STABLE_SWAP_PET."); uint64 npcGUID; uint32 pet_number; @@ -854,7 +854,7 @@ void WorldSession::HandleStableSwapPetCallback(QueryResult result, uint32 petnum void WorldSession::HandleRepairItemOpcode(WorldPacket & recv_data) { - sLog->outDebug("WORLD: CMSG_REPAIR_ITEM"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_REPAIR_ITEM"); uint64 npcGUID, itemGUID; uint8 guildBank; // new in 2.3.2, bool that means from guild bank money @@ -864,7 +864,7 @@ void WorldSession::HandleRepairItemOpcode(WorldPacket & recv_data) Creature *unit = GetPlayer()->GetNPCIfCanInteractWith(npcGUID, UNIT_NPC_FLAG_REPAIR); if (!unit) { - sLog->outDebug("WORLD: HandleRepairItemOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(npcGUID))); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleRepairItemOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(npcGUID))); return; } @@ -878,7 +878,7 @@ void WorldSession::HandleRepairItemOpcode(WorldPacket & recv_data) uint32 TotalCost = 0; if (itemGUID) { - sLog->outDebug("ITEM: Repair item, itemGUID = %u, npcGUID = %u", GUID_LOPART(itemGUID), GUID_LOPART(npcGUID)); + sLog->outDebug(LOG_FILTER_NETWORKIO, "ITEM: Repair item, itemGUID = %u, npcGUID = %u", GUID_LOPART(itemGUID), GUID_LOPART(npcGUID)); Item* item = _player->GetItemByGuid(itemGUID); if (item) @@ -886,7 +886,7 @@ void WorldSession::HandleRepairItemOpcode(WorldPacket & recv_data) } else { - sLog->outDebug("ITEM: Repair all items, npcGUID = %u", GUID_LOPART(npcGUID)); + sLog->outDebug(LOG_FILTER_NETWORKIO, "ITEM: Repair all items, npcGUID = %u", GUID_LOPART(npcGUID)); TotalCost = _player->DurabilityRepairAll(true, discountMod, guildBank); } } diff --git a/src/server/game/Server/Protocol/Handlers/PetHandler.cpp b/src/server/game/Server/Protocol/Handlers/PetHandler.cpp index 9833e6830680f..1d34bc6d2e7e8 100755 --- a/src/server/game/Server/Protocol/Handlers/PetHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/PetHandler.cpp @@ -36,13 +36,13 @@ void WorldSession::HandleDismissCritter(WorldPacket &recv_data) uint64 guid; recv_data >> guid; - sLog->outDebug("WORLD: Received CMSG_DISMISS_CRITTER for GUID " UI64FMTD, guid); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_DISMISS_CRITTER for GUID " UI64FMTD, guid); Unit* pet = ObjectAccessor::GetCreatureOrPetOrVehicle(*_player, guid); if (!pet) { - sLog->outDebug("Vanitypet (guid: %u) does not exist - player '%s' (guid: %u / account: %u) attempted to dismiss it (possibly lagged out)", + sLog->outDebug(LOG_FILTER_NETWORKIO, "Vanitypet (guid: %u) does not exist - player '%s' (guid: %u / account: %u) attempted to dismiss it (possibly lagged out)", uint32(GUID_LOPART(guid)), GetPlayer()->GetName(), GetPlayer()->GetGUIDLow(), GetAccountId()); return; } @@ -114,7 +114,7 @@ void WorldSession::HandlePetStopAttack(WorldPacket &recv_data) uint64 guid; recv_data >> guid; - sLog->outDebug("WORLD: Received CMSG_PET_STOP_ATTACK for GUID " UI64FMTD "", guid); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_PET_STOP_ATTACK for GUID " UI64FMTD "", guid); Unit* pet = ObjectAccessor::GetCreatureOrPetOrVehicle(*_player, guid); @@ -141,7 +141,8 @@ void WorldSession::HandlePetActionHelper(Unit *pet, uint64 guid1, uint16 spellid CharmInfo *charmInfo = pet->GetCharmInfo(); if (!charmInfo) { - sLog->outError("WorldSession::HandlePetAction: object (GUID: %u TypeId: %u) is considered pet-like but doesn't have a charminfo!", pet->GetGUIDLow(), pet->GetTypeId()); + sLog->outError("WorldSession::HandlePetAction(petGuid: " UI64FMTD ", tagGuid: " UI64FMTD ", spellId: %u, flag: %u): object (entry: %u TypeId: %u) is considered pet-like but doesn't have a charminfo!", + guid1, guid2, spellid, flag, pet->GetGUIDLow(), pet->GetTypeId()); return; } @@ -166,26 +167,7 @@ void WorldSession::HandlePetActionHelper(Unit *pet, uint64 guid1, uint16 spellid { pet->AttackStop(); pet->InterruptNonMeleeSpells(false); - float distance = PET_FOLLOW_DIST; - if (pet->ToCreature()) - { - CreatureInfo const *cinfo = pet->ToCreature()->GetCreatureInfo(); - switch (cinfo->family) - { - case CREATURE_FAMILY_SPIDER: - case CREATURE_FAMILY_DEVILSAUR: - distance = -2.0f; - break; - case CREATURE_FAMILY_CHIMAERA: - case CREATURE_FAMILY_CORE_HOUND: - case CREATURE_FAMILY_RHINO: - distance = -4.0f; - break; - default: - break; - } - } - pet->GetMotionMaster()->MoveFollow(_player,distance,pet->GetFollowAngle()); + pet->GetMotionMaster()->MoveFollow(_player, PET_FOLLOW_DIST, pet->GetFollowAngle()); charmInfo->SetCommandState(COMMAND_FOLLOW); charmInfo->SetIsCommandAttack(false); @@ -316,7 +298,7 @@ void WorldSession::HandlePetActionHelper(Unit *pet, uint64 guid1, uint16 spellid } if (spellInfo->StartRecoveryCategory > 0) - if (pet->ToCreature()->GetGlobalCooldown() > 0) + if (pet->GetCharmInfo() && pet->GetCharmInfo()->GetGlobalCooldownMgr().HasGlobalCooldown(spellInfo)) return; for (uint32 i = 0; i < MAX_SPELL_EFFECTS; ++i) @@ -752,7 +734,7 @@ void WorldSession::HandlePetCastSpellOpcode(WorldPacket& recvPacket) recvPacket >> guid >> castCount >> spellId >> castFlags; - sLog->outDebug("WORLD: CMSG_PET_CAST_SPELL, guid: " UI64FMTD ", castCount: %u, spellId %u, castFlags %u", guid, castCount, spellId, castFlags); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_PET_CAST_SPELL, guid: " UI64FMTD ", castCount: %u, spellId %u, castFlags %u", guid, castCount, spellId, castFlags); // This opcode is also sent from charmed and possessed units (players and creatures) if (!_player->GetGuardianPet() && !_player->GetCharm()) @@ -774,7 +756,7 @@ void WorldSession::HandlePetCastSpellOpcode(WorldPacket& recvPacket) } if (spellInfo->StartRecoveryCategory > 0) // Check if spell is affected by GCD - if (caster->GetTypeId() == TYPEID_UNIT && caster->ToCreature()->GetGlobalCooldown() > 0) + if (caster->GetTypeId() == TYPEID_UNIT && caster->GetCharmInfo() && caster->GetCharmInfo()->GetGlobalCooldownMgr().HasGlobalCooldown(spellInfo)) { caster->SendPetCastFail(spellId, SPELL_FAILED_NOT_READY); return; @@ -857,7 +839,7 @@ void WorldSession::SendPetNameInvalid(uint32 error, const std::string& name, Dec void WorldSession::HandlePetLearnTalent(WorldPacket & recv_data) { - sLog->outDebug("WORLD: CMSG_PET_LEARN_TALENT"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_PET_LEARN_TALENT"); uint64 guid; uint32 talent_id, requested_rank; @@ -869,7 +851,7 @@ void WorldSession::HandlePetLearnTalent(WorldPacket & recv_data) void WorldSession::HandleLearnPreviewTalentsPet(WorldPacket & recv_data) { - sLog->outDebug("CMSG_LEARN_PREVIEW_TALENTS_PET"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LEARN_PREVIEW_TALENTS_PET"); uint64 guid; recv_data >> guid; diff --git a/src/server/game/Server/Protocol/Handlers/PetitionsHandler.cpp b/src/server/game/Server/Protocol/Handlers/PetitionsHandler.cpp index b8cf982e990f9..1417661fba8e8 100755 --- a/src/server/game/Server/Protocol/Handlers/PetitionsHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/PetitionsHandler.cpp @@ -56,7 +56,7 @@ enum CharterCosts void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recv_data) { - sLog->outDebug("Received opcode CMSG_PETITION_BUY"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode CMSG_PETITION_BUY"); recv_data.hexlike(); uint64 guidNPC; @@ -86,13 +86,13 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recv_data) recv_data >> clientIndex; // index recv_data.read_skip(); // 0 - sLog->outDebug("Petitioner with GUID %u tried sell petition: name %s", GUID_LOPART(guidNPC), name.c_str()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Petitioner with GUID %u tried sell petition: name %s", GUID_LOPART(guidNPC), name.c_str()); // prevent cheating Creature *pCreature = GetPlayer()->GetNPCIfCanInteractWith(guidNPC,UNIT_NPC_FLAG_PETITIONER); if (!pCreature) { - sLog->outDebug("WORLD: HandlePetitionBuyOpcode - Unit (GUID: %u) not found or you can't interact with him.", GUID_LOPART(guidNPC)); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandlePetitionBuyOpcode - Unit (GUID: %u) not found or you can't interact with him.", GUID_LOPART(guidNPC)); return; } @@ -141,7 +141,7 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recv_data) type = ARENA_TEAM_CHARTER_5v5_TYPE; break; default: - sLog->outDebug("unknown selection at buy arena petition: %u", clientIndex); + sLog->outDebug(LOG_FILTER_NETWORKIO, "unknown selection at buy arena petition: %u", clientIndex); return; } @@ -230,7 +230,7 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recv_data) // delete petitions with the same guid as this one ssInvalidPetitionGUIDs << "'" << charter->GetGUIDLow() << "'"; - sLog->outDebug("Invalid petition GUIDs: %s", ssInvalidPetitionGUIDs.str().c_str()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Invalid petition GUIDs: %s", ssInvalidPetitionGUIDs.str().c_str()); CharacterDatabase.escape_string(name); SQLTransaction trans = CharacterDatabase.BeginTransaction(); trans->PAppend("DELETE FROM petition WHERE petitionguid IN (%s)", ssInvalidPetitionGUIDs.str().c_str()); @@ -243,7 +243,7 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recv_data) void WorldSession::HandlePetitionShowSignOpcode(WorldPacket & recv_data) { // ok - sLog->outDebug("Received opcode CMSG_PETITION_SHOW_SIGNATURES"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode CMSG_PETITION_SHOW_SIGNATURES"); //recv_data.hexlike(); uint8 signs = 0; @@ -272,7 +272,7 @@ void WorldSession::HandlePetitionShowSignOpcode(WorldPacket & recv_data) if (result) signs = uint8(result->GetRowCount()); - sLog->outDebug("CMSG_PETITION_SHOW_SIGNATURES petition entry: '%u'", petitionguid_low); + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_PETITION_SHOW_SIGNATURES petition entry: '%u'", petitionguid_low); WorldPacket data(SMSG_PETITION_SHOW_SIGNATURES, (8+8+4+1+signs*12)); data << uint64(petitionguid); // petition guid @@ -295,14 +295,14 @@ void WorldSession::HandlePetitionShowSignOpcode(WorldPacket & recv_data) void WorldSession::HandlePetitionQueryOpcode(WorldPacket & recv_data) { - sLog->outDebug("Received opcode CMSG_PETITION_QUERY"); // ok + sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode CMSG_PETITION_QUERY"); // ok //recv_data.hexlike(); uint32 guildguid; uint64 petitionguid; recv_data >> guildguid; // in Trinity always same as GUID_LOPART(petitionguid) recv_data >> petitionguid; // petition guid - sLog->outDebug("CMSG_PETITION_QUERY Petition GUID %u Guild GUID %u", GUID_LOPART(petitionguid), guildguid); + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_PETITION_QUERY Petition GUID %u Guild GUID %u", GUID_LOPART(petitionguid), guildguid); SendPetitionQueryOpcode(petitionguid); } @@ -330,7 +330,7 @@ void WorldSession::SendPetitionQueryOpcode(uint64 petitionguid) } else { - sLog->outDebug("CMSG_PETITION_QUERY failed for petition (GUID: %u)", GUID_LOPART(petitionguid)); + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_PETITION_QUERY failed for petition (GUID: %u)", GUID_LOPART(petitionguid)); return; } @@ -375,7 +375,7 @@ void WorldSession::SendPetitionQueryOpcode(uint64 petitionguid) void WorldSession::HandlePetitionRenameOpcode(WorldPacket & recv_data) { - sLog->outDebug("Received opcode MSG_PETITION_RENAME"); // ok + sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode MSG_PETITION_RENAME"); // ok //recv_data.hexlike(); uint64 petitionguid; @@ -398,7 +398,7 @@ void WorldSession::HandlePetitionRenameOpcode(WorldPacket & recv_data) } else { - sLog->outDebug("CMSG_PETITION_QUERY failed for petition (GUID: %u)", GUID_LOPART(petitionguid)); + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_PETITION_QUERY failed for petition (GUID: %u)", GUID_LOPART(petitionguid)); return; } @@ -434,7 +434,7 @@ void WorldSession::HandlePetitionRenameOpcode(WorldPacket & recv_data) CharacterDatabase.PExecute("UPDATE petition SET name = '%s' WHERE petitionguid = '%u'", db_newname.c_str(), GUID_LOPART(petitionguid)); - sLog->outDebug("Petition (GUID: %u) renamed to '%s'", GUID_LOPART(petitionguid), newname.c_str()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Petition (GUID: %u) renamed to '%s'", GUID_LOPART(petitionguid), newname.c_str()); WorldPacket data(MSG_PETITION_RENAME, (8+newname.size()+1)); data << uint64(petitionguid); data << newname; @@ -443,7 +443,7 @@ void WorldSession::HandlePetitionRenameOpcode(WorldPacket & recv_data) void WorldSession::HandlePetitionSignOpcode(WorldPacket & recv_data) { - sLog->outDebug("Received opcode CMSG_PETITION_SIGN"); // ok + sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode CMSG_PETITION_SIGN"); // ok //recv_data.hexlike(); Field *fields; @@ -546,7 +546,7 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket & recv_data) CharacterDatabase.PExecute("INSERT INTO petition_sign (ownerguid,petitionguid, playerguid, player_account) VALUES ('%u', '%u', '%u','%u')", GUID_LOPART(ownerguid),GUID_LOPART(petitionguid), plguidlo,GetAccountId()); - sLog->outDebug("PETITION SIGN: GUID %u by player: %s (GUID: %u Account: %u)", GUID_LOPART(petitionguid), _player->GetName(),plguidlo,GetAccountId()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "PETITION SIGN: GUID %u by player: %s (GUID: %u Account: %u)", GUID_LOPART(petitionguid), _player->GetName(),plguidlo,GetAccountId()); WorldPacket data(SMSG_PETITION_SIGN_RESULTS, (8+8+4)); data << uint64(petitionguid); @@ -568,13 +568,13 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket & recv_data) void WorldSession::HandlePetitionDeclineOpcode(WorldPacket & recv_data) { - sLog->outDebug("Received opcode MSG_PETITION_DECLINE"); // ok + sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode MSG_PETITION_DECLINE"); // ok //recv_data.hexlike(); uint64 petitionguid; uint64 ownerguid; recv_data >> petitionguid; // petition guid - sLog->outDebug("Petition %u declined by %u", GUID_LOPART(petitionguid), _player->GetGUIDLow()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Petition %u declined by %u", GUID_LOPART(petitionguid), _player->GetGUIDLow()); QueryResult result = CharacterDatabase.PQuery("SELECT ownerguid FROM petition WHERE petitionguid = '%u'", GUID_LOPART(petitionguid)); if (!result) @@ -594,7 +594,7 @@ void WorldSession::HandlePetitionDeclineOpcode(WorldPacket & recv_data) void WorldSession::HandleOfferPetitionOpcode(WorldPacket & recv_data) { - sLog->outDebug("Received opcode CMSG_OFFER_PETITION"); // ok + sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode CMSG_OFFER_PETITION"); // ok //recv_data.hexlike(); uint8 signs = 0; @@ -616,7 +616,7 @@ void WorldSession::HandleOfferPetitionOpcode(WorldPacket & recv_data) Field *fields = result->Fetch(); type = fields[0].GetUInt8(); - sLog->outDebug("OFFER PETITION: type %u, GUID1 %u, to player id: %u", type, GUID_LOPART(petitionguid), GUID_LOPART(plguid)); + sLog->outDebug(LOG_FILTER_NETWORKIO, "OFFER PETITION: type %u, GUID1 %u, to player id: %u", type, GUID_LOPART(petitionguid), GUID_LOPART(plguid)); if (!sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && GetPlayer()->GetTeam() != player->GetTeam()) { @@ -695,7 +695,7 @@ void WorldSession::HandleOfferPetitionOpcode(WorldPacket & recv_data) void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recv_data) { - sLog->outDebug("Received opcode CMSG_TURN_IN_PETITION"); // ok + sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode CMSG_TURN_IN_PETITION"); // ok //recv_data.hexlike(); WorldPacket data; @@ -707,7 +707,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recv_data) recv_data >> petitionguid; - sLog->outDebug("Petition %u turned in by %u", GUID_LOPART(petitionguid), _player->GetGUIDLow()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Petition %u turned in by %u", GUID_LOPART(petitionguid), _player->GetGUIDLow()); // data QueryResult result = CharacterDatabase.PQuery("SELECT ownerguid, name, type FROM petition WHERE petitionguid = '%u'", GUID_LOPART(petitionguid)); @@ -839,14 +839,14 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recv_data) // register team and add captain sObjectMgr->AddArenaTeam(at); - sLog->outDebug("PetitonsHandler: arena team added to objmrg"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "PetitonsHandler: arena team added to objmrg"); // add members for (uint8 i = 0; i < signs; ++i) { Field* fields = result->Fetch(); uint64 memberGUID = fields[0].GetUInt64(); - sLog->outDebug("PetitionsHandler: adding arena member %u", GUID_LOPART(memberGUID)); + sLog->outDebug(LOG_FILTER_NETWORKIO, "PetitionsHandler: adding arena member %u", GUID_LOPART(memberGUID)); at->AddMember(memberGUID); result->NextRow(); } @@ -858,7 +858,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recv_data) CharacterDatabase.CommitTransaction(trans); // created - sLog->outDebug("TURN IN PETITION GUID %u", GUID_LOPART(petitionguid)); + sLog->outDebug(LOG_FILTER_NETWORKIO, "TURN IN PETITION GUID %u", GUID_LOPART(petitionguid)); data.Initialize(SMSG_TURN_IN_PETITION_RESULTS, 4); data << (uint32)PETITION_TURN_OK; @@ -867,7 +867,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recv_data) void WorldSession::HandlePetitionShowListOpcode(WorldPacket & recv_data) { - sLog->outDebug("Received CMSG_PETITION_SHOWLIST"); // ok + sLog->outDebug(LOG_FILTER_NETWORKIO, "Received CMSG_PETITION_SHOWLIST"); // ok //recv_data.hexlike(); uint64 guid; @@ -881,7 +881,7 @@ void WorldSession::SendPetitionShowList(uint64 guid) Creature *pCreature = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_PETITIONER); if (!pCreature) { - sLog->outDebug("WORLD: HandlePetitionShowListOpcode - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandlePetitionShowListOpcode - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); return; } @@ -941,5 +941,5 @@ void WorldSession::SendPetitionShowList(uint64 guid) // data << uint32(9); // required signs? //} SendPacket(&data); - sLog->outDebug("Sent SMSG_PETITION_SHOWLIST"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Sent SMSG_PETITION_SHOWLIST"); } diff --git a/src/server/game/Server/Protocol/Handlers/QueryHandler.cpp b/src/server/game/Server/Protocol/Handlers/QueryHandler.cpp index 4498595f8718b..a9b6ef6c1638c 100755 --- a/src/server/game/Server/Protocol/Handlers/QueryHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/QueryHandler.cpp @@ -197,16 +197,16 @@ void WorldSession::HandleCreatureQueryOpcode(WorldPacket & recv_data) data << uint32(ci->questItems[i]); // itemId[6], quest drop data << uint32(ci->movementId); // CreatureMovementInfo.dbc SendPacket(&data); - sLog->outDebug("WORLD: Sent SMSG_CREATURE_QUERY_RESPONSE"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_CREATURE_QUERY_RESPONSE"); } else { - sLog->outDebug("WORLD: CMSG_CREATURE_QUERY - NO CREATURE INFO! (GUID: %u, ENTRY: %u)", + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CREATURE_QUERY - NO CREATURE INFO! (GUID: %u, ENTRY: %u)", GUID_LOPART(guid), entry); WorldPacket data(SMSG_CREATURE_QUERY_RESPONSE, 4); data << uint32(entry | 0x80000000); SendPacket(&data); - sLog->outDebug("WORLD: Sent SMSG_CREATURE_QUERY_RESPONSE"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_CREATURE_QUERY_RESPONSE"); } } @@ -253,16 +253,16 @@ void WorldSession::HandleGameObjectQueryOpcode(WorldPacket & recv_data) for (uint32 i = 0; i < MAX_GAMEOBJECT_QUEST_ITEMS; ++i) data << uint32(info->questItems[i]); // itemId[6], quest drop SendPacket(&data); - sLog->outDebug("WORLD: Sent SMSG_GAMEOBJECT_QUERY_RESPONSE"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_GAMEOBJECT_QUERY_RESPONSE"); } else { - sLog->outDebug("WORLD: CMSG_GAMEOBJECT_QUERY - Missing gameobject info for (GUID: %u, ENTRY: %u)", + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_GAMEOBJECT_QUERY - Missing gameobject info for (GUID: %u, ENTRY: %u)", GUID_LOPART(guid), entryID); WorldPacket data (SMSG_GAMEOBJECT_QUERY_RESPONSE, 4); data << uint32(entryID | 0x80000000); SendPacket(&data); - sLog->outDebug("WORLD: Sent SMSG_GAMEOBJECT_QUERY_RESPONSE"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_GAMEOBJECT_QUERY_RESPONSE"); } } @@ -397,7 +397,7 @@ void WorldSession::HandleNpcTextQueryOpcode(WorldPacket & recv_data) SendPacket(&data); - sLog->outDebug("WORLD: Sent SMSG_NPC_TEXT_UPDATE"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_NPC_TEXT_UPDATE"); } void WorldSession::HandlePageTextQueryOpcode(WorldPacket & recv_data) @@ -437,13 +437,13 @@ void WorldSession::HandlePageTextQueryOpcode(WorldPacket & recv_data) } SendPacket(&data); - sLog->outDebug("WORLD: Sent SMSG_PAGE_TEXT_QUERY_RESPONSE"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_PAGE_TEXT_QUERY_RESPONSE"); } } void WorldSession::HandleCorpseMapPositionQuery(WorldPacket & recv_data) { - sLog->outDebug("WORLD: Recv CMSG_CORPSE_MAP_POSITION_QUERY"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recv CMSG_CORPSE_MAP_POSITION_QUERY"); uint32 unk; recv_data >> unk; diff --git a/src/server/game/Server/Protocol/Handlers/QuestHandler.cpp b/src/server/game/Server/Protocol/Handlers/QuestHandler.cpp index 4eb37efdd23b2..aa61e61864266 100755 --- a/src/server/game/Server/Protocol/Handlers/QuestHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/QuestHandler.cpp @@ -54,7 +54,7 @@ void WorldSession::HandleQuestgiverStatusQueryOpcode(WorldPacket & recv_data) { case TYPEID_UNIT: { - sLog->outDebug("WORLD: Received CMSG_QUESTGIVER_STATUS_QUERY for npc, guid = %u",uint32(GUID_LOPART(guid))); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_STATUS_QUERY for npc, guid = %u",uint32(GUID_LOPART(guid))); Creature* cr_questgiver=questgiver->ToCreature(); if (!cr_questgiver->IsHostileTo(_player)) // not show quest status to enemies { @@ -66,7 +66,7 @@ void WorldSession::HandleQuestgiverStatusQueryOpcode(WorldPacket & recv_data) } case TYPEID_GAMEOBJECT: { - sLog->outDebug("WORLD: Received CMSG_QUESTGIVER_STATUS_QUERY for GameObject guid = %u",uint32(GUID_LOPART(guid))); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_STATUS_QUERY for GameObject guid = %u",uint32(GUID_LOPART(guid))); GameObject* go_questgiver=(GameObject*)questgiver; questStatus = sScriptMgr->GetDialogStatus(_player, go_questgiver); if (questStatus > 6) @@ -87,12 +87,12 @@ void WorldSession::HandleQuestgiverHelloOpcode(WorldPacket & recv_data) uint64 guid; recv_data >> guid; - sLog->outDebug ("WORLD: Received CMSG_QUESTGIVER_HELLO npc = %u", GUID_LOPART(guid)); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_HELLO npc = %u", GUID_LOPART(guid)); Creature *pCreature = GetPlayer()->GetNPCIfCanInteractWith(guid,UNIT_NPC_FLAG_NONE); if (!pCreature) { - sLog->outDebug ("WORLD: HandleQuestgiverHelloOpcode - Unit (GUID: %u) not found or you can't interact with him.", + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleQuestgiverHelloOpcode - Unit (GUID: %u) not found or you can't interact with him.", GUID_LOPART(guid)); return; } @@ -122,7 +122,7 @@ void WorldSession::HandleQuestgiverAcceptQuestOpcode(WorldPacket & recv_data) if (!GetPlayer()->isAlive()) return; - sLog->outDebug("WORLD: Received CMSG_QUESTGIVER_ACCEPT_QUEST npc = %u, quest = %u, unk1 = %u", uint32(GUID_LOPART(guid)), quest, unk1); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_ACCEPT_QUEST npc = %u, quest = %u, unk1 = %u", uint32(GUID_LOPART(guid)), quest, unk1); Object* pObject = ObjectAccessor::GetObjectByTypeMask(*_player, guid,TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT|TYPEMASK_ITEM|TYPEMASK_PLAYER); @@ -239,7 +239,7 @@ void WorldSession::HandleQuestgiverQueryQuestOpcode(WorldPacket & recv_data) uint32 quest; uint8 unk1; recv_data >> guid >> quest >> unk1; - sLog->outDebug("WORLD: Received CMSG_QUESTGIVER_QUERY_QUEST npc = %u, quest = %u, unk1 = %u", uint32(GUID_LOPART(guid)), quest, unk1); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_QUERY_QUEST npc = %u, quest = %u, unk1 = %u", uint32(GUID_LOPART(guid)), quest, unk1); // Verify that the guid is valid and is a questgiver or involved in the requested quest Object* pObject = ObjectAccessor::GetObjectByTypeMask(*_player, guid,TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT|TYPEMASK_ITEM); @@ -273,7 +273,7 @@ void WorldSession::HandleQuestQueryOpcode(WorldPacket & recv_data) uint32 quest; recv_data >> quest; - sLog->outDebug("WORLD: Received CMSG_QUEST_QUERY quest = %u",quest); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUEST_QUERY quest = %u",quest); Quest const *pQuest = sObjectMgr->GetQuestTemplate(quest); if (pQuest) @@ -297,7 +297,7 @@ void WorldSession::HandleQuestgiverChooseRewardOpcode(WorldPacket & recv_data) if (!GetPlayer()->isAlive()) return; - sLog->outDebug("WORLD: Received CMSG_QUESTGIVER_CHOOSE_REWARD npc = %u, quest = %u, reward = %u",uint32(GUID_LOPART(guid)),quest,reward); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_CHOOSE_REWARD npc = %u, quest = %u, reward = %u",uint32(GUID_LOPART(guid)),quest,reward); Object* pObject = ObjectAccessor::GetObjectByTypeMask(*_player, guid,TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT); if (!pObject) @@ -352,7 +352,7 @@ void WorldSession::HandleQuestgiverRequestRewardOpcode(WorldPacket & recv_data) if (!GetPlayer()->isAlive()) return; - sLog->outDebug("WORLD: Received CMSG_QUESTGIVER_REQUEST_REWARD npc = %u, quest = %u",uint32(GUID_LOPART(guid)),quest); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_REQUEST_REWARD npc = %u, quest = %u",uint32(GUID_LOPART(guid)),quest); Object* pObject = ObjectAccessor::GetObjectByTypeMask(*_player, guid,TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT); if (!pObject||!pObject->hasInvolvedQuest(quest)) @@ -370,7 +370,7 @@ void WorldSession::HandleQuestgiverRequestRewardOpcode(WorldPacket & recv_data) void WorldSession::HandleQuestgiverCancel(WorldPacket& /*recv_data*/) { - sLog->outDebug("WORLD: Received CMSG_QUESTGIVER_CANCEL"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_CANCEL"); _player->PlayerTalkClass->CloseGossip(); } @@ -383,7 +383,7 @@ void WorldSession::HandleQuestLogSwapQuest(WorldPacket& recv_data) if (slot1 == slot2 || slot1 >= MAX_QUEST_LOG_SIZE || slot2 >= MAX_QUEST_LOG_SIZE) return; - sLog->outDebug("WORLD: Received CMSG_QUESTLOG_SWAP_QUEST slot 1 = %u, slot 2 = %u", slot1, slot2); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTLOG_SWAP_QUEST slot 1 = %u, slot 2 = %u", slot1, slot2); GetPlayer()->SwapQuestSlot(slot1,slot2); } @@ -393,7 +393,7 @@ void WorldSession::HandleQuestLogRemoveQuest(WorldPacket& recv_data) uint8 slot; recv_data >> slot; - sLog->outDebug("WORLD: Received CMSG_QUESTLOG_REMOVE_QUEST slot = %u",slot); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTLOG_REMOVE_QUEST slot = %u",slot); if (slot < MAX_QUEST_LOG_SIZE) { @@ -426,7 +426,7 @@ void WorldSession::HandleQuestConfirmAccept(WorldPacket& recv_data) uint32 quest; recv_data >> quest; - sLog->outDebug("WORLD: Received CMSG_QUEST_CONFIRM_ACCEPT quest = %u", quest); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUEST_CONFIRM_ACCEPT quest = %u", quest); if (const Quest* pQuest = sObjectMgr->GetQuestTemplate(quest)) { @@ -465,7 +465,7 @@ void WorldSession::HandleQuestgiverCompleteQuest(WorldPacket& recv_data) if (!_player->isAlive()) return; - sLog->outDebug("WORLD: Received CMSG_QUESTGIVER_COMPLETE_QUEST npc = %u, quest = %u",uint32(GUID_LOPART(guid)),quest); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_COMPLETE_QUEST npc = %u, quest = %u",uint32(GUID_LOPART(guid)),quest); Quest const *pQuest = sObjectMgr->GetQuestTemplate(quest); if (pQuest) @@ -501,7 +501,7 @@ void WorldSession::HandleQuestgiverCompleteQuest(WorldPacket& recv_data) void WorldSession::HandleQuestgiverQuestAutoLaunch(WorldPacket& /*recvPacket*/) { - sLog->outDebug("WORLD: Received CMSG_QUESTGIVER_QUEST_AUTOLAUNCH"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_QUEST_AUTOLAUNCH"); } void WorldSession::HandlePushQuestToParty(WorldPacket& recvPacket) @@ -509,7 +509,7 @@ void WorldSession::HandlePushQuestToParty(WorldPacket& recvPacket) uint32 questId; recvPacket >> questId; - sLog->outDebug("WORLD: Received CMSG_PUSHQUESTTOPARTY quest = %u", questId); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_PUSHQUESTTOPARTY quest = %u", questId); if (Quest const *pQuest = sObjectMgr->GetQuestTemplate(questId)) { @@ -567,7 +567,7 @@ void WorldSession::HandleQuestPushResult(WorldPacket& recvPacket) uint8 msg; recvPacket >> guid >> msg; - sLog->outDebug("WORLD: Received MSG_QUEST_PUSH_RESULT"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_QUEST_PUSH_RESULT"); if (_player->GetDivider() != 0) { @@ -682,7 +682,7 @@ uint32 WorldSession::getDialogStatus(Player *pPlayer, Object* questgiver, uint32 void WorldSession::HandleQuestgiverStatusMultipleQuery(WorldPacket& /*recvPacket*/) { - sLog->outDebug("WORLD: Received CMSG_QUESTGIVER_STATUS_MULTIPLE_QUERY"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_STATUS_MULTIPLE_QUERY"); uint32 count = 0; diff --git a/src/server/game/Server/Protocol/Handlers/SkillHandler.cpp b/src/server/game/Server/Protocol/Handlers/SkillHandler.cpp index 44bd0e8e6c96a..ac98830dd2bcd 100755 --- a/src/server/game/Server/Protocol/Handlers/SkillHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/SkillHandler.cpp @@ -37,7 +37,7 @@ void WorldSession::HandleLearnTalentOpcode(WorldPacket & recv_data) void WorldSession::HandleLearnPreviewTalents(WorldPacket& recvPacket) { - sLog->outDebug("CMSG_LEARN_PREVIEW_TALENTS"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LEARN_PREVIEW_TALENTS"); uint32 talentsCount; recvPacket >> talentsCount; @@ -56,14 +56,14 @@ void WorldSession::HandleLearnPreviewTalents(WorldPacket& recvPacket) void WorldSession::HandleTalentWipeConfirmOpcode(WorldPacket & recv_data) { - sLog->outDetail("MSG_TALENT_WIPE_CONFIRM"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "MSG_TALENT_WIPE_CONFIRM"); uint64 guid; recv_data >> guid; Creature *unit = GetPlayer()->GetNPCIfCanInteractWith(guid,UNIT_NPC_FLAG_TRAINER); if (!unit) { - sLog->outDebug("WORLD: HandleTalentWipeConfirmOpcode - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleTalentWipeConfirmOpcode - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); return; } diff --git a/src/server/game/Server/Protocol/Handlers/SpellHandler.cpp b/src/server/game/Server/Protocol/Handlers/SpellHandler.cpp index c9122e68f0143..862a2ed0e27f6 100755 --- a/src/server/game/Server/Protocol/Handlers/SpellHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/SpellHandler.cpp @@ -283,7 +283,7 @@ void WorldSession::HandleGameObjectUseOpcode(WorldPacket & recv_data) recv_data >> guid; - sLog->outDebug("WORLD: Recvd CMSG_GAMEOBJ_USE Message [guid=%u]", GUID_LOPART(guid)); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_GAMEOBJ_USE Message [guid=%u]", GUID_LOPART(guid)); // ignore for remote control state if (_player->m_mover != _player) @@ -302,7 +302,7 @@ void WorldSession::HandleGameobjectReportUse(WorldPacket& recvPacket) uint64 guid; recvPacket >> guid; - sLog->outDebug("WORLD: Recvd CMSG_GAMEOBJ_REPORT_USE Message [in game guid: %u]", GUID_LOPART(guid)); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_GAMEOBJ_REPORT_USE Message [in game guid: %u]", GUID_LOPART(guid)); // ignore for remote control state if (_player->m_mover != _player) @@ -326,7 +326,7 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket) uint8 castCount, castFlags; recvPacket >> castCount >> spellId >> castFlags; - sLog->outDebug("WORLD: got cast spell packet, castCount: %u, spellId: %u, castFlags: %u, data length = %u", castCount, spellId, castFlags, (uint32)recvPacket.size()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: got cast spell packet, castCount: %u, spellId: %u, castFlags: %u, data length = %u", castCount, spellId, castFlags, (uint32)recvPacket.size()); // ignore for remote control state (for player case) Unit* mover = _player->m_mover; @@ -532,7 +532,7 @@ void WorldSession::HandleTotemDestroyed(WorldPacket& recvPacket) void WorldSession::HandleSelfResOpcode(WorldPacket & /*recv_data*/) { - sLog->outDebug("WORLD: CMSG_SELF_RES"); // empty opcode + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_SELF_RES"); // empty opcode if (_player->GetUInt32Value(PLAYER_SELF_RES_SPELL)) { @@ -544,7 +544,7 @@ void WorldSession::HandleSelfResOpcode(WorldPacket & /*recv_data*/) } } -void WorldSession::HandleSpellClick(WorldPacket & recv_data) +void WorldSession::HandleSpellClick(WorldPacket& recv_data) { uint64 guid; recv_data >> guid; @@ -559,30 +559,12 @@ void WorldSession::HandleSpellClick(WorldPacket & recv_data) if (!unit->IsInWorld()) return; - SpellClickInfoMapBounds clickPair = sObjectMgr->GetSpellClickInfoMapBounds(unit->GetEntry()); - for (SpellClickInfoMap::const_iterator itr = clickPair.first; itr != clickPair.second; ++itr) - { - if (itr->second.IsFitToRequirements(_player, unit)) - { - Unit *caster = (itr->second.castFlags & NPC_CLICK_CAST_CASTER_PLAYER) ? (Unit*)_player : (Unit*)unit; - Unit *target = (itr->second.castFlags & NPC_CLICK_CAST_TARGET_PLAYER) ? (Unit*)_player : (Unit*)unit; - uint64 origCasterGUID = (itr->second.castFlags & NPC_CLICK_CAST_ORIG_CASTER_OWNER) ? unit->GetOwnerGUID() : 0; - caster->CastSpell(target, itr->second.spellId, true, NULL, NULL, origCasterGUID); - } - } - - if (unit->IsVehicle()) - { - if (unit->CheckPlayerCondition(_player)) - _player->EnterVehicle(unit); - } - - unit->AI()->DoAction(EVENT_SPELLCLICK); + unit->HandleSpellClick(_player); } void WorldSession::HandleMirrrorImageDataRequest(WorldPacket & recv_data) { - sLog->outDebug("WORLD: CMSG_GET_MIRRORIMAGE_DATA"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_GET_MIRRORIMAGE_DATA"); uint64 guid; recv_data >> guid; diff --git a/src/server/game/Server/Protocol/Handlers/TaxiHandler.cpp b/src/server/game/Server/Protocol/Handlers/TaxiHandler.cpp index 0baca16a73589..a7bc65143beb8 100755 --- a/src/server/game/Server/Protocol/Handlers/TaxiHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/TaxiHandler.cpp @@ -31,7 +31,7 @@ void WorldSession::HandleTaxiNodeStatusQueryOpcode(WorldPacket & recv_data) { - sLog->outDebug("WORLD: Received CMSG_TAXINODE_STATUS_QUERY"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_TAXINODE_STATUS_QUERY"); uint64 guid; @@ -45,7 +45,7 @@ void WorldSession::SendTaxiStatus(uint64 guid) Creature *unit = GetPlayer()->GetMap()->GetCreature(guid); if (!unit) { - sLog->outDebug("WorldSession::SendTaxiStatus - Unit (GUID: %u) not found.", uint32(GUID_LOPART(guid))); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WorldSession::SendTaxiStatus - Unit (GUID: %u) not found.", uint32(GUID_LOPART(guid))); return; } @@ -55,18 +55,18 @@ void WorldSession::SendTaxiStatus(uint64 guid) if (curloc == 0) return; - sLog->outDebug("WORLD: current location %u ",curloc); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: current location %u ",curloc); WorldPacket data(SMSG_TAXINODE_STATUS, 9); data << guid; data << uint8(GetPlayer()->m_taxi.IsTaximaskNodeKnown(curloc) ? 1 : 0); SendPacket(&data); - sLog->outDebug("WORLD: Sent SMSG_TAXINODE_STATUS"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_TAXINODE_STATUS"); } void WorldSession::HandleTaxiQueryAvailableNodes(WorldPacket & recv_data) { - sLog->outDebug("WORLD: Received CMSG_TAXIQUERYAVAILABLENODES"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_TAXIQUERYAVAILABLENODES"); uint64 guid; recv_data >> guid; @@ -75,7 +75,7 @@ void WorldSession::HandleTaxiQueryAvailableNodes(WorldPacket & recv_data) Creature *unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_FLIGHTMASTER); if (!unit) { - sLog->outDebug("WORLD: HandleTaxiQueryAvailableNodes - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleTaxiQueryAvailableNodes - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); return; } @@ -102,7 +102,7 @@ void WorldSession::SendTaxiMenu(Creature* unit) bool lastTaxiCheaterState = GetPlayer()->isTaxiCheater(); if (unit->GetEntry() == 29480) GetPlayer()->SetTaxiCheater(true); // Grimwing in Ebon Hold, special case. NOTE: Not perfect, Zul'Aman should not be included according to WoWhead, and I think taxicheat includes it. - sLog->outDebug("WORLD: CMSG_TAXINODE_STATUS_QUERY %u ",curloc); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_TAXINODE_STATUS_QUERY %u ",curloc); WorldPacket data(SMSG_SHOWTAXINODES, (4+8+4+8*4)); data << uint32(1); @@ -111,7 +111,7 @@ void WorldSession::SendTaxiMenu(Creature* unit) GetPlayer()->m_taxi.AppendTaximaskTo(data,GetPlayer()->isTaxiCheater()); SendPacket(&data); - sLog->outDebug("WORLD: Sent SMSG_SHOWTAXINODES"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_SHOWTAXINODES"); GetPlayer()->SetTaxiCheater(lastTaxiCheaterState); } @@ -166,7 +166,7 @@ void WorldSession::SendDiscoverNewTaxiNode(uint32 nodeid) void WorldSession::HandleActivateTaxiExpressOpcode (WorldPacket & recv_data) { - sLog->outDebug("WORLD: Received CMSG_ACTIVATETAXIEXPRESS"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_ACTIVATETAXIEXPRESS"); uint64 guid; uint32 node_count; @@ -176,7 +176,7 @@ void WorldSession::HandleActivateTaxiExpressOpcode (WorldPacket & recv_data) Creature *npc = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_FLIGHTMASTER); if (!npc) { - sLog->outDebug("WORLD: HandleActivateTaxiExpressOpcode - Unit (GUID: %u) not found or you can't interact with it.", uint32(GUID_LOPART(guid))); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleActivateTaxiExpressOpcode - Unit (GUID: %u) not found or you can't interact with it.", uint32(GUID_LOPART(guid))); return; } std::vector nodes; @@ -191,14 +191,14 @@ void WorldSession::HandleActivateTaxiExpressOpcode (WorldPacket & recv_data) if (nodes.empty()) return; - sLog->outDebug("WORLD: Received CMSG_ACTIVATETAXIEXPRESS from %d to %d" ,nodes.front(),nodes.back()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_ACTIVATETAXIEXPRESS from %d to %d" ,nodes.front(),nodes.back()); GetPlayer()->ActivateTaxiPathTo(nodes, npc); } void WorldSession::HandleMoveSplineDoneOpcode(WorldPacket& recv_data) { - sLog->outDebug("WORLD: Received CMSG_MOVE_SPLINE_DONE"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_MOVE_SPLINE_DONE"); uint64 guid; // used only for proper packet read recv_data.readPackGUID(guid); @@ -252,7 +252,7 @@ void WorldSession::HandleMoveSplineDoneOpcode(WorldPacket& recv_data) } } - sLog->outDebug("WORLD: Taxi has to go from %u to %u", sourcenode, destinationnode); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Taxi has to go from %u to %u", sourcenode, destinationnode); uint32 mountDisplayId = sObjectMgr->GetTaxiMountDisplayId(sourcenode, GetPlayer()->GetTeam()); @@ -276,18 +276,18 @@ void WorldSession::HandleMoveSplineDoneOpcode(WorldPacket& recv_data) void WorldSession::HandleActivateTaxiOpcode(WorldPacket & recv_data) { - sLog->outDebug("WORLD: Received CMSG_ACTIVATETAXI"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_ACTIVATETAXI"); uint64 guid; std::vector nodes; nodes.resize(2); recv_data >> guid >> nodes[0] >> nodes[1]; - sLog->outDebug("WORLD: Received CMSG_ACTIVATETAXI from %d to %d" ,nodes[0],nodes[1]); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_ACTIVATETAXI from %d to %d" ,nodes[0],nodes[1]); Creature *npc = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_FLIGHTMASTER); if (!npc) { - sLog->outDebug("WORLD: HandleActivateTaxiOpcode - Unit (GUID: %u) not found or you can't interact with it.", uint32(GUID_LOPART(guid))); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleActivateTaxiOpcode - Unit (GUID: %u) not found or you can't interact with it.", uint32(GUID_LOPART(guid))); return; } diff --git a/src/server/game/Server/Protocol/Handlers/TradeHandler.cpp b/src/server/game/Server/Protocol/Handlers/TradeHandler.cpp index 6e22df70eb812..8d50f2fd7fe92 100755 --- a/src/server/game/Server/Protocol/Handlers/TradeHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/TradeHandler.cpp @@ -69,13 +69,13 @@ void WorldSession::SendTradeStatus(TradeStatus status) void WorldSession::HandleIgnoreTradeOpcode(WorldPacket& /*recvPacket*/) { - sLog->outDebug("WORLD: Ignore Trade %u",_player->GetGUIDLow()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Ignore Trade %u",_player->GetGUIDLow()); // recvPacket.print_storage(); } void WorldSession::HandleBusyTradeOpcode(WorldPacket& /*recvPacket*/) { - sLog->outDebug("WORLD: Busy Trade %u",_player->GetGUIDLow()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Busy Trade %u",_player->GetGUIDLow()); // recvPacket.print_storage(); } @@ -150,7 +150,7 @@ void WorldSession::moveItems(Item* myItems[], Item* hisItems[]) if (myItems[i]) { // logging - sLog->outDebug("partner storing: %u",myItems[i]->GetGUIDLow()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "partner storing: %u",myItems[i]->GetGUIDLow()); if (_player->GetSession()->GetSecurity() > SEC_PLAYER && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE)) { sLog->outCommand(_player->GetSession()->GetAccountId(), "GM %s (Account: %u) trade: %s (Entry: %d Count: %u) to player: %s (Account: %u)", @@ -168,7 +168,7 @@ void WorldSession::moveItems(Item* myItems[], Item* hisItems[]) if (hisItems[i]) { // logging - sLog->outDebug("player storing: %u",hisItems[i]->GetGUIDLow()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "player storing: %u",hisItems[i]->GetGUIDLow()); if (trader->GetSession()->GetSecurity() > SEC_PLAYER && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE)) { sLog->outCommand(trader->GetSession()->GetAccountId(),"GM %s (Account: %u) trade: %s (Entry: %d Count: %u) to player: %s (Account: %u)", diff --git a/src/server/game/Server/Protocol/Handlers/VehicleHandler.cpp b/src/server/game/Server/Protocol/Handlers/VehicleHandler.cpp new file mode 100644 index 0000000000000..2fcfcc25672d3 --- /dev/null +++ b/src/server/game/Server/Protocol/Handlers/VehicleHandler.cpp @@ -0,0 +1,228 @@ +/* + * Copyright (C) 2008-2011 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 "WorldPacket.h" +#include "WorldSession.h" +#include "Opcodes.h" +#include "Vehicle.h" +#include "Player.h" +#include "Log.h" +#include "ObjectAccessor.h" + +void WorldSession::HandleDismissControlledVehicle(WorldPacket &recv_data) +{ + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_DISMISS_CONTROLLED_VEHICLE"); + recv_data.hexlike(); + + uint64 vehicleGUID = _player->GetCharmGUID(); + + if (!vehicleGUID) // something wrong here... + { + recv_data.rfinish(); // prevent warnings spam + return; + } + + uint64 guid; + + recv_data.readPackGUID(guid); + + MovementInfo mi; + mi.guid = guid; + ReadMovementInfo(recv_data, &mi); + + _player->m_movementInfo = mi; + + _player->ExitVehicle(); +} + +void WorldSession::HandleChangeSeatsOnControlledVehicle(WorldPacket &recv_data) +{ + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_CHANGE_SEATS_ON_CONTROLLED_VEHICLE"); + recv_data.hexlike(); + + Unit* vehicle_base = GetPlayer()->GetVehicleBase(); + if (!vehicle_base) + { + recv_data.rfinish(); // prevent warnings spam + return; + } + + VehicleSeatEntry const* seat = GetPlayer()->GetVehicle()->GetSeatForPassenger(GetPlayer()); + if (!seat->CanSwitchFromSeat()) + { + recv_data.rfinish(); // prevent warnings spam + sLog->outError("HandleChangeSeatsOnControlledVehicle, Opcode: %u, Player %u tried to switch seats but current seatflags %u don't permit that.", + recv_data.GetOpcode(), GetPlayer()->GetGUIDLow(), seat->m_flags); + return; + } + + switch (recv_data.GetOpcode()) + { + case CMSG_REQUEST_VEHICLE_PREV_SEAT: + GetPlayer()->ChangeSeat(-1, false); + break; + case CMSG_REQUEST_VEHICLE_NEXT_SEAT: + GetPlayer()->ChangeSeat(-1, true); + break; + case CMSG_CHANGE_SEATS_ON_CONTROLLED_VEHICLE: + { + uint64 guid; // current vehicle guid + recv_data.readPackGUID(guid); + + ReadMovementInfo(recv_data, &vehicle_base->m_movementInfo); + + uint64 accessory; // accessory guid + recv_data.readPackGUID(accessory); + + int8 seatId; + recv_data >> seatId; + + if (vehicle_base->GetGUID() != guid) + return; + + if (!accessory) + GetPlayer()->ChangeSeat(-1, seatId > 0); // prev/next + else if (Unit *vehUnit = Unit::GetUnit(*GetPlayer(), accessory)) + { + if (Vehicle *vehicle = vehUnit->GetVehicleKit()) + if (vehicle->HasEmptySeat(seatId)) + vehUnit->HandleSpellClick(GetPlayer(), seatId); + } + break; + } + case CMSG_REQUEST_VEHICLE_SWITCH_SEAT: + { + uint64 guid; // current vehicle guid + recv_data.readPackGUID(guid); + + int8 seatId; + recv_data >> seatId; + + if (vehicle_base->GetGUID() == guid) + GetPlayer()->ChangeSeat(seatId); + else if (Unit *vehUnit = Unit::GetUnit(*GetPlayer(), guid)) + if (Vehicle *vehicle = vehUnit->GetVehicleKit()) + if (vehicle->HasEmptySeat(seatId)) + vehUnit->HandleSpellClick(GetPlayer(), seatId); + break; + } + default: + break; + } +} + +void WorldSession::HandleEnterPlayerVehicle(WorldPacket &data) +{ + // Read guid + uint64 guid; + data >> guid; + + if (Player* pl = ObjectAccessor::FindPlayer(guid)) + { + if (!pl->GetVehicleKit()) + return; + if (!pl->IsInRaidWith(_player)) + return; + if (!pl->IsWithinDistInMap(_player, INTERACTION_DISTANCE)) + return; + + _player->EnterVehicle(pl); + } +} + +void WorldSession::HandleEjectPassenger(WorldPacket &data) +{ + Vehicle* vehicle = _player->GetVehicleKit(); + if (!vehicle) + { + data.rfinish(); // prevent warnings spam + sLog->outError("HandleEjectPassenger: Player %u is not in a vehicle!", GetPlayer()->GetGUIDLow()); + return; + } + + uint64 guid; + data >> guid; + + if (IS_PLAYER_GUID(guid)) + { + Player *plr = ObjectAccessor::FindPlayer(guid); + if (!plr) + { + sLog->outError("Player %u tried to eject player %u from vehicle, but the latter was not found in world!", GetPlayer()->GetGUIDLow(), GUID_LOPART(guid)); + return; + } + + if (!plr->IsOnVehicle(vehicle->GetBase())) + { + sLog->outError("Player %u tried to eject player %u, but they are not in the same vehicle", GetPlayer()->GetGUIDLow(), GUID_LOPART(guid)); + return; + } + + VehicleSeatEntry const* seat = vehicle->GetSeatForPassenger(plr); + ASSERT(seat); + if (seat->IsEjectable()) + plr->ExitVehicle(); + else + sLog->outError("Player %u attempted to eject player %u from non-ejectable seat.", GetPlayer()->GetGUIDLow(), GUID_LOPART(guid)); + } + + else if (IS_CREATURE_GUID(guid)) + { + Unit *unit = ObjectAccessor::GetUnit(*_player, guid); + if (!unit) // creatures can be ejected too from player mounts + { + sLog->outError("Player %u tried to eject creature guid %u from vehicle, but the latter was not found in world!", GetPlayer()->GetGUIDLow(), GUID_LOPART(guid)); + return; + } + + if (!unit->IsOnVehicle(vehicle->GetBase())) + { + sLog->outError("Player %u tried to eject unit %u, but they are not in the same vehicle", GetPlayer()->GetGUIDLow(), GUID_LOPART(guid)); + return; + } + + VehicleSeatEntry const* seat = vehicle->GetSeatForPassenger(unit); + ASSERT(seat); + if (seat->IsEjectable()) + { + ASSERT(GetPlayer() == vehicle->GetBase()); + unit->ExitVehicle(); + } + else + sLog->outError("Player %u attempted to eject creature GUID %u from non-ejectable seat.", GetPlayer()->GetGUIDLow(), GUID_LOPART(guid)); + } + else + sLog->outError("HandleEjectPassenger: Player %u tried to eject invalid GUID "UI64FMTD, GetPlayer()->GetGUIDLow(), guid); +} + +void WorldSession::HandleRequestVehicleExit(WorldPacket &recv_data) +{ + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_REQUEST_VEHICLE_EXIT"); + recv_data.hexlike(); + + if (Vehicle* vehicle = GetPlayer()->GetVehicle()) + { + if (VehicleSeatEntry const* seat = vehicle->GetSeatForPassenger(GetPlayer())) + { + if (seat->CanEnterOrExit()) + GetPlayer()->ExitVehicle(); + else + sLog->outError("Player %u tried to exit vehicle, but seatflags %u (ID: %u) don't permit that.", + GetPlayer()->GetGUIDLow(), seat->m_ID, seat->m_flags); + } + } +} diff --git a/src/server/game/Server/Protocol/Handlers/VoiceChatHandler.cpp b/src/server/game/Server/Protocol/Handlers/VoiceChatHandler.cpp index 1a926ca54aef7..e2b5fe96ae196 100755 --- a/src/server/game/Server/Protocol/Handlers/VoiceChatHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/VoiceChatHandler.cpp @@ -24,7 +24,7 @@ void WorldSession::HandleVoiceSessionEnableOpcode(WorldPacket & recv_data) { - sLog->outDebug("WORLD: CMSG_VOICE_SESSION_ENABLE"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_VOICE_SESSION_ENABLE"); // uint8 isVoiceEnabled, uint8 isMicrophoneEnabled recv_data.read_skip(); recv_data.read_skip(); @@ -33,14 +33,14 @@ void WorldSession::HandleVoiceSessionEnableOpcode(WorldPacket & recv_data) void WorldSession::HandleChannelVoiceOnOpcode(WorldPacket & recv_data) { - sLog->outDebug("WORLD: CMSG_CHANNEL_VOICE_ON"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CHANNEL_VOICE_ON"); // Enable Voice button in channel context menu recv_data.hexlike(); } void WorldSession::HandleSetActiveVoiceChannel(WorldPacket & recv_data) { - sLog->outDebug("WORLD: CMSG_SET_ACTIVE_VOICE_CHANNEL"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_SET_ACTIVE_VOICE_CHANNEL"); recv_data.read_skip(); recv_data.read_skip(); recv_data.hexlike(); diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index f73288feeb793..7ba68d1b573aa 100755 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -684,7 +684,7 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] = /*0x28F*/ { "CMSG_GROUP_ASSISTANT_LEADER", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupAssistantLeaderOpcode}, /*0x290*/ { "CMSG_BUYBACK_ITEM", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuybackItem }, /*0x291*/ { "SMSG_SERVER_MESSAGE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x292*/ { "CMSG_SET_SAVED_INSTANCE_EXTEND", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, + /*0x292*/ { "CMSG_SET_SAVED_INSTANCE_EXTEND", STATUS_UNHANDLED,PROCESS_INPLACE, &WorldSession::Handle_NULL }, /*0x293*/ { "SMSG_LFG_OFFER_CONTINUE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, /*0x294*/ { "CMSG_MEETINGSTONE_CHEAT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, /*0x295*/ { "SMSG_MEETINGSTONE_SETQUEUE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index 7a0e3a6b51ce3..d4e34ad870f59 100755 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -189,12 +189,11 @@ void WorldSession::QueuePacket(WorldPacket *new_packet) } /// Logging helper for unexpected opcodes -void WorldSession::LogUnexpectedOpcode(WorldPacket *packet, const char *reason) +void WorldSession::LogUnexpectedOpcode(WorldPacket *packet, const char* status, const char *reason) { - sLog->outError("SESSION: received unexpected opcode %s (0x%.4X) %s", - LookupOpcodeName(packet->GetOpcode()), - packet->GetOpcode(), - reason); + sLog->outError("SESSION (account: %u, guidlow: %u, char: %s): received unexpected opcode %s (0x%.4X, status: %s) %s", + GetAccountId(), m_GUIDLow, _player ? _player->GetName() : "", + LookupOpcodeName(packet->GetOpcode()), packet->GetOpcode(), status, reason); } /// Logging helper for unexpected opcodes @@ -238,7 +237,7 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater) { // skip STATUS_LOGGEDIN opcode unexpected errors if player logout sometime ago - this can be network lag delayed packets if (!m_playerRecentlyLogout) - LogUnexpectedOpcode(packet, "the player has not logged in yet"); + LogUnexpectedOpcode(packet, "STATUS_LOGGEDIN", "the player has not logged in yet"); } else if (_player->IsInWorld()) { @@ -251,7 +250,8 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater) break; case STATUS_LOGGEDIN_OR_RECENTLY_LOGGOUT: if (!_player && !m_playerRecentlyLogout) - LogUnexpectedOpcode(packet, "the player has not logged in yet and not recently logout"); + LogUnexpectedOpcode(packet, "STATUS_LOGGEDIN_OR_RECENTLY_LOGGOUT", + "the player has not logged in yet and not recently logout"); else { // not expected _player or must checked in packet hanlder @@ -263,9 +263,9 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater) break; case STATUS_TRANSFER: if (!_player) - LogUnexpectedOpcode(packet, "the player has not logged in yet"); + LogUnexpectedOpcode(packet, "STATUS_TRANSFER", "the player has not logged in yet"); else if (_player->IsInWorld()) - LogUnexpectedOpcode(packet, "the player is still in world"); + LogUnexpectedOpcode(packet, "STATUS_TRANSFER", "the player is still in world"); else { sScriptMgr->OnPacketReceive(m_Socket, WorldPacket(*packet)); @@ -278,7 +278,7 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater) // prevent cheating with skip queue wait if (m_inQueue) { - LogUnexpectedOpcode(packet, "the player not pass queue yet"); + LogUnexpectedOpcode(packet, "STATUS_AUTHED", "the player not pass queue yet"); break; } @@ -293,10 +293,14 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater) LogUnprocessedTail(packet); break; case STATUS_NEVER: - sLog->outError("SESSION: received not allowed opcode %s (0x%.4X)", LookupOpcodeName(packet->GetOpcode()), packet->GetOpcode()); + sLog->outError("SESSION (account: %u, guidlow: %u, char: %s): received not allowed opcode %s (0x%.4X)", + GetAccountId(), m_GUIDLow, _player ? _player->GetName() : "", + LookupOpcodeName(packet->GetOpcode()), packet->GetOpcode()); break; case STATUS_UNHANDLED: - sLog->outDebug("SESSION: received not handled opcode %s (0x%.4X)", LookupOpcodeName(packet->GetOpcode()), packet->GetOpcode()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "SESSION (account: %u, guidlow: %u, char: %s): received not handled opcode %s (0x%.4X)", + GetAccountId(), m_GUIDLow, _player ? _player->GetName() : "", + LookupOpcodeName(packet->GetOpcode()), packet->GetOpcode()); break; } } @@ -306,7 +310,7 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater) packet->GetOpcode(), GetRemoteAddress().c_str(), GetAccountId()); if (sLog->IsOutDebug()) { - sLog->outDebug("Dumping error causing packet:"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Dumping error causing packet:"); packet->hexlike(); } } @@ -496,7 +500,7 @@ void WorldSession::LogoutPlayer(bool Save) ///- Since each account can only have one online character at any given time, ensure all characters for active account are marked as offline //No SQL injection as AccountId is uint32 CharacterDatabase.PExecute("UPDATE characters SET online = 0 WHERE account = '%u'", GetAccountId()); - sLog->outDebug("SESSION: Sent SMSG_LOGOUT_COMPLETE Message"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "SESSION: Sent SMSG_LOGOUT_COMPLETE Message"); } m_playerLogout = false; @@ -592,7 +596,7 @@ void WorldSession::SendAuthWaitQue(uint32 position) void WorldSession::LoadGlobalAccountData() { - PreparedStatement *stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_ACCOUNT_DATA); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_ACCOUNT_DATA); stmt->setUInt32(0, GetAccountId()); LoadAccountData(CharacterDatabase.Query(stmt), GLOBAL_CACHE_MASK); } @@ -628,17 +632,14 @@ void WorldSession::LoadAccountData(PreparedQueryResult result, uint32 mask) while (result->NextRow()); } -void WorldSession::SetAccountData(AccountDataType type, time_t time_, std::string data) +void WorldSession::SetAccountData(AccountDataType type, time_t tm, std::string data) { + uint32 id = 0; + uint32 index = 0; if ((1 << type) & GLOBAL_CACHE_MASK) { - uint32 acc = GetAccountId(); - - SQLTransaction trans = CharacterDatabase.BeginTransaction(); - trans->PAppend("DELETE FROM account_data WHERE account='%u' AND type='%u'", acc, type); - CharacterDatabase.escape_string(data); - trans->PAppend("INSERT INTO account_data VALUES ('%u','%u','%u','%s')", acc, type, (uint32)time_, data.c_str()); - CharacterDatabase.CommitTransaction(trans); + id = GetAccountId(); + index = CHAR_SET_ACCOUNT_DATA; } else { @@ -646,14 +647,18 @@ void WorldSession::SetAccountData(AccountDataType type, time_t time_, std::strin if (!m_GUIDLow) return; - SQLTransaction trans = CharacterDatabase.BeginTransaction(); - trans->PAppend("DELETE FROM character_account_data WHERE guid='%u' AND type='%u'", m_GUIDLow, type); - CharacterDatabase.escape_string(data); - trans->PAppend("INSERT INTO character_account_data VALUES ('%u','%u','%u','%s')", m_GUIDLow, type, (uint32)time_, data.c_str()); - CharacterDatabase.CommitTransaction(trans); + id = m_GUIDLow; + index = CHAR_SET_PLAYER_ACCOUNT_DATA; } - m_accountData[type].Time = time_; + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(index); + stmt->setUInt32(0, id); + stmt->setUInt8 (1, type); + stmt->setUInt32(2, uint32(tm)); + stmt->setString(3, data); + CharacterDatabase.Execute(stmt); + + m_accountData[type].Time = tm; m_accountData[type].Data = data; } @@ -671,30 +676,21 @@ void WorldSession::SendAccountDataTimes(uint32 mask) void WorldSession::LoadTutorialsData() { - for (int aX = 0; aX < MAX_CHARACTER_TUTORIAL_VALUES; ++aX) - m_Tutorials[ aX ] = 0; - - // is there a good reason why this isn't a prepared statement? - QueryResult result = CharacterDatabase.PQuery("SELECT tut0, tut1, tut2, tut3, tut4, tut5, tut6, tut7 FROM character_tutorial WHERE account = '%u'", GetAccountId()); + memset(m_Tutorials, 0, sizeof(uint32) * MAX_ACCOUNT_TUTORIAL_VALUES); - if (result) - { - do - { - Field *fields = result->Fetch(); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_TUTORIALS); + stmt->setUInt32(0, GetAccountId()); + if (PreparedQueryResult result = CharacterDatabase.Query(stmt)) + for (uint8 i = 0; i < MAX_ACCOUNT_TUTORIAL_VALUES; ++i) + m_Tutorials[i] = (*result)[i].GetUInt32(); - for (int iI = 0; iI < MAX_CHARACTER_TUTORIAL_VALUES; ++iI) - m_Tutorials[iI] = fields[iI].GetUInt32(); - } - while (result->NextRow()); - } m_TutorialsChanged = false; } void WorldSession::SendTutorialsData() { - WorldPacket data(SMSG_TUTORIAL_FLAGS, 4 * MAX_CHARACTER_TUTORIAL_VALUES); - for (uint32 i = 0; i < MAX_CHARACTER_TUTORIAL_VALUES; ++i) + WorldPacket data(SMSG_TUTORIAL_FLAGS, 4 * MAX_ACCOUNT_TUTORIAL_VALUES); + for (uint8 i = 0; i < MAX_ACCOUNT_TUTORIAL_VALUES; ++i) data << m_Tutorials[i]; SendPacket(&data); } @@ -704,19 +700,15 @@ void WorldSession::SaveTutorialsData(SQLTransaction &trans) if (!m_TutorialsChanged) return; - // should these be prepared as well? - - uint32 Rows = 0; - // it's better than rebuilding indexes multiple times - QueryResult result = CharacterDatabase.PQuery("SELECT count(*) AS r FROM character_tutorial WHERE account = '%u'", GetAccountId()); - if (result) - Rows = result->Fetch()[0].GetUInt32(); - - if (Rows) - trans->PAppend("UPDATE character_tutorial SET tut0='%u', tut1='%u', tut2='%u', tut3='%u', tut4='%u', tut5='%u', tut6='%u', tut7='%u' WHERE account = '%u'", - m_Tutorials[0], m_Tutorials[1], m_Tutorials[2], m_Tutorials[3], m_Tutorials[4], m_Tutorials[5], m_Tutorials[6], m_Tutorials[7], GetAccountId()); - else - trans->PAppend("INSERT INTO character_tutorial (account, tut0, tut1, tut2, tut3, tut4, tut5, tut6, tut7) VALUES ('%u', '%u', '%u', '%u', '%u', '%u', '%u', '%u', '%u')", GetAccountId(), m_Tutorials[0], m_Tutorials[1], m_Tutorials[2], m_Tutorials[3], m_Tutorials[4], m_Tutorials[5], m_Tutorials[6], m_Tutorials[7]); + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_GET_HAS_TUTORIALS); + stmt->setUInt32(0, GetAccountId()); + bool hasTutorials = (CharacterDatabase.Query(stmt) != NULL); + // Modify data in DB + stmt = CharacterDatabase.GetPreparedStatement(hasTutorials ? CHAR_SET_TUTORIALS : CHAR_ADD_TUTORIALS); + for (uint8 i = 0; i < MAX_ACCOUNT_TUTORIAL_VALUES; ++i) + stmt->setUInt32(i, m_Tutorials[i]); + stmt->setUInt32(MAX_ACCOUNT_TUTORIAL_VALUES, GetAccountId()); + trans->Append(stmt); m_TutorialsChanged = false; } @@ -779,7 +771,7 @@ void WorldSession::WriteMovementInfo(WorldPacket *data, MovementInfo *mi) *data << mi->t_seat; } - if (mi->HasMovementFlag(MovementFlags(MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_FLYING)) && mi->HasExtraMovementFlag(MOVEMENTFLAG2_ALWAYS_ALLOW_PITCHING)) + if (mi->HasMovementFlag(MovementFlags(MOVEMENTFLAG_SWIMMING | MOVEMENTFLAG_FLYING)) || mi->HasExtraMovementFlag(MOVEMENTFLAG2_ALWAYS_ALLOW_PITCHING)) *data << mi->pitch; *data << mi->fallTime; @@ -868,10 +860,10 @@ void WorldSession::ReadAddonsInfo(WorldPacket &data) uint32 currentTime; addonInfo >> currentTime; - sLog->outDebug("ADDON: CurrentTime: %u", currentTime); + sLog->outDebug(LOG_FILTER_NETWORKIO, "ADDON: CurrentTime: %u", currentTime); if (addonInfo.rpos() != addonInfo.size()) - sLog->outDebug("packet under-read!"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "packet under-read!"); } else sLog->outError("Addon packet uncompress error!"); diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index 926b0ac32e90d..59ff2bc3e085f 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -278,23 +278,20 @@ class WorldSession // Account Data AccountData *GetAccountData(AccountDataType type) { return &m_accountData[type]; } - void SetAccountData(AccountDataType type, time_t time_, std::string data); + void SetAccountData(AccountDataType type, time_t tm, std::string data); void SendAccountDataTimes(uint32 mask); void LoadGlobalAccountData(); void LoadAccountData(PreparedQueryResult result, uint32 mask); + void LoadTutorialsData(); void SendTutorialsData(); void SaveTutorialsData(SQLTransaction& trans); - uint32 GetTutorialInt(uint32 intId) - { - return m_Tutorials[intId]; - } - - void SetTutorialInt(uint32 intId, uint32 value) + uint32 GetTutorialInt(uint8 index) { return m_Tutorials[index]; } + void SetTutorialInt(uint8 index, uint32 value) { - if (m_Tutorials[intId] != value) + if (m_Tutorials[index] != value) { - m_Tutorials[intId] = value; + m_Tutorials[index] = value; m_TutorialsChanged = true; } } @@ -882,7 +879,7 @@ class WorldSession void moveItems(Item* myItems[], Item* hisItems[]); // logging helper - void LogUnexpectedOpcode(WorldPacket *packet, const char * reason); + void LogUnexpectedOpcode(WorldPacket *packet, const char* status, const char *reason); void LogUnprocessedTail(WorldPacket *packet); uint32 m_GUIDLow; // set loggined or recently logout player (while m_playerRecentlyLogout set) @@ -904,7 +901,7 @@ class WorldSession LocaleConstant m_sessionDbLocaleIndex; uint32 m_latency; AccountData m_accountData[NUM_ACCOUNT_DATA_TYPES]; - uint32 m_Tutorials[MAX_CHARACTER_TUTORIAL_VALUES]; + uint32 m_Tutorials[MAX_ACCOUNT_TUTORIAL_VALUES]; bool m_TutorialsChanged; AddonsList m_addonsList; uint32 recruiterId; diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp index 084eade755535..f1ea340cd4b23 100755 --- a/src/server/game/Server/WorldSocket.cpp +++ b/src/server/game/Server/WorldSocket.cpp @@ -61,7 +61,7 @@ struct ServerPktHeader uint8 headerIndex=0; if (isLargePacket()) { - sLog->outDebug("initializing large server to client packet. Size: %u, cmd: %u", size, cmd); + sLog->outDebug(LOG_FILTER_NETWORKIO, "initializing large server to client packet. Size: %u, cmd: %u", size, cmd); header[headerIndex++] = 0x80|(0xFF &(size>>16)); } header[headerIndex++] = 0xFF &(size>>8); @@ -494,8 +494,12 @@ int WorldSocket::handle_input_header (void) if ((header.size < 4) || (header.size > 10240) || (header.cmd > 10240)) { - sLog->outError ("WorldSocket::handle_input_header: client sent malformed packet size = %d , cmd = %d", - header.size, header.cmd); + Player *_player = m_Session ? m_Session->GetPlayer() : NULL; + sLog->outError ("WorldSocket::handle_input_header(): client (account: %u, char [GUID: %u, name: %s]) sent malformed packet (size: %d , cmd: %d)", + m_Session ? m_Session->GetAccountId() : 0, + _player ? _player->GetGUIDLow() : 0, + _player ? _player->GetName() : "", + header.size, header.cmd); errno = EINVAL; return -1; @@ -751,7 +755,7 @@ int WorldSocket::ProcessIncoming (WorldPacket* new_pct) opcode, GetRemoteAddress().c_str(), m_Session?m_Session->GetAccountId():-1); if (sLog->IsOutDebug()) { - sLog->outDebug("Dumping error causing packet:"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Dumping error causing packet:"); new_pct->hexlike(); } @@ -930,7 +934,7 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket) // Check locked state for server AccountTypes allowedAccountType = sWorld->GetPlayerSecurityLimit(); - sLog->outDebug("Allowed Level: %u Player Level %u", allowedAccountType, AccountTypes(security)); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Allowed Level: %u Player Level %u", allowedAccountType, AccountTypes(security)); if (allowedAccountType > SEC_PLAYER && AccountTypes(security) < allowedAccountType) { WorldPacket Packet (SMSG_AUTH_RESPONSE, 1); @@ -1030,9 +1034,12 @@ int WorldSocket::HandlePing (WorldPacket& recvPacket) if (m_Session && m_Session->GetSecurity() == SEC_PLAYER) { - sLog->outError ("WorldSocket::HandlePing: Player kicked for " - "over-speed pings address = %s", - GetRemoteAddress().c_str()); + Player* _player = m_Session->GetPlayer(); + sLog->outError("WorldSocket::HandlePing: Player (account: %u, GUID: %u, name: %s) kicked for over-speed pings (address: %s)", + m_Session->GetAccountId(), + _player ? _player->GetGUIDLow() : 0, + _player ? _player->GetName() : "", + GetRemoteAddress().c_str()); return -1; } diff --git a/src/server/game/Skills/SkillDiscovery.cpp b/src/server/game/Skills/SkillDiscovery.cpp index c75d34079b695..973d37b90cc69 100755 --- a/src/server/game/Skills/SkillDiscovery.cpp +++ b/src/server/game/Skills/SkillDiscovery.cpp @@ -70,7 +70,7 @@ void LoadSkillDiscoveryTable() uint32 spellId = fields[0].GetUInt32(); int32 reqSkillOrSpell = fields[1].GetInt32(); - uint32 reqSkillValue = fields[2].GetInt32(); + uint32 reqSkillValue = fields[2].GetUInt32(); float chance = fields[3].GetFloat(); if (chance <= 0) // chance @@ -82,13 +82,14 @@ void LoadSkillDiscoveryTable() if (reqSkillOrSpell > 0) // spell case { - SpellEntry const* reqSpellEntry = sSpellStore.LookupEntry(reqSkillOrSpell); + uint32 absReqSkillOrSpell = uint32(reqSkillOrSpell); + SpellEntry const* reqSpellEntry = sSpellStore.LookupEntry(absReqSkillOrSpell); if (!reqSpellEntry) { - if (reportedReqSpells.find(reqSkillOrSpell) == reportedReqSpells.end()) + if (reportedReqSpells.find(absReqSkillOrSpell) == reportedReqSpells.end()) { sLog->outErrorDb("Spell (ID: %u) have not existed spell (ID: %i) in `reqSpell` field in `skill_discovery_template` table",spellId,reqSkillOrSpell); - reportedReqSpells.insert(reqSkillOrSpell); + reportedReqSpells.insert(absReqSkillOrSpell); } continue; } @@ -98,12 +99,12 @@ void LoadSkillDiscoveryTable() // explicit discovery ability !IsExplicitDiscoverySpell(reqSpellEntry)) { - if (reportedReqSpells.find(reqSkillOrSpell) == reportedReqSpells.end()) + if (reportedReqSpells.find(absReqSkillOrSpell) == reportedReqSpells.end()) { sLog->outErrorDb("Spell (ID: %u) not have MECHANIC_DISCOVERY (28) value in Mechanic field in spell.dbc" " and not 100%% chance random discovery ability but listed for spellId %u (and maybe more) in `skill_discovery_template` table", - reqSkillOrSpell,spellId); - reportedReqSpells.insert(reqSkillOrSpell); + absReqSkillOrSpell, spellId); + reportedReqSpells.insert(absReqSkillOrSpell); } continue; } @@ -146,7 +147,7 @@ void LoadSkillDiscoveryTable() if (!IsExplicitDiscoverySpell(spellEntry)) continue; - if (SkillDiscoveryStore.find(spell_id) == SkillDiscoveryStore.end()) + if (SkillDiscoveryStore.find(int32(spell_id)) == SkillDiscoveryStore.end()) sLog->outErrorDb("Spell (ID: %u) is 100%% chance random discovery ability but not have data in `skill_discovery_template` table",spell_id); } @@ -158,12 +159,12 @@ uint32 GetExplicitDiscoverySpell(uint32 spellId, Player* player) { // explicit discovery spell chances (always success if case exist) // in this case we have both skill and spell - SkillDiscoveryMap::const_iterator tab = SkillDiscoveryStore.find(spellId); + SkillDiscoveryMap::const_iterator tab = SkillDiscoveryStore.find(int32(spellId)); if (tab == SkillDiscoveryStore.end()) return 0; SkillLineAbilityMapBounds bounds = sSpellMgr->GetSkillLineAbilityMapBounds(spellId); - uint32 skillvalue = bounds.first != bounds.second ? player->GetSkillValue(bounds.first->second->skillId) : 0; + uint32 skillvalue = bounds.first != bounds.second ? player->GetSkillValue(bounds.first->second->skillId) : uint32(0); float full_chance = 0; for (SkillDiscoveryList::const_iterator item_iter = tab->second.begin(); item_iter != tab->second.end(); ++item_iter) @@ -191,12 +192,25 @@ uint32 GetExplicitDiscoverySpell(uint32 spellId, Player* player) return 0; } +bool HasDiscoveredAllSpells(uint32 spellId, Player* player) +{ + SkillDiscoveryMap::const_iterator tab = SkillDiscoveryStore.find(int32(spellId)); + if (tab == SkillDiscoveryStore.end()) + return true; + + for (SkillDiscoveryList::const_iterator item_iter = tab->second.begin(); item_iter != tab->second.end(); ++item_iter) + if (!player->HasSpell(item_iter->spellId)) + return false; + + return true; +} + uint32 GetSkillDiscoverySpell(uint32 skillId, uint32 spellId, Player* player) { - uint32 skillvalue = skillId ? player->GetSkillValue(skillId) : 0; + uint32 skillvalue = skillId ? player->GetSkillValue(skillId) : uint32(0); // check spell case - SkillDiscoveryMap::const_iterator tab = SkillDiscoveryStore.find(spellId); + SkillDiscoveryMap::const_iterator tab = SkillDiscoveryStore.find(int32(spellId)); if (tab != SkillDiscoveryStore.end()) { diff --git a/src/server/game/Skills/SkillDiscovery.h b/src/server/game/Skills/SkillDiscovery.h index da9a96c4bd9aa..ae4f3494534eb 100755 --- a/src/server/game/Skills/SkillDiscovery.h +++ b/src/server/game/Skills/SkillDiscovery.h @@ -25,6 +25,7 @@ class Player; void LoadSkillDiscoveryTable(); uint32 GetSkillDiscoverySpell(uint32 skillId, uint32 spellId, Player* player); +bool HasDiscoveredAllSpells(uint32 spellId, Player* player); uint32 GetExplicitDiscoverySpell(uint32 spellId, Player* player); #endif diff --git a/src/server/game/Spells/Auras/SpellAuraDefines.h b/src/server/game/Spells/Auras/SpellAuraDefines.h index f597ce35ffe2d..d731915bbb57e 100755 --- a/src/server/game/Spells/Auras/SpellAuraDefines.h +++ b/src/server/game/Spells/Auras/SpellAuraDefines.h @@ -217,7 +217,7 @@ enum AuraType SPELL_AURA_MOD_AOE_AVOIDANCE = 160, SPELL_AURA_MOD_HEALTH_REGEN_IN_COMBAT = 161, SPELL_AURA_POWER_BURN_MANA = 162, - SPELL_AURA_MOD_CRIT_DAMAGE_BONUS_MELEE = 163, + SPELL_AURA_MOD_CRIT_DAMAGE_BONUS = 163, SPELL_AURA_164 = 164, SPELL_AURA_MELEE_ATTACK_POWER_ATTACKER_BONUS = 165, SPELL_AURA_MOD_ATTACK_POWER_PCT = 166, diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index bca23b333bb0f..141ff84653536 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -215,7 +215,7 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]= &AuraEffect::HandleNoImmediateEffect, //160 SPELL_AURA_MOD_AOE_AVOIDANCE implemented in Unit::MagicSpellHitResult &AuraEffect::HandleNoImmediateEffect, //161 SPELL_AURA_MOD_HEALTH_REGEN_IN_COMBAT &AuraEffect::HandleNoImmediateEffect, //162 SPELL_AURA_POWER_BURN_MANA implemented in AuraEffect::PeriodicTick - &AuraEffect::HandleNoImmediateEffect, //163 SPELL_AURA_MOD_CRIT_DAMAGE_BONUS_MELEE + &AuraEffect::HandleNoImmediateEffect, //163 SPELL_AURA_MOD_CRIT_DAMAGE_BONUS &AuraEffect::HandleUnused, //164 unused (3.2.0), only one test spell &AuraEffect::HandleNoImmediateEffect, //165 SPELL_AURA_MELEE_ATTACK_POWER_ATTACKER_BONUS implemented in Unit::MeleeDamageBonus &AuraEffect::HandleAuraModAttackPowerPercent, //166 SPELL_AURA_MOD_ATTACK_POWER_PCT @@ -699,7 +699,7 @@ int32 AuraEffect::CalculateAmount(Unit * caster) { if (caster->GetTypeId() == TYPEID_PLAYER) { - int32 value = (-1 * amount) - 10; + int32 value = (-1 * amount); uint32 defva = uint32(caster->ToPlayer()->GetSkillValue(SKILL_DEFENSE) + caster->ToPlayer()->GetRatingBonusValue(CR_DEFENSE_SKILL)); if (defva > 400) @@ -1402,7 +1402,11 @@ void AuraEffect::PeriodicTick(AuraApplication * aurApp, Unit * caster) const SpellPeriodicAuraLogInfo pInfo(this, damage, overkill, absorb, resist, 0.0f, crit); target->SendPeriodicAuraLog(&pInfo); - caster->ProcDamageAndSpell(target, procAttacker, procVictim, procEx, damage, BASE_ATTACK, GetSpellProto()); + // Rend should not proc anything from absorbs + if (GetSpellProto()->SpellFamilyName == SPELLFAMILY_WARRIOR && GetSpellProto()->SpellFamilyFlags[0] & 0x20) + caster->ProcDamageAndSpell(target, procAttacker, procVictim, procEx, damage, BASE_ATTACK, GetSpellProto()); + else + caster->ProcDamageAndSpell(target, procAttacker, procVictim, procEx, damage + absorb, BASE_ATTACK, GetSpellProto()); caster->DealDamage(target, damage, &cleanDamage, DOT, GetSpellSchoolMask(GetSpellProto()), GetSpellProto(), true); break; @@ -1476,7 +1480,7 @@ void AuraEffect::PeriodicTick(AuraApplication * aurApp, Unit * caster) const damage = (damage <= absorb+resist) ? 0 : (damage-absorb-resist); if (damage) procVictim|=PROC_FLAG_TAKEN_DAMAGE; - caster->ProcDamageAndSpell(target, procAttacker, procVictim, procEx, damage, BASE_ATTACK, GetSpellProto()); + caster->ProcDamageAndSpell(target, procAttacker, procVictim, procEx, damage + absorb, BASE_ATTACK, GetSpellProto()); int32 new_damage = caster->DealDamage(target, damage, &cleanDamage, DOT, GetSpellSchoolMask(GetSpellProto()), GetSpellProto(), false); if (!target->isAlive() && caster->IsNonMeleeSpellCasted(false)) @@ -1516,7 +1520,7 @@ void AuraEffect::PeriodicTick(AuraApplication * aurApp, Unit * caster) const //donator->SendSpellNonMeleeDamageLog(donator, GetId(), damage, GetSpellSchoolMask(spellProto), 0, 0, false, 0); caster->ModifyHealth(-(int32)damage); - sLog->outDebug("PeriodicTick: donator %u target %u damage %u.", target->GetEntry(), target->GetEntry(), damage); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "PeriodicTick: donator %u target %u damage %u.", target->GetEntry(), target->GetEntry(), damage); float gainMultiplier = SpellMgr::CalculateSpellEffectValueMultiplier(GetSpellProto(), GetEffIndex(), caster); @@ -1554,33 +1558,35 @@ void AuraEffect::PeriodicTick(AuraApplication * aurApp, Unit * caster) const { // Taken mods float TakenTotalMod = 1.0f; + float NegativeTakenTotalMod = 1.0f; // Tenacity increase healing % taken if (AuraEffect const* Tenacity = target->GetAuraEffect(58549, 0)) - AddFlatPctN(TakenTotalMod, Tenacity->GetAmount()); + AddFlatPctN(TakenTotalMod, NegativeTakenTotalMod, Tenacity->GetAmount()); // Healing taken percent float minval = (float)target->GetMaxNegativeAuraModifier(SPELL_AURA_MOD_HEALING_PCT); if (minval) - AddFlatPctF(TakenTotalMod, minval); + AddFlatPctF(TakenTotalMod, NegativeTakenTotalMod, minval); float maxval = (float)target->GetMaxPositiveAuraModifier(SPELL_AURA_MOD_HEALING_PCT); if (maxval) - AddFlatPctF(TakenTotalMod, maxval); + AddFlatPctF(TakenTotalMod, NegativeTakenTotalMod, maxval); // Healing over time taken percent float minval_hot = (float)target->GetMaxNegativeAuraModifier(SPELL_AURA_MOD_HOT_PCT); if (minval_hot) - AddFlatPctF(TakenTotalMod, minval_hot); + AddFlatPctF(TakenTotalMod, NegativeTakenTotalMod, minval_hot); float maxval_hot = (float)target->GetMaxPositiveAuraModifier(SPELL_AURA_MOD_HOT_PCT); if (maxval_hot) - AddFlatPctF(TakenTotalMod, maxval_hot); + AddFlatPctF(TakenTotalMod, NegativeTakenTotalMod, maxval_hot); TakenTotalMod = std::max(TakenTotalMod, 0.0f); + NegativeTakenTotalMod = std::max(NegativeTakenTotalMod, 0.0f); damage = uint32(target->CountPctFromMaxHealth(damage)); - damage = uint32(damage * TakenTotalMod); + damage = uint32(damage * TakenTotalMod * NegativeTakenTotalMod); } else { @@ -1617,7 +1623,7 @@ void AuraEffect::PeriodicTick(AuraApplication * aurApp, Unit * caster) const uint32 procEx = PROC_EX_NORMAL_HIT | PROC_EX_INTERNAL_HOT; // ignore item heals if (!haveCastItem) - caster->ProcDamageAndSpell(target, procAttacker, procVictim, procEx, damage, BASE_ATTACK, GetSpellProto()); + caster->ProcDamageAndSpell(target, procAttacker, procVictim, procEx, damage + absorb, BASE_ATTACK, GetSpellProto()); break; } case SPELL_AURA_PERIODIC_MANA_LEECH: @@ -1862,7 +1868,7 @@ void AuraEffect::PeriodicTick(AuraApplication * aurApp, Unit * caster) const if (damageInfo.damage) procVictim|=PROC_FLAG_TAKEN_DAMAGE; - caster->ProcDamageAndSpell(damageInfo.target, procAttacker, procVictim, procEx, damageInfo.damage, BASE_ATTACK, spellProto); + caster->ProcDamageAndSpell(damageInfo.target, procAttacker, procVictim, procEx, damageInfo.damage + damageInfo.absorb, BASE_ATTACK, spellProto); caster->DealSpellDamage(&damageInfo, true); break; @@ -1957,6 +1963,26 @@ void AuraEffect::PeriodicDummyTick(Unit * target, Unit * caster) const target->RemoveAura(64821); } break; + case 63802: // Brain Link + if (caster) + { + std::list unitList; + target->GetRaidMember(unitList, 80); + for (std::list::iterator itr = unitList.begin(); itr != unitList.end(); ++itr) + { + Unit* pUnit = *itr; + if (!pUnit || pUnit == target || !pUnit->HasAura(63802)) + continue; + + // Afflicted targets suffer Shadow damage whenever they are more than 20 yards apart + if (target->IsWithinDist(pUnit, 20)) + target->CastSpell(pUnit, 63804, true, 0, 0); + else + target->CastSpell(pUnit, 63803, true, 0, 0); + return; + } + } + break; } break; case SPELLFAMILY_MAGE: @@ -2438,7 +2464,7 @@ void AuraEffect::TriggerSpell(Unit * target, Unit * caster) const { Unit * triggerCaster = GetTriggeredSpellCaster(triggeredSpellInfo, caster, triggerTarget); triggerCaster->CastSpell(triggerTarget, triggeredSpellInfo, true, NULL, this); - sLog->outDebug("AuraEffect::TriggerSpell: Spell %u Trigger %u", GetId(), triggeredSpellInfo->Id); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "AuraEffect::TriggerSpell: Spell %u Trigger %u", GetId(), triggeredSpellInfo->Id); } else { @@ -4254,7 +4280,7 @@ void AuraEffect::HandleAuraControlVehicle(AuraApplication const * aurApp, uint8 if (apply) { - caster->EnterVehicle(target->GetVehicleKit(), m_amount - 1, aurApp); + caster->_EnterVehicle(target->GetVehicleKit(), m_amount - 1, aurApp); } else { @@ -4267,7 +4293,7 @@ void AuraEffect::HandleAuraControlVehicle(AuraApplication const * aurApp, uint8 // some SPELL_AURA_CONTROL_VEHICLE auras have a dummy effect on the player - remove them caster->RemoveAurasDueToSpell(GetId()); - caster->ExitVehicle(); + caster->_ExitVehicle(); } } @@ -4900,6 +4926,8 @@ void AuraEffect::HandleModTotalPercentStat(AuraApplication const * aurApp, uint8 if ((GetMiscValue() == STAT_STAMINA) && (maxHPValue > 0) && (m_spellProto->Attributes & SPELL_ATTR0_UNK4)) { uint32 newHPValue = target->CountPctFromMaxHealth(int32(100.0f * curHPValue / maxHPValue)); + if (!newHPValue) + newHPValue = 1; target->SetHealth(newHPValue); } } @@ -5812,12 +5840,15 @@ void AuraEffect::HandleAuraDummy(AuraApplication const * aurApp, uint8 mode, boo GetBase()->SetDuration(GetBase()->GetDuration() + aurEff->GetAmount()); break; case 52916: // Honor Among Thieves - if (target->GetTypeId() == TYPEID_PLAYER) - if (Unit * spellTarget = ObjectAccessor::GetUnit(*target,target->ToPlayer()->GetComboTarget())) - target->CastSpell(spellTarget, 51699, true); - else if (Unit * spellTarget = target->ToPlayer()->GetSelectedUnit()) - target->CastSpell(spellTarget, 51699, true); - break; + if (caster == target && caster->GetTypeId() == TYPEID_PLAYER) + { + Unit * spellTarget = ObjectAccessor::GetUnit(*caster, caster->ToPlayer()->GetComboTarget()); + if (!spellTarget) + spellTarget = caster->ToPlayer()->GetSelectedUnit(); + if (spellTarget && spellTarget->IsHostileTo(caster)) + caster->CastSpell(spellTarget, 51699, true); + } + break; case 28832: // Mark of Korth'azz case 28833: // Mark of Blaumeux case 28834: // Mark of Rivendare @@ -5991,8 +6022,8 @@ void AuraEffect::HandleAuraDummy(AuraApplication const * aurApp, uint8 mode, boo break; case SPELLFAMILY_HUNTER: // Misdirection - if (GetId() == 34477) - target->SetReducedThreatPercent(0, 0); + if (GetId() == 35079) + caster->SetReducedThreatPercent(0, 0); break; case SPELLFAMILY_ROGUE: { @@ -6435,7 +6466,6 @@ void AuraEffect::HandleAuraModFaction(AuraApplication const * aurApp, uint8 mode } } - void AuraEffect::HandleComprehendLanguage(AuraApplication const * aurApp, uint8 mode, bool apply) const { if (!(mode & AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK)) @@ -6611,7 +6641,7 @@ void AuraEffect::HandleAuraSetVehicle(AuraApplication const * aurApp, uint8 mode if (apply) { - if (!target->CreateVehicleKit(vehicleId)) + if (!target->CreateVehicleKit(vehicleId, 0)) return; } else if (target->GetVehicleKit()) diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index d43a321ea9ee7..6a76e3374d8e9 100755 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -72,10 +72,10 @@ m_effectsToApply(effMask), m_removeMode(AURA_REMOVE_NONE), m_needClientUpdate(fa m_slot = slot; GetTarget()->SetVisibleAura(slot, this); SetNeedClientUpdate(); - sLog->outDebug("Aura: %u Effect: %d put to unit visible auras slot: %u", GetBase()->GetId(), GetEffectMask(), slot); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Aura: %u Effect: %d put to unit visible auras slot: %u", GetBase()->GetId(), GetEffectMask(), slot); } else - sLog->outDebug("Aura: %u Effect: %d could not find empty unit visible slot", GetBase()->GetId(), GetEffectMask()); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Aura: %u Effect: %d could not find empty unit visible slot", GetBase()->GetId(), GetEffectMask()); } _InitFlags(caster, effMask); @@ -154,7 +154,7 @@ void AuraApplication::_HandleEffect(uint8 effIndex, bool apply) ASSERT(aurEff); ASSERT(HasEffect(effIndex) == (!apply)); ASSERT((1<outDebug("AuraApplication::_HandleEffect: %u, apply: %u: amount: %u", aurEff->GetAuraType(), apply, aurEff->GetAmount()); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "AuraApplication::_HandleEffect: %u, apply: %u: amount: %u", aurEff->GetAuraType(), apply, aurEff->GetAmount()); if (apply) { @@ -190,7 +190,7 @@ void AuraApplication::ClientUpdate(bool remove) { ASSERT(!m_target->GetVisibleAura(m_slot)); data << uint32(0); - sLog->outDebug("Aura %u removed slot %u",GetBase()->GetId(), m_slot); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Aura %u removed slot %u",GetBase()->GetId(), m_slot); m_target->SendMessageToSet(&data, true); return; } @@ -315,10 +315,10 @@ Aura * Aura::Create(SpellEntry const* spellproto, uint8 effMask, WorldObject * o { case TYPEID_UNIT: case TYPEID_PLAYER: - aura = new UnitAura(spellproto,effMask,owner,caster,baseAmount,castItem, casterGUID); + aura = new UnitAura(spellproto, effMask, owner, caster, baseAmount, castItem, casterGUID); break; case TYPEID_DYNAMICOBJECT: - aura = new DynObjAura(spellproto,effMask,owner,caster,baseAmount,castItem, casterGUID); + aura = new DynObjAura(spellproto, effMask, owner, caster, baseAmount, castItem, casterGUID); break; default: ASSERT(false); @@ -330,7 +330,7 @@ Aura * Aura::Create(SpellEntry const* spellproto, uint8 effMask, WorldObject * o return aura; } -Aura::Aura(SpellEntry const* spellproto, uint8 effMask, WorldObject * owner, Unit * caster, int32 *baseAmount, Item * castItem, uint64 casterGUID): +Aura::Aura(SpellEntry const* spellproto, WorldObject * owner, Unit * caster, Item * castItem, uint64 casterGUID) : m_spellProto(spellproto), m_casterGuid(casterGUID ? casterGUID : caster->GetGUID()), m_castItemGuid(castItem ? castItem->GetGUID() : 0), m_applyTime(time(NULL)), m_owner(owner), m_timeCla(0), m_updateTargetMapInterval(0), @@ -792,7 +792,6 @@ bool Aura::ModStackAmount(int32 num) return false; } - bool Aura::IsPassive() const { return IsPassiveSpell(GetSpellProto()); @@ -820,6 +819,11 @@ bool Aura::CanBeSaved() const if (HasEffectType(SPELL_AURA_OPEN_STABLE)) return false; + // Incanter's Absorbtion - considering the minimal duration and problems with aura stacking + // we skip saving this aura + if (GetId() == 44413) + return false; + return true; } @@ -1193,6 +1197,30 @@ void Aura::HandleAuraSpecificMods(AuraApplication const * aurApp, Unit * caster, } } break; + case 63830: // Malady of the Mind + case 63881: + { + if (removeMode != AURA_REMOVE_BY_EXPIRE) + break; + // it will attempt to jump to a nearby friend when removed + std::list unitList; + target->GetRaidMember(unitList, 10); + for (std::list::iterator itr = unitList.begin(); itr != unitList.end(); ++itr) + { + Unit* pUnit = *itr; + if (!pUnit || pUnit == target) + continue; + + pUnit->CastSpell(pUnit, 63881, true, 0, 0); + return; + } + break; + } + case 64465: // Shadow Beacon + if (removeMode != AURA_REMOVE_BY_EXPIRE) + break; + target->CastSpell(target, 64468, true, 0, 0, GetCasterGUID()); + break; } break; case SPELLFAMILY_MAGE: @@ -1573,19 +1601,11 @@ void Aura::HandleAuraSpecificMods(AuraApplication const * aurApp, Unit * caster, else { // Remove passive auras - if (presence == 48266 || bloodPresenceAura) - target->RemoveAurasDueToSpell(63611); - if (presence == 48263 || frostPresenceAura) - target->RemoveAurasDueToSpell(61261); - if (presence == 48265 || unholyPresenceAura) - { - if (presence == 48265 && unholyPresenceAura) - { - target->RemoveAurasDueToSpell(63622); - target->RemoveAurasDueToSpell(65095); - } - target->RemoveAurasDueToSpell(49772); - } + target->RemoveAurasDueToSpell(63611); + target->RemoveAurasDueToSpell(61261); + target->RemoveAurasDueToSpell(63622); + target->RemoveAurasDueToSpell(65095); + target->RemoveAurasDueToSpell(49772); } } break; @@ -1680,7 +1700,7 @@ void Aura::_DeleteRemovedApplications() void Aura::LoadScripts() { - sLog->outDebug("Aura::LoadScripts"); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Aura::LoadScripts"); sScriptMgr->CreateAuraScripts(m_spellProto->Id, m_loadedScripts); for(std::list::iterator itr = m_loadedScripts.begin(); itr != m_loadedScripts.end() ;) { @@ -1845,7 +1865,6 @@ void Aura::CallScriptEffectAfterAbsorbHandlers(AuraEffect * aurEff, AuraApplicat } } - void Aura::CallScriptEffectManaShieldHandlers(AuraEffect * aurEff, AuraApplication const * aurApp, DamageInfo & dmgInfo, uint32 & absorbAmount, bool & defaultPrevented) { for(std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr) @@ -1879,7 +1898,7 @@ void Aura::CallScriptEffectAfterManaShieldHandlers(AuraEffect * aurEff, AuraAppl } UnitAura::UnitAura(SpellEntry const* spellproto, uint8 effMask, WorldObject * owner, Unit * caster, int32 *baseAmount, Item * castItem, uint64 casterGUID) - : Aura(spellproto, effMask, owner, caster, baseAmount, castItem, casterGUID) + : Aura(spellproto, owner, caster, castItem, casterGUID) { m_AuraDRGroup = DIMINISHING_NONE; LoadScripts(); @@ -1991,7 +2010,7 @@ void UnitAura::FillTargetMap(std::map & targets, Unit * caster) } DynObjAura::DynObjAura(SpellEntry const* spellproto, uint8 effMask, WorldObject * owner, Unit * caster, int32 *baseAmount, Item * castItem, uint64 casterGUID) - : Aura(spellproto, effMask, owner, caster, baseAmount, castItem, casterGUID) + : Aura(spellproto, owner, caster, castItem, casterGUID) { LoadScripts(); ASSERT(GetDynobjOwner()); diff --git a/src/server/game/Spells/Auras/SpellAuras.h b/src/server/game/Spells/Auras/SpellAuras.h index 7b50c8c4a3299..ca49faae98253 100755 --- a/src/server/game/Spells/Auras/SpellAuras.h +++ b/src/server/game/Spells/Auras/SpellAuras.h @@ -84,7 +84,7 @@ class Aura static Aura * TryCreate(SpellEntry const* spellproto, uint8 effMask, WorldObject * owner, Unit * caster, int32 *baseAmount = NULL, Item * castItem = NULL, uint64 casterGUID = 0); static Aura * TryCreate(SpellEntry const* spellproto, WorldObject * owner, Unit * caster, int32 *baseAmount = NULL, Item * castItem = NULL, uint64 casterGUID = 0); static Aura * Create(SpellEntry const* spellproto, uint8 effMask, WorldObject * owner, Unit * caster, int32 *baseAmount = NULL, Item * castItem = NULL, uint64 casterGUID = 0); - explicit Aura(SpellEntry const* spellproto, uint8 effMask, WorldObject * owner, Unit * caster, int32 *baseAmount, Item * castItem, uint64 casterGUID); + explicit Aura(SpellEntry const* spellproto, WorldObject * owner, Unit * caster, Item * castItem, uint64 casterGUID); void _InitEffects(uint8 effMask, Unit * caster, int32 *baseAmount); ~Aura(); diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 438b6a985e39a..cda2fa2e016d5 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -425,6 +425,7 @@ m_spellInfo(sSpellMgr->GetSpellForDifficultyFromSpell(info, Caster)), m_caster(Caster), m_spellValue(new SpellValue(m_spellInfo)) { m_customAttr = sSpellMgr->GetSpellCustomAttr(m_spellInfo->Id); + m_customError = SPELL_CUSTOM_ERROR_NONE; m_skipCheck = skipCheck; m_selfContainer = NULL; m_referencedFromCurrentSpell = false; @@ -1303,7 +1304,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target) // Do triggers for unit (reflect triggers passed on hit phase for correct drop charge) if (canEffectTrigger && missInfo != SPELL_MISS_REFLECT) { - caster->ProcDamageAndSpell(unitTarget, procAttacker, procVictim, procEx, damageInfo.damage, m_attackType, m_spellInfo, m_triggeredByAuraSpell); + caster->ProcDamageAndSpell(unitTarget, procAttacker, procVictim, procEx, damageInfo.damage + damageInfo.absorb, m_attackType, m_spellInfo, m_triggeredByAuraSpell); if (caster->GetTypeId() == TYPEID_PLAYER && (m_spellInfo->Attributes & SPELL_ATTR0_STOP_ATTACK_TARGET) == 0 && (m_spellInfo->DmgClass == SPELL_DAMAGE_CLASS_MELEE || m_spellInfo->DmgClass == SPELL_DAMAGE_CLASS_RANGED)) caster->ToPlayer()->CastItemCombatSpell(unitTarget, m_attackType, procVictim, procEx); @@ -1312,7 +1313,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target) caster->DealSpellDamage(&damageInfo, true); // Needed by Hooks - m_true_damage = damageInfo.damage; + m_true_damage = damageInfo.damage + damageInfo.absorb; // Haunt if (m_spellInfo->SpellFamilyName == SPELLFAMILY_WARLOCK && m_spellInfo->SpellFamilyFlags[1] & 0x40000 && m_spellAura && m_spellAura->GetEffect(1)) @@ -1620,7 +1621,7 @@ void Spell::DoTriggersOnSpellHit(Unit *unit) if (roll_chance_i(i->second)) { m_caster->CastSpell(unit, i->first, true); - sLog->outDebug("Spell %d triggered spell %d by SPELL_AURA_ADD_TARGET_TRIGGER aura", m_spellInfo->Id, i->first->Id); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell %d triggered spell %d by SPELL_AURA_ADD_TARGET_TRIGGER aura", m_spellInfo->Id, i->first->Id); } if (GetSpellDuration(i->first) == -1) { @@ -1947,7 +1948,7 @@ WorldObject* Spell::SearchNearbyTarget(float range, SpellTargets TargetType, Spe ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_SPELL_SCRIPT_TARGET, m_spellInfo->Id); if (conditions.empty()) { - sLog->outDebug("Spell (ID: %u) (caster Entry: %u) does not have record in `conditions` for spell script target (ConditionSourceType 13)", m_spellInfo->Id, m_caster->GetEntry()); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell (ID: %u) (caster Entry: %u) does not have record in `conditions` for spell script target (ConditionSourceType 13)", m_spellInfo->Id, m_caster->GetEntry()); if (IsPositiveSpell(m_spellInfo->Id)) return SearchNearbyTarget(range, SPELL_TARGETS_ALLY, effIndex); else @@ -2241,10 +2242,21 @@ void Spell::SelectEffectTargets(uint32 i, uint32 cur) } Position pos; - if (cur == TARGET_DEST_CASTER_FRONT_LEAP) - m_caster->GetFirstCollisionPosition(pos, dist, angle); - else - m_caster->GetNearPosition(pos, dist, angle); + // Can't we always use GetFirstCollisionPosition()? + switch (cur) + { + case TARGET_DEST_CASTER_FRONT_LEAP: + case TARGET_DEST_CASTER_FRONT_LEFT: + case TARGET_DEST_CASTER_BACK_LEFT: + case TARGET_DEST_CASTER_BACK_RIGHT: + case TARGET_DEST_CASTER_FRONT_RIGHT: + case TARGET_DEST_CASTER_FRONT: + m_caster->GetFirstCollisionPosition(pos, dist, angle); + break; + default: + m_caster->GetNearPosition(pos, dist, angle); + break; + } m_targets.setDst(*m_caster); m_targets.modDst(pos); break; @@ -2261,7 +2273,10 @@ void Spell::SelectEffectTargets(uint32 i, uint32 cur) if (cur == TARGET_DST_TARGET_ENEMY || cur == TARGET_DEST_TARGET_ANY) { + Position pos; + target->GetPosition(&pos); m_targets.setDst(*target); + m_targets.modDst(pos); break; } @@ -2353,7 +2368,7 @@ void Spell::SelectEffectTargets(uint32 i, uint32 cur) } else { - sLog->outDebug("SPELL: unknown target coordinates for spell ID %u", m_spellInfo->Id); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SPELL: unknown target coordinates for spell ID %u", m_spellInfo->Id); Unit *target = NULL; if (uint64 guid = m_caster->GetUInt64Value(UNIT_FIELD_TARGET)) target = ObjectAccessor::GetUnit(*m_caster, guid); @@ -2429,7 +2444,8 @@ void Spell::SelectEffectTargets(uint32 i, uint32 cur) AddUnitTarget(driver, i); break; default: - sLog->outError("Unhandled spell target %u", cur); + sLog->outError("SPELL (caster[type: %u; guidlow: %u], spell: %u): unhandled spell target (%u)", + m_caster->GetTypeId(), m_caster->GetGUIDLow(), m_spellInfo->Id, cur); break; } break; @@ -2623,12 +2639,11 @@ void Spell::SelectEffectTargets(uint32 i, uint32 cur) case 62834: // Boom (Boombot) case 64320: // Rune of Power (Assembly of Iron) case 28374: // Decimate (Gluth) - case 54426: // Decimate + case 54426: SearchAreaTarget(unitList, radius, pushType, SPELL_TARGETS_ANY); break; - default: - sLog->outDebug("Spell (ID: %u) (caster Entry: %u) does not have type CONDITION_SOURCE_TYPE_SPELL_SCRIPT_TARGET record in `conditions` table.", m_spellInfo->Id, m_caster->GetEntry()); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell (ID: %u) (caster Entry: %u) does not have type CONDITION_SOURCE_TYPE_SPELL_SCRIPT_TARGET record in `conditions` table.", m_spellInfo->Id, m_caster->GetEntry()); if (m_spellInfo->Effect[i] == SPELL_EFFECT_TELEPORT_UNITS) SearchAreaTarget(unitList, radius, pushType, SPELL_TARGETS_ENTRY, 0); @@ -2658,7 +2673,7 @@ void Spell::SelectEffectTargets(uint32 i, uint32 cur) else { if (m_spellInfo->Effect[i] == SPELL_EFFECT_ACTIVATE_OBJECT) - sLog->outDebug("Spell (ID: %u) (caster Entry: %u) with SPELL_EFFECT_ACTIVATE_OBJECT does not have type CONDITION_SOURCE_TYPE_SPELL_SCRIPT_TARGET record in `conditions` table.", m_spellInfo->Id, m_caster->GetEntry()); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell (ID: %u) (caster Entry: %u) with SPELL_EFFECT_ACTIVATE_OBJECT does not have type CONDITION_SOURCE_TYPE_SPELL_SCRIPT_TARGET record in `conditions` table.", m_spellInfo->Id, m_caster->GetEntry()); SearchGOAreaTarget(gobjectList, radius, pushType, SPELL_TARGETS_GO); } break; @@ -3031,7 +3046,7 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect const * triggere // set timer base at cast time ReSetTimer(); - sLog->outDebug("Spell::prepare: spell id %u source %u caster %d triggered %u mask %u", m_spellInfo->Id, m_caster->GetEntry(), m_originalCaster ? m_originalCaster->GetEntry() : -1, m_IsTriggeredSpell ? 1 : 0, m_targets.getTargetMask()); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell::prepare: spell id %u source %u caster %d triggered %u mask %u", m_spellInfo->Id, m_caster->GetEntry(), m_originalCaster ? m_originalCaster->GetEntry() : -1, m_IsTriggeredSpell ? 1 : 0, m_targets.getTargetMask()); //if (m_targets.getUnitTarget()) // sLog->outError("Spell::prepare: unit target %u", m_targets.getUnitTarget()->GetEntry()); //if (m_targets.HasDst()) @@ -3062,8 +3077,7 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect const * triggere m_caster->SetCurrentCastedSpell(this); SendSpellStart(); - if (m_caster->GetTypeId() == TYPEID_PLAYER) - m_caster->ToPlayer()->AddGlobalCooldown(m_spellInfo,this); + TriggerGlobalCooldown(); if (!m_casttime && !m_spellInfo->StartRecoveryTime && !m_castItemGUID //item: first cast may destroy item and second cast causes crash @@ -3077,10 +3091,6 @@ void Spell::cancel() if (m_spellState == SPELL_STATE_FINISHED) return; - SetReferencedFromCurrent(false); - if (m_selfContainer && *m_selfContainer == this) - *m_selfContainer = NULL; - uint32 oldState = m_spellState; m_spellState = SPELL_STATE_FINISHED; @@ -3088,6 +3098,7 @@ void Spell::cancel() switch (oldState) { case SPELL_STATE_PREPARING: + CancelGlobalCooldown(); case SPELL_STATE_DELAYED: SendInterrupted(0); SendCastResult(SPELL_FAILED_INTERRUPTED); @@ -3113,6 +3124,10 @@ void Spell::cancel() default: break; } + + SetReferencedFromCurrent(false); + if (m_selfContainer && *m_selfContainer == this) + *m_selfContainer = NULL; if (m_caster->GetTypeId() == TYPEID_PLAYER) m_caster->ToPlayer()->RemoveGlobalCooldown(m_spellInfo); @@ -3617,7 +3632,7 @@ void Spell::update(uint32 difftime) if (m_targets.getUnitTargetGUID() && !m_targets.getUnitTarget()) { - sLog->outDebug("Spell %u is cancelled due to removal of target.", m_spellInfo->Id); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell %u is cancelled due to removal of target.", m_spellInfo->Id); cancel(); return; } @@ -3654,7 +3669,7 @@ void Spell::update(uint32 difftime) // check if there are alive targets left if (!UpdateChanneledTargetList()) { - sLog->outDebug("Channeled spell %d is removed due to lack of targets", m_spellInfo->Id); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Channeled spell %d is removed due to lack of targets", m_spellInfo->Id); SendChannelUpdate(0); finish(); } @@ -3746,7 +3761,7 @@ void Spell::finish(bool ok) SpellEntry const *spellInfo = sSpellStore.LookupEntry(spell); if (spellInfo && spellInfo->SpellIconID == 2056) { - sLog->outDebug("Statue %d is unsummoned in spell %d finish", m_caster->GetGUIDLow(), m_spellInfo->Id); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Statue %d is unsummoned in spell %d finish", m_caster->GetGUIDLow(), m_spellInfo->Id); m_caster->setDeathState(JUST_DIED); return; } @@ -3805,10 +3820,10 @@ void Spell::SendCastResult(SpellCastResult result) if (m_caster->ToPlayer()->GetSession()->PlayerLoading()) // don't send cast results at loading time return; - SendCastResult((Player*)m_caster,m_spellInfo,m_cast_count,result); + SendCastResult(m_caster->ToPlayer(), m_spellInfo, m_cast_count, result, m_customError); } -void Spell::SendCastResult(Player* caster, SpellEntry const* spellInfo, uint8 cast_count, SpellCastResult result) +void Spell::SendCastResult(Player* caster, SpellEntry const* spellInfo, uint8 cast_count, SpellCastResult result, SpellCustomErrors customError /*= SPELL_CUSTOM_ERROR_NONE*/) { if (result == SPELL_CAST_OK) return; @@ -3870,6 +3885,9 @@ void Spell::SendCastResult(Player* caster, SpellEntry const* spellInfo, uint8 ca data << uint32(pProto->ItemLimitCategory); break; } + case SPELL_FAILED_CUSTOM_ERROR: + data << uint32(customError); + break; default: break; } @@ -3881,7 +3899,7 @@ void Spell::SendSpellStart() if (!IsNeedSendToClient()) return; - //sLog->outDebug("Sending SMSG_SPELL_START id=%u", m_spellInfo->Id); + //sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Sending SMSG_SPELL_START id=%u", m_spellInfo->Id); uint32 castFlags = CAST_FLAG_UNKNOWN_2; if (m_spellInfo->Attributes & SPELL_ATTR0_REQ_AMMO) @@ -3929,7 +3947,7 @@ void Spell::SendSpellGo() if (!IsNeedSendToClient()) return; - //sLog->outDebug("Sending SMSG_SPELL_GO id=%u", m_spellInfo->Id); + //sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Sending SMSG_SPELL_GO id=%u", m_spellInfo->Id); uint32 castFlags = CAST_FLAG_UNKNOWN_9; @@ -4748,7 +4766,7 @@ void Spell::HandleEffects(Unit *pUnitTarget,Item *pItemTarget,GameObject *pGOTar uint8 eff = m_spellInfo->Effect[i]; - sLog->outDebug("Spell: %u Effect : %u", m_spellInfo->Id, eff); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell: %u Effect : %u", m_spellInfo->Id, eff); //we do not need DamageMultiplier here. damage = CalculateDamage(i, NULL); @@ -4784,6 +4802,10 @@ SpellCastResult Spell::CheckCast(bool strict) } } + // Check global cooldown + if (strict && !m_IsTriggeredSpell && HasGlobalCooldown()) + return SPELL_FAILED_NOT_READY; + // only allow triggered spells if at an ended battleground if (!m_IsTriggeredSpell && m_caster->GetTypeId() == TYPEID_PLAYER) if (Battleground * bg = m_caster->ToPlayer()->GetBattleground()) @@ -4901,7 +4923,7 @@ SpellCastResult Spell::CheckCast(bool strict) return SPELL_FAILED_TARGET_AURASTATE; // Not allow casting on flying player or on vehicle player (if caster isnt vehicle) - if (target->HasUnitState(UNIT_STAT_IN_FLIGHT) || (target->HasUnitState(UNIT_STAT_ONVEHICLE) && target->GetVehicleBase() != m_caster)) + if (target->HasUnitState(UNIT_STAT_IN_FLIGHT) /*|| (target->HasUnitState(UNIT_STAT_ONVEHICLE) && target->GetVehicleBase() != m_caster)*/) return SPELL_FAILED_BAD_TARGETS; if (!m_IsTriggeredSpell && !m_caster->canSeeOrDetect(target)) @@ -4940,6 +4962,20 @@ SpellCastResult Spell::CheckCast(bool strict) if (!m_IsTriggeredSpell && VMAP::VMapFactory::checkSpellForLoS(m_spellInfo->Id) && !m_caster->IsWithinLOSInMap(target)) return SPELL_FAILED_LINE_OF_SIGHT; + // Do not allow "flying charges" + if (m_spellInfo->AttributesEx7 & SPELL_ATTR7_HAS_CHARGE_EFFECT) + { + float z_diff = target->GetPositionZ() - m_caster->GetPositionZ(); + if (z_diff > 5.0f) + { + float x_mid = (target->GetPositionX() + m_caster->GetPositionX()) / 2; + float y_mid = (target->GetPositionY() + m_caster->GetPositionY()) / 2; + float z_mid = (target->GetPositionZ() + m_caster->GetPositionZ()) / 2; + float z_ground = m_caster->GetMap()->GetHeight(x_mid, y_mid, z_mid, true, 5.0f); + if (fabs(z_mid - z_ground) > 1.0) + return SPELL_FAILED_NOPATH; + } + } } else if (m_caster == target) { @@ -5109,6 +5145,11 @@ SpellCastResult Spell::CheckCast(bool strict) return castResult; } + // script hook + castResult = CallScriptCheckCastHandlers(); + if (castResult != SPELL_CAST_OK) + return castResult; + // Dispel check - only if the first effect is dispel if (!m_IsTriggeredSpell && (m_spellInfo->Effect[EFFECT_0] == SPELL_EFFECT_DISPEL)) if (Unit const * target = m_targets.getUnitTarget()) @@ -5474,13 +5515,20 @@ SpellCastResult Spell::CheckCast(bool strict) return SPELL_FAILED_BAD_TARGETS; // check if our map is dungeon - if (sMapStore.LookupEntry(m_caster->GetMapId())->IsDungeon()) + MapEntry const* map = sMapStore.LookupEntry(m_caster->GetMapId()); + if (map->IsDungeon()) { - Map const* pMap = m_caster->GetMap(); - InstanceTemplate const* instance = ObjectMgr::GetInstanceTemplate(pMap->GetId()); + uint32 mapId = m_caster->GetMap()->GetId(); + Difficulty difficulty = m_caster->GetMap()->GetDifficulty(); + if (map->IsRaid()) + if (InstancePlayerBind* targetBind = target->GetBoundInstance(mapId, difficulty)) + if (targetBind->perm && targetBind != m_caster->ToPlayer()->GetBoundInstance(mapId, difficulty)) + return SPELL_FAILED_TARGET_LOCKED_TO_RAID_INSTANCE; + + InstanceTemplate const* instance = ObjectMgr::GetInstanceTemplate(mapId); if (!instance) return SPELL_FAILED_TARGET_NOT_IN_INSTANCE; - if (!target->Satisfy(sObjectMgr->GetAccessRequirement(pMap->GetId(), pMap->GetDifficulty()), pMap->GetId())) + if (!target->Satisfy(sObjectMgr->GetAccessRequirement(mapId, difficulty), mapId)) return SPELL_FAILED_BAD_TARGETS; } break; @@ -5507,8 +5555,7 @@ SpellCastResult Spell::CheckCast(bool strict) if (m_caster->GetTypeId() == TYPEID_PLAYER && m_spellInfo->Id == 781 && !m_caster->isInCombat()) return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW; - Unit* target = m_targets.getUnitTarget(); - if (m_caster == target && m_caster->HasUnitState(UNIT_STAT_ROOT)) + if (m_caster->HasUnitState(UNIT_STAT_ROOT)) { if (m_caster->GetTypeId() == TYPEID_PLAYER) return SPELL_FAILED_ROOTED; @@ -6149,8 +6196,15 @@ SpellCastResult Spell::CheckItems() // do not take reagents for these item casts if (!(m_CastItem && m_CastItem->GetProto()->Flags & ITEM_PROTO_FLAG_TRIGGERED_CAST)) { + bool checkReagents = !m_IsTriggeredSpell && !p_caster->CanNoReagentCast(m_spellInfo); + // Not own traded item (in trader trade slot) requires reagents even if triggered spell + if (!checkReagents) + if (Item* targetItem = m_targets.getItemTarget()) + if (targetItem->GetOwnerGUID() != m_caster->GetGUID()) + checkReagents = true; + // check reagents (ignore triggered spells with reagents processed by original spell) and special reagent ignore case. - if (!m_IsTriggeredSpell && !p_caster->CanNoReagentCast(m_spellInfo)) + if (checkReagents) { for (uint32 i = 0; i < MAX_SPELL_REAGENTS; i++) { @@ -6177,7 +6231,7 @@ SpellCastResult Spell::CheckItems() } } } - if (!p_caster->HasItemCount(itemid,itemcount)) + if (!p_caster->HasItemCount(itemid, itemcount)) return SPELL_FAILED_ITEM_NOT_READY; //0x54 } } @@ -6596,7 +6650,7 @@ void Spell::DelayedChannel() else m_timer -= delaytime; - sLog->outDebug("Spell %u partially interrupted for %i ms, new duration: %u ms", m_spellInfo->Id, delaytime, m_timer); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell %u partially interrupted for %i ms, new duration: %u ms", m_spellInfo->Id, delaytime, m_timer); for (std::list::const_iterator ihit = m_UniqueTargetInfo.begin(); ihit != m_UniqueTargetInfo.end(); ++ihit) if ((*ihit).missCondition == SPELL_MISS_NONE) @@ -6951,7 +7005,7 @@ bool Spell::IsValidSingleTargetSpell(Unit const* target) const { if (target->GetMapId() == MAPID_INVALID) { - sLog->outDebug("Spell::IsValidSingleTargetSpell - a spell was cast on '%s' (GUIDLow: %u), but they have an invalid map id!", target->GetName(), target->GetGUIDLow()); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell::IsValidSingleTargetSpell - a spell was cast on '%s' (GUIDLow: %u), but they have an invalid map id!", target->GetName(), target->GetGUIDLow()); return false; } for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) @@ -7132,16 +7186,16 @@ 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.) - 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. skillValue = m_CastItem || m_caster->GetTypeId()!= TYPEID_PLAYER ? 0 : m_caster->ToPlayer()->GetSkillValue(skillId); - skillValue += spellSkillBonus; + // skill bonus provided by casting spell (mostly item spells) + // add the damage modifier from the spell casted (cheat lock / skeleton key etc.) + if (m_spellInfo->EffectImplicitTargetA[effIndex] == TARGET_GAMEOBJECT_ITEM || m_spellInfo->EffectImplicitTargetB[effIndex] == TARGET_GAMEOBJECT_ITEM) + skillValue += uint32(CalculateDamage(effIndex, NULL)); if (skillValue < reqSkillValue) return SPELL_FAILED_LOW_CASTLEVEL; @@ -7359,7 +7413,7 @@ void Spell::CheckEffectExecuteData() void Spell::LoadScripts() { - sLog->outDebug("Spell::LoadScripts"); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell::LoadScripts"); sScriptMgr->CreateSpellScripts(m_spellInfo->Id, m_loadedScripts); for (std::list::iterator itr = m_loadedScripts.begin(); itr != m_loadedScripts.end() ;) { @@ -7381,6 +7435,25 @@ void Spell::PrepareScriptHitHandlers() (*scritr)->_InitHit(); } +SpellCastResult Spell::CallScriptCheckCastHandlers() +{ + SpellCastResult retVal = SPELL_CAST_OK; + for (std::list::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr) + { + (*scritr)->_PrepareScriptCall(SPELL_SCRIPT_HOOK_CHECK_CAST); + std::list::iterator hookItrEnd = (*scritr)->OnCheckCast.end(), hookItr = (*scritr)->OnCheckCast.begin(); + for (; hookItr != hookItrEnd; ++hookItr) + { + SpellCastResult tempResult = (*hookItr).Call(*scritr); + if (retVal == SPELL_CAST_OK) + retVal = tempResult; + } + + (*scritr)->_FinishScriptCall(); + } + return retVal; +} + bool Spell::CallScriptEffectHandlers(SpellEffIndex effIndex) { // execute script effect handler hooks and check if effects was prevented @@ -7454,3 +7527,67 @@ void Spell::CallScriptAfterUnitTargetSelectHandlers(std::list& unitTarget (*scritr)->_FinishScriptCall(); } } + +// Global cooldowns management +enum GCDLimits +{ + MIN_GCD = 1000, + MAX_GCD = 1500 +}; + +bool Spell::HasGlobalCooldown() +{ + // Only player or controlled units have global cooldown + if (m_caster->GetCharmInfo()) + return m_caster->GetCharmInfo()->GetGlobalCooldownMgr().HasGlobalCooldown(m_spellInfo); + else if (m_caster->GetTypeId() == TYPEID_PLAYER) + return m_caster->ToPlayer()->GetGlobalCooldownMgr().HasGlobalCooldown(m_spellInfo); + else + return false; +} + +void Spell::TriggerGlobalCooldown() +{ + int32 gcd = m_spellInfo->StartRecoveryTime; + if (!gcd) + return; + + // Global cooldown can't leave range 1..1.5 secs + // There are some spells (mostly not casted directly by player) that have < 1 sec and > 1.5 sec global cooldowns + // but as tests show are not affected by any spell mods. + if (m_spellInfo->StartRecoveryTime >= MIN_GCD && m_spellInfo->StartRecoveryTime <= MAX_GCD) + { + // gcd modifier auras are applied only to own spells and only players have such mods + if (m_caster->GetTypeId() == TYPEID_PLAYER) + m_caster->ToPlayer()->ApplySpellMod(m_spellInfo->Id, SPELLMOD_GLOBAL_COOLDOWN, gcd, this); + + // Apply haste rating + gcd = int32(float(gcd) * m_caster->GetFloatValue(UNIT_MOD_CAST_SPEED)); + if (gcd < MIN_GCD) + gcd = MIN_GCD; + else if (gcd > MAX_GCD) + gcd = MAX_GCD; + } + + // Only players or controlled units have global cooldown + if (m_caster->GetCharmInfo()) + m_caster->GetCharmInfo()->GetGlobalCooldownMgr().AddGlobalCooldown(m_spellInfo, gcd); + else if (m_caster->GetTypeId() == TYPEID_PLAYER) + m_caster->ToPlayer()->GetGlobalCooldownMgr().AddGlobalCooldown(m_spellInfo, gcd); +} + +void Spell::CancelGlobalCooldown() +{ + if (!m_spellInfo->StartRecoveryTime) + return; + + // Cancel global cooldown when interrupting current cast + if (m_caster->GetCurrentSpell(CURRENT_GENERIC_SPELL) != this) + return; + + // Only players or controlled units have global cooldown + if (m_caster->GetCharmInfo()) + m_caster->GetCharmInfo()->GetGlobalCooldownMgr().CancelGlobalCooldown(m_spellInfo); + else if (m_caster->GetTypeId() == TYPEID_PLAYER) + m_caster->ToPlayer()->GetGlobalCooldownMgr().CancelGlobalCooldown(m_spellInfo); +} diff --git a/src/server/game/Spells/Spell.h b/src/server/game/Spells/Spell.h index 88368d65a2352..1685a800ac83d 100755 --- a/src/server/game/Spells/Spell.h +++ b/src/server/game/Spells/Spell.h @@ -470,7 +470,7 @@ class Spell void CheckSrc() { if (!m_targets.HasSrc()) m_targets.setSrc(*m_caster); } void CheckDst() { if (!m_targets.HasDst()) m_targets.setDst(*m_caster); } - static void SendCastResult(Player* caster, SpellEntry const* spellInfo, uint8 cast_count, SpellCastResult result); + static void SendCastResult(Player* caster, SpellEntry const* spellInfo, uint8 cast_count, SpellCastResult result, SpellCustomErrors customError = SPELL_CUSTOM_ERROR_NONE); void SendCastResult(SpellCastResult result); void SendSpellStart(); void SendSpellGo(); @@ -503,6 +503,7 @@ class Spell uint32 m_preCastSpell; SpellCastTargets m_targets; int8 m_comboPointGain; + SpellCustomErrors m_customError; UsedSpellMods m_appliedMods; @@ -543,6 +544,9 @@ class Spell void SetSpellValue(SpellValueMod mod, int32 value); protected: + bool HasGlobalCooldown(); + void TriggerGlobalCooldown(); + void CancelGlobalCooldown(); void SendLoot(uint64 guid, LootType loottype); @@ -685,6 +689,7 @@ class Spell // Scripting system void LoadScripts(); + SpellCastResult CallScriptCheckCastHandlers(); void PrepareScriptHitHandlers(); bool CallScriptEffectHandlers(SpellEffIndex effIndex); void CallScriptBeforeHitHandlers(); diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 0fc7770f25c85..c73fd5044a478 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -196,7 +196,7 @@ pEffect SpellEffects[TOTAL_SPELL_EFFECTS]= &Spell::EffectApplyAreaAura, //128 SPELL_EFFECT_APPLY_AREA_AURA_FRIEND &Spell::EffectApplyAreaAura, //129 SPELL_EFFECT_APPLY_AREA_AURA_ENEMY &Spell::EffectRedirectThreat, //130 SPELL_EFFECT_REDIRECT_THREAT - &Spell::EffectPlayerNotification, //131 SPELL_EFFECT_PLAYER_NOTIFICATION + &Spell::EffectPlayerNotification, //131 SPELL_EFFECT_PLAYER_NOTIFICATION sound id in misc value (SoundEntries.dbc) &Spell::EffectPlayMusic, //132 SPELL_EFFECT_PLAY_MUSIC sound id in misc value (SoundEntries.dbc) &Spell::EffectUnlearnSpecialization, //133 SPELL_EFFECT_UNLEARN_SPECIALIZATION unlearn profession specialization &Spell::EffectKillCredit, //134 SPELL_EFFECT_KILL_CREDIT misc value is creature entry @@ -234,7 +234,7 @@ pEffect SpellEffects[TOTAL_SPELL_EFFECTS]= void Spell::EffectNULL(SpellEffIndex /*effIndex*/) { - sLog->outDebug("WORLD: Spell Effect DUMMY"); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "WORLD: Spell Effect DUMMY"); } void Spell::EffectUnused(SpellEffIndex /*effIndex*/) @@ -454,6 +454,20 @@ void Spell::SpellDamageSchoolDmg(SpellEffIndex effIndex) damage = (distance > radius) ? 0 : int32(SpellMgr::CalculateSpellEffectAmount(m_spellInfo, 0) * distance); break; } + // Lightning Nova + case 65279: + { + // Guessed: exponential diminution until max range of spell (100yd) + float radius = GetSpellRadiusForHostile(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[0])); + if (!radius) + return; + float distance = m_caster->GetDistance2d(unitTarget); + if (distance > radius) + damage = 0; + else + damage *= pow(1.0f - distance / radius, 2); + break; + } } break; } @@ -870,7 +884,7 @@ void Spell::EffectDummy(SpellEffIndex effIndex) Creature* creatureTarget = unitTarget->ToCreature(); m_caster->SummonGameObject(179644, creatureTarget->GetPositionX(), creatureTarget->GetPositionY(), creatureTarget->GetPositionZ(), creatureTarget->GetOrientation(), 0, 0, 0, 0, uint32(creatureTarget->GetRespawnTime()-time(NULL))); - sLog->outDebug("SummonGameObject at SpellEfects.cpp EffectDummy for Spell 23019"); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SummonGameObject at SpellEfects.cpp EffectDummy for Spell 23019"); creatureTarget->DespawnOrUnsummon(); @@ -1541,7 +1555,7 @@ void Spell::EffectDummy(SpellEffIndex effIndex) } // normal DB scripted effect - sLog->outDebug("Spell ScriptStart spellid %u in EffectDummy(%u)", m_spellInfo->Id, effIndex); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell ScriptStart spellid %u in EffectDummy(%u)", m_spellInfo->Id, effIndex); m_caster->GetMap()->ScriptsStart(sSpellScripts, uint32(m_spellInfo->Id | (effIndex << 24)), m_caster, unitTarget); // Script based implementation. Must be used only for not good for implementation in core spell effects @@ -1624,13 +1638,6 @@ void Spell::EffectForceCast(SpellEffIndex effIndex) } } - switch (triggered_spell_id) - { - case 62056: case 63985: // Stone Grip Forcecast (10m, 25m) - unitTarget->CastSpell(unitTarget, spellInfo, true); // Don't send m_originalCasterGUID param here or underlying - return; // AureEffect::HandleAuraControlVehicle will fail on caster == target - } - Unit * caster = GetTriggeredSpellCaster(spellInfo, m_caster, unitTarget); caster->CastSpell(unitTarget, spellInfo, true, NULL, NULL, m_originalCasterGUID); @@ -1657,7 +1664,6 @@ void Spell::EffectForceCastWithValue(SpellEffIndex effIndex) caster->CastCustomSpell(unitTarget, spellInfo->Id, &bp, &bp, &bp, true, NULL, NULL, m_originalCasterGUID); } - void Spell::EffectTriggerSpell(SpellEffIndex effIndex) { // only unit case known @@ -1906,16 +1912,25 @@ void Spell::EffectJumpDest(SpellEffIndex effIndex) void Spell::CalculateJumpSpeeds(uint8 i, float dist, float & speedXY, float & speedZ) { - if (m_spellInfo->EffectMiscValue[i] && m_spellInfo->EffectMiscValueB[i]) + bool fspeed = false; + if (m_spellInfo->EffectMiscValue[i]) // Fixed Time? + speedZ = float(m_spellInfo->EffectMiscValue[i])/10; + else if (m_spellInfo->EffectMiscValueB[i]) // Fixed Speed? { - speedZ = float(m_spellInfo->EffectMiscValueB[i]) / 10; - speedXY = dist * float(m_spellInfo->EffectMiscValue[i]) / speedZ; + speedXY = float(m_spellInfo->EffectMiscValueB[i])/10; + fspeed = true; } else + speedZ = 10.0f; + + if (fspeed) { - speedZ = 15.0f; - speedXY = dist * 10.0f / speedZ; + if (m_spellInfo->EffectValueMultiplier[i] > 0) + speedXY *= m_spellInfo->EffectValueMultiplier[i]; + speedZ = dist / speedXY; } + else + speedXY = dist * 10.0f / speedZ; } void Spell::EffectTeleportUnits(SpellEffIndex /*effIndex*/) @@ -1977,7 +1992,7 @@ void Spell::EffectTeleportUnits(SpellEffIndex /*effIndex*/) m_targets.m_dstPos.GetPosition(x, y, z, orientation); if (!orientation && m_targets.getUnitTarget()) orientation = m_targets.getUnitTarget()->GetOrientation(); - sLog->outDebug("Spell::EffectTeleportUnits - teleport unit to %u %f %f %f %f\n", mapid, x, y, z, orientation); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell::EffectTeleportUnits - teleport unit to %u %f %f %f %f\n", mapid, x, y, z, orientation); if (mapid == unitTarget->GetMapId()) unitTarget->NearTeleportTo(x, y, z, orientation, unitTarget == m_caster); @@ -2107,7 +2122,7 @@ void Spell::EffectUnlearnSpecialization(SpellEffIndex effIndex) _player->removeSpell(spellToUnlearn); - sLog->outDebug("Spell: Player %u has unlearned spell %u from NpcGUID: %u", _player->GetGUIDLow(), spellToUnlearn, m_caster->GetGUIDLow()); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell: Player %u has unlearned spell %u from NpcGUID: %u", _player->GetGUIDLow(), spellToUnlearn, m_caster->GetGUIDLow()); } void Spell::EffectPowerDrain(SpellEffIndex effIndex) @@ -2149,7 +2164,7 @@ void Spell::EffectSendEvent(SpellEffIndex effIndex) /* we do not handle a flag dropping or clicking on flag in battleground by sendevent system */ - sLog->outDebug("Spell ScriptStart %u for spellid %u in EffectSendEvent ", m_spellInfo->EffectMiscValue[effIndex], m_spellInfo->Id); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell ScriptStart %u for spellid %u in EffectSendEvent ", m_spellInfo->EffectMiscValue[effIndex], m_spellInfo->Id); Object *pTarget; if (focusObject) @@ -2357,7 +2372,7 @@ void Spell::EffectHealthLeech(SpellEffIndex effIndex) if (!unitTarget || !unitTarget->isAlive() || damage < 0) return; - sLog->outDebug("HealthLeech :%i", damage); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "HealthLeech :%i", damage); float healMultiplier = SpellMgr::CalculateSpellEffectValueMultiplier(m_spellInfo, effIndex, m_originalCaster, this); @@ -2604,12 +2619,12 @@ void Spell::EffectEnergize(SpellEffIndex effIndex) case 68082: // Glyph of Seal of Command damage = int32(CalculatePctN(unitTarget->GetCreateMana(), damage)); break; - case 71132: // Glyph of Shadow Word: Pain - damage = int32(CalculatePctN(unitTarget->GetCreateMana(), 1)); - break; case 48542: // Revitalize damage = int32(CalculatePctN(unitTarget->GetMaxPower(power), damage)); break; + case 71132: // Glyph of Shadow Word: Pain + damage = int32(CalculatePctN(unitTarget->GetCreateMana(), 1)); // set 1 as value, missing in dbc + break; default: break; } @@ -2746,7 +2761,7 @@ void Spell::SendLoot(uint64 guid, LootType loottype) // TODO: possible must be moved to loot release (in different from linked triggering) if (gameObjTarget->GetGOInfo()->chest.eventId) { - sLog->outDebug("Chest ScriptStart id %u for GO %u", gameObjTarget->GetGOInfo()->chest.eventId,gameObjTarget->GetDBTableGUIDLow()); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Chest ScriptStart id %u for GO %u", gameObjTarget->GetGOInfo()->chest.eventId,gameObjTarget->GetDBTableGUIDLow()); player->GetMap()->ScriptsStart(sEventScripts, gameObjTarget->GetGOInfo()->chest.eventId, player, gameObjTarget); } @@ -2768,7 +2783,7 @@ void Spell::EffectOpenLock(SpellEffIndex effIndex) { if (m_caster->GetTypeId() != TYPEID_PLAYER) { - sLog->outDebug("WORLD: Open Lock - No Player Caster!"); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "WORLD: Open Lock - No Player Caster!"); return; } @@ -2823,7 +2838,7 @@ void Spell::EffectOpenLock(SpellEffIndex effIndex) } else { - sLog->outDebug("WORLD: Open Lock - No GameObject/Item Target!"); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "WORLD: Open Lock - No GameObject/Item Target!"); return; } @@ -3144,7 +3159,7 @@ void Spell::EffectSummonType(SpellEffIndex effIndex) { float x, y, z; m_caster->GetClosePoint(x, y, z, DEFAULT_WORLD_OBJECT_SIZE); - summon = m_caster->GetMap()->SummonCreature(entry, pos, properties, duration, m_caster); + summon = m_originalCaster->GetMap()->SummonCreature(entry, pos, properties, duration, m_caster); if (!summon || !summon->IsVehicle()) return; @@ -3152,10 +3167,21 @@ void Spell::EffectSummonType(SpellEffIndex effIndex) { SpellEntry const *spellProto = sSpellStore.LookupEntry(SpellMgr::CalculateSpellEffectAmount(m_spellInfo, effIndex)); if (spellProto) - m_caster->CastSpell(summon, spellProto, true); + { + m_originalCaster->CastSpell(summon, spellProto, true); + return; + } } - m_caster->EnterVehicle(summon->GetVehicleKit()); + // Hard coded enter vehicle spell + m_originalCaster->CastSpell(summon, VEHICLE_SPELL_RIDE_HARDCODED, true); + + summon->SetUInt32Value(UNIT_CREATED_BY_SPELL, m_spellInfo->Id); + uint32 faction = properties->Faction; + if (!faction) + faction = m_originalCaster->getFaction(); + + summon->setFaction(faction); break; } } @@ -3186,7 +3212,7 @@ void Spell::EffectLearnSpell(SpellEffIndex effIndex) uint32 spellToLearn = (m_spellInfo->Id == 483 || m_spellInfo->Id == 55884) ? damage : m_spellInfo->EffectTriggerSpell[effIndex]; player->learnSpell(spellToLearn, false); - sLog->outDebug("Spell: Player %u has learned spell %u from NpcGUID=%u", player->GetGUIDLow(), spellToLearn, m_caster->GetGUIDLow()); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell: Player %u has learned spell %u from NpcGUID=%u", player->GetGUIDLow(), spellToLearn, m_caster->GetGUIDLow()); } typedef std::list< std::pair > DispelList; @@ -3446,7 +3472,7 @@ void Spell::EffectAddHonor(SpellEffIndex /*effIndex*/) if (m_CastItem) { unitTarget->ToPlayer()->RewardHonor(NULL, 1, damage/10); - sLog->outDebug("SpellEffect::AddHonor (spell_id %u) rewards %d honor points (item %u) for player: %u", m_spellInfo->Id, damage/10, m_CastItem->GetEntry(),unitTarget->ToPlayer()->GetGUIDLow()); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SpellEffect::AddHonor (spell_id %u) rewards %d honor points (item %u) for player: %u", m_spellInfo->Id, damage/10, m_CastItem->GetEntry(),unitTarget->ToPlayer()->GetGUIDLow()); return; } @@ -3455,13 +3481,13 @@ void Spell::EffectAddHonor(SpellEffIndex /*effIndex*/) { uint32 honor_reward = Trinity::Honor::hk_honor_at_level(unitTarget->getLevel(), float(damage)); unitTarget->ToPlayer()->RewardHonor(NULL, 1, honor_reward); - sLog->outDebug("SpellEffect::AddHonor (spell_id %u) rewards %u honor points (scale) to player: %u", m_spellInfo->Id, honor_reward, unitTarget->ToPlayer()->GetGUIDLow()); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SpellEffect::AddHonor (spell_id %u) rewards %u honor points (scale) to player: %u", m_spellInfo->Id, honor_reward, unitTarget->ToPlayer()->GetGUIDLow()); } else { //maybe we have correct honor_gain in damage already unitTarget->ToPlayer()->RewardHonor(NULL, 1, damage); - sLog->outDebug("SpellEffect::AddHonor (spell_id %u) rewards %u honor points (non scale) for player: %u", m_spellInfo->Id, damage, unitTarget->ToPlayer()->GetGUIDLow()); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SpellEffect::AddHonor (spell_id %u) rewards %u honor points (non scale) for player: %u", m_spellInfo->Id, damage, unitTarget->ToPlayer()->GetGUIDLow()); } } @@ -3949,6 +3975,7 @@ void Spell::SpellDamageWeaponDmg(SpellEffIndex effIndex) // some spell specific modifiers float totalDamagePercentMod = 1.0f; // applied to final bonus+weapon damage + float neg_totalDamagePercentMod = 1.0f; int32 fixed_bonus = 0; int32 spell_bonus = 0; // bonus specific for spell @@ -4066,7 +4093,7 @@ void Spell::SpellDamageWeaponDmg(SpellEffIndex effIndex) else if (m_spellInfo->SpellFamilyFlags[0] & 0x00008800 && unitTarget->HasAuraState(AURA_STATE_BLEEDING)) { if (AuraEffect const* rendAndTear = m_caster->GetDummyAuraEffect(SPELLFAMILY_DRUID, 2859, 0)) - AddFlatPctN(totalDamagePercentMod, rendAndTear->GetAmount()); + AddFlatPctN(totalDamagePercentMod, neg_totalDamagePercentMod, rendAndTear->GetAmount()); } break; } @@ -4084,18 +4111,18 @@ void Spell::SpellDamageWeaponDmg(SpellEffIndex effIndex) { // Glyph of Plague Strike if (AuraEffect const * aurEff = m_caster->GetAuraEffect(58657, EFFECT_0)) - AddFlatPctN(totalDamagePercentMod, aurEff->GetAmount()); + AddFlatPctN(totalDamagePercentMod, neg_totalDamagePercentMod, aurEff->GetAmount()); break; } // Blood Strike if (m_spellInfo->SpellFamilyFlags[EFFECT_0] & 0x400000) { - AddFlatPctF(totalDamagePercentMod, SpellMgr::CalculateSpellEffectAmount(m_spellInfo, EFFECT_2) * unitTarget->GetDiseasesByCaster(m_caster->GetGUID()) / 2.0f); + AddFlatPctF(totalDamagePercentMod, neg_totalDamagePercentMod, SpellMgr::CalculateSpellEffectAmount(m_spellInfo, EFFECT_2) * unitTarget->GetDiseasesByCaster(m_caster->GetGUID()) / 2.0f); // Glyph of Blood Strike if (m_caster->GetAuraEffect(59332, EFFECT_0)) if (unitTarget->HasAuraType(SPELL_AURA_MOD_DECREASE_SPEED)) - AddFlatPctN(totalDamagePercentMod, 20); + AddFlatPctN(totalDamagePercentMod, neg_totalDamagePercentMod, 20); break; } // Death Strike @@ -4104,7 +4131,7 @@ void Spell::SpellDamageWeaponDmg(SpellEffIndex effIndex) // Glyph of Death Strike if (AuraEffect const * aurEff = m_caster->GetAuraEffect(59336, EFFECT_0)) if (uint32 runic = std::min(m_caster->GetPower(POWER_RUNIC_POWER), SpellMgr::CalculateSpellEffectAmount(aurEff->GetSpellProto(), EFFECT_1))) - AddFlatPctN(totalDamagePercentMod, runic); + AddFlatPctN(totalDamagePercentMod, neg_totalDamagePercentMod, runic); break; } // Obliterate (12.5% more damage per disease) @@ -4117,19 +4144,19 @@ void Spell::SpellDamageWeaponDmg(SpellEffIndex effIndex) if (roll_chance_i(aurEff->GetAmount())) consumeDiseases = false; - AddFlatPctF(totalDamagePercentMod, SpellMgr::CalculateSpellEffectAmount(m_spellInfo, EFFECT_2) * unitTarget->GetDiseasesByCaster(m_caster->GetGUID(), consumeDiseases) / 2.0f); + AddFlatPctF(totalDamagePercentMod, neg_totalDamagePercentMod, SpellMgr::CalculateSpellEffectAmount(m_spellInfo, EFFECT_2) * unitTarget->GetDiseasesByCaster(m_caster->GetGUID(), consumeDiseases) / 2.0f); break; } // Blood-Caked Strike - Blood-Caked Blade if (m_spellInfo->SpellIconID == 1736) { - AddFlatPctF(totalDamagePercentMod, unitTarget->GetDiseasesByCaster(m_caster->GetGUID()) * 12.5f); + AddFlatPctF(totalDamagePercentMod, neg_totalDamagePercentMod, unitTarget->GetDiseasesByCaster(m_caster->GetGUID()) * 12.5f); break; } // Heart Strike if (m_spellInfo->SpellFamilyFlags[EFFECT_0] & 0x1000000) { - AddFlatPctN(totalDamagePercentMod, SpellMgr::CalculateSpellEffectAmount(m_spellInfo, EFFECT_2) * unitTarget->GetDiseasesByCaster(m_caster->GetGUID())); + AddFlatPctN(totalDamagePercentMod, neg_totalDamagePercentMod, SpellMgr::CalculateSpellEffectAmount(m_spellInfo, EFFECT_2) * unitTarget->GetDiseasesByCaster(m_caster->GetGUID())); break; } break; @@ -4175,7 +4202,19 @@ void Spell::SpellDamageWeaponDmg(SpellEffIndex effIndex) weapon_total_pct = m_caster->GetModifierValue(unitMod, TOTAL_PCT); if (fixed_bonus) + { fixed_bonus = int32(fixed_bonus * weapon_total_pct); + // Death Strike, Scourge Strike and Plague Strike fixed bonus take talents bonuses twice + if (m_spellInfo->SpellFamilyName == SPELLFAMILY_DEATHKNIGHT && m_caster->ToPlayer()) + { + if (m_spellInfo->SpellFamilyFlags[0] & 0x11 || m_spellInfo->SpellFamilyFlags[1] & 0x8000000) + { + float coeff = 1.0f; + m_caster->ToPlayer()->ApplySpellMod(m_spellInfo->Id, SPELLMOD_DAMAGE, coeff); + fixed_bonus *= coeff; + } + } + } if (spell_bonus) spell_bonus = int32(spell_bonus * weapon_total_pct); } @@ -4204,8 +4243,8 @@ void Spell::SpellDamageWeaponDmg(SpellEffIndex effIndex) if (spell_bonus) weaponDamage += spell_bonus; - if (totalDamagePercentMod != 1.0f) - weaponDamage = int32(weaponDamage * totalDamagePercentMod); + if (totalDamagePercentMod != 1.0f || neg_totalDamagePercentMod != 1.0f) + weaponDamage = int32(weaponDamage * totalDamagePercentMod * neg_totalDamagePercentMod); // prevent negative damage uint32 eff_damage(std::max(weaponDamage, 0)); @@ -4378,6 +4417,38 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex) { case SPELLFAMILY_GENERIC: { + if (unitTarget && unitTarget->HasAura(63050)) + { + // reduces Sanity by % + uint32 sanityCount = 0; + switch(m_spellInfo->Id) + { + case 63803: // Brain Link + case 64168: // Lunatic Gaze + sanityCount = 2; break; + case 63830: // Malady of the Mind 10 + case 63881: // Malady of the Mind 25 + sanityCount = 3; break; + case 64164: // Lunatic Gaze P3 + sanityCount = 4; break; + case 63795: // Psychosis + sanityCount = 9; break; + case 64059: // Induce Madness + sanityCount = 100; break; + } + if (sanityCount) + { + if (Aura *aur = unitTarget->GetAura(63050)) + { + int32 stack = aur->GetStackAmount() - sanityCount; + if (stack <= 0) + unitTarget->RemoveAurasDueToSpell(63050); + else + unitTarget->SetAuraStack(63050, unitTarget, stack); + } + } + } + switch(m_spellInfo->Id) { // Glyph of Backstab @@ -4824,15 +4895,6 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex) if (unitTarget && m_originalCaster) m_originalCaster->CastSpell(unitTarget, urand(0, 1) ? damage : 52505, true); return; - // Death Gate - case 52751: - { - if (!unitTarget || unitTarget->getClass() != CLASS_DEATH_KNIGHT) - return; - // triggered spell is stored in m_spellInfo->EffectBasePoints[0] - unitTarget->CastSpell(unitTarget, damage, false); - break; - } case 53110: // Devour Humanoid if (unitTarget) unitTarget->CastSpell(m_caster, damage, true); @@ -5124,7 +5186,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex) return; // learn random explicit discovery recipe (if any) - if (uint32 discoveredSpell = GetExplicitDiscoverySpell(m_spellInfo->Id, (Player*)m_caster)) + if (uint32 discoveredSpell = GetExplicitDiscoverySpell(m_spellInfo->Id, m_caster->ToPlayer())) m_caster->ToPlayer()->learnSpell(discoveredSpell, false); return; } @@ -5149,17 +5211,11 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex) oldContainer->DisappearAndDie(); // TODO: a hack, range = 11, should after some time cast, otherwise too far m_caster->CastSpell(seat->GetBase(), 62496, true); - unitTarget->EnterVehicle(seat, 1); + unitTarget->EnterVehicle(m_caster, 1); } } return; } - case 65594: // Cancel Stone Grip - { - uint32 spellToRemove = unitTarget->GetMap()->GetDifficulty() == RAID_DIFFICULTY_10MAN_NORMAL ? 62166 : 63981; - unitTarget->RemoveAurasDueToSpell(spellToRemove); - return; - } case 60123: // Lightwell { if (m_caster->GetTypeId() != TYPEID_UNIT || !m_caster->ToCreature()->isSummon()) @@ -5424,7 +5480,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex) } // normal DB scripted effect - sLog->outDebug("Spell ScriptStart spellid %u in EffectScriptEffect(%u)", m_spellInfo->Id, effIndex); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell ScriptStart spellid %u in EffectScriptEffect(%u)", m_spellInfo->Id, effIndex); m_caster->GetMap()->ScriptsStart(sSpellScripts, uint32(m_spellInfo->Id | (effIndex << 24)), m_caster, unitTarget); } @@ -5573,7 +5629,7 @@ void Spell::EffectStuck(SpellEffIndex /*effIndex*/) Player* pTarget = (Player*)unitTarget; - sLog->outDebug("Spell Effect: Stuck"); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell Effect: Stuck"); sLog->outDetail("Player %s (guid %u) used auto-unstuck future at map %u (%f, %f, %f)", pTarget->GetName(), pTarget->GetGUIDLow(), m_caster->GetMapId(), m_caster->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ()); if (pTarget->isInFlight()) @@ -6293,7 +6349,7 @@ void Spell::EffectSummonDeadPet(SpellEffIndex /*effIndex*/) pet->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0); pet->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE); pet->setDeathState(ALIVE); - pet->ClearUnitState(UNIT_STAT_ALL_STATE); + pet->ClearUnitState(uint32(UNIT_STAT_ALL_STATE)); pet->SetHealth(pet->CountPctFromMaxHealth(damage)); //pet->AIM_Initialize(); @@ -6574,7 +6630,7 @@ void Spell::EffectMilling(SpellEffIndex /*effIndex*/) void Spell::EffectSkill(SpellEffIndex /*effIndex*/) { - sLog->outDebug("WORLD: SkillEFFECT"); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "WORLD: SkillEFFECT"); } /* There is currently no need for this effect. We handle it in Battleground.cpp @@ -6601,7 +6657,7 @@ void Spell::EffectSpiritHeal(SpellEffIndex /*effIndex*/) // remove insignia spell effect void Spell::EffectSkinPlayerCorpse(SpellEffIndex /*effIndex*/) { - sLog->outDebug("Effect: SkinPlayerCorpse"); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Effect: SkinPlayerCorpse"); if ((m_caster->GetTypeId() != TYPEID_PLAYER) || (unitTarget->GetTypeId() != TYPEID_PLAYER) || (unitTarget->isAlive())) return; @@ -6610,7 +6666,7 @@ void Spell::EffectSkinPlayerCorpse(SpellEffIndex /*effIndex*/) void Spell::EffectStealBeneficialBuff(SpellEffIndex effIndex) { - sLog->outDebug("Effect: StealBeneficialBuff"); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Effect: StealBeneficialBuff"); if (!unitTarget || unitTarget == m_caster) // can't steal from self return; @@ -7075,7 +7131,7 @@ void Spell::EffectActivateSpec(SpellEffIndex /*effIndex*/) unitTarget->ToPlayer()->ActivateSpec(damage-1); // damage is 1 or 2, spec is 0 or 1 } -void Spell::EffectPlayerNotification(SpellEffIndex /*effIndex*/) +void Spell::EffectPlayerNotification(SpellEffIndex effIndex) { if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER) return; @@ -7087,6 +7143,18 @@ void Spell::EffectPlayerNotification(SpellEffIndex /*effIndex*/) unitTarget->ToPlayer()->GetSession()->SendNotification(LANG_ZONE_NOFLYZONE); break; } + + uint32 soundid = m_spellInfo->EffectMiscValue[effIndex]; + + if (!sSoundEntriesStore.LookupEntry(soundid)) + { + sLog->outError("EffectPlayerNotification: Sound (Id: %u) not exist in spell %u.", soundid, m_spellInfo->Id); + return; + } + + WorldPacket data(SMSG_PLAY_SOUND, 4); + data << uint32(soundid); + unitTarget->ToPlayer()->GetSession()->SendPacket(&data); } void Spell::EffectRemoveAura(SpellEffIndex effIndex) diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 91724da12bbef..4bce02cfe5fe6 100755 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -400,7 +400,7 @@ uint32 CalculatePowerCost(SpellEntry const * spellInfo, Unit const * caster, Spe break; case POWER_RUNE: case POWER_RUNIC_POWER: - sLog->outDebug("CalculateManaCost: Not implemented yet!"); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "CalculateManaCost: Not implemented yet!"); break; default: sLog->outError("CalculateManaCost: Unknown power type '%d' in spell %d", spellInfo->powerType, spellInfo->Id); @@ -1137,7 +1137,6 @@ void SpellMgr::LoadSpellTargetPositions() { Field *fields = result->Fetch(); - uint32 Spell_ID = fields[0].GetUInt32(); SpellTargetPosition st; @@ -1229,7 +1228,7 @@ void SpellMgr::LoadSpellTargetPositions() if (found) { // if (!sSpellMgr->GetSpellTargetPosition(i)) -// sLog->outDebug("Spell (ID: %u) does not have record in `spell_target_position`", i); +// sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell (ID: %u) does not have record in `spell_target_position`", i); } } @@ -1277,7 +1276,6 @@ void SpellMgr::LoadSpellProcEvents() { Field *fields = result->Fetch(); - uint32 entry = fields[0].GetUInt32(); const SpellEntry *spell = sSpellStore.LookupEntry(entry); @@ -1505,22 +1503,17 @@ void SpellMgr::LoadSpellGroups() QueryResult result = WorldDatabase.Query("SELECT id, spell_id FROM spell_group"); if (!result) { - - - sLog->outString(); sLog->outString(">> Loaded %u spell group definitions", count); return; } - std::set groups; do { Field *fields = result->Fetch(); - uint32 group_id = fields[0].GetUInt32(); if (group_id <= SPELL_GROUP_DB_RANGE_MIN && group_id >= SPELL_GROUP_CORE_RANGE_MAX) { @@ -1593,19 +1586,15 @@ void SpellMgr::LoadSpellGroupStackRules() QueryResult result = WorldDatabase.Query("SELECT group_id, stack_rule FROM spell_group_stack_rules"); if (!result) { - - sLog->outString(">> Loaded 0 spell group stack rules"); sLog->outString(); return; } - do { Field *fields = result->Fetch(); - uint32 group_id = fields[0].GetUInt32(); uint8 stack_rule = fields[1].GetUInt32(); if (stack_rule >= SPELL_GROUP_STACK_RULE_MAX) @@ -1643,20 +1632,15 @@ void SpellMgr::LoadSpellThreats() QueryResult result = WorldDatabase.Query("SELECT entry, Threat FROM spell_threat"); if (!result) { - - - sLog->outString(">> Loaded %u aggro generating spells", count); sLog->outString(); return; } - do { Field *fields = result->Fetch(); - uint32 entry = fields[0].GetUInt32(); uint16 Threat = fields[1].GetUInt16(); @@ -2112,7 +2096,6 @@ void SpellMgr::LoadSpellPetAuras() { Field *fields = result->Fetch(); - uint32 spell = fields[0].GetUInt32(); uint8 eff = fields[1].GetUInt8(); uint32 pet = fields[2].GetUInt32(); @@ -2164,7 +2147,6 @@ void SpellMgr::LoadPetLevelupSpellMap() uint32 count = 0; uint32 family_count = 0; - for (uint32 i = 0; i < sCreatureFamilyStore.GetNumRows(); ++i) { @@ -2271,7 +2253,6 @@ void SpellMgr::LoadPetDefaultSpells() uint32 countCreature = 0; uint32 countData = 0; - for (uint32 i = 0; i < sCreatureStorage.MaxEntry; ++i) { @@ -2305,7 +2286,6 @@ void SpellMgr::LoadPetDefaultSpells() sLog->outString("Loading summonable creature templates..."); oldMSTime = getMSTime(); - // different summon spells for (uint32 i = 0; i < sSpellStore.GetNumRows(); ++i) { @@ -2345,7 +2325,6 @@ void SpellMgr::LoadPetDefaultSpells() } } - sLog->outString(">> Loaded %u summonable creature templates in %u ms", countCreature, GetMSTimeDiffToNow(oldMSTime)); sLog->outString(); } @@ -2469,7 +2448,6 @@ void SpellMgr::LoadSpellAreas() { Field *fields = result->Fetch(); - uint32 spell = fields[0].GetUInt32(); SpellArea spellArea; spellArea.spellId = spell; @@ -2896,6 +2874,9 @@ DiminishingGroup GetDiminishingReturnsGroupForSpell(SpellEntry const* spellproto // Repentance if (spellproto->SpellFamilyFlags[0] & 0x4) return DIMINISHING_POLYMORPH; + // Judgement of Justice + if (spellproto->SpellFamilyFlags[0] & 0x100000) + return DIMINISHING_LIMITONLY; break; } case SPELLFAMILY_DEATHKNIGHT: @@ -3183,6 +3164,34 @@ bool SpellMgr::CanAurasStack(Aura const *aura1, Aura const *aura2, bool sameCast } } + bool isVehicleAura1 = false; + bool isVehicleAura2 = false; + uint8 i = 0; + while (i < MAX_SPELL_EFFECTS && !(isVehicleAura1 && isVehicleAura2)) + { + if (spellInfo_1->EffectApplyAuraName[i] == SPELL_AURA_CONTROL_VEHICLE) + isVehicleAura1 = true; + if (spellInfo_2->EffectApplyAuraName[i] == SPELL_AURA_CONTROL_VEHICLE) + isVehicleAura2 = true; + + ++i; + } + + if (isVehicleAura1 && isVehicleAura2) + { + Vehicle* veh = NULL; + if (aura1->GetOwner()->ToUnit()) + veh = aura1->GetOwner()->ToUnit()->GetVehicleKit(); + + if (!veh) // We should probably just let it stack. Vehicle system will prevent undefined behaviour later + return true; + + if (!veh->GetAvailableSeatCount()) + return false; // No empty seat available + + return true; // Empty seat available (skip rest) + } + uint32 spellId_1 = GetLastSpellInChain(spellInfo_1->Id); uint32 spellId_2 = GetLastSpellInChain(spellInfo_2->Id); @@ -3250,8 +3259,6 @@ void SpellMgr::LoadSpellEnchantProcData() QueryResult result = WorldDatabase.Query("SELECT entry, customChance, PPMChance, procEx FROM spell_enchant_proc_data"); if (!result) { - - sLog->outString(">> Loaded %u spell enchant proc event conditions", count); sLog->outString(); return; @@ -3261,7 +3268,6 @@ void SpellMgr::LoadSpellEnchantProcData() { Field *fields = result->Fetch(); - uint32 enchantId = fields[0].GetUInt32(); SpellItemEnchantmentEntry const *ench = sSpellItemEnchantmentStore.LookupEntry(enchantId); @@ -3361,7 +3367,6 @@ void SpellMgr::LoadSpellRanks() return; } - uint32 rows = 0; bool finished = false; @@ -3594,6 +3599,10 @@ void SpellMgr::LoadSpellCustomAttr() switch (i) { + case 36350: //They Must Burn Bomb Aura (self) + spellInfo->EffectTriggerSpell[0] = 36325; // They Must Burn Bomb Drop (DND) + count++; + break; case 49838: // Stop Time case 50526: // Wandering Plague case 52916: // Honor Among Thieves @@ -3850,6 +3859,10 @@ void SpellMgr::LoadSpellCustomAttr() spellInfo->EffectImplicitTargetA[0] = TARGET_UNIT_CASTER; count++; break; + case 66665: // Burning Breath + spellInfo->EffectImplicitTargetA[0] = TARGET_UNIT_TARGET_ENEMY; + count++; + break; case 62907: // Freya's Ward case 62947: spellInfo->DurationIndex = 0; @@ -3969,7 +3982,43 @@ void SpellMgr::LoadSpellCustomAttr() spellInfo->EffectImplicitTargetB[0] = TARGET_UNIT_MASTER; count++; break; + // ULDUAR SPELLS + // + case 63342: // Focused Eyebeam Summon Trigger + spellInfo->MaxAffectedTargets = 1; + count++; + break; + case 64145: // Diminish Power + case 63882: // Death Ray Warning Visual + case 63886: // Death Ray Damage Visual + spellInfo->AttributesEx3 |= SPELL_ATTR3_STACK_FOR_DIFF_CASTERS; + count++; + break; + case 64172: // Titanic Storm + spellInfo->excludeTargetAuraSpell = 65294; // Empowered + count++; + break; + case 63830: // Malady of the Mind + case 63881: // Malady of the Mind proc + case 63795: // Psychosis + spellInfo->EffectImplicitTargetB[0] = TARGET_UNIT_TARGET_ANY; + spellInfo->EffectImplicitTargetB[1] = TARGET_UNIT_TARGET_ANY; + spellInfo->EffectImplicitTargetB[2] = TARGET_UNIT_TARGET_ANY; + count++; + break; + case 63802: // Brain Link + spellInfo->MaxAffectedTargets = 2; + spellInfo->EffectRadiusIndex[0] = 12; // 100 yard + count++; + break; + case 63050: // Sanity + spellInfo->AttributesEx3 |= SPELL_ATTR3_DEATH_PERSISTENT; + count++; + break; + // ENDOF ULDUAR SPELLS + // // ICECROWN CITADEL SPELLS + // // THESE SPELLS ARE WORKING CORRECTLY EVEN WITHOUT THIS HACK // THE ONLY REASON ITS HERE IS THAT CURRENT GRID SYSTEM // DOES NOT ALLOW FAR OBJECT SELECTION (dist > 333) @@ -4084,6 +4133,10 @@ void SpellMgr::LoadSpellCustomAttr() spellInfo->Effect[1] = 0; count++; break; + case 51590: // Toss Ice Boulder + spellInfo->MaxAffectedTargets = 1; + count++; + break; case 49224: // Magic Suppression case 49611: case 57935: // Twilight Torment @@ -4118,8 +4171,8 @@ void SpellMgr::LoadSpellCustomAttr() spellInfo->Effect[1] = 6; spellInfo->EffectApplyAuraName[0] = SPELL_AURA_MOD_XP_PCT; spellInfo->EffectApplyAuraName[1] = SPELL_AURA_MOD_XP_QUEST_PCT; - spellInfo->EffectBasePoints[0] = 5; - spellInfo->EffectBasePoints[1] = 5; + spellInfo->EffectBasePoints[0] = 10; + spellInfo->EffectBasePoints[1] = 10; spellInfo->EffectImplicitTargetA[0] = 1; spellInfo->EffectImplicitTargetA[1] = 1; spellInfo->EffectImplicitTargetB[0] = 0; @@ -4140,6 +4193,14 @@ void SpellMgr::LoadSpellCustomAttr() spellInfo->AuraInterruptFlags |= AURA_INTERRUPT_FLAG_SPELL_ATTACK; count++; break; + case 70890: // Scourge Strike Triggered + spellInfo->AttributesEx2 |= SPELL_ATTR2_TRIGGERED_CAN_TRIGGER; + count++; + break; + case 49206: // Summon Gargoyle + spellInfo->DurationIndex = 587; + count++; + break; default: break; } @@ -4167,6 +4228,9 @@ void SpellMgr::LoadSpellCustomAttr() // Entangling Roots else if (spellInfo->SpellFamilyFlags[0] & 0x200 && spellInfo->Attributes & SPELL_ATTR0_CASTABLE_WHILE_SITTING) spellInfo->CastingTimeIndex = 1; + // Rake + else if (spellInfo->SpellFamilyFlags[0] & 0x1000) + mSpellCustomAttr[i] |= SPELL_ATTR0_CU_IGNORE_ARMOR; else break; count++; @@ -4201,7 +4265,6 @@ void SpellMgr::LoadEnchantCustomAttr() uint32 size = sSpellItemEnchantmentStore.GetNumRows(); mEnchantCustomAttr.resize(size); - uint32 count = 0; for (uint32 i = 0; i < size; ++i) @@ -4258,7 +4321,6 @@ void SpellMgr::LoadSpellLinked() { Field *fields = result->Fetch(); - int32 trigger = fields[0].GetInt32(); int32 effect = fields[1].GetInt32(); int32 type = fields[2].GetInt32(); diff --git a/src/server/game/Spells/SpellMgr.h b/src/server/game/Spells/SpellMgr.h index 42558c5eaab1b..8d6305ee383cf 100755 --- a/src/server/game/Spells/SpellMgr.h +++ b/src/server/game/Spells/SpellMgr.h @@ -132,12 +132,10 @@ enum SpellFamilyFlag SPELLFAMILYFLAG_DK_DEATH_COIL = 0x00002000, SPELLFAMILYFLAG1_DK_HUNGERING_COLD = 0x00001000, - // TODO: Figure out a more accurate name for the following familyflag(s) SPELLFAMILYFLAG_SHAMAN_TOTEM_EFFECTS = 0x04000000, // Seems to be linked to most totems and some totem effects }; - // Spell clasification enum SpellSpecific { @@ -538,7 +536,7 @@ inline uint32 GetDispellMask(DispelType dispel) if (dispel == DISPEL_ALL) return DISPEL_ALL_MASK; else - return (1 << dispel); + return uint32(1 << dispel); } // Diminishing Returns interaction with spells @@ -903,7 +901,6 @@ enum SpellCustomAttributes SPELL_ATTR0_CU_NEGATIVE = SPELL_ATTR0_CU_NEGATIVE_EFF0 | SPELL_ATTR0_CU_NEGATIVE_EFF1 | SPELL_ATTR0_CU_NEGATIVE_EFF2, }; - typedef std::vector SpellCustomAttribute; typedef std::vector EnchantCustomAttribute; @@ -1083,27 +1080,26 @@ class SpellMgr SpellDifficultyEntry const *SpellDiff = sSpellDifficultyStore.LookupEntry(SpellDiffId); if (!SpellDiff) { - sLog->outDebug("GetSpellForDifficultyFromSpell: SpellDifficultyEntry not found for spell %u. This Should never happen.", spell->Id); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "GetSpellForDifficultyFromSpell: SpellDifficultyEntry not found for spell %u. This Should never happen.", spell->Id); return spell;//return source spell } if (SpellDiff->SpellID[mode] <= 0 && mode > DUNGEON_DIFFICULTY_HEROIC) { - uint8 baseMode = mode; + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "GetSpellForDifficultyFromSpell: spell %u mode %u spell is NULL, using mode %u", spell->Id, mode, mode-2); mode -= 2; - sLog->outDebug("GetSpellForDifficultyFromSpell: spell %u mode %u spell is NULL, using mode %u", spell->Id, baseMode, mode); } if (SpellDiff->SpellID[mode] <= 0) { sLog->outErrorDb("GetSpellForDifficultyFromSpell: spell %u mode %u spell is 0. Check spelldifficulty_dbc!", spell->Id, mode); return spell; } - SpellEntry const* newSpell = sSpellStore.LookupEntry(SpellDiff->SpellID[mode]); + SpellEntry const* newSpell = sSpellStore.LookupEntry(uint32(SpellDiff->SpellID[mode])); if (!newSpell) { - sLog->outDebug("GetSpellForDifficultyFromSpell: spell %u not found in SpellStore. Check spelldifficulty_dbc!", SpellDiff->SpellID[mode]); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "GetSpellForDifficultyFromSpell: spell %u not found in SpellStore. Check spelldifficulty_dbc!", SpellDiff->SpellID[mode]); return spell; } - sLog->outDebug("GetSpellForDifficultyFromSpell: spellid for spell %u in mode %u is %u ", spell->Id, mode, newSpell->Id); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "GetSpellForDifficultyFromSpell: spellid for spell %u in mode %u is %u ", spell->Id, mode, newSpell->Id); return newSpell; } @@ -1199,7 +1195,7 @@ class SpellMgr return spell_id; } - uint32 IsArenaAllowedEnchancment(uint32 ench_id) const + bool IsArenaAllowedEnchancment(uint32 ench_id) const { return mEnchantCustomAttr[ench_id]; } diff --git a/src/server/game/Spells/SpellScript.cpp b/src/server/game/Spells/SpellScript.cpp index 01557eec43103..8b5bafa2c8e4c 100755 --- a/src/server/game/Spells/SpellScript.cpp +++ b/src/server/game/Spells/SpellScript.cpp @@ -146,6 +146,16 @@ std::string _SpellScript::EffectAuraNameCheck::ToString() } } +SpellScript::CheckCastHandler::CheckCastHandler(SpellCheckCastFnType checkCastHandlerScript) +{ + _checkCastHandlerScript = checkCastHandlerScript; +} + +SpellCastResult SpellScript::CheckCastHandler::Call(SpellScript* spellScript) +{ + return (spellScript->*_checkCastHandlerScript)(); +} + SpellScript::EffectHandler::EffectHandler(SpellEffectFnType _pEffectHandlerScript,uint8 _effIndex, uint16 _effName) : _SpellScript::EffectNameCheck(_effName), _SpellScript::EffectHook(_effIndex) { @@ -445,6 +455,17 @@ void SpellScript::FinishCast(SpellCastResult result) m_spell->finish(result == SPELL_CAST_OK); } +void SpellScript::SetCustomCastResultMessage(SpellCustomErrors result) +{ + if (!IsInCheckCastHook()) + { + sLog->outError("TSCR: Script: `%s` Spell: `%u`: function SpellScript::SetCustomCastResultMessage was called while spell not in check cast phase!", m_scriptName->c_str(), m_scriptSpellId); + return; + } + + m_spell->m_customError = result; +} + int32 SpellScript::GetTrueDamage() { if (!IsInAfterHitPhase()) diff --git a/src/server/game/Spells/SpellScript.h b/src/server/game/Spells/SpellScript.h index 9c6c78c6aeb06..4612bcfa5257d 100755 --- a/src/server/game/Spells/SpellScript.h +++ b/src/server/game/Spells/SpellScript.h @@ -121,11 +121,12 @@ enum SpellScriptHookType SPELL_SCRIPT_HOOK_HIT, SPELL_SCRIPT_HOOK_AFTER_HIT, SPELL_SCRIPT_HOOK_UNIT_TARGET_SELECT, + SPELL_SCRIPT_HOOK_CHECK_CAST, }; #define HOOK_SPELL_HIT_START SPELL_SCRIPT_HOOK_EFFECT #define HOOK_SPELL_HIT_END SPELL_SCRIPT_HOOK_AFTER_HIT + 1 #define HOOK_SPELL_START SPELL_SCRIPT_HOOK_EFFECT -#define HOOK_SPELL_END SPELL_SCRIPT_HOOK_UNIT_TARGET_SELECT + 1 +#define HOOK_SPELL_END SPELL_SCRIPT_HOOK_CHECK_CAST + 1 #define HOOK_SPELL_COUNT HOOK_SPELL_END - HOOK_SPELL_START class SpellScript : public _SpellScript @@ -134,12 +135,22 @@ class SpellScript : public _SpellScript // DO NOT OVERRIDE THESE IN SCRIPTS public: #define SPELLSCRIPT_FUNCTION_TYPE_DEFINES(CLASSNAME) \ + typedef SpellCastResult(CLASSNAME::*SpellCheckCastFnType)(); \ typedef void(CLASSNAME::*SpellEffectFnType)(SpellEffIndex); \ typedef void(CLASSNAME::*SpellHitFnType)(); \ typedef void(CLASSNAME::*SpellUnitTargetFnType)(std::list&); \ SPELLSCRIPT_FUNCTION_TYPE_DEFINES(SpellScript) + class CheckCastHandler + { + public: + CheckCastHandler(SpellCheckCastFnType checkCastHandlerScript); + SpellCastResult Call(SpellScript* spellScript); + private: + SpellCheckCastFnType _checkCastHandlerScript; + }; + class EffectHandler : public _SpellScript::EffectNameCheck, public _SpellScript::EffectHook { public: @@ -173,6 +184,7 @@ class SpellScript : public _SpellScript }; #define SPELLSCRIPT_FUNCTION_CAST_DEFINES(CLASSNAME) \ + class CheckCastHandlerFunction : public SpellScript::CheckCastHandler { public: CheckCastHandlerFunction(SpellCheckCastFnType _checkCastHandlerScript) : SpellScript::CheckCastHandler((SpellScript::SpellCheckCastFnType)_checkCastHandlerScript) {} }; \ class EffectHandlerFunction : public SpellScript::EffectHandler { public: EffectHandlerFunction(SpellEffectFnType _pEffectHandlerScript,uint8 _effIndex, uint16 _effName) : SpellScript::EffectHandler((SpellScript::SpellEffectFnType)_pEffectHandlerScript, _effIndex, _effName) {} }; \ class HitHandlerFunction : public SpellScript::HitHandler { public: HitHandlerFunction(SpellHitFnType _pHitHandlerScript) : SpellScript::HitHandler((SpellScript::SpellHitFnType)_pHitHandlerScript) {} }; \ class UnitTargetHandlerFunction : public SpellScript::UnitTargetHandler { public: UnitTargetHandlerFunction(SpellUnitTargetFnType _pUnitTargetHandlerScript, uint8 _effIndex, uint16 _targetType) : SpellScript::UnitTargetHandler((SpellScript::SpellUnitTargetFnType)_pUnitTargetHandlerScript, _effIndex, _targetType) {} }; \ @@ -186,8 +198,9 @@ class SpellScript : public _SpellScript bool _IsDefaultEffectPrevented(SpellEffIndex effIndex) { return m_hitPreventDefaultEffectMask & (1<= HOOK_SPELL_HIT_START && m_currentScriptState < HOOK_SPELL_HIT_END); } - bool IsInEffectHook() { return (m_currentScriptState == SPELL_SCRIPT_HOOK_EFFECT); } + bool IsInCheckCastHook() const { return m_currentScriptState == SPELL_SCRIPT_HOOK_CHECK_CAST; } + bool IsInHitPhase() const { return (m_currentScriptState >= HOOK_SPELL_HIT_START && m_currentScriptState < HOOK_SPELL_HIT_END); } + bool IsInEffectHook() const { return (m_currentScriptState == SPELL_SCRIPT_HOOK_EFFECT); } bool IsInAfterHitPhase() { return (m_currentScriptState == SPELL_SCRIPT_HOOK_AFTER_HIT); }; private: Spell * m_spell; @@ -198,6 +211,12 @@ class SpellScript : public _SpellScript // SpellScript interface // hooks to which you can attach your functions // + + // example: OnCheckCast += SpellCheckCastFn(); + // where function is SpellCastResult function() + HookList OnCheckCast; + #define SpellCheckCastFn(F) CheckCastHandlerFunction(&F) + // example: OnEffect += SpellEffectFn(class::function, EffectIndexSpecifier, EffectNameSpecifier); // where function is void function(SpellEffIndex effIndex) HookList OnEffect; @@ -296,6 +315,8 @@ class SpellScript : public _SpellScript // finishes spellcast prematurely with selected error message void FinishCast(SpellCastResult result); + void SetCustomCastResultMessage(SpellCustomErrors result); + // returns total damage of a spell (crit comprensive) int32 GetTrueDamage(); }; @@ -458,7 +479,7 @@ class AuraScript : public _SpellScript // executed when periodic aura effect is updated // example: OnEffectUpdatePeriodic += AuraEffectUpdatePeriodicFn(class::function, EffectIndexSpecifier, EffectAuraNameSpecifier); - // where function is: void function (AuraEffect const * aurEff); + // where function is: void function (AuraEffect * aurEff); HookList OnEffectUpdatePeriodic; #define AuraEffectUpdatePeriodicFn(F, I, N) EffectUpdatePeriodicHandlerFunction(&F, I, N) diff --git a/src/server/game/Texts/CreatureTextMgr.cpp b/src/server/game/Texts/CreatureTextMgr.cpp index 29a58d791651e..079789befaa1f 100755 --- a/src/server/game/Texts/CreatureTextMgr.cpp +++ b/src/server/game/Texts/CreatureTextMgr.cpp @@ -417,14 +417,14 @@ bool CreatureTextMgr::TextExist(uint32 sourceEntry, uint8 textGroup) CreatureTextMap::const_iterator sList = mTextMap.find(sourceEntry); if (sList == mTextMap.end()) { - sLog->outDebug("CreatureTextMgr::TextExist: Could not find Text for Creature (entry %u) in 'creature_text' table.", sourceEntry); + sLog->outDebug(LOG_FILTER_UNITS, "CreatureTextMgr::TextExist: Could not find Text for Creature (entry %u) in 'creature_text' table.", sourceEntry); return false; } CreatureTextHolder TextHolder = (*sList).second; CreatureTextHolder::const_iterator itr = TextHolder.find(textGroup); if (itr == TextHolder.end()) { - sLog->outDebug("CreatureTextMgr::TextExist: Could not find TextGroup %u for Creature (entry %u).",uint32(textGroup), sourceEntry); + sLog->outDebug(LOG_FILTER_UNITS, "CreatureTextMgr::TextExist: Could not find TextGroup %u for Creature (entry %u).",uint32(textGroup), sourceEntry); return false; } return true; diff --git a/src/server/game/Tools/PlayerDump.h b/src/server/game/Tools/PlayerDump.h index 3067552a4087e..a6e379a934ee3 100755 --- a/src/server/game/Tools/PlayerDump.h +++ b/src/server/game/Tools/PlayerDump.h @@ -30,8 +30,7 @@ enum DumpTableType DTT_CHAR_TABLE, // // character_achievement, character_achievement_progress, // character_action, character_aura, character_homebind, // character_queststatus, character_queststatus_rewarded, character_reputation, - // character_spell, character_spell_cooldown, character_ticket, character_talent, - // character_tutorial + // character_spell, character_spell_cooldown, character_ticket, character_talent DTT_EQSET_TABLE, // <- guid // character_equipmentsets diff --git a/src/server/game/Weather/Weather.cpp b/src/server/game/Weather/Weather.cpp index b191b85d47b6b..d21de1c1fad68 100755 --- a/src/server/game/Weather/Weather.cpp +++ b/src/server/game/Weather/Weather.cpp @@ -97,7 +97,7 @@ bool Weather::ReGenerate() static char const* seasonName[WEATHER_SEASONS] = { "spring", "summer", "fall", "winter" }; - sLog->outDebug("Generating a change in %s weather for zone %u.", seasonName[season], m_zone); + sLog->outDetail("Generating a change in %s weather for zone %u.", seasonName[season], m_zone); if ((u < 60) && (m_grade < 0.33333334f)) // Get fair { diff --git a/src/server/game/Weather/WeatherMgr.cpp b/src/server/game/Weather/WeatherMgr.cpp index ba00de8a956cf..79600b482df63 100755 --- a/src/server/game/Weather/WeatherMgr.cpp +++ b/src/server/game/Weather/WeatherMgr.cpp @@ -89,7 +89,6 @@ void WeatherMgr::LoadWeatherData() return; } - do { Field *fields = result->Fetch(); diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index fda9ef51dd12f..31bfae69ba446 100755 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1221,6 +1221,12 @@ void World::SetInitialWorldSettings() exit(1); } + ///- Initialize pool manager + sPoolMgr->Initialize(); + + ///- Initialize game event manager + sGameEventMgr->Initialize(); + ///- Loading strings. Getting no records means core load has to be canceled because no error message can be output. sLog->outString(); sLog->outString("Loading Trinity strings..."); @@ -1256,9 +1262,9 @@ void World::SetInitialWorldSettings() sLog->outString("Loading SkillLineAbilityMultiMap Data..."); sSpellMgr->LoadSkillLineAbilityMap(); - ///- Clean up and pack instances - sLog->outString("Cleaning up and packing instances..."); - sInstanceSaveMgr->CleanupAndPackInstances(); // must be called before `creature_respawn`/`gameobject_respawn` tables + // Must be called before `creature_respawn`/`gameobject_respawn` tables + sLog->outString("Loading instances..."); + sInstanceSaveMgr->LoadInstances(); sLog->outString("Loading Localization strings..."); uint32 oldMSTime = getMSTime(); @@ -1366,9 +1372,6 @@ void World::SetInitialWorldSettings() sLog->outString("Loading Creature Template Addon Data..."); sObjectMgr->LoadCreatureAddons(); // must be after LoadCreatureTemplates() and LoadCreatures() - sLog->outString("Loading Vehicle Accessories..."); - sObjectMgr->LoadVehicleAccessories(); // must be after LoadCreatureTemplates() - sLog->outString("Loading Creature Respawn Data..."); // must be after PackInstances() sObjectMgr->LoadCreatureRespawnTimes(); @@ -1379,10 +1382,7 @@ void World::SetInitialWorldSettings() sObjectMgr->LoadGameobjectRespawnTimes(); sLog->outString("Loading Creature Linked Respawn..."); - sObjectMgr->LoadLinkedRespawn(); // must be after LoadCreatures(), LoadGameObjects() - - sLog->outString("Loading Objects Pooling Data..."); // TODOLEAK: scope - sPoolMgr->LoadFromDB(); + sObjectMgr->LoadLinkedRespawn(); // must be after LoadCreatures(), LoadGameObjects() sLog->outString("Loading Weather Data..."); sWeatherMgr->LoadWeatherData(); @@ -1399,11 +1399,20 @@ void World::SetInitialWorldSettings() sLog->outString("Loading Quests Relations..."); sObjectMgr->LoadQuestRelations(); // must be after quest load - sLog->outString("Loading Quest Pooling Data..."); - sPoolMgr->LoadQuestPools(); + sLog->outString("Loading Objects Pooling Data..."); + sPoolMgr->LoadFromDB(); sLog->outString("Loading Game Event Data..."); // must be after loading pools fully - sGameEventMgr->LoadFromDB(); // TODOLEAK: add scopes + sGameEventMgr->LoadFromDB(); + + sLog->outString("Loading UNIT_NPC_FLAG_SPELLCLICK Data..."); // must be after LoadQuests + sObjectMgr->LoadNPCSpellClickSpells(); + + sLog->outString("Loading Vehicle Template Accessories..."); + sObjectMgr->LoadVehicleTemplateAccessories(); // must be after LoadCreatureTemplates() and LoadNPCSpellClickSpells() + + sLog->outString("Loading Vehicle Accessories..."); + sObjectMgr->LoadVehicleAccessories(); // must be after LoadCreatureTemplates() and LoadNPCSpellClickSpells() sLog->outString("Loading Dungeon boss data..."); sObjectMgr->LoadInstanceEncounters(); @@ -1411,9 +1420,6 @@ void World::SetInitialWorldSettings() sLog->outString("Loading LFG rewards..."); sLFGMgr->LoadRewards(); - sLog->outString("Loading UNIT_NPC_FLAG_SPELLCLICK Data..."); - sObjectMgr->LoadNPCSpellClickSpells(); - sLog->outString("Loading SpellArea Data..."); // must be after quest load sSpellMgr->LoadSpellAreas(); @@ -1474,7 +1480,7 @@ void World::SetInitialWorldSettings() sObjectMgr->LoadMailLevelRewards(); // Loot tables - LoadLootTables(); //TODOLEAK: untangle that shit + LoadLootTables(); sLog->outString("Loading Skill Discovery Table..."); LoadSkillDiscoveryTable(); @@ -1605,7 +1611,7 @@ void World::SetInitialWorldSettings() sCreatureTextMgr->LoadCreatureTexts(); sLog->outString("Initializing Scripts..."); - sScriptMgr->Initialize(); //LEAKTODO + sScriptMgr->Initialize(); sLog->outString("Validating spell scripts..."); sObjectMgr->ValidateSpellScripts(); @@ -1614,7 +1620,7 @@ void World::SetInitialWorldSettings() sSmartScriptMgr->LoadSmartAIFromDB(); ///- Initialize game time and timers - sLog->outDebug("DEBUG:: Initialize game time and timers"); + sLog->outString("Initialize game time and timers"); m_gameTime = time(NULL); m_startTime=m_gameTime; @@ -1651,7 +1657,7 @@ void World::SetInitialWorldSettings() mail_timer = ((((localtime(&m_gameTime)->tm_hour + 20) % 24)* HOUR * IN_MILLISECONDS) / m_timers[WUPDATE_AUCTIONS].GetInterval()); //1440 mail_timer_expires = ((DAY * IN_MILLISECONDS) / (m_timers[WUPDATE_AUCTIONS].GetInterval())); - sLog->outDebug("Mail timer set to: " UI64FMTD ", mail return is called every " UI64FMTD " minutes", uint64(mail_timer), uint64(mail_timer_expires)); + sLog->outDetail("Mail timer set to: " UI64FMTD ", mail return is called every " UI64FMTD " minutes", uint64(mail_timer), uint64(mail_timer_expires)); ///- Initilize static helper structures AIRegistry::Initialize(); @@ -1662,7 +1668,7 @@ void World::SetInitialWorldSettings() sMapMgr->Initialize(); sLog->outString("Starting Game Event system..."); - uint32 nextGameEvent = sGameEventMgr->Initialize(); + uint32 nextGameEvent = sGameEventMgr->StartSystem(); m_timers[WUPDATE_EVENTS].SetInterval(nextGameEvent); //depend on next event // Delete all characters which have been deleted X days before @@ -1697,9 +1703,6 @@ void World::SetInitialWorldSettings() sLog->outString("Deleting expired bans..."); LoginDatabase.Execute("DELETE FROM ip_banned WHERE unbandate <= UNIX_TIMESTAMP() AND unbandate<>bandate"); - sLog->outString("Starting objects Pooling system..."); - sPoolMgr->Initialize(); - sLog->outString("Calculate next daily quest reset time..."); InitDailyQuestResetTime(); @@ -2524,7 +2527,7 @@ void World::ProcessCliCommands() CliCommandHolder* command; while (cliCmdQueue.next(command)) { - sLog->outDebug("CLI command under processing..."); + sLog->outDetail("CLI command under processing..."); zprint = command->m_print; callbackArg = command->m_callbackArg; CliHandler handler(callbackArg, zprint); @@ -2565,9 +2568,9 @@ void World::SendAutoBroadcast() WorldPacket data(SMSG_NOTIFICATION, (msg.size()+1)); data << msg; sWorld->SendGlobalMessage(&data); - } - sLog->outDebug("AutoBroadcast: '%s'",msg.c_str()); + + sLog->outDetail("AutoBroadcast: '%s'",msg.c_str()); } void World::UpdateRealmCharCount(uint32 accountId) diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp index c375e2e63e5e9..c69367278857b 100644 --- a/src/server/scripts/Commands/cs_debug.cpp +++ b/src/server/scripts/Commands/cs_debug.cpp @@ -391,12 +391,12 @@ class debug_commandscript : public CommandScript } else { - sLog->outDebug("Sending opcode: unknown type '%s'", type.c_str()); + sLog->outError("Sending opcode: unknown type '%s'", type.c_str()); break; } } ifs.close(); - sLog->outDebug("Sending opcode %u", data.GetOpcode()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Sending opcode %u", data.GetOpcode()); data.hexlike(); player->GetSession()->SendPacket(&data); handler->PSendSysMessage(LANG_COMMAND_OPCODESENT, data.GetOpcode(), unit->GetName()); @@ -516,22 +516,17 @@ class debug_commandscript : public CommandScript if (i >= BUYBACK_SLOT_START && i < BUYBACK_SLOT_END) continue; - Item *item = player->GetItemByPos(INVENTORY_SLOT_BAG_0, i); - if (!item) continue; - if (!item->IsBag()) - { - if (item->GetState() == state) - handler->PSendSysMessage("bag: 255 slot: %d guid: %d owner: %d", item->GetSlot(), item->GetGUIDLow(), GUID_LOPART(item->GetOwnerGUID())); - } - else + if (Item *item = player->GetItemByPos(INVENTORY_SLOT_BAG_0, i)) { - Bag *bag = (Bag*)item; - for (uint8 j = 0; j < bag->GetBagSize(); ++j) + if (Bag* bag = item->ToBag()) { - Item* item2 = bag->GetItemByPos(j); - if (item2 && item2->GetState() == state) - handler->PSendSysMessage("bag: 255 slot: %d guid: %d owner: %d", item2->GetSlot(), item2->GetGUIDLow(), GUID_LOPART(item2->GetOwnerGUID())); + for (uint8 j = 0; j < bag->GetBagSize(); ++j) + if (Item* item2 = bag->GetItemByPos(j)) + if (item2->GetState() == state) + handler->PSendSysMessage("bag: 255 slot: %d guid: %d owner: %d", item2->GetSlot(), item2->GetGUIDLow(), GUID_LOPART(item2->GetOwnerGUID())); } + else if (item->GetState() == state) + handler->PSendSysMessage("bag: 255 slot: %d guid: %d owner: %d", item->GetSlot(), item->GetGUIDLow(), GUID_LOPART(item->GetOwnerGUID())); } } } @@ -619,9 +614,8 @@ class debug_commandscript : public CommandScript error = true; continue; } - if (item->IsBag()) + if (Bag* bag = item->ToBag()) { - Bag *bag = (Bag*)item; for (uint8 j = 0; j < bag->GetBagSize(); ++j) { Item* item2 = bag->GetItemByPos(j); @@ -1053,14 +1047,12 @@ class debug_commandscript : public CommandScript if (isint32) { iValue = (uint32)atoi(py); - sLog->outDebug(handler->GetTrinityString(LANG_SET_UINT), GUID_LOPART(guid), Opcode, iValue); target->SetUInt32Value(Opcode , iValue); handler->PSendSysMessage(LANG_SET_UINT_FIELD, GUID_LOPART(guid), Opcode,iValue); } else { fValue = (float)atof(py); - sLog->outDebug(handler->GetTrinityString(LANG_SET_FLOAT), GUID_LOPART(guid), Opcode, fValue); target->SetFloatValue(Opcode , fValue); handler->PSendSysMessage(LANG_SET_FLOAT_FIELD, GUID_LOPART(guid), Opcode,fValue); } @@ -1104,13 +1096,11 @@ class debug_commandscript : public CommandScript if (isint32) { iValue = target->GetUInt32Value(Opcode); - sLog->outDebug(handler->GetTrinityString(LANG_GET_UINT), GUID_LOPART(guid), Opcode, iValue); handler->PSendSysMessage(LANG_GET_UINT_FIELD, GUID_LOPART(guid), Opcode, iValue); } else { fValue = target->GetFloatValue(Opcode); - sLog->outDebug(handler->GetTrinityString(LANG_GET_FLOAT), GUID_LOPART(guid), Opcode, fValue); handler->PSendSysMessage(LANG_GET_FLOAT_FIELD, GUID_LOPART(guid), Opcode, fValue); } @@ -1137,8 +1127,6 @@ class debug_commandscript : public CommandScript return false; } - sLog->outDebug(handler->GetTrinityString(LANG_CHANGE_32BIT), Opcode, Value); - int CurrentValue = (int)handler->GetSession()->GetPlayer()->GetUInt32Value(Opcode); CurrentValue += Value; @@ -1223,8 +1211,6 @@ class debug_commandscript : public CommandScript if (Value > 32) //uint32 = 32 bits return false; - sLog->outDebug(handler->GetTrinityString(LANG_SET_32BIT), Opcode, Value); - uint32 iValue = Value ? 1 << (Value - 1) : 0; target->SetUInt32Value(Opcode , iValue); diff --git a/src/server/scripts/Commands/cs_gobject.cpp b/src/server/scripts/Commands/cs_gobject.cpp index d5f589928b68a..aef5e85bdd386 100644 --- a/src/server/scripts/Commands/cs_gobject.cpp +++ b/src/server/scripts/Commands/cs_gobject.cpp @@ -159,7 +159,7 @@ class gobject_commandscript : public CommandScript { uint32 value = atoi((char*)spawntimeSecs); pGameObj->SetRespawnTime(value); - //sLog->outDebug("*** spawntimeSecs: %d", value); + //sLog->outDebug(LOG_FILTER_TSCR, "*** spawntimeSecs: %d", value); } // fill the gameobject data and save to the db @@ -172,8 +172,6 @@ class gobject_commandscript : public CommandScript return false; } - sLog->outDebug(handler->GetTrinityString(LANG_GAMEOBJECT_CURRENT), gInfo->name, db_lowGUID, x, y, z, o); - map->Add(pGameObj); // TODO: is it really necessary to add both the real and DB table guid here ? @@ -245,14 +243,14 @@ class gobject_commandscript : public CommandScript else { std::ostringstream eventFilter; - eventFilter << " AND (event IS NULL "; + eventFilter << " AND (eventEntry IS NULL "; bool initString = true; for (GameEventMgr::ActiveEvents::const_iterator itr = activeEventsList.begin(); itr != activeEventsList.end(); ++itr) { if (initString) { - eventFilter << "OR event IN (" <<*itr; + eventFilter << "OR eventEntry IN (" <<*itr; initString =false; } else @@ -266,8 +264,9 @@ class gobject_commandscript : public CommandScript result = WorldDatabase.PQuery("SELECT gameobject.guid, id, position_x, position_y, position_z, orientation, map, phaseMask, " "(POW(position_x - %f, 2) + POW(position_y - %f, 2) + POW(position_z - %f, 2)) AS order_ FROM gameobject " - "LEFT OUTER JOIN game_event_gameobject on gameobject.guid=game_event_gameobject.guid WHERE map = '%i' %s ORDER BY order_ ASC LIMIT 10", - handler->GetSession()->GetPlayer()->GetPositionX(), handler->GetSession()->GetPlayer()->GetPositionY(), handler->GetSession()->GetPlayer()->GetPositionZ(), handler->GetSession()->GetPlayer()->GetMapId(),eventFilter.str().c_str()); + "LEFT OUTER JOIN game_event_gameobject on gameobject.guid = game_event_gameobject.guid WHERE map = '%i' %s ORDER BY order_ ASC LIMIT 10", + handler->GetSession()->GetPlayer()->GetPositionX(), handler->GetSession()->GetPlayer()->GetPositionY(), handler->GetSession()->GetPlayer()->GetPositionZ(), + handler->GetSession()->GetPlayer()->GetMapId(),eventFilter.str().c_str()); } if (!result) diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp index ed76147bc7643..72698be3742b1 100644 --- a/src/server/scripts/Commands/cs_npc.cpp +++ b/src/server/scripts/Commands/cs_npc.cpp @@ -536,7 +536,7 @@ class npc_commandscript : public CommandScript std::string curRespawnDelayStr = secsToTimeString(uint64(curRespawnDelay),true); std::string defRespawnDelayStr = secsToTimeString(target->GetRespawnDelay(),true); - handler->PSendSysMessage(LANG_NPCINFO_CHAR, target->GetDBTableGUIDLow(), faction, npcflags, Entry, displayid, nativeid); + handler->PSendSysMessage(LANG_NPCINFO_CHAR, target->GetDBTableGUIDLow(), target->GetGUIDLow(), faction, npcflags, Entry, displayid, nativeid); handler->PSendSysMessage(LANG_NPCINFO_LEVEL, target->getLevel()); handler->PSendSysMessage(LANG_NPCINFO_HEALTH,target->GetCreateHealth(), target->GetMaxHealth(), target->GetHealth()); handler->PSendSysMessage(LANG_NPCINFO_FLAGS, target->GetUInt32Value(UNIT_FIELD_FLAGS), target->GetUInt32Value(UNIT_DYNAMIC_FLAGS), target->getFaction()); diff --git a/src/server/scripts/Commands/cs_reload.cpp b/src/server/scripts/Commands/cs_reload.cpp index b4cd6d6f8a9dc..45579ff1e648f 100644 --- a/src/server/scripts/Commands/cs_reload.cpp +++ b/src/server/scripts/Commands/cs_reload.cpp @@ -151,6 +151,8 @@ class reload_commandscript : public CommandScript { "spell_group_stack_rules", SEC_ADMINISTRATOR, true, &HandleReloadSpellGroupStackRulesCommand, "", NULL }, { "trinity_string", SEC_ADMINISTRATOR, true, &HandleReloadTrinityStringCommand, "", NULL }, { "waypoint_scripts", SEC_ADMINISTRATOR, true, &HandleReloadWpScriptsCommand, "", NULL }, + { "vehicle_accessory", SEC_ADMINISTRATOR, true, &HandleReloadVehicleAccessoryCommand, "", NULL }, + { "vehicle_template_accessory", SEC_ADMINISTRATOR, true, &HandleReloadVehicleTemplateAccessoryCommand, "", NULL }, { NULL, 0, false, NULL, "", NULL } }; static ChatCommand commandTable[] = @@ -190,6 +192,9 @@ class reload_commandscript : public CommandScript HandleReloadTrinityStringCommand(handler,""); HandleReloadGameTeleCommand(handler,""); + HandleReloadVehicleAccessoryCommand(handler, ""); + HandleReloadVehicleTemplateAccessoryCommand(handler, ""); + HandleReloadAutobroadcastCommand(handler,""); return true; } @@ -1273,6 +1278,22 @@ class reload_commandscript : public CommandScript handler->SendGlobalGMSysMessage("Smart Scripts reloaded."); return true; } + + static bool HandleReloadVehicleAccessoryCommand(ChatHandler* handler, const char* /*args*/) + { + sLog->outString("Reloading vehicle_accessory table..."); + sObjectMgr->LoadVehicleAccessories(); + handler->SendGlobalGMSysMessage("Vehicle accessories reloaded."); + return true; + } + + static bool HandleReloadVehicleTemplateAccessoryCommand(ChatHandler* handler, const char* /*args*/) + { + sLog->outString("Reloading vehicle_template_accessory table..."); + sObjectMgr->LoadVehicleTemplateAccessories(); + handler->SendGlobalGMSysMessage("Vehicle template accessories reloaded."); + return true; + } }; void AddSC_reload_commandscript() diff --git a/src/server/scripts/Commands/cs_wp.cpp b/src/server/scripts/Commands/cs_wp.cpp index badbb78971348..fcb15b4b6f37c 100644 --- a/src/server/scripts/Commands/cs_wp.cpp +++ b/src/server/scripts/Commands/cs_wp.cpp @@ -75,8 +75,6 @@ class wp_commandscript : public CommandScript */ static bool HandleWpAddCommand(ChatHandler* handler, const char* args) { - sLog->outDebug("DEBUG: HandleWpAddCommand"); - // optional char* path_number = NULL; uint32 pathid = 0; @@ -96,7 +94,6 @@ class wp_commandscript : public CommandScript QueryResult result = WorldDatabase.Query("SELECT MAX(id) FROM waypoint_data"); uint32 maxpathid = result->Fetch()->GetInt32(); pathid = maxpathid+1; - sLog->outDebug("DEBUG: HandleWpAddCommand - New path started."); handler->PSendSysMessage("%s%s|r", "|cff00ff00", "New path started."); } } @@ -108,13 +105,10 @@ class wp_commandscript : public CommandScript if (!pathid) { - sLog->outDebug("DEBUG: HandleWpAddCommand - Current creature haven't loaded path."); handler->PSendSysMessage("%s%s|r", "|cffff33ff", "Current creature haven't loaded path."); return true; } - sLog->outDebug("DEBUG: HandleWpAddCommand - point == 0"); - QueryResult result = WorldDatabase.PQuery("SELECT MAX(point) FROM waypoint_data WHERE id = '%u'",pathid); if (result) @@ -147,7 +141,7 @@ class wp_commandscript : public CommandScript // Did player provide a path_id? if (!path_number) - sLog->outDebug("DEBUG: HandleWpLoadPathCommand - No path number provided"); + return false; if (!target) { @@ -167,7 +161,7 @@ class wp_commandscript : public CommandScript if (!pathid) { - handler->PSendSysMessage("%s%s|r", "|cffff33ff", "No vallid path number provided."); + handler->PSendSysMessage("%s%s|r", "|cffff33ff", "No valid path number provided."); return true; } @@ -452,8 +446,6 @@ class wp_commandscript : public CommandScript static bool HandleWpModifyCommand(ChatHandler* handler, const char* args) { - sLog->outDebug("DEBUG: HandleWpModifyCommand"); - if (!*args) return false; @@ -491,7 +483,6 @@ class wp_commandscript : public CommandScript return false; } - sLog->outDebug("DEBUG: HandleWpModifyCommand - User did select an NPC"); // The visual waypoint Creature* wpCreature = NULL; wpGuid = target->GetGUIDLow(); @@ -513,8 +504,6 @@ class wp_commandscript : public CommandScript if (!result) { - sLog->outDebug("DEBUG: HandleWpModifyCommand - No waypoint found - used 'wpguid'"); - handler->PSendSysMessage(LANG_WAYPOINT_NOTFOUNDSEARCH, target->GetGUIDLow()); // Select waypoint number from database // Since we compare float values, we have to deal with @@ -531,7 +520,6 @@ class wp_commandscript : public CommandScript return true; } } - sLog->outDebug("DEBUG: HandleWpModifyCommand - After getting wpGuid"); do { @@ -546,8 +534,6 @@ class wp_commandscript : public CommandScript arg_str = strtok((char*)NULL, " "); } - sLog->outDebug("DEBUG: HandleWpModifyCommand - Parameters parsed - now execute the command"); - // Check for argument if (show != "del" && show != "move" && arg_str == NULL) { @@ -644,8 +630,6 @@ class wp_commandscript : public CommandScript static bool HandleWpShowCommand(ChatHandler* handler, const char* args) { - sLog->outDebug("DEBUG: HandleWpShowCommand"); - if (!*args) return false; @@ -656,7 +640,6 @@ class wp_commandscript : public CommandScript // second arg: GUID (optional, if a creature is selected) char* guid_str = strtok((char*)NULL, " "); - sLog->outDebug("DEBUG: HandleWpShowCommand: show_str: %s guid_str: %s", show_str, guid_str); uint32 pathid = 0; Creature* target = handler->getSelectedCreature(); @@ -665,7 +648,6 @@ class wp_commandscript : public CommandScript if (!guid_str) { - sLog->outDebug("DEBUG: HandleWpShowCommand: !guid_str"); // No PathID provided // -> Player must have selected a creature @@ -680,7 +662,6 @@ class wp_commandscript : public CommandScript } else { - sLog->outDebug("|cff00ff00DEBUG: HandleWpShowCommand: PathID provided|r"); // PathID provided // Warn if player also selected a creature // -> Creature selection is ignored <- @@ -690,13 +671,9 @@ class wp_commandscript : public CommandScript pathid = atoi((char*)guid_str); } - sLog->outDebug("DEBUG: HandleWpShowCommand: danach"); - std::string show = show_str; uint32 Maxpoint; - sLog->outDebug("DEBUG: HandleWpShowCommand: PathID: %u", pathid); - //handler->PSendSysMessage("wpshow - show: %s", show); // Show info for the selected waypoint @@ -811,7 +788,6 @@ class wp_commandscript : public CommandScript return false; } - sLog->outDebug("DEBUG: UPDATE waypoint_data SET wpguid = '%u' WHERE id = '%u' and point = '%u'", wpCreature->GetGUIDLow(), pathid, point); // set "wpguid" column to the visual waypoint WorldDatabase.PExecute("UPDATE waypoint_data SET wpguid = '%u' WHERE id = '%u' and point = '%u'", wpCreature->GetGUIDLow(), pathid, point); diff --git a/src/server/scripts/Custom/CMakeLists.txt b/src/server/scripts/Custom/CMakeLists.txt index 4de0d6e84e52b..2570724e3e27d 100644 --- a/src/server/scripts/Custom/CMakeLists.txt +++ b/src/server/scripts/Custom/CMakeLists.txt @@ -3,6 +3,7 @@ set(scripts_STAT_SRCS Custom/npc_guildhouses.cpp Custom/npc_lottery.cpp Custom/npcs_mini_boss.cpp + Custom/npc_zingara.cpp ) message(" -> Prepared: Custom") diff --git a/src/server/scripts/Custom/npc_zingara.cpp b/src/server/scripts/Custom/npc_zingara.cpp new file mode 100644 index 0000000000000..9a59297c577c7 --- /dev/null +++ b/src/server/scripts/Custom/npc_zingara.cpp @@ -0,0 +1,118 @@ +/* + * 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: BloodyWars - La Zingara +SDAuthor: PrinceCreed - Nymeria +SD%Complete: 100% +SDComment: // +SDCategory: Custom +EndScriptData */ + +#include "ScriptPCH.h" + +/*###### +## npc_zingara +######*/ + +#define GOSSIP_SPAWN_CHESTS "Spawna le casse" + +const Position ChestPos[10] = +{ + {5825.20f,760.12f,640.34f,0}, + {5825.20f,758.12f,640.40f,0}, + {5825.20f,756.12f,640.48f,0}, + {5825.20f,754.12f,640.58f,0}, + {5825.20f,752.12f,640.68f,0}, + {5825.20f,750.12f,640.78f,0}, + {5825.20f,748.12f,640.88f,0}, + {5825.20f,746.12f,640.98f,0}, + {5825.20f,744.12f,641.10f,0}, + {5825.20f,742.12f,641.18f,0} +}; + +class npc_zingara : public CreatureScript +{ +public: + npc_zingara() : CreatureScript("npc_zingara") { } + + bool OnGossipHello(Player* pPlayer, Creature* pCreature) + { + if (pPlayer && pPlayer->isGameMaster()) + { + pPlayer->PrepareGossipMenu(pCreature); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SPAWN_CHESTS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + pPlayer->SEND_GOSSIP_MENU(1, pCreature->GetGUID()); + } + return true; + } + + bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction) + { + pPlayer->PlayerTalkClass->ClearMenus(); + + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF: + if (pPlayer) + pPlayer->CLOSE_GOSSIP_MENU(); + uint32 chest = 1000000; + QueryResult result = WorldDatabase.Query("SELECT entry FROM `item_template` WHERE entry > 1000000 AND entry < 10000011 ORDER BY RAND();"); + do + { + ++chest; + Field *fields = result->Fetch(); + uint32 card = fields[0].GetUInt32(); + + WorldDatabase.PExecute("DELETE FROM `gameobject_loot_template` WHERE entry = %u", chest); + WorldDatabase.PExecute("INSERT INTO `gameobject_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES (%u,%u,%u,%u,%u,%u,%u);",chest,card,100,1,0,1,1); + } + while (result->NextRow()); + // reload gameobject_loot_template + LoadLootTemplates_Gameobject(); + LootTemplates_Gameobject.CheckLootRefs(); + // spawn chests + for (uint32 i = 1000001; i <= chest; i++) + { + uint32 Num = i - 1000001; + pCreature->SummonGameObject(i, ChestPos[Num].GetPositionX(),ChestPos[Num].GetPositionY(),ChestPos[Num].GetPositionZ(),M_PI,0,0,0,0,604800); + } + break; + } + return true; + } + + CreatureAI* GetAI(Creature* pCreature) const + { + return new npc_zingaraAI (pCreature); + } + + struct npc_zingaraAI : public ScriptedAI + { + npc_zingaraAI(Creature* pCreature) : ScriptedAI(pCreature) + { + me->SetVisible(false); + } + }; + +}; + +void AddSC_npc_zingara() +{ + new npc_zingara; +} + diff --git a/src/server/scripts/Custom/npcs_mini_boss.cpp b/src/server/scripts/Custom/npcs_mini_boss.cpp index 951fac9930aa7..786b515546fe2 100644 --- a/src/server/scripts/Custom/npcs_mini_boss.cpp +++ b/src/server/scripts/Custom/npcs_mini_boss.cpp @@ -59,7 +59,7 @@ enum QuelNagasSpells SUMMONED_MURLOC = 27649, SPELL_POISON_BOLT_VOLLEY = 54098, SPELL_ENTANGLE = 38316, - SPELL_WRATH = 63259 + SPELL_WRATH = 20698 }; // Quel'Nagas yells @@ -108,7 +108,7 @@ enum PerotharnSpells PIERCING_SHADOW = 36698, SHADOW_FLAME = 22539, HARVEST_SOUL = 28679, - SHADOW_BOLT = 61291 + SHADOW_BOLT = 41957 }; // Perotharn yells @@ -161,7 +161,7 @@ class npc_likantropo : public CreatureScript void Reset() { - me->SetDisplayId(17263); // human form + me->RestoreDisplayId(); EnrageTimer = 15000; WoundTimer = 5000; BiteTimer = 45000; @@ -186,7 +186,7 @@ class npc_likantropo : public CreatureScript void JustDied(Unit* /*killer*/) { me->MonsterYell(SAY_LIKANTROPO_DEATH, LANG_UNIVERSAL, 0); - me->SetDisplayId(17263); // human form + me->RestoreDisplayId(); } void UpdateAI(const uint32 uiDiff) @@ -220,7 +220,7 @@ class npc_likantropo : public CreatureScript if (BiteTimer <= uiDiff) { DoCast(me, WORGEN_BITE); - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,1)) me->AddAura(WORGEN_CALL, pTarget); BiteTimer = 45000; } else BiteTimer -= uiDiff; @@ -316,7 +316,7 @@ class npc_lava_boost : public CreatureScript if (LavaTimer <= uiDiff) { me->InterruptNonMeleeSpells(false); - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,1)) DoCast(pTarget, LAVA_BURST); DoCast(me, LIGHTNING_SHIELD); LavaTimer = 15000; @@ -326,7 +326,7 @@ class npc_lava_boost : public CreatureScript if (ShockTimer <= uiDiff) { me->InterruptNonMeleeSpells(false); - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,1)) DoCast(pTarget, EARTH_SHOCK); DoCast(me, LIGHTNING_RING); ShockTimer = 20000; @@ -433,7 +433,7 @@ class npc_quel_nagas : public CreatureScript me->AttackStop(); me->RemoveAllAuras(); // In Fase 2 evoca 3 Murloc - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) for (uint8 i = 1; i <= 3; i++) { me->SummonCreature(SUMMONED_MURLOC, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 60000); @@ -462,7 +462,7 @@ class npc_quel_nagas : public CreatureScript if (SporeTimer <= uiDiff) { me->InterruptNonMeleeSpells(false); - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) { Creature* trig = me->SummonCreature(TOXIC_SPORES_TRIGGER, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 30000); if (trig) @@ -486,7 +486,7 @@ class npc_quel_nagas : public CreatureScript if (RootTimer <= uiDiff) { me->InterruptNonMeleeSpells(false); - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(pTarget, SPELL_ENTANGLE); RootTimer = 25000; } else RootTimer -= uiDiff; @@ -566,7 +566,7 @@ class npc_might_of_sylvanas : public CreatureScript // Multishot ogni 2 sec if (MultiTimer <= uiDiff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(pTarget, SPELL_MULTISHOT); MultiTimer = 4000; } else MultiTimer -= uiDiff; @@ -581,7 +581,7 @@ class npc_might_of_sylvanas : public CreatureScript // Ogni 5 sec casta Snake Trap su un target random if (SnakeTimer <= uiDiff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) for (uint8 i = 1; i <= 3; i++) { me->SummonCreature(SUMMONED_SNAKE, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 60000); @@ -687,7 +687,7 @@ class npc_trollzilla : public CreatureScript // Summon Fire Elemental ogni 30 sec if (FireTimer <= uiDiff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) me->SummonCreature(SUMMON_FIRE_ELEMENTAL, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 60000); FireTimer = 30000; } else FireTimer -= uiDiff; @@ -773,7 +773,7 @@ class npc_perotharn : public CreatureScript if (GriefTimer <= uiDiff) { me->InterruptNonMeleeSpells(false); - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) DoCast(pTarget, STORM_OF_GRIEF); GriefTimer = 20000; } else GriefTimer -= uiDiff; @@ -782,7 +782,7 @@ class npc_perotharn : public CreatureScript if (PiercingTimer <= uiDiff) { me->InterruptNonMeleeSpells(false); - if (Unit *pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO,0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_TOPAGGRO,0)) DoCast(pTarget, PIERCING_SHADOW); PiercingTimer = 10000; } else PiercingTimer -= uiDiff; @@ -882,7 +882,7 @@ class npc_uznam_the_watcher : public CreatureScript // Shock of sorrow Ogni 40 sec. if (ShockTimer <= uiDiff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) DoCast(pTarget, SHOCK_OF_SORROW); ShockTimer = 40000; } else ShockTimer -= uiDiff; diff --git a/src/server/scripts/EasternKingdoms/AlteracValley/alterac_valley.cpp b/src/server/scripts/EasternKingdoms/AlteracValley/alterac_valley.cpp index 9b356d4b063a6..a249c31df28a6 100644 --- a/src/server/scripts/EasternKingdoms/AlteracValley/alterac_valley.cpp +++ b/src/server/scripts/EasternKingdoms/AlteracValley/alterac_valley.cpp @@ -162,7 +162,6 @@ class mob_av_marshal_or_warmaster : public CreatureScript uiEnrageTimer = urand(10*IN_MILLISECONDS,30*IN_MILLISECONDS); }else uiEnrageTimer -= diff; - // check if creature is not outside of building if (uiResetTimer <= diff) { diff --git a/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp b/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp index 60ad092a27931..3219b284c8040 100644 --- a/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp +++ b/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp @@ -27,8 +27,8 @@ enum Spells enum Yells { - YELL_AGGRO = -2100019, - YELL_EVADE = -2100020 + YELL_AGGRO = -1810023, + YELL_EVADE = -1810024 }; enum Creatures @@ -179,7 +179,6 @@ class boss_balinda : public CreatureScript uiFrostboltTimer = urand(4*IN_MILLISECONDS,12*IN_MILLISECONDS); } else uiFrostboltTimer -= diff; - // check if creature is not outside of building if (uiResetTimer < diff) { diff --git a/src/server/scripts/EasternKingdoms/AlteracValley/boss_drekthar.cpp b/src/server/scripts/EasternKingdoms/AlteracValley/boss_drekthar.cpp index ee7ac38d27f34..ad61e43bcd424 100644 --- a/src/server/scripts/EasternKingdoms/AlteracValley/boss_drekthar.cpp +++ b/src/server/scripts/EasternKingdoms/AlteracValley/boss_drekthar.cpp @@ -128,7 +128,6 @@ class boss_drekthar : public CreatureScript } }; - CreatureAI *GetAI(Creature *creature) const { return new boss_drektharAI(creature); diff --git a/src/server/scripts/EasternKingdoms/AlteracValley/boss_galvangar.cpp b/src/server/scripts/EasternKingdoms/AlteracValley/boss_galvangar.cpp index 5385eece8f100..74c0365c04107 100644 --- a/src/server/scripts/EasternKingdoms/AlteracValley/boss_galvangar.cpp +++ b/src/server/scripts/EasternKingdoms/AlteracValley/boss_galvangar.cpp @@ -41,7 +41,6 @@ class boss_galvangar : public CreatureScript { boss_galvangarAI(Creature *c) : ScriptedAI(c) {} - uint32 uiCleaveTimer; uint32 uiFrighteningShoutTimer; uint32 uiWhirlwind1Timer; @@ -49,7 +48,6 @@ class boss_galvangar : public CreatureScript uint32 uiMortalStrikeTimer; uint32 uiResetTimer; - void Reset() { uiCleaveTimer = urand(1*IN_MILLISECONDS,9*IN_MILLISECONDS); diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp index 0e72c048a0303..e46ed6c059342 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/blackrock_depths.cpp @@ -239,7 +239,7 @@ class npc_grimstone : public CreatureScript { pInstance->UpdateEncounterState(ENCOUNTER_CREDIT_KILL_CREATURE, NPC_GRIMSTONE, me); pInstance->SetData(TYPE_RING_OF_LAW,DONE); - sLog->outDebug("TSCR: npc_grimstone: event reached end and set complete."); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: npc_grimstone: event reached end and set complete."); } break; } @@ -368,7 +368,6 @@ class npc_grimstone : public CreatureScript }; - /*###### ## mob_phalanx ######*/ @@ -538,7 +537,6 @@ class npc_kharan_mighthammer : public CreatureScript }; - /*###### ## npc_lokhtos_darkbargainer ######*/ @@ -606,7 +604,6 @@ class npc_lokhtos_darkbargainer : public CreatureScript }; - /*###### ## npc_dughal_stormwing ######*/ @@ -1204,8 +1201,6 @@ class npc_tobias_seecher : public CreatureScript }; - - */ /*###### 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 f8027ed8ad49d..ab6a09a11d07c 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp @@ -81,7 +81,7 @@ class boss_emperor_dagran_thaurissan : public CreatureScript if (HandOfThaurissan_Timer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) DoCast(pTarget, SPELL_HANDOFTHAURISSAN); //3 Hands of Thaurissan will be casted @@ -110,7 +110,6 @@ class boss_emperor_dagran_thaurissan : public CreatureScript }; - void AddSC_boss_draganthaurissan() { new boss_emperor_dagran_thaurissan(); 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 234511a45dda8..02435e944732b 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_tomb_of_seven.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_tomb_of_seven.cpp @@ -95,7 +95,6 @@ class boss_gloomrel : public CreatureScript }; - enum DoomrelSpells { SPELL_SHADOWBOLTVOLLEY = 15245, diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/instance_blackrock_depths.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/instance_blackrock_depths.cpp index 12e0e2bef8c2d..509764f84f9e6 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/instance_blackrock_depths.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/instance_blackrock_depths.cpp @@ -214,7 +214,7 @@ class instance_blackrock_depths : public InstanceMapScript void SetData64(uint32 type, uint64 data) { - sLog->outDebug("TSCR: Instance Blackrock Depths: SetData64 update (Type: %u Data " UI64FMTD ")", type, data); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Blackrock Depths: SetData64 update (Type: %u Data " UI64FMTD ")", type, data); switch(type) { @@ -230,7 +230,7 @@ class instance_blackrock_depths : public InstanceMapScript void SetData(uint32 type, uint32 data) { - sLog->outDebug("TSCR: Instance Blackrock Depths: SetData update (Type: %u Data %u)", type, data); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Blackrock Depths: SetData update (Type: %u Data %u)", type, data); switch(type) { @@ -456,8 +456,7 @@ class instance_blackrock_depths : public InstanceMapScript }; - - void AddSC_instance_blackrock_depths() +void AddSC_instance_blackrock_depths() { new instance_blackrock_depths(); } diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_gyth.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_gyth.cpp index 7dab307f19b90..ff74de7cdafa2 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_gyth.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_gyth.cpp @@ -96,7 +96,7 @@ class boss_gyth : public CreatureScript Unit* Summoned = me->SummonCreature(creatureId, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 240000); if (Summoned) { - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0); if (pTarget) Summoned->AddThreat(pTarget, 1.0f); } @@ -202,7 +202,6 @@ class boss_gyth : public CreatureScript }; - void AddSC_boss_gyth() { new boss_gyth(); diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_razorgore.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_razorgore.cpp index 7ea2dfdf058cc..5c631f4b626d0 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_razorgore.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_razorgore.cpp @@ -123,7 +123,6 @@ class boss_razorgore : public CreatureScript }; - void AddSC_boss_razorgore() { new boss_razorgore(); diff --git a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_victor_nefarius.cpp b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_victor_nefarius.cpp index 1c3b68afb438b..b077ba1d82a20 100644 --- a/src/server/scripts/EasternKingdoms/BlackwingLair/boss_victor_nefarius.cpp +++ b/src/server/scripts/EasternKingdoms/BlackwingLair/boss_victor_nefarius.cpp @@ -381,9 +381,6 @@ class boss_victor_nefarius : public CreatureScript }; - - - void AddSC_boss_victor_nefarius() { new boss_victor_nefarius(); diff --git a/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp b/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp index 34a0e4524ef51..1f86bf407868a 100644 --- a/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp +++ b/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp @@ -543,9 +543,6 @@ class npc_blastmaster_emi_shortfuse : public CreatureScript }; - - - class boss_grubbis : public CreatureScript { public: @@ -592,7 +589,6 @@ class boss_grubbis : public CreatureScript }; - void AddSC_gnomeregan() { new npc_blastmaster_emi_shortfuse(); diff --git a/src/server/scripts/EasternKingdoms/Gnomeregan/instance_gnomeregan.cpp b/src/server/scripts/EasternKingdoms/Gnomeregan/instance_gnomeregan.cpp index b6d62379486c7..df1f5137f2b79 100644 --- a/src/server/scripts/EasternKingdoms/Gnomeregan/instance_gnomeregan.cpp +++ b/src/server/scripts/EasternKingdoms/Gnomeregan/instance_gnomeregan.cpp @@ -137,7 +137,6 @@ class instance_gnomeregan : public InstanceMapScript }; - void AddSC_instance_gnomeregan() { new instance_gnomeregan(); diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_curator.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_curator.cpp index 6c1e181da7b2a..612626909ef1f 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_curator.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_curator.cpp @@ -133,7 +133,7 @@ class boss_curator : public CreatureScript //Summon Astral Flare Creature* AstralFlare = DoSpawnCreature(17096, float(rand()%37), float(rand()%37), 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0); if (AstralFlare && pTarget) { @@ -184,7 +184,7 @@ class boss_curator : public CreatureScript else HatefulBoltTimer = 15000; - if (Unit *pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO, 1)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_TOPAGGRO, 1)) DoCast(pTarget, SPELL_HATEFUL_BOLT); } else HatefulBoltTimer -= diff; @@ -195,7 +195,6 @@ class boss_curator : public CreatureScript }; - void AddSC_boss_curator() { new boss_curator(); 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 87e79099861c0..a550cff0df563 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_maiden_of_virtue.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_maiden_of_virtue.cpp @@ -136,7 +136,6 @@ class boss_maiden_of_virtue : public CreatureScript }; - void AddSC_boss_maiden_of_virtue() { new boss_maiden_of_virtue(); diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp index ab5eeac585715..03721d01fb79e 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp @@ -310,7 +310,6 @@ void boss_attumen::boss_attumenAI::UpdateAI(const uint32 diff) DoMeleeAttackIfReady(); } - void AddSC_boss_attumen() { new boss_attumen(); diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_netherspite.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_netherspite.cpp index 85327e24e744a..a836a4fdf12dc 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_netherspite.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_netherspite.cpp @@ -335,7 +335,6 @@ class boss_netherspite : public CreatureScript }; - void AddSC_boss_netherspite() { new boss_netherspite(); diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp index 00a63ef3c3681..6f69aac9c5575 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp @@ -395,7 +395,7 @@ class boss_nightbane : public CreatureScript if (FireballBarrageTimer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_FARTHEST, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_FARTHEST, 0)) DoCast(pTarget, SPELL_FIREBALL_BARRAGE); FireballBarrageTimer = 20000; } else FireballBarrageTimer -= diff; @@ -415,7 +415,6 @@ class boss_nightbane : public CreatureScript }; - void AddSC_boss_nightbane() { new boss_nightbane(); diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp index 97b6bdbb5f98c..a763e35386097 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_terestian_illhoof.cpp @@ -388,7 +388,7 @@ class boss_terestian_illhoof : public CreatureScript if (ShadowboltTimer <= diff) { - DoCast(SelectUnit(SELECT_TARGET_TOPAGGRO, 0), SPELL_SHADOW_BOLT); + DoCast(SelectTarget(SELECT_TARGET_TOPAGGRO, 0), SPELL_SHADOW_BOLT); ShadowboltTimer = 10000; } else ShadowboltTimer -= diff; diff --git a/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp index cde236b8ca708..4c354ad048a86 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp @@ -194,7 +194,7 @@ class boss_dorothee : public CreatureScript if (WaterBoltTimer <= diff) { - DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_WATERBOLT); + DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0), SPELL_WATERBOLT); WaterBoltTimer = TitoDied ? 1500 : 5000; } else WaterBoltTimer -= diff; @@ -744,13 +744,6 @@ class mob_cyclone : public CreatureScript }; - - - - - - - /**************************************/ /**** Opera Red Riding Hood Event ****/ /************************************/ @@ -800,7 +793,6 @@ class npc_grandmother : public CreatureScript }; - class boss_bigbadwolf : public CreatureScript { public: @@ -927,7 +919,6 @@ class boss_bigbadwolf : public CreatureScript }; - /**********************************************/ /******** Opera Romeo and Juliet Event *******/ /********************************************/ @@ -1432,7 +1423,7 @@ void boss_julianne::boss_julianneAI::UpdateAI(const uint32 diff) if (PowerfulAttractionTimer <= diff) { - DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_POWERFUL_ATTRACTION); + DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0), SPELL_POWERFUL_ATTRACTION); PowerfulAttractionTimer = urand(5000,30000); } else PowerfulAttractionTimer -= diff; @@ -1513,7 +1504,6 @@ void boss_julianne::boss_julianneAI::DamageTaken(Unit* /*done_by*/, uint32 &dama sLog->outError("TSCR: boss_julianneAI: DamageTaken reach end of code, that should not happen."); } - void AddSC_bosses_opera() { new boss_dorothee(); diff --git a/src/server/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp b/src/server/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp index 1a48ab455e3a3..28a336bf37d75 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp @@ -310,7 +310,6 @@ class instance_karazhan : public InstanceMapScript }; - void AddSC_instance_karazhan() { new instance_karazhan(); diff --git a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp index 9ae5cca4cc0c8..98d69488478ee 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp @@ -227,7 +227,7 @@ class npc_barnes : public CreatureScript void PrepareEncounter() { - sLog->outDebug("TSCR: Barnes Opera Event - Introduction complete - preparing encounter %d", m_uiEventId); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Barnes Opera Event - Introduction complete - preparing encounter %d", m_uiEventId); uint8 index = 0; uint8 count = 0; @@ -398,8 +398,6 @@ class npc_barnes : public CreatureScript }; - - /*### # npc_berthold ####*/ @@ -441,7 +439,6 @@ class npc_berthold : public CreatureScript }; - /*### # npc_image_of_medivh ####*/ @@ -649,7 +646,6 @@ class npc_image_of_medivh : public CreatureScript }; - void AddSC_karazhan() { new npc_barnes(); diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp index 107546085ae61..7c1815dec4f1a 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp @@ -302,7 +302,7 @@ class boss_felblood_kaelthas : public CreatureScript if (PhoenixTimer <= diff) { - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1); + Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,1); uint8 random = urand(1,2); float x = KaelLocations[random][0]; @@ -396,7 +396,7 @@ class boss_felblood_kaelthas : public CreatureScript for (uint8 i = 0; i < 3; ++i) { Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); + pTarget = SelectTarget(SELECT_TARGET_RANDOM,0); Creature* Orb = DoSpawnCreature(CREATURE_ARCANE_SPHERE, 5, 5, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000); if (Orb && pTarget) @@ -685,11 +685,6 @@ class mob_arcane_sphere : public CreatureScript }; - - - - - void AddSC_boss_felblood_kaelthas() { new boss_felblood_kaelthas(); diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp index 8171743bed4cc..5f9f850ceaf2a 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_priestess_delrissa.cpp @@ -332,7 +332,6 @@ class boss_priestess_delrissa : public CreatureScript }; - enum eHealingPotion { SPELL_HEALING_POTION = 15503 @@ -528,7 +527,7 @@ class boss_kagani_nightstrike : public CreatureScript { DoCast(me, SPELL_VANISH); - Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 0); + Unit* pUnit = SelectTarget(SELECT_TARGET_RANDOM, 0); DoResetThreat(); @@ -576,7 +575,6 @@ class boss_kagani_nightstrike : public CreatureScript }; - enum eWarlockSpells { SPELL_IMMOLATE = 44267, @@ -646,7 +644,7 @@ class boss_ellris_duskhallow : public CreatureScript if (Seed_of_Corruption_Timer <= diff) { - if (Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* pUnit = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(pUnit, SPELL_SEED_OF_CORRUPTION); Seed_of_Corruption_Timer = 10000; @@ -654,7 +652,7 @@ class boss_ellris_duskhallow : public CreatureScript if (Curse_of_Agony_Timer <= diff) { - if (Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* pUnit = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(pUnit, SPELL_CURSE_OF_AGONY); Curse_of_Agony_Timer = 13000; @@ -662,7 +660,7 @@ class boss_ellris_duskhallow : public CreatureScript if (Fear_Timer <= diff) { - if (Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* pUnit = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(pUnit, SPELL_FEAR); Fear_Timer = 10000; @@ -793,7 +791,7 @@ class boss_yazzai : public CreatureScript if (Polymorph_Timer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) { DoCast(pTarget, SPELL_POLYMORPH); Polymorph_Timer = 20000; @@ -808,7 +806,7 @@ class boss_yazzai : public CreatureScript if (Blizzard_Timer <= diff) { - if (Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* pUnit = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(pUnit, SPELL_BLIZZARD); Blizzard_Timer = 8000; @@ -939,7 +937,7 @@ class boss_warlord_salaris : public CreatureScript //if nobody is in melee range than try to use Intercept if (!InMeleeRange) { - if (Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* pUnit = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(pUnit, SPELL_INTERCEPT_STUN); } @@ -1170,7 +1168,7 @@ class boss_apoko : public CreatureScript if (Purge_Timer <= diff) { - if (Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* pUnit = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(pUnit, SPELL_PURGE); Purge_Timer = 15000; diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp index bf1a7aeb52cc6..65ac5aff16a19 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_selin_fireheart.cpp @@ -75,7 +75,7 @@ class boss_selin_fireheart : public CreatureScript for (uint8 i = 0; i < size; ++i) { uint64 guid = pInstance->GetData64(DATA_FEL_CRYSTAL); - sLog->outDebug("TSCR: Selin: Adding Fel Crystal " UI64FMTD " to list", guid); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Selin: Adding Fel Crystal " UI64FMTD " to list", guid); Crystals.push_back(guid); } } @@ -253,7 +253,7 @@ class boss_selin_fireheart : public CreatureScript { if (DrainLifeTimer <= diff) { - DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_DRAIN_LIFE); + DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0), SPELL_DRAIN_LIFE); DrainLifeTimer = 10000; } else DrainLifeTimer -= diff; @@ -262,7 +262,7 @@ class boss_selin_fireheart : public CreatureScript { if (DrainManaTimer <= diff) { - DoCast(SelectUnit(SELECT_TARGET_RANDOM, 1), SPELL_DRAIN_MANA); + DoCast(SelectTarget(SELECT_TARGET_RANDOM, 1), SPELL_DRAIN_MANA); DrainManaTimer = 10000; } else DrainManaTimer -= diff; } @@ -321,7 +321,6 @@ class boss_selin_fireheart : public CreatureScript }; - class mob_fel_crystal : public CreatureScript { public: @@ -368,7 +367,6 @@ class mob_fel_crystal : public CreatureScript }; - void AddSC_boss_selin_fireheart() { new boss_selin_fireheart(); diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp index daf6fb408b464..42c20299b3819 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp @@ -117,7 +117,7 @@ class boss_vexallus : public CreatureScript void JustSummoned(Creature *summoned) { - if (Unit *temp = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *temp = SelectTarget(SELECT_TARGET_RANDOM, 0)) summoned->GetMotionMaster()->MoveFollow(temp,0,0); //spells are SUMMON_TYPE_GUARDIAN, so using setOwner should be ok @@ -163,7 +163,7 @@ class boss_vexallus : public CreatureScript if (ChainLightningTimer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(pTarget, SPELL_CHAIN_LIGHTNING); ChainLightningTimer = 8000; @@ -171,7 +171,7 @@ class boss_vexallus : public CreatureScript if (ArcaneShockTimer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) if (pTarget) DoCast(pTarget, SPELL_ARCANE_SHOCK); @@ -194,7 +194,6 @@ class boss_vexallus : public CreatureScript }; - class mob_pure_energy : public CreatureScript { public: @@ -227,7 +226,6 @@ class mob_pure_energy : public CreatureScript }; - void AddSC_boss_vexallus() { new boss_vexallus(); diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp index 3b281726eb5ed..ea7b2f1904ffa 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/instance_magisters_terrace.cpp @@ -202,7 +202,6 @@ class instance_magisters_terrace : public InstanceMapScript }; - void AddSC_instance_magisters_terrace() { new instance_magisters_terrace(); diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.cpp index 0fcc0a975a4bc..d6fed004baab3 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/magisters_terrace.cpp @@ -171,9 +171,6 @@ class npc_kalecgos : public CreatureScript }; - - - void AddSC_magisters_terrace() { new npc_kalecgos(); diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_garr.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_garr.cpp index d52c7a4d3695e..028362f219902 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_garr.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_garr.cpp @@ -136,7 +136,7 @@ class mob_firesworn : public CreatureScript if (immolateTimer <= diff) { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(target, SPELL_IMMOLATE); immolateTimer = urand(5000, 10000); } @@ -153,7 +153,6 @@ class mob_firesworn : public CreatureScript } }; - void AddSC_boss_garr() { new boss_garr(); diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_gehennas.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_gehennas.cpp index bf476b4e3e4b7..92b0e370f9f71 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_gehennas.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_gehennas.cpp @@ -80,12 +80,12 @@ class boss_gehennas : public CreatureScript events.ScheduleEvent(EVENT_GEHENNAS_CURSE, urand(22000, 30000)); break; case EVENT_RAIN_OF_FIRE: - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(target, SPELL_RAIN_OF_FIRE); events.ScheduleEvent(EVENT_RAIN_OF_FIRE, urand(4000, 12000)); break; case EVENT_SHADOW_BOLT: - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1)) + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1)) DoCast(target, SPELL_SHADOW_BOLT); events.ScheduleEvent(EVENT_SHADOW_BOLT, 7000); break; diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_golemagg.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_golemagg.cpp index a0daf31531ce4..ef502543f1051 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_golemagg.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_golemagg.cpp @@ -99,7 +99,7 @@ class boss_golemagg : public CreatureScript switch (eventId) { case EVENT_PYROBLAST: - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(pTarget, SPELL_PYROBLAST); events.ScheduleEvent(EVENT_PYROBLAST, 7000); break; @@ -139,7 +139,7 @@ class mob_core_rager : public CreatureScript mangleTimer = 7*IN_MILLISECONDS; // These times are probably wrong } - void DamageTaken(Unit* /*attacker*/, uint32& damage) + void DamageTaken(Unit* /*attacker*/, uint32& /*damage*/) { if (HealthAbovePct(50) || !instance) return; diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_majordomo_executus.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_majordomo_executus.cpp index 1e58ae8665abb..ad2f02ca77b86 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_majordomo_executus.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_majordomo_executus.cpp @@ -139,7 +139,7 @@ class boss_majordomo : public CreatureScript events.ScheduleEvent(EVENT_BLAST_WAVE, 10000); break; case EVENT_TELEPORT: - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1)) + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1)) DoCast(target, SPELL_TELEPORT); events.ScheduleEvent(EVENT_TELEPORT, 20000); break; diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_ragnaros.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_ragnaros.cpp index f58269861cde3..309a1546ca30e 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_ragnaros.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_ragnaros.cpp @@ -172,7 +172,7 @@ class boss_ragnaros : public CreatureScript me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0); me->HandleEmoteCommand(EMOTE_ONESHOT_EMERGE); - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) AttackStart(target); instance->SetData(DATA_RAGNAROS_ADDS, 0); @@ -259,7 +259,7 @@ class boss_ragnaros : public CreatureScript // summon 8 elementals for (uint8 i = 0; i < 8; ++i) - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) if (Creature* pSummoned = me->SummonCreature(12143, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0.0f,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,900000)) pSummoned->AI()->AttackStart(pTarget); @@ -274,7 +274,7 @@ class boss_ragnaros : public CreatureScript DoScriptText(SAY_REINFORCEMENTS2, me); for (uint8 i = 0; i < 8; ++i) - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) if (Creature* pSummoned = me->SummonCreature(12143, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0.0f,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,900000)) pSummoned->AI()->AttackStart(pTarget); @@ -309,7 +309,6 @@ class boss_ragnaros : public CreatureScript } }; - class mob_son_of_flame : public CreatureScript { public: diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/instance_molten_core.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/instance_molten_core.cpp index e4b6943ffdc6f..6b0631425d4fe 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/instance_molten_core.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/instance_molten_core.cpp @@ -227,7 +227,6 @@ class instance_molten_core : public InstanceMapScript } }; - void AddSC_instance_molten_core() { new instance_molten_core(); diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp index eeef3d373a51c..4c0c9d0672871 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp @@ -216,7 +216,7 @@ class npc_unworthy_initiate : public CreatureScript else { me->GetMotionMaster()->MovePoint(1, anchorX, anchorY, me->GetPositionZ()); - //sLog->outDebug("npc_unworthy_initiateAI: move to %f %f %f", anchorX, anchorY, me->GetPositionZ()); + //sLog->outDebug(LOG_FILTER_TSCR, "npc_unworthy_initiateAI: move to %f %f %f", anchorX, anchorY, me->GetPositionZ()); phase = PHASE_EQUIPING; wait_timer = 0; } @@ -281,7 +281,6 @@ class npc_unworthy_initiate : public CreatureScript }; }; - class npc_unworthy_initiate_anchor : public CreatureScript { public: @@ -309,9 +308,6 @@ class npc_unworthy_initiate_anchor : public CreatureScript }; - - - class go_acherus_soul_prison : public GameObjectScript { public: @@ -516,9 +512,6 @@ class npc_death_knight_initiate : public CreatureScript }; - - - /*###### ## npc_dark_rider_of_acherus ######*/ @@ -605,7 +598,6 @@ class npc_dark_rider_of_acherus : public CreatureScript }; - /*###### ## npc_salanar_the_horseman ######*/ @@ -681,7 +673,6 @@ class npc_salanar_the_horseman : public CreatureScript }; - /*###### ## npc_ros_dark_rider ######*/ @@ -731,7 +722,6 @@ class npc_ros_dark_rider : public CreatureScript }; - // correct way: 52312 52314 52555 ... enum SG { @@ -780,7 +770,6 @@ class npc_dkc1_gothik : public CreatureScript }; - class npc_scarlet_ghoul : public CreatureScript { public: @@ -864,7 +853,6 @@ class npc_scarlet_ghoul : public CreatureScript }; - /*#### ## npc_scarlet_miner_cart ####*/ @@ -887,7 +875,7 @@ class npc_scarlet_miner_cart : public CreatureScript npc_scarlet_miner_cartAI(Creature *c) : PassiveAI(c), minerGUID(0) { me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); - me->SetDisplayId(me->GetCreatureInfo()->Modelid2); // Modelid1 is a horse. + me->SetDisplayId(me->GetCreatureInfo()->Modelid1); // Modelid2 is a horse. } uint64 minerGUID; @@ -921,7 +909,6 @@ class npc_scarlet_miner_cart : public CreatureScript }; - /*#### ## npc_scarlet_miner ####*/ @@ -1045,7 +1032,7 @@ class npc_scarlet_miner : public CreatureScript else { if (Creature *car = Unit::GetCreature(*me, carGUID)) - car->AI()->DoAction(); + car->AI()->DoAction(0); IntroPhase = 0; } } else IntroTimer-=diff; @@ -1056,7 +1043,6 @@ class npc_scarlet_miner : public CreatureScript }; - /*###### ## go_inconspicuous_mine_car ######*/ diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp index 64170b15cc16f..fac16df491e64 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp @@ -141,7 +141,6 @@ class npc_crusade_persuaded : public CreatureScript }; - /*###### ## npc_koltira_deathweaver ######*/ @@ -342,8 +341,6 @@ class npc_koltira_deathweaver : public CreatureScript }; - - //Scarlet courier enum ScarletCourierEnum { @@ -432,7 +429,6 @@ class mob_scarlet_courier : public CreatureScript }; - //Koltira & Valroth- Breakout enum valroth @@ -521,7 +517,6 @@ class mob_high_inquisitor_valroth : public CreatureScript }; - /*###### ## npc_a_special_surprise ######*/ @@ -986,7 +981,6 @@ class npc_a_special_surprise : public CreatureScript }; - void AddSC_the_scarlet_enclave_c2() { new npc_crusade_persuaded(); diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp index fe0ff30c038e5..95550f70f4e56 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp @@ -1535,7 +1535,7 @@ class npc_highlord_darion_mograine : public CreatureScript { if (Creature* pTemp = Unit::GetCreature(*me, ui_GUID)) if (pTemp->isAlive()) - if (Unit* pTarger = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit* pTarger = SelectTarget(SELECT_TARGET_RANDOM,0)) if (pTarger->isAlive()) { // pTemp->DeleteThreatList(); @@ -1663,8 +1663,6 @@ class npc_highlord_darion_mograine : public CreatureScript }; - - /*###### ## npc the lich king in dawn of light ######*/ @@ -1689,8 +1687,6 @@ class npc_the_lich_king_tirion_dawn : public CreatureScript }; - - void AddSC_the_scarlet_enclave_c5() { new npc_highlord_darion_mograine(); diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp index 77fe08746ccd6..dff84c6f70043 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp @@ -111,7 +111,6 @@ class npc_valkyr_battle_maiden : public CreatureScript }; - void AddSC_the_scarlet_enclave() { new 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 6557f830ae31a..5895d43f5c277 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_arcanist_doan.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_arcanist_doan.cpp @@ -101,7 +101,7 @@ class boss_arcanist_doan : public CreatureScript if (Polymorph_Timer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,1)) DoCast(pTarget, SPELL_POLYMORPH); Polymorph_Timer = 20000; 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 ab1a0dacd8f7a..53f6693a60d70 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_azshir_the_sleepless.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_azshir_the_sleepless.cpp @@ -96,7 +96,6 @@ class boss_azshir_the_sleepless : public CreatureScript }; - void AddSC_boss_azshir_the_sleepless() { new boss_azshir_the_sleepless(); diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_bloodmage_thalnos.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_bloodmage_thalnos.cpp index a791f5932eb60..8fe766409e417 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_bloodmage_thalnos.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_bloodmage_thalnos.cpp @@ -122,7 +122,6 @@ class boss_bloodmage_thalnos : public CreatureScript }; - void AddSC_boss_bloodmage_thalnos() { new boss_bloodmage_thalnos(); diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp index 10a972af11b4d..902541b322322 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp @@ -743,8 +743,6 @@ class boss_headless_horseman : public CreatureScript }; - - class mob_pulsing_pumpkin : public CreatureScript { public: diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp index 206c25475292f..526a9210eb002 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp @@ -118,7 +118,6 @@ class boss_herod : public CreatureScript }; - class mob_scarlet_trainee : public CreatureScript { public: @@ -159,7 +158,6 @@ class mob_scarlet_trainee : public CreatureScript }; - void AddSC_boss_herod() { new boss_herod(); 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 3ffef4a673d9b..565b183c7ea2b 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp @@ -87,7 +87,7 @@ class boss_high_inquisitor_fairbanks : public CreatureScript //Fear_Timer if (Fear_Timer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,1)) DoCast(pTarget, SPELL_FEAR); Fear_Timer = 40000; @@ -96,7 +96,7 @@ class boss_high_inquisitor_fairbanks : public CreatureScript //Sleep_Timer if (Sleep_Timer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO,0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_TOPAGGRO,0)) DoCast(pTarget, SPELL_SLEEP); Sleep_Timer = 30000; @@ -112,7 +112,7 @@ class boss_high_inquisitor_fairbanks : public CreatureScript //Dispel_Timer if (Dispel_Timer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) DoCast(pTarget, SPELL_DISPELMAGIC); DispelMagic_Timer = 30000; @@ -131,7 +131,6 @@ class boss_high_inquisitor_fairbanks : public CreatureScript }; - void AddSC_boss_high_inquisitor_fairbanks() { new boss_high_inquisitor_fairbanks(); diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_houndmaster_loksey.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_houndmaster_loksey.cpp index c450929d88a1b..2392927b488f9 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_houndmaster_loksey.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_houndmaster_loksey.cpp @@ -75,7 +75,6 @@ class boss_houndmaster_loksey : public CreatureScript }; - void AddSC_boss_houndmaster_loksey() { new boss_houndmaster_loksey(); diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp index 6eb9da70cae8a..5bd2193f296b8 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp @@ -116,7 +116,6 @@ class boss_interrogator_vishas : public CreatureScript }; - void AddSC_boss_interrogator_vishas() { new boss_interrogator_vishas(); 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 be2ee619a6588..33d2b16bf4270 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp @@ -358,8 +358,6 @@ class boss_high_inquisitor_whitemane : public CreatureScript }; - - void AddSC_boss_mograine_and_whitemane() { new boss_scarlet_commander_mograine(); diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp index 4d2909c3cd3dd..2b3dda1333365 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/instance_scarlet_monastery.cpp @@ -155,7 +155,6 @@ class instance_scarlet_monastery : public InstanceMapScript }; - void AddSC_instance_scarlet_monastery() { new instance_scarlet_monastery(); diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp index c4d76d1caf19c..15c759b6ab48b 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_darkmaster_gandling.cpp @@ -125,7 +125,7 @@ class boss_darkmaster_gandling : public CreatureScript if (Teleport_Timer <= diff) { Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); + pTarget = SelectTarget(SELECT_TARGET_RANDOM,0); if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER) { if (DoGetThreat(pTarget)) 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 746e11d934e86..3591431e0dbfa 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_doctor_theolen_krastinov.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_doctor_theolen_krastinov.cpp @@ -113,7 +113,6 @@ class boss_doctor_theolen_krastinov : public CreatureScript }; - void AddSC_boss_theolenkrastinov() { new boss_doctor_theolen_krastinov(); diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_illucia_barov.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_illucia_barov.cpp index 58fc4d4cd3e52..cd17ef2125cc3 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_illucia_barov.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_illucia_barov.cpp @@ -90,7 +90,7 @@ class boss_illucia_barov : public CreatureScript if (ShadowShock_Timer <= diff) { Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); + pTarget = SelectTarget(SELECT_TARGET_RANDOM,0); if (pTarget) DoCast(pTarget, SPELL_SHADOWSHOCK); ShadowShock_Timer = 12000; diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_instructor_malicia.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_instructor_malicia.cpp index ed0dfb4a24652..9f2a7fd5428a2 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_instructor_malicia.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_instructor_malicia.cpp @@ -97,7 +97,7 @@ class boss_instructor_malicia : public CreatureScript if (Corruption_Timer <= diff) { Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); + pTarget = SelectTarget(SELECT_TARGET_RANDOM,0); if (pTarget) DoCast(pTarget, SPELL_CORRUPTION); Corruption_Timer = 24000; diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_jandice_barov.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_jandice_barov.cpp index 914ed75123299..e01b0fb56640b 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_jandice_barov.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_jandice_barov.cpp @@ -114,7 +114,7 @@ class boss_jandice_barov : public CreatureScript Unit *pTarget = NULL; for (uint8 i = 0; i < 10; ++i) { - pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); + pTarget = SelectTarget(SELECT_TARGET_RANDOM,0); if (pTarget) SummonIllusions(pTarget); } @@ -201,8 +201,6 @@ class mob_illusionofjandicebarov : public CreatureScript }; - - void AddSC_boss_jandicebarov() { new boss_jandice_barov(); 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 d5587afe102e4..f4d86668dde7b 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_lord_alexei_barov.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_lord_alexei_barov.cpp @@ -79,7 +79,7 @@ class boss_lord_alexei_barov : public CreatureScript if (Immolate_Timer <= diff) { Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); + pTarget = SelectTarget(SELECT_TARGET_RANDOM,0); if (pTarget) DoCast(pTarget, SPELL_IMMOLATE); Immolate_Timer = 12000; diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_the_ravenian.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_the_ravenian.cpp index 15f6e5c1e3ab1..0c81be8803812 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_the_ravenian.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_the_ravenian.cpp @@ -115,7 +115,6 @@ class boss_the_ravenian : public CreatureScript }; - void AddSC_boss_theravenian() { new boss_the_ravenian(); diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_vectus.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_vectus.cpp index 942ecdc0aff7e..3ae6a763afb3e 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_vectus.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_vectus.cpp @@ -101,7 +101,6 @@ class boss_vectus : public CreatureScript }; - void AddSC_boss_vectus() { new boss_vectus(); diff --git a/src/server/scripts/EasternKingdoms/Scholomance/instance_scholomance.cpp b/src/server/scripts/EasternKingdoms/Scholomance/instance_scholomance.cpp index 2834f23829458..d9dbf0558b704 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/instance_scholomance.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/instance_scholomance.cpp @@ -144,7 +144,6 @@ class instance_scholomance : public InstanceMapScript }; - void AddSC_instance_scholomance() { new instance_scholomance(); diff --git a/src/server/scripts/EasternKingdoms/ShadowfangKeep/instance_shadowfang_keep.cpp b/src/server/scripts/EasternKingdoms/ShadowfangKeep/instance_shadowfang_keep.cpp index 6c76afebe1ba7..70970588e6ce1 100644 --- a/src/server/scripts/EasternKingdoms/ShadowfangKeep/instance_shadowfang_keep.cpp +++ b/src/server/scripts/EasternKingdoms/ShadowfangKeep/instance_shadowfang_keep.cpp @@ -299,7 +299,6 @@ class instance_shadowfang_keep : public InstanceMapScript }; - void AddSC_instance_shadowfang_keep() { new instance_shadowfang_keep(); diff --git a/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp b/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp index a8fc6a43123ba..a44c439c91660 100644 --- a/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp +++ b/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp @@ -141,9 +141,6 @@ class npc_shadowfang_prisoner : public CreatureScript }; - - - class npc_arugal_voidwalker : public CreatureScript { public: @@ -553,17 +550,17 @@ class npc_apothecary_frye : public CreatureScript switch(eventId) { case EVENT_CHANGE_TARGET: - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) me->AI()->AttackStart(pTarget); events.RescheduleEvent(EVENT_CHANGE_TARGET, 10000); break; case EVENT_THROW_PERFUME: - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(pTarget, SPELL_THROW_PERFUME); events.RescheduleEvent(EVENT_THROW_PERFUME, 35000); break; case EVENT_THROW_COLOGNE: - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(pTarget, SPELL_THROW_COLOGNE); events.RescheduleEvent(EVENT_THROW_COLOGNE, 35000); break; @@ -588,7 +585,6 @@ class npc_apothecary_frye : public CreatureScript }; }; - void AddSC_shadowfang_keep() { new npc_shadowfang_prisoner(); diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp index 0a7f35092f275..9e4fc930e1c5c 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp @@ -122,7 +122,7 @@ class boss_baron_rivendare : public CreatureScript void JustSummoned(Creature* summoned) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) summoned->AI()->AttackStart(pTarget); } @@ -140,7 +140,7 @@ class boss_baron_rivendare : public CreatureScript //ShadowBolt if (ShadowBolt_Timer <= diff) { - if (SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(me->getVictim(), SPELL_SHADOWBOLT); ShadowBolt_Timer = 10000; @@ -188,7 +188,6 @@ class boss_baron_rivendare : public CreatureScript }; - void AddSC_boss_baron_rivendare() { new boss_baron_rivendare(); diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_dathrohan_balnazzar.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_dathrohan_balnazzar.cpp index f5998c6c8f0e4..f15a27317d21e 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_dathrohan_balnazzar.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_dathrohan_balnazzar.cpp @@ -186,7 +186,7 @@ class boss_dathrohan_balnazzar : public CreatureScript //PsychicScream if (m_uiPsychicScream_Timer <= uiDiff) { - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) DoCast(pTarget, SPELL_PSYCHICSCREAM); m_uiPsychicScream_Timer = 20000; @@ -195,7 +195,7 @@ class boss_dathrohan_balnazzar : public CreatureScript //DeepSleep if (m_uiDeepSleep_Timer <= uiDiff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) DoCast(pTarget, SPELL_SLEEP); m_uiDeepSleep_Timer = 15000; @@ -215,7 +215,6 @@ class boss_dathrohan_balnazzar : public CreatureScript }; - void AddSC_boss_dathrohan_balnazzar() { new boss_dathrohan_balnazzar(); diff --git a/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp b/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp index f1ccedb08a342..f62c197aa4113 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp @@ -122,7 +122,7 @@ class instance_stratholme : public InstanceMapScript return true; } - sLog->outDebug("TSCR: Instance Stratholme: Cannot open slaugther square yet."); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Stratholme: Cannot open slaugther square yet."); return false; } @@ -240,7 +240,7 @@ class instance_stratholme : public InstanceMapScript break; EncounterState[0] = data; events.ScheduleEvent(EVENT_BARON_RUN, 2700000); - sLog->outDebug("TSCR: Instance Stratholme: Baron run in progress."); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Stratholme: Baron run in progress."); break; case FAIL: DoRemoveAurasDueToSpellOnPlayers(SPELL_BARON_ULTIMATUM); @@ -298,10 +298,10 @@ class instance_stratholme : public InstanceMapScript //UpdateGoState(ziggurat4GUID,0,true); if (Creature* pBaron = instance->GetCreature(baronGUID)) pBaron->SummonCreature(C_RAMSTEIN, 4032.84f, -3390.24f, 119.73f, 4.71f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 1800000); - sLog->outDebug("TSCR: Instance Stratholme: Ramstein spawned."); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Stratholme: Ramstein spawned."); } else - sLog->outDebug("TSCR: Instance Stratholme: %u Abomnation left to kill.",count); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Stratholme: %u Abomnation left to kill.",count); } if (data == NOT_STARTED) @@ -310,7 +310,7 @@ class instance_stratholme : public InstanceMapScript if (data == DONE) { events.ScheduleEvent(EVENT_SLAUGHTER_SQUARE, 60000); - sLog->outDebug("TSCR: Instance Stratholme: Slaugther event will continue in 1 minute."); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Stratholme: Slaugther event will continue in 1 minute."); } EncounterState[4] = data; break; @@ -446,7 +446,7 @@ class instance_stratholme : public InstanceMapScript case EVENT_BARON_RUN: if (GetData(TYPE_BARON_RUN) != DONE) SetData(TYPE_BARON_RUN, FAIL); - sLog->outDebug("TSCR: Instance Stratholme: Baron run event reached end. Event has state %u.", GetData(TYPE_BARON_RUN)); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Stratholme: Baron run event reached end. Event has state %u.", GetData(TYPE_BARON_RUN)); break; case EVENT_SLAUGHTER_SQUARE: if (Creature* baron = instance->GetCreature(baronGUID)) @@ -456,7 +456,7 @@ class instance_stratholme : public InstanceMapScript HandleGameObject(ziggurat4GUID, true); HandleGameObject(ziggurat5GUID, true); - sLog->outDebug("TSCR: Instance Stratholme: Black guard sentries spawned. Opening gates to baron."); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Stratholme: Black guard sentries spawned. Opening gates to baron."); } break; default: @@ -472,7 +472,6 @@ class instance_stratholme : public InstanceMapScript } }; - void AddSC_instance_stratholme() { new instance_stratholme(); diff --git a/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp b/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp index 18b4adf27c8c0..4c9f5bc2a6294 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp @@ -111,7 +111,6 @@ class mob_freed_soul : public CreatureScript }; - /*###### ## mob_restless_soul ######*/ @@ -190,7 +189,6 @@ class mob_restless_soul : public CreatureScript }; - /*###### ## mobs_spectral_ghostly_citizen ######*/ @@ -288,7 +286,6 @@ class mobs_spectral_ghostly_citizen : public CreatureScript }; - void AddSC_stratholme() { new go_gauntlet_gate(); diff --git a/src/server/scripts/EasternKingdoms/SunkenTemple/instance_sunken_temple.cpp b/src/server/scripts/EasternKingdoms/SunkenTemple/instance_sunken_temple.cpp index 2e165b5aaf257..981694efb3ece 100644 --- a/src/server/scripts/EasternKingdoms/SunkenTemple/instance_sunken_temple.cpp +++ b/src/server/scripts/EasternKingdoms/SunkenTemple/instance_sunken_temple.cpp @@ -203,7 +203,6 @@ class instance_sunken_temple : public InstanceMapScript }; - void AddSC_instance_sunken_temple() { new instance_sunken_temple(); diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp index f5e2660e20be3..1c10ea81f8a01 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp @@ -347,7 +347,6 @@ class boss_brutallus : public CreatureScript }; - void AddSC_boss_brutallus() { new boss_brutallus(); diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp index ec4a222402c48..dcfa7e461ceb1 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_eredar_twins.cpp @@ -253,7 +253,7 @@ class boss_sacrolash : public CreatureScript { me->InterruptSpell(CURRENT_GENERIC_SPELL); Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0); if (pTarget) DoCast(pTarget, SPELL_CONFLAGRATION); ConflagrationTimer = 30000+(rand()%5000); @@ -267,7 +267,7 @@ class boss_sacrolash : public CreatureScript if (!me->IsNonMeleeSpellCasted(false)) { Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0); if (pTarget) DoCast(pTarget, SPELL_SHADOW_NOVA); @@ -287,7 +287,7 @@ class boss_sacrolash : public CreatureScript if (!me->IsNonMeleeSpellCasted(false)) { Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0); if (pTarget) DoCast(pTarget, SPELL_CONFOUNDING_BLOW); ConfoundingblowTimer = 20000 + (rand()%5000); @@ -300,7 +300,7 @@ class boss_sacrolash : public CreatureScript Creature* temp = NULL; for (uint8 i = 0; i<3; ++i) { - pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0); temp = DoSpawnCreature(MOB_SHADOW_IMAGE,0,0,0,0,TEMPSUMMON_CORPSE_DESPAWN,10000); if (temp && pTarget) { @@ -343,7 +343,6 @@ class boss_sacrolash : public CreatureScript }; - class boss_alythess : public CreatureScript { public: @@ -603,7 +602,7 @@ class boss_alythess : public CreatureScript if (!me->IsNonMeleeSpellCasted(false)) { Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0); if (pTarget) DoCast(pTarget, SPELL_SHADOW_NOVA); ShadownovaTimer= 30000+(rand()%5000); @@ -618,7 +617,7 @@ class boss_alythess : public CreatureScript { me->InterruptSpell(CURRENT_GENERIC_SPELL); Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0); if (pTarget) DoCast(pTarget, SPELL_CONFLAGRATION); ConflagrationTimer = 30000+(rand()%5000); @@ -674,7 +673,6 @@ class boss_alythess : public CreatureScript }; - class mob_shadow_image : public CreatureScript { public: @@ -757,7 +755,6 @@ class mob_shadow_image : public CreatureScript }; - void AddSC_boss_eredar_twins() { new boss_sacrolash(); diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp index 15aafebe260ca..80a382d63f375 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp @@ -583,9 +583,6 @@ class mob_felmyst_trail : public CreatureScript }; - - - void AddSC_boss_felmyst() { new boss_felmyst(); diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp index 51b8c44cc6eef..7d5bc8e993604 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp @@ -783,7 +783,7 @@ class boss_sathrovarr : public CreatureScript if (AgonyCurseTimer <= diff) { - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0); if (!pTarget) pTarget = me->getVictim(); DoCast(pTarget, SPELL_AGONY_CURSE); AgonyCurseTimer = 20000; @@ -802,7 +802,6 @@ class boss_sathrovarr : public CreatureScript }; - void AddSC_boss_kalecgos() { new boss_kalecgos(); diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp index fa072467bd80a..86327f34c29cd 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp @@ -493,7 +493,6 @@ class mob_kiljaeden_controller : public CreatureScript }; - //AI for Kil'jaeden class boss_kiljaeden : public CreatureScript { @@ -680,7 +679,6 @@ class boss_kiljaeden : public CreatureScript } } - void UpdateAI(const uint32 diff) { if (!UpdateVictim() || Phase < PHASE_NORMAL) @@ -909,7 +907,6 @@ class boss_kiljaeden : public CreatureScript }; - //AI for Hand of the Deceiver class mob_hand_of_the_deceiver : public CreatureScript { @@ -1011,7 +1008,6 @@ class mob_hand_of_the_deceiver : public CreatureScript }; - //AI for Felfire Portal class mob_felfire_portal : public CreatureScript { @@ -1049,7 +1045,7 @@ class mob_felfire_portal : public CreatureScript if (uiSpawnFiendTimer <= diff) { if (Creature* pFiend = DoSpawnCreature(CREATURE_VOLATILE_FELFIRE_FIEND, 0, 0, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 20000)) - pFiend->AddThreat(SelectUnit(SELECT_TARGET_RANDOM,0), 100000.0f); + pFiend->AddThreat(SelectTarget(SELECT_TARGET_RANDOM,0), 100000.0f); uiSpawnFiendTimer = urand(4000,8000); } else uiSpawnFiendTimer -= diff; } @@ -1057,7 +1053,6 @@ class mob_felfire_portal : public CreatureScript }; - //AI for Felfire Fiend class mob_volatile_felfire_fiend : public CreatureScript { @@ -1116,7 +1111,6 @@ class mob_volatile_felfire_fiend : public CreatureScript }; - //AI for Armageddon target class mob_armageddon : public CreatureScript { @@ -1172,7 +1166,6 @@ class mob_armageddon : public CreatureScript }; - //AI for Shield Orbs class mob_shield_orb : public CreatureScript { @@ -1261,7 +1254,6 @@ class mob_shield_orb : public CreatureScript }; - //AI for Sinister Reflection class mob_sinster_reflection : public CreatureScript { @@ -1424,7 +1416,7 @@ class mob_sinster_reflection : public CreatureScript DoMeleeAttackIfReady(); break; } - sLog->outDebug("Sinister-Timer"); + sLog->outDebug(LOG_FILTER_TSCR, "Sinister-Timer"); for (uint8 i = 0; i < 3; ++i) uiTimer[i] -= diff; } @@ -1432,7 +1424,6 @@ class mob_sinster_reflection : public CreatureScript }; - void AddSC_boss_kiljaeden() { new go_orb_of_the_blue_flight(); diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp index face8af5ed4df..6509a0317a66e 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp @@ -201,7 +201,6 @@ class boss_entropius : public CreatureScript }; - class boss_muru : public CreatureScript { public: @@ -367,7 +366,6 @@ class boss_muru : public CreatureScript }; - class npc_muru_portal : public CreatureScript { public: @@ -452,7 +450,6 @@ class npc_muru_portal : public CreatureScript }; - class npc_dark_fiend : public CreatureScript { public: @@ -516,7 +513,6 @@ class npc_dark_fiend : public CreatureScript }; - class npc_void_sentinel : public CreatureScript { public: @@ -573,7 +569,6 @@ class npc_void_sentinel : public CreatureScript }; - class npc_blackhole : public CreatureScript { public: @@ -653,7 +648,6 @@ class npc_blackhole : public CreatureScript }; - void AddSC_boss_muru() { new boss_muru(); diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/instance_sunwell_plateau.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/instance_sunwell_plateau.cpp index bb863cff56491..7d36d4160e7a0 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/instance_sunwell_plateau.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/instance_sunwell_plateau.cpp @@ -134,7 +134,7 @@ class instance_sunwell_plateau : public InstanceMapScript } } - sLog->outDebug("TSCR: Instance Sunwell Plateau: GetPlayerInMap, but PlayerList is empty!"); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Sunwell Plateau: GetPlayerInMap, but PlayerList is empty!"); return NULL; } @@ -306,7 +306,6 @@ class instance_sunwell_plateau : public InstanceMapScript }; - void AddSC_instance_sunwell_plateau() { new instance_sunwell_plateau(); diff --git a/src/server/scripts/EasternKingdoms/Uldaman/boss_ironaya.cpp b/src/server/scripts/EasternKingdoms/Uldaman/boss_ironaya.cpp index ebce1b17f491d..5ccfb7b8b194e 100644 --- a/src/server/scripts/EasternKingdoms/Uldaman/boss_ironaya.cpp +++ b/src/server/scripts/EasternKingdoms/Uldaman/boss_ironaya.cpp @@ -72,10 +72,10 @@ class boss_ironaya : public CreatureScript DoCast(me->getVictim(), SPELL_KNOCKAWAY, true); // current aggro target is knocked away pick new target - Unit* pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO, 0); + Unit* pTarget = SelectTarget(SELECT_TARGET_TOPAGGRO, 0); if (!pTarget || pTarget == me->getVictim()) - pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO, 1); + pTarget = SelectTarget(SELECT_TARGET_TOPAGGRO, 1); if (pTarget) me->TauntApply(pTarget); diff --git a/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp b/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp index 4100f97b6766e..b24099c3d9221 100644 --- a/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp +++ b/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp @@ -23,7 +23,6 @@ SDComment: Need some cosmetics updates when archeadas door are closing (Guardian SDCategory: Uldaman EndScriptData */ - #include "ScriptPCH.h" #include "uldaman.h" diff --git a/src/server/scripts/EasternKingdoms/Uldaman/uldaman.cpp b/src/server/scripts/EasternKingdoms/Uldaman/uldaman.cpp index 746df16c037ad..29dbe1c56e571 100644 --- a/src/server/scripts/EasternKingdoms/Uldaman/uldaman.cpp +++ b/src/server/scripts/EasternKingdoms/Uldaman/uldaman.cpp @@ -81,7 +81,7 @@ class mob_jadespine_basilisk : public CreatureScript //Stop attacking target thast asleep and pick new target uiCslumberTimer = 28000; - Unit* pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO, 0); + Unit* pTarget = SelectTarget(SELECT_TARGET_TOPAGGRO, 0); if (!pTarget || pTarget == me->getVictim()) pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); @@ -101,8 +101,6 @@ class mob_jadespine_basilisk : public CreatureScript } }; - - /*###### ## go_keystone_chamber ######*/ diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp index 855572f798ffe..8580e9c449128 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp @@ -285,7 +285,7 @@ class boss_akilzon : public CreatureScript if (StaticDisruption_Timer <= diff) { - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1); + Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1); if (!pTarget) pTarget = me->getVictim(); TargetGUID = pTarget->GetGUID(); DoCast(pTarget, SPELL_STATIC_DISRUPTION, false); @@ -298,7 +298,7 @@ class boss_akilzon : public CreatureScript if (GustOfWind_Timer <= diff) { - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1); + Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1); if (!pTarget) pTarget = me->getVictim(); DoCast(pTarget, SPELL_GUST_OF_WIND); GustOfWind_Timer = (20+rand()%10)*1000; //20 to 30 seconds(bosskillers) @@ -362,7 +362,7 @@ class boss_akilzon : public CreatureScript Unit* bird = Unit::GetUnit(*me,BirdGUIDs[i]); if (!bird) //they despawned on die { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) { x = pTarget->GetPositionX() + irand(-10,10); y = pTarget->GetPositionY() + irand(-10,10); @@ -443,7 +443,7 @@ class mob_akilzon_eagle : public CreatureScript if (arrived) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) { float x, y, z; if (EagleSwoop_Timer) diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp index b4e375266568a..cf5809a1c77a3 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp @@ -262,7 +262,7 @@ class boss_halazzi : public CreatureScript if (ShockTimer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) { if (pTarget->IsNonMeleeSpellCasted(false)) DoCast(pTarget, SPELL_EARTHSHOCK); diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp index 680aeb06fc90f..d005c85434f7d 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp @@ -602,7 +602,7 @@ class boss_alyson_antille : public CreatureScript if (urand(0,1)) pTarget = DoSelectLowestHpFriendly(50, 0); else - pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0); if (pTarget) DoCast(pTarget, SPELL_DISPEL_MAGIC, false); } diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp index 220e987150760..251ae131d01b3 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp @@ -426,7 +426,7 @@ class boss_janalai : public CreatureScript if (FireBreathTimer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) { me->AttackStop(); me->GetMotionMaster()->Clear(); @@ -439,7 +439,6 @@ class boss_janalai : public CreatureScript } }; - CreatureAI* GetAI(Creature* creature) const { return new boss_janalaiAI(creature); diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp index 4eb3c9ac07cdf..bab2c9cdc6c9f 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp @@ -445,7 +445,6 @@ class boss_nalorakk : public CreatureScript } }; - CreatureAI* GetAI(Creature* creature) const { return new boss_nalorakkAI(creature); diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp index d1fb865b00adb..9518d768f8fb2 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp @@ -375,7 +375,7 @@ class boss_zuljin : public CreatureScript Vortex->CastSpell(Vortex, SPELL_CYCLONE_VISUAL, true); Vortex->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); Vortex->SetSpeed(MOVE_RUN, 1.0f); - Vortex->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0)); + Vortex->AI()->AttackStart(SelectTarget(SELECT_TARGET_RANDOM, 0)); DoZoneInCombat(Vortex); } } @@ -463,7 +463,7 @@ class boss_zuljin : public CreatureScript { if (!TankGUID) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) { TankGUID = me->getVictim()->GetGUID(); me->SetSpeed(MOVE_RUN, 5.0f); @@ -479,7 +479,7 @@ class boss_zuljin : public CreatureScript { Unit *pTarget = me->getVictim(); if (!pTarget || !pTarget->isTargetableForAttack()) pTarget = Unit::GetUnit(*me, TankGUID); - if (!pTarget || !pTarget->isTargetableForAttack()) pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (!pTarget || !pTarget->isTargetableForAttack()) pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0); if (pTarget) { AttackStart(pTarget); @@ -512,7 +512,7 @@ class boss_zuljin : public CreatureScript { if (!TankGUID) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) { TankGUID = me->getVictim()->GetGUID(); me->SetSpeed(MOVE_RUN, 5.0f); @@ -526,7 +526,7 @@ class boss_zuljin : public CreatureScript Unit *pTarget = me->getVictim(); if (!pTarget || !pTarget->isTargetableForAttack()) { - pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0); AttackStart(pTarget); } if (pTarget) @@ -543,7 +543,7 @@ class boss_zuljin : public CreatureScript TankGUID = 0; } else - AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0)); + AttackStart(SelectTarget(SELECT_TARGET_RANDOM, 0)); } } else @@ -564,14 +564,14 @@ class boss_zuljin : public CreatureScript if (Pillar_Of_Fire_Timer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(pTarget, SPELL_SUMMON_PILLAR); Pillar_Of_Fire_Timer = 10000; } else Pillar_Of_Fire_Timer -= diff; if (Flame_Breath_Timer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) me->SetInFront(pTarget); DoCast(me, SPELL_FLAME_BREATH); Flame_Breath_Timer = 10000; @@ -587,7 +587,6 @@ class boss_zuljin : public CreatureScript } }; - CreatureAI* GetAI(Creature* creature) const { return new boss_zuljinAI(creature); @@ -621,7 +620,7 @@ class mob_zuljin_vortex : public CreatureScript { //if the vortex reach the target, it change his target to another player if (me->IsWithinMeleeRange(me->getVictim())) - AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0)); + AttackStart(SelectTarget(SELECT_TARGET_RANDOM, 0)); } }; @@ -631,7 +630,6 @@ class mob_zuljin_vortex : public CreatureScript } }; - void AddSC_boss_zuljin() { new boss_zuljin(); diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp index c4c6f53e444d0..f554894c6f3fd 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp @@ -162,7 +162,7 @@ class boss_arlokk : public CreatureScript if (m_uiMark_Timer <= uiDiff) { - Unit *pMarkedTarget = SelectUnit(SELECT_TARGET_RANDOM,0); + Unit *pMarkedTarget = SelectTarget(SELECT_TARGET_RANDOM,0); if (pMarkedTarget) { @@ -242,7 +242,7 @@ class boss_arlokk : public CreatureScript me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 35))); me->UpdateDamagePhysical(BASE_ATTACK); - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) AttackStart(pTarget); m_bIsPhaseTwo = true; diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp index f833296ae4661..c8ea4f895857a 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp @@ -68,7 +68,7 @@ class boss_grilek : public CreatureScript DoCast(me, SPELL_AVARTAR); Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM,1); + pTarget = SelectTarget(SELECT_TARGET_RANDOM,1); if (DoGetThreat(me->getVictim())) DoModifyThreatPercent(me->getVictim(),-50); diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp index a478826a6e173..e53c66082dde8 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp @@ -141,7 +141,7 @@ class boss_hakkar : public CreatureScript //WillOfHakkar_Timer if (WillOfHakkar_Timer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) DoCast(pTarget, SPELL_WILLOFHAKKAR); WillOfHakkar_Timer = 25000 + rand()%10000; diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp index 0dab193bb1ba1..04474c9383cfe 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp @@ -84,7 +84,7 @@ class boss_hazzarah : public CreatureScript Unit *pTarget = NULL; for (uint8 i = 0; i < 3; ++i) { - pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); + pTarget = SelectTarget(SELECT_TARGET_RANDOM,0); if (!pTarget) return; diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp index 41e84c35f71f6..a80dd889d7e50 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp @@ -113,7 +113,7 @@ class boss_jeklik : public CreatureScript { if (Charge_Timer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) { DoCast(pTarget, SPELL_CHARGE); AttackStart(pTarget); @@ -136,7 +136,7 @@ class boss_jeklik : public CreatureScript if (SpawnBats_Timer <= diff) { - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); + Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0); Creature* Bat = NULL; Bat = me->SummonCreature(11368,-12291.6220f,-1380.2640f,144.8304f,5.483f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); @@ -165,7 +165,7 @@ class boss_jeklik : public CreatureScript { if (PhaseTwo && ShadowWordPain_Timer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) { DoCast(pTarget, SPELL_SHADOW_WORD_PAIN); ShadowWordPain_Timer = 12000 + rand()%6000; @@ -194,7 +194,7 @@ class boss_jeklik : public CreatureScript if (SpawnFlyingBats_Timer <= diff) { - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0); if (!pTarget) return; @@ -264,7 +264,7 @@ class mob_batrider : public CreatureScript //Bomb_Timer if (Bomb_Timer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) { DoCast(pTarget, SPELL_BOMB); Bomb_Timer = 5000; diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp index 4e558ce42e2c2..f78a47c658535 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp @@ -108,7 +108,7 @@ class boss_jindo : public CreatureScript //Casting the delusion curse with a shade. So shade will attack the same target with the curse. if (Delusions_Timer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) { DoCast(pTarget, SPELL_DELUSIONSOFJINDO); @@ -124,7 +124,7 @@ class boss_jindo : public CreatureScript if (Teleport_Timer <= diff) { Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); + pTarget = SelectTarget(SELECT_TARGET_RANDOM,0); if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER) { DoTeleportPlayer(pTarget, -11583.7783f,-1249.4278f,77.5471f,4.745f); diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp index 16663ac106253..e4054c9032b84 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp @@ -186,7 +186,7 @@ class boss_mandokir : public CreatureScript if ((Watch_Timer < 8000) && !someWatched) //8 sec(cast time + expire time) before the check for the watch effect mandokir will cast watch debuff on a random target { - if (Unit* p = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit* p = SelectTarget(SELECT_TARGET_RANDOM,0)) { DoScriptText(SAY_WATCH, me, p); DoCast(p, SPELL_WATCH); diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp index c25a80550b3e5..4f191b11249a6 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp @@ -118,7 +118,7 @@ class boss_marli : public CreatureScript { DoScriptText(SAY_SPIDER_SPAWN, me); - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); + Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0); if (!pTarget) return; @@ -142,7 +142,7 @@ class boss_marli : public CreatureScript if (SpawnSpider_Timer <= diff) { - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); + Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0); if (!pTarget) return; diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp index 5edb0036cdfdf..191d9f311b214 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp @@ -93,7 +93,7 @@ class boss_renataki : public CreatureScript if (Ambush_Timer <= diff) { Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); + pTarget = SelectTarget(SELECT_TARGET_RANDOM,0); if (pTarget) { DoTeleportTo(pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ()); @@ -127,7 +127,7 @@ class boss_renataki : public CreatureScript if (Aggro_Timer <= diff) { Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM,1); + pTarget = SelectTarget(SELECT_TARGET_RANDOM,1); if (DoGetThreat(me->getVictim())) DoModifyThreatPercent(me->getVictim(),-50); diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp index 5b467db09c0e4..a20eb2719632c 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp @@ -219,7 +219,7 @@ class boss_thekal : public CreatureScript { if (Charge_Timer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) { DoCast(pTarget, SPELL_CHARGE); DoResetThreat(); diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp index a18787638b045..d7aaee44857e5 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp @@ -125,7 +125,7 @@ class boss_venoxis : public CreatureScript TargetInRange = 0; for (uint8 i = 0; i < 10; ++i) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO,i)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_TOPAGGRO,i)) if (me->IsWithinMeleeRange(pTarget)) ++TargetInRange; } @@ -144,7 +144,7 @@ class boss_venoxis : public CreatureScript if (HolyFire_Timer < diff && TargetInRange < 3) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) DoCast(pTarget, SPELL_HOLY_FIRE); HolyFire_Timer = 8000; @@ -174,7 +174,7 @@ class boss_venoxis : public CreatureScript if (PhaseTwo && VenomSpit_Timer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) DoCast(pTarget, SPELL_VENOMSPIT); VenomSpit_Timer = 15000 + rand()%5000; diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_wushoolay.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_wushoolay.cpp index 7865320c6a812..944a33fb620f8 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_wushoolay.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_wushoolay.cpp @@ -71,7 +71,7 @@ class boss_wushoolay : public CreatureScript if (LightningWave_Timer <= diff) { Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); + pTarget = SelectTarget(SELECT_TARGET_RANDOM,0); if (pTarget) DoCast(pTarget, SPELL_LIGHTNINGWAVE); LightningWave_Timer = 12000 + rand()%4000; diff --git a/src/server/scripts/EasternKingdoms/blasted_lands.cpp b/src/server/scripts/EasternKingdoms/blasted_lands.cpp index 792d49ff30448..8cd3237360d87 100644 --- a/src/server/scripts/EasternKingdoms/blasted_lands.cpp +++ b/src/server/scripts/EasternKingdoms/blasted_lands.cpp @@ -69,7 +69,6 @@ class npc_deathly_usher : public CreatureScript }; - /*###### ## npc_fallen_hero_of_horde ######*/ @@ -162,7 +161,6 @@ class npc_fallen_hero_of_horde : public CreatureScript }; - void AddSC_blasted_lands() { new npc_deathly_usher(); diff --git a/src/server/scripts/EasternKingdoms/burning_steppes.cpp b/src/server/scripts/EasternKingdoms/burning_steppes.cpp index ec80a63dfaa14..4d2abdea18cb0 100644 --- a/src/server/scripts/EasternKingdoms/burning_steppes.cpp +++ b/src/server/scripts/EasternKingdoms/burning_steppes.cpp @@ -150,9 +150,6 @@ class npc_ragged_john : public CreatureScript }; - - - void AddSC_burning_steppes() { new npc_ragged_john(); diff --git a/src/server/scripts/EasternKingdoms/eastern_plaguelands.cpp b/src/server/scripts/EasternKingdoms/eastern_plaguelands.cpp index d551be9cefb89..4a41c32563377 100644 --- a/src/server/scripts/EasternKingdoms/eastern_plaguelands.cpp +++ b/src/server/scripts/EasternKingdoms/eastern_plaguelands.cpp @@ -63,7 +63,6 @@ class mobs_ghoul_flayer : public CreatureScript }; - /*###### ## npc_augustus_the_touched ######*/ @@ -95,7 +94,6 @@ class npc_augustus_the_touched : public CreatureScript }; - /*###### ## npc_darrowshire_spirit ######*/ @@ -136,7 +134,6 @@ class npc_darrowshire_spirit : public CreatureScript }; - /*###### ## npc_tirion_fordring ######*/ @@ -191,7 +188,6 @@ class npc_tirion_fordring : public CreatureScript }; - void AddSC_eastern_plaguelands() { new mobs_ghoul_flayer(); diff --git a/src/server/scripts/EasternKingdoms/eversong_woods.cpp b/src/server/scripts/EasternKingdoms/eversong_woods.cpp index 63d5268825ada..13f69b90d1bfc 100644 --- a/src/server/scripts/EasternKingdoms/eversong_woods.cpp +++ b/src/server/scripts/EasternKingdoms/eversong_woods.cpp @@ -119,9 +119,6 @@ class npc_prospector_anvilward : public CreatureScript }; - - - /*###### ## Quest 9686 Second Trial ######*/ @@ -500,7 +497,6 @@ void npc_second_trial_paladin::npc_secondTrialAI::JustDied(Unit* Killer) } } - /*###### ## go_second_trial ######*/ @@ -520,7 +516,6 @@ class go_second_trial : public GameObjectScript }; - /*###### ## npc_apprentice_mirveda ######*/ @@ -605,7 +600,6 @@ class npc_apprentice_mirveda : public CreatureScript }; - /*###### ## npc_infused_crystal ######*/ diff --git a/src/server/scripts/EasternKingdoms/ghostlands.cpp b/src/server/scripts/EasternKingdoms/ghostlands.cpp index 9f357163af1fd..83faaf36dfe42 100644 --- a/src/server/scripts/EasternKingdoms/ghostlands.cpp +++ b/src/server/scripts/EasternKingdoms/ghostlands.cpp @@ -72,7 +72,6 @@ class npc_blood_knight_dawnstar : public CreatureScript }; - /*###### ## npc_budd_nedreck ######*/ @@ -109,7 +108,6 @@ class npc_budd_nedreck : public CreatureScript }; - /*###### ## npc_rathis_tomber ######*/ @@ -144,7 +142,6 @@ class npc_rathis_tomber : public CreatureScript }; - /*###### ## npc_ranger_lilatha ######*/ @@ -256,7 +253,6 @@ class npc_ranger_lilatha : public CreatureScript }; - void AddSC_ghostlands() { new npc_blood_knight_dawnstar(); diff --git a/src/server/scripts/EasternKingdoms/hinterlands.cpp b/src/server/scripts/EasternKingdoms/hinterlands.cpp index 363e7f68e871d..f9925feda74c0 100644 --- a/src/server/scripts/EasternKingdoms/hinterlands.cpp +++ b/src/server/scripts/EasternKingdoms/hinterlands.cpp @@ -149,8 +149,6 @@ class npc_00x09hl : public CreatureScript }; - - /*###### ## npc_rinji ######*/ @@ -350,8 +348,6 @@ class npc_rinji : public CreatureScript }; - - void AddSC_hinterlands() { new npc_00x09hl(); diff --git a/src/server/scripts/EasternKingdoms/ironforge.cpp b/src/server/scripts/EasternKingdoms/ironforge.cpp index 2b4f4fd034f2f..0c55076c3f232 100644 --- a/src/server/scripts/EasternKingdoms/ironforge.cpp +++ b/src/server/scripts/EasternKingdoms/ironforge.cpp @@ -91,7 +91,6 @@ class npc_royal_historian_archesonus : public CreatureScript }; - void AddSC_ironforge() { new npc_royal_historian_archesonus(); diff --git a/src/server/scripts/EasternKingdoms/loch_modan.cpp b/src/server/scripts/EasternKingdoms/loch_modan.cpp index fd1283d99a591..3ea335e83b887 100644 --- a/src/server/scripts/EasternKingdoms/loch_modan.cpp +++ b/src/server/scripts/EasternKingdoms/loch_modan.cpp @@ -98,7 +98,6 @@ class npc_mountaineer_pebblebitty : public CreatureScript }; - void AddSC_loch_modan() { new npc_mountaineer_pebblebitty(); diff --git a/src/server/scripts/EasternKingdoms/redridge_mountains.cpp b/src/server/scripts/EasternKingdoms/redridge_mountains.cpp index f887f769412a8..71aaa4158c386 100644 --- a/src/server/scripts/EasternKingdoms/redridge_mountains.cpp +++ b/src/server/scripts/EasternKingdoms/redridge_mountains.cpp @@ -167,8 +167,6 @@ class npc_corporal_keeshan : public CreatureScript }; - - void AddSC_redridge_mountains() { new npc_corporal_keeshan(); diff --git a/src/server/scripts/EasternKingdoms/searing_gorge.cpp b/src/server/scripts/EasternKingdoms/searing_gorge.cpp index df09a543521da..c4c9a7d0d072d 100644 --- a/src/server/scripts/EasternKingdoms/searing_gorge.cpp +++ b/src/server/scripts/EasternKingdoms/searing_gorge.cpp @@ -80,7 +80,6 @@ class npc_kalaran_windblade : public CreatureScript }; - /*###### ## npc_lothos_riftwaker ######*/ @@ -119,7 +118,6 @@ class npc_lothos_riftwaker : public CreatureScript }; - /*###### ## npc_zamael_lunthistle ######*/ @@ -169,7 +167,6 @@ class npc_zamael_lunthistle : public CreatureScript }; - /*###### ## ######*/ diff --git a/src/server/scripts/EasternKingdoms/silvermoon_city.cpp b/src/server/scripts/EasternKingdoms/silvermoon_city.cpp index afb8bb18c4074..7a9d7efb34726 100644 --- a/src/server/scripts/EasternKingdoms/silvermoon_city.cpp +++ b/src/server/scripts/EasternKingdoms/silvermoon_city.cpp @@ -103,7 +103,6 @@ class npc_blood_knight_stillblade : public CreatureScript }; - void AddSC_silvermoon_city() { new npc_blood_knight_stillblade(); diff --git a/src/server/scripts/EasternKingdoms/silverpine_forest.cpp b/src/server/scripts/EasternKingdoms/silverpine_forest.cpp index c70c34aee6a16..9ae10832e285b 100644 --- a/src/server/scripts/EasternKingdoms/silverpine_forest.cpp +++ b/src/server/scripts/EasternKingdoms/silverpine_forest.cpp @@ -99,9 +99,6 @@ class npc_astor_hadren : public CreatureScript }; - - - /*###### ## npc_deathstalker_erland ######*/ @@ -197,7 +194,6 @@ class npc_deathstalker_erland : public CreatureScript }; - /*###### ## pyrewood_ambush #######*/ @@ -384,8 +380,6 @@ class pyrewood_ambush : public CreatureScript }; - - /*###### ## AddSC ######*/ diff --git a/src/server/scripts/EasternKingdoms/stormwind_city.cpp b/src/server/scripts/EasternKingdoms/stormwind_city.cpp index 71c26f059425c..76af8e4460ec5 100644 --- a/src/server/scripts/EasternKingdoms/stormwind_city.cpp +++ b/src/server/scripts/EasternKingdoms/stormwind_city.cpp @@ -75,7 +75,6 @@ class npc_archmage_malin : public CreatureScript }; - /*###### ## npc_bartleby ######*/ @@ -148,8 +147,6 @@ class npc_bartleby : public CreatureScript }; - - /*###### ## npc_dashel_stonefist ######*/ @@ -222,8 +219,6 @@ class npc_dashel_stonefist : public CreatureScript }; - - /*###### ## npc_lady_katrana_prestor ######*/ @@ -278,7 +273,6 @@ class npc_lady_katrana_prestor : public CreatureScript }; - /*###### ## npc_lord_gregor_lescovar ######*/ @@ -452,7 +446,6 @@ class npc_lord_gregor_lescovar : public CreatureScript }; - /*###### ## npc_marzon_silent_blade ######*/ @@ -534,7 +527,6 @@ class npc_marzon_silent_blade : public CreatureScript }; - /*###### ## npc_tyrion_spybot ######*/ @@ -684,7 +676,6 @@ class npc_tyrion_spybot : public CreatureScript }; - /*###### ## npc_tyrion ######*/ diff --git a/src/server/scripts/EasternKingdoms/swamp_of_sorrows.cpp b/src/server/scripts/EasternKingdoms/swamp_of_sorrows.cpp index 4a3838dd55746..67f2bd2c7e842 100644 --- a/src/server/scripts/EasternKingdoms/swamp_of_sorrows.cpp +++ b/src/server/scripts/EasternKingdoms/swamp_of_sorrows.cpp @@ -16,7 +16,6 @@ * with this program. If not, see . */ - #include "ScriptPCH.h" #include "ScriptedEscortAI.h" diff --git a/src/server/scripts/EasternKingdoms/tirisfal_glades.cpp b/src/server/scripts/EasternKingdoms/tirisfal_glades.cpp index 57522ac8ca3b0..6b68ac58ea351 100644 --- a/src/server/scripts/EasternKingdoms/tirisfal_glades.cpp +++ b/src/server/scripts/EasternKingdoms/tirisfal_glades.cpp @@ -153,7 +153,6 @@ class npc_calvin_montague : public CreatureScript }; - /*###### ## go_mausoleum_door ## go_mausoleum_trigger diff --git a/src/server/scripts/EasternKingdoms/undercity.cpp b/src/server/scripts/EasternKingdoms/undercity.cpp index 906827d91a4fb..4b0ac36518112 100644 --- a/src/server/scripts/EasternKingdoms/undercity.cpp +++ b/src/server/scripts/EasternKingdoms/undercity.cpp @@ -146,7 +146,6 @@ class npc_lady_sylvanas_windrunner : public CreatureScript }; - /*###### ## npc_highborne_lamenter ######*/ @@ -256,7 +255,6 @@ class npc_parqual_fintallas : public CreatureScript }; - /*###### ## AddSC ######*/ diff --git a/src/server/scripts/EasternKingdoms/western_plaguelands.cpp b/src/server/scripts/EasternKingdoms/western_plaguelands.cpp index 10a54c4c81dc1..3ef6b7f689c32 100644 --- a/src/server/scripts/EasternKingdoms/western_plaguelands.cpp +++ b/src/server/scripts/EasternKingdoms/western_plaguelands.cpp @@ -103,7 +103,6 @@ class npcs_dithers_and_arbington : public CreatureScript }; - /*###### ## npc_myranda_the_hag ######*/ @@ -153,7 +152,6 @@ class npc_myranda_the_hag : public CreatureScript }; - /*###### ## npc_the_scourge_cauldron ######*/ @@ -269,7 +267,6 @@ class npc_andorhal_tower : public CreatureScript }; - /*###### ## npc_anchorite_truuen ######*/ @@ -401,8 +398,6 @@ class npc_anchorite_truuen : public CreatureScript }; - - /*###### ## ######*/ diff --git a/src/server/scripts/EasternKingdoms/westfall.cpp b/src/server/scripts/EasternKingdoms/westfall.cpp index ef1a1ff49fbc7..5b6c377a37e80 100644 --- a/src/server/scripts/EasternKingdoms/westfall.cpp +++ b/src/server/scripts/EasternKingdoms/westfall.cpp @@ -188,8 +188,6 @@ class npc_daphne_stilwell : public CreatureScript }; - - /*###### ## npc_defias_traitor ######*/ @@ -263,8 +261,6 @@ class npc_defias_traitor : public CreatureScript }; - - void AddSC_westfall() { new npc_daphne_stilwell(); diff --git a/src/server/scripts/EasternKingdoms/wetlands.cpp b/src/server/scripts/EasternKingdoms/wetlands.cpp index ca905dd30ae27..b89aa63d16616 100644 --- a/src/server/scripts/EasternKingdoms/wetlands.cpp +++ b/src/server/scripts/EasternKingdoms/wetlands.cpp @@ -135,7 +135,6 @@ class npc_tapoke_slim_jahn : public CreatureScript }; - /*###### ## npc_mikhail ######*/ diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp index e688acd10919d..4833827755c9a 100644 --- a/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp +++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp @@ -161,7 +161,7 @@ class npc_blackfathom_deeps_event : public CreatureScript { if (uiFrostBoltVolleyTimer <= uiDiff) { - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) { if (pTarget) DoCast(pTarget, SPELL_FROST_BOLT_VOLLEY); @@ -190,7 +190,6 @@ class npc_blackfathom_deeps_event : public CreatureScript }; - enum eMorridune { SAY_MORRIDUNE_1 = -1048003, @@ -254,9 +253,6 @@ class npc_morridune : public CreatureScript }; - - - void AddSC_blackfathom_deeps() { new go_blackfathom_altar(); diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_aku_mai.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_aku_mai.cpp index cf8b2b1056e2c..3580b3d4c305b 100644 --- a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_aku_mai.cpp +++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_aku_mai.cpp @@ -89,7 +89,6 @@ class boss_aku_mai : public CreatureScript }; - void AddSC_boss_aku_mai() { new boss_aku_mai(); diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_gelihast.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_gelihast.cpp index 4e245921ead4e..9eec90ad02f85 100644 --- a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_gelihast.cpp +++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_gelihast.cpp @@ -80,7 +80,6 @@ class boss_gelihast : public CreatureScript }; - void AddSC_boss_gelihast() { new boss_gelihast(); diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_kelris.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_kelris.cpp index 28461b19761cd..5833cb2d123d9 100644 --- a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_kelris.cpp +++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_kelris.cpp @@ -103,7 +103,6 @@ class boss_kelris : public CreatureScript }; - void AddSC_boss_kelris() { new boss_kelris(); diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/instance_blackfathom_deeps.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/instance_blackfathom_deeps.cpp index 629c1b160a5c7..92c2f1d4d65cd 100644 --- a/src/server/scripts/Kalimdor/BlackfathomDeeps/instance_blackfathom_deeps.cpp +++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/instance_blackfathom_deeps.cpp @@ -258,7 +258,6 @@ class instance_blackfathom_deeps : public InstanceMapScript }; - void AddSC_instance_blackfathom_deeps() { new instance_blackfathom_deeps(); diff --git a/src/server/scripts/Kalimdor/CMakeLists.txt b/src/server/scripts/Kalimdor/CMakeLists.txt index 1c0db64a91243..f198fcbc497ca 100644 --- a/src/server/scripts/Kalimdor/CMakeLists.txt +++ b/src/server/scripts/Kalimdor/CMakeLists.txt @@ -42,6 +42,7 @@ set(scripts_STAT_SRCS Kalimdor/CavernsOfTime/DarkPortal/dark_portal.cpp Kalimdor/CavernsOfTime/DarkPortal/boss_aeonus.cpp Kalimdor/CavernsOfTime/DarkPortal/boss_temporus.cpp + Kalimdor/DireMaul/npc_pusillin.cpp Kalimdor/BlackfathomDeeps/boss_kelris.cpp Kalimdor/BlackfathomDeeps/instance_blackfathom_deeps.cpp Kalimdor/BlackfathomDeeps/boss_gelihast.cpp diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp index cd7d5ade01848..3bd68634571b1 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp @@ -239,7 +239,6 @@ class boss_anetheron : public CreatureScript }; - #define SPELL_IMMOLATION 31303 #define SPELL_INFERNO_EFFECT 31302 @@ -325,7 +324,6 @@ class mob_towering_infernal : public CreatureScript }; - void AddSC_boss_anetheron() { new boss_anetheron(); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp index b0b9d65dd0cda..e2fa3a69f9659 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp @@ -583,7 +583,7 @@ class boss_archimonde : public CreatureScript if (GripOfTheLegionTimer <= diff) { - DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_GRIP_OF_THE_LEGION); + DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0), SPELL_GRIP_OF_THE_LEGION); GripOfTheLegionTimer = urand(5000,25000); } else GripOfTheLegionTimer -= diff; @@ -594,7 +594,7 @@ class boss_archimonde : public CreatureScript else DoScriptText(SAY_AIR_BURST2, me); - DoCast(SelectUnit(SELECT_TARGET_RANDOM, 1), SPELL_AIR_BURST);//not on tank + DoCast(SelectTarget(SELECT_TARGET_RANDOM, 1), SPELL_AIR_BURST);//not on tank AirBurstTimer = urand(25000,40000); } else AirBurstTimer -= diff; @@ -611,7 +611,7 @@ class boss_archimonde : public CreatureScript else DoScriptText(SAY_DOOMFIRE2, me); - Unit *temp = SelectUnit(SELECT_TARGET_RANDOM, 1); + Unit *temp = SelectTarget(SELECT_TARGET_RANDOM, 1); if (!temp) temp = me->getVictim(); @@ -626,7 +626,7 @@ class boss_archimonde : public CreatureScript { if (CanUseFingerOfDeath()) { - DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_FINGER_OF_DEATH); + DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0), SPELL_FINGER_OF_DEATH); MeleeRangeCheckTimer = 1000; } @@ -640,10 +640,6 @@ class boss_archimonde : public CreatureScript }; - - - - void AddSC_boss_archimonde() { new boss_archimonde(); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp index 11b354f8a7725..417d875da8394 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp @@ -202,7 +202,6 @@ class boss_azgalor : public CreatureScript }; - #define SPELL_THRASH 12787 #define SPELL_CRIPPLE 31406 #define SPELL_WARSTOMP 31408 @@ -301,7 +300,6 @@ class mob_lesser_doomguard : public CreatureScript }; - void AddSC_boss_azgalor() { new boss_azgalor(); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp index 9d478bc0639d8..377ca4c2e2504 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp @@ -210,7 +210,6 @@ class boss_kazrogal : public CreatureScript }; - void AddSC_boss_kazrogal() { new boss_kazrogal(); 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 26b0d9288a34d..f46b374b2e80d 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp @@ -205,7 +205,6 @@ class boss_rage_winterchill : public CreatureScript }; - void AddSC_boss_rage_winterchill() { new boss_rage_winterchill(); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp index 23a73b168977c..26aa3fd7cfca1 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.cpp @@ -69,7 +69,7 @@ class npc_jaina_proudmoore : public CreatureScript break; case GOSSIP_ACTION_INFO_DEF: ai->Debug = !ai->Debug; - sLog->outDebug("TSCR: HyjalAI - Debug mode has been toggled"); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: HyjalAI - Debug mode has been toggled"); break; } return true; @@ -121,8 +121,6 @@ class npc_jaina_proudmoore : public CreatureScript }; - - class npc_thrall : public CreatureScript { public: @@ -148,7 +146,7 @@ class npc_thrall : public CreatureScript break; case GOSSIP_ACTION_INFO_DEF: ai->Debug = !ai->Debug; - sLog->outDebug("TSCR: HyjalAI - Debug mode has been toggled"); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: HyjalAI - Debug mode has been toggled"); break; } return true; @@ -201,8 +199,6 @@ class npc_thrall : public CreatureScript }; - - class npc_tyrande_whisperwind : public CreatureScript { public: @@ -249,8 +245,6 @@ class npc_tyrande_whisperwind : public CreatureScript }; - - void AddSC_hyjal() { new npc_jaina_proudmoore(); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp index d5b7a1b0ee384..bfdf0d28f41e8 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp @@ -563,7 +563,7 @@ void hyjalAI::SummonNextWave(const Wave wave[18], uint32 Count, float Base[4][3] else { NextWaveTimer = 15000; - sLog->outDebug("TSCR: HyjalAI: debug mode is enabled. Next Wave in 15 seconds"); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: HyjalAI: debug mode is enabled. Next Wave in 15 seconds"); } } else @@ -895,7 +895,7 @@ void hyjalAI::UpdateAI(const uint32 diff) switch(Spells[i].TargetType) { case TARGETTYPE_SELF: pTarget = me; break; - case TARGETTYPE_RANDOM: pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); break; + case TARGETTYPE_RANDOM: pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0); break; case TARGETTYPE_VICTIM: pTarget = me->getVictim(); break; } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp index 04e0313999ff9..93450203aa0f2 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp @@ -626,7 +626,6 @@ class mob_abomination : public CreatureScript }; - #define SPELL_FRENZY 31540 class mob_ghoul : public CreatureScript @@ -733,7 +732,6 @@ class mob_ghoul : public CreatureScript }; - #define SPELL_RAISE_DEAD_1 31617 #define SPELL_RAISE_DEAD_2 31624 #define SPELL_RAISE_DEAD_3 31625 @@ -856,7 +854,6 @@ class mob_necromancer : public CreatureScript }; - #define SPELL_BANSHEE_CURSE 31651 #define SPELL_BANSHEE_WAIL 38183 #define SPELL_ANTI_MAGIC_SHELL 31662 @@ -964,7 +961,6 @@ class mob_banshee : public CreatureScript }; - #define SPELL_WEB 28991 class mob_crypt_fiend : public CreatureScript @@ -1057,7 +1053,6 @@ class mob_crypt_fiend : public CreatureScript }; - #define SPELL_MANA_BURN 31729 class mob_fel_stalker : public CreatureScript @@ -1150,7 +1145,6 @@ class mob_fel_stalker : public CreatureScript }; - #define SPELL_FROST_BREATH 31688 class mob_frost_wyrm : public CreatureScript @@ -1268,7 +1262,6 @@ class mob_frost_wyrm : public CreatureScript }; - #define SPELL_GARGOYLE_STRIKE 31664 class mob_gargoyle : public CreatureScript @@ -1380,7 +1373,7 @@ class mob_gargoyle : public CreatureScript forcemove = false; if (forcemove) { - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0); if (pTarget) me->Attack(pTarget,false); } @@ -1409,7 +1402,6 @@ class mob_gargoyle : public CreatureScript }; - #define SPELL_EXPLODING_SHOT 7896 class alliance_rifleman : public CreatureScript diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp index 824e07249b8d8..1ef40a375b1a7 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp @@ -260,7 +260,7 @@ class instance_hyjal : public InstanceMapScript break; } - sLog->outDebug("TSCR: Instance Hyjal: Instance data updated for event %u (Data=%u)",type,data); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Hyjal: Instance data updated for event %u (Data=%u)",type,data); if (data == DONE) { @@ -322,7 +322,6 @@ class instance_hyjal : public InstanceMapScript }; - void AddSC_instance_mount_hyjal() { new instance_hyjal(); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_epoch.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_epoch.cpp index 103e1b1b426f2..7981bdbed7e5a 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_epoch.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_epoch.cpp @@ -15,7 +15,6 @@ * with this program. If not, see . */ - /* Script Data Start SDName: Boss epoch SDAuthor: Tartalo @@ -151,7 +150,6 @@ class boss_epoch : public CreatureScript }; - void AddSC_boss_epoch() { new boss_epoch(); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_infinite.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_infinite.cpp index 9e31dc322884c..f447e8760797d 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_infinite.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_infinite.cpp @@ -31,7 +31,6 @@ enum Yells SAY_DEATH = -1595047 }; - class boss_infinite_corruptor : public CreatureScript { public: @@ -81,7 +80,6 @@ class boss_infinite_corruptor : public CreatureScript }; - void AddSC_boss_infinite_corruptor() { new boss_infinite_corruptor(); 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 002eaae451dcd..b269587b19d12 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_mal_ganis.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_mal_ganis.cpp @@ -254,7 +254,6 @@ class boss_mal_ganis : public CreatureScript }; - void AddSC_boss_mal_ganis() { new boss_mal_ganis(); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_meathook.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_meathook.cpp index 2a92774fcfe79..7ad2ba18ff5bf 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_meathook.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_meathook.cpp @@ -135,7 +135,6 @@ class boss_meathook : public CreatureScript }; - void AddSC_boss_meathook() { new boss_meathook(); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_salramm.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_salramm.cpp index 82ae7a85d030a..6eb1cb66bd767 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_salramm.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_salramm.cpp @@ -117,7 +117,7 @@ class boss_salramm : public CreatureScript //Shadow bolt timer if (uiShadowBoltTimer <= diff) { - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(pTarget, SPELL_SHADOW_BOLT); uiShadowBoltTimer = urand(8000,12000); } else uiShadowBoltTimer -= diff; @@ -126,7 +126,7 @@ class boss_salramm : public CreatureScript if (uiStealFleshTimer <= diff) { DoScriptText(RAND(SAY_STEAL_FLESH_1,SAY_STEAL_FLESH_2,SAY_STEAL_FLESH_3), me); - if (Unit* random_pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* random_pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(random_pTarget, SPELL_STEAL_FLESH); uiStealFleshTimer = 10000; } else uiStealFleshTimer -= diff; @@ -135,7 +135,7 @@ class boss_salramm : public CreatureScript if (uiSummonGhoulsTimer <= diff) { DoScriptText(RAND(SAY_SUMMON_GHOULS_1,SAY_SUMMON_GHOULS_2), me); - if (Unit* random_pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* random_pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(random_pTarget, SPELL_SUMMON_GHOULS); uiSummonGhoulsTimer = 10000; } else uiSummonGhoulsTimer -= diff; @@ -162,7 +162,6 @@ class boss_salramm : public CreatureScript }; - void AddSC_boss_salramm() { new boss_salramm(); 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 b5408326d1ab9..be6c5aad8fb20 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp @@ -415,7 +415,7 @@ class npc_arthas : public CreatureScript if (Creature* pTemp = me->SummonCreature((uint32)RiftAndSpawnsLocations[i][0],RiftAndSpawnsLocations[timeRiftID][1],RiftAndSpawnsLocations[timeRiftID][2],RiftAndSpawnsLocations[timeRiftID][3],RiftAndSpawnsLocations[timeRiftID][4],TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,900000)) { guidVector[i-timeRiftID-1] = pTemp->GetGUID(); - pTemp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_UNK_9); + pTemp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_PASSIVE); pTemp->SetReactState(REACT_PASSIVE); pTemp->GetMotionMaster()->MovePoint(0, RiftAndSpawnsLocations[i][1],RiftAndSpawnsLocations[i][2],RiftAndSpawnsLocations[i][3]); if ((uint32)RiftAndSpawnsLocations[i][0] == NPC_EPOCH) @@ -1007,7 +1007,7 @@ class npc_arthas : public CreatureScript { pDisguised2->UpdateEntry(NPC_INFINITE_HUNTER, 0); //Make them unattackable - pDisguised2->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_UNK_9); + pDisguised2->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_PASSIVE); pDisguised2->SetReactState(REACT_PASSIVE); } JumpToNextStep(2000); @@ -1017,7 +1017,7 @@ class npc_arthas : public CreatureScript { pDisguised1->UpdateEntry(NPC_INFINITE_AGENT, 0); //Make them unattackable - pDisguised1->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_UNK_9); + pDisguised1->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_PASSIVE); pDisguised1->SetReactState(REACT_PASSIVE); } JumpToNextStep(2000); @@ -1027,7 +1027,7 @@ class npc_arthas : public CreatureScript { pDisguised0->UpdateEntry(NPC_INFINITE_ADVERSARY, 0); //Make them unattackable - pDisguised0->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_UNK_9); + pDisguised0->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_PASSIVE); pDisguised0->SetReactState(REACT_PASSIVE); } JumpToNextStep(2000); @@ -1041,7 +1041,7 @@ class npc_arthas : public CreatureScript for (uint32 i = 0; i< ENCOUNTER_DRACONIAN_NUMBER; ++i) if (Creature* pTemp = Unit::GetCreature(*me, uiInfiniteDraconianGUID[i])) { - pTemp->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_UNK_9); + pTemp->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_PASSIVE); pTemp->SetReactState(REACT_AGGRESSIVE); } JumpToNextStep(5000); @@ -1099,7 +1099,7 @@ class npc_arthas : public CreatureScript if (Creature* pEpoch = Unit::GetCreature(*me, uiEpochGUID)) { //Make Epoch attackable - pEpoch->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_UNK_9); + pEpoch->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_PASSIVE); pEpoch->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); pEpoch->SetReactState(REACT_AGGRESSIVE); } @@ -1154,7 +1154,7 @@ class npc_arthas : public CreatureScript case 87: if (Creature* pMalganis = Unit::GetCreature(*me, uiMalganisGUID)) { - pMalganis->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_UNK_6 | UNIT_FLAG_UNK_9 | UNIT_FLAG_UNK_15); + pMalganis->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_UNK_6 | UNIT_FLAG_PASSIVE | UNIT_FLAG_UNK_15); pMalganis->SetReactState(REACT_AGGRESSIVE); } JumpToNextStep(1000); @@ -1199,7 +1199,7 @@ class npc_arthas : public CreatureScript if (uiExorcismTimer < diff) { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM,0)) DoCast(target, SPELL_EXORCISM_N); uiExorcismTimer = 7300; } else uiExorcismTimer -= diff; 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 73cd29f8642f8..9bb42e6b7fde6 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 @@ -282,7 +282,6 @@ class instance_culling_of_stratholme : public InstanceMapScript }; - void AddSC_instance_culling_of_stratholme() { new instance_culling_of_stratholme(); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_aeonus.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_aeonus.cpp index 2e86a2271039c..00faa87a378b6 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_aeonus.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_aeonus.cpp @@ -143,7 +143,6 @@ class boss_aeonus : public CreatureScript }; - void AddSC_boss_aeonus() { new boss_aeonus(); 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 08a2a910adcf9..3af197e86587f 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 @@ -124,7 +124,7 @@ class boss_chrono_lord_deja : public CreatureScript //Arcane Discharge if (ArcaneDischarge_Timer <= diff) { - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0); DoCast(pTarget, SPELL_ARCANE_DISCHARGE); ArcaneDischarge_Timer = 20000+rand()%10000; } else ArcaneDischarge_Timer -= diff; @@ -152,7 +152,6 @@ class boss_chrono_lord_deja : public CreatureScript }; - void AddSC_boss_chrono_lord_deja() { new boss_chrono_lord_deja(); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_temporus.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_temporus.cpp index 94fa5c29e01b4..8c9a5c5c1b95e 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_temporus.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/boss_temporus.cpp @@ -150,7 +150,6 @@ class boss_temporus : public CreatureScript }; - void AddSC_boss_temporus() { new boss_temporus(); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.cpp index 63883c9763c32..adc2dc2be003e 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/dark_portal.cpp @@ -237,7 +237,6 @@ class npc_medivh_bm : public CreatureScript }; - struct Wave { uint32 PortalMob[4]; //spawns for portal waves (in order) @@ -325,7 +324,7 @@ class npc_time_rift : public CreatureScript mRiftWaveCount = 0; entry = PortalWaves[mWaveId].PortalMob[mRiftWaveCount]; - sLog->outDebug("TSCR: npc_time_rift: summoning wave Creature (Wave %u, Entry %u).",mRiftWaveCount,entry); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: npc_time_rift: summoning wave Creature (Wave %u, Entry %u).",mRiftWaveCount,entry); ++mRiftWaveCount; @@ -350,7 +349,7 @@ class npc_time_rift : public CreatureScript if (me->IsNonMeleeSpellCasted(false)) return; - sLog->outDebug("TSCR: npc_time_rift: not casting anylonger, i need to die."); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: npc_time_rift: not casting anylonger, i need to die."); me->setDeathState(JUST_DIED); if (pInstance->GetData(TYPE_RIFT) == IN_PROGRESS) @@ -360,7 +359,6 @@ class npc_time_rift : public CreatureScript }; - #define SAY_SAAT_WELCOME -1269019 #define GOSSIP_ITEM_OBTAIN "[PH] Obtain Chrono-Beacon" @@ -407,7 +405,6 @@ class npc_saat : public CreatureScript }; - void AddSC_dark_portal() { new npc_medivh_bm(); 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 2bfa2e54b3d9f..287abd42cf775 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/instance_dark_portal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/DarkPortal/instance_dark_portal.cpp @@ -194,7 +194,7 @@ class instance_dark_portal : public InstanceMapScript { if (data == IN_PROGRESS) { - sLog->outDebug("TSCR: Instance Dark Portal: Starting event."); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Dark Portal: Starting event."); InitWorldState(); m_auiEncounter[1] = IN_PROGRESS; NextPortal_Timer = 15000; @@ -203,7 +203,7 @@ class instance_dark_portal : public InstanceMapScript if (data == DONE) { //this may be completed further out in the post-event - sLog->outDebug("TSCR: Instance Dark Portal: Event completed."); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Dark Portal: Event completed."); Map::PlayerList const& players = instance->GetPlayers(); if (!players.isEmpty()) @@ -268,7 +268,7 @@ class instance_dark_portal : public InstanceMapScript if (entry == RIFT_BOSS) entry = RandRiftBoss(); - sLog->outDebug("TSCR: Instance Dark Portal: Summoning rift boss entry %u.",entry); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Dark Portal: Summoning rift boss entry %u.",entry); Position pos; me->GetRandomNearPosition(pos, 10.0f); @@ -279,7 +279,7 @@ class instance_dark_portal : public InstanceMapScript if (Creature* summon = me->SummonCreature(entry, pos, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000)) return summon; - sLog->outDebug("TSCR: Instance Dark Portal: What just happened there? No boss, no loot, no fun..."); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Dark Portal: What just happened there? No boss, no loot, no fun..."); return NULL; } @@ -292,7 +292,7 @@ class instance_dark_portal : public InstanceMapScript if (tmp >= CurrentRiftId) ++tmp; - sLog->outDebug("TSCR: Instance Dark Portal: Creating Time Rift at locationId %i (old locationId was %u).",tmp,CurrentRiftId); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Dark Portal: Creating Time Rift at locationId %i (old locationId was %u).",tmp,CurrentRiftId); CurrentRiftId = tmp; @@ -347,7 +347,6 @@ class instance_dark_portal : public InstanceMapScript }; - void AddSC_instance_dark_portal() { new instance_dark_portal(); 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 9384168729d68..e402a48c59a29 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_captain_skarloc.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_captain_skarloc.cpp @@ -150,7 +150,6 @@ class boss_captain_skarloc : public CreatureScript }; - void AddSC_boss_captain_skarloc() { new boss_captain_skarloc(); 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 bd8633cefc297..4fa3fafebc5d2 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_epoch_hunter.cpp @@ -119,7 +119,7 @@ class boss_epoch_hunter : public CreatureScript if (WingBuffet_Timer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) DoCast(pTarget, SPELL_WING_BUFFET); WingBuffet_Timer = 25000+rand()%10000; } else WingBuffet_Timer -= diff; @@ -136,7 +136,6 @@ class boss_epoch_hunter : public CreatureScript }; - void AddSC_boss_epoch_hunter() { new boss_epoch_hunter(); 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 dcea74d806c8a..0243441215b97 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_leutenant_drake.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/boss_leutenant_drake.cpp @@ -189,7 +189,6 @@ class boss_lieutenant_drake : public CreatureScript }; - void AddSC_boss_lieutenant_drake() { new go_barrel_old_hillsbrad(); 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 e61a70cbb0eee..14668bf4ec8da 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/instance_old_hillsbrad.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/instance_old_hillsbrad.cpp @@ -83,7 +83,7 @@ class instance_old_hillsbrad : public InstanceMapScript } } - sLog->outDebug("TSCR: Instance Old Hillsbrad: GetPlayerInMap, but PlayerList is empty!"); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Old Hillsbrad: GetPlayerInMap, but PlayerList is empty!"); return NULL; } @@ -123,7 +123,7 @@ class instance_old_hillsbrad : public InstanceMapScript if (!pPlayer) { - sLog->outDebug("TSCR: Instance Old Hillsbrad: SetData (Type: %u Data %u) cannot find any player.", type, data); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Old Hillsbrad: SetData (Type: %u Data %u) cannot find any player.", type, data); return; } @@ -139,7 +139,7 @@ class instance_old_hillsbrad : public InstanceMapScript ++mBarrelCount; DoUpdateWorldState(WORLD_STATE_OH, mBarrelCount); - sLog->outDebug("TSCR: Instance Old Hillsbrad: go_barrel_old_hillsbrad count %u",mBarrelCount); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Old Hillsbrad: go_barrel_old_hillsbrad count %u",mBarrelCount); m_auiEncounter[0] = IN_PROGRESS; @@ -160,7 +160,7 @@ class instance_old_hillsbrad : public InstanceMapScript { ++mThrallEventCount; m_auiEncounter[1] = NOT_STARTED; - sLog->outDebug("TSCR: Instance Old Hillsbrad: Thrall event failed %u times. Resetting all sub-events.",mThrallEventCount); + sLog->outDebug(LOG_FILTER_TSCR, "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; @@ -173,29 +173,29 @@ class instance_old_hillsbrad : public InstanceMapScript m_auiEncounter[3] = data; m_auiEncounter[4] = data; m_auiEncounter[5] = data; - sLog->outDebug("TSCR: Instance Old Hillsbrad: Thrall event failed %u times. Resetting all sub-events.",mThrallEventCount); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Old Hillsbrad: Thrall event failed %u times. Resetting all sub-events.",mThrallEventCount); } } else m_auiEncounter[1] = data; - sLog->outDebug("TSCR: Instance Old Hillsbrad: Thrall escort event adjusted to data %u.",data); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Old Hillsbrad: Thrall escort event adjusted to data %u.",data); break; } case TYPE_THRALL_PART1: m_auiEncounter[2] = data; - sLog->outDebug("TSCR: Instance Old Hillsbrad: Thrall event part I adjusted to data %u.",data); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Old Hillsbrad: Thrall event part I adjusted to data %u.",data); break; case TYPE_THRALL_PART2: m_auiEncounter[3] = data; - sLog->outDebug("TSCR: Instance Old Hillsbrad: Thrall event part II adjusted to data %u.",data); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Old Hillsbrad: Thrall event part II adjusted to data %u.",data); break; case TYPE_THRALL_PART3: m_auiEncounter[4] = data; - sLog->outDebug("TSCR: Instance Old Hillsbrad: Thrall event part III adjusted to data %u.",data); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Old Hillsbrad: Thrall event part III adjusted to data %u.",data); break; case TYPE_THRALL_PART4: m_auiEncounter[5] = data; - sLog->outDebug("TSCR: Instance Old Hillsbrad: Thrall event part IV adjusted to data %u.",data); + sLog->outDebug(LOG_FILTER_TSCR, "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 1d4dd4ca5b246..5c7f49e23df31 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.cpp @@ -90,7 +90,6 @@ class npc_erozion : public CreatureScript }; - /*###### ## npc_thrall_old_hillsbrad ######*/ @@ -563,9 +562,6 @@ class npc_thrall_old_hillsbrad : public CreatureScript }; - - - /*###### ## npc_taretha ######*/ @@ -658,8 +654,6 @@ class npc_taretha : public CreatureScript }; - - /*###### ## AddSC ######*/ diff --git a/src/server/scripts/Kalimdor/DireMaul/npc_pusillin.cpp b/src/server/scripts/Kalimdor/DireMaul/npc_pusillin.cpp new file mode 100644 index 0000000000000..a5f49b0b3cfe8 --- /dev/null +++ b/src/server/scripts/Kalimdor/DireMaul/npc_pusillin.cpp @@ -0,0 +1,313 @@ +/* + * Copyright (C) 2008-2011 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 "ScriptedFollowerAI.h" + +enum pus +{ + SAY_1 = -1901000, + SAY_2 = -1901001, + SAY_3 = -1901002, + SAY_4 = -1901003, + SAY_5 = -1901004, + + NPC_IMP = 13276 +}; + +enum eSpells +{ + SPELL_BLAST_WAVE = 17145, + SPELL_FIRE_BLAST = 14145, + SPELL_FIREBALL = 15228, + SPELL_RUNN = 22735 +}; + + +const Position SpawnPosition1 = {23.019f,-703.442f,-12.642f,3.23f}; +const Position SpawnPosition2 = {22.646f,-691.948f,-12.642f,4.13f}; +const Position SpawnPosition3 = {12.277f,-676.333f,-12.642f,4.97f}; +const Position SpawnPosition4 = {24.416f,-680.573f,-12.642f,4.31f}; + + +#define GOSSIP_HELLO "Game? Are your crazy?" +#define Gossip_2 "Why you little..." +#define Gossip_3 "Mark my words, I will catch you, Imp. And when I do!" +#define Gossip_4 "DIE!" +#define Gossip_5 "Prepare to meet your Maker." + +class npc_pusillin : public CreatureScript +{ +public: + npc_pusillin() : CreatureScript("npc_pusillin") { } + + struct npc_pusillinAI : public npc_escortAI + { + npc_pusillinAI(Creature* pCreature) : npc_escortAI(pCreature) + {} + + uint32 uiPhase; + uint32 uiGossipStep; + uint32 uiBlastWaveTimer; + uint32 uiFireBlastTimer; + uint32 uiFireBallTimer; + uint32 uiSpiritOfRunnTimer; + bool buffed; + + void Reset() + { + uiPhase = 0; + uiGossipStep = 0; + me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + uiBlastWaveTimer = urand(7000, 9000); + uiFireBlastTimer = urand(3000, 6000); + uiFireBallTimer = urand(11000, 13000); + uiSpiritOfRunnTimer = urand(5000, 7000); + buffed=false; + } + + void SetHoldState(bool bOnHold) + { + SetEscortPaused(bOnHold); + } + + void WaypointReached(uint32 uiPointId) + { + switch(uiPointId) + { + case 0: + break; + case 2: + uiGossipStep = 1; + me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + SetHoldState(true); + break; + case 4: + uiGossipStep = 2; + me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + SetHoldState(true); + break; + case 10: + uiGossipStep = 3; + me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + SetHoldState(true); + break; + case 16: + uiGossipStep = 4; + me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + break; + } + } + + void UpdateAI(const uint32 uiDiff) + { + + npc_escortAI::UpdateAI(uiDiff); + + if (uiPhase) + { + switch(uiPhase) + { + case 1: + DoScriptText(SAY_1,me); + uiPhase=0; + break; + case 2: + DoScriptText(SAY_2,me); + uiPhase=0; + break; + case 3: + DoScriptText(SAY_3,me); + uiPhase=0; + break; + case 4: + DoScriptText(SAY_4,me); + uiPhase=0; + break; + case 5: + DoScriptText(SAY_5,me); + me->setFaction(14); + float scale = me->GetFloatValue(OBJECT_FIELD_SCALE_X); + me->SetFloatValue(OBJECT_FIELD_SCALE_X, scale * 3); + Unit* pTarget = SelectTarget(SELECT_TARGET_NEAREST,0); + me->AI()->AttackStart(pTarget); + for(uint8 i = 0; i<5; i++) + { + switch(i) + { + case 1: + if (Creature *pImp=me->SummonCreature(NPC_IMP, SpawnPosition1, TEMPSUMMON_CORPSE_DESPAWN, 120000)) + { + if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) + pImp->AI()->AttackStart(pTarget); + } + break; + case 2: + if (Creature *pImp=me->SummonCreature(NPC_IMP, SpawnPosition2, TEMPSUMMON_CORPSE_DESPAWN, 120000)) + { + if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) + pImp->AI()->AttackStart(pTarget); + } + break; + case 3: + if (Creature *pImp=me->SummonCreature(NPC_IMP, SpawnPosition3, TEMPSUMMON_CORPSE_DESPAWN, 120000)) + { + if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) + pImp->AI()->AttackStart(pTarget); + } + break; + case 4: + if (Creature *pImp=me->SummonCreature(NPC_IMP, SpawnPosition4, TEMPSUMMON_CORPSE_DESPAWN, 120000)) + { + if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) + pImp->AI()->AttackStart(pTarget); + } + break; + } + + } + uiPhase=6; + break; + } + + } + + if (uiPhase==6) + { + if (!UpdateVictim()) + return; + + if (uiBlastWaveTimer <= uiDiff) + { + DoCast(me->getVictim(), SPELL_BLAST_WAVE); + uiBlastWaveTimer = urand(7000, 9000); + } + else uiBlastWaveTimer -= uiDiff; + + if (uiFireBlastTimer <= uiDiff) + { + DoCast(me->getVictim(), SPELL_FIRE_BLAST); + uiFireBlastTimer = urand(3000, 6000); + } + else uiFireBlastTimer -= uiDiff; + + if (uiFireBallTimer <= uiDiff) + { + DoCast(me->getVictim(), SPELL_FIREBALL); + uiFireBallTimer = urand(11000, 13000); + } + else uiFireBallTimer -= uiDiff; + + if (uiSpiritOfRunnTimer <= uiDiff && buffed==false) + { + DoCast(me, SPELL_RUNN); + buffed = true; + } + else uiSpiritOfRunnTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } + } + }; + + CreatureAI* GetAI(Creature* pCreature) const + { + return new npc_pusillinAI(pCreature); + } + + bool OnGossipHello(Player* pPlayer, Creature* pCreature) + { + npc_pusillinAI* pAI = CAST_AI(npc_pusillinAI,pCreature->AI()); + + switch (pAI->uiGossipStep) + { + case 0: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->SEND_GOSSIP_MENU(6877, pCreature->GetGUID()); + break; + case 1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, Gossip_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + pPlayer->SEND_GOSSIP_MENU(6878, pCreature->GetGUID()); + break; + case 2: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, Gossip_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); + pPlayer->SEND_GOSSIP_MENU(6879, pCreature->GetGUID()); + break; + case 3: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, Gossip_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4); + pPlayer->SEND_GOSSIP_MENU(6880, pCreature->GetGUID()); + break; + case 4: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, Gossip_5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); + pPlayer->SEND_GOSSIP_MENU(6881, pCreature->GetGUID()); + break; + } + + return true; + } + + bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction) + { + npc_pusillinAI* pAI = CAST_AI(npc_pusillinAI,pCreature->AI()); + + if (!pAI) + return false; + + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + CAST_AI(npc_pusillinAI, pCreature->AI())->Start(false, true, pPlayer->GetGUID()); + pAI->SetHoldState(false); + pAI->uiPhase = 1; + } + + if (uiAction == GOSSIP_ACTION_INFO_DEF+2) + { + pAI->uiPhase = 2; + pAI->SetHoldState(false); + } + + if (uiAction == GOSSIP_ACTION_INFO_DEF+3) + { + pAI->uiPhase = 3; + pAI->SetHoldState(false); + } + + if (uiAction == GOSSIP_ACTION_INFO_DEF+4) + { + pAI->uiPhase = 4; + pAI->SetHoldState(false); + } + + if (uiAction == GOSSIP_ACTION_INFO_DEF+5) + { + pAI->uiPhase = 5; + } + + pPlayer->CLOSE_GOSSIP_MENU(); + pAI->SetDespawnAtEnd(false); + pAI->SetDespawnAtFar(false); + pCreature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + return true; + } +}; + + +void AddSC_npc_pusillin() +{ + new npc_pusillin(); +} \ No newline at end of file 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 0ba1db3a7ea3b..7bbec40784dc2 100644 --- a/src/server/scripts/Kalimdor/Maraudon/boss_celebras_the_cursed.cpp +++ b/src/server/scripts/Kalimdor/Maraudon/boss_celebras_the_cursed.cpp @@ -70,7 +70,7 @@ class celebras_the_cursed : public CreatureScript if (Wrath_Timer <= diff) { Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); + pTarget = SelectTarget(SELECT_TARGET_RANDOM,0); if (pTarget) DoCast(pTarget, SPELL_WRATH); Wrath_Timer = 8000; diff --git a/src/server/scripts/Kalimdor/Maraudon/boss_princess_theradras.cpp b/src/server/scripts/Kalimdor/Maraudon/boss_princess_theradras.cpp index 32989190ca57d..57231ba33fd0d 100644 --- a/src/server/scripts/Kalimdor/Maraudon/boss_princess_theradras.cpp +++ b/src/server/scripts/Kalimdor/Maraudon/boss_princess_theradras.cpp @@ -82,7 +82,7 @@ class boss_princess_theradras : public CreatureScript if (Boulder_Timer <= diff) { Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); + pTarget = SelectTarget(SELECT_TARGET_RANDOM,0); if (pTarget) DoCast(pTarget, SPELL_BOULDER); Boulder_Timer = 10000; diff --git a/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp b/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp index 599efe0e6b325..5202a8e47a467 100644 --- a/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp +++ b/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp @@ -115,7 +115,6 @@ class boss_onyxia : public CreatureScript boss_onyxiaAI(Creature* pCreature) : ScriptedAI(pCreature), Summons(me) { m_pInstance = pCreature->GetInstanceScript(); - Reset(); } InstanceScript* m_pInstance; @@ -144,7 +143,7 @@ class boss_onyxia : public CreatureScript void Reset() { - if (!IsCombatMovement()) + if (!IsCombatMovementAllowed()) SetCombatMovement(true); m_uiPhase = PHASE_START; @@ -166,12 +165,13 @@ class boss_onyxia : public CreatureScript m_uiBellowingRoarTimer = 30000; Summons.DespawnAll(); + DespawnCreatures(NPC_WHELP, 150.0f); m_uiSummonWhelpCount = 0; m_bIsMoving = false; if (m_pInstance) { - m_pInstance->SetData(DATA_ONYXIA, NOT_STARTED); + m_pInstance->SetBossState(DATA_ONYXIA, NOT_STARTED); m_pInstance->SetData(DATA_ONYXIA_PHASE, m_uiPhase); m_pInstance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT); } @@ -184,7 +184,7 @@ class boss_onyxia : public CreatureScript if (m_pInstance) { - m_pInstance->SetData(DATA_ONYXIA, IN_PROGRESS); + m_pInstance->SetBossState(DATA_ONYXIA, IN_PROGRESS); m_pInstance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT); } } @@ -192,15 +192,16 @@ class boss_onyxia : public CreatureScript void JustDied(Unit* /*killer*/) { if (m_pInstance) - m_pInstance->SetData(DATA_ONYXIA, DONE); + m_pInstance->SetBossState(DATA_ONYXIA, DONE); Summons.DespawnAll(); + DespawnCreatures(NPC_WHELP, 150.0f); } void JustSummoned(Creature *pSummoned) { pSummoned->SetInCombatWithZone(); - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) pSummoned->AI()->AttackStart(pTarget); switch (pSummoned->GetEntry()) @@ -457,7 +458,7 @@ class boss_onyxia : public CreatureScript { if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != POINT_MOTION_TYPE) { - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(pTarget, SPELL_FIREBALL); m_uiFireballTimer = 8000; @@ -490,6 +491,18 @@ class boss_onyxia : public CreatureScript m_uiWhelpTimer -= uiDiff; } } + + void DespawnCreatures(uint32 entry, float distance) + { + std::list m_pCreatures; + GetCreatureListWithEntryInGrid(m_pCreatures, me, entry, distance); + + if (m_pCreatures.empty()) + return; + + for(std::list::iterator iter = m_pCreatures.begin(); iter != m_pCreatures.end(); ++iter) + (*iter)->DespawnOrUnsummon(); + } }; }; diff --git a/src/server/scripts/Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp b/src/server/scripts/Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp index cabd08dd85634..1e6d05ec8713a 100644 --- a/src/server/scripts/Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp +++ b/src/server/scripts/Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp @@ -37,7 +37,11 @@ class instance_onyxias_lair : public InstanceMapScript struct instance_onyxias_lair_InstanceMapScript : public InstanceScript { - instance_onyxias_lair_InstanceMapScript(Map* pMap) : InstanceScript(pMap) {Initialize();}; + instance_onyxias_lair_InstanceMapScript(Map* pMap) : InstanceScript(pMap) + { + Initialize(); + SetBossNumber(MAX_ENCOUNTER); + } //Eruption is a BFS graph problem //One map to remember all floor, one map to keep floor that still need to erupt and one queue to know what needs to be removed @@ -49,15 +53,11 @@ class instance_onyxias_lair : public InstanceMapScript uint32 m_uiManyWhelpsCounter; uint32 m_uiEruptTimer; - uint8 m_auiEncounter[MAX_ENCOUNTER]; - bool m_bAchievManyWhelpsHandleIt; bool m_bAchievSheDeepBreathMore; void Initialize() { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - m_uiOnyxiasGUID = 0; m_uiOnyxiaLiftoffTimer = 0; m_uiManyWhelpsCounter = 0; @@ -114,7 +114,7 @@ class instance_onyxias_lair : public InstanceMapScript { //THIS GOB IS A TRAP - What shall i do? =( //Cast it spell? Copyed Heigan method - pFloorEruption->SendCustomAnim(); + pFloorEruption->SendCustomAnim(pFloorEruption->GetGoAnimProgress()); pFloorEruption->CastSpell(NULL, Difficulty(instance->GetSpawnMode()) == RAID_DIFFICULTY_10MAN_NORMAL ? 17731 : 69294); //pFloorEruption->GetGOInfo()->trap.spellId //Get all immediatly nearby floors @@ -143,11 +143,6 @@ class instance_onyxias_lair : public InstanceMapScript { switch(uiType) { - case DATA_ONYXIA: - m_auiEncounter[0] = uiData; - if (uiData == IN_PROGRESS) - SetData(DATA_SHE_DEEP_BREATH_MORE, IN_PROGRESS); - break; case DATA_ONYXIA_PHASE: if (uiData == PHASE_BREATH) //Used to mark the liftoff phase { @@ -184,31 +179,36 @@ class instance_onyxias_lair : public InstanceMapScript } } - uint32 GetData(uint32 uiType) + uint64 GetData64(uint32 uiData) { - switch(uiType) + switch(uiData) { - case DATA_ONYXIA: - return m_auiEncounter[0]; + case DATA_ONYXIA_GUID: + return m_uiOnyxiasGUID; } return 0; } - uint64 GetData64(uint32 uiData) + bool SetBossState(uint32 id, EncounterState state) { - switch(uiData) + if (!InstanceScript::SetBossState(id, state)) + return false; + + switch (id) { - case DATA_ONYXIA_GUID: - return m_uiOnyxiasGUID; + case DATA_ONYXIA: + if (state == IN_PROGRESS) + SetData(DATA_SHE_DEEP_BREATH_MORE, IN_PROGRESS); + break; } - return 0; + return true; } void Update(uint32 uiDiff) { - if (GetData(DATA_ONYXIA) == IN_PROGRESS) + if (GetBossState(DATA_ONYXIA) == IN_PROGRESS) { if (m_uiOnyxiaLiftoffTimer && m_uiOnyxiaLiftoffTimer <= uiDiff) { @@ -253,7 +253,6 @@ class instance_onyxias_lair : public InstanceMapScript }; - void AddSC_instance_onyxias_lair() { new instance_onyxias_lair(); 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 93502bda44969..44e62de17b785 100644 --- a/src/server/scripts/Kalimdor/RazorfenDowns/boss_amnennar_the_coldbringer.cpp +++ b/src/server/scripts/Kalimdor/RazorfenDowns/boss_amnennar_the_coldbringer.cpp @@ -128,7 +128,6 @@ class boss_amnennar_the_coldbringer : public CreatureScript }; - void AddSC_boss_amnennar_the_coldbringer() { new boss_amnennar_the_coldbringer(); diff --git a/src/server/scripts/Kalimdor/RazorfenDowns/instance_razorfen_downs.cpp b/src/server/scripts/Kalimdor/RazorfenDowns/instance_razorfen_downs.cpp index c650ccaeddd6c..90728b61ae578 100644 --- a/src/server/scripts/Kalimdor/RazorfenDowns/instance_razorfen_downs.cpp +++ b/src/server/scripts/Kalimdor/RazorfenDowns/instance_razorfen_downs.cpp @@ -157,7 +157,6 @@ class instance_razorfen_downs : public InstanceMapScript break; } - if (Creature* creature = go->SummonCreature(uiCreature,2502.635f,844.140f,46.896f,0.633f)) { if (uiGongWaves == 10 || uiGongWaves == 1) @@ -210,7 +209,6 @@ class instance_razorfen_downs : public InstanceMapScript }; - void AddSC_instance_razorfen_downs() { new instance_razorfen_downs(); diff --git a/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp b/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp index 69e2a4829491b..a49e12e99cabe 100644 --- a/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp +++ b/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp @@ -84,7 +84,6 @@ class npc_henry_stern : public CreatureScript }; - /*###### ## go_gong ######*/ @@ -168,7 +167,6 @@ class npc_tomb_creature : public CreatureScript }; - void AddSC_razorfen_downs() { new npc_henry_stern(); diff --git a/src/server/scripts/Kalimdor/RazorfenKraul/instance_razorfen_kraul.cpp b/src/server/scripts/Kalimdor/RazorfenKraul/instance_razorfen_kraul.cpp index 300b16bc85df3..ba2cdb765fa2d 100644 --- a/src/server/scripts/Kalimdor/RazorfenKraul/instance_razorfen_kraul.cpp +++ b/src/server/scripts/Kalimdor/RazorfenKraul/instance_razorfen_kraul.cpp @@ -65,7 +65,7 @@ class instance_razorfen_kraul : public InstanceMapScript return plr; } } - sLog->outDebug("TSCR: Instance Razorfen Kraul: GetPlayerInMap, but PlayerList is empty!"); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Razorfen Kraul: GetPlayerInMap, but PlayerList is empty!"); return NULL; } @@ -103,7 +103,6 @@ class instance_razorfen_kraul : public InstanceMapScript }; - void AddSC_instance_razorfen_kraul() { new instance_razorfen_kraul(); diff --git a/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp b/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp index 7cf4e62635b7c..f1b21dba2abb1 100644 --- a/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp +++ b/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp @@ -146,7 +146,6 @@ class npc_willix : public CreatureScript }; - class npc_deaths_head_ward_keeper : public CreatureScript { public: @@ -193,8 +192,6 @@ class npc_deaths_head_ward_keeper : public CreatureScript }; - - void AddSC_razorfen_kraul() { new npc_willix(); diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp index 2b5b7dc8ddcb5..bae7f4ec8f7af 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp @@ -160,7 +160,6 @@ class boss_moam : public CreatureScript }; - void AddSC_boss_moam() { new boss_moam(); 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 cb0af2828d2b8..ecb9c0d28cbe1 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/instance_ruins_of_ahnqiraj.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/instance_ruins_of_ahnqiraj.cpp @@ -212,7 +212,6 @@ class instance_ruins_of_ahnqiraj : public InstanceMapScript }; - void AddSC_instance_ruins_of_ahnqiraj() { new instance_ruins_of_ahnqiraj(); diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp index f8c955e76f8fe..47c6a5e9c6da5 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp @@ -194,7 +194,7 @@ class boss_vem : public CreatureScript if (Charge_Timer <= diff) { Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); + pTarget = SelectTarget(SELECT_TARGET_RANDOM,0); if (pTarget) { DoCast(pTarget, SPELL_CHARGE); @@ -273,7 +273,7 @@ class boss_yauj : public CreatureScript for (uint8 i = 0; i < 10; ++i) { - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); + Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0); Creature* Summoned = me->SummonCreature(15621,me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(),0,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,90000); if (Summoned && pTarget) Summoned->AI()->AttackStart(pTarget); @@ -348,9 +348,6 @@ class boss_yauj : public CreatureScript }; - - - void AddSC_bug_trio() { new boss_kri(); diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp index 031c0faaf013e..dfaf4c5187afb 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp @@ -241,7 +241,7 @@ class boss_eye_of_cthun : public CreatureScript void SpawnEyeTentacle(float x, float y) { if (Creature* Spawned = DoSpawnCreature(MOB_EYE_TENTACLE, x, y, 0, 0, TEMPSUMMON_CORPSE_DESPAWN, 500)) - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) if (Spawned->AI()) Spawned->AI()->AttackStart(pTarget); } @@ -284,7 +284,7 @@ class boss_eye_of_cthun : public CreatureScript if (BeamTimer <= diff) { //SPELL_GREEN_BEAM - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) { me->InterruptNonMeleeSpells(false); DoCast(pTarget, SPELL_GREEN_BEAM); @@ -300,7 +300,7 @@ class boss_eye_of_cthun : public CreatureScript //ClawTentacleTimer if (ClawTentacleTimer <= diff) { - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) { Creature* Spawned = NULL; @@ -328,7 +328,7 @@ class boss_eye_of_cthun : public CreatureScript me->SetUInt64Value(UNIT_FIELD_TARGET, 0); //Select random target for dark beam to start on - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) { //Face our target DarkGlareAngle = me->GetAngle(pTarget); @@ -988,7 +988,7 @@ class mob_eye_tentacle : public CreatureScript //MindflayTimer if (MindflayTimer <= diff) { - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); + Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0); if (pTarget && !pTarget->HasAura(SPELL_DIGESTIVE_ACID)) DoCast(pTarget, SPELL_MIND_FLAY); @@ -1064,7 +1064,7 @@ class mob_claw_tentacle : public CreatureScript //Dissapear and reappear at new position me->SetVisible(false); - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); + Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0); if (!pTarget) { me->Kill(me); @@ -1176,7 +1176,7 @@ class mob_giant_claw_tentacle : public CreatureScript //Dissapear and reappear at new position me->SetVisible(false); - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0); if (!pTarget) { me->Kill(me); @@ -1281,7 +1281,7 @@ class mob_giant_eye_tentacle : public CreatureScript //BeamTimer if (BeamTimer <= diff) { - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); + Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0); if (pTarget && !pTarget->HasAura(SPELL_DIGESTIVE_ACID)) DoCast(pTarget, SPELL_GREEN_BEAM); @@ -1323,12 +1323,6 @@ class mob_giant_flesh_tentacle : public CreatureScript //GetAIs - - - - - - void AddSC_boss_cthun() { new boss_eye_of_cthun(); diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp index 3bedc6e987b61..1cb0a9631fb63 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp @@ -115,16 +115,16 @@ class boss_fankriss : public CreatureScript switch (urand(0,2)) { case 0: - SummonSpawn(SelectUnit(SELECT_TARGET_RANDOM,0)); + SummonSpawn(SelectTarget(SELECT_TARGET_RANDOM,0)); break; case 1: - SummonSpawn(SelectUnit(SELECT_TARGET_RANDOM,0)); - SummonSpawn(SelectUnit(SELECT_TARGET_RANDOM,0)); + SummonSpawn(SelectTarget(SELECT_TARGET_RANDOM,0)); + SummonSpawn(SelectTarget(SELECT_TARGET_RANDOM,0)); break; case 2: - SummonSpawn(SelectUnit(SELECT_TARGET_RANDOM,0)); - SummonSpawn(SelectUnit(SELECT_TARGET_RANDOM,0)); - SummonSpawn(SelectUnit(SELECT_TARGET_RANDOM,0)); + SummonSpawn(SelectTarget(SELECT_TARGET_RANDOM,0)); + SummonSpawn(SelectTarget(SELECT_TARGET_RANDOM,0)); + SummonSpawn(SelectTarget(SELECT_TARGET_RANDOM,0)); break; } SpawnSpawns_Timer = 30000 + rand()%30000; @@ -137,7 +137,7 @@ class boss_fankriss : public CreatureScript if (SpawnHatchlings_Timer <= diff) { Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); + pTarget = SelectTarget(SELECT_TARGET_RANDOM,0); if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER) { DoCast(pTarget, SPELL_ROOT); @@ -204,7 +204,6 @@ class boss_fankriss : public CreatureScript }; - void AddSC_boss_fankriss() { new boss_fankriss(); diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_huhuran.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_huhuran.cpp index 00f70d809007f..0ae028e99f62c 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_huhuran.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_huhuran.cpp @@ -95,7 +95,7 @@ class boss_huhuran : public CreatureScript // Wyvern Timer if (Wyvern_Timer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) DoCast(pTarget, SPELL_WYVERNSTING); Wyvern_Timer = 15000 + rand()%17000; } else Wyvern_Timer -= diff; @@ -146,7 +146,6 @@ class boss_huhuran : public CreatureScript }; - void AddSC_boss_huhuran() { new boss_huhuran(); diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp index 3d150db0aeb74..510db661bf097 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp @@ -112,7 +112,7 @@ class boss_ouro : public CreatureScript if (Submerged && ChangeTarget_Timer <= diff) { Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); + pTarget = SelectTarget(SELECT_TARGET_RANDOM,0); if (pTarget) DoTeleportTo(pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ()); @@ -138,7 +138,6 @@ class boss_ouro : public CreatureScript }; - void AddSC_boss_ouro() { new boss_ouro(); diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_sartura.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_sartura.cpp index c135f49f69c0f..824c978e415af 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_sartura.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_sartura.cpp @@ -106,7 +106,7 @@ class boss_sartura : public CreatureScript { //Attack random Gamers Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM,1); + pTarget = SelectTarget(SELECT_TARGET_RANDOM,1); if (pTarget) me->AddThreat(pTarget, 1.0f); me->TauntApply(pTarget); @@ -135,7 +135,7 @@ class boss_sartura : public CreatureScript { //Attack random Gamers Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM,1); + pTarget = SelectTarget(SELECT_TARGET_RANDOM,1); if (pTarget) me->AddThreat(pTarget, 1.0f); me->TauntApply(pTarget); @@ -243,7 +243,7 @@ class mob_sartura_royal_guard : public CreatureScript { //Attack random Gamers Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM,1); + pTarget = SelectTarget(SELECT_TARGET_RANDOM,1); if (pTarget) me->AddThreat(pTarget, 1.0f); me->TauntApply(pTarget); @@ -264,7 +264,7 @@ class mob_sartura_royal_guard : public CreatureScript { //Attack random Gamers Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM,1); + pTarget = SelectTarget(SELECT_TARGET_RANDOM,1); if (pTarget) me->AddThreat(pTarget, 1.0f); me->TauntApply(pTarget); @@ -297,8 +297,6 @@ class mob_sartura_royal_guard : public CreatureScript }; - - void AddSC_boss_sartura() { new boss_sartura(); diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp index 1ad7871f62b44..f29b3b9f070d2 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp @@ -264,7 +264,7 @@ class boss_skeram : public CreatureScript case 25: Images25 = true; break; } - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); + Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0); Creature *Image1 = me->SummonCreature(15263, i1->x, i1->y, i1->z, i1->r, TEMPSUMMON_CORPSE_DESPAWN, 30000); if (Image1) @@ -295,7 +295,6 @@ class boss_skeram : public CreatureScript }; - void AddSC_boss_skeram() { new boss_skeram(); diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp index d35c5bba8873c..ac6dddc5f827c 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp @@ -595,8 +595,6 @@ class boss_veklor : public CreatureScript }; - - void AddSC_boss_twinemperors() { new boss_veknilash(); 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 189f7dcf74ea4..3b8bfeec90134 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/instance_temple_of_ahnqiraj.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/instance_temple_of_ahnqiraj.cpp @@ -164,7 +164,6 @@ class instance_temple_of_ahnqiraj : public InstanceMapScript }; - void AddSC_instance_temple_of_ahnqiraj() { new instance_temple_of_ahnqiraj(); diff --git a/src/server/scripts/Kalimdor/WailingCaverns/instance_wailing_caverns.cpp b/src/server/scripts/Kalimdor/WailingCaverns/instance_wailing_caverns.cpp index ed69570bf9d02..77681853d442f 100644 --- a/src/server/scripts/Kalimdor/WailingCaverns/instance_wailing_caverns.cpp +++ b/src/server/scripts/Kalimdor/WailingCaverns/instance_wailing_caverns.cpp @@ -141,7 +141,6 @@ class instance_wailing_caverns : public InstanceMapScript }; - void AddSC_instance_wailing_caverns() { new instance_wailing_caverns(); diff --git a/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp b/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp index cae9fef757d61..8eb379024cb49 100644 --- a/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp +++ b/src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp @@ -393,9 +393,6 @@ class npc_disciple_of_naralex : public CreatureScript }; - - - void AddSC_wailing_caverns() { new npc_disciple_of_naralex(); diff --git a/src/server/scripts/Kalimdor/ZulFarrak/instance_zulfarrak.cpp b/src/server/scripts/Kalimdor/ZulFarrak/instance_zulfarrak.cpp index cc3a30965e9a5..eb0cd56c45427 100644 --- a/src/server/scripts/Kalimdor/ZulFarrak/instance_zulfarrak.cpp +++ b/src/server/scripts/Kalimdor/ZulFarrak/instance_zulfarrak.cpp @@ -358,7 +358,6 @@ class instance_zulfarrak : public InstanceMapScript }; - void AddSC_instance_zulfarrak() { new instance_zulfarrak(); diff --git a/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp b/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp index 5acc80b343825..554c3f9449946 100644 --- a/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp +++ b/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.cpp @@ -68,7 +68,7 @@ class npc_sergeant_bly : public CreatureScript { pPlayer->CLOSE_GOSSIP_MENU(); CAST_AI(npc_sergeant_bly::npc_sergeant_blyAI,pCreature->AI())->PlayerGUID = pPlayer->GetGUID(); - pCreature->AI()->DoAction(); + pCreature->AI()->DoAction(0); } return true; } @@ -132,7 +132,7 @@ class npc_sergeant_bly : public CreatureScript case 1: //weegli doesn't fight - he goes & blows up the door if (Creature* pWeegli = pInstance->instance->GetCreature(pInstance->GetData64(ENTRY_WEEGLI))) - pWeegli->AI()->DoAction(); + pWeegli->AI()->DoAction(0); DoScriptText(SAY_1,me); Text_Timer = 5000; break; @@ -195,9 +195,6 @@ class npc_sergeant_bly : public CreatureScript }; - - - /*###### +## go_troll_cage +######*/ @@ -268,7 +265,7 @@ class npc_weegli_blastfuse : public CreatureScript { pPlayer->CLOSE_GOSSIP_MENU(); //here we make him run to door, set the charge and run away off to nowhere - pCreature->AI()->DoAction(); + pCreature->AI()->DoAction(0); } return true; } @@ -396,8 +393,6 @@ class npc_weegli_blastfuse : public CreatureScript }; - - /*###### ## go_shallow_grave ######*/ diff --git a/src/server/scripts/Kalimdor/azshara.cpp b/src/server/scripts/Kalimdor/azshara.cpp index af47fe61a78c7..4915eb9625b99 100644 --- a/src/server/scripts/Kalimdor/azshara.cpp +++ b/src/server/scripts/Kalimdor/azshara.cpp @@ -519,7 +519,6 @@ class mob_depth_charge : public CreatureScript }; - void AddSC_azshara() { new mobs_spitelashes(); diff --git a/src/server/scripts/Kalimdor/azuremyst_isle.cpp b/src/server/scripts/Kalimdor/azuremyst_isle.cpp index 45be69b22ecd4..e40775e9bb95e 100644 --- a/src/server/scripts/Kalimdor/azuremyst_isle.cpp +++ b/src/server/scripts/Kalimdor/azuremyst_isle.cpp @@ -19,7 +19,7 @@ /* ScriptData SDName: Azuremyst_Isle SD%Complete: 75 -SDComment: Quest support: 9283, 9537, 9582, 9554, 9531, 9303(special flight path, proper model for mount missing). Injured Draenei cosmetic only, 9582. +SDComment: Quest support: 9283, 9537, 9582, 9554, 9531, ? (special flight path, proper model for mount missing). Injured Draenei cosmetic only, 9582. SDCategory: Azuremyst Isle EndScriptData */ @@ -29,7 +29,6 @@ npc_engineer_spark_overgrind npc_injured_draenei npc_magwin npc_geezle -mob_nestlewood_owlkin go_ravager_cage npc_death_ravager EndContentData */ @@ -286,9 +285,6 @@ class npc_engineer_spark_overgrind : public CreatureScript }; - - - /*###### ## npc_injured_draenei ######*/ @@ -409,7 +405,6 @@ class npc_magwin : public CreatureScript }; - /*###### ## npc_geezle ######*/ @@ -576,80 +571,6 @@ class npc_geezle : public CreatureScript }; -/*###### -## mob_nestlewood_owlkin -######*/ - -enum eOwlkin -{ - SPELL_INOCULATE_OWLKIN = 29528, - ENTRY_OWLKIN = 16518, - ENTRY_OWLKIN_INOC = 16534 -}; - -class npc_nestlewood_owlkin : public CreatureScript -{ -public: - npc_nestlewood_owlkin() : CreatureScript("npc_nestlewood_owlkin") { } - - struct npc_nestlewood_owlkinAI : public ScriptedAI - { - npc_nestlewood_owlkinAI(Creature *c) : ScriptedAI(c) {} - - uint32 DespawnTimer; - - void Reset() - { - DespawnTimer = 0; - } - - void UpdateAI(const uint32 diff) - { - //timer gets adjusted by the triggered aura effect - if (DespawnTimer) - { - if (DespawnTimer <= diff) - { - //once we are able to, despawn us - me->DespawnOrUnsummon(); - return; - } else DespawnTimer -= diff; - } - - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - }; - - bool EffectDummyCreature(Unit * /*pCaster*/, uint32 spellId, uint32 effIndex, Creature *pCreatureTarget) - { - //always check spellid and effectindex - if (spellId == SPELL_INOCULATE_OWLKIN && effIndex == 0) - { - if (pCreatureTarget->GetEntry() != ENTRY_OWLKIN) - return true; - - pCreatureTarget->UpdateEntry(ENTRY_OWLKIN_INOC); - - //set despawn timer, since we want to remove Creature after a short time - CAST_AI(npc_nestlewood_owlkin::npc_nestlewood_owlkinAI, pCreatureTarget->AI())->DespawnTimer = 15000; - - //always return true when we are handling this spell and effect - return true; - } - return false; - } - - CreatureAI* GetAI(Creature* pCreature) const - { - return new npc_nestlewood_owlkinAI (pCreature); - } - -}; - - enum eRavegerCage { NPC_DEATH_RAVAGER = 17556, @@ -812,7 +733,6 @@ void AddSC_azuremyst_isle() new npc_injured_draenei(); new npc_magwin(); new npc_geezle(); - new npc_nestlewood_owlkin(); new npc_death_ravager(); new go_ravager_cage(); new npc_stillpine_capitive(); diff --git a/src/server/scripts/Kalimdor/bloodmyst_isle.cpp b/src/server/scripts/Kalimdor/bloodmyst_isle.cpp index 020d5e8395ae1..8da1167808dde 100644 --- a/src/server/scripts/Kalimdor/bloodmyst_isle.cpp +++ b/src/server/scripts/Kalimdor/bloodmyst_isle.cpp @@ -149,7 +149,6 @@ class npc_captured_sunhawk_agent : public CreatureScript }; - void AddSC_bloodmyst_isle() { new mob_webbed_creature(); diff --git a/src/server/scripts/Kalimdor/boss_azuregos.cpp b/src/server/scripts/Kalimdor/boss_azuregos.cpp index 9758103086619..81c7826c74f66 100644 --- a/src/server/scripts/Kalimdor/boss_azuregos.cpp +++ b/src/server/scripts/Kalimdor/boss_azuregos.cpp @@ -122,7 +122,7 @@ class boss_azuregos : public CreatureScript //ManaStorm_Timer if (ManaStorm_Timer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) DoCast(pTarget, SPELL_MANASTORM); ManaStorm_Timer = 7500 + rand()%5000; } else ManaStorm_Timer -= diff; diff --git a/src/server/scripts/Kalimdor/darkshore.cpp b/src/server/scripts/Kalimdor/darkshore.cpp index 940580e8e387e..f756445462cf7 100644 --- a/src/server/scripts/Kalimdor/darkshore.cpp +++ b/src/server/scripts/Kalimdor/darkshore.cpp @@ -177,8 +177,6 @@ class npc_kerlonian : public CreatureScript }; - - /*#### # npc_prospector_remtravel ####*/ @@ -313,8 +311,6 @@ class npc_prospector_remtravel : public CreatureScript }; - - /*#### # npc_threshwackonator ####*/ @@ -352,7 +348,6 @@ class npc_threshwackonator : public CreatureScript return true; } - bool OnGossipHello(Player* pPlayer, Creature* pCreature) { if (pPlayer->GetQuestStatus(QUEST_GYROMAST_REV) == QUEST_STATUS_INCOMPLETE) @@ -400,9 +395,6 @@ class npc_threshwackonator : public CreatureScript }; - - - void AddSC_darkshore() { new npc_kerlonian(); diff --git a/src/server/scripts/Kalimdor/desolace.cpp b/src/server/scripts/Kalimdor/desolace.cpp index 069de9470353a..a956ceacee173 100644 --- a/src/server/scripts/Kalimdor/desolace.cpp +++ b/src/server/scripts/Kalimdor/desolace.cpp @@ -167,9 +167,6 @@ class npc_aged_dying_ancient_kodo : public CreatureScript }; - - - /*###### ## go_iruxos. Quest 5381 ######*/ @@ -260,8 +257,6 @@ class npc_dalinda : public CreatureScript }; - - void AddSC_desolace() { new npc_aged_dying_ancient_kodo(); diff --git a/src/server/scripts/Kalimdor/durotar.cpp b/src/server/scripts/Kalimdor/durotar.cpp index 3a5474905728e..f4a9b46c33fc0 100644 --- a/src/server/scripts/Kalimdor/durotar.cpp +++ b/src/server/scripts/Kalimdor/durotar.cpp @@ -67,7 +67,7 @@ class npc_lazy_peon : public CreatureScript work = true; } - void SpellHit(Unit *caster, const SpellEntry *spell) + void SpellHit(Unit* caster, const SpellEntry * spell) { if (spell->Id == SPELL_AWAKEN_PEON && caster->GetTypeId() == TYPEID_PLAYER && CAST_PLR(caster)->GetQuestStatus(QUEST_LAZY_PEONS) == QUEST_STATUS_INCOMPLETE) @@ -96,11 +96,413 @@ class npc_lazy_peon : public CreatureScript DoMeleeAttackIfReady(); } }; +}; + +enum Texts +{ + // Tiger Matriarch Credit + SAY_MATRIARCH_AGGRO = 0, + + // Troll Volunteer + SAY_VOLUNTEER_START = 0, + SAY_VOLUNTEER_END = 1, +}; + +enum Spells +{ + // Tiger Matriarch Credit + SPELL_SUMMON_MATRIARCH = 75187, + SPELL_NO_SUMMON_AURA = 75213, + SPELL_DETECT_INVIS = 75180, + SPELL_SUMMON_ZENTABRA_TRIGGER = 75212, + + // Tiger Matriarch + SPELL_POUNCE = 61184, + SPELL_FURIOUS_BITE = 75164, + SPELL_SUMMON_ZENTABRA = 75181, + SPELL_SPIRIT_OF_THE_TIGER_RIDER = 75166, + SPELL_EJECT_PASSENGERS = 50630, + // Troll Volunteer + SPELL_VOLUNTEER_AURA = 75076, + SPELL_PETACT_AURA = 74071, + SPELL_QUEST_CREDIT = 75106, + SPELL_MOUNTING_CHECK = 75420, + SPELL_TURNIN = 73953, + SPELL_AOE_TURNIN = 75107, + + // Vol'jin War Drums + SPELL_MOTIVATE_1 = 75088, + SPELL_MOTIVATE_2 = 75086, +}; + +enum Creatures +{ + // Tiger Matriarch Credit + NPC_TIGER_VEHICLE = 40305, + + // Troll Volunteer + NPC_URUZIN = 40253, + NPC_VOLUNTEER_1 = 40264, + NPC_VOLUNTEER_2 = 40260, + + // Vol'jin War Drums + NPC_CITIZEN_1 = 40256, + NPC_CITIZEN_2 = 40257, }; +enum Events +{ + // Tiger Matriarch Credit + EVENT_CHECK_SUMMON_AURA = 1, + + // Tiger Matriarch + EVENT_POUNCE = 2, + EVENT_NOSUMMON = 3, +}; + +enum Points +{ + POINT_URUZIN = 4026400, +}; + +class npc_tiger_matriarch_credit : public CreatureScript +{ + public: + npc_tiger_matriarch_credit() : CreatureScript("npc_tiger_matriarch_credit"){} + + struct npc_tiger_matriarch_creditAI : public Scripted_NoMovementAI + { + npc_tiger_matriarch_creditAI(Creature* creature) : Scripted_NoMovementAI(creature) + { + events.ScheduleEvent(EVENT_CHECK_SUMMON_AURA, 2000); + } + + void UpdateAI(const uint32 diff) + { + events.Update(diff); + + if (events.ExecuteEvent() == EVENT_CHECK_SUMMON_AURA) + { + std::list tigers; + GetCreatureListWithEntryInGrid(tigers, me, NPC_TIGER_VEHICLE, 15.0f); + if (!tigers.empty()) + { + for (std::list::iterator itr = tigers.begin(); itr != tigers.end(); ++itr) + { + if (Unit* summoner = CAST_SUM(*itr)->GetSummoner()) + if (!summoner->HasAura(SPELL_NO_SUMMON_AURA) && !summoner->HasAura(SPELL_SUMMON_ZENTABRA_TRIGGER) + && !summoner->isInCombat()) + { + me->AddAura(SPELL_NO_SUMMON_AURA, summoner); + me->AddAura(SPELL_DETECT_INVIS, summoner); + summoner->CastSpell(summoner, SPELL_SUMMON_MATRIARCH, true); + Talk(SAY_MATRIARCH_AGGRO, summoner->GetGUID()); + } + } + } + + events.ScheduleEvent(EVENT_CHECK_SUMMON_AURA, 5000); + } + } + + private: + EventMap events; + }; + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_tiger_matriarch_creditAI(creature); + } +}; + +class npc_tiger_matriarch : public CreatureScript +{ + public: + npc_tiger_matriarch() : CreatureScript("npc_tiger_matriarch"){} + + struct npc_tiger_matriarchAI : public ScriptedAI + { + npc_tiger_matriarchAI(Creature* creature) : ScriptedAI(creature) {} + + void IsSummonedBy(Unit* summoner) + { + if (summoner->GetTypeId() != TYPEID_PLAYER) + return; + + _tiger = summoner->GetVehicle()->GetBase(); + if (_tiger) + { + me->AddThreat(_tiger, 500000.0f); + DoCast(me, SPELL_FURIOUS_BITE); + events.ScheduleEvent(EVENT_POUNCE, 100); + events.ScheduleEvent(EVENT_NOSUMMON, 50000); + } + } + + void KilledUnit(Unit* victim) + { + if (victim->GetTypeId() != TYPEID_UNIT) + return; + + if (Unit* vehSummoner = CAST_SUM(victim)->GetSummoner()) + { + vehSummoner->RemoveAurasDueToSpell(SPELL_NO_SUMMON_AURA); + vehSummoner->RemoveAurasDueToSpell(SPELL_DETECT_INVIS); + vehSummoner->RemoveAurasDueToSpell(SPELL_SPIRIT_OF_THE_TIGER_RIDER); + vehSummoner->RemoveAurasDueToSpell(SPELL_SUMMON_ZENTABRA_TRIGGER); + } + me->ForcedDespawn(); + } + + void DamageTaken(Unit* attacker, uint32& damage) + { + if (HealthBelowPct(20)) + { + damage = 0; + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + if (Unit* vehSummoner = CAST_SUM(attacker)->GetSummoner()) + { + vehSummoner->AddAura(SPELL_SUMMON_ZENTABRA_TRIGGER, vehSummoner); + vehSummoner->CastSpell(vehSummoner, SPELL_SUMMON_ZENTABRA, true); + attacker->CastSpell(attacker, SPELL_EJECT_PASSENGERS, true); + vehSummoner->RemoveAurasDueToSpell(SPELL_NO_SUMMON_AURA); + vehSummoner->RemoveAurasDueToSpell(SPELL_DETECT_INVIS); + vehSummoner->RemoveAurasDueToSpell(SPELL_SPIRIT_OF_THE_TIGER_RIDER); + vehSummoner->RemoveAurasDueToSpell(SPELL_SUMMON_ZENTABRA_TRIGGER); + } + me->ForcedDespawn(); + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (!_tiger) + return; + + events.Update(diff); + + while (uint32 eventId = events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_POUNCE: + DoCastVictim(SPELL_POUNCE); + events.ScheduleEvent(EVENT_POUNCE, 30000); + break; + case EVENT_NOSUMMON: // Reapply SPELL_NO_SUMMON_AURA + if (Unit* vehSummoner = CAST_SUM(_tiger)->GetSummoner()) + me->AddAura(SPELL_NO_SUMMON_AURA, vehSummoner); + events.ScheduleEvent(EVENT_NOSUMMON, 50000); + break; + default: + break; + } + } + + DoMeleeAttackIfReady(); + } + + private: + EventMap events; + Unit* _tiger; + }; + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_tiger_matriarchAI(creature); + } +}; + +// These models was found in sniff. +// TODO: generalize these models with race from dbc +uint32 const trollmodel[] = +{11665,11734,11750,12037,12038,12042,12049,12849,13529,14759,15570,15701, +15702,1882,1897,1976,2025,27286,2734,2735,4084,4085,4087,4089,4231,4357, +4358,4360,4361,4362,4363,4370,4532,4537,4540,4610,6839,7037,9767,9768}; + +class npc_troll_volunteer : public CreatureScript +{ + public: + npc_troll_volunteer() : CreatureScript("npc_troll_volunteer") { } + + struct npc_troll_volunteerAI : public ScriptedAI + { + npc_troll_volunteerAI(Creature* creature) : ScriptedAI(creature) + { + Reset(); + Player* player = me->GetOwner()->ToPlayer(); + + switch (urand(1,4)) + { + case 1: + _mountModel = 6471; + break; + case 2: + _mountModel = 6473; + break; + case 3: + _mountModel = 6469; + break; + case 4: + _mountModel = 6472; + break; + } + me->SetDisplayId(trollmodel[urand(0, 39)]); + if (player) + me->GetMotionMaster()->MoveFollow(player, 5.0f, urand(120, 240)); + } + + void Reset() + { + _complete = false; + me->AddAura(SPELL_VOLUNTEER_AURA, me); + me->AddAura(SPELL_MOUNTING_CHECK, me); + DoCast(me, SPELL_PETACT_AURA); + me->SetReactState(REACT_PASSIVE); + Talk(SAY_VOLUNTEER_START); + } + + // This is needed for mount check aura to know what mountmodel the npc got stored + uint32 GetMountId() + { + return _mountModel; + } + + void MovementInform(uint32 type, uint32 id) + { + if (type != POINT_MOTION_TYPE) + return; + if (id == POINT_URUZIN) + me->DespawnOrUnsummon(); + } + + void SpellHit(Unit* caster, SpellEntry const* spell) + { + if (spell->Id == SPELL_AOE_TURNIN && caster->GetEntry() == NPC_URUZIN && !_complete) + { + _complete = true; // Preventing from giving credit twice + DoCast(me, SPELL_TURNIN); + DoCast(me, SPELL_QUEST_CREDIT); + me->RemoveAurasDueToSpell(SPELL_MOUNTING_CHECK); + me->Unmount(); + Talk(SAY_VOLUNTEER_END); + me->GetMotionMaster()->MovePoint(POINT_URUZIN, caster->GetPositionX(), caster->GetPositionY(), caster->GetPositionZ()); + } + } + + private: + uint32 _mountModel; + bool _complete; + }; + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_troll_volunteerAI(creature); + } +}; + +class spell_mount_check : public SpellScriptLoader +{ + public: + spell_mount_check() : SpellScriptLoader("spell_mount_check") {} + + class spell_mount_check_AuraScript : public AuraScript + { + PrepareAuraScript(spell_mount_check_AuraScript) + bool Validate(SpellEntry const * /*spellEntry*/) + { + if (!sSpellStore.LookupEntry(SPELL_MOUNTING_CHECK)) + return false; + return true; + } + + void HandleEffectPeriodic(AuraEffect const* /*aurEff*/) + { + Unit* target = GetTarget(); + Unit* owner = target->GetOwner(); + + if (!owner) + return; + + if (owner->IsMounted() && !target->IsMounted()) + { + if (Creature* volunteer = target->ToCreature()) + if (uint32 mountid = CAST_AI(npc_troll_volunteer::npc_troll_volunteerAI, volunteer->AI())->GetMountId()) + target->Mount(mountid); + } + else if (!owner->IsMounted() && target->IsMounted()) + target->Unmount(); + + target->SetSpeed(MOVE_RUN, owner->GetSpeedRate(MOVE_RUN)); + target->SetSpeed(MOVE_WALK, owner->GetSpeedRate(MOVE_WALK)); + } + + void Register() + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_mount_check_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_mount_check_AuraScript(); + } +}; + +class spell_voljin_war_drums : public SpellScriptLoader +{ + public: + spell_voljin_war_drums() : SpellScriptLoader("spell_voljin_war_drums") {} + + class spell_voljin_war_drums_SpellScript : public SpellScript + { + PrepareSpellScript(spell_voljin_war_drums_SpellScript) + bool Validate(SpellEntry const * /*spellEntry*/) + { + if (!sSpellStore.LookupEntry(SPELL_MOTIVATE_1)) + return false; + if (!sSpellStore.LookupEntry(SPELL_MOTIVATE_2)) + return false; + return true; + } + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + if (Unit* target = GetHitUnit()) + { + uint32 motivate = 0; + if (target->GetEntry() == NPC_CITIZEN_1) + motivate = SPELL_MOTIVATE_1; + else if (target->GetEntry() == NPC_CITIZEN_2) + motivate = SPELL_MOTIVATE_2; + if (motivate) + caster->CastSpell(target, motivate, true, NULL, NULL, caster->GetGUID()); + } + } + + void Register() + { + OnEffect += SpellEffectFn(spell_voljin_war_drums_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_voljin_war_drums_SpellScript(); + } +}; void AddSC_durotar() { new npc_lazy_peon(); -} + new npc_tiger_matriarch_credit(); + new npc_tiger_matriarch(); + new npc_troll_volunteer(); + new spell_mount_check(); + new spell_voljin_war_drums(); +} \ No newline at end of file diff --git a/src/server/scripts/Kalimdor/dustwallow_marsh.cpp b/src/server/scripts/Kalimdor/dustwallow_marsh.cpp index 2665014934237..189054480a108 100644 --- a/src/server/scripts/Kalimdor/dustwallow_marsh.cpp +++ b/src/server/scripts/Kalimdor/dustwallow_marsh.cpp @@ -117,7 +117,6 @@ class mobs_risen_husk_spirit : public CreatureScript }; - /*###### ## npc_restless_apparition ######*/ @@ -386,7 +385,6 @@ class npc_lady_jaina_proudmoore : public CreatureScript }; - /*###### ## npc_nat_pagle ######*/ @@ -428,7 +426,6 @@ class npc_nat_pagle : public CreatureScript }; - /*###### ## npc_private_hendel ######*/ @@ -506,8 +503,6 @@ class npc_private_hendel : public CreatureScript }; - - /*###### ## npc_zelfrax ######*/ @@ -547,7 +542,7 @@ class npc_zelfrax : public CreatureScript me->SetInCombatWith(pWho); pWho->SetInCombatWith(me); - if (IsCombatMovement()) + if (IsCombatMovementAllowed()) me->GetMotionMaster()->MoveChase(pWho); } } @@ -634,7 +629,6 @@ class npc_stinky : public CreatureScript { npc_stinkyAI(Creature* pCreature) : npc_escortAI(pCreature) { } - void WaypointReached(uint32 i) { Player* pPlayer = GetPlayerForEscort(); @@ -712,7 +706,6 @@ class npc_stinky : public CreatureScript }; }; - void AddSC_dustwallow_marsh() { new mobs_risen_husk_spirit(); diff --git a/src/server/scripts/Kalimdor/felwood.cpp b/src/server/scripts/Kalimdor/felwood.cpp index cb07bcbfee3e0..197a830f0be6e 100644 --- a/src/server/scripts/Kalimdor/felwood.cpp +++ b/src/server/scripts/Kalimdor/felwood.cpp @@ -87,7 +87,6 @@ class npcs_riverbreeze_and_silversky : public CreatureScript }; - void AddSC_felwood() { new npcs_riverbreeze_and_silversky(); diff --git a/src/server/scripts/Kalimdor/feralas.cpp b/src/server/scripts/Kalimdor/feralas.cpp index cefb821856f54..819b6ffe73331 100644 --- a/src/server/scripts/Kalimdor/feralas.cpp +++ b/src/server/scripts/Kalimdor/feralas.cpp @@ -64,7 +64,6 @@ class npc_gregan_brewspewer : public CreatureScript }; - /*###### ## npc_oox22fe ######*/ @@ -183,8 +182,6 @@ class npc_oox22fe : public CreatureScript }; - - /*###### ## npc_screecher_spirit ######*/ diff --git a/src/server/scripts/Kalimdor/moonglade.cpp b/src/server/scripts/Kalimdor/moonglade.cpp index 460e560e77ee3..9d104653e9915 100644 --- a/src/server/scripts/Kalimdor/moonglade.cpp +++ b/src/server/scripts/Kalimdor/moonglade.cpp @@ -109,7 +109,6 @@ class npc_bunthen_plainswind : public CreatureScript }; - /*###### ## npc_great_bear_spirit ######*/ @@ -168,7 +167,6 @@ class npc_great_bear_spirit : public CreatureScript }; - /*###### ## npc_silva_filnaveth ######*/ @@ -226,7 +224,6 @@ class npc_silva_filnaveth : public CreatureScript }; - /*###### ## npc_clintar_spirit ######*/ @@ -561,7 +558,6 @@ class npc_clintar_spirit : public CreatureScript }; - /*#### # npc_clintar_dreamwalker ####*/ diff --git a/src/server/scripts/Kalimdor/mulgore.cpp b/src/server/scripts/Kalimdor/mulgore.cpp index fa2a9fca81cc9..7ae0eb6cd8fc2 100644 --- a/src/server/scripts/Kalimdor/mulgore.cpp +++ b/src/server/scripts/Kalimdor/mulgore.cpp @@ -67,7 +67,6 @@ class npc_skorn_whitecloud : public CreatureScript }; - /*##### # npc_kyle_frenzied ######*/ @@ -200,7 +199,6 @@ class npc_kyle_frenzied : public CreatureScript }; - /*##### # npc_plains_vision ######*/ @@ -315,7 +313,6 @@ class npc_plains_vision : public CreatureScript }; - /*##### # ######*/ diff --git a/src/server/scripts/Kalimdor/orgrimmar.cpp b/src/server/scripts/Kalimdor/orgrimmar.cpp index c3333fd0c1177..fb5a123f24d45 100644 --- a/src/server/scripts/Kalimdor/orgrimmar.cpp +++ b/src/server/scripts/Kalimdor/orgrimmar.cpp @@ -126,8 +126,6 @@ class npc_shenthul : public CreatureScript }; - - /*###### ## npc_thrall_warchief ######*/ @@ -243,8 +241,6 @@ class npc_thrall_warchief : public CreatureScript }; - - void AddSC_orgrimmar() { new npc_shenthul(); diff --git a/src/server/scripts/Kalimdor/silithus.cpp b/src/server/scripts/Kalimdor/silithus.cpp index b810bc696b535..4f26073d50b7f 100644 --- a/src/server/scripts/Kalimdor/silithus.cpp +++ b/src/server/scripts/Kalimdor/silithus.cpp @@ -105,7 +105,6 @@ class npc_highlord_demitrian : public CreatureScript }; - /*### ## npcs_rutgar_and_frankal ###*/ @@ -221,7 +220,6 @@ class npcs_rutgar_and_frankal : public CreatureScript }; - /*#### # quest_a_pawn_on_the_eternal_board (Defines) ####*/ diff --git a/src/server/scripts/Kalimdor/stonetalon_mountains.cpp b/src/server/scripts/Kalimdor/stonetalon_mountains.cpp index 3924a98dd0e3e..fde36d3e59009 100644 --- a/src/server/scripts/Kalimdor/stonetalon_mountains.cpp +++ b/src/server/scripts/Kalimdor/stonetalon_mountains.cpp @@ -86,7 +86,6 @@ class npc_braug_dimspirit : public CreatureScript }; - /*###### ## npc_kaya_flathoof ######*/ @@ -167,7 +166,6 @@ class npc_kaya_flathoof : public CreatureScript }; - /*###### ## AddSC ######*/ diff --git a/src/server/scripts/Kalimdor/tanaris.cpp b/src/server/scripts/Kalimdor/tanaris.cpp index 4b0a5733506c9..68ee527bbceff 100644 --- a/src/server/scripts/Kalimdor/tanaris.cpp +++ b/src/server/scripts/Kalimdor/tanaris.cpp @@ -235,7 +235,6 @@ class npc_custodian_of_time : public CreatureScript }; - /*###### ## npc_marin_noggenfogger ######*/ @@ -269,7 +268,6 @@ class npc_marin_noggenfogger : public CreatureScript }; - /*###### ## npc_steward_of_time ######*/ @@ -316,8 +314,6 @@ class npc_steward_of_time : public CreatureScript }; - - /*###### ## npc_stone_watcher_of_norgannon ######*/ @@ -382,7 +378,6 @@ class npc_stone_watcher_of_norgannon : public CreatureScript }; - /*###### ## npc_OOX17 ######*/ @@ -482,8 +477,6 @@ class npc_OOX17 : public CreatureScript }; - - /*#### # npc_tooga ####*/ @@ -649,8 +642,6 @@ class npc_tooga : public CreatureScript }; - - void AddSC_tanaris() { new mob_aquementas(); diff --git a/src/server/scripts/Kalimdor/teldrassil.cpp b/src/server/scripts/Kalimdor/teldrassil.cpp index 3b0c6162dddd6..a2186f4dee8f3 100644 --- a/src/server/scripts/Kalimdor/teldrassil.cpp +++ b/src/server/scripts/Kalimdor/teldrassil.cpp @@ -110,8 +110,6 @@ class npc_mist : public CreatureScript }; - - void AddSC_teldrassil() { new npc_mist(); diff --git a/src/server/scripts/Kalimdor/the_barrens.cpp b/src/server/scripts/Kalimdor/the_barrens.cpp index 8d6300e890c77..0698ae4f0d58a 100644 --- a/src/server/scripts/Kalimdor/the_barrens.cpp +++ b/src/server/scripts/Kalimdor/the_barrens.cpp @@ -73,7 +73,6 @@ class npc_beaten_corpse : public CreatureScript }; - /*###### # npc_gilthares ######*/ @@ -176,8 +175,6 @@ class npc_gilthares : public CreatureScript }; - - /*###### ## npc_sputtervalve ######*/ @@ -214,7 +211,6 @@ class npc_sputtervalve : public CreatureScript }; - /*###### ## npc_taskmaster_fizzule ######*/ @@ -316,7 +312,6 @@ class npc_taskmaster_fizzule : public CreatureScript }; - /*##### ## npc_twiggy_flathead #####*/ @@ -543,7 +538,6 @@ class npc_twiggy_flathead : public CreatureScript }; - /*##### ## npc_wizzlecrank_shredder #####*/ @@ -712,7 +706,6 @@ class npc_wizzlecrank_shredder : public CreatureScript }; - void AddSC_the_barrens() { new npc_beaten_corpse(); diff --git a/src/server/scripts/Kalimdor/thousand_needles.cpp b/src/server/scripts/Kalimdor/thousand_needles.cpp index e161ed668cadb..f27e8e75edd69 100644 --- a/src/server/scripts/Kalimdor/thousand_needles.cpp +++ b/src/server/scripts/Kalimdor/thousand_needles.cpp @@ -106,8 +106,6 @@ class npc_kanati : public CreatureScript }; - - /*###### # npc_lakota_windsong ######*/ @@ -202,8 +200,6 @@ class npc_lakota_windsong : public CreatureScript }; - - /*###### # npc_paoka_swiftmountain ######*/ @@ -284,8 +280,6 @@ class npc_paoka_swiftmountain : public CreatureScript }; - - /*##### # npc_plucky ######*/ @@ -462,7 +456,6 @@ class npc_enraged_panther : public CreatureScript }; - void AddSC_thousand_needles() { new npc_kanati(); diff --git a/src/server/scripts/Kalimdor/thunder_bluff.cpp b/src/server/scripts/Kalimdor/thunder_bluff.cpp index e1b1237acb28f..2c202e687549e 100644 --- a/src/server/scripts/Kalimdor/thunder_bluff.cpp +++ b/src/server/scripts/Kalimdor/thunder_bluff.cpp @@ -99,7 +99,7 @@ class npc_cairne_bloodhoof : public CreatureScript if (BerserkerCharge_Timer <= diff) { - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); + Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0); if (pTarget) DoCast(pTarget, SPELL_BERSERKER_CHARGE); BerserkerCharge_Timer = 25000; @@ -135,8 +135,6 @@ class npc_cairne_bloodhoof : public CreatureScript }; - - void AddSC_thunder_bluff() { new npc_cairne_bloodhoof(); diff --git a/src/server/scripts/Kalimdor/winterspring.cpp b/src/server/scripts/Kalimdor/winterspring.cpp index 365c4a1ba87db..fb245d5c97d17 100644 --- a/src/server/scripts/Kalimdor/winterspring.cpp +++ b/src/server/scripts/Kalimdor/winterspring.cpp @@ -96,7 +96,6 @@ class npc_lorax : public CreatureScript }; - /*###### ## npc_rivern_frostwind ######*/ @@ -130,7 +129,6 @@ class npc_rivern_frostwind : public CreatureScript }; - /*###### ## npc_witch_doctor_mauari ######*/ @@ -171,7 +169,6 @@ class npc_witch_doctor_mauari : public CreatureScript }; - void AddSC_winterspring() { new npc_lorax(); diff --git a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp index 1d2863c2db568..8b572323e16b0 100644 --- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp @@ -143,10 +143,10 @@ class boss_hadronox : public CreatureScript if (me->HasAura(SPELL_WEB_FRONT_DOORS) || me->HasAura(SPELL_WEB_SIDE_DOORS)) { - if (IsCombatMovement()) + if (IsCombatMovementAllowed()) SetCombatMovement(false); } - else if (!IsCombatMovement()) + else if (!IsCombatMovementAllowed()) SetCombatMovement(true); if (uiPierceTimer <= diff) @@ -173,7 +173,7 @@ class boss_hadronox : public CreatureScript if (uiGrabTimer <= diff) { - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) // Draws all players (and attacking Mobs) to itself. + if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) // Draws all players (and attacking Mobs) to itself. DoCast(pTarget, SPELL_WEB_GRAB); uiGrabTimer = urand(15*IN_MILLISECONDS,30*IN_MILLISECONDS); 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 8576586ff58cf..99714484447d8 100644 --- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/instance_azjol_nerub.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/instance_azjol_nerub.cpp @@ -103,7 +103,6 @@ class instance_azjol_nerub : public InstanceMapScript } } - uint64 GetData64(uint32 identifier) { switch(identifier) diff --git a/src/server/scripts/Northrend/AzjolNerub/ahnkahet/boss_amanitar.cpp b/src/server/scripts/Northrend/AzjolNerub/ahnkahet/boss_amanitar.cpp index 03fe895b706fd..7eb49ca77633a 100644 --- a/src/server/scripts/Northrend/AzjolNerub/ahnkahet/boss_amanitar.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/ahnkahet/boss_amanitar.cpp @@ -104,7 +104,7 @@ class boss_amanitar : public CreatureScript { for (uint8 i = 0; i < 30; ++i) { - Unit* victim = SelectUnit(SELECT_TARGET_RANDOM, 0); + Unit* victim = SelectTarget(SELECT_TARGET_RANDOM, 0); if (victim) { 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 019f9e8a160f7..48f4ed1d98058 100644 --- a/src/server/scripts/Northrend/AzjolNerub/ahnkahet/boss_herald_volazj.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/ahnkahet/boss_herald_volazj.cpp @@ -288,7 +288,7 @@ class boss_volazj : public CreatureScript if (uiShiverTimer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(pTarget, SPELL_SHIVER); uiShiverTimer = 15*IN_MILLISECONDS; } else uiShiverTimer -= diff; 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 1b62ae68ee178..ef8598bdace8a 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp @@ -17,8 +17,8 @@ /* ScriptData SDName: Argent Challenge Encounter. -SD%Complete: 50 % -SDComment: AI for Argent Soldiers are not implemented. AI from bosses need more improvements. +SD%Complete: 90 % +SDComment: AI from bosses need more improvements. Need AI for lightwell SDCategory: Trial of the Champion EndScriptData */ @@ -53,7 +53,55 @@ enum eSpells SPELL_SHADOWS_PAST = 66619, SPELL_SHADOWS_PAST_H = 67678, SPELL_WAKING_NIGHTMARE = 66552, - SPELL_WAKING_NIGHTMARE_H = 67677 + SPELL_WAKING_NIGHTMARE_H = 67677, + + //Monk + SPELL_DIVINE_SHIELD = 67251, + SPELL_FINAL_MEDITATION = 67255, + SPELL_FLURRY_OF_BLOWS = 67233, + SPELL_PUMMEL = 67235, + + //Priestess + SPELL_HOLY_SMITE_H = 67289, + SPELL_MIND_CONTROLL = 67229, //not supported yet + SPELL_DOT_PAIN_H = 34942, + SPELL_HOLY_SMITE = 36176, + SPELL_DOT_PAIN = 34941, + SPELL_FOUNTAIN_OF_LIGHT = 67194, //partially not work + + //Lightwielder + SPELL_BLAZING_LIGHT_H = 67290, + SPELL_BLAZING_LIGHT = 67247, + SPELL_UNBALANCING_STRIKE = 67237, + SPELL_CLEAVE = 15284 +}; + +enum Misc +{ + ACHIEV_FACEROLLER = 3803, + ACHIEV_CONF = 3802 +}; + +enum eEnums +{ + SAY_MEM_DIE = -1999968, + SAY_DEATH_P = -1999967, + SAY_INTRO_P2 = -1999966, + SAY_INTRO_P1 = -1999965, + SAY_INTRO_E = -1999964, + SAY_HAMMER_E = -1999963, + SAY_DEATH_E = -1999962, + SAY_START_E = -1999961, + SAY_KILL1_P = -1999960, + SAY_KILL2_P = -1999959, + SAY_KILL1_E = -1999958, + SAY_KILL2_E = -1999957, + SAY_START_10 = -1999956, + SAY_START_9 = -1999955, + SAY_START_8 = -1999941, + SAY_START_P = -1999955, + SAY_START_7 = -1999954, + SAY_START_6 = -1999951 }; class boss_eadric : public CreatureScript @@ -96,18 +144,24 @@ class boss_eadric : public CreatureScript EnterEvadeMode(); me->setFaction(35); bDone = true; + DoScriptText(SAY_DEATH_E, me); + if (GameObject* pGO = GameObject::GetGameObject(*me, pInstance->GetData64(DATA_MAIN_GATE))) + pInstance->HandleGameObject(pGO->GetGUID(),true); + if (GameObject* pGO = GameObject::GetGameObject(*me, pInstance->GetData64(DATA_MAIN_GATE1))) + pInstance->HandleGameObject(pGO->GetGUID(),true); } } - void MovementInform(uint32 MovementType, uint32 /*Data*/) + void EnterCombat(Unit* pWho) { - if (MovementType != POINT_MOTION_TYPE) - return; + DoScriptText(SAY_START_E, me); + } + void KilledUnit(Unit* pVictim) + { + DoScriptText(urand(0, 1) ? SAY_KILL1_E : SAY_KILL2_E, me); if (pInstance) - pInstance->SetData(BOSS_ARGENT_CHALLENGE_E, DONE); - - me->DisappearAndDie(); + pInstance->SetData(BOSS_ARGENT_CHALLENGE_E,IN_PROGRESS); } void UpdateAI(const uint32 uiDiff) @@ -115,7 +169,11 @@ class boss_eadric : public CreatureScript if (bDone && uiResetTimer <= uiDiff) { me->GetMotionMaster()->MovePoint(0,746.87f,665.87f,411.75f); + pInstance->SetData(BOSS_ARGENT_CHALLENGE_E, DONE); + me->DisappearAndDie(); bDone = false; + if (IsHeroic()) + pInstance->DoCompleteAchievement(ACHIEV_FACEROLLER); } else uiResetTimer -= uiDiff; if (!UpdateVictim()) @@ -211,9 +269,12 @@ class boss_paletress : public CreatureScript void SetData(uint32 uiId, uint32 /*uiValue*/) { if (uiId == 1) + { me->RemoveAura(SPELL_SHIELD); + DoScriptText(SAY_MEM_DIE, me); + } } - + void DamageTaken(Unit * /*done_by*/, uint32 &damage) { if (damage >= me->GetHealth()) @@ -222,27 +283,39 @@ class boss_paletress : public CreatureScript EnterEvadeMode(); me->setFaction(35); bDone = true; + DoScriptText(SAY_DEATH_P, me); + if (GameObject* pGO = GameObject::GetGameObject(*me, pInstance->GetData64(DATA_MAIN_GATE))) + pInstance->HandleGameObject(pGO->GetGUID(),true); + if (GameObject* pGO = GameObject::GetGameObject(*me, pInstance->GetData64(DATA_MAIN_GATE1))) + pInstance->HandleGameObject(pGO->GetGUID(),true); + pInstance->SetData(BOSS_ARGENT_CHALLENGE_P, DONE); + if (IsHeroic()) + pInstance->DoCompleteAchievement(ACHIEV_CONF); } - } + } - void MovementInform(uint32 MovementType, uint32 Point) + void EnterCombat(Unit* pWho) { - if (MovementType != POINT_MOTION_TYPE || Point != 0) - return; + DoScriptText(SAY_START_P, me); + } + void KilledUnit(Unit* pVictim) + { + DoScriptText(urand(0, 1) ? SAY_KILL1_P : SAY_KILL2_P, me); if (pInstance) - pInstance->SetData(BOSS_ARGENT_CHALLENGE_P, DONE); - - me->DisappearAndDie(); + pInstance->SetData(BOSS_ARGENT_CHALLENGE_P,IN_PROGRESS); } void UpdateAI(const uint32 uiDiff) { if (bDone && uiResetTimer <= uiDiff) { - me->GetMotionMaster()->MovePoint(0,746.87f,665.87f,411.75f); + me->GetMotionMaster()->MovePoint(0,746.843f, 695.68f, 412.339f); bDone = false; - } else uiResetTimer -= uiDiff; + if (GameObject* pGO = GameObject::GetGameObject(*me, pInstance->GetData64(DATA_MAIN_GATE))) + pInstance->HandleGameObject(pGO->GetGUID(),true); + me->DisappearAndDie(); + } else uiResetTimer -= uiDiff; if (!UpdateVictim()) return; @@ -299,10 +372,62 @@ class boss_paletress : public CreatureScript me->InterruptNonMeleeSpells(true); DoCastAOE(SPELL_HOLY_NOVA,false); DoCast(me, SPELL_SHIELD); - DoCastAOE(SPELL_SUMMON_MEMORY,false); DoCastAOE(SPELL_CONFESS,false); - bHealth = true; + + switch(urand(0, 24)) + { + case 0: me->SummonCreature(MEMORY_ALGALON, 0.0f, 0.0f, 0.0f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + break; + case 1: me->SummonCreature(MEMORY_CHROMAGGUS, 0.0f, 0.0f, 0.0f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + break; + case 2: me->SummonCreature(MEMORY_CYANIGOSA, 0.0f, 0.0f, 0.0f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + break; + case 3: me->SummonCreature(MEMORY_DELRISSA, 0.0f, 0.0f, 0.0f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + break; + case 4: me->SummonCreature(MEMORY_ECK, 0.0f, 0.0f, 0.0f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + break; + case 5: me->SummonCreature(MEMORY_ENTROPIUS, 0.0f, 0.0f, 0.0f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + break; + case 6: me->SummonCreature(MEMORY_GRUUL, 0.0f, 0.0f, 0.0f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + break; + case 7: me->SummonCreature(MEMORY_HAKKAR, 0.0f, 0.0f, 0.0f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + break; + case 8: me->SummonCreature(MEMORY_HEIGAN, 0.0f, 0.0f, 0.0f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + break; + case 9: me->SummonCreature(MEMORY_HEROD, 0.0f, 0.0f, 0.0f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + break; + case 10: me->SummonCreature(MEMORY_HOGGER, 0.0f, 0.0f, 0.0f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + break; + case 11: me->SummonCreature(MEMORY_IGNIS, 0.0f, 0.0f, 0.0f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + break; + case 12: me->SummonCreature(MEMORY_ILLIDAN, 0.0f, 0.0f, 0.0f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + break; + case 13: me->SummonCreature(MEMORY_INGVAR, 0.0f, 0.0f, 0.0f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + break; + case 14: me->SummonCreature(MEMORY_KALITHRESH, 0.0f, 0.0f, 0.0f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + break; + case 15: me->SummonCreature(MEMORY_LUCIFRON, 0.0f, 0.0f, 0.0f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + break; + case 16: me->SummonCreature(MEMORY_MALCHEZAAR, 0.0f, 0.0f, 0.0f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + break; + case 17: me->SummonCreature(MEMORY_MUTANUS, 0.0f, 0.0f, 0.0f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + break; + case 18: me->SummonCreature(MEMORY_ONYXIA, 0.0f, 0.0f, 0.0f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + break; + case 19: me->SummonCreature(MEMORY_THUNDERAAN, 0.0f, 0.0f, 0.0f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + break; + case 20: me->SummonCreature(MEMORY_VANCLEEF, 0.0f, 0.0f, 0.0f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + break; + case 21: me->SummonCreature(MEMORY_VASHJ, 0.0f, 0.0f, 0.0f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + break; + case 22: me->SummonCreature(MEMORY_VEKNILASH, 0.0f, 0.0f, 0.0f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + break; + case 23: me->SummonCreature(MEMORY_VEZAX, 0.0f, 0.0f, 0.0f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + break; + case 24: me->SummonCreature(MEMORY_ARCHIMONDE, 0.0f, 0.0f, 0.0f, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + break; + } } DoMeleeAttackIfReady(); @@ -347,7 +472,7 @@ class npc_memory : public CreatureScript if (uiOldWoundsTimer <= uiDiff) { - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) { if (pTarget && pTarget->isAlive()) DoCast(pTarget, SPELL_OLD_WOUNDS); @@ -363,7 +488,7 @@ class npc_memory : public CreatureScript if (uiShadowPastTimer <= uiDiff) { - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM,1)) + if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM,1)) { if (pTarget && pTarget->isAlive()) DoCast(pTarget,SPELL_SHADOWS_PAST); @@ -398,7 +523,7 @@ class npc_argent_soldier : public CreatureScript public: npc_argent_soldier() : CreatureScript("npc_argent_soldier") { } - // THIS AI NEEDS MORE IMPROVEMENTS + struct npc_argent_soldierAI : public npc_escortAI { npc_argent_soldierAI(Creature* pCreature) : npc_escortAI(pCreature) @@ -412,6 +537,38 @@ class npc_argent_soldier : public CreatureScript InstanceScript* pInstance; uint8 uiWaypoint; + uint32 uiCleaveTimer; + uint32 uiStrikeTimer; + uint32 uiblazingLightTimer; + uint32 uiFlurryTimer; + uint32 uiPummelTimer; + uint32 uiHolySmiteTimer; + uint32 uiMindControllTimer; + uint32 uiPainDotTimer; + uint32 uiFountainTimer; + bool Shielded; + + void Reset() + { + switch(me->GetEntry()) + { + case NPC_ARGENT_LIGHWIELDER: + uiCleaveTimer = 10000; + uiStrikeTimer = 12000; + uiblazingLightTimer = 9000; + break; + case NPC_ARGENT_MONK: + uiFlurryTimer = 8000; + uiPummelTimer = 10000; + Shielded = false; + break; + case NPC_PRIESTESS: + uiHolySmiteTimer = 9000; + uiPainDotTimer = 8000; + uiFountainTimer = 10000; + break; + } + } void WaypointReached(uint32 uiPoint) { @@ -486,12 +643,101 @@ class npc_argent_soldier : public CreatureScript uiWaypoint = uiType; } + void DamageTaken(Unit * /*done_by*/, uint32 &damage) + { + if (me->GetEntry() == NPC_ARGENT_MONK && IsHeroic() && Shielded==false) + { + if (damage >= me->GetHealth()) + { + DoCast(me, SPELL_DIVINE_SHIELD); + DoCast(me, SPELL_FINAL_MEDITATION); + me->SetHealth(1); + damage = 0; + Shielded = true; + } + } + } + void UpdateAI(const uint32 uiDiff) { npc_escortAI::UpdateAI(uiDiff); if (!UpdateVictim()) return; + + switch(me->GetEntry()) + { + case NPC_ARGENT_LIGHWIELDER: + if (uiCleaveTimer <= uiDiff) + { + DoCast(me->getVictim(), SPELL_CLEAVE); + uiCleaveTimer = 10000; + }else + uiCleaveTimer -= uiDiff; + + if (uiStrikeTimer <= uiDiff && IsHeroic()) + { + DoCast(me->getVictim(), SPELL_UNBALANCING_STRIKE); + uiStrikeTimer = 12000; + }else + uiStrikeTimer -= uiDiff; + + if (uiblazingLightTimer <= uiDiff) + { + if (IsHeroic()) + DoCast(me, SPELL_BLAZING_LIGHT_H); + else + DoCast(me, SPELL_BLAZING_LIGHT); + uiblazingLightTimer = 12000; + }else + uiblazingLightTimer -= uiDiff; + break; + case NPC_ARGENT_MONK: + if (uiFlurryTimer <= uiDiff) + { + DoCast(me, SPELL_FLURRY_OF_BLOWS); + uiFlurryTimer = 15000; + }else + uiFlurryTimer -= uiDiff; + + if (uiPummelTimer <= uiDiff) + { + DoCast(me->getVictim(), SPELL_PUMMEL); + uiPummelTimer = 15000; + }else + uiPummelTimer -= uiDiff; + + break; + case NPC_PRIESTESS: + if (uiHolySmiteTimer <= uiDiff) + { + if(IsHeroic()) + DoCast(me->getVictim(), SPELL_HOLY_SMITE_H); + else + DoCast(me->getVictim(), SPELL_HOLY_SMITE); + uiHolySmiteTimer = 9000; + }else + uiHolySmiteTimer -= uiDiff; + + if (uiPainDotTimer <= uiDiff) + { + if (IsHeroic()) + DoCast(me->getVictim(), SPELL_DOT_PAIN_H); + else + DoCast(me->getVictim(), SPELL_DOT_PAIN); + uiPainDotTimer = 25000; + }else + uiPainDotTimer -= uiDiff; + + if (uiFountainTimer <= uiDiff) + { + DoCastAOE(SPELL_FOUNTAIN_OF_LIGHT,false); + uiFountainTimer = 60000; + }else + uiFountainTimer -= uiDiff; + + break; + } DoMeleeAttackIfReady(); } @@ -509,10 +755,55 @@ class npc_argent_soldier : public CreatureScript } }; +enum ReflectiveShield +{ + SPELL_REFLECTIVE_SHIELD_TRIGGERED = 33619, +}; + +// Reflective Shield 66515 +class spell_gen_reflective_shield : public SpellScriptLoader +{ + public: + spell_gen_reflective_shield() : SpellScriptLoader("spell_gen_reflective_shield") { } + + class spell_gen_reflective_shield_AuraScript : public AuraScript + { + PrepareAuraScript(spell_gen_reflective_shield_AuraScript); + + bool Validate(SpellEntry const * /*spellEntry*/) + { + return sSpellStore.LookupEntry(SPELL_REFLECTIVE_SHIELD_TRIGGERED); + } + + void Trigger(AuraEffect * aurEff, DamageInfo & dmgInfo, uint32 & absorbAmount) + { + Unit * target = dmgInfo.GetAttacker(); + if (!target) + return; + Unit * caster = GetCaster(); + if (!caster) + return; + int32 bp = CalculatePctN(absorbAmount, 25); + target->CastCustomSpell(target, SPELL_REFLECTIVE_SHIELD_TRIGGERED, &bp, NULL, NULL, true, NULL, aurEff); + } + + void Register() + { + AfterEffectAbsorb += AuraEffectAbsorbFn(spell_gen_reflective_shield_AuraScript::Trigger, EFFECT_0); + } + }; + + AuraScript *GetAuraScript() const + { + return new spell_gen_reflective_shield_AuraScript(); + } +}; + void AddSC_boss_argent_challenge() { new boss_eadric(); new boss_paletress(); new npc_memory(); new npc_argent_soldier(); + new spell_gen_reflective_shield(); } 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 223fda6cde2f6..b9e0a7895ac69 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp @@ -17,8 +17,8 @@ /* ScriptData SDName: Boss Black Knight -SD%Complete: 80% -SDComment: missing yells. not sure about timers. +SD%Complete: 95% +SDComment: not sure about timers. SDCategory: Trial of the Champion EndScriptData */ @@ -26,6 +26,25 @@ EndScriptData */ #include "ScriptedEscortAI.h" #include "trial_of_the_champion.h" +enum eEnums +{ + //Yell + SAY_DEATH_3 = -1999935, + SAY_AGGRO = -1999929, + SAY_AGGRO_2 = -1999930, + SAY_SLAY = -1999932, + SAY_DEATH_1 = -1999933, + SAY_DEATH = -1999934, + SAY_START5 = -1999936, + SAY_START6 = -1999937, + SAY_START7 = -1999928, + SAY_START8 = -1999929, + SAY_START9 = -1999952, + SAY_START10 = -1999932, + SAY_START11 = -1999953, + SAY_KILL = -1999969, + SAY_KILL1 = -1999970 +}; enum eSpells { //phase 1 @@ -42,8 +61,9 @@ enum eSpells //phase 2 - During this phase, the Black Knight will use the same abilities as in phase 1, except for Death's Respite SPELL_ARMY_DEAD = 67761, + SPELL_ARMY_DEAD_H = 67874, SPELL_DESECRATION = 67778, - SPELL_DESECRATION_2 = 67778, + SPELL_DESECRATION_2 = 67877, SPELL_GHOUL_EXPLODE = 67751, //phase 3 @@ -54,7 +74,7 @@ enum eSpells SPELL_BLACK_KNIGHT_RES = 67693, - SPELL_LEAP = 67749, + SPELL_LEAP = 67749, SPELL_LEAP_H = 67880 }; @@ -64,6 +84,18 @@ enum eModels MODEL_GHOST = 21300 }; +enum eEqip +{ + EQUIP_SWORD = 40343 +}; + +enum IntroPhase +{ + IDLE, + INTRO, + FINISHED +}; + enum ePhases { PHASE_UNDEAD = 1, @@ -71,6 +103,15 @@ enum ePhases PHASE_GHOST = 3 }; +enum Misc +{ + ACHIEV_WORSE = 3804, + ACHIEV_HEROIC_DONE_H = 4297, + ACHIEV_HEROIC_DONE_A = 4298, + ACHIEV_NORMAL_DONE_H = 4296, + ACHIEV_NORMAL_DONE_A = 3778 +}; + class boss_black_knight : public CreatureScript { public: @@ -91,9 +132,15 @@ class boss_black_knight : public CreatureScript bool bEvent; bool bSummonArmy; bool bDeathArmyDone; + bool bEventInBattle; + bool bFight; uint8 uiPhase; + uint8 uiIntroPhase; + + IntroPhase Phase; + uint32 uiIntroTimer; uint32 uiPlagueStrikeTimer; uint32 uiIcyTouchTimer; uint32 uiDeathRespiteTimer; @@ -115,6 +162,15 @@ class boss_black_knight : public CreatureScript bEvent = false; bSummonArmy = false; bDeathArmyDone = false; + bFight = false; + + if (GameObject* pGO = GameObject::GetGameObject(*me, pInstance->GetData64(DATA_MAIN_GATE1))) + pInstance->HandleGameObject(pGO->GetGUID(),true); + if (GameObject* pGO = GameObject::GetGameObject(*me, pInstance->GetData64(DATA_MAIN_GATE1))) + pInstance->HandleGameObject(pGO->GetGUID(),false); + + if (bEventInBattle) + me->GetMotionMaster()->MovePoint(1,743.396f, 635.411f, 411.575f); uiPhase = PHASE_UNDEAD; @@ -128,6 +184,7 @@ class boss_black_knight : public CreatureScript uiGhoulExplodeTimer = 8000; uiDeathBiteTimer = urand (2000,4000); uiMarkedDeathTimer = urand (5000,7000); + uiIntroTimer = 5000; } void RemoveSummons() @@ -161,6 +218,15 @@ class boss_black_knight : public CreatureScript if (uiResurrectTimer <= uiDiff) { me->SetFullHealth(); + switch(uiPhase) + { + case PHASE_UNDEAD: + DoScriptText(SAY_DEATH_1, me); + break; + case PHASE_SKELETON: + DoScriptText(SAY_DEATH, me); + break; + } DoCast(me,SPELL_BLACK_KNIGHT_RES,true); uiPhase++; uiResurrectTimer = 4000; @@ -176,17 +242,26 @@ class boss_black_knight : public CreatureScript { if (uiIcyTouchTimer <= uiDiff) { - DoCastVictim(SPELL_ICY_TOUCH); + if (IsHeroic()) + DoCastVictim(SPELL_ICY_TOUCH_H); + else + DoCastVictim(SPELL_ICY_TOUCH); uiIcyTouchTimer = urand(5000,7000); } else uiIcyTouchTimer -= uiDiff; if (uiPlagueStrikeTimer <= uiDiff) { - DoCastVictim(SPELL_ICY_TOUCH); + if (IsHeroic()) + DoCastVictim(SPELL_PLAGUE_STRIKE); + else + DoCastVictim(SPELL_PLAGUE_STRIKE_2); uiPlagueStrikeTimer = urand(12000,15000); } else uiPlagueStrikeTimer -= uiDiff; if (uiObliterateTimer <= uiDiff) { - DoCastVictim(SPELL_OBLITERATE); + if (IsHeroic()) + DoCastVictim(SPELL_OBLITERATE_H); + else + DoCastVictim(SPELL_OBLITERATE); uiObliterateTimer = urand(17000,19000); } else uiObliterateTimer -= uiDiff; switch(uiPhase) @@ -197,8 +272,13 @@ class boss_black_knight : public CreatureScript { if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) { - if (pTarget && pTarget->isAlive()) - DoCast(pTarget,SPELL_DEATH_RESPITE); + if (pTarget && pTarget->isAlive()) + { + if (IsHeroic()) + DoCast(pTarget,SPELL_DEATH_RESPITE_2); + else + DoCast(pTarget,SPELL_DEATH_RESPITE); + } } uiDeathRespiteTimer = urand(15000,16000); } else uiDeathRespiteTimer -= uiDiff; @@ -210,7 +290,10 @@ class boss_black_knight : public CreatureScript { bSummonArmy = true; me->AddUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED); - DoCast(me, SPELL_ARMY_DEAD); + if (IsHeroic()) + DoCast(me, SPELL_ARMY_DEAD_H); + else + DoCast(me, SPELL_ARMY_DEAD); } if (!bDeathArmyDone) { @@ -225,8 +308,13 @@ class boss_black_knight : public CreatureScript { if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) { - if (pTarget && pTarget->isAlive()) - DoCast(pTarget,SPELL_DESECRATION); + if (pTarget && pTarget->isAlive()) + { + if (IsHeroic()) + DoCast(pTarget,SPELL_DESECRATION_2); + else + DoCast(pTarget,SPELL_DESECRATION); + } } uiDesecration = urand(15000,16000); } else uiDesecration -= uiDiff; @@ -245,7 +333,10 @@ class boss_black_knight : public CreatureScript { if (uiDeathBiteTimer <= uiDiff) { - DoCastAOE(SPELL_DEATH_BITE); + if (IsHeroic()) + DoCastAOE(SPELL_DEATH_BITE); + else + DoCastAOE(SPELL_DEATH_BITE_H); uiDeathBiteTimer = urand (2000, 4000); } else uiDeathBiteTimer -= uiDiff; if (uiMarkedDeathTimer <= uiDiff) @@ -253,7 +344,12 @@ class boss_black_knight : public CreatureScript if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) { if (pTarget && pTarget->isAlive()) - DoCast(pTarget,SPELL_MARKED_DEATH); + { + if (IsHeroic()) + DoCast(pTarget,SPELL_MARKED_DEATH); + else + DoCast(pTarget,SPELL_MARKED_DEATH_2); + } } uiMarkedDeathTimer = urand (5000, 7000); } else uiMarkedDeathTimer -= uiDiff; @@ -265,6 +361,17 @@ class boss_black_knight : public CreatureScript DoMeleeAttackIfReady(); } + void EnterCombat(Unit* pWho) + { + bEventInBattle = true; + DoScriptText(SAY_AGGRO_2, me); + SetEquipmentSlots(false, EQUIP_SWORD, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE); + if (GameObject* pGO = GameObject::GetGameObject(*me, pInstance->GetData64(DATA_MAIN_GATE1))) + pInstance->HandleGameObject(pGO->GetGUID(),false); + if (GameObject* pGO = GameObject::GetGameObject(*me, pInstance->GetData64(DATA_MAIN_GATE))) + pInstance->HandleGameObject(pGO->GetGUID(),false); + } + void DamageTaken(Unit* /*pDoneBy*/, uint32& uiDamage) { if (uiDamage > me->GetHealth() && uiPhase <= PHASE_SKELETON) @@ -286,10 +393,44 @@ class boss_black_knight : public CreatureScript } } + void KilledUnit(Unit* pVictim) + { + DoScriptText(urand(0, 1) ? SAY_KILL : SAY_KILL1, me); + if (pInstance) + pInstance->SetData(BOSS_BLACK_KNIGHT,IN_PROGRESS); + } + void JustDied(Unit* /*pKiller*/) { + DoScriptText(SAY_DEATH_3, me); + if (GameObject* pGO = GameObject::GetGameObject(*me, pInstance->GetData64(DATA_MAIN_GATE1))) + pInstance->HandleGameObject(pGO->GetGUID(),true); + if (pInstance) + { pInstance->SetData(BOSS_BLACK_KNIGHT,DONE); + if (IsHeroic()) + { + pInstance->DoCompleteAchievement(ACHIEV_WORSE); + if (pInstance->GetData(DATA_TEAM_IN_INSTANCE) == TEAM_ALLIANCE) + { + pInstance->DoCompleteAchievement(ACHIEV_HEROIC_DONE_A); + }else + { + pInstance->DoCompleteAchievement(ACHIEV_HEROIC_DONE_H); + } + } + else + { + if (pInstance->GetData(DATA_TEAM_IN_INSTANCE) == TEAM_ALLIANCE) + { + pInstance->DoCompleteAchievement(ACHIEV_NORMAL_DONE_A); + }else + { + pInstance->DoCompleteAchievement(ACHIEV_NORMAL_DONE_H); + } + } + } } }; @@ -347,10 +488,16 @@ class npc_black_knight_skeletal_gryphon : public CreatureScript struct npc_black_knight_skeletal_gryphonAI : public npc_escortAI { - npc_black_knight_skeletal_gryphonAI(Creature* pCreature) : npc_escortAI(pCreature) + npc_black_knight_skeletal_gryphonAI(Creature* pCreature) : npc_escortAI(pCreature), vehicle(me->GetVehicleKit()) { Start(false,true,0,NULL); } + Vehicle *vehicle; + + void Reset() + { + vehicle->Reset(); + } void WaypointReached(uint32 /*i*/) { 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 e1b8cfda0e963..00e0319b49a58 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp @@ -73,6 +73,12 @@ enum eSpells SPELL_POISON_BOTTLE = 67701 }; +enum eEnums +{ + SAY_START_1 = -1999939, + SAY_START_2 = -1999937 +}; + enum eSeat { SEAT_ID_0 = 0 @@ -102,10 +108,20 @@ void AggroAllPlayers(Creature* pTemp) { if (Player* pPlayer = i->getSource()) { - if (pPlayer->isGameMaster()) - continue; - - if (pPlayer->isAlive()) + if (pPlayer->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT) && !pPlayer->isGameMaster()) + { + Creature* pCreature = pPlayer->GetVehicleBase()->ToCreature(); + + if (pCreature) + { + pTemp->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE); + pTemp->SetReactState(REACT_AGGRESSIVE); + pTemp->SetInCombatWith(pCreature); + pPlayer->SetInCombatWith(pTemp); + pCreature->SetInCombatWith(pTemp); + pTemp->AddThreat(pCreature, 0.0f); + } + } else if (pPlayer->isAlive() && !pPlayer->isGameMaster()) { pTemp->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE); pTemp->SetReactState(REACT_AGGRESSIVE); @@ -113,6 +129,9 @@ void AggroAllPlayers(Creature* pTemp) pPlayer->SetInCombatWith(pTemp); pTemp->AddThreat(pPlayer, 0.0f); } + + if (pPlayer->isGameMaster()) + continue; } } } @@ -172,6 +191,9 @@ class generic_vehicleAI_toc5 : public CreatureScript uiChargeTimer = 5000; uiShieldBreakerTimer = 8000; uiBuffTimer = urand(30000,60000); + + if (me->GetVehicleKit()) + me->GetVehicleKit()->Reset(); } void SetData(uint32 uiType, uint32 /*uiData*/) @@ -252,11 +274,15 @@ class generic_vehicleAI_toc5 : public CreatureScript for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) { Player* pPlayer = itr->getSource(); - if (pPlayer && !pPlayer->isGameMaster() && me->IsInRange(pPlayer,8.0f,25.0f,false)) + if (pPlayer && !pPlayer->isGameMaster() && me->IsInRange(pPlayer,8.0f,25.0f,false) && pPlayer->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT)) { - DoResetThreat(); - me->AddThreat(pPlayer,1.0f); - DoCast(pPlayer, SPELL_CHARGE); + Creature* pVehicle = pPlayer->GetVehicleBase()->ToCreature(); + if (pVehicle) + { + DoResetThreat(); + me->AddThreat(pVehicle,1.0f); + DoCast(pVehicle, SPELL_CHARGE); + } break; } } @@ -267,23 +293,22 @@ class generic_vehicleAI_toc5 : public CreatureScript //dosen't work at all if (uiShieldBreakerTimer <= uiDiff) { - Vehicle *pVehicle = me->GetVehicleKit(); - if (!pVehicle) - return; - - if (Unit* pPassenger = pVehicle->GetPassenger(SEAT_ID_0)) + Map::PlayerList const& players = me->GetMap()->GetPlayers(); + if (me->GetMap()->IsDungeon() && !players.isEmpty()) { - Map::PlayerList const& players = me->GetMap()->GetPlayers(); - if (me->GetMap()->IsDungeon() && !players.isEmpty()) + for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) { - for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + Player* pPlayer = itr->getSource(); + if (pPlayer && !pPlayer->isGameMaster() && me->IsInRange(pPlayer,10.0f,30.0f,false) && pPlayer->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT)) { - Player* pPlayer = itr->getSource(); - if (pPlayer && !pPlayer->isGameMaster() && me->IsInRange(pPlayer,10.0f,30.0f,false)) + Creature* pVehicle = pPlayer->GetVehicleBase()->ToCreature(); + if (pVehicle) { - pPassenger->CastSpell(pPlayer,SPELL_SHIELD_BREAKER,true); - break; + DoResetThreat(); + me->AddThreat(pVehicle,1.0f); + DoCast(pVehicle,SPELL_SHIELD_BREAKER); } + break; } } } @@ -361,6 +386,7 @@ class boss_warrior_toc5 : public CreatureScript if (!bDone && GrandChampionsOutVehicle(me)) { bDone = true; + DoScriptText(SAY_START_2, me); if (pInstance && me->GetGUID() == pInstance->GetData64(DATA_GRAND_CHAMPION_1)) me->SetHomePosition(739.678f,662.541f,412.393f,4.49f); @@ -422,6 +448,7 @@ class boss_warrior_toc5 : public CreatureScript void JustDied(Unit* /*pKiller*/) { + DoScriptText(SAY_START_1, me); if (pInstance) pInstance->SetData(BOSS_GRAND_CHAMPIONS, DONE); } @@ -526,7 +553,6 @@ class boss_mage_toc5 : public CreatureScript uiFireBallTimer = 5000; } else uiFireBallTimer -= uiDiff; - if (!UpdateVictim() || me->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT)) return; @@ -538,7 +564,7 @@ class boss_mage_toc5 : public CreatureScript if (uiPolymorphTimer <= uiDiff) { - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) DoCast(pTarget, SPELL_POLYMORPH); uiPolymorphTimer = 8000; } else uiPolymorphTimer -= uiDiff; @@ -562,6 +588,7 @@ class boss_mage_toc5 : public CreatureScript void JustDied(Unit* /*pKiller*/) { + DoScriptText(SAY_START_1, me); if (pInstance) pInstance->SetData(BOSS_GRAND_CHAMPIONS, DONE); } @@ -670,7 +697,7 @@ class boss_shaman_toc5 : public CreatureScript if (uiChainLightningTimer <= uiDiff) { - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) DoCast(pTarget,SPELL_CHAIN_LIGHTNING); uiChainLightningTimer = 16000; @@ -709,6 +736,7 @@ class boss_shaman_toc5 : public CreatureScript void JustDied(Unit* /*pKiller*/) { + DoScriptText(SAY_START_1, me); if (pInstance) pInstance->SetData(BOSS_GRAND_CHAMPIONS, DONE); } @@ -720,7 +748,6 @@ class boss_shaman_toc5 : public CreatureScript } }; - class boss_hunter_toc5 : public CreatureScript { public: @@ -865,6 +892,7 @@ class boss_hunter_toc5 : public CreatureScript void JustDied(Unit* /*pKiller*/) { + DoScriptText(SAY_START_1, me); if (pInstance) pInstance->SetData(BOSS_GRAND_CHAMPIONS, DONE); } @@ -876,7 +904,6 @@ class boss_hunter_toc5 : public CreatureScript } }; - class boss_rouge_toc5 : public CreatureScript { public: @@ -977,7 +1004,7 @@ class boss_rouge_toc5 : public CreatureScript if (uiPosionBottleTimer <= uiDiff) { - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) DoCast(pTarget,SPELL_POISON_BOTTLE); uiPosionBottleTimer = 19000; } else uiPosionBottleTimer -= uiDiff; @@ -987,6 +1014,7 @@ class boss_rouge_toc5 : public CreatureScript void JustDied(Unit* /*pKiller*/) { + DoScriptText(SAY_START_1, me); if (pInstance) pInstance->SetData(BOSS_GRAND_CHAMPIONS, DONE); } 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 0d9ead0331960..86d1c49e93794 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 @@ -15,7 +15,6 @@ * with this program. If not, see . */ - /* ScriptData SDName: Instance Trial of the Champion SDComment: @@ -42,6 +41,7 @@ class instance_trial_of_the_champion : public InstanceMapScript instance_trial_of_the_champion_InstanceMapScript(Map* pMap) : InstanceScript(pMap) {Initialize();} uint32 m_auiEncounter[MAX_ENCOUNTER]; + uint32 TeamInInstance; uint16 uiMovementDone; uint16 uiGrandChampionsDeaths; @@ -49,6 +49,7 @@ class instance_trial_of_the_champion : public InstanceMapScript uint64 uiAnnouncerGUID; uint64 uiMainGateGUID; + uint64 uiMainGate1GUID; uint64 uiGrandChampionVehicle1GUID; uint64 uiGrandChampionVehicle2GUID; uint64 uiGrandChampionVehicle3GUID; @@ -69,9 +70,11 @@ class instance_trial_of_the_champion : public InstanceMapScript uiMovementDone = 0; uiGrandChampionsDeaths = 0; uiArgentSoldierDeaths = 0; + TeamInInstance = 0; uiAnnouncerGUID = 0; uiMainGateGUID = 0; + uiMainGate1GUID = 0; uiGrandChampionVehicle1GUID = 0; uiGrandChampionVehicle2GUID = 0; uiGrandChampionVehicle3GUID = 0; @@ -102,7 +105,6 @@ class instance_trial_of_the_champion : public InstanceMapScript void OnCreatureCreate(Creature* creature) { Map::PlayerList const &players = instance->GetPlayers(); - uint32 TeamInInstance = 0; if (!players.isEmpty()) { @@ -112,33 +114,100 @@ class instance_trial_of_the_champion : public InstanceMapScript switch(creature->GetEntry()) { - // Champions + // Gran Champions case VEHICLE_MOKRA_SKILLCRUSHER_MOUNT: if (TeamInInstance == HORDE) creature->UpdateEntry(VEHICLE_MARSHAL_JACOB_ALERIUS_MOUNT, ALLIANCE); break; + case NPC_MOKRA: + if (TeamInInstance == HORDE) + creature->UpdateEntry(NPC_JACOB, ALLIANCE); + break; case VEHICLE_ERESSEA_DAWNSINGER_MOUNT: if (TeamInInstance == HORDE) creature->UpdateEntry(VEHICLE_AMBROSE_BOLTSPARK_MOUNT, ALLIANCE); break; + case NPC_ERESSEA: + if (TeamInInstance == HORDE) + creature->UpdateEntry(NPC_AMBROSE, ALLIANCE); + break; case VEHICLE_RUNOK_WILDMANE_MOUNT: if (TeamInInstance == HORDE) creature->UpdateEntry(VEHICLE_COLOSOS_MOUNT, ALLIANCE); break; + case NPC_RUNOK: + if (TeamInInstance == HORDE) + creature->UpdateEntry(NPC_COLOSOS, ALLIANCE); + break; case VEHICLE_ZUL_TORE_MOUNT: if (TeamInInstance == HORDE) creature->UpdateEntry(VEHICLE_EVENSONG_MOUNT, ALLIANCE); break; + case NPC_ZULTORE: + if (TeamInInstance == HORDE) + creature->UpdateEntry(NPC_JAELYNE, ALLIANCE); + break; case VEHICLE_DEATHSTALKER_VESCERI_MOUNT: if (TeamInInstance == HORDE) creature->UpdateEntry(VEHICLE_LANA_STOUTHAMMER_MOUNT, ALLIANCE); break; + case NPC_VISCERI: + if (TeamInInstance == HORDE) + creature->UpdateEntry(NPC_LANA, ALLIANCE); + break; + // Faction champions vehicles + case VEHICLE_FORSAKE_WARHORSE: + if (TeamInInstance == HORDE) + creature->UpdateEntry(VEHICLE_IRONFORGE_RAM, ALLIANCE); + break; + case VEHICLE_THUNDER_BLUFF_KODO: + if (TeamInInstance == HORDE) + creature->UpdateEntry(VEHICLE_EXODAR_ELEKK, ALLIANCE); + break; + case VEHICLE_ORGRIMMAR_WOLF: + if (TeamInInstance == HORDE) + creature->UpdateEntry(VEHICLE_STORMWIND_STEED, ALLIANCE); + break; + case VEHICLE_SILVERMOON_HAWKSTRIDER: + if (TeamInInstance == HORDE) + creature->UpdateEntry(VEHICLE_GNOMEREGAN_MECHANOSTRIDER, ALLIANCE); + break; + case VEHICLE_DARKSPEAR_RAPTOR: + if (TeamInInstance == HORDE) + creature->UpdateEntry(VEHICLE_DARNASSIA_NIGHTSABER, ALLIANCE); + break; + // Faction champios + case NPC_ORGRIMAR_CHAMPION: + if (TeamInInstance == HORDE) + creature->UpdateEntry(NPC_STORMWIND_CHAMPION, ALLIANCE); + break; + case NPC_SILVERMOON_CHAMPION: + if (TeamInInstance == HORDE) + creature->UpdateEntry(NPC_GNOMERAGN_CHAMPION, ALLIANCE); + break; + case NPC_THUNDER_CHAMPION: + if (TeamInInstance == HORDE) + creature->UpdateEntry(NPC_EXODAR_CHAMPION, ALLIANCE); + break; + case NPC_TROLL_CHAMPION: + if (TeamInInstance == HORDE) + creature->UpdateEntry(NPC_DRNASSUS_CHAMPION, ALLIANCE); + break; + case NPC_UNDERCITY_CHAMPION: + if (TeamInInstance == HORDE) + creature->UpdateEntry(NPC_IRONFORGE_CHAMPION, ALLIANCE); + break; + // Coliseum Announcer || Just NPC_JAEREN must be spawned. case NPC_JAEREN: uiAnnouncerGUID = creature->GetGUID(); if (TeamInInstance == ALLIANCE) creature->UpdateEntry(NPC_ARELAS,ALLIANCE); break; + case NPC_JAEREN_AN: + if (TeamInInstance == ALLIANCE) + creature->UpdateEntry(NPC_ARELAS_AN,ALLIANCE); + break; case VEHICLE_ARGENT_WARHORSE: case VEHICLE_ARGENT_BATTLEWORG: VehicleList.push_back(creature->GetGUID()); @@ -157,6 +226,9 @@ class instance_trial_of_the_champion : public InstanceMapScript case GO_MAIN_GATE: uiMainGateGUID = go->GetGUID(); break; + case GO_MAIN_GATE1: + uiMainGate1GUID = go->GetGUID(); + break; case GO_CHAMPIONS_LOOT: case GO_CHAMPIONS_LOOT_H: uiChampionLootGUID = go->GetGUID(); @@ -186,10 +258,11 @@ class instance_trial_of_the_champion : public InstanceMapScript }else if (uiData == DONE) { ++uiGrandChampionsDeaths; - if (uiGrandChampionsDeaths == 3) + if (uiGrandChampionsDeaths >= 3) { if (Creature* pAnnouncer = instance->GetCreature(uiAnnouncerGUID)) { + m_auiEncounter[0] = uiData; pAnnouncer->GetMotionMaster()->MovePoint(0,748.309f,619.487f,411.171f); pAnnouncer->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); pAnnouncer->SummonGameObject(instance->IsHeroic()? GO_CHAMPIONS_LOOT_H : GO_CHAMPIONS_LOOT,746.59f,618.49f,411.09f,1.42f,0, 0, 0, 0,90000000); @@ -206,25 +279,42 @@ class instance_trial_of_the_champion : public InstanceMapScript pBoss->GetMotionMaster()->MovePoint(0,746.88f,618.74f,411.06f); pBoss->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE); pBoss->SetReactState(REACT_AGGRESSIVE); + pBoss->setFaction(16); } } break; case BOSS_ARGENT_CHALLENGE_E: m_auiEncounter[1] = uiData; - if (Creature* pAnnouncer = instance->GetCreature(uiAnnouncerGUID)) + if (uiData == IN_PROGRESS) { - pAnnouncer->GetMotionMaster()->MovePoint(0,748.309f,619.487f,411.171f); - pAnnouncer->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - pAnnouncer->SummonGameObject(instance->IsHeroic()? GO_EADRIC_LOOT_H : GO_EADRIC_LOOT,746.59f,618.49f,411.09f,1.42f,0, 0, 0, 0,90000000); + for(std::list::const_iterator itr = VehicleList.begin(); itr != VehicleList.end(); ++itr) + if (Creature* pSummon = instance->GetCreature(*itr)) + pSummon->RemoveFromWorld(); + }else if (uiData == DONE) + { + if (Creature* pAnnouncer = instance->GetCreature(uiAnnouncerGUID)) + { + pAnnouncer->GetMotionMaster()->MovePoint(0,748.309f,619.487f,411.171f); + pAnnouncer->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + pAnnouncer->SummonGameObject(instance->IsHeroic()? GO_EADRIC_LOOT_H : GO_EADRIC_LOOT,746.59f,618.49f,411.09f,1.42f,0, 0, 0, 0,90000000); + } } break; case BOSS_ARGENT_CHALLENGE_P: m_auiEncounter[2] = uiData; - if (Creature* pAnnouncer = instance->GetCreature(uiAnnouncerGUID)) + if (uiData == IN_PROGRESS) { - pAnnouncer->GetMotionMaster()->MovePoint(0,748.309f,619.487f,411.171f); - pAnnouncer->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - pAnnouncer->SummonGameObject(instance->IsHeroic()? GO_PALETRESS_LOOT_H : GO_PALETRESS_LOOT,746.59f,618.49f,411.09f,1.42f,0, 0, 0, 0,90000000); + for(std::list::const_iterator itr = VehicleList.begin(); itr != VehicleList.end(); ++itr) + if (Creature* pSummon = instance->GetCreature(*itr)) + pSummon->RemoveFromWorld(); + }else if (uiData == DONE) + { + if (Creature* pAnnouncer = instance->GetCreature(uiAnnouncerGUID)) + { + pAnnouncer->GetMotionMaster()->MovePoint(0,748.309f,619.487f,411.171f); + pAnnouncer->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + pAnnouncer->SummonGameObject(instance->IsHeroic()? GO_PALETRESS_LOOT_H : GO_PALETRESS_LOOT,746.59f,618.49f,411.09f,1.42f,0, 0, 0, 0,90000000); + } } break; } @@ -244,6 +334,7 @@ class instance_trial_of_the_champion : public InstanceMapScript case DATA_MOVEMENT_DONE: return uiMovementDone; case DATA_ARGENT_SOLDIER_DEFEATED: return uiArgentSoldierDeaths; + case DATA_TEAM_IN_INSTANCE: return TeamInInstance; } return 0; @@ -255,6 +346,7 @@ class instance_trial_of_the_champion : public InstanceMapScript { case DATA_ANNOUNCER: return uiAnnouncerGUID; case DATA_MAIN_GATE: return uiMainGateGUID; + case DATA_MAIN_GATE1: return uiMainGate1GUID; case DATA_GRAND_CHAMPION_1: return uiGrandChampion1GUID; case DATA_GRAND_CHAMPION_2: return uiGrandChampion2GUID; @@ -336,7 +428,6 @@ class instance_trial_of_the_champion : public InstanceMapScript }; - void AddSC_instance_trial_of_the_champion() { new instance_trial_of_the_champion(); 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 03d38570db0d3..0ed7846e05f96 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 @@ -18,7 +18,7 @@ /* ScriptData SDName: Trial Of the Champion SD%Complete: -SDComment: +SDComment: SDCategory: trial_of_the_champion EndScriptData */ @@ -41,6 +41,209 @@ EndContentData */ const Position SpawnPosition = {746.261f,657.401f,411.681f,4.65f}; +enum eEnums +{ + SAY_START = -1999926, + SAY_START3 = -1999940, + SAY_START5 = -1999936, + SAY_START11 = -1999953, + AN_1 = -1999942, + AN_2 = -1999943, + AN_3 = -1999944, + AN_4 = -1999945, + AN_5 = -1999946, + AN_6 = -1999947, + AN_7 = -1999948, + AN_8 = -1999949 +}; + +enum IntroPhase +{ + IDLE, + INTRO, + FINISHED +}; + +enum Creatures +{ + CREATURE_TRALL = 34994, + CREATURE_GARROSH = 34995, + CREATURE_KING = 34990, + CREATURE_LADY = 34992, + CREATURE_HIGHLORD = 34996, + CREATURE_ANNOUNCER = 35004 +}; + + +class npc_anstart : public CreatureScript +{ +public: + npc_anstart() : CreatureScript("npc_anstart") { } + + CreatureAI* GetAI(Creature* pCreature) const + { + return new npc_anstartAI (pCreature); + } + + struct npc_anstartAI : public ScriptedAI + { + npc_anstartAI(Creature *pCreature) : ScriptedAI(pCreature) + + { + pInstance = (InstanceScript*)pCreature->GetInstanceScript(); + } + + uint32 uiIntroTimer; + + uint8 uiIntroPhase; + + IntroPhase Phase; + + Creature* pTrall; + Creature* pGarrosh; + Creature* pKing; + Creature* pLady; + Creature* pHighlord; + + InstanceScript* pInstance; + + + + void Reset() + { + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE); + Phase = IDLE; + uiIntroTimer = 0; + uiIntroPhase = 0; + pTrall = NULL; + pGarrosh = NULL; + pKing = NULL; + pLady = NULL; + pHighlord = NULL; + } + + void MoveInLineOfSight(Unit* pWho) + { + if (!pWho) + return; + if (Phase == IDLE && pWho->isTargetableForAttack() && me->IsHostileTo(pWho) && me->IsWithinDistInMap(pWho, 20)) + { + Phase = INTRO; + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + if (pTrall = me->SummonCreature(CREATURE_TRALL, 685.569f, 615.103f, 435.396f, 6.23544f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000)) + { + pTrall->SetReactState(REACT_PASSIVE); + pTrall->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + if (pGarrosh = me->SummonCreature(CREATURE_GARROSH, 685.7f, 621.134f, 435.396f, 6.259f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000)) + { + pGarrosh->SetReactState(REACT_PASSIVE); + pGarrosh->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + if (pKing = me->SummonCreature(CREATURE_KING, 807.724f, 617.9f, 435.396f, 3.18416f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000)) + { + pKing->SetReactState(REACT_PASSIVE); + pKing->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + if (pLady = me->SummonCreature(CREATURE_LADY, 807.401f, 613.667f, 435.397f, 3.0585f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000)) + { + pLady->SetReactState(REACT_PASSIVE); + pLady->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + if (pHighlord = me->SummonCreature(CREATURE_HIGHLORD, 746.482f, 556.857f, 435.396f, 1.5898f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000)) + { + pHighlord->SetReactState(REACT_PASSIVE); + pHighlord->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + } + } + + void AttackStart(Unit* who) {} + + void UpdateAI(const uint32 diff) + { + + if (Phase != INTRO) + return; + + if (uiIntroTimer <= diff) + { + if(!pTrall) + return; + if(!pGarrosh) + return; + if(!pKing) + return; + if(!pLady) + return; + if(!pHighlord) + return; + + switch (uiIntroPhase) + { + case 0: + ++uiIntroPhase; + uiIntroTimer = 4000; + break; + case 1: + DoScriptText(AN_1, me); + ++uiIntroPhase; + uiIntroTimer = 10000; + break; + case 2: + DoScriptText(AN_2, me); + ++uiIntroPhase; + uiIntroTimer = 13000; + break; + case 3: + DoScriptText(AN_3, pTrall); + ++uiIntroPhase; + uiIntroTimer = 8000; + break; + case 4: + DoScriptText(AN_4, pGarrosh); + ++uiIntroPhase; + uiIntroTimer = 6000; + break; + case 5: + DoScriptText(AN_5, pKing); + ++uiIntroPhase; + uiIntroTimer = 8000; + break; + case 6: + DoScriptText(AN_6, pLady); + ++uiIntroPhase; + uiIntroTimer = 8000; + break; + case 7: + DoScriptText(AN_7, pHighlord); + ++uiIntroPhase; + uiIntroTimer = 3000; + break; + case 8: + DoScriptText(AN_8, me); + ++uiIntroPhase; + uiIntroTimer = 4000; + break; + case 9: + if (Creature* pAnnouncertoc5 = me->SummonCreature(CREATURE_ANNOUNCER, 746.626f, 618.54f, 411.09f, 4.63158f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 60000)) + { + me->DisappearAndDie(); + pAnnouncertoc5->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + pAnnouncertoc5->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + pAnnouncertoc5->SetReactState(REACT_PASSIVE); + + Phase = FINISHED; + } + else Reset(); + return; + } + } else uiIntroTimer -= diff; + } + }; +}; + class npc_announcer_toc5 : public CreatureScript { public: @@ -120,6 +323,11 @@ class npc_announcer_toc5 : public CreatureScript switch (uiType) { case DATA_START: + if (GameObject* pGO = GameObject::GetGameObject(*me, pInstance->GetData64(DATA_MAIN_GATE))) + pInstance->HandleGameObject(pGO->GetGUID(),true); + if (GameObject* pGO = GameObject::GetGameObject(*me, pInstance->GetData64(DATA_MAIN_GATE1))) + pInstance->HandleGameObject(pGO->GetGUID(),false); + DoScriptText(SAY_START, me); DoSummonGrandChampion(uiFirstBoss); NextStep(10000,false,1); break; @@ -306,6 +514,7 @@ class npc_announcer_toc5 : public CreatureScript void DoStartArgentChampionEncounter() { + DoScriptText(SAY_START3, me); me->GetMotionMaster()->MovePoint(1,735.81f,661.92f,412.39f); if (me->SummonCreature(uiArgentChampion,SpawnPosition)) @@ -313,11 +522,20 @@ class npc_announcer_toc5 : public CreatureScript for (uint8 i = 0; i < 3; ++i) { if (Creature* pTrash = me->SummonCreature(NPC_ARGENT_LIGHWIELDER,SpawnPosition)) + { pTrash->AI()->SetData(i,0); + pTrash->SetReactState(REACT_AGGRESSIVE); + } if (Creature* pTrash = me->SummonCreature(NPC_ARGENT_MONK,SpawnPosition)) + { pTrash->AI()->SetData(i,0); + pTrash->SetReactState(REACT_AGGRESSIVE); + } if (Creature* pTrash = me->SummonCreature(NPC_PRIESTESS,SpawnPosition)) + { pTrash->AI()->SetData(i,0); + pTrash->SetReactState(REACT_AGGRESSIVE); + } } } } @@ -354,6 +572,8 @@ class npc_announcer_toc5 : public CreatureScript return; me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + if (GameObject* pGO = GameObject::GetGameObject(*me, pInstance->GetData64(DATA_MAIN_GATE1))) + pInstance->HandleGameObject(pGO->GetGUID(),false); if (pInstance->GetData(BOSS_BLACK_KNIGHT) == NOT_STARTED) { @@ -369,7 +589,12 @@ class npc_announcer_toc5 : public CreatureScript if ((pInstance->GetData(BOSS_GRAND_CHAMPIONS) == DONE && pInstance->GetData(BOSS_ARGENT_CHALLENGE_E) == DONE) || pInstance->GetData(BOSS_ARGENT_CHALLENGE_P) == DONE) - me->SummonCreature(VEHICLE_BLACK_KNIGHT,769.834f,651.915f,447.035f,0); + { + me->SummonCreature(VEHICLE_BLACK_KNIGHT,769.834f,651.915f,447.035f,0); + if (GameObject* pGO = GameObject::GetGameObject(*me, pInstance->GetData64(DATA_MAIN_GATE))) + pInstance->HandleGameObject(pGO->GetGUID(),false); + DoScriptText(SAY_START5, me); + } } } @@ -384,10 +609,21 @@ class npc_announcer_toc5 : public CreatureScript { if (Player* pPlayer = i->getSource()) { - if (pPlayer->isGameMaster()) - continue; - - if (pPlayer->isAlive()) + if (pPlayer->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT) && !pPlayer->isGameMaster()) + { + Creature* pCreature = pPlayer->GetVehicleBase()->ToCreature(); + + if (pCreature) + { + pTemp->SetHomePosition(me->GetPositionX(),me->GetPositionY(),me->GetPositionZ(),me->GetOrientation()); + pTemp->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE); + pTemp->SetReactState(REACT_AGGRESSIVE); + pTemp->SetInCombatWith(pCreature); + pPlayer->SetInCombatWith(pTemp); + pCreature->SetInCombatWith(pTemp); + pTemp->AddThreat(pCreature, 0.0f); + } + } else if (pPlayer->isAlive() && !pPlayer->isGameMaster() ) { pTemp->SetHomePosition(me->GetPositionX(),me->GetPositionY(),me->GetPositionZ(),me->GetOrientation()); pTemp->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE); @@ -396,11 +632,13 @@ class npc_announcer_toc5 : public CreatureScript pPlayer->SetInCombatWith(pTemp); pTemp->AddThreat(pPlayer, 0.0f); } + + if (pPlayer->isGameMaster()) + continue; } } } - void UpdateAI(const uint32 uiDiff) { ScriptedAI::UpdateAI(uiDiff); @@ -472,10 +710,11 @@ class npc_announcer_toc5 : public CreatureScript InstanceScript* pInstance = pCreature->GetInstanceScript(); if (pInstance && - ((pInstance->GetData(BOSS_GRAND_CHAMPIONS) == DONE && + pInstance->GetData(BOSS_GRAND_CHAMPIONS) == DONE && pInstance->GetData(BOSS_BLACK_KNIGHT) == DONE && - pInstance->GetData(BOSS_ARGENT_CHALLENGE_E) == DONE) || + (pInstance->GetData(BOSS_ARGENT_CHALLENGE_E) == DONE || pInstance->GetData(BOSS_ARGENT_CHALLENGE_P) == DONE)) + return false; if (pInstance && @@ -505,7 +744,100 @@ class npc_announcer_toc5 : public CreatureScript } }; +enum ArgentTournamentSpells +{ + SPELL_DEFEND = 66482, +}; + +// Shield-Breaker 62575 +class spell_gen_shieldbreaker : public SpellScriptLoader +{ +public: + spell_gen_shieldbreaker() : SpellScriptLoader("spell_gen_shieldbreaker") { } + + class spell_gen_shieldbreaker_SpellScript : public SpellScript + { + PrepareSpellScript(spell_gen_shieldbreaker_SpellScript) + + void HandleScript(SpellEffIndex /*effIndex*/) + { + if (Unit * target = GetHitUnit()) + target->RemoveAuraFromStack(SPELL_DEFEND); + } + + void Register() + { + OnEffect += SpellEffectFn(spell_gen_shieldbreaker_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_gen_shieldbreaker_SpellScript(); + } +}; + +// Charge 63010 +class spell_gen_atcharge : public SpellScriptLoader +{ +public: + spell_gen_atcharge() : SpellScriptLoader("spell_gen_atcharge") { } + + class spell_gen_atcharge_SpellScript : public SpellScript + { + PrepareSpellScript(spell_gen_atcharge_SpellScript) + + void HandleScript(SpellEffIndex /*effIndex*/) + { + if (Unit * target = GetHitUnit()) + target->RemoveAuraFromStack(SPELL_DEFEND); + } + + void Register() + { + OnEffect += SpellEffectFn(spell_gen_atcharge_SpellScript::HandleScript, EFFECT_2, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_gen_atcharge_SpellScript(); + } +}; + +// Shield-Breaker 68504 +class spell_gen_npcshieldbreaker : public SpellScriptLoader +{ +public: + spell_gen_npcshieldbreaker() : SpellScriptLoader("spell_gen_npcshieldbreaker") { } + + class spell_gen_npcshieldbreaker_SpellScript : public SpellScript + { + PrepareSpellScript(spell_gen_npcshieldbreaker_SpellScript) + + void HandleScript(SpellEffIndex /*effIndex*/) + { + if (Unit * target = GetHitUnit()) + target->RemoveAuraFromStack(SPELL_DEFEND); + } + + void Register() + { + OnEffect += SpellEffectFn(spell_gen_npcshieldbreaker_SpellScript::HandleScript, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_gen_npcshieldbreaker_SpellScript(); + } +}; + void AddSC_trial_of_the_champion() { + new npc_anstart(); new npc_announcer_toc5(); + new spell_gen_shieldbreaker(); + new spell_gen_atcharge(); + new spell_gen_npcshieldbreaker(); } 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 bde74cf170dea..2f5b3aa5cbf0b 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 @@ -19,7 +19,6 @@ #ifndef DEF_TOC_H #define DEF_TOC_H - enum eData { BOSS_GRAND_CHAMPIONS, @@ -30,13 +29,15 @@ enum eData DATA_LESSER_CHAMPIONS_DEFEATED, DATA_START, DATA_IN_POSITION, - DATA_ARGENT_SOLDIER_DEFEATED + DATA_ARGENT_SOLDIER_DEFEATED, + DATA_TEAM_IN_INSTANCE }; enum Data64 { DATA_ANNOUNCER, DATA_MAIN_GATE, + DATA_MAIN_GATE1, DATA_GRAND_CHAMPION_VEHICLE_1, DATA_GRAND_CHAMPION_VEHICLE_2, @@ -63,6 +64,20 @@ enum eNpcs NPC_JAELYNE = 34657, NPC_LANA = 34703, + // Faction champions horde + NPC_ORGRIMAR_CHAMPION = 35314, + NPC_SILVERMOON_CHAMPION = 35326, + NPC_THUNDER_CHAMPION = 35325, + NPC_TROLL_CHAMPION = 35323, + NPC_UNDERCITY_CHAMPION = 35327, + + // Faction champions alliance + NPC_STORMWIND_CHAMPION = 35328, + NPC_GNOMERAGN_CHAMPION = 35331, + NPC_EXODAR_CHAMPION = 35330, + NPC_DRNASSUS_CHAMPION = 35332, + NPC_IRONFORGE_CHAMPION = 35329, + NPC_EADRIC = 35119, NPC_PALETRESS = 34928, @@ -74,23 +89,56 @@ enum eNpcs NPC_RISEN_JAEREN = 35545, NPC_RISEN_ARELAS = 35564, - + + // Announcer Start Event NPC_JAEREN = 35004, - NPC_ARELAS = 35005 + NPC_ARELAS = 35005, + + // Announcer + NPC_JAEREN_AN = 35591, + NPC_ARELAS_AN = 35592, + + // Memory + MEMORY_ALGALON = 35052, + MEMORY_ARCHIMONDE = 35041, + MEMORY_CHROMAGGUS = 35033, + MEMORY_CYANIGOSA = 35046, + MEMORY_DELRISSA = 35043, + MEMORY_ECK = 35047, + MEMORY_ENTROPIUS = 35044, + MEMORY_GRUUL = 35039, + MEMORY_HAKKAR = 35034, + MEMORY_HEIGAN = 35049, + MEMORY_HEROD = 35030, + MEMORY_HOGGER = 34942, + MEMORY_IGNIS = 35050, + MEMORY_ILLIDAN = 35042, + MEMORY_INGVAR = 35045, + MEMORY_KALITHRESH = 35037, + MEMORY_LUCIFRON = 35031, + MEMORY_MALCHEZAAR = 35038, + MEMORY_MUTANUS = 35029, + MEMORY_ONYXIA = 35048, + MEMORY_THUNDERAAN = 35032, + MEMORY_VANCLEEF = 35028, + MEMORY_VASHJ = 35040, + MEMORY_VEKNILASH = 35036, + MEMORY_VEZAX = 35051 }; enum eGameObjects { GO_MAIN_GATE = 195647, + GO_MAIN_GATE1 = 195650, GO_CHAMPIONS_LOOT = 195709, - GO_CHAMPIONS_LOOT_H = 195710, + GO_CHAMPIONS_LOOT_H = 195710, GO_EADRIC_LOOT = 195374, GO_EADRIC_LOOT_H = 195375, GO_PALETRESS_LOOT = 195323, - GO_PALETRESS_LOOT_H = 195324 + GO_PALETRESS_LOOT_H = 195324 }; enum eVehicles diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp index 4c67249751d8b..800d0512bf4f9 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp @@ -134,6 +134,8 @@ class boss_anubarak_trial : public CreatureScript { boss_anubarak_trialAI(Creature* pCreature) : ScriptedAI(pCreature), Summons(me) { + me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true); + me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_GRIP, true); m_pInstance = (InstanceScript*)pCreature->GetInstanceScript(); } @@ -405,7 +407,6 @@ class boss_anubarak_trial : public CreatureScript }; - class mob_swarm_scarab : public CreatureScript { public: @@ -473,7 +474,6 @@ class mob_swarm_scarab : public CreatureScript }; - class mob_nerubian_burrower : public CreatureScript { public: @@ -513,7 +513,7 @@ class mob_nerubian_burrower : public CreatureScript switch (actionId) { case ACTION_SHADOW_STRIKE: - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(pTarget, SPELL_SHADOW_STRIKE); break; } @@ -551,7 +551,6 @@ class mob_nerubian_burrower : public CreatureScript }; - class mob_frost_sphere : public CreatureScript { public: @@ -632,7 +631,6 @@ class mob_frost_sphere : public CreatureScript }; - class mob_anubarak_spike : public CreatureScript { public: diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp index 2b4733a8ce83d..ba9e694ef4e1b 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp @@ -69,14 +69,12 @@ class boss_toc_champion_controller : public CreatureScript InstanceScript* m_pInstance; SummonList Summons; - uint32 m_uiChampionsNotStarted; uint32 m_uiChampionsFailed; uint32 m_uiChampionsKilled; bool m_bInProgress; void Reset() { - m_uiChampionsNotStarted = 0; m_uiChampionsFailed = 0; m_uiChampionsKilled = 0; m_bInProgress = false; @@ -222,7 +220,6 @@ class boss_toc_champion_controller : public CreatureScript case IN_PROGRESS: if (!m_bInProgress) { - m_uiChampionsNotStarted = 0; m_uiChampionsFailed = 0; m_uiChampionsKilled = 0; m_bInProgress = true; @@ -249,35 +246,33 @@ class boss_toc_champion_controller : public CreatureScript }; - struct boss_faction_championsAI : public ScriptedAI { boss_faction_championsAI(Creature* pCreature, uint32 aitype) : ScriptedAI(pCreature) { m_pInstance = (InstanceScript *) pCreature->GetInstanceScript(); mAIType = aitype; + isWipe = false; } InstanceScript* m_pInstance; - uint64 championControllerGUID; uint32 mAIType; uint32 ThreatTimer; uint32 CCTimer; + bool isWipe; void Reset() { - championControllerGUID = 0; CCTimer = rand()%10000; ThreatTimer = 5000; - } - - void JustReachedHome() - { - if (m_pInstance) - if (Creature* pChampionController = Unit::GetCreature((*me), m_pInstance->GetData64(NPC_CHAMPIONS_CONTROLLER))) - pChampionController->AI()->SetData(2, FAIL); - me->DespawnOrUnsummon(); + if (isWipe) + { + if (m_pInstance) + if (Creature* pChampionController = Unit::GetCreature((*me), m_pInstance->GetData64(NPC_CHAMPIONS_CONTROLLER))) + pChampionController->AI()->SetData(TYPE_CRUSADERS, FAIL); + me->DespawnOrUnsummon(); + } } float CalculateThreat(float distance, float armor, uint32 health) @@ -329,16 +324,17 @@ struct boss_faction_championsAI : public ScriptedAI if (mAIType != AI_PET) if (m_pInstance) if (Creature* pChampionController = Unit::GetCreature((*me), m_pInstance->GetData64(NPC_CHAMPIONS_CONTROLLER))) - pChampionController->AI()->SetData(2, DONE); + pChampionController->AI()->SetData(TYPE_CRUSADERS, DONE); } void EnterCombat(Unit* /*who*/) { DoCast(me, SPELL_ANTI_AOE, true); me->SetInCombatWithZone(); + isWipe = true; if (m_pInstance) if (Creature* pChampionController = Unit::GetCreature((*me), m_pInstance->GetData64(NPC_CHAMPIONS_CONTROLLER))) - pChampionController->AI()->SetData(2, IN_PROGRESS); + pChampionController->AI()->SetData(TYPE_CRUSADERS, IN_PROGRESS); } void KilledUnit(Unit* who) @@ -606,7 +602,7 @@ class mob_toc_shaman : public CreatureScript if (m_uiHexTimer <= uiDiff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(pTarget, SPELL_HEX); m_uiHexTimer = urand(10*IN_MILLISECONDS, 40*IN_MILLISECONDS); } else m_uiHexTimer -= uiDiff; @@ -708,7 +704,7 @@ class mob_toc_paladin : public CreatureScript if (m_uiHolyShockTimer <= uiDiff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(pTarget, SPELL_HOLY_SHOCK); m_uiHolyShockTimer = urand(6*IN_MILLISECONDS, 15*IN_MILLISECONDS); } else m_uiHolyShockTimer -= uiDiff; @@ -722,7 +718,7 @@ class mob_toc_paladin : public CreatureScript if (m_uiHammerOfJusticeTimer <= uiDiff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(pTarget, SPELL_HAMMER_OF_JUSTICE); m_uiHammerOfJusticeTimer = urand(5*IN_MILLISECONDS, 15*IN_MILLISECONDS); } else m_uiHammerOfJusticeTimer -= uiDiff; @@ -810,7 +806,7 @@ class mob_toc_priest : public CreatureScript DoCast(me, SPELL_FLASH_HEAL); break; case 4: - if (Unit *pTarget = urand(0, 1) ? SelectUnit(SELECT_TARGET_RANDOM, 0) : DoSelectLowestHpFriendly(40.0f)) + if (Unit *pTarget = urand(0, 1) ? SelectTarget(SELECT_TARGET_RANDOM, 0) : DoSelectLowestHpFriendly(40.0f)) DoCast(pTarget, SPELL_DISPEL); break; case 5: @@ -905,7 +901,7 @@ class mob_toc_shadow_priest : public CreatureScript if (m_uiMindBlastTimer <= uiDiff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(pTarget, SPELL_MIND_BLAST); m_uiMindBlastTimer = urand(3*IN_MILLISECONDS, 8*IN_MILLISECONDS); } else m_uiMindBlastTimer -= uiDiff; @@ -915,19 +911,19 @@ class mob_toc_shadow_priest : public CreatureScript switch (urand(0, 4)) { case 0: case 1: - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(pTarget, SPELL_MIND_FLAY); break; case 2: - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(pTarget, SPELL_VAMPIRIC_TOUCH); break; case 3: - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(pTarget, SPELL_SW_PAIN); break; case 4: - if (Unit *pTarget = urand(0, 1) ? SelectUnit(SELECT_TARGET_RANDOM, 0) : DoSelectLowestHpFriendly(40.0f)) + if (Unit *pTarget = urand(0, 1) ? SelectTarget(SELECT_TARGET_RANDOM, 0) : DoSelectLowestHpFriendly(40.0f)) DoCast(pTarget, SPELL_DISPEL); break; } @@ -986,7 +982,7 @@ class mob_toc_warlock : public CreatureScript SetEquipmentSlots(false, 49992, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE); m_uiSummonPetTimer = urand(15*IN_MILLISECONDS, 30*IN_MILLISECONDS); - DoCast(SPELL_SUMMON_FELHUNTER); + DoCast(me, SPELL_SUMMON_FELHUNTER, true); } void UpdateAI(const uint32 uiDiff) @@ -995,7 +991,7 @@ class mob_toc_warlock : public CreatureScript if (m_uiFearTimer <= uiDiff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(pTarget, SPELL_FEAR); m_uiFearTimer = urand(4*IN_MILLISECONDS, 15*IN_MILLISECONDS); } else m_uiFearTimer -= uiDiff; @@ -1009,7 +1005,7 @@ class mob_toc_warlock : public CreatureScript if (m_uiUnstableAfflictionTimer <= uiDiff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(pTarget, SPELL_UNSTABLE_AFFLICTION); m_uiUnstableAfflictionTimer = urand(2*IN_MILLISECONDS, 10*IN_MILLISECONDS); } else m_uiUnstableAfflictionTimer -= uiDiff; @@ -1036,7 +1032,7 @@ class mob_toc_warlock : public CreatureScript DoCastVictim(SPELL_CURSE_OF_AGONY); break; case 5: - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(pTarget, SPELL_CURSE_OF_EXHAUSTION); break; } @@ -1122,7 +1118,7 @@ class mob_toc_mage : public CreatureScript if (m_uiPolymorphTimer <= uiDiff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(pTarget, SPELL_POLYMORPH); m_uiPolymorphTimer = urand(15*IN_MILLISECONDS, 40*IN_MILLISECONDS); } else m_uiPolymorphTimer -= uiDiff; @@ -1200,7 +1196,7 @@ class mob_toc_hunter : public CreatureScript SetEquipmentSlots(false, 47156, EQUIP_NO_CHANGE, 48711); m_uiSummonPetTimer = urand(15*IN_MILLISECONDS, 30*IN_MILLISECONDS); - DoCast(SPELL_CALL_PET); + DoCast(me, SPELL_CALL_PET, true); } void UpdateAI(const uint32 uiDiff) @@ -1324,14 +1320,14 @@ class mob_toc_boomkin : public CreatureScript if (m_uiCycloneTimer <= uiDiff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(pTarget, SPELL_CYCLONE); m_uiCycloneTimer = urand(5*IN_MILLISECONDS, 40*IN_MILLISECONDS); } else m_uiCycloneTimer -= uiDiff; if (m_uiEntanglingRootsTimer <= uiDiff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(pTarget, SPELL_ENTANGLING_ROOTS); m_uiEntanglingRootsTimer = urand(5*IN_MILLISECONDS, 40*IN_MILLISECONDS); } else m_uiEntanglingRootsTimer -= uiDiff; @@ -1546,7 +1542,7 @@ class mob_toc_dk : public CreatureScript if (m_uiChainsOfIceTimer <= uiDiff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(pTarget, SPELL_CHAINS_OF_ICE); m_uiChainsOfIceTimer = urand(5*IN_MILLISECONDS, 15*IN_MILLISECONDS); } else m_uiChainsOfIceTimer -= uiDiff; @@ -1667,7 +1663,7 @@ class mob_toc_rogue : public CreatureScript if (m_uiBlindTimer <= uiDiff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1)) if (me->IsInRange(pTarget, 0.0f, 15.0f, false)) DoCast(pTarget, SPELL_BLIND); m_uiBlindTimer = urand(7*IN_MILLISECONDS, 8*IN_MILLISECONDS); @@ -1878,7 +1874,7 @@ class mob_toc_retro_paladin : public CreatureScript if (m_uiRepeteanceTimer <= uiDiff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(pTarget, SPELL_REPENTANCE); m_uiRepeteanceTimer = 60*IN_MILLISECONDS; } else m_uiRepeteanceTimer -= uiDiff; diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp index 4cc4c82a76737..dd76f00fe4a77 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp @@ -74,7 +74,8 @@ enum BossSpells SPELL_LEGION_FLAME = 66197, SPELL_LEGION_FLAME_EFFECT = 66201, SPELL_SHIVAN_SLASH = 67098, - SPELL_SPINNING_STRIKE = 66283, + SPELL_SPINNING_STRIKE_1 = 66283, + SPELL_SPINNING_STRIKE_2 = 66285, SPELL_MISTRESS_KISS = 67077, SPELL_FEL_INFERNO = 67047, SPELL_FEL_STREAK = 66494, @@ -99,8 +100,9 @@ class boss_jaraxxus : public CreatureScript { boss_jaraxxusAI(Creature* pCreature) : ScriptedAI(pCreature), Summons(me) { + me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true); + me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_GRIP, true); m_pInstance = pCreature->GetInstanceScript(); - Reset(); } InstanceScript* m_pInstance; @@ -174,6 +176,9 @@ class boss_jaraxxus : public CreatureScript void UpdateAI(const uint32 uiDiff) { if (!UpdateVictim()) + return; + + if (me->HasUnitState(UNIT_STAT_CASTING)) return; if (m_uiSummonInfernalEruptionTimer <= uiDiff) @@ -196,12 +201,14 @@ class boss_jaraxxus : public CreatureScript if (m_uiFelFireballTimer <= uiDiff) { + me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, false); DoCastVictim(SPELL_FEL_FIREBALL); m_uiFelFireballTimer = urand(10*IN_MILLISECONDS, 15*IN_MILLISECONDS); } else m_uiFelFireballTimer -= uiDiff; if (m_uiFelLightningTimer <= uiDiff) { + me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, true); if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM)) DoCast(pTarget, SPELL_FEL_LIGHTING); m_uiFelLightningTimer = urand(10*IN_MILLISECONDS, 15*IN_MILLISECONDS); @@ -209,6 +216,7 @@ class boss_jaraxxus : public CreatureScript if (m_uiIncinerateFleshTimer <= uiDiff) { + me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, true); if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 0, true)) { DoScriptText(EMOTE_INCINERATE, me, pTarget); @@ -220,12 +228,14 @@ class boss_jaraxxus : public CreatureScript if (m_uiNetherPowerTimer <= uiDiff) { - DoCast(me, SPELL_NETHER_POWER); + me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, true); + me->SetAuraStack(SPELL_NETHER_POWER, me, RAID_MODE(5, 10, 5, 10)); m_uiNetherPowerTimer = 40*IN_MILLISECONDS; } else m_uiNetherPowerTimer -= uiDiff; if (m_uiLegionFlameTimer <= uiDiff) { + me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, true); if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 0, true)) { DoScriptText(EMOTE_LEGION_FLAME, me, pTarget); @@ -234,9 +244,10 @@ class boss_jaraxxus : public CreatureScript m_uiLegionFlameTimer = 30*IN_MILLISECONDS; } else m_uiLegionFlameTimer -= uiDiff; - if (getDifficulty() == RAID_DIFFICULTY_25MAN_HEROIC && m_uiTouchOfJaraxxusTimer <= uiDiff) + if (GetDifficulty() == RAID_DIFFICULTY_25MAN_HEROIC && m_uiTouchOfJaraxxusTimer <= uiDiff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, true); + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(pTarget, SPELL_TOUCH_OF_JARAXXUS); m_uiTouchOfJaraxxusTimer = urand(10*IN_MILLISECONDS, 15*IN_MILLISECONDS); } else m_uiTouchOfJaraxxusTimer -= uiDiff; @@ -398,7 +409,7 @@ class mob_fel_infernal : public CreatureScript if (m_uiFelStreakTimer <= uiDiff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(pTarget, SPELL_FEL_STREAK); m_uiFelStreakTimer = 30*IN_MILLISECONDS; } else m_uiFelStreakTimer -= uiDiff; @@ -535,7 +546,11 @@ class mob_mistress_of_pain : public CreatureScript if (m_uiSpinningStrikeTimer <= uiDiff) { if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 0, true)) - DoCast(pTarget, SPELL_SPINNING_STRIKE); + { + DoCast(pTarget,SPELL_SPINNING_STRIKE_1); + DoCast(pTarget,SPELL_SPINNING_STRIKE_2); + pTarget->CastSpell(me, 66287, true); + } m_uiSpinningStrikeTimer = 30*IN_MILLISECONDS; } else m_uiSpinningStrikeTimer -= uiDiff; @@ -552,6 +567,42 @@ class mob_mistress_of_pain : public CreatureScript }; + +class spell_spinning_pain_strike : public SpellScriptLoader +{ +public: + spell_spinning_pain_strike() : SpellScriptLoader("spell_spinning_pain_strike") { } + + class spell_spinning_pain_strike_SpellScript : public SpellScript + { + public: + PrepareSpellScript(spell_spinning_pain_strike_SpellScript) + bool Validate(SpellEntry const * /*spellEntry*/) + { + return true; + } + + void CalcDamage(SpellEffIndex /*effIndex*/) + { + uint32 dmg = 0; + if(Unit* pTarget = GetHitUnit()) + dmg = ((float)pTarget->GetMaxHealth())*50.0f/100.0f; + SetHitDamage(dmg); + } + + void Register() + { + OnEffect += SpellEffectFn(spell_spinning_pain_strike_SpellScript::CalcDamage, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_spinning_pain_strike_SpellScript(); + } +}; + + void AddSC_boss_jaraxxus() { new boss_jaraxxus(); @@ -560,4 +611,5 @@ void AddSC_boss_jaraxxus() new mob_fel_infernal(); new mob_nether_portal(); new mob_mistress_of_pain(); + new spell_spinning_pain_strike(); } diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp index 57c457044c5f7..2adc006b4941b 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp @@ -123,6 +123,8 @@ class boss_gormok : public CreatureScript { boss_gormokAI(Creature* pCreature) : ScriptedAI(pCreature), Summons(me) { + me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true); + me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_GRIP, true); m_pInstance = (InstanceScript*)pCreature->GetInstanceScript(); } @@ -140,8 +142,8 @@ class boss_gormok : public CreatureScript m_uiStaggeringStompTimer = 15*IN_MILLISECONDS; m_uiSummonTimer = urand(15*IN_MILLISECONDS, 30*IN_MILLISECONDS);; - if (getDifficulty() == RAID_DIFFICULTY_25MAN_NORMAL || - getDifficulty() == RAID_DIFFICULTY_25MAN_HEROIC) + if (GetDifficulty() == RAID_DIFFICULTY_25MAN_NORMAL || + GetDifficulty() == RAID_DIFFICULTY_25MAN_HEROIC) m_uiSummonCount = 5; else m_uiSummonCount = 4; @@ -224,7 +226,6 @@ class boss_gormok : public CreatureScript }; - class mob_snobold_vassal : public CreatureScript { public: @@ -319,7 +320,7 @@ class mob_snobold_vassal : public CreatureScript m_bTargetDied = true; me->GetMotionMaster()->MoveJump(gormok->GetPositionX(), gormok->GetPositionY(), gormok->GetPositionZ(), 15.0f, 15.0f); } - else if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + else if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) { m_uiTargetGUID = target->GetGUID(); me->GetMotionMaster()->MoveJump(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 15.0f, 15.0f); @@ -330,7 +331,7 @@ class mob_snobold_vassal : public CreatureScript if (m_uiFireBombTimer < uiDiff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(pTarget, SPELL_FIRE_BOMB); m_uiFireBombTimer = 20000; } @@ -358,11 +359,12 @@ class mob_snobold_vassal : public CreatureScript }; - struct boss_jormungarAI : public ScriptedAI { boss_jormungarAI(Creature* creature) : ScriptedAI(creature) { + me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true); + me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_GRIP, true); instanceScript = creature->GetInstanceScript(); } @@ -502,7 +504,7 @@ struct boss_jormungarAI : public ScriptedAI case 4: // Stationary if (sprayTimer <= uiDiff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(pTarget, spraySpell); sprayTimer = urand(15*IN_MILLISECONDS, 30*IN_MILLISECONDS); } else sprayTimer -= uiDiff; @@ -571,7 +573,6 @@ struct boss_jormungarAI : public ScriptedAI bool enraged; }; - class boss_acidmaw : public CreatureScript { public: @@ -604,7 +605,6 @@ class boss_acidmaw : public CreatureScript } }; - class boss_dreadscale : public CreatureScript { public: @@ -636,7 +636,6 @@ class boss_dreadscale : public CreatureScript } }; - class mob_slime_pool : public CreatureScript { public: @@ -686,6 +685,8 @@ class boss_icehowl : public CreatureScript { boss_icehowlAI(Creature* pCreature) : ScriptedAI(pCreature) { + me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true); + me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_GRIP, true); m_pInstance = (InstanceScript*)pCreature->GetInstanceScript(); } @@ -805,7 +806,7 @@ class boss_icehowl : public CreatureScript if (m_uiArticBreathTimer <= uiDiff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(pTarget, SPELL_ARCTIC_BREATH); m_uiArticBreathTimer = urand(25*IN_MILLISECONDS, 40*IN_MILLISECONDS); } else m_uiArticBreathTimer -= uiDiff; @@ -909,7 +910,6 @@ class boss_icehowl : public CreatureScript }; - void AddSC_boss_northrend_beasts() { new boss_gormok(); diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp index e2ea299e66a45..2ae30fb9ff365 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp @@ -94,6 +94,11 @@ enum BossSpells SPELL_UNLEASHED_DARK = 65808, SPELL_UNLEASHED_LIGHT = 65795, //PowerUp 67604 + + SPELL_POWERING_UP_1 = 67590, + SPELL_POWERING_UP_2 = 67602, + SPELL_POWERING_UP_3 = 67603, + SPELL_POWERING_UP_4 = 67604, }; enum Actions @@ -102,7 +107,6 @@ enum Actions ACTION_PACT }; - /*###### ## boss_twin_base ######*/ @@ -111,7 +115,10 @@ struct boss_twin_baseAI : public ScriptedAI { boss_twin_baseAI(Creature* pCreature) : ScriptedAI(pCreature), Summons(me) { + me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true); + me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_GRIP, true); m_pInstance = (InstanceScript*)pCreature->GetInstanceScript(); + m_bIsWipe = false; } InstanceScript* m_pInstance; @@ -119,6 +126,7 @@ struct boss_twin_baseAI : public ScriptedAI uint8 m_uiStage; bool m_bIsBerserk; + bool m_bIsWipe; uint8 m_uiWaveCount; uint32 m_uiColorballsTimer; uint32 m_uiSpecialAbilityTimer; @@ -126,8 +134,8 @@ struct boss_twin_baseAI : public ScriptedAI uint32 m_uiTouchTimer; uint32 m_uiBerserkTimer; - uint32 m_uiVortexSay; - uint32 m_uiVortexEmote; + int32 m_uiVortexSay; + int32 m_uiVortexEmote; uint32 m_uiSisterNpcId; uint32 m_uiColorballNpcId; uint32 m_uiEssenceNpcId; @@ -160,16 +168,14 @@ struct boss_twin_baseAI : public ScriptedAI m_uiBerserkTimer = IsHeroic() ? 6*MINUTE*IN_MILLISECONDS : 10*MINUTE*IN_MILLISECONDS; Summons.DespawnAll(); - } - - void JustReachedHome() - { - if (m_pInstance) + + if (m_bIsWipe) { - m_pInstance->SetData(TYPE_VALKIRIES, FAIL); - m_pInstance->SetData(DATA_HEALTH_TWIN_SHARED, me->GetMaxHealth()); + if (m_pInstance) + m_pInstance->SetData(TYPE_VALKIRIES, FAIL); + + me->DespawnOrUnsummon(); } - me->DespawnOrUnsummon(); } void MovementInform(uint32 uiType, uint32 uiId) @@ -243,7 +249,7 @@ struct boss_twin_baseAI : public ScriptedAI if (pDoneBy->GetGUID() == me->GetGUID()) return; - if (pDoneBy->GetTypeId() == TYPEID_PLAYER) + if (pDoneBy->ToPlayer()) { if (pDoneBy->HasAura(m_uiOtherEssenceSpellId)) uiDamage += uiDamage/2; @@ -255,15 +261,24 @@ struct boss_twin_baseAI : public ScriptedAI } if (m_pInstance) - m_pInstance->SetData(DATA_HEALTH_TWIN_SHARED, me->GetHealth() >= uiDamage ? me->GetHealth() - uiDamage : 0); + { + if (Creature* pSister = GetSister()) + { + pSister->DealDamage(pSister, uiDamage); + pSister->LowerPlayerDamageReq(uiDamage); + } + } } void SpellHit(Unit* caster, const SpellEntry* spell) { - if (caster->ToCreature() == me) - if (spell->Effect[0] == 136) //Effect Heal + if (caster->GetGUID() == me->GetGUID()) + if (spell->Effect[0] == 136) // Effect Heal if (m_pInstance) - m_pInstance->SetData(DATA_HEALTH_TWIN_SHARED, me->GetHealth() + me->CountPctFromMaxHealth(spell->EffectBasePoints[0])); + { + if (Creature* pSister = GetSister()) + pSister->DealHeal(pSister, spell->EffectBasePoints[0]); + } } void SummonColorballs(uint8 quantity) @@ -286,7 +301,6 @@ struct boss_twin_baseAI : public ScriptedAI DoScriptText(SAY_DEATH, me); if (m_pInstance) { - m_pInstance->SetData(DATA_HEALTH_TWIN_SHARED, 0); if (Creature* pSister = GetSister()) { if (!pSister->isAlive()) @@ -308,19 +322,14 @@ struct boss_twin_baseAI : public ScriptedAI void EnterCombat(Unit* /*pWho*/) { + DoScriptText(SAY_AGGRO, me); + DoCast(me, m_uiSurgeSpellId); me->SetInCombatWithZone(); + m_bIsWipe = true; + me->SummonCreature(m_uiEssenceNpcId, EssenceLocation[0].GetPositionX(), EssenceLocation[0].GetPositionY(), EssenceLocation[0].GetPositionZ()); + me->SummonCreature(m_uiEssenceNpcId, EssenceLocation[1].GetPositionX(), EssenceLocation[1].GetPositionY(), EssenceLocation[1].GetPositionZ()); if (m_pInstance) - { m_pInstance->SetData(TYPE_VALKIRIES, IN_PROGRESS); - m_pInstance->SetData(DATA_HEALTH_TWIN_SHARED, me->GetMaxHealth()); - } - if (me->isAlive()) - { - me->SummonCreature(m_uiEssenceNpcId, EssenceLocation[0].GetPositionX(), EssenceLocation[0].GetPositionY(), EssenceLocation[0].GetPositionZ()); - me->SummonCreature(m_uiEssenceNpcId, EssenceLocation[1].GetPositionX(), EssenceLocation[1].GetPositionY(), EssenceLocation[1].GetPositionZ()); - } - DoScriptText(SAY_AGGRO, me); - DoCast(me, m_uiSurgeSpellId); } void DoAction(const int32 action) @@ -342,11 +351,6 @@ struct boss_twin_baseAI : public ScriptedAI if (!m_pInstance || !UpdateVictim()) return; - if (m_pInstance->GetData(DATA_HEALTH_TWIN_SHARED) != 0) - me->SetHealth(m_pInstance->GetData(DATA_HEALTH_TWIN_SHARED)); - else - me->SetHealth(1); - switch (m_uiStage) { case 0: @@ -490,7 +494,6 @@ class boss_fjola : public CreatureScript }; - /*###### ## boss_eydis ######*/ @@ -536,7 +539,6 @@ class boss_eydis : public CreatureScript }; - class mob_essence_of_twin : public CreatureScript { public: @@ -562,7 +564,6 @@ class mob_essence_of_twin : public CreatureScript } }; - struct mob_unleashed_ballAI : public ScriptedAI { mob_unleashed_ballAI(Creature *pCreature) : ScriptedAI(pCreature) @@ -626,6 +627,22 @@ class mob_unleashed_dark : public CreatureScript { mob_unleashed_darkAI(Creature *pCreature) : mob_unleashed_ballAI(pCreature) {} + void SpellHitTarget(Unit* pWho, const SpellEntry* spell) + { + if (spell->Id == SPELL_UNLEASHED_DARK && pWho->HasAura(SPELL_DARK_ESSENCE)) + { + pWho->CastSpell(pWho, RAID_MODE(SPELL_POWERING_UP_1, SPELL_POWERING_UP_2, SPELL_POWERING_UP_3, SPELL_POWERING_UP_4), true); + int n = 5 + rand() % 8; + if(Aura * aura = pWho->GetAura(RAID_MODE(SPELL_POWERING_UP_1, SPELL_POWERING_UP_2, SPELL_POWERING_UP_3, SPELL_POWERING_UP_4))) + { + if(aura->GetStackAmount()+n > 100) + aura->SetStackAmount(100, true); + else + aura->SetStackAmount(aura->GetStackAmount()+n, true); + } + } + } + void UpdateAI(const uint32 uiDiff) { if (m_uiRangeCheckTimer < uiDiff) @@ -635,7 +652,7 @@ class mob_unleashed_dark : public CreatureScript { DoCastAOE(SPELL_UNLEASHED_DARK); me->GetMotionMaster()->MoveIdle(); - me->DespawnOrUnsummon(500); + me->DespawnOrUnsummon(1000); } m_uiRangeCheckTimer = IN_MILLISECONDS; } @@ -645,7 +662,6 @@ class mob_unleashed_dark : public CreatureScript }; - class mob_unleashed_light : public CreatureScript { public: @@ -660,6 +676,22 @@ class mob_unleashed_light : public CreatureScript { mob_unleashed_lightAI(Creature *pCreature) : mob_unleashed_ballAI(pCreature) {} + void SpellHitTarget(Unit* pWho, const SpellEntry* spell) + { + if (spell->Id == SPELL_UNLEASHED_LIGHT && pWho->HasAura(SPELL_LIGHT_ESSENCE)) + { + pWho->CastSpell(pWho, RAID_MODE(SPELL_POWERING_UP_1, SPELL_POWERING_UP_2, SPELL_POWERING_UP_3, SPELL_POWERING_UP_4), true); + int n = 5 + rand() % 8; + if(Aura * aura = pWho->GetAura(RAID_MODE(SPELL_POWERING_UP_1, SPELL_POWERING_UP_2, SPELL_POWERING_UP_3, SPELL_POWERING_UP_4))) + { + if(aura->GetStackAmount()+n > 100) + aura->SetStackAmount(100, true); + else + aura->SetStackAmount(aura->GetStackAmount()+n, true); + } + } + } + void UpdateAI(const uint32 uiDiff) { if (m_uiRangeCheckTimer < uiDiff) @@ -669,7 +701,7 @@ class mob_unleashed_light : public CreatureScript { DoCastAOE(SPELL_UNLEASHED_LIGHT); me->GetMotionMaster()->MoveIdle(); - me->DespawnOrUnsummon(500); + me->DespawnOrUnsummon(1000); } m_uiRangeCheckTimer = IN_MILLISECONDS; } @@ -679,7 +711,135 @@ class mob_unleashed_light : public CreatureScript }; +enum ePoweringUp +{ + SPELL_SURGE_OF_SPEED_1 = 65828, + SPELL_SURGE_OF_SPEED_2 = 67241, + SPELL_SURGE_OF_SPEED_3 = 67242, + SPELL_SURGE_OF_SPEED_4 = 67243, + SPELL_EMPOWERED_DARKNESS_1 = 65724, + SPELL_EMPOWERED_DARKNESS_2 = 67213, + SPELL_EMPOWERED_DARKNESS_3 = 67214, + SPELL_EMPOWERED_DARKNESS_4 = 67215, + SPELL_EMPOWERED_LIGHT_1 = 65748, + SPELL_EMPOWERED_LIGHT_2 = 67216, + SPELL_EMPOWERED_LIGHT_3 = 67217, + SPELL_EMPOWERED_LIGHT_4 = 67218, +}; + +class spell_powering_up : public SpellScriptLoader +{ +public: + spell_powering_up() : SpellScriptLoader("spell_powering_up") { } + class spell_powering_up_AuraScript : public AuraScript + { + PrepareAuraScript(spell_powering_up_AuraScript); + + void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (Unit* pTarget = GetTarget()) + { + if (Aura* pAura = pTarget->GetAura(GetId())) + { + if (pAura->GetStackAmount() == 100) + { + if (pTarget->HasAura(SPELL_DARK_ESSENCE)) + { + switch(GetId()) + { + case SPELL_POWERING_UP_1: + pTarget->CastSpell(pTarget, SPELL_EMPOWERED_DARKNESS_1, true) ; + break; + case SPELL_POWERING_UP_2: + pTarget->CastSpell(pTarget, SPELL_EMPOWERED_DARKNESS_2, true) ; + break; + case SPELL_POWERING_UP_3: + pTarget->CastSpell(pTarget, SPELL_EMPOWERED_DARKNESS_3, true) ; + break; + case SPELL_POWERING_UP_4: + pTarget->CastSpell(pTarget, SPELL_EMPOWERED_DARKNESS_4, true) ; + break; + } + } + if (pTarget->HasAura(SPELL_LIGHT_ESSENCE)) + { + switch(GetId()) + { + case SPELL_POWERING_UP_1: + pTarget->CastSpell(pTarget, SPELL_EMPOWERED_LIGHT_1, true) ; + break; + case SPELL_POWERING_UP_2: + pTarget->CastSpell(pTarget, SPELL_EMPOWERED_LIGHT_2, true) ; + break; + case SPELL_POWERING_UP_3: + pTarget->CastSpell(pTarget, SPELL_EMPOWERED_LIGHT_3, true) ; + break; + case SPELL_POWERING_UP_4: + pTarget->CastSpell(pTarget, SPELL_EMPOWERED_LIGHT_4, true) ; + break; + } + } + pTarget->RemoveAurasDueToSpell(GetId()); + } + } + } + } + + void Register() + { + OnEffectApply += AuraEffectApplyFn(spell_powering_up_AuraScript::OnApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_powering_up_AuraScript(); + } + + class spell_powering_up_SpellScript : public SpellScript + { + public: + PrepareSpellScript(spell_powering_up_SpellScript) + bool Validate(SpellEntry const * /*spellEntry*/) + { + return true; + } + + void HandleScriptEffect(SpellEffIndex /*effIndex*/) + { + if (Unit* pTarget = GetTargetUnit()) + if (rand()%100 < 30) + { + switch(GetSpellInfo()->Id) + { + case SPELL_POWERING_UP_1: + pTarget->CastSpell(pTarget, SPELL_SURGE_OF_SPEED_1, true) ; + break; + case SPELL_POWERING_UP_2: + pTarget->CastSpell(pTarget, SPELL_SURGE_OF_SPEED_2, true) ; + break; + case SPELL_POWERING_UP_3: + pTarget->CastSpell(pTarget, SPELL_SURGE_OF_SPEED_3, true) ; + break; + case SPELL_POWERING_UP_4: + pTarget->CastSpell(pTarget, SPELL_SURGE_OF_SPEED_4, true) ; + break; + } + } + } + + void Register() + { + OnEffect += SpellEffectFn(spell_powering_up_SpellScript::HandleScriptEffect, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_powering_up_SpellScript(); + } +}; void AddSC_boss_twin_valkyr() { new boss_fjola(); @@ -687,4 +847,5 @@ void AddSC_boss_twin_valkyr() new mob_unleashed_light(); new mob_unleashed_dark(); new mob_essence_of_twin(); + new spell_powering_up(); } diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp index 408fd2cd7b74e..76ee1d9b01944 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/instance_trial_of_the_crusader.cpp @@ -44,7 +44,6 @@ class instance_trial_of_the_crusader : public InstanceMapScript std::string SaveDataBuffer; bool NeedSave; - uint32 DataDamageTwin; uint32 FjolaCasting; uint32 EydisCasting; @@ -89,7 +88,6 @@ class instance_trial_of_the_crusader : public InstanceMapScript EventStage = 0; TributeChestGUID = 0; - DataDamageTwin = 0; MainGateDoorGUID = 0; EastPortcullisGUID = 0; @@ -267,6 +265,10 @@ class instance_trial_of_the_crusader : public InstanceMapScript case TYPE_VALKIRIES: switch (data) { + case IN_PROGRESS: + if(GameObject* chest = instance->GetGameObject(CrusadersCacheGUID)) + chest->Delete(); + break; case FAIL: if (EncounterStatus[TYPE_VALKIRIES] == NOT_STARTED) data = NOT_STARTED; @@ -368,10 +370,6 @@ class instance_trial_of_the_crusader : public InstanceMapScript break; } break; - case DATA_HEALTH_TWIN_SHARED: - DataDamageTwin = data; - data = NOT_STARTED; - break; //Achievements case DATA_SNOBOLD_COUNT: @@ -584,8 +582,6 @@ class instance_trial_of_the_crusader : public InstanceMapScript break; }; return EventNPCId; - case DATA_HEALTH_TWIN_SHARED: - return DataDamageTwin; default: break; } diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp index 8aa05c87c6c62..421d6bd786118 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp @@ -168,6 +168,9 @@ class npc_announcer_toc10 : public CreatureScript } break; case GOSSIP_ACTION_INFO_DEF+2: + if (Creature* icehowl = Unit::GetCreature(*player, instanceScript->GetData64(NPC_ICEHOWL))) + icehowl->DespawnOrUnsummon(); + if (Creature* jaraxxus = Unit::GetCreature(*player, instanceScript->GetData64(NPC_JARAXXUS))) { jaraxxus->RemoveAurasDueToSpell(SPELL_JARAXXUS_CHAINS); @@ -182,6 +185,9 @@ class npc_announcer_toc10 : public CreatureScript } break; case GOSSIP_ACTION_INFO_DEF+3: + if (Creature* jaraxxus = Unit::GetCreature(*player, instanceScript->GetData64(NPC_JARAXXUS))) + jaraxxus->DespawnOrUnsummon(); + if (instanceScript->GetData(TYPE_CRUSADERS) != DONE) { if (player->GetTeam() == ALLIANCE) @@ -204,7 +210,7 @@ class npc_announcer_toc10 : public CreatureScript return true; if (GameObject* floor = GameObject::GetGameObject(*player, instanceScript->GetData64(GO_ARGENT_COLISEUM_FLOOR))) - floor->TakenDamage(1000000); + floor->TakenDamage(10000001); creature->CastSpell(creature, 69016, false); @@ -319,7 +325,7 @@ class boss_lich_king_toc : public CreatureScript break; case 5080: if (GameObject* pGoFloor = m_pInstance->instance->GetGameObject(m_pInstance->GetData64(GO_ARGENT_COLISEUM_FLOOR))) - pGoFloor->TakenDamage(1000000); + pGoFloor->TakenDamage(10000001); me->CastSpell(me, 69016, false); if (m_pInstance) m_pInstance->SetData(TYPE_LICH_KING, DONE); Creature* pTemp = Unit::GetCreature((*me), m_pInstance->GetData64(NPC_ANUBARAK)); @@ -793,6 +799,7 @@ class npc_tirion_toc : public CreatureScript break; case 6005: DoScriptText(SAY_STAGE_4_06, me); + me->SummonGameObject(202079, 651.71f, 149.18f, 140.79f, 3.14f, 0, 0, 1, 1, 604800); m_uiUpdateTimer = 20000; m_pInstance->SetData(TYPE_EVENT, 6010); break; diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.h b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.h index ab9087c0ca880..7a8f9358d316a 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.h +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.h @@ -22,8 +22,6 @@ enum TYPE_EVENT_NPC = 102, TYPE_NORTHREND_BEASTS = 103, - DATA_HEALTH_TWIN_SHARED = 201, - DATA_SNOBOLD_COUNT = 301, DATA_MISTRESS_OF_PAIN_COUNT = 302, DATA_TRIBUTE_TO_IMMORTALITY_ELEGIBLE = 303, @@ -207,10 +205,10 @@ enum eCreature NPC_HORDE_WARLOCK = 34450, NPC_HORDE_WARRIOR = 34453, - NPC_LIGHTBANE = 34497, - NPC_DARKBANE = 34496, + NPC_LIGHTBANE = 34497, + NPC_DARKBANE = 34496, - NPC_ANUBARAK = 34564, + NPC_ANUBARAK = 34564, }; enum eGameObject diff --git a/src/server/scripts/Northrend/DraktharonKeep/boss_tharon_ja.cpp b/src/server/scripts/Northrend/DraktharonKeep/boss_tharon_ja.cpp index 745877eaafff4..11ebbb6199bfd 100644 --- a/src/server/scripts/Northrend/DraktharonKeep/boss_tharon_ja.cpp +++ b/src/server/scripts/Northrend/DraktharonKeep/boss_tharon_ja.cpp @@ -250,7 +250,6 @@ class boss_tharon_ja : public CreatureScript } }; - void AddSC_boss_tharon_ja() { new boss_tharon_ja; 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 f1f71bf31aa3d..00c674907db19 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 @@ -269,12 +269,12 @@ class boss_devourer_of_souls : public CreatureScript events.ScheduleEvent(EVENT_MIRRORED_SOUL, urand(15000, 30000)); break; case EVENT_WELL_OF_SOULS: - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(target, SPELL_WELL_OF_SOULS); events.ScheduleEvent(EVENT_WELL_OF_SOULS, 20000); break; case EVENT_UNLEASHED_SOULS: - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(target, SPELL_UNLEASHED_SOULS); me->SetDisplayId(DISPLAY_SORROW); DoScriptText(RAND(SAY_FACE_ANGER_UNLEASH_SOUL, SAY_FACE_SORROW_UNLEASH_SOUL, SAY_FACE_DESIRE_UNLEASH_SOUL), me); @@ -291,7 +291,7 @@ class boss_devourer_of_souls : public CreatureScript DoScriptText(RAND(SAY_FACE_ANGER_WAILING_SOUL,SAY_FACE_DESIRE_WAILING_SOUL), me); DoScriptText(EMOTE_WAILING_SOUL, me); DoCast(me, SPELL_WAILING_SOULS_STARTING); - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) { me->SetOrientation(me->GetAngle(target)); DoCast(me, SPELL_WAILING_SOULS_BEAM); 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 eb4a0f6270dec..ef5023c5a3edb 100644 --- a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.cpp @@ -509,7 +509,7 @@ class mob_spectral_warden : public CreatureScript events.RescheduleEvent(EVENT_VEIL_OF_SHADOWS, 10000); return; case EVENT_WAIL_OF_SOULS: - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(target, SPELL_WAIL_OF_SOULS); events.RescheduleEvent(EVENT_WAIL_OF_SOULS, 5000); return; @@ -624,7 +624,7 @@ class mob_soulguard_reaper : public CreatureScript events.RescheduleEvent(EVENT_FROST_NOVA, 9600); return; case EVENT_SHADOW_LANCE: - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(target, SPELL_SHADOW_LANCE); events.RescheduleEvent(EVENT_SHADOW_LANCE, 8000); return; @@ -750,17 +750,17 @@ class mob_soulguard_animator : public CreatureScript events.RescheduleEvent(EVENT_RAISE_DEAD, 25000); return; case EVENT_SHADOW_BOLT: - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(target, SPELL_SHADOW_BOLT); events.RescheduleEvent(EVENT_SHADOW_BOLT, 5000); return; case EVENT_SOUL_SICKNESS: - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(target, SPELL_SOUL_SICKNESS); events.RescheduleEvent(EVENT_SOUL_SICKNESS, 10000); return; case EVENT_SOUL_SIPHON: - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(target, SPELL_SOUL_SIPHON); events.RescheduleEvent(EVENT_SOUL_SIPHON, 8000); return; @@ -823,12 +823,12 @@ class mob_soulguard_adept : public CreatureScript events.RescheduleEvent(EVENT_RAISE_DEAD, 25000); return; case EVENT_SHADOW_BOLT: - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(target, SPELL_SHADOW_BOLT); events.RescheduleEvent(EVENT_SHADOW_BOLT, 4000); return; case EVENT_DRAIN_LIFE: - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(target, SPELL_DRAIN_LIFE); events.RescheduleEvent(EVENT_DRAIN_LIFE, 9000); return; diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_falric.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_falric.cpp index c377b899dff39..d0e1794be95c9 100644 --- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_falric.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_falric.cpp @@ -140,7 +140,6 @@ class boss_falric : public CreatureScript }; - void AddSC_boss_falric() { new boss_falric(); diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_marwyn.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_marwyn.cpp index 4049561eb0037..c8c512e8d98fb 100644 --- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_marwyn.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_marwyn.cpp @@ -131,7 +131,6 @@ class boss_marwyn : public CreatureScript }; - void AddSC_boss_marwyn() { new boss_marwyn(); 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 6441b72b2242b..373ad249f9b0c 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 @@ -218,7 +218,6 @@ class instance_halls_of_reflection : public InstanceMapScript return; } - if (uiWaveCount && data == NOT_STARTED) DoWipe(); @@ -423,7 +422,6 @@ class instance_halls_of_reflection : public InstanceMapScript }; - void AddSC_instance_halls_of_reflection() { new instance_halls_of_reflection(); 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 e44c3ebdadfb1..d7f20de04d99e 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_forgemaster_garfrost.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_forgemaster_garfrost.cpp @@ -194,7 +194,7 @@ class boss_garfrost : public CreatureScript switch (eventId) { case EVENT_THROW_SARONITE: - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(target, SPELL_THROW_SARONITE); events.ScheduleEvent(EVENT_THROW_SARONITE, urand(12500, 20000)); break; @@ -203,7 +203,7 @@ class boss_garfrost : public CreatureScript events.ScheduleEvent(EVENT_CHILLING_WAVE, 40000, 0, PHASE_TWO); break; case EVENT_DEEP_FREEZE: - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(target, SPELL_DEEP_FREEZE); events.ScheduleEvent(EVENT_DEEP_FREEZE, 35000, 0, PHASE_THREE); break; diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp index b7fa040b1bfc7..7a1a97539a4bb 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp @@ -162,7 +162,7 @@ class boss_ick : public CreatureScript void EnterCombat(Unit * /*who*/) { - _vehicle->InstallAllAccessories(me->GetEntry()); + _vehicle->InstallAllAccessories(); if (Creature* krick = GetKrick()) DoScriptText(SAY_KRICK_AGGRO, krick); @@ -226,13 +226,13 @@ class boss_ick : public CreatureScript { case EVENT_TOXIC_WASTE: if (Creature* krick = GetKrick()) - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) krick->CastSpell(target, SPELL_TOXIC_WASTE, false); events.ScheduleEvent(EVENT_TOXIC_WASTE, urand(7000, 10000)); break; case EVENT_SHADOW_BOLT: if (Creature* krick = GetKrick()) - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1)) + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1)) krick->CastSpell(target, SPELL_SHADOW_BOLT, false); events.ScheduleEvent(EVENT_SHADOW_BOLT, 15000); return; 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 cd436e1dc8fe3..440666581c080 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_scourgelord_tyrannus.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_scourgelord_tyrannus.cpp @@ -301,7 +301,7 @@ class boss_rimefang : public CreatureScript void JustReachedHome() { - _vehicle->InstallAllAccessories(me->GetEntry()); + _vehicle->InstallAllAccessories(); } void DoAction(const int32 actionId) @@ -345,7 +345,7 @@ class boss_rimefang : public CreatureScript _events.ScheduleEvent(EVENT_MOVE_NEXT, 2000, 0, PHASE_COMBAT); break; case EVENT_ICY_BLAST: - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(target, SPELL_ICY_BLAST); _events.ScheduleEvent(EVENT_ICY_BLAST, 15000, 0, PHASE_COMBAT); break; 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 5dc37e54234a9..2bf8876572f19 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 @@ -18,6 +18,11 @@ #include "ScriptPCH.h" #include "pit_of_saron.h" +// positions for Martin Victus (37591) and Gorkun Ironskull (37592) +Position const SlaveLeaderPos = {689.7158f, -104.8736f, 513.7360f, 0.0f}; +// position for Jaina and Sylvanas +Position const EventLeaderPos2 = {1054.368f, 107.14620f, 628.4467f, 0.0f}; + class instance_pit_of_saron : public InstanceMapScript { public: @@ -149,6 +154,44 @@ class instance_pit_of_saron : public InstanceMapScript } } + bool SetBossState(uint32 type, EncounterState state) + { + if (!InstanceScript::SetBossState(type, state)) + return false; + + switch (type) + { + case DATA_GARFROST: + if(state == DONE) + { + if (Creature* summoner = instance->GetCreature(_garfrostGUID)) + { + if (_teamInInstance == ALLIANCE) + summoner->SummonCreature(NPC_MARTIN_VICTUS_1, SlaveLeaderPos, TEMPSUMMON_MANUAL_DESPAWN); + else + summoner->SummonCreature(NPC_GORKUN_IRONSKULL_2, SlaveLeaderPos, TEMPSUMMON_MANUAL_DESPAWN); + } + } + break; + case DATA_TYRANNUS: + if (state == DONE) + { + if (Creature* summoner = instance->GetCreature(_tyrannusGUID)) + { + if (_teamInInstance == ALLIANCE) + summoner->SummonCreature(NPC_JAINA_PART2, EventLeaderPos2, TEMPSUMMON_MANUAL_DESPAWN); + else + summoner->SummonCreature(NPC_SYLVANAS_PART2, EventLeaderPos2, TEMPSUMMON_MANUAL_DESPAWN); + } + } + break; + default: + break; + } + + return true; + } + uint32 GetData(uint32 type) { switch (type) 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 3b1da15593845..3e0a35cd1cab4 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp @@ -79,12 +79,12 @@ class mob_ymirjar_flamebearer : public CreatureScript switch (eventId) { case EVENT_FIREBALL: - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(target, SPELL_FIREBALL); _events.RescheduleEvent(EVENT_FIREBALL, 5000); break; case EVENT_TACTICAL_BLINK: - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(target, SPELL_TACTICAL_BLINK); DoCast(me, SPELL_HELLFIRE); _events.RescheduleEvent(EVENT_TACTICAL_BLINK, 12000); @@ -284,7 +284,7 @@ class spell_trash_mob_glacial_strike : public SpellScriptLoader { PrepareAuraScript(spell_trash_mob_glacial_strike_AuraScript); - void PeriodicTick(AuraEffect const* aurEff) + void PeriodicTick(AuraEffect const* /*aurEff*/) { if (GetTarget()->IsFullHealth()) { 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 d553a5ca3c6fc..e4282dfa5fadb 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.h +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.h @@ -23,12 +23,14 @@ enum DataTypes { + // Encounter states and GUIDs DATA_GARFROST = 0, - DATA_KRICK = 1, - DATA_ICK = 2, - DATA_TYRANNUS = 3, - DATA_RIMEFANG = 4, + DATA_ICK = 1, + DATA_TYRANNUS = 2, + // GUIDs + DATA_RIMEFANG = 3, + DATA_KRICK = 4, DATA_JAINA_SYLVANAS_1 = 5, // GUID of either Jaina or Sylvanas part 1, depending on team, as it's the same spawn. DATA_JAINA_SYLVANAS_2 = 6, // GUID of either Jaina or Sylvanas part 2, depending on team, as it's the same spawn. DATA_TYRANNUS_EVENT = 7, diff --git a/src/server/scripts/Northrend/Gundrak/boss_drakkari_colossus.cpp b/src/server/scripts/Northrend/Gundrak/boss_drakkari_colossus.cpp index 8c4934b0b04f5..403feb7cf3ef1 100644 --- a/src/server/scripts/Northrend/Gundrak/boss_drakkari_colossus.cpp +++ b/src/server/scripts/Northrend/Gundrak/boss_drakkari_colossus.cpp @@ -106,7 +106,6 @@ class boss_drakkari_colossus : public CreatureScript phase = COLOSSUS_PHASE_NORMAL; - // Note: This should not be called, but before use SetBossState function we should use BossAI // in all the bosses of the instance instance->SetData(DATA_DRAKKARI_COLOSSUS_EVENT, NOT_STARTED); @@ -438,7 +437,6 @@ class npc_living_mojo : public CreatureScript } } - void AttackStart(Unit* attacker) { if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == POINT_MOTION_TYPE) diff --git a/src/server/scripts/Northrend/Gundrak/boss_eck.cpp b/src/server/scripts/Northrend/Gundrak/boss_eck.cpp index 7170da3ad00df..64a32fbfcec66 100644 --- a/src/server/scripts/Northrend/Gundrak/boss_eck.cpp +++ b/src/server/scripts/Northrend/Gundrak/boss_eck.cpp @@ -94,7 +94,7 @@ class boss_eck : public CreatureScript if (uiSpringTimer <= diff) { - Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM,1); + Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM,1); if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER) { DoCast(pTarget, RAND(SPELL_ECK_SPRING_1, SPELL_ECK_SPRING_2)); @@ -133,7 +133,6 @@ class boss_eck : public CreatureScript }; - class npc_ruins_dweller : public CreatureScript { public: @@ -166,7 +165,6 @@ class npc_ruins_dweller : public CreatureScript }; - void AddSC_boss_eck() { new boss_eck(); diff --git a/src/server/scripts/Northrend/Gundrak/boss_gal_darah.cpp b/src/server/scripts/Northrend/Gundrak/boss_gal_darah.cpp index b5b095071bb3f..d5f6bcf5a4b1f 100644 --- a/src/server/scripts/Northrend/Gundrak/boss_gal_darah.cpp +++ b/src/server/scripts/Northrend/Gundrak/boss_gal_darah.cpp @@ -283,7 +283,6 @@ class boss_gal_darah : public CreatureScript }; - void AddSC_boss_gal_darah() { new boss_gal_darah(); diff --git a/src/server/scripts/Northrend/Gundrak/boss_moorabi.cpp b/src/server/scripts/Northrend/Gundrak/boss_moorabi.cpp index 54e9e41a1c193..e39151551a77c 100644 --- a/src/server/scripts/Northrend/Gundrak/boss_moorabi.cpp +++ b/src/server/scripts/Northrend/Gundrak/boss_moorabi.cpp @@ -170,7 +170,6 @@ class boss_moorabi : public CreatureScript }; - void AddSC_boss_moorabi() { new boss_moorabi(); diff --git a/src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp b/src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp index 666e27aed27d1..e6498c889ac18 100644 --- a/src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp +++ b/src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp @@ -265,9 +265,6 @@ class mob_slad_ran_viper : public CreatureScript }; - - - void AddSC_boss_slad_ran() { new boss_slad_ran(); diff --git a/src/server/scripts/Northrend/Gundrak/instance_gundrak.cpp b/src/server/scripts/Northrend/Gundrak/instance_gundrak.cpp index ef105fd7aeacb..b4efcdfe88b3f 100644 --- a/src/server/scripts/Northrend/Gundrak/instance_gundrak.cpp +++ b/src/server/scripts/Northrend/Gundrak/instance_gundrak.cpp @@ -366,7 +366,6 @@ class instance_gundrak : public InstanceMapScript << (uiDrakkariColossusStatue ? GetObjState(uiDrakkariColossusStatue) : GO_STATE_ACTIVE) << " " << (uiGalDarahStatue ? GetObjState(uiGalDarahStatue) : GO_STATE_READY) << " " << (uiBridge ? GetObjState(uiBridge) : GO_STATE_ACTIVE) << " " << (uiCollision ? GetObjState(uiCollision) : GO_STATE_READY); - str_data = saveStream.str(); OUT_SAVE_INST_DATA_COMPLETE; @@ -548,7 +547,6 @@ class go_gundrak_altar : public GameObjectScript }; - void AddSC_instance_gundrak() { new instance_gundrak(); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp index fea3dcd19f18a..45274a71208ff 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp @@ -18,7 +18,6 @@ #include "ObjectMgr.h" #include "ScriptMgr.h" #include "ScriptedCreature.h" -#include "SpellScript.h" #include "SpellAuraEffects.h" #include "icecrown_citadel.h" @@ -182,14 +181,6 @@ class boss_blood_council_controller : public CreatureScript { } - void InitializeAI() - { - if (!instance || static_cast(me->GetMap())->GetScriptId() != GetScriptId(ICCScriptName)) - me->IsAIEnabled = false; - else if (!me->isDead()) - Reset(); - } - void Reset() { events.Reset(); @@ -270,7 +261,7 @@ class boss_blood_council_controller : public CreatureScript void SetData(uint32 /*type*/, uint32 data) { - resetCounter += data; + resetCounter += uint8(data); if (resetCounter == 3) EnterEvadeMode(); } @@ -334,7 +325,7 @@ class boss_blood_council_controller : public CreatureScript if (newPrince) { newPrince->SetHealth(me->GetHealth()); - newPrince->AI()->Talk(invocationOrder[invocationStage].textId); + newPrince->AI()->Talk(uint8(invocationOrder[invocationStage].textId)); } DoCast(me, invocationOrder[invocationStage].spellId); @@ -352,10 +343,10 @@ class boss_blood_council_controller : public CreatureScript { uint64 guid; uint32 spellId; - uint8 textId; + uint32 textId; uint32 visualSpell; - InvocationData(uint64 _guid, uint32 _spellId, int32 _textId, uint32 _visualSpell) + InvocationData(uint64 _guid, uint32 _spellId, uint32 _textId, uint32 _visualSpell) { guid = _guid; spellId = _spellId; @@ -365,13 +356,13 @@ class boss_blood_council_controller : public CreatureScript InvocationData() : guid(0), spellId(0), textId(0), visualSpell(0) { } } invocationOrder[3]; - uint8 invocationStage; - uint8 resetCounter; + uint32 invocationStage; + uint32 resetCounter; }; CreatureAI* GetAI(Creature* creature) const { - return new boss_blood_council_controllerAI(creature); + return GetIcecrownCitadelAI(creature); } }; @@ -394,9 +385,7 @@ class boss_prince_keleseth_icc : public CreatureScript if (data->curhealth) spawnHealth = data->curhealth; - if (!instance || static_cast(me->GetMap())->GetScriptId() != GetScriptId(ICCScriptName)) - me->IsAIEnabled = false; - else if (!me->isDead()) + if (!me->isDead()) JustRespawned(); me->SetReactState(REACT_DEFENSIVE); @@ -564,13 +553,13 @@ class boss_prince_keleseth_icc : public CreatureScript private: static const Position roomCenter; - bool isEmpowered; // bool check faster than map lookup uint32 spawnHealth; + bool isEmpowered; // bool check faster than map lookup }; CreatureAI* GetAI(Creature* creature) const { - return new boss_prince_kelesethAI(creature); + return GetIcecrownCitadelAI(creature); } }; @@ -595,9 +584,7 @@ class boss_prince_taldaram_icc : public CreatureScript if (data->curhealth) spawnHealth = data->curhealth; - if (!instance || static_cast(me->GetMap())->GetScriptId() != GetScriptId(ICCScriptName)) - me->IsAIEnabled = false; - else if (!me->isDead()) + if (!me->isDead()) JustRespawned(); me->SetReactState(REACT_DEFENSIVE); @@ -777,7 +764,7 @@ class boss_prince_taldaram_icc : public CreatureScript CreatureAI* GetAI(Creature* creature) const { - return new boss_prince_taldaramAI(creature); + return GetIcecrownCitadelAI(creature); } }; @@ -800,9 +787,7 @@ class boss_prince_valanar_icc : public CreatureScript if (data->curhealth) spawnHealth = data->curhealth; - if (!instance || static_cast(me->GetMap())->GetScriptId() != GetScriptId(ICCScriptName)) - me->IsAIEnabled = false; - else if (!me->isDead()) + if (!me->isDead()) JustRespawned(); me->SetReactState(REACT_DEFENSIVE); @@ -1001,7 +986,7 @@ class boss_prince_valanar_icc : public CreatureScript CreatureAI* GetAI(Creature* creature) const { - return new boss_prince_valanarAI(creature); + return GetIcecrownCitadelAI(creature); } }; @@ -1018,14 +1003,6 @@ class npc_blood_queen_lana_thel : public CreatureScript instance = creature->GetInstanceScript(); } - void InitializeAI() - { - if (!instance || static_cast(me->GetMap())->GetScriptId() != GetScriptId(ICCScriptName)) - me->IsAIEnabled = false; - else if (!me->isDead()) - Reset(); - } - void Reset() { events.Reset(); @@ -1102,7 +1079,7 @@ class npc_blood_queen_lana_thel : public CreatureScript CreatureAI* GetAI(Creature* creature) const { - return new npc_blood_queen_lana_thelAI(creature); + return GetIcecrownCitadelAI(creature); } }; @@ -1180,14 +1157,14 @@ class npc_ball_of_flame : public CreatureScript } private: - InstanceScript* instance; uint64 chaseGUID; + InstanceScript* instance; uint32 despawnTimer; }; CreatureAI* GetAI(Creature* creature) const { - return new npc_ball_of_flameAI(creature); + return GetIcecrownCitadelAI(creature); } }; @@ -1247,12 +1224,14 @@ class npc_kinetic_bomb : public CreatureScript private: EventMap events; - float x, y, groundZ; + float x; + float y; + float groundZ; }; CreatureAI* GetAI(Creature* creature) const { - return new npc_kinetic_bombAI(creature); + return GetIcecrownCitadelAI(creature); } }; @@ -1350,7 +1329,7 @@ class npc_dark_nucleus : public CreatureScript CreatureAI* GetAI(Creature* creature) const { - return new npc_dark_nucleusAI(creature); + return GetIcecrownCitadelAI(creature); } }; diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp index 3f121e1d862f2..b38448d9f191f 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp @@ -18,7 +18,6 @@ #include "ObjectMgr.h" #include "ScriptMgr.h" #include "ScriptedCreature.h" -#include "SpellScript.h" #include "Spell.h" #include "SpellAuraEffects.h" #include "icecrown_citadel.h" @@ -60,6 +59,7 @@ enum Spells SPELL_TWILIGHT_BLOODBOLT = 71446, SPELL_INCITE_TERROR = 73070, SPELL_BLOODBOLT_WHIRL = 71772, + SPELL_ANNIHILATE = 71322, }; enum Shadowmourne @@ -82,7 +82,7 @@ static const uint32 vampireAuras[3][MAX_DIFFICULTY] = #define ESSENCE_OF_BLOOD_QUEEN_PLR RAID_MODE(70879,71525,71530,71531) #define FRENZIED_BLOODTHIRST RAID_MODE(70877,71474,70877,71474) -enum eEvents +enum Events { EVENT_BERSERK = 1, EVENT_VAMPIRIC_BITE = 2, @@ -101,15 +101,17 @@ enum eEvents #define GUID_VAMPIRE 1 -enum ePoints +enum Points { POINT_CENTER = 1, POINT_AIR = 2, POINT_GROUND = 3, + POINT_MINCHAR = 4, }; -static const Position centerPos = {4595.7090f, 2769.4190f, 400.6368f, 0.0000f}; -static const Position airPos = {4595.7090f, 2769.4190f, 422.3893f, 0.0000f}; +static const Position centerPos = {4595.7090f, 2769.4190f, 400.6368f, 0.000000f}; +static const Position airPos = {4595.7090f, 2769.4190f, 422.3893f, 0.000000f}; +static const Position mincharPos = {4629.3711f, 2782.6089f, 424.6390f, 0.000000f}; bool IsVampire(Unit const* unit) { @@ -130,14 +132,6 @@ class boss_blood_queen_lana_thel : public CreatureScript { } - void InitializeAI() - { - if (!instance || static_cast(me->GetMap())->GetScriptId() != GetScriptId(ICCScriptName)) - me->IsAIEnabled = false; - else if (!me->isDead()) - Reset(); - } - void Reset() { _Reset(); @@ -152,6 +146,7 @@ class boss_blood_queen_lana_thel : public CreatureScript me->SetSpeed(MOVE_FLIGHT, 0.642857f, true); offtank = NULL; vampires.clear(); + creditBloodQuickening = false; } void EnterCombat(Unit* who) @@ -170,9 +165,10 @@ class boss_blood_queen_lana_thel : public CreatureScript DoCast(me, SPELL_SHROUD_OF_SORROW, true); DoCast(me, SPELL_FRENZIED_BLOODTHIRST_VISUAL, true); + creditBloodQuickening = instance->GetData(DATA_BLOOD_QUICKENING_STATE) == IN_PROGRESS; } - void JustDied(Unit* /*killer*/) + void JustDied(Unit* killer) { _JustDied(); Talk(SAY_DEATH); @@ -185,10 +181,64 @@ class boss_blood_queen_lana_thel : public CreatureScript instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_BLOOD_MIRROR_DUMMY); instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_DELIRIOUS_SLASH); instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_PACT_OF_THE_DARKFALLEN); + // Blah, credit the quest + if (creditBloodQuickening) + { + instance->SetData(DATA_BLOOD_QUICKENING_STATE, DONE); + if (Player* plr = killer->ToPlayer()) + plr->RewardPlayerAndGroupAtEvent(NPC_INFILTRATOR_MINCHAR_BQ, plr); + if (Creature* minchar = me->FindNearestCreature(NPC_INFILTRATOR_MINCHAR_BQ, 200.0f)) + { + minchar->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0); + minchar->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, 0x01); + minchar->SetFlying(false); + minchar->SendMovementFlagUpdate(); + minchar->RemoveAllAuras(); + minchar->GetMotionMaster()->MoveCharge(4629.3711f, 2782.6089f, 401.5301f, SPEED_CHARGE/3.0f); + } + } + } + + void DoAction(const int32 action) + { + if (action != ACTION_KILL_MINCHAR) + return; + + if (instance->GetBossState(DATA_BLOOD_QUEEN_LANA_THEL) == IN_PROGRESS) + killMinchar = true; + else + { + me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetByteFlag(UNIT_FIELD_BYTES_1, 3, 0x01); + me->SetFlying(true); + me->SendMovementFlagUpdate(); + me->GetMotionMaster()->MovePoint(POINT_MINCHAR, mincharPos); + } + } + + void EnterEvadeMode() + { + _EnterEvadeMode(); + if (killMinchar) + { + me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetByteFlag(UNIT_FIELD_BYTES_1, 3, 0x01); + me->SetFlying(true); + me->GetMotionMaster()->MovePoint(POINT_MINCHAR, mincharPos); + } + else + { + me->GetMotionMaster()->MoveTargetedHome(); + Reset(); + } } void JustReachedHome() { + me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, 0x01); + me->SetFlying(false); + me->SetReactState(REACT_AGGRESSIVE); _JustReachedHome(); Talk(SAY_WIPE); instance->SetBossState(DATA_BLOOD_QUEEN_LANA_THEL, FAIL); @@ -229,11 +279,17 @@ class boss_blood_queen_lana_thel : public CreatureScript me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); me->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, 0x01); me->SetFlying(false); + me->SendMovementFlagUpdate(); me->SetReactState(REACT_AGGRESSIVE); if (Unit *victim = me->SelectVictim()) AttackStart(victim); events.ScheduleEvent(EVENT_BLOOD_MIRROR, 2500, EVENT_GROUP_CANCELLABLE); break; + case POINT_MINCHAR: + DoCast(me, SPELL_ANNIHILATE, true); + // already in evade mode + me->GetMotionMaster()->MoveTargetedHome(); + Reset(); default: break; } @@ -346,6 +402,7 @@ class boss_blood_queen_lana_thel : public CreatureScript me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); me->SetByteFlag(UNIT_FIELD_BYTES_1, 3, 0x01); me->SetFlying(true); + me->SendMovementFlagUpdate(); me->GetMotionMaster()->MovePoint(POINT_AIR, airPos); break; case EVENT_AIR_FLY_DOWN: @@ -401,11 +458,13 @@ class boss_blood_queen_lana_thel : public CreatureScript Player* offtank; std::set vampires; + bool creditBloodQuickening; + bool killMinchar; }; CreatureAI* GetAI(Creature* creature) const { - return new boss_blood_queen_lana_thelAI(creature); + return GetIcecrownCitadelAI(creature); } }; @@ -432,19 +491,22 @@ class spell_blood_queen_vampiric_bite : public SpellScriptLoader return true; } + SpellCastResult CheckTarget() + { + if (IsVampire(GetTargetUnit())) + { + SetCustomCastResultMessage(SPELL_CUSTOM_ERROR_CANT_TARGET_VAMPIRES); + return SPELL_FAILED_CUSTOM_ERROR; + } + + return SPELL_CAST_OK; + } + void OnCast() { if (GetCaster()->GetTypeId() != TYPEID_PLAYER) return; - if (IsVampire(GetHitUnit())) - { - PreventHitDamage(); - PreventHitDefaultEffect(EFFECT_1); - Spell::SendCastResult(GetCaster()->ToPlayer(), GetSpellInfo(), 0, SPELL_FAILED_BAD_TARGETS); - return; - } - SpellEntry const* spell = sSpellStore.LookupEntry(SPELL_FRENZIED_BLOODTHIRST); spell = sSpellMgr->GetSpellForDifficultyFromSpell(spell, GetCaster()); GetCaster()->RemoveAura(spell->Id, 0, 0, AURA_REMOVE_BY_ENEMY_SPELL); @@ -473,6 +535,7 @@ class spell_blood_queen_vampiric_bite : public SpellScriptLoader void Register() { + OnCheckCast += SpellCheckCastFn(spell_blood_queen_vampiric_bite_SpellScript::CheckTarget); BeforeHit += SpellHitFn(spell_blood_queen_vampiric_bite_SpellScript::OnCast); } }; @@ -645,7 +708,7 @@ class spell_blood_queen_pact_of_the_darkfallen_dmg : public SpellScriptLoader SpellEntry const* damageSpell = sSpellStore.LookupEntry(SPELL_PACT_OF_THE_DARKFALLEN_DAMAGE); int32 damage = SpellMgr::CalculateSpellEffectAmount(damageSpell, EFFECT_0); float multiplier = 0.3375f + 0.1f * uint32(aurEff->GetTickNumber()/10); // do not convert to 0.01f - we need tick number/10 as INT (damage increases every 10 ticks) - damage = uint32(damage * multiplier); + damage = int32(damage * multiplier); GetTarget()->CastCustomSpell(SPELL_PACT_OF_THE_DARKFALLEN_DAMAGE, SPELLVALUE_BASE_POINT0, damage, GetTarget(), true); } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp index 3f67ea4afde66..66d3755ec6fb4 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp @@ -19,7 +19,6 @@ #include "ScriptMgr.h" #include "ScriptedCreature.h" #include "ScriptedGossip.h" -#include "SpellScript.h" #include "SpellAuras.h" #include "icecrown_citadel.h" @@ -193,6 +192,7 @@ enum Actions ACTION_CHARGE = -3781302, ACTION_START_OUTRO = -3781303, ACTION_DESPAWN = -3781304, + ACTION_INTERRUPT_INTRO = -3781305, ACTION_MARK_OF_THE_FALLEN_CHAMPION = -72293, }; @@ -205,7 +205,8 @@ enum MovePoints POINT_CHARGE = 3781302, POINT_CHOKE = 3781303, POINT_CORPSE = 3781304, - POINT_FINAL = 3781305 + POINT_FINAL = 3781305, + POINT_EXIT = 5, // waypoint id }; static const Position deathbringerPos = {-496.3542f, 2211.33f, 541.1138f, 0.0f}; @@ -247,14 +248,6 @@ class boss_deathbringer_saurfang : public CreatureScript fallenChampionCount = 0; } - void InitializeAI() - { - if (!instance || static_cast(me->GetMap())->GetScriptId() != GetScriptId(ICCScriptName)) - me->IsAIEnabled = false; - else if (!me->isDead()) - Reset(); - } - void Reset() { _Reset(); @@ -284,8 +277,15 @@ class boss_deathbringer_saurfang : public CreatureScript me->setActive(true); DoZoneInCombat(); + events.Reset(); events.SetPhase(PHASE_COMBAT); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + if (!introDone) + { + DoCast(me, SPELL_GRIP_OF_AGONY); + if (Creature* creature = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_SAURFANG_EVENT_NPC))) + creature->AI()->DoAction(ACTION_INTERRUPT_INTRO); + } introDone = true; Talk(SAY_AGGRO); @@ -510,6 +510,8 @@ class boss_deathbringer_saurfang : public CreatureScript events.ScheduleEvent(EVENT_INTRO_HORDE_2, 5000, 0, PHASE_INTRO_H); break; case ACTION_CONTINUE_INTRO: + if (introDone) + return; events.ScheduleEvent(EVENT_INTRO_ALLIANCE_6, 6500+500, 0, PHASE_INTRO_A); events.ScheduleEvent(EVENT_INTRO_FINISH, 8000, 0, PHASE_INTRO_A); @@ -540,7 +542,7 @@ class boss_deathbringer_saurfang : public CreatureScript CreatureAI* GetAI(Creature* creature) const { - return new boss_deathbringer_saurfangAI(creature); + return GetIcecrownCitadelAI(creature); } }; @@ -564,44 +566,53 @@ class npc_high_overlord_saurfang_icc : public CreatureScript void DoAction(const int32 action) { - if (action == ACTION_START_EVENT) + switch (action) { - // Prevent crashes - if (events.GetPhaseMask() & PHASE_INTRO_MASK) - return; - - GetCreatureListWithEntryInGrid(guardList, me, NPC_SE_KOR_KRON_REAVER, 20.0f); - guardList.sort(Trinity::ObjectDistanceOrderPred(me)); - uint32 x = 1; - for (std::list::iterator itr = guardList.begin(); itr != guardList.end(); ++x, ++itr) - (*itr)->AI()->SetData(0, x); - - me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - Talk(SAY_INTRO_HORDE_1); - events.SetPhase(PHASE_INTRO_H); - events.ScheduleEvent(EVENT_INTRO_HORDE_3, 18500, 0, PHASE_INTRO_H); - if (instance) + case ACTION_START_EVENT: { + // Prevent crashes + if (events.GetPhaseMask() & PHASE_INTRO_MASK) + return; + + GetCreatureListWithEntryInGrid(guardList, me, NPC_SE_KOR_KRON_REAVER, 20.0f); + guardList.sort(Trinity::ObjectDistanceOrderPred(me)); + uint32 x = 1; + for (std::list::iterator itr = guardList.begin(); itr != guardList.end(); ++x, ++itr) + (*itr)->AI()->SetData(0, x); + + me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + Talk(SAY_INTRO_HORDE_1); + events.SetPhase(PHASE_INTRO_H); + events.ScheduleEvent(EVENT_INTRO_HORDE_3, 18500, 0, PHASE_INTRO_H); deathbringerSaurfangGUID = instance->GetData64(DATA_DEATHBRINGER_SAURFANG); instance->HandleGameObject(instance->GetData64(GO_SAURFANG_S_DOOR), true); + if (Creature* deathbringer = ObjectAccessor::GetCreature(*me, deathbringerSaurfangGUID)) + deathbringer->AI()->DoAction(PHASE_INTRO_H); + break; } - if (Creature* deathbringer = ObjectAccessor::GetCreature(*me, deathbringerSaurfangGUID)) - deathbringer->AI()->DoAction(PHASE_INTRO_H); - } - else if (action == ACTION_START_OUTRO) - { - me->RemoveAurasDueToSpell(SPELL_GRIP_OF_AGONY); - Talk(SAY_OUTRO_HORDE_1); - events.ScheduleEvent(EVENT_OUTRO_HORDE_2, 10000); // say - events.ScheduleEvent(EVENT_OUTRO_HORDE_3, 18000); // say - events.ScheduleEvent(EVENT_OUTRO_HORDE_4, 24000); // cast - events.ScheduleEvent(EVENT_OUTRO_HORDE_5, 30000); // move - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - me->SendMovementFlagUpdate(); - me->Relocate(me->GetPositionX(), me->GetPositionY(), 539.2917f); - me->SendMonsterMove(me->GetPositionX(), me->GetPositionY(), 539.2917f, SPLINEFLAG_FALLING, 0, 0.0f); - for (std::list::iterator itr = guardList.begin(); itr != guardList.end(); ++itr) - (*itr)->AI()->DoAction(ACTION_DESPAWN); + case ACTION_START_OUTRO: + { + me->RemoveAurasDueToSpell(SPELL_GRIP_OF_AGONY); + Talk(SAY_OUTRO_HORDE_1); + events.ScheduleEvent(EVENT_OUTRO_HORDE_2, 10000); // say + events.ScheduleEvent(EVENT_OUTRO_HORDE_3, 18000); // say + events.ScheduleEvent(EVENT_OUTRO_HORDE_4, 24000); // cast + events.ScheduleEvent(EVENT_OUTRO_HORDE_5, 30000); // move + me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SendMovementFlagUpdate(); + me->Relocate(me->GetPositionX(), me->GetPositionY(), 539.2917f); + me->SendMonsterMove(me->GetPositionX(), me->GetPositionY(), 539.2917f, SPLINEFLAG_FALLING, 0, 0.0f); + for (std::list::iterator itr = guardList.begin(); itr != guardList.end(); ++itr) + (*itr)->AI()->DoAction(ACTION_DESPAWN); + break; + } + case ACTION_INTERRUPT_INTRO: + events.Reset(); + for (std::list::iterator itr = guardList.begin(); itr != guardList.end(); ++itr) + (*itr)->AI()->DoAction(ACTION_DESPAWN); + break; + default: + break; } } @@ -616,36 +627,45 @@ class npc_high_overlord_saurfang_icc : public CreatureScript void MovementInform(uint32 type, uint32 id) { - if (type != POINT_MOTION_TYPE) - return; - - if (id == POINT_FIRST_STEP) - { - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); - Talk(SAY_INTRO_HORDE_3); - events.ScheduleEvent(EVENT_INTRO_HORDE_5, 15500, 0, PHASE_INTRO_H); - events.ScheduleEvent(EVENT_INTRO_HORDE_6, 29500, 0, PHASE_INTRO_H); - events.ScheduleEvent(EVENT_INTRO_HORDE_7, 43800, 0, PHASE_INTRO_H); - events.ScheduleEvent(EVENT_INTRO_HORDE_8, 47000, 0, PHASE_INTRO_H); - if (Creature* deathbringer = ObjectAccessor::GetCreature(*me, deathbringerSaurfangGUID)) - deathbringer->AI()->DoAction(ACTION_CONTINUE_INTRO); - } - else if (id == POINT_CORPSE) + if (type == POINT_MOTION_TYPE) { - if (Creature* deathbringer = ObjectAccessor::GetCreature(*me, deathbringerSaurfangGUID)) + switch (id) { - deathbringer->CastSpell(me, SPELL_RIDE_VEHICLE, true); // for the packet logs. - deathbringer->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - deathbringer->setDeathState(ALIVE); - deathbringer->EnterVehicle(vehicle, 0); + case POINT_FIRST_STEP: + me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + Talk(SAY_INTRO_HORDE_3); + events.ScheduleEvent(EVENT_INTRO_HORDE_5, 15500, 0, PHASE_INTRO_H); + events.ScheduleEvent(EVENT_INTRO_HORDE_6, 29500, 0, PHASE_INTRO_H); + events.ScheduleEvent(EVENT_INTRO_HORDE_7, 43800, 0, PHASE_INTRO_H); + events.ScheduleEvent(EVENT_INTRO_HORDE_8, 47000, 0, PHASE_INTRO_H); + if (Creature* deathbringer = ObjectAccessor::GetCreature(*me, deathbringerSaurfangGUID)) + deathbringer->AI()->DoAction(ACTION_CONTINUE_INTRO); + break; + case POINT_CORPSE: + if (Creature* deathbringer = ObjectAccessor::GetCreature(*me, deathbringerSaurfangGUID)) + { + deathbringer->CastSpell(me, SPELL_RIDE_VEHICLE, true); // for the packet logs. + deathbringer->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + deathbringer->setDeathState(ALIVE); + } + events.ScheduleEvent(EVENT_OUTRO_HORDE_5, 1000); // move + events.ScheduleEvent(EVENT_OUTRO_HORDE_6, 4000); // say + break; + case POINT_FINAL: + if (Creature* deathbringer = ObjectAccessor::GetCreature(*me, deathbringerSaurfangGUID)) + deathbringer->DespawnOrUnsummon(); + me->DespawnOrUnsummon(); + break; + default: + break; } - events.ScheduleEvent(EVENT_OUTRO_HORDE_5, 1000); // move - events.ScheduleEvent(EVENT_OUTRO_HORDE_6, 4000); // say } - else if (id == POINT_FINAL) + else if (type == WAYPOINT_MOTION_TYPE && id == POINT_EXIT) { - if (Creature* deathbringer = ObjectAccessor::GetCreature(*me, deathbringerSaurfangGUID)) - deathbringer->DespawnOrUnsummon(); + std::list guards; + GetCreatureListWithEntryInGrid(guards, me, NPC_KOR_KRON_GENERAL, 50.0f); + for (std::list::iterator itr = guards.begin(); itr != guards.end(); ++itr) + (*itr)->DespawnOrUnsummon(); me->DespawnOrUnsummon(); } } @@ -738,7 +758,7 @@ class npc_high_overlord_saurfang_icc : public CreatureScript CreatureAI* GetAI(Creature* creature) const { - return new npc_high_overlord_saurfangAI(creature); + return GetIcecrownCitadelAI(creature); } }; @@ -761,40 +781,47 @@ class npc_muradin_bronzebeard_icc : public CreatureScript void DoAction(const int32 action) { - if (action == ACTION_START_EVENT) + switch (action) { - // Prevent crashes - if (events.GetPhaseMask() & PHASE_INTRO_MASK) - return; - - events.SetPhase(PHASE_INTRO_A); - GetCreatureListWithEntryInGrid(guardList, me, NPC_SE_SKYBREAKER_MARINE, 20.0f); - guardList.sort(Trinity::ObjectDistanceOrderPred(me)); - uint32 x = 1; - for (std::list::iterator itr = guardList.begin(); itr != guardList.end(); ++x, ++itr) - (*itr)->AI()->SetData(0, x); - - me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - Talk(SAY_INTRO_ALLIANCE_1); - events.ScheduleEvent(EVENT_INTRO_ALLIANCE_4, 2500+17500+9500, 0, PHASE_INTRO_A); - if (instance) + case ACTION_START_EVENT: { + // Prevent crashes + if (events.GetPhaseMask() & PHASE_INTRO_MASK) + return; + + events.SetPhase(PHASE_INTRO_A); + GetCreatureListWithEntryInGrid(guardList, me, NPC_SE_SKYBREAKER_MARINE, 20.0f); + guardList.sort(Trinity::ObjectDistanceOrderPred(me)); + uint32 x = 1; + for (std::list::iterator itr = guardList.begin(); itr != guardList.end(); ++x, ++itr) + (*itr)->AI()->SetData(0, x); + + me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + Talk(SAY_INTRO_ALLIANCE_1); + events.ScheduleEvent(EVENT_INTRO_ALLIANCE_4, 2500+17500+9500, 0, PHASE_INTRO_A); deathbringerSaurfangGUID = instance->GetData64(DATA_DEATHBRINGER_SAURFANG); instance->HandleGameObject(instance->GetData64(GO_SAURFANG_S_DOOR), true); + if (Creature* deathbringer = ObjectAccessor::GetCreature(*me, deathbringerSaurfangGUID)) + deathbringer->AI()->DoAction(PHASE_INTRO_A); + break; } - if (Creature* deathbringer = ObjectAccessor::GetCreature(*me, deathbringerSaurfangGUID)) - deathbringer->AI()->DoAction(PHASE_INTRO_A); - } - else if (action == ACTION_START_OUTRO) - { - me->RemoveAurasDueToSpell(SPELL_GRIP_OF_AGONY); - Talk(SAY_OUTRO_ALLIANCE_1); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - me->SendMovementFlagUpdate(); - me->Relocate(me->GetPositionX(), me->GetPositionY(), 539.2917f); - me->SendMonsterMove(me->GetPositionX(), me->GetPositionY(), 539.2917f, SPLINEFLAG_FALLING, 0, 0.0f); - for (std::list::iterator itr = guardList.begin(); itr != guardList.end(); ++itr) - (*itr)->AI()->DoAction(ACTION_DESPAWN); + case ACTION_START_OUTRO: + { + me->RemoveAurasDueToSpell(SPELL_GRIP_OF_AGONY); + Talk(SAY_OUTRO_ALLIANCE_1); + me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SendMovementFlagUpdate(); + me->Relocate(me->GetPositionX(), me->GetPositionY(), 539.2917f); + me->SendMonsterMove(me->GetPositionX(), me->GetPositionY(), 539.2917f, SPLINEFLAG_FALLING, 0, 0.0f); + for (std::list::iterator itr = guardList.begin(); itr != guardList.end(); ++itr) + (*itr)->AI()->DoAction(ACTION_DESPAWN); + break; + } + case ACTION_INTERRUPT_INTRO: + events.Reset(); + for (std::list::iterator itr = guardList.begin(); itr != guardList.end(); ++itr) + (*itr)->AI()->DoAction(ACTION_DESPAWN); + break; } } @@ -809,14 +836,22 @@ class npc_muradin_bronzebeard_icc : public CreatureScript void MovementInform(uint32 type, uint32 id) { - if (type != POINT_MOTION_TYPE || id != POINT_FIRST_STEP) - return; - - me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); - Talk(SAY_INTRO_ALLIANCE_4); - events.ScheduleEvent(EVENT_INTRO_ALLIANCE_5, 5000, 0, PHASE_INTRO_A); - if (Creature* deathbringer = ObjectAccessor::GetCreature(*me, deathbringerSaurfangGUID)) - deathbringer->AI()->DoAction(ACTION_CONTINUE_INTRO); + if (type == POINT_MOTION_TYPE && id == POINT_FIRST_STEP) + { + me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); + Talk(SAY_INTRO_ALLIANCE_4); + events.ScheduleEvent(EVENT_INTRO_ALLIANCE_5, 5000, 0, PHASE_INTRO_A); + if (Creature* deathbringer = ObjectAccessor::GetCreature(*me, deathbringerSaurfangGUID)) + deathbringer->AI()->DoAction(ACTION_CONTINUE_INTRO); + } + else if (type == WAYPOINT_MOTION_TYPE && id == POINT_EXIT) + { + std::list guards; + GetCreatureListWithEntryInGrid(guards, me, NPC_ALLIANCE_COMMANDER, 50.0f); + for (std::list::iterator itr = guards.begin(); itr != guards.end(); ++itr) + (*itr)->DespawnOrUnsummon(); + me->DespawnOrUnsummon(); + } } void UpdateAI(const uint32 diff) @@ -874,7 +909,7 @@ class npc_muradin_bronzebeard_icc : public CreatureScript CreatureAI* GetAI(Creature* creature) const { - return new npc_muradin_bronzebeard_iccAI(creature); + return GetIcecrownCitadelAI(creature); } }; @@ -887,13 +922,13 @@ class npc_saurfang_event : public CreatureScript { npc_saurfang_eventAI(Creature* creature) : ScriptedAI(creature) { - uiNPCindex = 0; + npcIndex = 0; } void SetData(uint32 type, uint32 data) { ASSERT(!type && data && data < 6); - uiNPCindex = data; + npcIndex = data; } void SpellHit(Unit* /*caster*/, SpellEntry const* spell) @@ -901,26 +936,25 @@ class npc_saurfang_event : public CreatureScript if (spell->Id == SPELL_GRIP_OF_AGONY) { me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - me->GetMotionMaster()->MovePoint(POINT_CHOKE, chokePos[uiNPCindex]); + me->GetMotionMaster()->MovePoint(POINT_CHOKE, chokePos[npcIndex]); } } void DoAction(const int32 action) { - if (action == ACTION_CHARGE && uiNPCindex) - me->GetMotionMaster()->MoveCharge(chargePos[uiNPCindex].GetPositionX(), chargePos[uiNPCindex].GetPositionY(), chargePos[uiNPCindex].GetPositionZ(), 13.0f, POINT_CHARGE); + if (action == ACTION_CHARGE && npcIndex) + me->GetMotionMaster()->MoveCharge(chargePos[npcIndex].GetPositionX(), chargePos[npcIndex].GetPositionY(), chargePos[npcIndex].GetPositionZ(), 13.0f, POINT_CHARGE); else if (action == ACTION_DESPAWN) me->DespawnOrUnsummon(); } private: - EventMap events; - uint32 uiNPCindex; + uint32 npcIndex; }; CreatureAI* GetAI(Creature* creature) const { - return new npc_saurfang_eventAI(creature); + return GetIcecrownCitadelAI(creature); } }; diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_festergut.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_festergut.cpp index 576ac2db45491..3a0de0d7fc49a 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_festergut.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_festergut.cpp @@ -18,7 +18,6 @@ #include "ObjectMgr.h" #include "ScriptMgr.h" #include "ScriptedCreature.h" -#include "SpellScript.h" #include "SpellAuras.h" #include "icecrown_citadel.h" @@ -88,14 +87,6 @@ class boss_festergut : public CreatureScript gasDummyGUID = 0; } - void InitializeAI() - { - if (!instance || static_cast(me->GetMap())->GetScriptId() != GetScriptId(ICCScriptName)) - me->IsAIEnabled = false; - else if (!me->isDead()) - Reset(); - } - void Reset() { _Reset(); @@ -277,12 +268,12 @@ class boss_festergut : public CreatureScript private: uint64 gasDummyGUID; uint32 maxInoculatedStack; - uint8 inhaleCounter; + uint32 inhaleCounter; }; CreatureAI* GetAI(Creature* creature) const { - return new boss_festergutAI(creature); + return GetIcecrownCitadelAI(creature); } }; @@ -338,8 +329,7 @@ class npc_stinky_icc : public CreatureScript void JustDied(Unit* /*who*/) { - uint64 festergutGUID = instance ? instance->GetData64(DATA_FESTERGUT) : 0; - if (Creature* festergut = me->GetCreature(*me, festergutGUID)) + if (Creature* festergut = me->GetCreature(*me, instance->GetData64(DATA_FESTERGUT))) if (festergut->isAlive()) festergut->AI()->Talk(SAY_STINKY_DEAD); } @@ -351,7 +341,7 @@ class npc_stinky_icc : public CreatureScript CreatureAI* GetAI(Creature* creature) const { - return new npc_stinky_iccAI(creature); + return GetIcecrownCitadelAI(creature); } }; @@ -463,6 +453,42 @@ class spell_festergut_blighted_spores : public SpellScriptLoader } }; +class spell_festergut_gaseous_blight : public SpellScriptLoader +{ + public: + spell_festergut_gaseous_blight() : SpellScriptLoader("spell_festergut_gaseous_blight") { } + + class spell_festergut_gaseous_blight_SpellScript : public SpellScript + { + PrepareSpellScript(spell_festergut_gaseous_blight_SpellScript); + + bool Validate(SpellEntry const* /*spell*/) + { + if (!sSpellStore.LookupEntry(SPELL_ORANGE_BLIGHT_RESIDUE)) + return false; + return true; + } + + void ExtraEffect() + { + if (GetHitUnit()->HasAura(SPELL_ORANGE_BLIGHT_RESIDUE)) + return; + + GetHitUnit()->CastSpell(GetHitUnit(), SPELL_ORANGE_BLIGHT_RESIDUE, true); + } + + void Register() + { + AfterHit += SpellHitFn(spell_festergut_gaseous_blight_SpellScript::ExtraEffect); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_festergut_gaseous_blight_SpellScript(); + } +}; + class achievement_flu_shot_shortage : public AchievementCriteriaScript { public: @@ -484,5 +510,6 @@ void AddSC_boss_festergut() new spell_festergut_pungent_blight(); new spell_festergut_gastric_bloat(); new spell_festergut_blighted_spores(); + new spell_festergut_gaseous_blight(); new achievement_flu_shot_shortage(); } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp index 0c44d27d4e597..6b5ab146e4b30 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp @@ -18,12 +18,13 @@ #include "ObjectMgr.h" #include "ScriptMgr.h" #include "ScriptedCreature.h" -#include "SpellScript.h" -#include "icecrown_citadel.h" +#include "PoolMgr.h" #include "Group.h" +#include "icecrown_citadel.h" enum ScriptTexts { + // Lady Deathwhisper SAY_INTRO_1 = 0, SAY_INTRO_2 = 1, SAY_INTRO_3 = 2, @@ -41,6 +42,10 @@ enum ScriptTexts SAY_KILL = 14, SAY_BERSERK = 15, SAY_DEATH = 16, + + // Darnavan + SAY_DARNAVAN_AGGRO = 0, + SAY_DARNAVAN_RESCUED = 1, }; enum Spells @@ -89,6 +94,14 @@ enum Spells SPELL_VENGEFUL_BLAST_25N = 72010, SPELL_VENGEFUL_BLAST_10H = 72011, SPELL_VENGEFUL_BLAST_25H = 72012, + + // Darnavan + SPELL_BLADESTORM = 65947, + SPELL_CHARGE = 65927, + SPELL_INTIMIDATING_SHOUT = 65930, + SPELL_MORTAL_STRIKE = 65926, + SPELL_SHATTERING_THROW = 65940, + SPELL_SUNDER_ARMOR = 65936, }; enum Events @@ -131,6 +144,14 @@ enum Events EVENT_ADHERENT_DEATHCHILL = 25, EVENT_ADHERENT_CURSE_OF_TORPOR = 26, EVENT_ADHERENT_SHORUD_OF_THE_OCCULT = 27, + + // Darnavan + EVENT_DARNAVAN_BLADESTORM = 28, + EVENT_DARNAVAN_CHARGE = 29, + EVENT_DARNAVAN_INTIMIDATING_SHOUT = 30, + EVENT_DARNAVAN_MORTAL_STRIKE = 31, + EVENT_DARNAVAN_SHATTERING_THROW = 32, + EVENT_DARNAVAN_SUNDER_ARMOR = 33, }; enum Phases @@ -144,6 +165,21 @@ enum Phases PHASE_ONE_MASK = 1 << PHASE_ONE, }; +enum DeprogrammingData +{ + NPC_DARNAVAN_10 = 38472, + NPC_DARNAVAN_25 = 38485, + NPC_DARNAVAN_CREDIT_10 = 39091, + NPC_DARNAVAN_CREDIT_25 = 39092, + + ACTION_COMPLETE_QUEST = -384720, + POINT_DESPAWN = 384721, +}; + +#define NPC_DARNAVAN RAID_MODE(NPC_DARNAVAN_10,NPC_DARNAVAN_25,NPC_DARNAVAN_10,NPC_DARNAVAN_25) +#define NPC_DARNAVAN_CREDIT RAID_MODE(NPC_DARNAVAN_CREDIT_10,NPC_DARNAVAN_CREDIT_25,NPC_DARNAVAN_CREDIT_10,NPC_DARNAVAN_CREDIT_25) +#define QUEST_DEPROGRAMMING RAID_MODE(QUEST_DEPROGRAMMING_10,QUEST_DEPROGRAMMING_25,QUEST_DEPROGRAMMING_10,QUEST_DEPROGRAMMING_25) + static const uint32 addEntries[2] = {NPC_CULT_FANATIC, NPC_CULT_ADHERENT}; static const Position addSpawnPos[7] = @@ -157,6 +193,20 @@ static const Position addSpawnPos[7] = {-524.2480f, 2211.920f, 62.90960f, 3.141592f}, // 7 Upper (Random Cultist) }; +class DaranavanMoveEvent : public BasicEvent +{ + public: + DaranavanMoveEvent(Creature& _darnavan) : darnavan(_darnavan) { } + + bool Execute(uint64 , uint32 ) + { + darnavan.GetMotionMaster()->MovePoint(POINT_DESPAWN, addSpawnPos[6]); + return true; + } + + Creature& darnavan; +}; + class boss_lady_deathwhisper : public CreatureScript { public: @@ -167,15 +217,7 @@ class boss_lady_deathwhisper : public CreatureScript boss_lady_deathwhisperAI(Creature* creature) : BossAI(creature, DATA_LADY_DEATHWHISPER) { introDone = false; - dominateMindCount = RAID_MODE(0,1,1,3); - } - - void InitializeAI() - { - if (!instance || static_cast(me->GetMap())->GetScriptId() != GetScriptId(ICCScriptName)) - me->IsAIEnabled = false; - else if (!me->isDead()) - Reset(); + dominateMindCount = RAID_MODE(0, 1, 1, 3); } void Reset() @@ -186,6 +228,7 @@ class boss_lady_deathwhisper : public CreatureScript events.SetPhase(PHASE_ONE); addWaveCounter = 0; nextVengefulShadeTarget = 0; + darnavanGUID = 0; DoCast(me, SPELL_SHADOW_CHANNELING); me->RemoveAurasDueToSpell(SPELL_BERSERK); me->RemoveAurasDueToSpell(SPELL_MANA_BARRIER); @@ -241,7 +284,7 @@ class boss_lady_deathwhisper : public CreatureScript events.ScheduleEvent(EVENT_P1_SUMMON_WAVE, 5000, 0, PHASE_ONE); events.ScheduleEvent(EVENT_P1_SHADOW_BOLT, urand(5500, 6000), 0, PHASE_ONE); events.ScheduleEvent(EVENT_P1_EMPOWER_CULTIST, urand(20000, 30000), 0, PHASE_ONE); - if (getDifficulty() != RAID_DIFFICULTY_10MAN_NORMAL) + if (GetDifficulty() != RAID_DIFFICULTY_10MAN_NORMAL) events.ScheduleEvent(EVENT_DOMINATE_MIND_H, 27000); Talk(SAY_AGGRO); @@ -264,23 +307,29 @@ class boss_lady_deathwhisper : public CreatureScript livingAddEntries.insert(unit->GetEntry()); if (livingAddEntries.size() >= 5) + instance->DoUpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET, SPELL_FULL_HOUSE, 0, me); + + if (Creature* darnavan = ObjectAccessor::GetCreature(*me, darnavanGUID)) { - if (Player* player = killer->GetCharmerOrOwnerPlayerOrPlayerItself()) + if (darnavan->isAlive()) { - if (Group* group = player->GetGroup()) + darnavan->setFaction(35); + darnavan->CombatStop(true); + darnavan->GetMotionMaster()->MoveIdle(); + darnavan->SetReactState(REACT_PASSIVE); + darnavan->m_Events.AddEvent(new DaranavanMoveEvent(*darnavan), darnavan->m_Events.CalculateTime(10000)); + darnavan->AI()->Talk(SAY_DARNAVAN_RESCUED); + if (Player* owner = killer->GetCharmerOrOwnerPlayerOrPlayerItself()) { - for (GroupReference *itr = group->GetFirstMember(); itr != NULL; itr = itr->next()) + if (Group* group = owner->GetGroup()) { - Player* member = itr->getSource(); - if (!member || !member->IsAtGroupRewardDistance(me)) - continue; - - if (member->isAlive()|| !member->GetCorpse()) - member->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET, SPELL_FULL_HOUSE, 0, me); + for (GroupReference *itr = group->GetFirstMember(); itr != NULL; itr = itr->next()) + if (Player* member = itr->getSource()) + member->KilledMonsterCredit(NPC_DARNAVAN_CREDIT, 0); } + else + owner->KilledMonsterCredit(NPC_DARNAVAN_CREDIT, 0); } - else - player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET, SPELL_FULL_HOUSE, 0, me); } } @@ -293,6 +342,11 @@ class boss_lady_deathwhisper : public CreatureScript instance->SetBossState(DATA_LADY_DEATHWHISPER, FAIL); summons.DespawnAll(); + if (Creature* darnavan = ObjectAccessor::GetCreature(*me, darnavanGUID)) + { + darnavan->DespawnOrUnsummon(); + darnavanGUID = 0; + } } void KilledUnit(Unit* victim) @@ -329,7 +383,11 @@ class boss_lady_deathwhisper : public CreatureScript void JustSummoned(Creature* summon) { - summons.push_back(summon->GetGUID()); + if (summon->GetEntry() == NPC_DARNAVAN) + darnavanGUID = summon->GetGUID(); + else + summons.push_back(summon->GetGUID()); + Unit* target = NULL; if (summon->GetEntry() == NPC_VENGEFUL_SHADE) { @@ -422,7 +480,7 @@ class boss_lady_deathwhisper : public CreatureScript events.ScheduleEvent(EVENT_P2_TOUCH_OF_INSIGNIFICANCE, urand(9000, 13000), 0, PHASE_TWO); break; case EVENT_P2_SUMMON_SHADE: - if (Unit* shadeTarget = SelectUnit(SELECT_TARGET_RANDOM, 1)) + if (Unit* shadeTarget = SelectTarget(SELECT_TARGET_RANDOM, 1)) { nextVengefulShadeTarget = shadeTarget->GetGUID(); DoCast(shadeTarget, SPELL_SUMMON_SHADE); @@ -452,7 +510,10 @@ class boss_lady_deathwhisper : public CreatureScript { uint8 addIndex = addWaveCounter & 1; uint8 addIndexOther = uint8(addIndex ^ 1); - _SummonAdd(addEntries[addIndex], addSpawnPos[addIndex*3]); + if (addWaveCounter || !sPoolMgr->IsSpawnedObject(QUEST_DEPROGRAMMING)) + _SummonAdd(addEntries[addIndex], addSpawnPos[addIndex*3]); + else + _SummonAdd(NPC_DARNAVAN, addSpawnPos[addIndex*3]); _SummonAdd(addEntries[addIndexOther], addSpawnPos[addIndex*3+1]); _SummonAdd(addEntries[addIndex], addSpawnPos[addIndex*3+2]); if (Is25ManRaid()) @@ -550,6 +611,7 @@ class boss_lady_deathwhisper : public CreatureScript private: uint64 nextVengefulShadeTarget; + uint64 darnavanGUID; std::deque reanimationQueue; uint32 addWaveCounter; uint8 dominateMindCount; @@ -558,10 +620,12 @@ class boss_lady_deathwhisper : public CreatureScript CreatureAI* GetAI(Creature* creature) const { - return new boss_lady_deathwhisperAI(creature); + return GetIcecrownCitadelAI(creature); } }; +typedef boss_lady_deathwhisper::boss_lady_deathwhisperAI DeathwisperAI; + class npc_cult_fanatic : public CreatureScript { public: @@ -635,7 +699,7 @@ class npc_cult_fanatic : public CreatureScript CreatureAI* GetAI(Creature* creature) const { - return new npc_cult_fanaticAI(creature); + return GetIcecrownCitadelAI(creature); } }; @@ -697,7 +761,7 @@ class npc_cult_adherent : public CreatureScript events.ScheduleEvent(EVENT_ADHERENT_DEATHCHILL, urand(9000, 13000)); break; case EVENT_ADHERENT_CURSE_OF_TORPOR: - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1)) + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1)) DoCast(target, SPELL_CURSE_OF_TORPOR); events.ScheduleEvent(EVENT_ADHERENT_CURSE_OF_TORPOR, urand(9000, 13000)); break; @@ -721,7 +785,7 @@ class npc_cult_adherent : public CreatureScript CreatureAI* GetAI(Creature* pCreature) const { - return new npc_cult_adherentAI(pCreature); + return GetIcecrownCitadelAI(pCreature); } }; @@ -761,7 +825,127 @@ class npc_vengeful_shade : public CreatureScript CreatureAI* GetAI(Creature* creature) const { - return new npc_vengeful_shadeAI(creature); + return GetIcecrownCitadelAI(creature); + } +}; + +class npc_darnavan : public CreatureScript +{ + public: + npc_darnavan() : CreatureScript("npc_darnavan") { } + + struct npc_darnavanAI : public ScriptedAI + { + npc_darnavanAI(Creature* creature) : ScriptedAI(creature) + { + } + + void Reset() + { + events.Reset(); + events.ScheduleEvent(EVENT_DARNAVAN_BLADESTORM, 10000); + events.ScheduleEvent(EVENT_DARNAVAN_INTIMIDATING_SHOUT, urand(20000, 25000)); + events.ScheduleEvent(EVENT_DARNAVAN_MORTAL_STRIKE, urand(25000, 30000)); + events.ScheduleEvent(EVENT_DARNAVAN_SUNDER_ARMOR, urand(5000, 8000)); + canCharge = true; + canShatter = true; + } + + void JustDied(Unit* killer) + { + events.Reset(); + if (Player* owner = killer->GetCharmerOrOwnerPlayerOrPlayerItself()) + { + if (Group* group = owner->GetGroup()) + { + for (GroupReference *itr = group->GetFirstMember(); itr != NULL; itr = itr->next()) + if (Player* member = itr->getSource()) + member->FailQuest(QUEST_DEPROGRAMMING); + } + else + owner->FailQuest(QUEST_DEPROGRAMMING); + } + } + + void MovementInform(uint32 type, uint32 id) + { + if (type != POINT_MOTION_TYPE || id != POINT_DESPAWN) + return; + me->DespawnOrUnsummon(); + } + + void EnterCombat(Unit* /*victim*/) + { + Talk(SAY_DARNAVAN_AGGRO); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + events.Update(diff); + + if (me->HasUnitState(UNIT_STAT_CASTING)) + return; + + if (canShatter && me->getVictim()->IsImmunedToDamage(SPELL_SCHOOL_MASK_NORMAL)) + { + DoCastVictim(SPELL_SHATTERING_THROW); + canShatter = false; + events.ScheduleEvent(EVENT_DARNAVAN_SHATTERING_THROW, 30000); + return; + } + + if (canCharge && !me->IsWithinMeleeRange(me->getVictim())) + { + DoCastVictim(SPELL_CHARGE); + canCharge = false; + events.ScheduleEvent(EVENT_DARNAVAN_CHARGE, 20000); + return; + } + + while (uint32 eventId = events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_DARNAVAN_BLADESTORM: + DoCast(SPELL_BLADESTORM); + events.ScheduleEvent(EVENT_DARNAVAN_BLADESTORM, urand(90000, 100000)); + break; + case EVENT_DARNAVAN_CHARGE: + canCharge = true; + break; + case EVENT_DARNAVAN_INTIMIDATING_SHOUT: + DoCast(SPELL_INTIMIDATING_SHOUT); + events.ScheduleEvent(EVENT_DARNAVAN_INTIMIDATING_SHOUT, urand(90000, 120000)); + break; + case EVENT_DARNAVAN_MORTAL_STRIKE: + DoCastVictim(SPELL_MORTAL_STRIKE); + events.ScheduleEvent(EVENT_DARNAVAN_MORTAL_STRIKE, urand(15000, 30000)); + break; + case EVENT_DARNAVAN_SHATTERING_THROW: + canShatter = true; + break; + case EVENT_DARNAVAN_SUNDER_ARMOR: + DoCastVictim(SPELL_SUNDER_ARMOR); + events.ScheduleEvent(EVENT_DARNAVAN_SUNDER_ARMOR, urand(3000, 7000)); + break; + } + } + + DoMeleeAttackIfReady(); + } + + private: + EventMap events; + bool canCharge; + bool canShatter; + }; + + CreatureAI* GetAI(Creature* creature) const + { + return GetIcecrownCitadelAI(creature); } }; @@ -809,7 +993,7 @@ class spell_cultist_dark_martyrdom : public SpellScriptLoader if (GetCaster()->isSummon()) if (Unit* owner = GetCaster()->ToTempSummon()->GetSummoner()) if (owner->GetEntry() == NPC_LADY_DEATHWHISPER) - CAST_AI(boss_lady_deathwhisper::boss_lady_deathwhisperAI, owner->ToCreature()->AI())->AddToReanimationQueue(GetCaster()); + CAST_AI(DeathwisperAI, owner->ToCreature()->AI())->AddToReanimationQueue(GetCaster()); GetCaster()->Kill(GetCaster()); GetCaster()->SetDisplayId(uint32(GetCaster()->GetEntry() == NPC_CULT_FANATIC ? 38009 : 38010)); @@ -833,6 +1017,7 @@ void AddSC_boss_lady_deathwhisper() new npc_cult_fanatic(); new npc_cult_adherent(); new npc_vengeful_shade(); + new npc_darnavan(); new spell_deathwhisper_mana_barrier(); new spell_cultist_dark_martyrdom(); } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp index e20ee195d103f..e709b3a53e7af 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp @@ -18,10 +18,9 @@ #include "ObjectMgr.h" #include "ScriptMgr.h" #include "ScriptedCreature.h" -#include "SpellScript.h" #include "SpellAuras.h" -#include "icecrown_citadel.h" #include "MapManager.h" +#include "icecrown_citadel.h" enum ScriptTexts { @@ -94,14 +93,6 @@ class boss_lord_marrowgar : public CreatureScript boneSlice = false; } - void InitializeAI() - { - if (!instance || static_cast(me->GetMap())->GetScriptId() != GetScriptId(ICCScriptName)) - me->IsAIEnabled = false; - else if (!me->isDead()) - Reset(); - } - void Reset() { _Reset(); @@ -199,9 +190,9 @@ class boss_lord_marrowgar : public CreatureScript case EVENT_BONE_STORM_MOVE: { events.ScheduleEvent(EVENT_BONE_STORM_MOVE, boneStormDuration/3); - Unit* unit = SelectUnit(SELECT_TARGET_RANDOM, 1); + Unit* unit = SelectTarget(SELECT_TARGET_RANDOM, 1); if (!unit) - unit = SelectUnit(SELECT_TARGET_RANDOM, 0); + unit = SelectTarget(SELECT_TARGET_RANDOM, 0); if (unit) me->GetMotionMaster()->MovePoint(POINT_TARGET_BONESTORM_PLAYER, unit->GetPositionX(), unit->GetPositionY(), unit->GetPositionZ()); break; @@ -252,16 +243,16 @@ class boss_lord_marrowgar : public CreatureScript } private: + Position coldflameLastPos; uint32 boneStormDuration; float baseSpeed; - Position coldflameLastPos; bool introDone; bool boneSlice; }; CreatureAI* GetAI(Creature* creature) const { - return new boss_lord_marrowgarAI(creature); + return GetIcecrownCitadelAI(creature); } }; @@ -335,7 +326,7 @@ class npc_coldflame : public CreatureScript CreatureAI* GetAI(Creature* creature) const { - return new npc_coldflameAI(creature); + return GetIcecrownCitadelAI(creature); } }; @@ -393,7 +384,7 @@ class npc_bone_spike : public CreatureScript CreatureAI* GetAI(Creature* creature) const { - return new npc_bone_spikeAI(creature); + return GetIcecrownCitadelAI(creature); } }; diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp index f7dde4dc1f108..4b60b3060483f 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp @@ -18,8 +18,9 @@ #include "ObjectMgr.h" #include "ScriptMgr.h" #include "ScriptedCreature.h" -#include "SpellScript.h" #include "SpellAuraEffects.h" +#include "Group.h" +#include "Spell.h" #include "icecrown_citadel.h" enum ScriptTexts @@ -152,7 +153,13 @@ static const Position tablePos = {4356.190f, 3262.90f, 389.4820f, 1.483 static const uint32 oozeFloodSpells[4] = {69782, 69796, 69798, 69801}; -#define DATA_EXPERIMENT_STAGE 0 +enum PutricideData +{ + DATA_EXPERIMENT_STAGE = 1, + DATA_PHASE = 2, + DATA_ABOMINATION = 3, +}; + #define EXPERIMENT_STATE_OOZE false #define EXPERIMENT_STATE_GAS true @@ -183,14 +190,6 @@ class boss_professor_putricide : public CreatureScript phase = PHASE_NONE; } - void InitializeAI() - { - if (!instance || static_cast(me->GetMap())->GetScriptId() != GetScriptId(ICCScriptName)) - me->IsAIEnabled = false; - else if (!me->isDead()) - Reset(); - } - void Reset() { if (!(events.GetPhaseMask() & PHASE_MASK_NOT_SELF)) @@ -205,8 +204,9 @@ class boss_professor_putricide : public CreatureScript me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == POINT_MOTION_TYPE) me->GetMotionMaster()->MovementExpired(); - if (GameObject* table = ObjectAccessor::GetGameObject(*me, instance->GetData64(DATA_PUTRICIDE_TABLE))) - table->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE); + + if (instance->GetBossState(DATA_ROTFACE) == DONE && instance->GetBossState(DATA_FESTERGUT) == DONE) + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); } void EnterCombat(Unit* who) @@ -235,8 +235,6 @@ class boss_professor_putricide : public CreatureScript DoZoneInCombat(me); instance->SetBossState(DATA_PROFESSOR_PUTRICIDE, IN_PROGRESS); - if (GameObject* table = ObjectAccessor::GetGameObject(*me, instance->GetData64(DATA_PUTRICIDE_TABLE))) - table->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE); } void JustReachedHome() @@ -501,8 +499,6 @@ class boss_professor_putricide : public CreatureScript events.CancelEvent(EVENT_UNSTABLE_EXPERIMENT); summons.DespawnEntry(NPC_MUTATED_ABOMINATION_10); summons.DespawnEntry(NPC_MUTATED_ABOMINATION_25); - if (GameObject* table = ObjectAccessor::GetGameObject(*me, instance->GetData64(DATA_PUTRICIDE_TABLE))) - table->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE); break; default: break; @@ -515,12 +511,22 @@ class boss_professor_putricide : public CreatureScript uint32 GetData(uint32 type) { - if (type == DATA_EXPERIMENT_STAGE) + switch (type) { - // ALSO MODIFIES! - uint32 ret = uint32(experimentState); - experimentState ^= true; - return ret; + case DATA_EXPERIMENT_STAGE: + { + // ALSO MODIFIES! + uint32 ret = uint32(experimentState); + experimentState ^= true; + return ret; + } + case DATA_PHASE: + return phase; + case DATA_ABOMINATION: + summons.RemoveNotExisting(); + return summons.HasEntry(NPC_MUTATED_ABOMINATION_10) || summons.HasEntry(NPC_MUTATED_ABOMINATION_25); + default: + break; } return 0; @@ -676,7 +682,7 @@ class boss_professor_putricide : public CreatureScript CreatureAI* GetAI(Creature* creature) const { - return new boss_professor_putricideAI(creature); + return GetIcecrownCitadelAI(creature); } }; @@ -737,7 +743,7 @@ class npc_volatile_ooze : public CreatureScript CreatureAI* GetAI(Creature* creature) const { - return new npc_volatile_oozeAI(creature); + return GetIcecrownCitadelAI(creature); } }; @@ -1027,28 +1033,33 @@ class spell_putricide_unbound_plague : public SpellScriptLoader { PrepareSpellScript(spell_putricide_unbound_plague_SpellScript); + bool Validate(SpellEntry const* /*spell*/) + { + if (!sSpellStore.LookupEntry(SPELL_UNBOUND_PLAGUE)) + return false; + if (!sSpellStore.LookupEntry(SPELL_UNBOUND_PLAGUE_SEARCHER)) + return false; + return true; + } + void HandleScript(SpellEffIndex /*effIndex*/) { if (!GetHitUnit()) return; - SpellEntry const* plague = sSpellStore.LookupEntry(SPELL_UNBOUND_PLAGUE); - SpellEntry const* searcher = sSpellStore.LookupEntry(SPELL_UNBOUND_PLAGUE_SEARCHER); - Creature* professor = NULL; - if (InstanceScript* instance = GetCaster()->GetInstanceScript()) - { - professor = Unit::GetCreature(*GetCaster(), instance->GetData64(DATA_PROFESSOR_PUTRICIDE)); - if (professor) - { - plague = sSpellMgr->GetSpellForDifficultyFromSpell(plague, professor); - searcher = sSpellMgr->GetSpellForDifficultyFromSpell(searcher, professor); - } - } + InstanceScript* instance = GetCaster()->GetInstanceScript(); + if (!instance) + return; + + SpellEntry const* plague = sSpellMgr->GetSpellForDifficultyFromSpell(sSpellStore.LookupEntry(SPELL_UNBOUND_PLAGUE), GetCaster()); + SpellEntry const* searcher = sSpellMgr->GetSpellForDifficultyFromSpell(sSpellStore.LookupEntry(SPELL_UNBOUND_PLAGUE_SEARCHER), GetCaster()); if (!GetHitUnit()->HasAura(plague->Id)) { - if (professor) + if (Creature* professor = ObjectAccessor::GetCreature(*GetCaster(), instance->GetData64(DATA_PROFESSOR_PUTRICIDE))) + { if (Aura* oldPlague = GetCaster()->GetAura(plague->Id, professor->GetGUID())) + { if (Aura* newPlague = professor->AddAura(plague->Id, GetHitUnit())) { newPlague->SetMaxDuration(oldPlague->GetDuration()); @@ -1059,6 +1070,8 @@ class spell_putricide_unbound_plague : public SpellScriptLoader GetCaster()->CastSpell(GetCaster(), SPELL_UNBOUND_PLAGUE_PROTECTION, true); professor->CastSpell(GetHitUnit(), SPELL_UNBOUND_PLAGUE_SEARCHER, true); } + } + } } } @@ -1170,6 +1183,60 @@ class spell_putricide_mutation_init : public SpellScriptLoader public: spell_putricide_mutation_init() : SpellScriptLoader("spell_putricide_mutation_init") { } + class spell_putricide_mutation_init_SpellScript : public SpellScript + { + PrepareSpellScript(spell_putricide_mutation_init_SpellScript); + + SpellCastResult CheckRequirementInternal(SpellCustomErrors& extendedError) + { + InstanceScript* instance = GetTargetUnit()->GetInstanceScript(); + if (!instance) + return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW; + + Creature* professor = ObjectAccessor::GetCreature(*GetTargetUnit(), instance->GetData64(DATA_PROFESSOR_PUTRICIDE)); + if (!professor) + return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW; + + if (professor->AI()->GetData(DATA_PHASE) == PHASE_COMBAT_3 || !professor->isAlive()) + { + extendedError = SPELL_CUSTOM_ERROR_ALL_POTIONS_USED; + return SPELL_FAILED_CUSTOM_ERROR; + } + + if (professor->AI()->GetData(DATA_ABOMINATION)) + { + extendedError = SPELL_CUSTOM_ERROR_TOO_MANY_ABOMINATIONS; + return SPELL_FAILED_CUSTOM_ERROR; + } + + return SPELL_CAST_OK; + } + + SpellCastResult CheckRequirement() + { + if (!GetTargetUnit()) + return SPELL_FAILED_BAD_TARGETS; + + if (GetTargetUnit()->GetTypeId() != TYPEID_PLAYER) + return SPELL_FAILED_TARGET_NOT_PLAYER; + + SpellCustomErrors extension = SPELL_CUSTOM_ERROR_NONE; + SpellCastResult result = CheckRequirementInternal(extension); + if (result != SPELL_CAST_OK) + { + Spell::SendCastResult(GetTargetUnit()->ToPlayer(), GetSpellInfo(), 0, result, extension); + return result; + } + + return SPELL_CAST_OK; + } + + void Register() + { + OnCheckCast += SpellCheckCastFn(spell_putricide_mutation_init_SpellScript::CheckRequirement); + } + }; + class spell_putricide_mutation_init_AuraScript : public AuraScript { PrepareAuraScript(spell_putricide_mutation_init_AuraScript); @@ -1189,6 +1256,11 @@ class spell_putricide_mutation_init : public SpellScriptLoader } }; + SpellScript* GetSpellScript() const + { + return new spell_putricide_mutation_init_SpellScript(); + } + AuraScript* GetAuraScript() const { return new spell_putricide_mutation_init_AuraScript(); @@ -1234,12 +1306,27 @@ class spell_putricide_mutated_transformation : public SpellScriptLoader void HandleSummon(SpellEffIndex effIndex) { PreventHitDefaultEffect(effIndex); - uint32 entry = uint32(GetSpellInfo()->EffectMiscValue[effIndex]); - SummonPropertiesEntry const* properties = sSummonPropertiesStore.LookupEntry(uint32(GetSpellInfo()->EffectMiscValueB[effIndex])); Unit* caster = GetOriginalCaster(); if (!caster) return; + InstanceScript* instance = GetTargetUnit()->GetInstanceScript(); + if (!instance) + return; + + Creature* putricide = ObjectAccessor::GetCreature(*GetTargetUnit(), instance->GetData64(DATA_PROFESSOR_PUTRICIDE)); + if (!putricide) + return; + + if (putricide->AI()->GetData(DATA_ABOMINATION)) + { + if (Player* plrCaster = caster->ToPlayer()) + Spell::SendCastResult(plrCaster, GetSpellInfo(), 0, SPELL_FAILED_CUSTOM_ERROR, SPELL_CUSTOM_ERROR_TOO_MANY_ABOMINATIONS); + return; + } + + uint32 entry = uint32(GetSpellInfo()->EffectMiscValue[effIndex]); + SummonPropertiesEntry const* properties = sSummonPropertiesStore.LookupEntry(uint32(GetSpellInfo()->EffectMiscValueB[effIndex])); uint32 duration = uint32(GetSpellDuration(GetSpellInfo())); Position pos; @@ -1251,13 +1338,11 @@ class spell_putricide_mutated_transformation : public SpellScriptLoader caster->CastSpell(summon, SPELL_MUTATED_TRANSFORMATION_NAME, true); summon->CastSpell(summon, SPELL_ABOMINATION_VEHICLE_POWER_DRAIN, true); summon->CastSpell(summon, SPELL_MUTATED_TRANSFORMATION_DAMAGE, true); - caster->EnterVehicle(summon->GetVehicleKit(), 0); + caster->EnterVehicle(summon, 0); summon->SetUInt32Value(UNIT_CREATED_BY_SPELL, GetSpellInfo()->Id); summon->SetCreatorGUID(caster->GetGUID()); - if (InstanceScript* instance = caster->GetInstanceScript()) - if (Creature* putricide = ObjectAccessor::GetCreature(*caster, instance->GetData64(DATA_PROFESSOR_PUTRICIDE))) - putricide->AI()->JustSummoned(summon); + putricide->AI()->JustSummoned(summon); } void Register() @@ -1342,8 +1427,7 @@ class spell_stinky_precious_decimate : public SpellScriptLoader if (GetHitUnit()->GetHealthPct() > float(GetEffectValue())) { uint32 newHealth = GetHitUnit()->GetMaxHealth() * uint32(GetEffectValue()) / 100; - if (GetHitUnit()->GetMaxHealth() >= newHealth) - GetHitUnit()->SetHealth(newHealth); + GetHitUnit()->SetHealth(newHealth); } } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp index efe33f6bd7412..51060932f5681 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_rotface.cpp @@ -18,7 +18,6 @@ #include "ObjectMgr.h" #include "ScriptMgr.h" #include "ScriptedCreature.h" -#include "SpellScript.h" #include "SpellAuras.h" #include "icecrown_citadel.h" @@ -74,7 +73,6 @@ enum Events EVENT_MORTAL_WOUND = 5, EVENT_STICKY_OOZE = 6, - EVENT_UNSTABLE_DESPAWN = 7, }; class boss_rotface : public CreatureScript @@ -90,14 +88,6 @@ class boss_rotface : public CreatureScript infectionCooldown = 14000; } - void InitializeAI() - { - if (!instance || static_cast(me->GetMap())->GetScriptId() != GetScriptId(ICCScriptName)) - me->IsAIEnabled = false; - else if (!me->isDead()) - Reset(); - } - void Reset() { _Reset(); @@ -208,7 +198,7 @@ class boss_rotface : public CreatureScript events.ScheduleEvent(EVENT_SLIME_SPRAY, 20000); break; case EVENT_HASTEN_INFECTIONS: - if (infectionStage < 4) + if (infectionStage++ < 4) { infectionCooldown -= 2000; events.ScheduleEvent(EVENT_HASTEN_INFECTIONS, 90000); @@ -234,12 +224,12 @@ class boss_rotface : public CreatureScript private: uint32 infectionCooldown; - uint8 infectionStage; + uint32 infectionStage; }; CreatureAI* GetAI(Creature* creature) const { - return new boss_rotfaceAI(creature); + return GetIcecrownCitadelAI(creature); } }; @@ -289,7 +279,7 @@ class npc_little_ooze : public CreatureScript CreatureAI* GetAI(Creature* creature) const { - return new npc_little_oozeAI(creature); + return GetIcecrownCitadelAI(creature); } }; @@ -300,7 +290,7 @@ class npc_big_ooze : public CreatureScript struct npc_big_oozeAI : public ScriptedAI { - npc_big_oozeAI(Creature* creature) : ScriptedAI(creature) + npc_big_oozeAI(Creature* creature) : ScriptedAI(creature), instance(creature->GetInstanceScript()) { } @@ -313,16 +303,14 @@ class npc_big_ooze : public CreatureScript DoCast(me, SPELL_GREEN_ABOMINATION_HITTIN__YA_PROC, true); events.ScheduleEvent(EVENT_STICKY_OOZE, 5000); // register in Rotface's summons - not summoned with Rotface as owner - if (InstanceScript* instance = me->GetInstanceScript()) - if (Creature* rotface = Unit::GetCreature(*me, instance->GetData64(DATA_ROTFACE))) - rotface->AI()->JustSummoned(me); + if (Creature* rotface = Unit::GetCreature(*me, instance->GetData64(DATA_ROTFACE))) + rotface->AI()->JustSummoned(me); } void JustDied(Unit* /*killer*/) { - if (InstanceScript* instance = me->GetInstanceScript()) - if (Creature* rotface = Unit::GetCreature(*me, instance->GetData64(DATA_ROTFACE))) - rotface->AI()->SummonedCreatureDespawn(me); + if (Creature* rotface = Unit::GetCreature(*me, instance->GetData64(DATA_ROTFACE))) + rotface->AI()->SummonedCreatureDespawn(me); me->DespawnOrUnsummon(); } @@ -330,13 +318,6 @@ class npc_big_ooze : public CreatureScript { if (action == EVENT_STICKY_OOZE) events.CancelEvent(EVENT_STICKY_OOZE); - else if (action == EVENT_UNSTABLE_DESPAWN) - { - me->RemoveAllAuras(); - me->SetVisible(false); - events.Reset(); - events.ScheduleEvent(EVENT_UNSTABLE_DESPAWN, 60000); - } } void UpdateAI(const uint32 diff) @@ -353,10 +334,6 @@ class npc_big_ooze : public CreatureScript case EVENT_STICKY_OOZE: DoCastVictim(SPELL_STICKY_OOZE); events.ScheduleEvent(EVENT_STICKY_OOZE, 15000); - break; - case EVENT_UNSTABLE_DESPAWN: - me->Kill(me); - break; default: break; } @@ -368,11 +345,12 @@ class npc_big_ooze : public CreatureScript private: EventMap events; + InstanceScript* instance; }; CreatureAI* GetAI(Creature* creature) const { - return new npc_big_oozeAI(creature); + return GetIcecrownCitadelAI(creature); } }; @@ -427,8 +405,7 @@ class npc_precious_icc : public CreatureScript void JustDied(Unit* /*who*/) { - uint64 rotfaceGUID = instance ? instance->GetData64(DATA_ROTFACE) : 0; - if (Creature* rotface = Unit::GetCreature(*me, rotfaceGUID)) + if (Creature* rotface = Unit::GetCreature(*me, instance->GetData64(DATA_ROTFACE))) if (rotface->isAlive()) rotface->AI()->Talk(SAY_PRECIOUS_DIES); } @@ -440,7 +417,7 @@ class npc_precious_icc : public CreatureScript CreatureAI* GetAI(Creature* creature) const { - return new npc_precious_iccAI(creature); + return GetIcecrownCitadelAI(creature); } }; @@ -707,7 +684,9 @@ class spell_rotface_unstable_ooze_explosion_suicide : public SpellScriptLoader if (target->GetTypeId() != TYPEID_UNIT) return; - target->ToCreature()->AI()->DoAction(EVENT_UNSTABLE_DESPAWN); + target->RemoveAllAuras(); + target->SetVisible(false); + target->ToCreature()->DespawnOrUnsummon(60000); } void Register() @@ -722,6 +701,42 @@ class spell_rotface_unstable_ooze_explosion_suicide : public SpellScriptLoader } }; +class spell_rotface_slime_spray : public SpellScriptLoader +{ + public: + spell_rotface_slime_spray() : SpellScriptLoader("spell_rotface_slime_spray") { } + + class spell_rotface_slime_spray_SpellScript : public SpellScript + { + PrepareSpellScript(spell_rotface_slime_spray_SpellScript); + + bool Validate(SpellEntry const* /*spell*/) + { + if (!sSpellStore.LookupEntry(SPELL_GREEN_BLIGHT_RESIDUE)) + return false; + return true; + } + + void ExtraEffect() + { + if (GetHitUnit()->HasAura(SPELL_GREEN_BLIGHT_RESIDUE)) + return; + + GetHitUnit()->CastSpell(GetHitUnit(), SPELL_GREEN_BLIGHT_RESIDUE, true); + } + + void Register() + { + AfterHit += SpellHitFn(spell_rotface_slime_spray_SpellScript::ExtraEffect); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_rotface_slime_spray_SpellScript(); + } +}; + void AddSC_boss_rotface() { new boss_rotface(); @@ -735,4 +750,5 @@ void AddSC_boss_rotface() new spell_rotface_unstable_ooze_explosion_init(); new spell_rotface_unstable_ooze_explosion(); new spell_rotface_unstable_ooze_explosion_suicide(); + new spell_rotface_slime_spray(); } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp index 8cbfbd895c57f..5debadb73eccb 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp @@ -18,7 +18,6 @@ #include "ObjectMgr.h" #include "ScriptMgr.h" #include "ScriptedCreature.h" -#include "SpellScript.h" #include "SpellAuraEffects.h" #include "icecrown_citadel.h" @@ -142,14 +141,14 @@ enum Shadowmourne SPELL_FROST_IMBUED_BLADE = 72290, }; -static Position const RimefangFlyPos = {4413.309f, 2456.421f, 223.3795f, 2.890186f}; -static Position const RimefangLandPos = {4413.309f, 2456.421f, 203.3848f, 2.890186f}; -static Position const SpinestalkerFlyPos = {4418.895f, 2514.233f, 220.4864f, 3.396045f}; -static Position const SpinestalkerLandPos = {4418.895f, 2514.233f, 203.3848f, 3.396045f}; - Position const SindragosaSpawnPos = {4818.700f, 2483.710f, 287.0650f, 3.089233f}; -static Position const SindragosaFlyPos = {4475.190f, 2484.570f, 234.8510f, 3.141593f}; -static Position const SindragosaLandPos = {4419.190f, 2484.570f, 203.3848f, 3.141593f}; -static Position const SindragosaAirPos = {4475.990f, 2484.430f, 247.9340f, 3.141593f}; +Position const RimefangFlyPos = {4413.309f, 2456.421f, 223.3795f, 2.890186f}; +Position const RimefangLandPos = {4413.309f, 2456.421f, 203.3848f, 2.890186f}; +Position const SpinestalkerFlyPos = {4418.895f, 2514.233f, 220.4864f, 3.396045f}; +Position const SpinestalkerLandPos = {4418.895f, 2514.233f, 203.3848f, 3.396045f}; +Position const SindragosaSpawnPos = {4818.700f, 2483.710f, 287.0650f, 3.089233f}; +Position const SindragosaFlyPos = {4475.190f, 2484.570f, 234.8510f, 3.141593f}; +Position const SindragosaLandPos = {4419.190f, 2484.570f, 203.3848f, 3.141593f}; +Position const SindragosaAirPos = {4475.990f, 2484.430f, 247.9340f, 3.141593f}; class FrostwyrmLandEvent : public BasicEvent { @@ -781,7 +780,7 @@ class npc_rimefang : public CreatureScript break; case EVENT_ICY_BLAST: { - icyBlastCounter = RAID_MODE(5, 7, 6, 8); + icyBlastCounter = RAID_MODE(5, 7, 6, 8); me->SetReactState(REACT_PASSIVE); me->AttackStop(); me->SetFlying(true); @@ -922,8 +921,8 @@ class npc_sindragosa_trash : public CreatureScript } private: - InstanceScript* instance; EventMap events; + InstanceScript* instance; uint32 frostwyrmId; bool isTaunted; // Frostwing Whelp only }; @@ -1011,7 +1010,7 @@ class spell_sindragosa_unchained_magic : public SpellScriptLoader void FilterTargets(std::list& unitList) { unitList.remove_if(UnchainedMagicTargetSelector()); - uint32 maxSize = GetCaster()->GetMap()->GetSpawnMode() & 1 ? 5 : 2; + uint32 maxSize = uint32(GetCaster()->GetMap()->GetSpawnMode() & 1 ? 5 : 2); if (unitList.size() > maxSize) Trinity::RandomResizeList(unitList, maxSize); } @@ -1166,14 +1165,14 @@ class spell_sindragosa_ice_tomb : public SpellScriptLoader class FrostBombTargetSelector { public: - FrostBombTargetSelector(Unit* _caster, std::list const& _collisionList) : caster(_caster), collisionList(_collisionList) { } + FrostBombTargetSelector(Unit* _caster, std::list const& _collisionList) : caster(_caster), collisionList(_collisionList) { } bool operator()(Unit* unit) { if (unit->HasAura(SPELL_ICE_TOMB_DAMAGE)) return true; - for (std::list::const_iterator itr = collisionList.begin(); itr != collisionList.end(); ++itr) + for (std::list::const_iterator itr = collisionList.begin(); itr != collisionList.end(); ++itr) if ((*itr)->IsInBetween(caster, unit)) return true; @@ -1181,7 +1180,7 @@ class FrostBombTargetSelector } Unit* caster; - std::list const& collisionList; + std::list const& collisionList; }; class spell_sindragosa_collision_filter : public SpellScriptLoader @@ -1193,13 +1192,17 @@ class spell_sindragosa_collision_filter : public SpellScriptLoader { PrepareSpellScript(spell_sindragosa_collision_filter_SpellScript); - void FilterTargets(std::list& unitList) + bool Validate(SpellEntry const* /*spell*/) { - std::list tombs; - for (std::list::const_iterator itr = unitList.begin(); itr != unitList.end(); ++itr) - if ((*itr)->HasAura(SPELL_ICE_TOMB_DAMAGE)) - tombs.push_back(*itr); + if (!sSpellStore.LookupEntry(SPELL_ICE_TOMB_DAMAGE)) + return false; + return true; + } + void FilterTargets(std::list& unitList) + { + std::list tombs; + GetCreatureListWithEntryInGrid(tombs, GetCaster(), NPC_ICE_TOMB, 200.0f); unitList.remove_if(FrostBombTargetSelector(GetCaster(), tombs)); } @@ -1387,7 +1390,7 @@ class spell_frostwarden_handler_focus_fire : public SpellScriptLoader { PrepareAuraScript(spell_frostwarden_handler_focus_fire_AuraScript); - void PeriodicTick(AuraEffect const* aurEff) + void PeriodicTick(AuraEffect const* /*aurEff*/) { PreventDefaultAction(); if (Unit* caster = GetCaster()) @@ -1414,40 +1417,6 @@ class spell_frostwarden_handler_focus_fire : public SpellScriptLoader } }; -class spell_trigger_spell_from_caster : public SpellScriptLoader -{ - public: - spell_trigger_spell_from_caster(char const* scriptName, uint32 _triggerId) : SpellScriptLoader(scriptName), triggerId(_triggerId) { } - - class spell_trigger_spell_from_caster_SpellScript : public SpellScript - { - PrepareSpellScript(spell_trigger_spell_from_caster_SpellScript); - - public: - spell_trigger_spell_from_caster_SpellScript(uint32 _triggerId) : SpellScript(), triggerId(_triggerId) { } - - void HandleTrigger() - { - GetCaster()->CastSpell(GetHitUnit(), triggerId, true); - } - - void Register() - { - AfterHit += SpellHitFn(spell_trigger_spell_from_caster_SpellScript::HandleTrigger); - } - - uint32 triggerId; - }; - - SpellScript* GetSpellScript() const - { - return new spell_trigger_spell_from_caster_SpellScript(triggerId); - } - - private: - uint32 triggerId; -}; - class at_sindragosa_lair : public AreaTriggerScript { public: @@ -1467,6 +1436,9 @@ class at_sindragosa_lair : public AreaTriggerScript if (!instance->GetData(DATA_SINDRAGOSA_FROSTWYRMS) && instance->GetBossState(DATA_SINDRAGOSA) != DONE) { + if (player->GetMap()->IsHeroic() && !instance->GetData(DATA_HEROIC_ATTEMPTS)) + return true; + player->GetMap()->LoadGrid(SindragosaSpawnPos.GetPositionX(), SindragosaSpawnPos.GetPositionY()); if (Creature* sindragosa = player->GetMap()->SummonCreature(NPC_SINDRAGOSA, SindragosaSpawnPos)) { diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp index 7a0dfc76fd5b0..32420c9261dbd 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp @@ -18,46 +18,325 @@ #include "ObjectMgr.h" #include "ScriptMgr.h" #include "ScriptedCreature.h" -#include "SpellScript.h" #include "SpellAuraEffects.h" #include "icecrown_citadel.h" // Weekly quest support -//* Deprogramming +//* Deprogramming (DONE) //* Securing the Ramparts (DONE) -//* Residue Rendezvous -//* Blood Quickening +//* Residue Rendezvous (DONE) +//* Blood Quickening (DONE) //* Respite for a Tormented Soul enum Texts { + // Highlord Tirion Fordring (at Light's Hammer) + SAY_TIRION_INTRO_1 = 0, + SAY_TIRION_INTRO_2 = 1, + SAY_TIRION_INTRO_3 = 2, + SAY_TIRION_INTRO_4 = 3, + SAY_TIRION_INTRO_H_5 = 4, + SAY_TIRION_INTRO_A_5 = 5, + + // The Lich King (at Light's Hammer) + SAY_LK_INTRO_1 = 0, + SAY_LK_INTRO_2 = 1, + SAY_LK_INTRO_3 = 2, + SAY_LK_INTRO_4 = 3, + SAY_LK_INTRO_5 = 4, + + // Highlord Bolvar Fordragon (at Light's Hammer) + SAY_BOLVAR_INTRO_1 = 0, + + // High Overlord Saurfang (at Light's Hammer) + SAY_SAURFANG_INTRO_1 = 15, + SAY_SAURFANG_INTRO_2 = 16, + SAY_SAURFANG_INTRO_3 = 17, + SAY_SAURFANG_INTRO_4 = 18, + + // Muradin Bronzebeard (at Light's Hammer) + SAY_MURADIN_INTRO_1 = 13, + SAY_MURADIN_INTRO_2 = 14, + SAY_MURADIN_INTRO_3 = 15, + // Rotting Frost Giant - EMOTE_DEATH_PLAGUE_WARNING = 0, + EMOTE_DEATH_PLAGUE_WARNING = 0, }; enum Spells { // Rotting Frost Giant - SPELL_DEATH_PLAGUE = 72879, - SPELL_DEATH_PLAGUE_AURA = 72865, - SPELL_RECENTLY_INFECTED = 72884, - SPELL_DEATH_PLAGUE_KILL = 72867, - SPELL_STOMP = 64652, - SPELL_ARCTIC_BREATH = 72848, + SPELL_DEATH_PLAGUE = 72879, + SPELL_DEATH_PLAGUE_AURA = 72865, + SPELL_RECENTLY_INFECTED = 72884, + SPELL_DEATH_PLAGUE_KILL = 72867, + SPELL_STOMP = 64652, + SPELL_ARCTIC_BREATH = 72848, // Frost Freeze Trap - SPELL_COLDFLAME_JETS = 70460, + SPELL_COLDFLAME_JETS = 70460, + + // Alchemist Adrianna + SPELL_HARVEST_BLIGHT_SPECIMEN = 72155, + SPELL_HARVEST_BLIGHT_SPECIMEN25 = 72162, }; enum Events { + // Highlord Tirion Fordring (at Light's Hammer) + // The Lich King (at Light's Hammer) + // Highlord Bolvar Fordragon (at Light's Hammer) + // High Overlord Saurfang (at Light's Hammer) + // Muradin Bronzebeard (at Light's Hammer) + EVENT_TIRION_INTRO_2 = 1, + EVENT_TIRION_INTRO_3 = 2, + EVENT_TIRION_INTRO_4 = 3, + EVENT_TIRION_INTRO_5 = 4, + EVENT_LK_INTRO_1 = 5, + EVENT_TIRION_INTRO_6 = 6, + EVENT_LK_INTRO_2 = 7, + EVENT_LK_INTRO_3 = 8, + EVENT_LK_INTRO_4 = 9, + EVENT_BOLVAR_INTRO_1 = 10, + EVENT_LK_INTRO_5 = 11, + EVENT_SAURFANG_INTRO_1 = 12, + EVENT_TIRION_INTRO_H_7 = 13, + EVENT_SAURFANG_INTRO_2 = 14, + EVENT_SAURFANG_INTRO_3 = 15, + EVENT_SAURFANG_INTRO_4 = 16, + EVENT_SAURFANG_RUN = 17, + EVENT_MURADIN_INTRO_1 = 18, + EVENT_MURADIN_INTRO_2 = 19, + EVENT_MURADIN_INTRO_3 = 20, + EVENT_TIRION_INTRO_A_7 = 21, + EVENT_MURADIN_INTRO_4 = 22, + EVENT_MURADIN_INTRO_5 = 23, + EVENT_MURADIN_RUN = 24, + // Rotting Frost Giant - EVENT_DEATH_PLAGUE = 1, - EVENT_STOMP = 2, - EVENT_ARCTIC_BREATH = 3, + EVENT_DEATH_PLAGUE = 25, + EVENT_STOMP = 26, + EVENT_ARCTIC_BREATH = 27, // Frost Freeze Trap - EVENT_ACTIVATE_TRAP = 4, + EVENT_ACTIVATE_TRAP = 28, +}; + +enum DataTypesICC +{ + DATA_DAMNED_KILLS = 1, +}; + +// at Light's Hammer +class npc_highlord_tirion_fordring_lh : public CreatureScript +{ + public: + npc_highlord_tirion_fordring_lh() : CreatureScript("npc_highlord_tirion_fordring_lh") { } + + struct npc_highlord_tirion_fordringAI : public ScriptedAI + { + npc_highlord_tirion_fordringAI(Creature* creature) : ScriptedAI(creature), instance(creature->GetInstanceScript()) + { + } + + void Reset() + { + events.Reset(); + _theLichKing = 0; + _bolvarFordragon = 0; + _factionNPC = 0; + _damnedKills = 0; + } + + // IMPORTANT NOTE: This is triggered from per-GUID scripts + // of The Damned SAI + void SetData(uint32 type, uint32 data) + { + if (type == DATA_DAMNED_KILLS && data == 1) + { + if (++_damnedKills == 2) + { + if (Creature* theLichKing = me->FindNearestCreature(NPC_THE_LICH_KING_LH, 150.0f)) + { + if (Creature* bolvarFordragon = me->FindNearestCreature(NPC_HIGHLORD_BOLVAR_FORDRAGON_LH, 150.0f)) + { + if (Creature* factionNPC = me->FindNearestCreature(instance->GetData(DATA_TEAM_IN_INSTANCE) == HORDE ? NPC_SE_HIGH_OVERLORD_SAURFANG : NPC_SE_MURADIN_BRONZEBEARD, 50.0f)) + { + me->setActive(true); + _theLichKing = theLichKing->GetGUID(); + theLichKing->setActive(true); + _bolvarFordragon = bolvarFordragon->GetGUID(); + bolvarFordragon->setActive(true); + _factionNPC = factionNPC->GetGUID(); + factionNPC->setActive(true); + } + } + } + + if (!_bolvarFordragon || !_theLichKing || !_factionNPC) + return; + + Talk(SAY_TIRION_INTRO_1); + events.ScheduleEvent(EVENT_TIRION_INTRO_2, 4000); + events.ScheduleEvent(EVENT_TIRION_INTRO_3, 14000); + events.ScheduleEvent(EVENT_TIRION_INTRO_4, 18000); + events.ScheduleEvent(EVENT_TIRION_INTRO_5, 31000); + events.ScheduleEvent(EVENT_LK_INTRO_1, 35000); + events.ScheduleEvent(EVENT_TIRION_INTRO_6, 51000); + events.ScheduleEvent(EVENT_LK_INTRO_2, 58000); + events.ScheduleEvent(EVENT_LK_INTRO_3, 74000); + events.ScheduleEvent(EVENT_LK_INTRO_4, 86000); + events.ScheduleEvent(EVENT_BOLVAR_INTRO_1, 100000); + events.ScheduleEvent(EVENT_LK_INTRO_5, 108000); + + if (instance->GetData(DATA_TEAM_IN_INSTANCE) == HORDE) + { + events.ScheduleEvent(EVENT_SAURFANG_INTRO_1, 120000); + events.ScheduleEvent(EVENT_TIRION_INTRO_H_7, 129000); + events.ScheduleEvent(EVENT_SAURFANG_INTRO_2, 139000); + events.ScheduleEvent(EVENT_SAURFANG_INTRO_3, 150000); + events.ScheduleEvent(EVENT_SAURFANG_INTRO_4, 162000); + events.ScheduleEvent(EVENT_SAURFANG_RUN, 170000); + } + else + { + events.ScheduleEvent(EVENT_MURADIN_INTRO_1, 120000); + events.ScheduleEvent(EVENT_MURADIN_INTRO_2, 124000); + events.ScheduleEvent(EVENT_MURADIN_INTRO_3, 127000); + events.ScheduleEvent(EVENT_TIRION_INTRO_A_7, 136000); + events.ScheduleEvent(EVENT_MURADIN_INTRO_4, 144000); + events.ScheduleEvent(EVENT_MURADIN_INTRO_5, 151000); + events.ScheduleEvent(EVENT_MURADIN_RUN, 157000); + } + } + } + } + + void UpdateAI(uint32 const diff) + { + if (_damnedKills != 2) + return; + + events.Update(diff); + + while (uint32 eventId = events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_TIRION_INTRO_2: + me->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION); + break; + case EVENT_TIRION_INTRO_3: + Talk(SAY_TIRION_INTRO_2); + break; + case EVENT_TIRION_INTRO_4: + me->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION); + break; + case EVENT_TIRION_INTRO_5: + Talk(SAY_TIRION_INTRO_3); + break; + case EVENT_LK_INTRO_1: + me->HandleEmoteCommand(EMOTE_ONESHOT_POINT_NOSHEATHE); + if (Creature* theLichKing = ObjectAccessor::GetCreature(*me, _theLichKing)) + theLichKing->AI()->Talk(SAY_LK_INTRO_1); + break; + case EVENT_TIRION_INTRO_6: + Talk(SAY_TIRION_INTRO_4); + break; + case EVENT_LK_INTRO_2: + if (Creature* theLichKing = ObjectAccessor::GetCreature(*me, _theLichKing)) + theLichKing->AI()->Talk(SAY_LK_INTRO_2); + break; + case EVENT_LK_INTRO_3: + if (Creature* theLichKing = ObjectAccessor::GetCreature(*me, _theLichKing)) + theLichKing->AI()->Talk(SAY_LK_INTRO_3); + break; + case EVENT_LK_INTRO_4: + if (Creature* theLichKing = ObjectAccessor::GetCreature(*me, _theLichKing)) + theLichKing->AI()->Talk(SAY_LK_INTRO_4); + break; + case EVENT_BOLVAR_INTRO_1: + if (Creature* bolvarFordragon = ObjectAccessor::GetCreature(*me, _bolvarFordragon)) + { + bolvarFordragon->AI()->Talk(SAY_BOLVAR_INTRO_1); + bolvarFordragon->setActive(false); + } + break; + case EVENT_LK_INTRO_5: + if (Creature* theLichKing = ObjectAccessor::GetCreature(*me, _theLichKing)) + { + theLichKing->AI()->Talk(SAY_LK_INTRO_5); + theLichKing->setActive(false); + } + break; + case EVENT_SAURFANG_INTRO_1: + if (Creature* saurfang = ObjectAccessor::GetCreature(*me, _factionNPC)) + saurfang->AI()->Talk(SAY_SAURFANG_INTRO_1); + break; + case EVENT_TIRION_INTRO_H_7: + Talk(SAY_TIRION_INTRO_H_5); + break; + case EVENT_SAURFANG_INTRO_2: + if (Creature* saurfang = ObjectAccessor::GetCreature(*me, _factionNPC)) + saurfang->AI()->Talk(SAY_SAURFANG_INTRO_2); + break; + case EVENT_SAURFANG_INTRO_3: + if (Creature* saurfang = ObjectAccessor::GetCreature(*me, _factionNPC)) + saurfang->AI()->Talk(SAY_SAURFANG_INTRO_3); + break; + case EVENT_SAURFANG_INTRO_4: + if (Creature* saurfang = ObjectAccessor::GetCreature(*me, _factionNPC)) + saurfang->AI()->Talk(SAY_SAURFANG_INTRO_4); + break; + case EVENT_MURADIN_RUN: + case EVENT_SAURFANG_RUN: + if (Creature* factionNPC = ObjectAccessor::GetCreature(*me, _factionNPC)) + factionNPC->GetMotionMaster()->MovePath(factionNPC->GetDBTableGUIDLow()*10, false); + me->setActive(false); + _damnedKills = 3; + break; + case EVENT_MURADIN_INTRO_1: + if (Creature* muradin = ObjectAccessor::GetCreature(*me, _factionNPC)) + muradin->AI()->Talk(SAY_MURADIN_INTRO_1); + break; + case EVENT_MURADIN_INTRO_2: + if (Creature* muradin = ObjectAccessor::GetCreature(*me, _factionNPC)) + muradin->HandleEmoteCommand(EMOTE_ONESHOT_TALK); + break; + case EVENT_MURADIN_INTRO_3: + if (Creature* muradin = ObjectAccessor::GetCreature(*me, _factionNPC)) + muradin->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION); + break; + case EVENT_TIRION_INTRO_A_7: + Talk(SAY_TIRION_INTRO_A_5); + break; + case EVENT_MURADIN_INTRO_4: + if (Creature* muradin = ObjectAccessor::GetCreature(*me, _factionNPC)) + muradin->AI()->Talk(SAY_MURADIN_INTRO_2); + break; + case EVENT_MURADIN_INTRO_5: + if (Creature* muradin = ObjectAccessor::GetCreature(*me, _factionNPC)) + muradin->AI()->Talk(SAY_MURADIN_INTRO_3); + break; + default: + break; + } + } + } + + private: + EventMap events; + InstanceScript* const instance; + uint64 _theLichKing; + uint64 _bolvarFordragon; + uint64 _factionNPC; + uint16 _damnedKills; + }; + + CreatureAI* GetAI(Creature* creature) const + { + return GetIcecrownCitadelAI(creature); + } }; class npc_rotting_frost_giant : public CreatureScript @@ -84,7 +363,7 @@ class npc_rotting_frost_giant : public CreatureScript events.Reset(); } - void UpdateAI(const uint32 diff) + void UpdateAI(uint32 const diff) { if (!UpdateVictim()) return; @@ -128,7 +407,7 @@ class npc_rotting_frost_giant : public CreatureScript CreatureAI* GetAI(Creature* creature) const { - return new npc_rotting_frost_giantAI(creature); + return GetIcecrownCitadelAI(creature); } }; @@ -143,7 +422,7 @@ class npc_frost_freeze_trap : public CreatureScript { } - void DoAction(const int32 action) + void DoAction(int32 const action) { switch (action) { @@ -160,7 +439,7 @@ class npc_frost_freeze_trap : public CreatureScript } } - void UpdateAI(const uint32 diff) + void UpdateAI(uint32 const diff) { events.Update(diff); @@ -177,7 +456,21 @@ class npc_frost_freeze_trap : public CreatureScript CreatureAI* GetAI(Creature* creature) const { - return new npc_frost_freeze_trapAI(creature); + return GetIcecrownCitadelAI(creature); + } +}; + +class npc_alchemist_adrianna : public CreatureScript +{ + public: + npc_alchemist_adrianna() : CreatureScript("npc_alchemist_adrianna") { } + + bool OnGossipHello(Player* player, Creature* creature) + { + if (!creature->FindCurrentSpellBySpellId(SPELL_HARVEST_BLIGHT_SPECIMEN) && !creature->FindCurrentSpellBySpellId(SPELL_HARVEST_BLIGHT_SPECIMEN25)) + if (player->HasAura(SPELL_ORANGE_BLIGHT_RESIDUE) && player->HasAura(SPELL_GREEN_BLIGHT_RESIDUE)) + creature->CastSpell(creature, SPELL_HARVEST_BLIGHT_SPECIMEN, false); + return false; } }; @@ -267,6 +560,39 @@ class spell_frost_giant_death_plague : public SpellScriptLoader } }; +class spell_icc_harvest_blight_specimen : public SpellScriptLoader +{ + public: + spell_icc_harvest_blight_specimen() : SpellScriptLoader("spell_icc_harvest_blight_specimen") { } + + class spell_icc_harvest_blight_specimen_SpellScript : public SpellScript + { + PrepareSpellScript(spell_icc_harvest_blight_specimen_SpellScript); + + void HandleScript(SpellEffIndex effIndex) + { + PreventHitDefaultEffect(effIndex); + GetHitUnit()->RemoveAurasDueToSpell(uint32(GetEffectValue())); + } + + void HandleQuestComplete(SpellEffIndex /*effIndex*/) + { + GetHitUnit()->RemoveAurasDueToSpell(uint32(GetEffectValue())); + } + + void Register() + { + OnEffect += SpellEffectFn(spell_icc_harvest_blight_specimen_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + OnEffect += SpellEffectFn(spell_icc_harvest_blight_specimen_SpellScript::HandleQuestComplete, EFFECT_1, SPELL_EFFECT_QUEST_COMPLETE); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_icc_harvest_blight_specimen_SpellScript(); + } +}; + class at_icc_saurfang_portal : public AreaTriggerScript { public: @@ -314,11 +640,29 @@ class at_icc_shutdown_traps : public AreaTriggerScript } }; +class at_icc_start_blood_quickening : public AreaTriggerScript +{ + public: + at_icc_start_blood_quickening() : AreaTriggerScript("at_icc_start_blood_quickening") { } + + bool OnTrigger(Player* player, AreaTriggerEntry const* /*areaTrigger*/) + { + if (InstanceScript* instance = player->GetInstanceScript()) + if (instance->GetData(DATA_BLOOD_QUICKENING_STATE) == NOT_STARTED) + instance->SetData(DATA_BLOOD_QUICKENING_STATE, IN_PROGRESS); + return true; + } +}; + void AddSC_icecrown_citadel() { + new npc_highlord_tirion_fordring_lh(); new npc_rotting_frost_giant(); new npc_frost_freeze_trap(); + new npc_alchemist_adrianna(); new spell_frost_giant_death_plague(); + new spell_icc_harvest_blight_specimen(); new at_icc_saurfang_portal(); new at_icc_shutdown_traps(); + new at_icc_start_blood_quickening(); } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.h b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.h index 5f09434064f93..4fd10463dcca2 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.h +++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.h @@ -15,16 +15,30 @@ * with this program. If not, see . */ -#ifndef DEF_ICECROWN_CITADEL_H -#define DEF_ICECROWN_CITADEL_H +#ifndef ICECROWN_CITADEL_H_ +#define ICECROWN_CITADEL_H_ + +#include "SpellScript.h" +#include "Map.h" +#include "Creature.h" #define ICCScriptName "instance_icecrown_citadel" -// Shared spells used by every boss +uint32 const EncounterCount = 12; +uint32 const WeeklyNPCs = 7; +uint32 const MaxHeroicAttempts = 50; +// Defined in boss_sindragosa.cpp +extern Position const SindragosaSpawnPos; + +// Shared spells used by more than one script enum SharedSpells { - SPELL_BERSERK = 26662, - SPELL_BERSERK2 = 47008 + SPELL_BERSERK = 26662, + SPELL_BERSERK2 = 47008, + + // Residue Rendezvous + SPELL_ORANGE_BLIGHT_RESIDUE = 72144, + SPELL_GREEN_BLIGHT_RESIDUE = 72145, }; enum TeleporterSpells @@ -35,7 +49,7 @@ enum TeleporterSpells DEATHBRINGER_S_RISE_TELEPORT = 70858, UPPER_SPIRE_TELEPORT = 70859, FROZEN_THRONE_TELEPORT = 70860, - SINDRAGOSA_S_LAIR_TELEPORT = 70861 + SINDRAGOSA_S_LAIR_TELEPORT = 70861, }; enum DataTypes @@ -69,17 +83,19 @@ enum DataTypes DATA_SPINESTALKER = 23, DATA_RIMEFANG = 24, DATA_COLDFLAME_JETS = 25, + DATA_TEAM_IN_INSTANCE = 26, + DATA_BLOOD_QUICKENING_STATE = 27, + DATA_HEROIC_ATTEMPTS = 28, }; -#define MAX_ENCOUNTER 12 - enum CreaturesIds { // At Light's Hammer + NPC_HIGHLORD_TIRION_FORDRING_LH = 37119, + NPC_THE_LICH_KING_LH = 37181, + NPC_HIGHLORD_BOLVAR_FORDRAGON_LH = 37183, NPC_KOR_KRON_GENERAL = 37189, NPC_ALLIANCE_COMMANDER = 37190, - NPC_KOR_KRON_LIEUTENANT = 38491, - NPC_SKYBREAKER_LIEUTENANT = 38492, NPC_TORTUNOK = 37992, // Druid Armor H NPC_ALANA_MOONSTRIKE = 37999, // Druid Armor A NPC_GERARDO_THE_SUAVE = 37993, // Hunter Armor H @@ -95,6 +111,16 @@ enum CreaturesIds NPC_GARROSH_HELLSCREAM = 39372, NPC_KING_VARIAN_WRYNN = 39371, + // Weekly quests + NPC_INFILTRATOR_MINCHAR = 38471, + NPC_KOR_KRON_LIEUTENANT = 38491, + NPC_SKYBREAKER_LIEUTENANT = 38492, + NPC_ALCHEMIST_ADRIANNA = 38501, + NPC_ALRIN_THE_AGILE = 38551, + NPC_INFILTRATOR_MINCHAR_BQ = 38558, + NPC_MINCHAR_BEAM_STALKER = 38557, + NPC_VALITHRIA_DREAMWALKER_QUEST = 38589, + // Lord Marrowgar NPC_LORD_MARROWGAR = 36612, NPC_COLDFLAME = 36672, @@ -198,6 +224,7 @@ enum GameObjectsIds GO_DOODAD_ICECROWN_GREENTUBES02 = 201618, GO_SCIENTIST_ENTRANCE = 201372, GO_DRINK_ME = 201584, + GO_PLAGUE_SIGIL = 202182, // Blood Prince Council GO_CRIMSON_HALL_DOOR = 201376, @@ -207,6 +234,7 @@ enum GameObjectsIds // Blood-Queen Lana'thel GO_DOODAD_ICECROWN_BLOODPRINCE_DOOR_01 = 201746, GO_DOODAD_ICECROWN_GRATE_01 = 201755, + GO_BLOODWING_SIGIL = 202183, // Valithria Dreamwalker GO_GREEN_DRAGON_BOSS_ENTRANCE = 201375, @@ -218,6 +246,7 @@ enum GameObjectsIds GO_SINDRAGOSA_SHORTCUT_EXIT_DOOR = 201379, GO_ICE_WALL = 202396, GO_ICE_BLOCK = 201722, + GO_SIGIL_OF_THE_FROSTWING = 202181, }; enum AchievementCriteriaIds @@ -271,12 +300,86 @@ enum SharedActions ACTION_ROTFACE_DEATH = -366272, ACTION_CHANGE_PHASE = -366780, + // Blood-Queen Lana'thel + ACTION_KILL_MINCHAR = -379550, + // Sindragosa ACTION_START_FROSTWYRM = -368530, ACTION_TRIGGER_ASPHYXIATION = -368531, }; -// Declaration -extern Position const SindragosaSpawnPos; +enum WeekliesICC +{ + QUEST_DEPROGRAMMING_10 = 24869, + QUEST_DEPROGRAMMING_25 = 24875, + QUEST_SECURING_THE_RAMPARTS_10 = 24870, + QUEST_SECURING_THE_RAMPARTS_25 = 24877, + QUEST_RESIDUE_RENDEZVOUS_10 = 24873, + QUEST_RESIDUE_RENDEZVOUS_25 = 24878, + QUEST_BLOOD_QUICKENING_10 = 24874, + QUEST_BLOOD_QUICKENING_25 = 24879, + QUEST_RESPITE_FOR_A_TORNMENTED_SOUL_10 = 24872, + QUEST_RESPITE_FOR_A_TORNMENTED_SOUL_25 = 24880, +}; -#endif // DEF_ICECROWN_CITADEL_H +enum WorldStatesICC +{ + WORLDSTATE_SHOW_TIMER = 4903, + WORLDSTATE_EXECUTION_TIME = 4904, + WORLDSTATE_SHOW_ATTEMPTS = 4940, + WORLDSTATE_ATTEMPTS_REMAINING = 4941, + WORLDSTATE_ATTEMPTS_MAX = 4942, +}; + +class spell_trigger_spell_from_caster : public SpellScriptLoader +{ + public: + spell_trigger_spell_from_caster(char const* scriptName, uint32 triggerId) : SpellScriptLoader(scriptName), _triggerId(triggerId) { } + + class spell_trigger_spell_from_caster_SpellScript : public SpellScript + { + PrepareSpellScript(spell_trigger_spell_from_caster_SpellScript); + + public: + spell_trigger_spell_from_caster_SpellScript(uint32 triggerId) : SpellScript(), _triggerId(triggerId) { } + + bool Validate(SpellEntry const* /*spell*/) + { + if (!sSpellStore.LookupEntry(_triggerId)) + return false; + return true; + } + + void HandleTrigger() + { + GetCaster()->CastSpell(GetHitUnit(), _triggerId, true); + } + + void Register() + { + AfterHit += SpellHitFn(spell_trigger_spell_from_caster_SpellScript::HandleTrigger); + } + + uint32 _triggerId; + }; + + SpellScript* GetSpellScript() const + { + return new spell_trigger_spell_from_caster_SpellScript(_triggerId); + } + + private: + uint32 _triggerId; +}; + +template +CreatureAI* GetIcecrownCitadelAI(Creature* creature) +{ + if (InstanceMap* instance = creature->GetMap()->ToInstanceMap()) + if (instance->GetInstanceScript()) + if (instance->GetScriptId() == GetScriptId(ICCScriptName)) + return new AI(creature); + return NULL; +} + +#endif // ICECROWN_CITADEL_H_ diff --git a/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp index a905fe0dd5fea..512ee9950c315 100755 --- a/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp @@ -20,6 +20,7 @@ #include "InstanceScript.h" #include "ScriptedCreature.h" #include "Map.h" +#include "PoolMgr.h" #include "icecrown_citadel.h" static const DoorData doorData[] = @@ -47,6 +48,22 @@ static const DoorData doorData[] = {0, 0, DOOR_TYPE_ROOM, BOUNDARY_NONE} // END }; +// this doesnt have to only store questgivers, also can be used for related quest spawns +struct WeeklyQuest +{ + uint32 creatureEntry; + uint32 questId[2]; // 10 and 25 man versions +} WeeklyQuestData[WeeklyNPCs] = +{ + {NPC_INFILTRATOR_MINCHAR, {QUEST_DEPROGRAMMING_10, QUEST_DEPROGRAMMING_25 }}, // Deprogramming + {NPC_KOR_KRON_LIEUTENANT, {QUEST_SECURING_THE_RAMPARTS_10, QUEST_SECURING_THE_RAMPARTS_25 }}, // Securing the Ramparts + {NPC_ALCHEMIST_ADRIANNA, {QUEST_RESIDUE_RENDEZVOUS_10, QUEST_RESIDUE_RENDEZVOUS_25 }}, // Residue Rendezvous + {NPC_ALRIN_THE_AGILE, {QUEST_BLOOD_QUICKENING_10, QUEST_BLOOD_QUICKENING_25 }}, // Blood Quickening + {NPC_INFILTRATOR_MINCHAR_BQ, {QUEST_BLOOD_QUICKENING_10, QUEST_BLOOD_QUICKENING_25 }}, // Blood Quickening + {NPC_MINCHAR_BEAM_STALKER, {QUEST_BLOOD_QUICKENING_10, QUEST_BLOOD_QUICKENING_25 }}, // Blood Quickening + {NPC_VALITHRIA_DREAMWALKER_QUEST, {QUEST_RESPITE_FOR_A_TORNMENTED_SOUL_10, QUEST_RESPITE_FOR_A_TORNMENTED_SOUL_25}}, // Respite for a Tormented Soul +}; + class instance_icecrown_citadel : public InstanceMapScript { public: @@ -56,15 +73,19 @@ class instance_icecrown_citadel : public InstanceMapScript { instance_icecrown_citadel_InstanceMapScript(InstanceMap* map) : InstanceScript(map) { - SetBossNumber(MAX_ENCOUNTER); + SetBossNumber(EncounterCount); LoadDoorData(doorData); teamInInstance = 0; + heroicAttempts = MaxHeroicAttempts; ladyDeathwisperElevator = 0; deathbringerSaurfang = 0; saurfangDoor = 0; saurfangEventNPC = 0; deathbringersCache = 0; saurfangTeleport = 0; + plagueSigil = 0; + bloodwingSigil = 0; + frostwingSigil = 0; memset(putricidePipes, 0, 2*sizeof(uint64)); memset(putricideGates, 0, 2*sizeof(uint64)); putricideCollision = 0; @@ -86,6 +107,18 @@ class instance_icecrown_citadel : public InstanceMapScript isNauseaEligible = true; isOrbWhispererEligible = true; coldflameJetsState = NOT_STARTED; + bloodQuickeningState = NOT_STARTED; + bloodQuickeningTimer = 0; + bloodQuickeningMinutes = 0; + } + + void FillInitialWorldStates(WorldPacket& data) + { + data << uint32(WORLDSTATE_SHOW_TIMER) << uint32(bloodQuickeningState == IN_PROGRESS); + data << uint32(WORLDSTATE_EXECUTION_TIME) << uint32(bloodQuickeningMinutes); + data << uint32(WORLDSTATE_SHOW_ATTEMPTS) << uint32(instance->IsHeroic()); + data << uint32(WORLDSTATE_ATTEMPTS_REMAINING) << uint32(heroicAttempts); + data << uint32(WORLDSTATE_ATTEMPTS_MAX) << uint32(MaxHeroicAttempts); } void OnPlayerEnter(Player* player) @@ -147,7 +180,7 @@ class instance_icecrown_citadel : public InstanceMapScript break; case NPC_SE_HIGH_OVERLORD_SAURFANG: if (teamInInstance == ALLIANCE) - creature->UpdateEntry(NPC_SE_MURADIN_BRONZEBEARD, ALLIANCE); + creature->UpdateEntry(NPC_SE_MURADIN_BRONZEBEARD, ALLIANCE, creature->GetCreatureData()); case NPC_SE_MURADIN_BRONZEBEARD: saurfangEventNPC = creature->GetGUID(); creature->LastUsedScriptID = creature->GetScriptId(); @@ -201,6 +234,39 @@ class instance_icecrown_citadel : public InstanceMapScript } } + // Weekly quest spawn prevention + uint32 GetCreatureEntry(uint32 /*guidLow*/, CreatureData const* data) + { + uint32 entry = data->id; + switch (entry) + { + case NPC_INFILTRATOR_MINCHAR: + case NPC_KOR_KRON_LIEUTENANT: + case NPC_ALCHEMIST_ADRIANNA: + case NPC_ALRIN_THE_AGILE: + case NPC_INFILTRATOR_MINCHAR_BQ: + case NPC_MINCHAR_BEAM_STALKER: + case NPC_VALITHRIA_DREAMWALKER_QUEST: + { + for (uint8 questIndex = 0; questIndex < WeeklyNPCs; ++questIndex) + { + if (WeeklyQuestData[questIndex].creatureEntry == entry) + { + uint8 diffIndex = uint8(instance->GetSpawnMode() & 1); + if (!sPoolMgr->IsSpawnedObject(WeeklyQuestData[questIndex].questId[diffIndex])) + entry = 0; + break; + } + } + break; + } + default: + break; + } + + return entry; + } + void OnCreatureRemove(Creature* creature) { if (creature->GetEntry() == NPC_FROST_FREEZE_TRAP) @@ -252,6 +318,21 @@ class instance_icecrown_citadel : public InstanceMapScript case GO_SCOURGE_TRANSPORTER_SAURFANG: saurfangTeleport = go->GetGUID(); break; + case GO_PLAGUE_SIGIL: + plagueSigil = go->GetGUID(); + if (GetBossState(DATA_PROFESSOR_PUTRICIDE) == DONE) + HandleGameObject(plagueSigil, false, go); + break; + case GO_BLOODWING_SIGIL: + bloodwingSigil = go->GetGUID(); + if (GetBossState(DATA_BLOOD_QUEEN_LANA_THEL) == DONE) + HandleGameObject(bloodwingSigil, false, go); + break; + case GO_SIGIL_OF_THE_FROSTWING: + frostwingSigil = go->GetGUID(); + if (GetBossState(DATA_SINDRAGOSA) == DONE) + HandleGameObject(frostwingSigil, false, go); + break; case GO_SCIENTIST_AIRLOCK_DOOR_COLLISION: putricideCollision = go->GetGUID(); if (GetBossState(DATA_FESTERGUT) == DONE && GetBossState(DATA_ROTFACE) == DONE) @@ -331,6 +412,12 @@ class instance_icecrown_citadel : public InstanceMapScript return rimefangTrash; case DATA_COLDFLAME_JETS: return coldflameJetsState; + case DATA_TEAM_IN_INSTANCE: + return teamInInstance; + case DATA_BLOOD_QUICKENING_STATE: + return bloodQuickeningState; + case DATA_HEROIC_ATTEMPTS: + return heroicAttempts; default: break; } @@ -445,8 +532,50 @@ class instance_icecrown_citadel : public InstanceMapScript HandleGameObject(putricidePipes[1], true); } break; + case DATA_PROFESSOR_PUTRICIDE: + HandleGameObject(plagueSigil, state != DONE); + if (instance->IsHeroic()) + { + if (state == FAIL && heroicAttempts) + { + --heroicAttempts; + DoUpdateWorldState(WORLDSTATE_ATTEMPTS_REMAINING, heroicAttempts); + if (!heroicAttempts) + if (Creature* putricide = instance->GetCreature(professorPutricide)) + putricide->DespawnOrUnsummon(); + } + } + break; + case DATA_BLOOD_QUEEN_LANA_THEL: + HandleGameObject(bloodwingSigil, state != DONE); + if (instance->IsHeroic()) + { + if (state == FAIL && heroicAttempts) + { + --heroicAttempts; + DoUpdateWorldState(WORLDSTATE_ATTEMPTS_REMAINING, heroicAttempts); + if (!heroicAttempts) + if (Creature* bq = instance->GetCreature(bloodQueenLanaThel)) + bq->DespawnOrUnsummon(); + } + } + break; case DATA_VALITHRIA_DREAMWALKER: + break; case DATA_SINDRAGOSA: + HandleGameObject(frostwingSigil, state != DONE); + if (instance->IsHeroic()) + { + if (state == FAIL && heroicAttempts) + { + --heroicAttempts; + DoUpdateWorldState(WORLDSTATE_ATTEMPTS_REMAINING, heroicAttempts); + if (!heroicAttempts) + if (Creature* sindra = instance->GetCreature(sindragosa)) + sindra->DespawnOrUnsummon(); + } + } + break; case DATA_THE_LICH_KING: break; default: @@ -473,6 +602,8 @@ class instance_icecrown_citadel : public InstanceMapScript isOrbWhispererEligible = data ? true : false; break; case DATA_SINDRAGOSA_FROSTWYRMS: + if (instance->IsHeroic() && !heroicAttempts) + return; if (data > 1) frostwyrms = data; else if (data == 1) @@ -515,6 +646,32 @@ class instance_icecrown_citadel : public InstanceMapScript trap->AI()->DoAction(ACTION_STOP_TRAPS); } break; + case DATA_BLOOD_QUICKENING_STATE: + { + // 3 is the index of Blood Quickening + if (!sPoolMgr->IsSpawnedObject(WeeklyQuestData[3].questId[instance->GetSpawnMode() & 1])) + break; + if (bloodQuickeningState == data) + break; + + switch (data) + { + case IN_PROGRESS: + bloodQuickeningTimer = 60000; + bloodQuickeningMinutes = 30; + DoUpdateWorldState(WORLDSTATE_SHOW_TIMER, 1); + DoUpdateWorldState(WORLDSTATE_EXECUTION_TIME, bloodQuickeningMinutes); + break; + case DONE: + bloodQuickeningTimer = 0; + bloodQuickeningMinutes = 0; + DoUpdateWorldState(WORLDSTATE_SHOW_TIMER, 0); + break; + } + bloodQuickeningState = data; + SaveToDB(); + break; + } default: break; } @@ -698,30 +855,31 @@ class instance_icecrown_citadel : public InstanceMapScript OUT_SAVE_INST_DATA; std::ostringstream saveStream; - saveStream << "I C " << GetBossSaveData() << uint32(coldflameJetsState); + saveStream << "I C " << GetBossSaveData() << coldflameJetsState + << " " << bloodQuickeningState << " " << bloodQuickeningMinutes; OUT_SAVE_INST_DATA_COMPLETE; return saveStream.str(); } - void Load(const char* in) + void Load(const char* str) { - if (!in) + if (!str) { OUT_LOAD_INST_DATA_FAIL; return; } - OUT_LOAD_INST_DATA(in); + OUT_LOAD_INST_DATA(str); char dataHead1, dataHead2; - std::istringstream loadStream(in); + std::istringstream loadStream(str); loadStream >> dataHead1 >> dataHead2; if (dataHead1 == 'I' && dataHead2 == 'C') { - for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) + for (uint32 i = 0; i < EncounterCount; ++i) { uint32 tmpState; loadStream >> tmpState; @@ -729,23 +887,59 @@ class instance_icecrown_citadel : public InstanceMapScript tmpState = NOT_STARTED; SetBossState(i, EncounterState(tmpState)); } - uint32 jets = 0; - loadStream >> jets; - if (jets) - jets = DONE; - coldflameJetsState = jets; - } else OUT_LOAD_INST_DATA_FAIL; + + uint32 temp = 0; + loadStream >> temp; + coldflameJetsState = temp ? DONE : NOT_STARTED; + temp = 0; + loadStream >> temp; + bloodQuickeningState = temp ? DONE : NOT_STARTED; // DONE means finished (not success/fail) + loadStream >> bloodQuickeningMinutes; + } + else + OUT_LOAD_INST_DATA_FAIL; OUT_LOAD_INST_DATA_COMPLETE; } + void Update(uint32 diff) + { + if (bloodQuickeningState == IN_PROGRESS) + { + if (bloodQuickeningTimer <= diff) + { + --bloodQuickeningMinutes; + bloodQuickeningTimer = 60000; + if (bloodQuickeningMinutes) + { + DoUpdateWorldState(WORLDSTATE_SHOW_TIMER, 1); + DoUpdateWorldState(WORLDSTATE_EXECUTION_TIME, bloodQuickeningMinutes); + } + else + { + bloodQuickeningState = DONE; + DoUpdateWorldState(WORLDSTATE_SHOW_TIMER, 0); + if (Creature* bq = instance->GetCreature(bloodQueenLanaThel)) + bq->AI()->DoAction(ACTION_KILL_MINCHAR); + } + SaveToDB(); + } + else + bloodQuickeningTimer -= diff; + } + } + private: + std::set coldflameJets; uint64 ladyDeathwisperElevator; uint64 deathbringerSaurfang; uint64 saurfangDoor; uint64 saurfangEventNPC; // Muradin Bronzebeard or High Overlord Saurfang uint64 deathbringersCache; uint64 saurfangTeleport; + uint64 plagueSigil; + uint64 bloodwingSigil; + uint64 frostwingSigil; uint64 putricidePipes[2]; uint64 putricideGates[2]; uint64 putricideCollision; @@ -759,12 +953,15 @@ class instance_icecrown_citadel : public InstanceMapScript uint64 sindragosa; uint64 spinestalker; uint64 rimefang; - std::set coldflameJets; uint32 teamInInstance; - uint8 coldflameJetsState; - uint8 frostwyrms; - uint8 spinestalkerTrash; - uint8 rimefangTrash; + uint32 bloodQuickeningTimer; + uint32 coldflameJetsState; + uint32 frostwyrms; + uint32 spinestalkerTrash; + uint32 rimefangTrash; + uint32 bloodQuickeningState; + uint16 heroicAttempts; + uint16 bloodQuickeningMinutes; bool isBonedEligible; bool isOozeDanceEligible; bool isNauseaEligible; diff --git a/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp b/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp index 0d1158975d7df..5b8d0e66206a4 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp @@ -73,7 +73,7 @@ class boss_anubrekhan : public CreatureScript hasTaunted = false; - if (getDifficulty() == RAID_DIFFICULTY_25MAN_NORMAL) + if (GetDifficulty() == RAID_DIFFICULTY_25MAN_NORMAL) { Position pos; @@ -115,7 +115,7 @@ class boss_anubrekhan : public CreatureScript events.ScheduleEvent(EVENT_LOCUST, 90000); events.ScheduleEvent(EVENT_BERSERK, 600000); - if (getDifficulty() == RAID_DIFFICULTY_10MAN_NORMAL) + if (GetDifficulty() == RAID_DIFFICULTY_10MAN_NORMAL) events.ScheduleEvent(EVENT_SPAWN_GUARDIAN_NORMAL, urand(15000,20000)); } @@ -140,7 +140,6 @@ class boss_anubrekhan : public CreatureScript summon->CastSpell(summon, SPELL_SUMMON_CORPSE_SCARABS_MOB, true, NULL, NULL, me->GetGUID()); } - void UpdateAI(const uint32 diff) { if (!UpdateVictim() || !CheckInRoom()) @@ -156,7 +155,7 @@ class boss_anubrekhan : public CreatureScript //Cast Impale on a random target //Do NOT cast it when we are afflicted by locust swarm if (!me->HasAura(RAID_MODE(SPELL_LOCUST_SWARM_10,SPELL_LOCUST_SWARM_25))) - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(pTarget, RAID_MODE(SPELL_IMPALE_10,SPELL_IMPALE_25)); events.ScheduleEvent(EVENT_IMPALE, urand(10000,20000)); break; @@ -183,7 +182,6 @@ class boss_anubrekhan : public CreatureScript }; - void AddSC_boss_anubrekhan() { new boss_anubrekhan(); diff --git a/src/server/scripts/Northrend/Naxxramas/boss_faerlina.cpp b/src/server/scripts/Northrend/Naxxramas/boss_faerlina.cpp index 7ef7bdcbe1969..7a1c186393789 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_faerlina.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_faerlina.cpp @@ -142,7 +142,7 @@ class boss_faerlina : public CreatureScript events.ScheduleEvent(EVENT_POISON, urand(8000,15000)); break; case EVENT_FIRE: - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(pTarget, RAID_MODE(SPELL_RAIN_OF_FIRE, H_SPELL_RAIN_OF_FIRE)); events.ScheduleEvent(EVENT_FIRE, urand(6000,18000)); break; @@ -175,7 +175,6 @@ class boss_faerlina : public CreatureScript }; - class mob_faerlina_add : public CreatureScript { public: @@ -197,7 +196,7 @@ class mob_faerlina_add : public CreatureScript void Reset() { - if (getDifficulty() == RAID_DIFFICULTY_10MAN_NORMAL) { + if (GetDifficulty() == RAID_DIFFICULTY_10MAN_NORMAL) { me->ApplySpellImmune(0, IMMUNITY_MECHANIC, SPELL_EFFECT_BIND, true); me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_CHARM, true); } @@ -205,7 +204,7 @@ class mob_faerlina_add : public CreatureScript void JustDied(Unit * /*killer*/) { - if (pInstance && getDifficulty() == RAID_DIFFICULTY_10MAN_NORMAL) + if (pInstance && GetDifficulty() == RAID_DIFFICULTY_10MAN_NORMAL) { if (Creature *pFaerlina = pInstance->instance->GetCreature(pInstance->GetData64(DATA_FAERLINA))) DoCast(pFaerlina, SPELL_WIDOWS_EMBRACE); @@ -215,7 +214,6 @@ class mob_faerlina_add : public CreatureScript }; - void AddSC_boss_faerlina() { new boss_faerlina(); diff --git a/src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp b/src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp index 8e86faf6ee923..6ff43318c701d 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_gluth.cpp @@ -92,16 +92,6 @@ class boss_gluth : public CreatureScript summons.Summon(summon); } - void JustDied(Unit* /*Killer*/) - { - _JustDied(); - } - - void Reset() - { - _Reset(); - } - void UpdateAI(const uint32 diff) { if (!UpdateVictimWithGaze() || !CheckInRoom()) @@ -154,8 +144,34 @@ class boss_gluth : public CreatureScript }; +class spell_gluth_decimate : public SpellScriptLoader +{ + public: + spell_gluth_decimate() : SpellScriptLoader("spell_gluth_decimate") { } + + class spell_gluth_decimate_SpellScript : public SpellScript + { + PrepareSpellScript(spell_gluth_decimate_SpellScript); + + void FilterTargets(std::list& unitList) + { + unitList.remove(GetCaster()); + } + + void Register() + { + OnUnitTargetSelect += SpellUnitTargetFn(spell_gluth_decimate_SpellScript::FilterTargets, EFFECT_0, TARGET_SRC_CASTER); + } + }; + + SpellScript *GetSpellScript() const + { + return new spell_gluth_decimate_SpellScript(); + } +}; void AddSC_boss_gluth() { new boss_gluth(); + new spell_gluth_decimate(); } diff --git a/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp b/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp index dd74ac5f1af4a..fad00bd73b6ab 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp @@ -1,591 +1,556 @@ -/* - * Copyright (C) 2008-2011 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 "naxxramas.h" - -enum Yells -{ - SAY_SPEECH = -1533040, - SAY_KILL = -1533041, - SAY_DEATH = -1533042, - SAY_TELEPORT = -1533043 -}; -//Gothik -enum Spells -{ - SPELL_HARVEST_SOUL = 28679, - SPELL_SHADOW_BOLT = 29317, - H_SPELL_SHADOW_BOLT = 56405, - SPELL_INFORM_LIVE_TRAINEE = 27892, - SPELL_INFORM_LIVE_KNIGHT = 27928, - SPELL_INFORM_LIVE_RIDER = 27935, - SPELL_INFORM_DEAD_TRAINEE = 27915, - SPELL_INFORM_DEAD_KNIGHT = 27931, - SPELL_INFORM_DEAD_RIDER = 27937 -}; -enum Creatures -{ - MOB_LIVE_TRAINEE = 16124, - MOB_LIVE_KNIGHT = 16125, - MOB_LIVE_RIDER = 16126, - MOB_DEAD_TRAINEE = 16127, - MOB_DEAD_KNIGHT = 16148, - MOB_DEAD_RIDER = 16150, - MOB_DEAD_HORSE = 16149 -}; - -struct Waves { uint32 entry, time, mode; }; -// wave setups are not the same in heroic and normal difficulty, -// mode is 0 only normal, 1 both and 2 only heroic -// but this is handled in DoGothikSummon function -const Waves waves[] = -{ - {MOB_LIVE_TRAINEE, 20000, 1}, - {MOB_LIVE_TRAINEE, 20000, 1}, - {MOB_LIVE_TRAINEE, 10000, 1}, - {MOB_LIVE_KNIGHT, 10000, 1}, - {MOB_LIVE_TRAINEE, 15000, 1}, - {MOB_LIVE_KNIGHT, 5000, 1}, - {MOB_LIVE_TRAINEE, 20000, 1}, - {MOB_LIVE_TRAINEE, 0, 1}, - {MOB_LIVE_KNIGHT, 10000, 1}, - {MOB_LIVE_TRAINEE, 10000, 2}, - {MOB_LIVE_RIDER, 10000, 0}, - {MOB_LIVE_RIDER, 5000, 2}, - {MOB_LIVE_TRAINEE, 5000, 0}, - {MOB_LIVE_TRAINEE, 15000, 2}, - {MOB_LIVE_KNIGHT, 15000, 0}, - {MOB_LIVE_TRAINEE, 0, 0}, - {MOB_LIVE_RIDER, 10000, 1}, - {MOB_LIVE_KNIGHT, 10000, 1}, - {MOB_LIVE_TRAINEE, 10000, 0}, - {MOB_LIVE_RIDER, 10000, 2}, - {MOB_LIVE_TRAINEE, 0, 2}, - {MOB_LIVE_RIDER, 5000, 1}, - {MOB_LIVE_TRAINEE, 0, 2}, - {MOB_LIVE_KNIGHT, 5000, 1}, - {MOB_LIVE_RIDER, 0, 2}, - {MOB_LIVE_TRAINEE, 20000, 1}, - {MOB_LIVE_RIDER, 0, 1}, - {MOB_LIVE_KNIGHT, 0, 1}, - {MOB_LIVE_TRAINEE, 25000, 2}, - {MOB_LIVE_TRAINEE, 15000, 0}, - {MOB_LIVE_TRAINEE, 25000, 0}, - {0, 0, 1}, -}; - -#define POS_Y_GATE -3360.78f -#define POS_Y_WEST -3285.0f -#define POS_Y_EAST -3434.0f -#define POS_X_NORTH 2750.49f -#define POS_X_SOUTH 2633.84f - -#define IN_LIVE_SIDE(who) (who->GetPositionY() < POS_Y_GATE) - -enum Events -{ - EVENT_NONE, - EVENT_SUMMON, - EVENT_HARVEST, - EVENT_BOLT, - EVENT_TELEPORT -}; -enum Pos -{ - POS_LIVE = 6, - POS_DEAD = 5 -}; - -const Position PosSummonLive[POS_LIVE] = -{ - {2669.7f, -3428.76f, 268.56f, 1.6f}, - {2692.1f, -3428.76f, 268.56f, 1.6f}, - {2714.4f, -3428.76f, 268.56f, 1.6f}, - {2669.7f, -3431.67f, 268.56f, 1.6f}, - {2692.1f, -3431.67f, 268.56f, 1.6f}, - {2714.4f, -3431.67f, 268.56f, 1.6f}, -}; - -const Position PosSummonDead[POS_DEAD] = -{ - {2725.1f, -3310.0f, 268.85f, 3.4f}, - {2699.3f, -3322.8f, 268.60f, 3.3f}, - {2733.1f, -3348.5f, 268.84f, 3.1f}, - {2682.8f, -3304.2f, 268.85f, 3.9f}, - {2664.8f, -3340.7f, 268.23f, 3.7f}, -}; - -const float PosGroundLiveSide[4] = {2691.2f, -3387.0f, 267.68f, 1.52f}; -const float PosGroundDeadSide[4] = {2693.5f, -3334.6f, 267.68f, 4.67f}; -const float PosPlatform[4] = {2640.5f, -3360.6f, 285.26f, 0.0f}; - -// Predicate function to check that the r efzr unit is NOT on the same side as the source. -struct NotOnSameSide : public std::unary_function { - bool m_inLiveSide; - NotOnSameSide(Unit *pSource) : m_inLiveSide(IN_LIVE_SIDE(pSource)) {} - bool operator() (const Unit *pTarget) { - return (m_inLiveSide != IN_LIVE_SIDE(pTarget)); - } -}; - -class boss_gothik : public CreatureScript -{ -public: - boss_gothik() : CreatureScript("boss_gothik") { } - - CreatureAI* GetAI(Creature* pCreature) const - { - return new boss_gothikAI (pCreature); - } - - struct boss_gothikAI : public BossAI - { - boss_gothikAI(Creature *c) : BossAI(c, BOSS_GOTHIK) {} - - uint32 waveCount; - typedef std::vector TriggerVct; - TriggerVct liveTrigger, deadTrigger; - bool mergedSides; - bool phaseTwo; - bool thirtyPercentReached; - - std::vector LiveTriggerGUID; - std::vector DeadTriggerGUID; - - void Reset() - { - LiveTriggerGUID.clear(); - DeadTriggerGUID.clear(); - - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_DISABLE_MOVE|UNIT_FLAG_NOT_SELECTABLE); - me->SetReactState(REACT_PASSIVE); - if (instance) - instance->SetData(DATA_GOTHIK_GATE, GO_STATE_ACTIVE); - _Reset(); - mergedSides = false; - phaseTwo = false; - thirtyPercentReached = false; - } - - void EnterCombat(Unit * /*who*/) - { - for (uint32 i = 0; i < POS_LIVE; ++i) - if (Creature *trigger = DoSummon(WORLD_TRIGGER, PosSummonLive[i])) - LiveTriggerGUID.push_back(trigger->GetGUID()); - for (uint32 i = 0; i < POS_DEAD; ++i) - if (Creature *trigger = DoSummon(WORLD_TRIGGER, PosSummonDead[i])) - DeadTriggerGUID.push_back(trigger->GetGUID()); - - if (LiveTriggerGUID.size() < POS_LIVE || DeadTriggerGUID.size() < POS_DEAD) - { - sLog->outError("Script Gothik: cannot summon triggers!"); - EnterEvadeMode(); - return; - } - - _EnterCombat(); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_DISABLE_MOVE|UNIT_FLAG_NOT_SELECTABLE); - waveCount = 0; - events.ScheduleEvent(EVENT_SUMMON, 30000); - DoTeleportTo(PosPlatform); - DoScriptText(SAY_SPEECH, me); - if (instance) - instance->SetData(DATA_GOTHIK_GATE, GO_STATE_READY); - } - - void JustSummoned(Creature *summon) - { - if (summon->GetEntry() == WORLD_TRIGGER) - summon->setActive(true); - else if (!mergedSides) - { - summon->AI()->DoAction(me->HasReactState(REACT_PASSIVE) ? 1 : 0); - summon->AI()->EnterEvadeMode(); - } - else - { - summon->AI()->DoAction(0); - summon->AI()->DoZoneInCombat(); - } - summons.Summon(summon); - } - - void SummonedCreatureDespawn(Creature *summon) - { - summons.Despawn(summon); - } - - void KilledUnit(Unit* /*victim*/) - { - if (!(rand()%5)) - DoScriptText(SAY_KILL, me); - } - - void JustDied(Unit* /*Killer*/) - { - LiveTriggerGUID.clear(); - DeadTriggerGUID.clear(); - _JustDied(); - DoScriptText(SAY_DEATH, me); - if (instance) - instance->SetData(DATA_GOTHIK_GATE, GO_STATE_ACTIVE); - } - - void DoGothikSummon(uint32 entry) - { - if (getDifficulty() == RAID_DIFFICULTY_25MAN_NORMAL) - { - switch(entry) - { - case MOB_LIVE_TRAINEE: - { - if (Creature *LiveTrigger0 = Unit::GetCreature(*me, LiveTriggerGUID[0])) - DoSummon(MOB_LIVE_TRAINEE, LiveTrigger0, 1); - if (Creature *LiveTrigger1 = Unit::GetCreature(*me, LiveTriggerGUID[1])) - DoSummon(MOB_LIVE_TRAINEE, LiveTrigger1, 1); - if (Creature *LiveTrigger2 = Unit::GetCreature(*me, LiveTriggerGUID[2])) - DoSummon(MOB_LIVE_TRAINEE, LiveTrigger2, 1); - break; - } - case MOB_LIVE_KNIGHT: - { - if (Creature *LiveTrigger3 = Unit::GetCreature(*me, LiveTriggerGUID[3])) - DoSummon(MOB_LIVE_KNIGHT, LiveTrigger3, 1); - if (Creature *LiveTrigger5 = Unit::GetCreature(*me, LiveTriggerGUID[5])) - DoSummon(MOB_LIVE_KNIGHT, LiveTrigger5, 1); - break; - } - case MOB_LIVE_RIDER: - { - if (Creature *LiveTrigger4 = Unit::GetCreature(*me, LiveTriggerGUID[4])) - DoSummon(MOB_LIVE_RIDER, LiveTrigger4, 1); - break; - } - } - } - else - { - switch(entry) - { - case MOB_LIVE_TRAINEE: - { - if (Creature *LiveTrigger0 = Unit::GetCreature(*me, LiveTriggerGUID[4])) - DoSummon(MOB_LIVE_TRAINEE, LiveTrigger0, 1); - if (Creature *LiveTrigger1 = Unit::GetCreature(*me, LiveTriggerGUID[4])) - DoSummon(MOB_LIVE_TRAINEE, LiveTrigger1, 1); - break; - } - case MOB_LIVE_KNIGHT: - { - if (Creature *LiveTrigger5 = Unit::GetCreature(*me, LiveTriggerGUID[4])) - DoSummon(MOB_LIVE_KNIGHT, LiveTrigger5, 1); - break; - } - case MOB_LIVE_RIDER: - { - if (Creature *LiveTrigger4 = Unit::GetCreature(*me, LiveTriggerGUID[4])) - DoSummon(MOB_LIVE_RIDER, LiveTrigger4, 1); - break; - } - } - } - } - - bool CheckGroupSplitted() - { - bool checklife = false; - bool checkdead = false; - - Map* pMap = me->GetMap(); - if (pMap && pMap->IsDungeon()) - { - Map::PlayerList const &PlayerList = pMap->GetPlayers(); - if (!PlayerList.isEmpty()) - { - for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) - { - if (i->getSource() && i->getSource()->isAlive() && - i->getSource()->GetPositionX() <= POS_X_NORTH && - i->getSource()->GetPositionX() >= POS_X_SOUTH && - i->getSource()->GetPositionY() <= POS_Y_GATE && - i->getSource()->GetPositionY() >= POS_Y_EAST) - { - checklife = true; - } - else if (i->getSource() && i->getSource()->isAlive() && - i->getSource()->GetPositionX() <= POS_X_NORTH && - i->getSource()->GetPositionX() >= POS_X_SOUTH && - i->getSource()->GetPositionY() >= POS_Y_GATE && - i->getSource()->GetPositionY() <= POS_Y_WEST) - { - checkdead = true; - } - - if (checklife && checkdead) - return true; - } - } - } - - return false; - } - - void SpellHit(Unit * /*caster*/, const SpellEntry *spell) - { - uint32 spellId = 0; - switch(spell->Id) - { - case SPELL_INFORM_LIVE_TRAINEE: spellId = SPELL_INFORM_DEAD_TRAINEE; break; - case SPELL_INFORM_LIVE_KNIGHT: spellId = SPELL_INFORM_DEAD_KNIGHT; break; - case SPELL_INFORM_LIVE_RIDER: spellId = SPELL_INFORM_DEAD_RIDER; break; - } - if (spellId && me->isInCombat()) - { - me->HandleEmoteCommand(EMOTE_ONESHOT_SPELLCAST); - if (Creature *pRandomDeadTrigger = Unit::GetCreature(*me, DeadTriggerGUID[rand() % POS_DEAD])) - me->CastSpell(pRandomDeadTrigger, spellId, true); - } - } - - void SpellHitTarget(Unit *pTarget, const SpellEntry *spell) - { - if (!me->isInCombat()) - return; - - switch(spell->Id) - { - case SPELL_INFORM_DEAD_TRAINEE: - DoSummon(MOB_DEAD_TRAINEE, pTarget, 0); - break; - case SPELL_INFORM_DEAD_KNIGHT: - DoSummon(MOB_DEAD_KNIGHT, pTarget, 0); - break; - case SPELL_INFORM_DEAD_RIDER: - DoSummon(MOB_DEAD_RIDER, pTarget, 1.0f); - DoSummon(MOB_DEAD_HORSE, pTarget, 1.0f); - break; - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim() || !CheckInRoom()) - return; - - events.Update(diff); - - if (!thirtyPercentReached && HealthBelowPct(30) && phaseTwo) - { - thirtyPercentReached = true; - if (instance) - instance->SetData(DATA_GOTHIK_GATE, GO_STATE_ACTIVE); - } - - if (me->HasUnitState(UNIT_STAT_CASTING)) - return; - - while (uint32 eventId = events.ExecuteEvent()) - { - switch(eventId) - { - case EVENT_SUMMON: - if (waves[waveCount].entry) - { - if ((waves[waveCount].mode == 2) && (getDifficulty() == RAID_DIFFICULTY_25MAN_NORMAL)) - DoGothikSummon(waves[waveCount].entry); - else if ((waves[waveCount].mode == 0) && (getDifficulty() == RAID_DIFFICULTY_10MAN_NORMAL)) - DoGothikSummon(waves[waveCount].entry); - else if (waves[waveCount].mode == 1) - DoGothikSummon(waves[waveCount].entry); - - // if group is not splitted, open gate and merge both sides at ~ 2 minutes (wave 11) - if (waveCount == 11) - { - if (!CheckGroupSplitted()) - { - if (instance) - instance->SetData(DATA_GOTHIK_GATE, GO_STATE_ACTIVE); - summons.DoAction(0, 0); - summons.DoZoneInCombat(); - mergedSides = true; - } - } - - if (waves[waveCount].mode == 1) - events.ScheduleEvent(EVENT_SUMMON,waves[waveCount].time); - else if ((waves[waveCount].mode == 2) && (getDifficulty() == RAID_DIFFICULTY_25MAN_NORMAL)) - events.ScheduleEvent(EVENT_SUMMON,waves[waveCount].time); - else if ((waves[waveCount].mode == 0) && (getDifficulty() == RAID_DIFFICULTY_10MAN_NORMAL)) - events.ScheduleEvent(EVENT_SUMMON,waves[waveCount].time); - else - events.ScheduleEvent(EVENT_SUMMON, 0); - - ++waveCount; - } - else - { - phaseTwo = true; - DoScriptText(SAY_TELEPORT, me); - DoTeleportTo(PosGroundLiveSide); - me->SetReactState(REACT_AGGRESSIVE); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE); - summons.DoAction(0, 0); - summons.DoZoneInCombat(); - events.ScheduleEvent(EVENT_BOLT, 1000); - events.ScheduleEvent(EVENT_HARVEST, urand(3000,15000)); - events.ScheduleEvent(EVENT_TELEPORT, 20000); - } - break; - case EVENT_BOLT: - DoCast(me->getVictim(), RAID_MODE(SPELL_SHADOW_BOLT, H_SPELL_SHADOW_BOLT)); - events.ScheduleEvent(EVENT_BOLT, 1000); - break; - case EVENT_HARVEST: - DoCast(me->getVictim(), SPELL_HARVEST_SOUL, true); - events.ScheduleEvent(EVENT_HARVEST, urand(20000,25000)); - break; - case EVENT_TELEPORT: - if (!thirtyPercentReached) - { - me->AttackStop(); - if (IN_LIVE_SIDE(me)) - { - DoTeleportTo(PosGroundDeadSide); - } - else - { - DoTeleportTo(PosGroundLiveSide); - } - - me->getThreatManager().resetAggro(NotOnSameSide(me)); - if (Unit *pTarget = SelectTarget(SELECT_TARGET_NEAREST, 0)) - { - me->getThreatManager().addThreat(pTarget, 100.0f); - AttackStart(pTarget); - } - - events.ScheduleEvent(EVENT_TELEPORT, 20000); - } - break; - } - } - - DoMeleeAttackIfReady(); - } - }; - -}; - -class mob_gothik_minion : public CreatureScript -{ -public: - mob_gothik_minion() : CreatureScript("mob_gothik_minion") { } - - CreatureAI* GetAI(Creature* pCreature) const - { - return new mob_gothik_minionAI (pCreature); - } - - struct mob_gothik_minionAI : public CombatAI - { - mob_gothik_minionAI(Creature *c) : CombatAI(c) - { - liveSide = IN_LIVE_SIDE(me); - } - - bool liveSide; - bool gateClose; - - bool isOnSameSide(const Unit *pWho) - { - return (liveSide == IN_LIVE_SIDE(pWho)); - } - - void DoAction(const int32 param) - { - gateClose = param; - } - - void DamageTaken(Unit *attacker, uint32 &damage) - { - if (gateClose && !isOnSameSide(attacker)) - damage = 0; - } - - void JustDied(Unit * /*killer*/) - { - if (me->isSummon()) - { - if (Unit *owner = CAST_SUM(me)->GetSummoner()) - CombatAI::JustDied(owner); - } - } - - void EnterEvadeMode() - { - if (!gateClose) - { - CombatAI::EnterEvadeMode(); - return; - } - - if (!_EnterEvadeMode()) - return; - - Map* pMap = me->GetMap(); - if (pMap->IsDungeon()) - { - Map::PlayerList const &PlayerList = pMap->GetPlayers(); - if (!PlayerList.isEmpty()) - { - for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) - { - if (i->getSource() && i->getSource()->isAlive() && isOnSameSide(i->getSource())) - { - AttackStart(i->getSource()); - return; - } - } - } - } - - me->GetMotionMaster()->MoveIdle(); - Reset(); - } - - void UpdateAI(const uint32 diff) - { - if (gateClose && (!isOnSameSide(me) || (me->getVictim() && !isOnSameSide(me->getVictim())))) - { - EnterEvadeMode(); - return; - } - - CombatAI::UpdateAI(diff); - } - }; - -}; - - - -void AddSC_boss_gothik() -{ - new boss_gothik(); - new mob_gothik_minion(); -} +/* + * Copyright (C) 2008-2011 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 "naxxramas.h" + +enum Yells +{ + SAY_SPEECH = -1533040, + SAY_KILL = -1533041, + SAY_DEATH = -1533042, + SAY_TELEPORT = -1533043 +}; +//Gothik +enum Spells +{ + SPELL_HARVEST_SOUL = 28679, + SPELL_SHADOW_BOLT = 29317, + H_SPELL_SHADOW_BOLT = 56405, + SPELL_INFORM_LIVE_TRAINEE = 27892, + SPELL_INFORM_LIVE_KNIGHT = 27928, + SPELL_INFORM_LIVE_RIDER = 27935, + SPELL_INFORM_DEAD_TRAINEE = 27915, + SPELL_INFORM_DEAD_KNIGHT = 27931, + SPELL_INFORM_DEAD_RIDER = 27937 +}; +enum Creatures +{ + MOB_LIVE_TRAINEE = 16124, + MOB_LIVE_KNIGHT = 16125, + MOB_LIVE_RIDER = 16126, + MOB_DEAD_TRAINEE = 16127, + MOB_DEAD_KNIGHT = 16148, + MOB_DEAD_RIDER = 16150, + MOB_DEAD_HORSE = 16149 +}; + +struct Waves { uint32 entry, time, mode; }; +// wave setups are not the same in heroic and normal difficulty, +// mode is 0 only normal, 1 both and 2 only heroic +// but this is handled in DoGothikSummon function +const Waves waves[] = +{ + {MOB_LIVE_TRAINEE, 20000, 1}, + {MOB_LIVE_TRAINEE, 20000, 1}, + {MOB_LIVE_TRAINEE, 10000, 1}, + {MOB_LIVE_KNIGHT, 10000, 1}, + {MOB_LIVE_TRAINEE, 15000, 1}, + {MOB_LIVE_KNIGHT, 5000, 1}, + {MOB_LIVE_TRAINEE, 20000, 1}, + {MOB_LIVE_TRAINEE, 0, 1}, + {MOB_LIVE_KNIGHT, 10000, 1}, + {MOB_LIVE_TRAINEE, 10000, 2}, + {MOB_LIVE_RIDER, 10000, 0}, + {MOB_LIVE_RIDER, 5000, 2}, + {MOB_LIVE_TRAINEE, 5000, 0}, + {MOB_LIVE_TRAINEE, 15000, 2}, + {MOB_LIVE_KNIGHT, 15000, 0}, + {MOB_LIVE_TRAINEE, 0, 0}, + {MOB_LIVE_RIDER, 10000, 1}, + {MOB_LIVE_KNIGHT, 10000, 1}, + {MOB_LIVE_TRAINEE, 10000, 0}, + {MOB_LIVE_RIDER, 10000, 2}, + {MOB_LIVE_TRAINEE, 0, 2}, + {MOB_LIVE_RIDER, 5000, 1}, + {MOB_LIVE_TRAINEE, 0, 2}, + {MOB_LIVE_KNIGHT, 5000, 1}, + {MOB_LIVE_RIDER, 0, 2}, + {MOB_LIVE_TRAINEE, 20000, 1}, + {MOB_LIVE_RIDER, 0, 1}, + {MOB_LIVE_KNIGHT, 0, 1}, + {MOB_LIVE_TRAINEE, 25000, 2}, + {MOB_LIVE_TRAINEE, 15000, 0}, + {MOB_LIVE_TRAINEE, 25000, 0}, + {0, 0, 1}, +}; + +#define POS_Y_GATE -3360.78f +#define POS_Y_WEST -3285.0f +#define POS_Y_EAST -3434.0f +#define POS_X_NORTH 2750.49f +#define POS_X_SOUTH 2633.84f + +#define IN_LIVE_SIDE(who) (who->GetPositionY() < POS_Y_GATE) + +enum Events +{ + EVENT_NONE, + EVENT_SUMMON, + EVENT_HARVEST, + EVENT_BOLT, + EVENT_TELEPORT +}; +enum Pos +{ + POS_LIVE = 6, + POS_DEAD = 5 +}; + +const Position PosSummonLive[POS_LIVE] = +{ + {2669.7f, -3428.76f, 268.56f, 1.6f}, + {2692.1f, -3428.76f, 268.56f, 1.6f}, + {2714.4f, -3428.76f, 268.56f, 1.6f}, + {2669.7f, -3431.67f, 268.56f, 1.6f}, + {2692.1f, -3431.67f, 268.56f, 1.6f}, + {2714.4f, -3431.67f, 268.56f, 1.6f}, +}; + +const Position PosSummonDead[POS_DEAD] = +{ + {2725.1f, -3310.0f, 268.85f, 3.4f}, + {2699.3f, -3322.8f, 268.60f, 3.3f}, + {2733.1f, -3348.5f, 268.84f, 3.1f}, + {2682.8f, -3304.2f, 268.85f, 3.9f}, + {2664.8f, -3340.7f, 268.23f, 3.7f}, +}; + +const float PosGroundLiveSide[4] = {2691.2f, -3387.0f, 267.68f, 1.52f}; +const float PosGroundDeadSide[4] = {2693.5f, -3334.6f, 267.68f, 4.67f}; +const float PosPlatform[4] = {2640.5f, -3360.6f, 285.26f, 0.0f}; + +// Predicate function to check that the r efzr unit is NOT on the same side as the source. +struct NotOnSameSide : public std::unary_function { + bool m_inLiveSide; + NotOnSameSide(Unit *pSource) : m_inLiveSide(IN_LIVE_SIDE(pSource)) {} + bool operator() (const Unit *pTarget) { + return (m_inLiveSide != IN_LIVE_SIDE(pTarget)); + } +}; + +class boss_gothik : public CreatureScript +{ +public: + boss_gothik() : CreatureScript("boss_gothik") { } + + CreatureAI* GetAI(Creature* pCreature) const + { + return new boss_gothikAI (pCreature); + } + + struct boss_gothikAI : public BossAI + { + boss_gothikAI(Creature *c) : BossAI(c, BOSS_GOTHIK) {} + + uint32 waveCount; + typedef std::vector TriggerVct; + TriggerVct liveTrigger, deadTrigger; + bool mergedSides; + bool phaseTwo; + bool thirtyPercentReached; + + std::vector LiveTriggerGUID; + std::vector DeadTriggerGUID; + + void Reset() + { + LiveTriggerGUID.clear(); + DeadTriggerGUID.clear(); + + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_DISABLE_MOVE|UNIT_FLAG_NOT_SELECTABLE); + me->SetReactState(REACT_PASSIVE); + if (instance) + instance->SetData(DATA_GOTHIK_GATE, GO_STATE_ACTIVE); + _Reset(); + mergedSides = false; + phaseTwo = false; + thirtyPercentReached = false; + } + + void EnterCombat(Unit * /*who*/) + { + for (uint32 i = 0; i < POS_LIVE; ++i) + if (Creature *trigger = DoSummon(WORLD_TRIGGER, PosSummonLive[i])) + LiveTriggerGUID.push_back(trigger->GetGUID()); + for (uint32 i = 0; i < POS_DEAD; ++i) + if (Creature *trigger = DoSummon(WORLD_TRIGGER, PosSummonDead[i])) + DeadTriggerGUID.push_back(trigger->GetGUID()); + + if (LiveTriggerGUID.size() < POS_LIVE || DeadTriggerGUID.size() < POS_DEAD) + { + sLog->outError("Script Gothik: cannot summon triggers!"); + EnterEvadeMode(); + return; + } + + _EnterCombat(); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_DISABLE_MOVE|UNIT_FLAG_NOT_SELECTABLE); + waveCount = 0; + events.ScheduleEvent(EVENT_SUMMON, 30000); + DoTeleportTo(PosPlatform); + DoScriptText(SAY_SPEECH, me); + if (instance) + instance->SetData(DATA_GOTHIK_GATE, GO_STATE_READY); + } + + void JustSummoned(Creature *summon) + { + if (summon->GetEntry() == WORLD_TRIGGER) + summon->setActive(true); + else if (!mergedSides) + { + summon->AI()->DoAction(me->HasReactState(REACT_PASSIVE) ? 1 : 0); + summon->AI()->EnterEvadeMode(); + } + else + { + summon->AI()->DoAction(0); + summon->AI()->DoZoneInCombat(); + } + summons.Summon(summon); + } + + void SummonedCreatureDespawn(Creature *summon) + { + summons.Despawn(summon); + } + + void KilledUnit(Unit* /*victim*/) + { + if (!(rand()%5)) + DoScriptText(SAY_KILL, me); + } + + void JustDied(Unit* /*Killer*/) + { + LiveTriggerGUID.clear(); + DeadTriggerGUID.clear(); + _JustDied(); + DoScriptText(SAY_DEATH, me); + if (instance) + instance->SetData(DATA_GOTHIK_GATE, GO_STATE_ACTIVE); + } + + void DoGothikSummon(uint32 entry) + { + switch(entry) + { + case MOB_LIVE_TRAINEE: + { + if (Creature *LiveTrigger0 = Unit::GetCreature(*me, LiveTriggerGUID[4])) + DoSummon(MOB_LIVE_TRAINEE, LiveTrigger0, 1); + if (Creature *LiveTrigger1 = Unit::GetCreature(*me, LiveTriggerGUID[4])) + DoSummon(MOB_LIVE_TRAINEE, LiveTrigger1, 1); + break; + } + case MOB_LIVE_KNIGHT: + { + if (Creature *LiveTrigger5 = Unit::GetCreature(*me, LiveTriggerGUID[4])) + DoSummon(MOB_LIVE_KNIGHT, LiveTrigger5, 1); + break; + } + case MOB_LIVE_RIDER: + { + if (Creature *LiveTrigger4 = Unit::GetCreature(*me, LiveTriggerGUID[4])) + DoSummon(MOB_LIVE_RIDER, LiveTrigger4, 1); + break; + } + } + } + + bool CheckGroupSplitted() + { + bool checklife = false; + bool checkdead = false; + + Map* pMap = me->GetMap(); + if (pMap && pMap->IsDungeon()) + { + Map::PlayerList const &PlayerList = pMap->GetPlayers(); + if (!PlayerList.isEmpty()) + { + for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) + { + if (i->getSource() && i->getSource()->isAlive() && + i->getSource()->GetPositionX() <= POS_X_NORTH && + i->getSource()->GetPositionX() >= POS_X_SOUTH && + i->getSource()->GetPositionY() <= POS_Y_GATE && + i->getSource()->GetPositionY() >= POS_Y_EAST) + { + checklife = true; + } + else if (i->getSource() && i->getSource()->isAlive() && + i->getSource()->GetPositionX() <= POS_X_NORTH && + i->getSource()->GetPositionX() >= POS_X_SOUTH && + i->getSource()->GetPositionY() >= POS_Y_GATE && + i->getSource()->GetPositionY() <= POS_Y_WEST) + { + checkdead = true; + } + + if (checklife && checkdead) + return true; + } + } + } + + return false; + } + + void SpellHit(Unit * /*caster*/, const SpellEntry *spell) + { + uint32 spellId = 0; + switch(spell->Id) + { + case SPELL_INFORM_LIVE_TRAINEE: spellId = SPELL_INFORM_DEAD_TRAINEE; break; + case SPELL_INFORM_LIVE_KNIGHT: spellId = SPELL_INFORM_DEAD_KNIGHT; break; + case SPELL_INFORM_LIVE_RIDER: spellId = SPELL_INFORM_DEAD_RIDER; break; + } + if (spellId && me->isInCombat()) + { + me->HandleEmoteCommand(EMOTE_ONESHOT_SPELLCAST); + if (Creature *pRandomDeadTrigger = Unit::GetCreature(*me, DeadTriggerGUID[rand() % POS_DEAD])) + me->CastSpell(pRandomDeadTrigger, spellId, true); + } + } + + void SpellHitTarget(Unit *pTarget, const SpellEntry *spell) + { + if (!me->isInCombat()) + return; + + switch(spell->Id) + { + case SPELL_INFORM_DEAD_TRAINEE: + DoSummon(MOB_DEAD_TRAINEE, pTarget, 0); + break; + case SPELL_INFORM_DEAD_KNIGHT: + DoSummon(MOB_DEAD_KNIGHT, pTarget, 0); + break; + case SPELL_INFORM_DEAD_RIDER: + DoSummon(MOB_DEAD_RIDER, pTarget, 1.0f); + DoSummon(MOB_DEAD_HORSE, pTarget, 1.0f); + break; + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim() || !CheckInRoom()) + return; + + events.Update(diff); + + if (!thirtyPercentReached && HealthBelowPct(30) && phaseTwo) + { + thirtyPercentReached = true; + if (instance) + instance->SetData(DATA_GOTHIK_GATE, GO_STATE_ACTIVE); + } + + if (me->HasUnitState(UNIT_STAT_CASTING)) + return; + + while (uint32 eventId = events.ExecuteEvent()) + { + switch(eventId) + { + case EVENT_SUMMON: + if (waves[waveCount].entry) + { + if ((waves[waveCount].mode == 2) && (GetDifficulty() == RAID_DIFFICULTY_25MAN_NORMAL)) + DoGothikSummon(waves[waveCount].entry); + else if ((waves[waveCount].mode == 0) && (GetDifficulty() == RAID_DIFFICULTY_10MAN_NORMAL)) + DoGothikSummon(waves[waveCount].entry); + else if (waves[waveCount].mode == 1) + DoGothikSummon(waves[waveCount].entry); + + // if group is not splitted, open gate and merge both sides at ~ 2 minutes (wave 11) + if (waveCount == 11) + { + if (!CheckGroupSplitted()) + { + if (instance) + instance->SetData(DATA_GOTHIK_GATE, GO_STATE_ACTIVE); + summons.DoAction(0, 0); + summons.DoZoneInCombat(); + mergedSides = true; + } + } + + if (waves[waveCount].mode == 1) + events.ScheduleEvent(EVENT_SUMMON,waves[waveCount].time); + else if ((waves[waveCount].mode == 2) && (GetDifficulty() == RAID_DIFFICULTY_25MAN_NORMAL)) + events.ScheduleEvent(EVENT_SUMMON,waves[waveCount].time); + else if ((waves[waveCount].mode == 0) && (GetDifficulty() == RAID_DIFFICULTY_10MAN_NORMAL)) + events.ScheduleEvent(EVENT_SUMMON,waves[waveCount].time); + else + events.ScheduleEvent(EVENT_SUMMON, 0); + + ++waveCount; + } + else + { + phaseTwo = true; + DoScriptText(SAY_TELEPORT, me); + DoTeleportTo(PosGroundLiveSide); + me->SetReactState(REACT_AGGRESSIVE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE); + summons.DoAction(0, 0); + summons.DoZoneInCombat(); + events.ScheduleEvent(EVENT_BOLT, 1000); + events.ScheduleEvent(EVENT_HARVEST, urand(3000,15000)); + events.ScheduleEvent(EVENT_TELEPORT, 20000); + } + break; + case EVENT_BOLT: + DoCast(me->getVictim(), RAID_MODE(SPELL_SHADOW_BOLT, H_SPELL_SHADOW_BOLT)); + events.ScheduleEvent(EVENT_BOLT, 1000); + break; + case EVENT_HARVEST: + DoCast(me->getVictim(), SPELL_HARVEST_SOUL, true); + events.ScheduleEvent(EVENT_HARVEST, urand(20000,25000)); + break; + case EVENT_TELEPORT: + if (!thirtyPercentReached) + { + me->AttackStop(); + if (IN_LIVE_SIDE(me)) + { + DoTeleportTo(PosGroundDeadSide); + } + else + { + DoTeleportTo(PosGroundLiveSide); + } + + me->getThreatManager().resetAggro(NotOnSameSide(me)); + if (Unit *pTarget = SelectTarget(SELECT_TARGET_NEAREST, 0)) + { + me->getThreatManager().addThreat(pTarget, 100.0f); + AttackStart(pTarget); + } + + events.ScheduleEvent(EVENT_TELEPORT, 20000); + } + break; + } + } + + DoMeleeAttackIfReady(); + } + }; + +}; + +class mob_gothik_minion : public CreatureScript +{ +public: + mob_gothik_minion() : CreatureScript("mob_gothik_minion") { } + + CreatureAI* GetAI(Creature* pCreature) const + { + return new mob_gothik_minionAI (pCreature); + } + + struct mob_gothik_minionAI : public CombatAI + { + mob_gothik_minionAI(Creature *c) : CombatAI(c) + { + liveSide = IN_LIVE_SIDE(me); + } + + bool liveSide; + bool gateClose; + + bool isOnSameSide(const Unit *pWho) + { + return (liveSide == IN_LIVE_SIDE(pWho)); + } + + void DoAction(const int32 param) + { + gateClose = param; + } + + void DamageTaken(Unit *attacker, uint32 &damage) + { + if (gateClose && !isOnSameSide(attacker)) + damage = 0; + } + + void JustDied(Unit * /*killer*/) + { + if (me->isSummon()) + { + if (Unit *owner = CAST_SUM(me)->GetSummoner()) + CombatAI::JustDied(owner); + } + } + + void EnterEvadeMode() + { + if (!gateClose) + { + CombatAI::EnterEvadeMode(); + return; + } + + if (!_EnterEvadeMode()) + return; + + Map* pMap = me->GetMap(); + if (pMap->IsDungeon()) + { + Map::PlayerList const &PlayerList = pMap->GetPlayers(); + if (!PlayerList.isEmpty()) + { + for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) + { + if (i->getSource() && i->getSource()->isAlive() && isOnSameSide(i->getSource())) + { + AttackStart(i->getSource()); + return; + } + } + } + } + + me->GetMotionMaster()->MoveIdle(); + Reset(); + } + + void UpdateAI(const uint32 diff) + { + if (gateClose && (!isOnSameSide(me) || (me->getVictim() && !isOnSameSide(me->getVictim())))) + { + EnterEvadeMode(); + return; + } + + CombatAI::UpdateAI(diff); + } + }; + +}; + +void AddSC_boss_gothik() +{ + new boss_gothik(); + new mob_gothik_minion(); +} diff --git a/src/server/scripts/Northrend/Naxxramas/boss_grobbulus.cpp b/src/server/scripts/Northrend/Naxxramas/boss_grobbulus.cpp index 1aae1b5529c61..cb4e4b9f7825e 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_grobbulus.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_grobbulus.cpp @@ -91,7 +91,7 @@ class boss_grobbulus : public CreatureScript events.ScheduleEvent(EVENT_SPRAY, 15000+rand()%15000); return; case EVENT_INJECT: - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1)) if (!pTarget->HasAura(SPELL_MUTATING_INJECTION)) DoCast(pTarget, SPELL_MUTATING_INJECTION); events.ScheduleEvent(EVENT_INJECT, 8000 + uint32(120 * me->GetHealthPct())); @@ -142,8 +142,6 @@ class npc_grobbulus_poison_cloud : public CreatureScript }; - - void AddSC_boss_grobbulus() { new boss_grobbulus(); diff --git a/src/server/scripts/Northrend/Naxxramas/boss_heigan.cpp b/src/server/scripts/Northrend/Naxxramas/boss_heigan.cpp index 0c527ab6cd84d..27d9f9757a6e5 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_heigan.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_heigan.cpp @@ -147,7 +147,6 @@ class boss_heigan : public CreatureScript }; - void AddSC_boss_heigan() { new boss_heigan(); diff --git a/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp b/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp index 9589f33821ff7..9d03472329908 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp @@ -430,7 +430,7 @@ class boss_kelthuzad : public CreatureScript events.ScheduleEvent(EVENT_DETONATE, urand(30000,40000)); events.ScheduleEvent(EVENT_FISSURE, urand(10000,30000)); events.ScheduleEvent(EVENT_BLAST, urand(60000,120000)); - if (getDifficulty() == RAID_DIFFICULTY_25MAN_NORMAL) + if (GetDifficulty() == RAID_DIFFICULTY_25MAN_NORMAL) events.ScheduleEvent(EVENT_CHAIN, urand(30000,60000)); Phase = 2; break; @@ -614,7 +614,7 @@ class boss_kelthuzad : public CreatureScript break; } case EVENT_FISSURE: - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) DoCast(pTarget, SPELL_SHADOW_FISURE); events.RepeatEvent(urand(10000,45000)); break; diff --git a/src/server/scripts/Northrend/Naxxramas/boss_loatheb.cpp b/src/server/scripts/Northrend/Naxxramas/boss_loatheb.cpp index 8ef61afda59a8..292d3f16d2bc6 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_loatheb.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_loatheb.cpp @@ -92,7 +92,6 @@ class boss_loatheb : public CreatureScript }; - enum SporeSpells { SPELL_FUNGAL_CREEP = 29232 @@ -120,7 +119,6 @@ class mob_loatheb_spore : public CreatureScript }; - void AddSC_boss_loatheb() { new boss_loatheb(); diff --git a/src/server/scripts/Northrend/Naxxramas/boss_maexxna.cpp b/src/server/scripts/Northrend/Naxxramas/boss_maexxna.cpp index 30cb99f926076..f47b806e865b8 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_maexxna.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_maexxna.cpp @@ -181,8 +181,6 @@ class mob_webwrap : public CreatureScript }; - - void AddSC_boss_maexxna() { new boss_maexxna(); diff --git a/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp b/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp index eeddfabeab1ff..1cd130556e949 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_noth.cpp @@ -106,7 +106,7 @@ class boss_noth : public CreatureScript events.ScheduleEvent(EVENT_BALCONY, 110000); events.ScheduleEvent(EVENT_CURSE, 10000+rand()%15000); events.ScheduleEvent(EVENT_WARRIOR, 30000); - if (getDifficulty() == RAID_DIFFICULTY_25MAN_NORMAL) + if (GetDifficulty() == RAID_DIFFICULTY_25MAN_NORMAL) events.ScheduleEvent(EVENT_BLINK, 20000 + rand()%20000); } } @@ -210,7 +210,6 @@ class boss_noth : public CreatureScript }; - void AddSC_boss_noth() { new boss_noth(); diff --git a/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp b/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp index a215e1dca8381..42afc0e57a0e2 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp @@ -159,7 +159,6 @@ class boss_patchwerk : public CreatureScript }; - void AddSC_boss_patchwerk() { new boss_patchwerk(); diff --git a/src/server/scripts/Northrend/Naxxramas/boss_razuvious.cpp b/src/server/scripts/Northrend/Naxxramas/boss_razuvious.cpp index 4fb2392b0189e..479fda3c87536 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_razuvious.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_razuvious.cpp @@ -135,7 +135,6 @@ class boss_razuvious : public CreatureScript }; - void AddSC_boss_razuvious() { new boss_razuvious(); diff --git a/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp b/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp index f28264d3910ad..0ce6f5e08291f 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_sapphiron.cpp @@ -395,7 +395,6 @@ class boss_sapphiron : public CreatureScript }; - void AddSC_boss_sapphiron() { new boss_sapphiron(); diff --git a/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp b/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp index 0bc588ccaa0ee..c97e2c20a8218 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp @@ -256,7 +256,6 @@ class boss_thaddius : public CreatureScript }; - class mob_stalagg : public CreatureScript { public: @@ -341,7 +340,6 @@ class mob_stalagg : public CreatureScript }; - class mob_feugen : public CreatureScript { public: @@ -402,7 +400,6 @@ class mob_feugen : public CreatureScript }; - void AddSC_boss_thaddius() { new boss_thaddius(); diff --git a/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp b/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp index 7aff349fb6ff6..f5f6756c290df 100644 --- a/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp +++ b/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp @@ -335,7 +335,7 @@ class instance_naxxramas : public InstanceMapScript { if (GameObject* pHeiganEruption = instance->GetGameObject(*itr)) { - pHeiganEruption->SendCustomAnim(); + pHeiganEruption->SendCustomAnim(pHeiganEruption->GetGoAnimProgress()); pHeiganEruption->CastSpell(NULL, SPELL_ERUPTION); } } @@ -389,15 +389,15 @@ class at_naxxramas_frostwyrm_wing : public AreaTriggerScript bool OnTrigger(Player* pPlayer, const AreaTriggerEntry* /*pAt*/) { - if (pPlayer->isGameMaster()) + if (pPlayer->isGameMaster()) return false; InstanceScript* pInstance = pPlayer->GetInstanceScript(); if (pInstance) { - for (uint32 i = BOSS_ANUBREKHAN; i < BOSS_SAPPHIRON; ++i) - if (pInstance->GetBossState(i) != DONE) - return true; + for (uint32 i = BOSS_ANUBREKHAN; i < BOSS_SAPPHIRON; ++i) + if (pInstance->GetBossState(i) != DONE) + return true; } return false; @@ -405,7 +405,6 @@ class at_naxxramas_frostwyrm_wing : public AreaTriggerScript }; - void AddSC_instance_naxxramas() { new instance_naxxramas(); diff --git a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp index fe2141c3f2854..6c73120c0aa03 100644 --- a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp +++ b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp @@ -17,176 +17,1120 @@ /* Script Data Start SDName: Boss malygos -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: Script Data End */ +// TO-DOs: +// Implement a better pathing for Malygos. +// Find sniffed spawn position for chest +// Implement a better way to disappear the gameobjects +// Implement achievements +// Implement scaling for player's drakes (should be done with aura 66668, it is casted - but it is not working as it should) +// Remove hack that re-adds targets to the aggro list after they enter to a vehicle when it works as expected +// Improve whatever can be improved :) + #include "ScriptPCH.h" +#include "eye_of_eternity.h" +#include "ScriptedEscortAI.h" -//Spells -#define SPELL_ARCANE_BREATH_N 56272 -#define SPELL_ARCANE_BREATH_H 60072 -#define SPELL_ARCANE_PULSE 57432 -#define SPELL_ARCANE_STORM_1 57459 -#define SPELL_ARCANE_STORM_2 61693 -#define SPELL_ARCANE_STORM_3 61694 -#define SPELL_STATIC_FIELD 57430 -#define SPELL_SURGE_OF_POWER_1 56505 -#define SPELL_SURGE_OF_POWER_2 57407 -#define SPELL_SURGE_OF_POWER_3 60936 -#define SPELL_VORTEX 56105 - -//Dragon "mounts" spells in Phase3 -//they use Rugelike energy -#define SPELL_DMOUNT_FLAME_SPIKE 56091 //maybe not accurate -#define SPELL_DMOUNT_ENGULF_IN_FLAMES 61621 -#define SPELL_DMOUNT_REVIVIFY 57090 -#define SPELL_DMOUNT_LIFE_BURST 57143 -#define SPELL_DMOUNT_FLAME_SHIELD 57108 -//#define SPELL_DMOUNT_UNKNOWN XYZ //Increases your drake's flight speed by 500%. - -//not in db -//Yell -//-->Other -#define SAY_ANTI_MAGIC_SHELL -1616000 -#define SAY_BREATH_ATTACK -1616001 -#define SAY_HIGH_DAMAGE_MODE -1616002 -#define SAY_MAGIC_BLAST -1616003 -//--> Generic Spells -#define SAY_GENERIC_SPELL_1 -1616004 -#define SAY_GENERIC_SPELL_2 -1616005 -#define SAY_GENERIC_SPELL_3 -1616006 -#define SAY_DEATH -1616007 -//--> Prefight -#define SAY_PREFIGHT_1 -1616008 -#define SAY_PREFIGHT_2 -1616009 -#define SAY_PREFIGHT_3 -1616010 -#define SAY_PREFIGHT_4 -1616011 -#define SAY_PREFIGHT_5 -1616012 -//--> Phase1 -#define SAY_PHASE1_AGGRO -1616013 -#define SAY_PHASE1_END -1616014 -#define SAY_PHASE1_SLAY_1 -1616015 -#define SAY_PHASE1_SLAY_2 -1616016 -#define SAY_PHASE1_SLAY_3 -1616017 - -//--> Phase2 at 50% HP, - -/*Malygos himself is not targetable during this phase, it will end when the adds he spawns are all killed. However, he does continue to play a part in the encounter. -During this phase he drops anti-magic zones onto the ground the raid MUST stand inside of, it reduces magical damage taken by 50%. They shrink over time, so it's important that your raid moves to each new one he drops. -Throughout the phase, he will deep breath doing ~4k damage per second, unless you are standing inside of the anti-magic zone. -The way the fight works during this phase is there are NPCs riding around on disks in the room. There are two types of mobs, Lords and Scions. -The Lords will move down onto the group, and need to be tanked (They will one-shot a non-tank). After they die, they drop a disk that a raid member can mount onto, which allows them to fly, to attack the Scions that do not come down to the ground. -It is recommended to let melee take the first disks, then ranged. As those mobs die, they also drop disks, which allows the rest of your dps to get onto them. -The Scions will continually cast Arcane Blast on random targets on the floor, which is mitigated by the anti-magic zones. While mounted on a disk, you will not take damage. -After all of the NPCs riding on the disks die, the players on the disks need to dismount as Phase 3 is about to begin.*/ - -//not in db -#define SAY_PHASE2_AGGRO -1616018 -#define SAY_PHASE2_END -1616019 -#define SAY_PHASE2_SLAY_1 -1616020 -#define SAY_PHASE2_SLAY_2 -1616021 -#define SAY_PHASE2_SLAY_3 -1616022 -//--> Phase3 Malygos destroys the floor, encounter continues on dragon "mounts" -#define SAY_PHASE3_INTRO -1616023 -#define SAY_PHASE3_AGGRO -1616024 -#define SAY_PHASE3_SLAY_1 -1616025 -#define SAY_PHASE3_SLAY_2 -1616026 -#define SAY_PHASE3_SLAY_3 -1616027 -#define SAY_PHASE3_BIG_ATTACK -1616028 - -enum +// not implemented +enum Achievements { ACHIEV_TIMED_START_EVENT = 20387, }; +enum Events +{ + // =========== PHASE ONE =============== + EVENT_ARCANE_BREATH = 1, + EVENT_ARCANE_STORM = 2, + EVENT_VORTEX = 3, + EVENT_POWER_SPARKS = 4, + + // =========== PHASE TWO =============== + EVENT_SURGE_POWER = 5, // wowhead is wrong, Surge of Power is casted instead of Arcane Pulse (source sniffs!) + EVENT_SUMMON_ARCANE = 6, + + // =========== PHASE TWO =============== + EVENT_SURGE_POWER_PHASE_3 = 7, + EVENT_STATIC_FIELD = 8, + + // =============== YELLS =============== + EVENT_YELL_0 = 9, + EVENT_YELL_1 = 10, + EVENT_YELL_2 = 11, + EVENT_YELL_3 = 12, + EVENT_YELL_4 = 13, +}; + +enum Phases +{ + PHASE_ONE = 1, + PHASE_TWO = 2, + PHASE_THREE = 3 +}; + +enum Spells +{ + SPELL_ARCANE_BREATH = 56272, + SPELL_ARCANE_STORM = 57459, + SPELL_BERSEKER = 60670, + + SPELL_VORTEX_1 = 56237, // seems that frezze object animation + SPELL_VORTEX_2 = 55873, // visual effect + SPELL_VORTEX_3 = 56105, // this spell must handle all the script - casted by the boss and to himself + //SPELL_VORTEX_4 = 55853, // damage | used to enter to the vehicle - defined in eye_of_eternity.h + //SPELL_VORTEX_5 = 56263, // damage | used to enter to the vehicle - defined in eye_of_eternity.h + SPELL_VORTEX_6 = 73040, // teleport - (casted to all raid) | caster 30090 | target player + + SPELL_PORTAL_VISUAL_CLOSED = 55949, + SPELL_SUMMON_POWER_PARK = 56142, + SPELL_POWER_SPARK_DEATH = 55852, + SPELL_POWER_SPARK_MALYGOS = 56152, + + SPELL_SURGE_POWER = 56505, // used in phase 2 + SPELL_SUMMON_ARCANE_BOMB = 56429, + SPELL_ARCANE_OVERLOAD = 56432, + SPELL_SUMMOM_RED_DRAGON = 56070, + SPELL_SURGE_POWER_PHASE_3 = 57407, + SPELL_STATIC_FIELD = 57430 +}; + +enum Movements +{ + MOVE_VORTEX = 1, + MOVE_PHASE_TWO, + MOVE_DEEP_BREATH_ROTATION, + MOVE_INIT_PHASE_ONE, + MOVE_CENTER_PLATFORM +}; + +enum Seats +{ + SEAT_0 = 0, +}; + +enum Factions +{ + FACTION_FRIENDLY = 35, + FACTION_HOSTILE = 14 +}; + +enum Actions +{ + ACTION_HOVER_DISK_START_WP_1, + ACTION_HOVER_DISK_START_WP_2 +}; + +enum MalygosEvents +{ + DATA_SUMMON_DEATHS, // phase 2 + DATA_PHASE +}; + +#define TEN_MINUTES 600000 + +enum MalygosSays +{ + SAY_AGGRO_P_ONE, + SAY_KILLED_PLAYER_P_ONE, + SAY_END_P_ONE, + SAY_AGGRO_P_TWO, + SAY_ANTI_MAGIC_SHELL, // not sure when execute it + SAY_MAGIC_BLAST, // not sure when execute it + SAY_KILLED_PLAYER_P_TWO, + SAY_END_P_TWO, + SAY_INTRO_P_THREE, + SAY_AGGRO_P_THREE, + SAY_SURGE_POWER, // not sure when execute it + SAY_BUFF_SPARK, + SAY_KILLED_PLAYER_P_THREE, + SAY_SPELL_CASTING_P_THREE, + SAY_DEATH +}; + +#define MAX_HOVER_DISK_WAYPOINTS 18 + +// Sniffed data +const Position HoverDiskWaypoints[MAX_HOVER_DISK_WAYPOINTS] = +{ + {782.9821f,1296.652f,282.1114f}, + {779.5459f,1287.228f,282.1393f}, + {773.0028f,1279.52f,282.4164f}, + {764.3626f,1274.476f,282.4731f}, + {754.3961f,1272.639f,282.4171f}, + {744.4422f,1274.412f,282.222f}, + {735.575f,1279.742f,281.9674f}, + {729.2788f,1287.187f,281.9943f}, + {726.1191f,1296.688f,282.2997f}, + {725.9396f,1306.531f,282.2448f}, + {729.3045f,1316.122f,281.9108f}, + {735.8322f,1323.633f,282.1887f}, + {744.4616f,1328.999f,281.9948f}, + {754.4739f,1330.666f,282.049f}, + {764.074f,1329.053f,281.9949f}, + {772.8409f,1323.951f,282.077f}, + {779.5085f,1316.412f,281.9145f}, + {782.8365f,1306.778f,282.3035f}, +}; + +#define GROUND_Z 268 + +// Source: Sniffs +#define MALYGOS_MAX_WAYPOINTS 16 +const Position MalygosPhaseTwoWaypoints[MALYGOS_MAX_WAYPOINTS] = +{ + {812.7299f,1391.672f,283.2763f}, + {848.2912f,1358.61f,283.2763f}, + {853.9227f,1307.911f,283.2763f}, + {847.1437f,1265.538f,283.2763f}, + {839.9229f,1245.245f,283.2763f}, + {827.3463f,1221.818f,283.2763f}, + {803.2727f,1203.851f,283.2763f}, + {772.9372f,1197.981f,283.2763f}, + {732.1138f,1200.647f,283.2763f}, + {693.8761f,1217.995f,283.2763f}, + {664.5038f,1256.539f,283.2763f}, + {650.1497f,1303.485f,283.2763f}, + {662.9109f,1350.291f,283.2763f}, + {677.6391f,1377.607f,283.2763f}, + {704.8198f,1401.162f,283.2763f}, + {755.2642f,1417.1f,283.2763f}, +}; + +#define MAX_SUMMONS_PHASE_TWO 4 + +#define MAX_MALYGOS_POS 2 +const Position MalygosPositions[MAX_MALYGOS_POS] = +{ + {754.544f,1301.71f,320.0f}, + {754.39f, 1301.27f, 292.91f} +}; + class boss_malygos : public CreatureScript { public: - boss_malygos() : CreatureScript("boss_malygos") { } + boss_malygos() : CreatureScript("boss_malygos") {} - CreatureAI* GetAI(Creature* pCreature) const + CreatureAI* GetAI(Creature* creature) const { - return new boss_malygosAI (pCreature); + return new boss_malygosAI(creature); } - struct boss_malygosAI : public ScriptedAI + struct boss_malygosAI : public BossAI { - boss_malygosAI(Creature *c) : ScriptedAI(c) + boss_malygosAI(Creature* creature) : BossAI(creature, DATA_MALYGOS_EVENT) { - instance = me->GetInstanceScript(); + // If we enter in combat when MovePoint generator is active, it overrwrites our homeposition + homePosition = creature->GetHomePosition(); } - InstanceScript *instance; + void Reset() + { - uint32 phase; - uint32 enrage; + _Reset(); - void Reset() + bersekerTimer = 0; + currentPos = 0; + + SetPhase(PHASE_ONE,true); + + delayedMovementTimer = 8000; + delayedMovement = false; + + summonDeaths = 0; + + me->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NOT_SELECTABLE); + + cannotMove = true; + } + + uint32 GetData(uint32 data) { - phase = 1; - enrage = 615000; //Source Deadly Boss Mod + if (data == DATA_SUMMON_DEATHS) + return summonDeaths; + else if (data == DATA_PHASE) + return phase; + + return 0; + } + + void SetData(uint32 data, uint32 value) + { + if (data == DATA_SUMMON_DEATHS && phase == PHASE_TWO) + { + summonDeaths = value; + + if (summonDeaths >= MAX_SUMMONS_PHASE_TWO) + StartPhaseThree(); + } + } + + void EnterEvadeMode() + { + me->SetHomePosition(homePosition); + + me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + + BossAI::EnterEvadeMode(); if (instance) - instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT); + instance->SetBossState(DATA_MALYGOS_EVENT, FAIL); + } + + void SetPhase(uint8 _phase, bool setEvents = false) + { + events.Reset(); + + events.SetPhase(_phase); + phase = _phase; + + if (setEvents) + SetPhaseEvents(_phase); + } + + void StartPhaseThree() + { + if (!instance) + return; + + SetPhase(PHASE_THREE,true); + + // this despawns Hover Disks + summons.DespawnAll(); + // players that used Hover Disk are no in the aggro list + me->SetInCombatWithZone(); + std::list &m_threatlist = me->getThreatManager().getThreatList(); + for (std::list::const_iterator itr = m_threatlist.begin(); itr!= m_threatlist.end(); ++itr) + { + if (Unit* target = (*itr)->getTarget()) + { + if (target->GetTypeId() != TYPEID_PLAYER) + continue; + + // The rest is handled in the AI of the vehicle. + target->CastSpell(target,SPELL_SUMMOM_RED_DRAGON,true); + } + } + + if (GameObject* go = GameObject::GetGameObject(*me,instance->GetData64(DATA_PLATFORM))) + go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_DESTROYED); // In sniffs it has this flag, but i don't know how is applied. + + // pos sniffed + me->GetMotionMaster()->MoveIdle(); + me->GetMotionMaster()->MovePoint(MOVE_CENTER_PLATFORM,MalygosPositions[0].GetPositionX(),MalygosPositions[0].GetPositionY(),MalygosPositions[0].GetPositionZ()); + } + + void SetPhaseEvents(uint8 _phase) + { + switch (_phase) + { + case PHASE_ONE: + events.ScheduleEvent(EVENT_ARCANE_BREATH,urand(15,20)*IN_MILLISECONDS,0,_phase); + events.ScheduleEvent(EVENT_ARCANE_STORM,urand(5,10)*IN_MILLISECONDS,0,_phase); + events.ScheduleEvent(EVENT_VORTEX,urand(30,40)*IN_MILLISECONDS,0,_phase); + events.ScheduleEvent(EVENT_POWER_SPARKS,urand(30,35)*IN_MILLISECONDS,0,_phase); + break; + case PHASE_TWO: + events.ScheduleEvent(EVENT_YELL_0,0,0,_phase); + events.ScheduleEvent(EVENT_YELL_1,24*IN_MILLISECONDS,0,_phase); + events.ScheduleEvent(EVENT_SURGE_POWER,urand(60,70)*IN_MILLISECONDS,0,_phase); + events.ScheduleEvent(EVENT_SUMMON_ARCANE,urand(2,5)*IN_MILLISECONDS,0,_phase); + break; + case PHASE_THREE: + events.ScheduleEvent(EVENT_YELL_2,0,0,_phase); + events.ScheduleEvent(EVENT_YELL_3,8*IN_MILLISECONDS,0,_phase); + events.ScheduleEvent(EVENT_YELL_4,16*IN_MILLISECONDS,0,_phase); + events.ScheduleEvent(EVENT_SURGE_POWER_PHASE_3,(7,16)*IN_MILLISECONDS,0,_phase); + events.ScheduleEvent(EVENT_STATIC_FIELD,(20,30)*IN_MILLISECONDS,0,_phase); + break; + default: + break; + } } void EnterCombat(Unit* /*who*/) { - if (phase == 1) + _EnterCombat(); + + me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NOT_SELECTABLE); + + Talk(SAY_AGGRO_P_ONE); + + DoCast(SPELL_BERSEKER); + } + + void KilledUnit(Unit* who) + { + if (who->GetTypeId() != TYPEID_PLAYER) + return; + + switch (phase) + { + case PHASE_ONE: + Talk(SAY_KILLED_PLAYER_P_ONE); + break; + case PHASE_TWO: + Talk(SAY_KILLED_PLAYER_P_TWO); + break; + case PHASE_THREE: + Talk(SAY_KILLED_PLAYER_P_THREE); + break; + } + } + + void SpellHit(Unit* caster, const SpellEntry* spell) + { + if (spell->Id == SPELL_POWER_SPARK_MALYGOS) + { + if (Creature* creature = caster->ToCreature()) + creature->DespawnOrUnsummon(); + + Talk(SAY_BUFF_SPARK); + } + } + + void MoveInLineOfSight(Unit* who) + { + if (!me->isInCombat()) + return; + + if (who->GetEntry() == NPC_POWER_SPARK) { - DoScriptText(SAY_PHASE1_AGGRO, me); - if (instance) - instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT); + // not sure about the distance | I think it is better check this here than in the UpdateAI function... + if (who->GetDistance(me) <= 2.5f) + who->CastSpell(me, SPELL_POWER_SPARK_MALYGOS, true); + } + } + + void PrepareForVortex() + { + me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + + me->GetMotionMaster()->MovementExpired(); + me->GetMotionMaster()->MovePoint(MOVE_VORTEX,MalygosPositions[1].GetPositionX(), MalygosPositions[1].GetPositionY(), MalygosPositions[1].GetPositionZ()); + // continues in MovementInform function. + } + + void ExecuteVortex() + { + DoCast(me,SPELL_VORTEX_1,true); + DoCast(me,SPELL_VORTEX_2,true); - if (phase == 2) - DoScriptText(SAY_PHASE1_AGGRO, me); - if (phase == 3) - DoScriptText(SAY_PHASE1_AGGRO, me); + // the vortex execution continues in the dummy effect of this spell (see its script) + DoCast(me,SPELL_VORTEX_3,true); } - void UpdateAI(const uint32 /*diff*/) + void MovementInform(uint32 type, uint32 id) + { + if (type != POINT_MOTION_TYPE) + return; + + switch (id) + { + case MOVE_VORTEX: + me->GetMotionMaster()->MoveIdle(); + ExecuteVortex(); + break; + case MOVE_DEEP_BREATH_ROTATION: + currentPos = currentPos == MALYGOS_MAX_WAYPOINTS - 1 ? 0 : currentPos+1; + me->GetMotionMaster()->MovementExpired(); + me->GetMotionMaster()->MovePoint(MOVE_DEEP_BREATH_ROTATION,MalygosPhaseTwoWaypoints[currentPos]); + break; + case MOVE_INIT_PHASE_ONE: + me->SetInCombatWithZone(); + break; + case MOVE_CENTER_PLATFORM: + cannotMove = false; + // malygos will move into center of platform and then he does not chase dragons, he just turns to his current target. + me->GetMotionMaster()->MoveIdle(); + break; + } + } + + void StartPhaseTwo() + { + SetPhase(PHASE_TWO,true); + + me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + + me->GetMotionMaster()->MoveIdle(); + me->GetMotionMaster()->MovePoint(MOVE_DEEP_BREATH_ROTATION,MalygosPhaseTwoWaypoints[0]); + + Creature* summon = me->SummonCreature(NPC_HOVER_DISK_CASTER,HoverDiskWaypoints[MAX_HOVER_DISK_WAYPOINTS-1]); + if (summon && summon->IsAIEnabled) + summon->AI()->DoAction(ACTION_HOVER_DISK_START_WP_2); + summon = me->SummonCreature(NPC_HOVER_DISK_CASTER,HoverDiskWaypoints[0]); + if (summon && summon->IsAIEnabled) + summon->AI()->DoAction(ACTION_HOVER_DISK_START_WP_1); + + for (uint8 i = 0; i < 2; i++) + { + // not sure about its position. + summon = me->SummonCreature(NPC_HOVER_DISK_MELEE,HoverDiskWaypoints[0]); + if (summon) + summon->SetInCombatWithZone(); + } + } + + void UpdateAI(const uint32 diff) { - //Return since we have no target if (!UpdateVictim()) return; - if (phase == 1 && HealthBelowPct(50)) { - phase = 2; - //spawn adds - //set malygos unatackable untill all adds spawned dead - //start phase3 + events.Update(diff); + + if (phase == PHASE_THREE) + { + if (!cannotMove) + { + // it can change if the player falls from the vehicle. + if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != IDLE_MOTION_TYPE) + { + me->GetMotionMaster()->MovementExpired(); + me->GetMotionMaster()->MoveIdle(); + } + } else + { + if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != POINT_MOTION_TYPE) + { + me->GetMotionMaster()->MovementExpired(); + me->GetMotionMaster()->MovePoint(MOVE_CENTER_PLATFORM,MalygosPositions[0].GetPositionX(),MalygosPositions[0].GetPositionY(),MalygosPositions[0].GetPositionZ()); + } + } + } + + // we need a better way for pathing + if (delayedMovement) + { + if (delayedMovementTimer <= diff) + { + me->GetMotionMaster()->MovePoint(MOVE_DEEP_BREATH_ROTATION,MalygosPhaseTwoWaypoints[currentPos]); + delayedMovementTimer = 8000; + delayedMovement = false; + } delayedMovementTimer -= diff; + } + + // at 50 % health malygos switch to phase 2 + if (me->GetHealthPct() <= 50.0f && phase == PHASE_ONE) + StartPhaseTwo(); + + // the boss is handling vortex + if (me->HasAura(SPELL_VORTEX_2)) + return; + + // We can't cast if we are casting already. + if (me->HasUnitState(UNIT_STAT_CASTING)) + return; + + while (uint32 eventId = events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_YELL_2: + Talk(SAY_END_P_TWO); + break; + case EVENT_YELL_3: + Talk(SAY_INTRO_P_THREE); + break; + case EVENT_YELL_4: + Talk(SAY_AGGRO_P_THREE); + break; + case EVENT_YELL_0: + Talk(SAY_END_P_ONE); + break; + case EVENT_YELL_1: + Talk(SAY_AGGRO_P_TWO); + break; + case EVENT_ARCANE_BREATH: + DoCast(me->getVictim(),SPELL_ARCANE_BREATH); + events.ScheduleEvent(EVENT_ARCANE_BREATH,urand(35,60)*IN_MILLISECONDS,0,PHASE_ONE); + break; + case EVENT_ARCANE_STORM: + DoCast(me->getVictim(),SPELL_ARCANE_STORM); + events.ScheduleEvent(EVENT_ARCANE_STORM,urand(5,10)*IN_MILLISECONDS,0,PHASE_ONE); + break; + case EVENT_VORTEX: + PrepareForVortex(); + events.ScheduleEvent(EVENT_VORTEX,urand(60,80)*IN_MILLISECONDS,0,PHASE_ONE); + break; + case EVENT_POWER_SPARKS: + instance->SetData(DATA_POWER_SPARKS_HANDLING,0); + events.ScheduleEvent(EVENT_POWER_SPARKS,urand(30,35)*IN_MILLISECONDS,0,PHASE_ONE); + break; + case EVENT_SURGE_POWER: + me->GetMotionMaster()->MoveIdle(); + delayedMovement = true; + DoCast(SPELL_SURGE_POWER); + events.ScheduleEvent(EVENT_SURGE_POWER,urand(60,70)*IN_MILLISECONDS,0,PHASE_TWO); + break; + case EVENT_SUMMON_ARCANE: + DoCast(SPELL_SUMMON_ARCANE_BOMB); + events.ScheduleEvent(EVENT_SUMMON_ARCANE,urand(12,15)*IN_MILLISECONDS,0,PHASE_TWO); + break; + case EVENT_SURGE_POWER_PHASE_3: + DoCast(GetTargetPhaseThree(),SPELL_SURGE_POWER_PHASE_3); + events.ScheduleEvent(EVENT_SURGE_POWER_PHASE_3,(7,16)*IN_MILLISECONDS,0,PHASE_THREE); + break; + case EVENT_STATIC_FIELD: + DoCast(GetTargetPhaseThree(),SPELL_STATIC_FIELD); + events.ScheduleEvent(EVENT_STATIC_FIELD,(20,30)*IN_MILLISECONDS,0,PHASE_THREE); + break; + default: + break; + } } DoMeleeAttackIfReady(); } + Unit* GetTargetPhaseThree() + { + Unit* target = SelectTarget(SELECT_TARGET_RANDOM,0); + + // we are a drake + if (target->GetVehicleKit()) + return target; + + // we are a player using a drake (or at least you should) + if (target->GetTypeId() == TYPEID_PLAYER) + { + if (Unit* base = target->GetVehicleBase()) + return base; + } + + // is a player falling from a vehicle? + return NULL; + } + void JustDied(Unit* /*killer*/) { - DoScriptText(SAY_DEATH, me); + Talk(SAY_DEATH); + _JustDied(); } - void KilledUnit(Unit * victim) + private: + uint8 phase; + uint32 bersekerTimer; + uint8 currentPos; // used for phase 2 rotation... + bool delayedMovement; // used in phase2. + uint32 delayedMovementTimer; // used in phase 2 + uint8 summonDeaths; + Position homePosition; // it can get bugged because core thinks we are pathing + bool mustTalk; + bool cannotMove; + }; + +}; + +class spell_malygos_vortex_dummy : public SpellScriptLoader +{ +public: + spell_malygos_vortex_dummy() : SpellScriptLoader("spell_malygos_vortex_dummy") {} + + class spell_malygos_vortex_dummy_SpellScript : public SpellScript + { + PrepareSpellScript(spell_malygos_vortex_dummy_SpellScript) + + void HandleScript(SpellEffIndex /*effIndex*/) { - if (victim == me) + Unit* caster = GetCaster(); + + if (!caster) return; - if (phase == 1) - DoScriptText(RAND(SAY_PHASE1_SLAY_1,SAY_PHASE1_SLAY_2,SAY_PHASE1_SLAY_3), me); - if (phase == 2) - DoScriptText(RAND(SAY_PHASE2_SLAY_1,SAY_PHASE2_SLAY_2,SAY_PHASE2_SLAY_3), me); - if (phase == 3) - DoScriptText(RAND(SAY_PHASE3_SLAY_1,SAY_PHASE3_SLAY_2,SAY_PHASE3_SLAY_3), me); + // each player will enter to the trigger vehicle (entry 30090) already spawned (each one can hold up to 5 players, it has 5 seats) + // the players enter to the vehicles casting SPELL_VORTEX_4 OR SPELL_VORTEX_5 + if (InstanceScript* instance = caster->GetInstanceScript()) + instance->SetData(DATA_VORTEX_HANDLING,0); + + // the rest of the vortex execution continues when SPELL_VORTEX_2 is removed. + } + + void Register() + { + OnEffect += SpellEffectFn(spell_malygos_vortex_dummy_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_DUMMY); } }; + SpellScript* GetSpellScript() const + { + return new spell_malygos_vortex_dummy_SpellScript(); + } +}; + +class spell_malygos_vortex_visual : public SpellScriptLoader +{ + public: + spell_malygos_vortex_visual() : SpellScriptLoader("spell_malygos_vortex_visual") { } + + class spell_malygos_vortex_visual_AuraScript : public AuraScript + { + PrepareAuraScript(spell_malygos_vortex_visual_AuraScript); + + void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + std::list &m_threatlist = GetCaster()->getThreatManager().getThreatList(); + for (std::list::const_iterator itr = m_threatlist.begin(); itr!= m_threatlist.end(); ++itr) + { + if (Unit* target = (*itr)->getTarget()) + { + Player* targetPlayer = target->ToPlayer(); + + if (!targetPlayer || targetPlayer->isGameMaster()) + continue; + + if (InstanceScript* instance = GetCaster()->GetInstanceScript()) + { + // teleport spell - i am not sure but might be it must be casted by each vehicle when its passenger leaves it + if (Creature* trigger = GetCaster()->GetMap()->GetCreature(instance->GetData64(DATA_TRIGGER))) + trigger->CastSpell(targetPlayer, SPELL_VORTEX_6, true); + } + } + } + + if (Creature* malygos = GetCaster()->ToCreature()) + { + // This is a hack, we have to re add players to the threat list because when they enter to the vehicles they are removed. + // Anyway even with this issue, the boss does not enter in evade mode - this prevents iterate an empty list in the next vortex execution. + malygos->SetInCombatWithZone(); + + malygos->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + + malygos->GetMotionMaster()->MoveChase(GetCaster()->getVictim()); + malygos->RemoveAura(SPELL_VORTEX_1); + } + + } + + void Register() + { + OnEffectRemove += AuraEffectRemoveFn(spell_malygos_vortex_visual_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_malygos_vortex_visual_AuraScript(); + } }; +class npc_portal_eoe: public CreatureScript +{ +public: + npc_portal_eoe() : CreatureScript("npc_portal_eoe") {} + + CreatureAI* GetAI(Creature* pCreature) const + { + return new npc_portal_eoeAI(pCreature); + } + + struct npc_portal_eoeAI : public ScriptedAI + { + npc_portal_eoeAI(Creature* creature) : ScriptedAI(creature) + { + instance = creature->GetInstanceScript(); + } + + void Reset() + { + summonTimer = urand(5,7)*IN_MILLISECONDS; + } + + void UpdateAI(const uint32 diff) + { + if (!me->HasAura(SPELL_PORTAL_VISUAL_CLOSED) && + !me->HasAura(SPELL_PORTAL_OPENED)) + DoCast(me,SPELL_PORTAL_VISUAL_CLOSED,true); + + if (instance) + { + if (Creature* malygos = Unit::GetCreature(*me,instance->GetData64(DATA_MALYGOS))) + { + if (malygos->AI()->GetData(DATA_PHASE) != PHASE_ONE) + { + me->RemoveAura(SPELL_PORTAL_OPENED); + DoCast(me,SPELL_PORTAL_VISUAL_CLOSED,true); + } + } + } + + if (!me->HasAura(SPELL_PORTAL_OPENED)) + return; + + if (summonTimer <= diff) + { + DoCast(SPELL_SUMMON_POWER_PARK); + summonTimer = urand(5,7)*IN_MILLISECONDS; + } else summonTimer -= diff; + } + + void JustSummoned(Creature* summon) + { + summon->SetInCombatWithZone(); + } + + private: + uint32 summonTimer; + InstanceScript* instance; + }; +}; + + +class npc_power_spark: public CreatureScript +{ +public: + npc_power_spark() : CreatureScript("npc_power_spark") {} + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_power_sparkAI(creature); + } + + struct npc_power_sparkAI : public ScriptedAI + { + npc_power_sparkAI(Creature* creature) : ScriptedAI(creature) + { + instance = creature->GetInstanceScript(); + + MoveToMalygos(); + } + + void EnterEvadeMode() + { + me->DespawnOrUnsummon(); + } + + void MoveToMalygos() + { + me->GetMotionMaster()->MoveIdle(); + + if (instance) + { + if (Creature* malygos = Unit::GetCreature(*me,instance->GetData64(DATA_MALYGOS))) + me->GetMotionMaster()->MoveFollow(malygos,0.0f,0.0f); + } + } + + void UpdateAI(const uint32 diff) + { + if (!instance) + return; + + if (Creature* malygos = Unit::GetCreature(*me,instance->GetData64(DATA_MALYGOS))) + { + if (malygos->AI()->GetData(DATA_PHASE) != PHASE_ONE) + { + me->DespawnOrUnsummon(); + return; + } + + if (malygos->HasAura(SPELL_VORTEX_1)) + { + me->GetMotionMaster()->MoveIdle(); + return; + } + + if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != TARGETED_MOTION_TYPE) + me->GetMotionMaster()->MoveFollow(malygos,0.0f,0.0f); + } + } + + void DamageTaken(Unit* /*done_by*/, uint32& damage) + { + if (damage > me->GetMaxHealth()) + { + damage = 0; + DoCast(me,SPELL_POWER_SPARK_DEATH,true); + me->DespawnOrUnsummon(1000); + } + } + + private: + InstanceScript* instance; + }; +}; + +class npc_hover_disk : public CreatureScript +{ +public: + npc_hover_disk() : CreatureScript("npc_hover_disk") { } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_hover_diskAI(creature); + } + + struct npc_hover_diskAI : public npc_escortAI + { + npc_hover_diskAI(Creature* creature) : npc_escortAI(creature) + { + if (me->GetEntry() == NPC_HOVER_DISK_CASTER) + me->SetReactState(REACT_PASSIVE); + else + me->SetInCombatWithZone(); + + instance = creature->GetInstanceScript(); + } + + void Reset() + { + if (Vehicle* veh = me->GetVehicleKit()) + veh->Reset(); + } + + void PassengerBoarded(Unit* unit, int8 seat, bool apply) + { + if (apply) + { + if (unit->GetTypeId() == TYPEID_UNIT) + { + me->setFaction(FACTION_HOSTILE); + unit->ToCreature()->SetInCombatWithZone(); + } + } + else + { + // Error found: This is not called if the passenger is a player + + if (unit->GetTypeId() == TYPEID_UNIT) + { + // This will only be called if the passenger dies + if (instance) + { + if (Creature* malygos = Unit::GetCreature(*me,instance->GetData64(DATA_MALYGOS))) + malygos->AI()->SetData(DATA_SUMMON_DEATHS,malygos->AI()->GetData(DATA_SUMMON_DEATHS)+1); + } + + me->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NOT_SELECTABLE); + } + + me->GetMotionMaster()->MoveIdle(); + + if (me->GetEntry() == NPC_HOVER_DISK_MELEE) + { + // Hack: Fall ground function can fail (remember the platform is a gameobject), we will teleport the disk to the ground + if (me->GetPositionZ() > GROUND_Z) + me->NearTeleportTo(me->GetPositionX(),me->GetPositionY(),GROUND_Z,0); + me->SetHomePosition(me->GetPositionX(),me->GetPositionY(),me->GetPositionZ(),me->GetOrientation()); + me->setFaction(FACTION_FRIENDLY); + me->AI()->EnterEvadeMode(); + } + } + } + + void EnterEvadeMode() + { + // we dont evade + } + + void DoAction(const int32 action) + { + if (me->GetEntry() != NPC_HOVER_DISK_CASTER) + return; + + switch (action) + { + case ACTION_HOVER_DISK_START_WP_1: + for (uint8 i = 0; i < MAX_HOVER_DISK_WAYPOINTS; i++) + AddWaypoint(i,HoverDiskWaypoints[i].GetPositionX(),HoverDiskWaypoints[i].GetPositionY(),HoverDiskWaypoints[i].GetPositionZ()); + break; + case ACTION_HOVER_DISK_START_WP_2: + { + uint8 count = 0; + for (uint8 i = MAX_HOVER_DISK_WAYPOINTS-1; i > 0; i--) + { + AddWaypoint(count,HoverDiskWaypoints[i].GetPositionX(),HoverDiskWaypoints[i].GetPositionY(),HoverDiskWaypoints[i].GetPositionZ()); + count++; + } + break; + } + default: + return; + } + + Start(true,false,0,0,false,true); + } + + void UpdateEscortAI(const uint32 /*diff*/) + { + // we dont do melee damage! + } + + void WaypointReached(uint32 i) + { + + } + + private: + InstanceScript* instance; + }; +}; + + +// The reason of this AI is to make the creature able to enter in combat otherwise the spell casting of SPELL_ARCANE_OVERLOAD fails. +class npc_arcane_overload : public CreatureScript +{ +public: + npc_arcane_overload() : CreatureScript("npc_arcane_overload") {} + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_arcane_overloadAI (creature); + } + + struct npc_arcane_overloadAI : public ScriptedAI + { + npc_arcane_overloadAI(Creature* creature) : ScriptedAI(creature) {} + + void AttackStart(Unit* who) + { + DoStartNoMovement(who); + } + + void Reset() + { + DoCast(me,SPELL_ARCANE_OVERLOAD,false); + } + + void UpdateAI(const uint32 diff) + { + // we dont do melee damage! + } + + }; +}; + +// SmartAI does not work correctly for this (vehicles) +class npc_wyrmrest_skytalon : public CreatureScript +{ +public: + npc_wyrmrest_skytalon() : CreatureScript("npc_wyrmrest_skytalon") {} + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_wyrmrest_skytalonAI (creature); + } + + struct npc_wyrmrest_skytalonAI : public NullCreatureAI + { + npc_wyrmrest_skytalonAI(Creature* creature) : NullCreatureAI(creature) + { + instance = creature->GetInstanceScript(); + + timer = 1000; + entered = false; + } + + // we can't call this in reset function, it fails. + void MakePlayerEnter() + { + if (!instance) + return; + + if (Creature* malygos = Unit::GetCreature(*me,instance->GetData64(DATA_MALYGOS))) + { + if (Unit* summoner = me->ToTempSummon()->GetSummoner()) + { + summoner->CastSpell(me,SPELL_RIDE_RED_DRAGON,true); + if (Creature* malygos = Unit::GetCreature(*me,instance->GetData64(DATA_MALYGOS))) + { + float victim_threat = malygos->getThreatManager().getThreat(summoner); + malygos->getThreatManager().resetAllAggro(); + malygos->AI()->AttackStart(me); + malygos->AddThreat(me, victim_threat); + } + } + } + } + + void UpdateAI(const uint32 diff) + { + if (!entered) + { + if (timer <= diff) + { + MakePlayerEnter(); + entered = true; + } else timer -= diff; + } + } + + private: + InstanceScript* instance; + uint32 timer; + bool entered; + }; +}; + +enum AlexstraszaYells +{ + SAY_ONE, + SAY_TWO, + SAY_THREE, + SAY_FOUR +}; + +class npc_alexstrasza_eoe : public CreatureScript +{ +public: + npc_alexstrasza_eoe() : CreatureScript("npc_alexstrasza_eoe") { } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_alexstrasza_eoeAI (creature); + } + + struct npc_alexstrasza_eoeAI : public ScriptedAI + { + npc_alexstrasza_eoeAI(Creature* creature) : ScriptedAI(creature) {} + + void Reset() + { + events.Reset(); + + events.ScheduleEvent(EVENT_YELL_1,0); + } + + void UpdateAI(const uint32 diff) + { + while (uint32 eventId = events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_YELL_1: + Talk(SAY_ONE); + events.ScheduleEvent(EVENT_YELL_2,4*IN_MILLISECONDS); + break; + case EVENT_YELL_2: + Talk(SAY_TWO); + events.ScheduleEvent(EVENT_YELL_3,4*IN_MILLISECONDS); + break; + case EVENT_YELL_3: + Talk(SAY_THREE); + events.ScheduleEvent(EVENT_YELL_4,7*IN_MILLISECONDS); + break; + case EVENT_YELL_4: + Talk(SAY_FOUR); + break; + } + } + } + private: + EventMap events; + }; +}; void AddSC_boss_malygos() { new boss_malygos(); + new npc_portal_eoe(); + new npc_power_spark(); + new npc_hover_disk(); + new npc_arcane_overload(); + new npc_wyrmrest_skytalon(); + new spell_malygos_vortex_dummy(); + new spell_malygos_vortex_visual(); + new npc_alexstrasza_eoe(); } 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 04415f0af071e..5bd66b9ffa467 100644 --- a/src/server/scripts/Northrend/Nexus/EyeOfEternity/eye_of_eternity.h +++ b/src/server/scripts/Northrend/Nexus/EyeOfEternity/eye_of_eternity.h @@ -18,4 +18,55 @@ #ifndef DEF_EYE_OF_ETERNITY_H #define DEF_EYE_OF_ETERNITY_H +enum InstanceData +{ + DATA_MALYGOS_EVENT, + MAX_ENCOUNTER, + + DATA_VORTEX_HANDLING, + DATA_POWER_SPARKS_HANDLING +}; + +enum InstanceData64 +{ + DATA_TRIGGER, + DATA_MALYGOS, + DATA_PLATFORM +}; + +enum InstanceNpcs +{ + NPC_MALYGOS = 28859, + NPC_VORTEX_TRIGGER = 30090, + NPC_PORTAL_TRIGGER = 30118, + NPC_POWER_SPARK = 30084, + NPC_HOVER_DISK_MELEE = 30234, + NPC_HOVER_DISK_CASTER = 30248, + NPC_ARCANE_OVERLOAD = 30282, + NPC_WYRMREST_SKYTALON = 30161, + NPC_ALEXSTRASZA = 32295 +}; + +enum InstanceGameObjects +{ + GO_NEXUS_RAID_PLATFORM = 193070, + GO_EXIT_PORTAL = 193908, + GO_FOCUSING_IRIS = 193958, + GO_ALEXSTRASZA_S_GIFT = 193905, + GO_ALEXSTRASZA_S_GIFT_2 = 193967 +}; + +enum InstanceEvents +{ + EVENT_FOCUSING_IRIS = 20711 +}; + +enum InstanceSpells +{ + SPELL_VORTEX_4 = 55853, // damage | used to enter to the vehicle + SPELL_VORTEX_5 = 56263, // damage | used to enter to the vehicle + SPELL_PORTAL_OPENED = 61236, + SPELL_RIDE_RED_DRAGON = 56071, +}; + #endif 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 49d7997ddc5fe..a28b5258e4b4c 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 @@ -21,22 +21,275 @@ class instance_eye_of_eternity : public InstanceMapScript { public: - instance_eye_of_eternity() : InstanceMapScript("instance_eye_of_eternity", 616) { } + instance_eye_of_eternity() : InstanceMapScript("instance_eye_of_eternity", 616) {} - InstanceScript* GetInstanceScript(InstanceMap* pMap) const + InstanceScript* GetInstanceScript(InstanceMap* map) const { - return new instance_eye_of_eternity_InstanceMapScript(pMap); + return new instance_eye_of_eternity_InstanceMapScript(map); } struct instance_eye_of_eternity_InstanceMapScript : public InstanceScript { - instance_eye_of_eternity_InstanceMapScript(Map* pMap) : InstanceScript(pMap) {Initialize();}; - }; + instance_eye_of_eternity_InstanceMapScript(Map* map) : InstanceScript(map) + { + SetBossNumber(MAX_ENCOUNTER); + + vortexTriggers.clear(); + portalTriggers.clear(); + + malygosGUID = 0; + lastPortalGUID = 0; + platformGUID = 0; + exitPortalGUID = 0; + }; + + bool SetBossState(uint32 type, EncounterState state) + { + if (!InstanceScript::SetBossState(type, state)) + return false; + + if (type == DATA_MALYGOS_EVENT) + { + if (state == FAIL) + { + for (std::list::const_iterator itr_trigger = portalTriggers.begin(); itr_trigger != portalTriggers.end(); ++itr_trigger) + { + if (Creature* trigger = instance->GetCreature(*itr_trigger)) + { + // just in case + trigger->RemoveAllAuras(); + trigger->AI()->Reset(); + } + } + + SpawnGameObject(GO_FOCUSING_IRIS,focusingIrisPosition); + SpawnGameObject(GO_EXIT_PORTAL,exitPortalPosition); + + if (GameObject* platform = instance->GetGameObject(platformGUID)) + platform->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_DESTROYED); + } else if (state == DONE) + { + if (Creature* malygos = instance->GetCreature(malygosGUID)) + malygos->SummonCreature(NPC_ALEXSTRASZA,829.0679f,1244.77f,279.7453f,2.32f); + + SpawnGameObject(GO_EXIT_PORTAL,exitPortalPosition); + + // we make the platform appear again because at the moment we don't support looting using a vehicle + if (GameObject* platform = instance->GetGameObject(platformGUID)) + platform->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_DESTROYED); + + if (GameObject* chest = instance->GetGameObject(chestGUID)) + chest->SetRespawnTime(chest->GetRespawnDelay()); + } + } + return true; + } + + // There is no other way afaik... + void SpawnGameObject(uint32 entry, Position& pos) + { + GameObject* go = new GameObject; + if (!go->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_GAMEOBJECT),entry, instance, + PHASEMASK_NORMAL, pos.GetPositionX(),pos.GetPositionY(),pos.GetPositionZ(),pos.GetOrientation(), + 0,0,0,0,120,GO_STATE_READY)) + { + delete go; + return; + } + + instance->Add(go); + } + + void OnGameObjectCreate(GameObject* go) + { + switch (go->GetEntry()) + { + case GO_NEXUS_RAID_PLATFORM: + platformGUID = go->GetGUID(); + break; + case GO_FOCUSING_IRIS: + go->GetPosition(&focusingIrisPosition); + break; + case GO_EXIT_PORTAL: + exitPortalGUID = go->GetGUID(); + go->GetPosition(&exitPortalPosition); + break; + case GO_ALEXSTRASZA_S_GIFT: + case GO_ALEXSTRASZA_S_GIFT_2: + chestGUID = go->GetGUID(); + break; + } + } + + void OnCreatureCreate(Creature* creature) + { + switch (creature->GetEntry()) + { + case NPC_VORTEX_TRIGGER: + vortexTriggers.push_back(creature->GetGUID()); + break; + case NPC_MALYGOS: + malygosGUID = creature->GetGUID(); + break; + case NPC_PORTAL_TRIGGER: + portalTriggers.push_back(creature->GetGUID()); + break; + } + } + + void ProcessEvent(GameObject* go, uint32 eventId) + { + if (eventId == EVENT_FOCUSING_IRIS) + { + go->Delete(); // this is not the best way. + if (Creature* malygos = instance->GetCreature(malygosGUID)) + malygos->GetMotionMaster()->MovePoint(4,770.10f, 1275.33f, 267.23f); // MOVE_INIT_PHASE_ONE + + if (GameObject* exitPortal = instance->GetGameObject(exitPortalGUID)) + exitPortal->Delete(); + } + } + + void VortexHandling() + { + if (Creature* malygos = instance->GetCreature(malygosGUID)) + { + std::list m_threatlist = malygos->getThreatManager().getThreatList(); + for (std::list::const_iterator itr_vortex = vortexTriggers.begin(); itr_vortex != vortexTriggers.end(); ++itr_vortex) + { + if (m_threatlist.empty()) + return; + + uint8 counter = 0; + if (Creature* trigger = instance->GetCreature(*itr_vortex)) + { + // each trigger have to cast the spell to 5 players. + for (std::list::const_iterator itr = m_threatlist.begin(); itr!= m_threatlist.end(); ++itr) + { + if (counter >= 5) + break; + + if (Unit* target = (*itr)->getTarget()) + { + Player* player = target->ToPlayer(); + if (!player || player->isGameMaster() || player->HasAura(SPELL_VORTEX_4)) + continue; + + player->CastSpell(trigger,SPELL_VORTEX_4,true); + counter++; + } + } + } + } + } + } + + void PowerSparksHandling() + { + bool next = (lastPortalGUID == portalTriggers.back() || !lastPortalGUID ? true : false); + + for (std::list::const_iterator itr_trigger = portalTriggers.begin(); itr_trigger != portalTriggers.end(); ++itr_trigger) + { + if (next) + { + if (Creature* trigger = instance->GetCreature(*itr_trigger)) + { + lastPortalGUID = trigger->GetGUID(); + trigger->CastSpell(trigger,SPELL_PORTAL_OPENED,true); + return; + } + } + + if (*itr_trigger == lastPortalGUID) + next = true; + } + } + + void SetData(uint32 data,uint32 /*value*/) + { + switch (data) + { + case DATA_VORTEX_HANDLING: + VortexHandling(); + break; + case DATA_POWER_SPARKS_HANDLING: + PowerSparksHandling(); + break; + } + } + + uint64 GetData64(uint32 data) + { + switch (data) + { + case DATA_TRIGGER: + return vortexTriggers.front(); + case DATA_MALYGOS: + return malygosGUID; + case DATA_PLATFORM: + return platformGUID; + } + + return 0; + } + + std::string GetSaveData() + { + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << "E E " << GetBossSaveData(); + + OUT_SAVE_INST_DATA_COMPLETE; + return saveStream.str(); + } + + void Load(const char* str) + { + if (!str) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(str); + + char dataHead1, dataHead2; + + std::istringstream loadStream(str); + loadStream >> dataHead1 >> dataHead2; + + if (dataHead1 == 'E' && dataHead2 == 'E') + { + for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) + { + uint32 tmpState; + loadStream >> tmpState; + if (tmpState == IN_PROGRESS || tmpState > SPECIAL) + tmpState = NOT_STARTED; + SetBossState(i, EncounterState(tmpState)); + } + + } else OUT_LOAD_INST_DATA_FAIL; + + OUT_LOAD_INST_DATA_COMPLETE; + } + + private: + std::list vortexTriggers; + std::list portalTriggers; + uint64 malygosGUID; + uint64 lastPortalGUID; + uint64 platformGUID; + uint64 exitPortalGUID; + uint64 chestGUID; + Position focusingIrisPosition; + Position exitPortalPosition; + }; }; void AddSC_instance_eye_of_eternity() { - // doesn't exist in the database? - //new instance_eye_of_eternity(); + new instance_eye_of_eternity(); } diff --git a/src/server/scripts/Northrend/Nexus/Nexus/boss_anomalus.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_anomalus.cpp index 2c1b18940052d..ffdd038ace3c8 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/boss_anomalus.cpp +++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_anomalus.cpp @@ -153,17 +153,16 @@ class boss_anomalus : public CreatureScript if (Rift) { //DoCast(Rift, SPELL_CHARGE_RIFT); - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) Rift->AI()->AttackStart(pTarget); uiChaoticRiftGUID = Rift->GetGUID(); DoScriptText(SAY_RIFT , me); } } - if (uiSparkTimer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(pTarget, SPELL_SPARK); uiSparkTimer = 5*IN_MILLISECONDS; } else uiSparkTimer -= diff; @@ -174,7 +173,6 @@ class boss_anomalus : public CreatureScript }; - enum RiftSpells { SPELL_CHAOTIC_ENERGY_BURST = 47688, @@ -228,7 +226,7 @@ class mob_chaotic_rift : public CreatureScript if (uiChaoticEnergyBurstTimer <= diff) { Unit* pAnomalus = Unit::GetUnit(*me, pInstance ? pInstance->GetData64(DATA_ANOMALUS) : 0); - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) { if (pAnomalus && pAnomalus->HasAura(SPELL_RIFT_SHIELD)) DoCast(pTarget, SPELL_CHARGED_CHAOTIC_ENERGY_BURST); @@ -242,7 +240,7 @@ class mob_chaotic_rift : public CreatureScript { 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)) + if (Unit *pTarget = SelectTarget(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)) @@ -255,7 +253,6 @@ class mob_chaotic_rift : public CreatureScript }; - void AddSC_boss_anomalus() { new boss_anomalus(); diff --git a/src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp index 325ad55ea7ecd..07a943a0234cd 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp +++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp @@ -223,7 +223,6 @@ class boss_keristrasza : public CreatureScript }; - class containment_sphere : public GameObjectScript { public: 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 c9c99642b0a3c..eaca718d419fb 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp +++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp @@ -167,7 +167,7 @@ class boss_magus_telestra : public CreatureScript break; } } - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) Summoned->AI()->AttackStart(pTarget); return Summoned->GetGUID(); } @@ -290,7 +290,7 @@ class boss_magus_telestra : public CreatureScript if (uiIceNovaTimer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) { DoCast(pTarget, SPELL_ICE_NOVA, false); uiCooldown = 1500; @@ -310,7 +310,7 @@ class boss_magus_telestra : public CreatureScript if (uiFireBombTimer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) { DoCast(pTarget, SPELL_FIREBOMB, false); uiCooldown = 2*IN_MILLISECONDS; @@ -324,7 +324,6 @@ class boss_magus_telestra : public CreatureScript }; - void AddSC_boss_magus_telestra() { new boss_magus_telestra(); diff --git a/src/server/scripts/Northrend/Nexus/Nexus/boss_ormorok.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_ormorok.cpp index b8023658f7174..431740b8e086e 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/boss_ormorok.cpp +++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_ormorok.cpp @@ -206,7 +206,7 @@ class boss_ormorok : public CreatureScript break; } if (!pTarget) - pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0); if (pTarget) { Crystalline_Tangler->AI()->AttackStart(pTarget); @@ -301,9 +301,6 @@ class mob_crystalline_tangler : public CreatureScript }; - - - void AddSC_boss_ormorok() { new boss_ormorok(); diff --git a/src/server/scripts/Northrend/Nexus/Nexus/commander_kolurg.cpp b/src/server/scripts/Northrend/Nexus/Nexus/commander_kolurg.cpp index ea33c65347d4b..12bf5dec0fc1c 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/commander_kolurg.cpp +++ b/src/server/scripts/Northrend/Nexus/Nexus/commander_kolurg.cpp @@ -68,7 +68,6 @@ class boss_commander_kolurg : public CreatureScript }; - void AddSC_boss_commander_kolurg() { new boss_commander_kolurg(); diff --git a/src/server/scripts/Northrend/Nexus/Nexus/commander_stoutbeard.cpp b/src/server/scripts/Northrend/Nexus/Nexus/commander_stoutbeard.cpp index 525461924c4c8..4d68eb61cc65d 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/commander_stoutbeard.cpp +++ b/src/server/scripts/Northrend/Nexus/Nexus/commander_stoutbeard.cpp @@ -74,7 +74,6 @@ class boss_commander_stoutbeard : public CreatureScript }; - void AddSC_boss_commander_stoutbeard() { new boss_commander_stoutbeard(); diff --git a/src/server/scripts/Northrend/Nexus/Nexus/instance_nexus.cpp b/src/server/scripts/Northrend/Nexus/Nexus/instance_nexus.cpp index ec621de965268..b861c82474064 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/instance_nexus.cpp +++ b/src/server/scripts/Northrend/Nexus/Nexus/instance_nexus.cpp @@ -257,7 +257,6 @@ class instance_nexus : public InstanceMapScript }; - void AddSC_instance_nexus() { new instance_nexus(); diff --git a/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp b/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp index 37fc2f3af4423..af07df4758686 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp @@ -81,17 +81,19 @@ class boss_varos : public CreatureScript coreEnergizeOrientation = 0.0f; } - void AttackStart(Unit* attacker) - { - if (me->HasFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_UNK_9)) - return; - - BossAI::AttackStart(attacker); - } - void EnterCombat(Unit* /*who*/) { _EnterCombat(); + Map::PlayerList const& players = me->GetMap()->GetPlayers(); + if (!players.isEmpty()) + { + for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + { + Player* pPlayer = itr->getSource(); + if (pPlayer) + pPlayer->ExitVehicle(); + } + } Talk(SAY_AGGRO); } @@ -190,7 +192,7 @@ class npc_azure_ring_captain : public CreatureScript } } - void UpdateAI(const uint32 diff) + void UpdateAI(const uint32 /*diff*/) { if (!UpdateVictim()) return; @@ -259,10 +261,10 @@ class spell_varos_centrifuge_shield : public SpellScriptLoader // flags taken from sniffs // UNIT_FLAG_UNK_9 -> means passive but it is not yet implemented in core - if (GetCaster()->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_15|UNIT_FLAG_UNK_9|UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_UNK_6)) + if (GetCaster()->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_15|UNIT_FLAG_PASSIVE|UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_UNK_6)) { GetCaster()->ToCreature()->SetReactState(REACT_PASSIVE); - GetCaster()->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_15|UNIT_FLAG_UNK_9|UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_UNK_6); + GetCaster()->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_15|UNIT_FLAG_PASSIVE|UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_UNK_6); } } @@ -272,7 +274,7 @@ class spell_varos_centrifuge_shield : public SpellScriptLoader return; GetCaster()->ToCreature()->SetReactState(REACT_AGGRESSIVE); - GetCaster()->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_15|UNIT_FLAG_UNK_9|UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_UNK_6); + GetCaster()->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_15|UNIT_FLAG_PASSIVE|UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_UNK_6); } void Register() diff --git a/src/server/scripts/Northrend/Nexus/Oculus/instance_oculus.cpp b/src/server/scripts/Northrend/Nexus/Oculus/instance_oculus.cpp index 835c73912e740..5e3cced7b5ef4 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/instance_oculus.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/instance_oculus.cpp @@ -81,6 +81,10 @@ class instance_oculus : public InstanceMapScript } } + void ProcessEvent(GameObject* /*go*/, uint32 /*eventId*/) + { + } + void ProcessEvent(Unit* /*unit*/, uint32 eventId) { if (eventId != EVENT_CALL_DRAGON) @@ -227,7 +231,6 @@ class instance_oculus : public InstanceMapScript char dataHead1, dataHead2; - std::istringstream loadStream(in); loadStream >> dataHead1 >> dataHead2; @@ -262,7 +265,6 @@ class instance_oculus : public InstanceMapScript }; - void AddSC_instance_oculus() { new instance_oculus(); diff --git a/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp b/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp index 373d9c9900827..71313f54d5916 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp @@ -174,7 +174,6 @@ class npc_oculus_drake : public CreatureScript }; - void AddSC_oculus() { new npc_oculus_drake(); diff --git a/src/server/scripts/Northrend/ObsidianSanctum/boss_sartharion.cpp b/src/server/scripts/Northrend/ObsidianSanctum/boss_sartharion.cpp index a83ca5db0f7b1..8f1ffbcd01e0c 100644 --- a/src/server/scripts/Northrend/ObsidianSanctum/boss_sartharion.cpp +++ b/src/server/scripts/Northrend/ObsidianSanctum/boss_sartharion.cpp @@ -117,7 +117,6 @@ enum eEnums SPELL_FLAME_TSUNAMI_DMG_AURA = 57492, // 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 @@ -264,7 +263,6 @@ class boss_sartharion : public CreatureScript if (me->HasAura(SPELL_TWILIGHT_REVENGE)) me->RemoveAurasDueToSpell(SPELL_TWILIGHT_REVENGE); - me->ResetLootMode(); me->SetHomePosition(3246.57f, 551.263f, 58.6164f, 4.66003f); achievProgress = 0; @@ -625,7 +623,7 @@ class boss_sartharion : public CreatureScript events.ScheduleEvent(EVENT_CLEAVE, urand(7000,10000)); break; case EVENT_LAVA_STRIKE: - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) { CastLavaStrikeOnTarget(pTarget); if(urand(0,5) == 0) @@ -987,7 +985,7 @@ class mob_tenebron : public CreatureScript // shadow fissure if (m_uiShadowFissureTimer <= uiDiff) { - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(pTarget, RAID_MODE(SPELL_SHADOW_FISSURE, SPELL_SHADOW_FISSURE)); m_uiShadowFissureTimer = urand(15000,20000); @@ -1025,7 +1023,6 @@ class mob_tenebron : public CreatureScript }; - /*###### ## Mob Shadron ######*/ @@ -1135,7 +1132,7 @@ class mob_shadron : public CreatureScript // shadow fissure if (m_uiShadowFissureTimer <= uiDiff) { - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(pTarget, RAID_MODE(SPELL_SHADOW_FISSURE, SPELL_SHADOW_FISSURE_H)); m_uiShadowFissureTimer = urand(15000,20000); @@ -1177,7 +1174,6 @@ class mob_shadron : public CreatureScript }; - /*###### ## Mob Vesperon ######*/ @@ -1263,7 +1259,7 @@ class mob_vesperon : public CreatureScript // shadow fissure if (m_uiShadowFissureTimer <= uiDiff) { - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(pTarget, RAID_MODE(SPELL_SHADOW_FISSURE, SPELL_SHADOW_FISSURE_H)); m_uiShadowFissureTimer = urand(15000,20000); @@ -1303,7 +1299,6 @@ class mob_vesperon : public CreatureScript }; - /*###### ## Mob Acolyte of Shadron ######*/ @@ -1404,7 +1399,6 @@ class mob_acolyte_of_shadron : public CreatureScript }; - /*###### ## Mob Acolyte of Vesperon ######*/ @@ -1500,7 +1494,6 @@ class mob_acolyte_of_vesperon : public CreatureScript }; - /*###### ## Mob Twilight Eggs ######*/ @@ -1573,7 +1566,6 @@ class mob_twilight_eggs : public CreatureScript }; - /*###### ## Mob Flame Tsunami ######*/ @@ -1665,9 +1657,6 @@ class npc_twilight_fissure : public CreatureScript }; - - - /*###### ## Mob Twilight Whelps ######*/ @@ -1720,7 +1709,6 @@ class mob_twilight_whelp : public CreatureScript }; - void AddSC_boss_sartharion() { new boss_sartharion(); diff --git a/src/server/scripts/Northrend/ObsidianSanctum/instance_obsidian_sanctum.cpp b/src/server/scripts/Northrend/ObsidianSanctum/instance_obsidian_sanctum.cpp index d31bfb0e9638f..b955cd1209b7d 100644 --- a/src/server/scripts/Northrend/ObsidianSanctum/instance_obsidian_sanctum.cpp +++ b/src/server/scripts/Northrend/ObsidianSanctum/instance_obsidian_sanctum.cpp @@ -140,7 +140,6 @@ class instance_obsidian_sanctum : public InstanceMapScript }; - void AddSC_instance_obsidian_sanctum() { new instance_obsidian_sanctum(); diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp index 1d6bc93b78fc0..f2d972bb05105 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp @@ -432,8 +432,6 @@ class mob_stormforged_lieutenant : public CreatureScript }; - - void AddSC_boss_bjarngrim() { new boss_bjarngrim(); diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp index c8702ca3d9034..9b9d7a3848944 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp @@ -199,7 +199,7 @@ class boss_ionar : public CreatureScript pSummoned->CastSpell(pSummoned, DUNGEON_MODE(SPELL_SPARK_VISUAL_TRIGGER,H_SPELL_SPARK_VISUAL_TRIGGER), true); - Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0); if (pTarget) { pSummoned->SetInCombatWith(pTarget); @@ -257,7 +257,7 @@ class boss_ionar : public CreatureScript if (uiStaticOverloadTimer <= uiDiff) { - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(pTarget, SPELL_STATIC_OVERLOAD); uiStaticOverloadTimer = urand(5*IN_MILLISECONDS, 6*IN_MILLISECONDS); @@ -292,8 +292,6 @@ class boss_ionar : public CreatureScript }; - - /*###### ## mob_spark_of_ionar ######*/ @@ -380,7 +378,6 @@ class mob_spark_of_ionar : public CreatureScript }; - void AddSC_boss_ionar() { new boss_ionar(); diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp index 4a157456fce72..1b314ee3c9dee 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp @@ -180,7 +180,7 @@ class boss_loken : public CreatureScript if (m_uiArcLightning_Timer <= uiDiff) { - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(pTarget, SPELL_ARC_LIGHTNING); m_uiArcLightning_Timer = 15000 + rand()%1000; @@ -220,7 +220,6 @@ class boss_loken : public CreatureScript }; - void AddSC_boss_loken() { new boss_loken(); diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp index b2772393a2a64..1161ffac5eb3c 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp @@ -217,7 +217,7 @@ class boss_volkhan : public CreatureScript { m_lGolemGUIDList.push_back(pSummoned->GetGUID()); - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) pSummoned->GetMotionMaster()->MoveFollow(pTarget, 0.0f, 0.0f); // Why healing when just summoned? @@ -334,7 +334,7 @@ class boss_volkhan : public CreatureScript // 4 - Wait for delay to expire if (m_uiDelay_Timer <= uiDiff) { - if (Unit* pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO, 0)) + if (Unit* pTarget = SelectTarget(SELECT_TARGET_TOPAGGRO, 0)) { me->SetReactState(REACT_AGGRESSIVE); me->SetInCombatWith(pTarget); 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 dbc688d850a4d..84f361bc821d5 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 @@ -251,7 +251,6 @@ class instance_halls_of_lightning : public InstanceMapScript }; - void AddSC_instance_halls_of_lightning() { new instance_halls_of_lightning(); diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_krystallus.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_krystallus.cpp index 4940bdb60f9a4..1f11e7a254a9e 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_krystallus.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_krystallus.cpp @@ -186,7 +186,6 @@ class boss_krystallus : public CreatureScript }; - void AddSC_boss_krystallus() { new boss_krystallus(); 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 53825c71b9d29..5468837a711a6 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 @@ -119,7 +119,7 @@ class boss_maiden_of_grief : public CreatureScript { if (PartingSorrowTimer <= diff) { - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0); if (pTarget) DoCast(pTarget, SPELL_PARTING_SORROW); @@ -144,7 +144,7 @@ class boss_maiden_of_grief : public CreatureScript if (PillarOfWoeTimer <= diff) { - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1); + Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1); if (pTarget) DoCast(pTarget, SPELL_PILLAR_OF_WOE_N); @@ -176,7 +176,6 @@ class boss_maiden_of_grief : public CreatureScript }; - void AddSC_boss_maiden_of_grief() { new boss_maiden_of_grief(); diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_sjonnir.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_sjonnir.cpp index 3f09d430f2572..f286dd23f5889 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_sjonnir.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_sjonnir.cpp @@ -242,7 +242,6 @@ class boss_sjonnir : public CreatureScript }; - class mob_malformed_ooze : public CreatureScript { public: @@ -286,7 +285,6 @@ class mob_malformed_ooze : public CreatureScript }; - class mob_iron_sludge : public CreatureScript { public: @@ -316,7 +314,6 @@ class mob_iron_sludge : public CreatureScript }; - void AddSC_boss_sjonnir() { new boss_sjonnir(); 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 885462ea8d879..9fc0cc599d9e4 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/halls_of_stone.cpp @@ -738,10 +738,6 @@ class npc_brann_hos : public CreatureScript }; - - - - void AddSC_halls_of_stone() { new npc_brann_hos(); 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 72db0ef517c0b..a298a913395e9 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 @@ -268,7 +268,6 @@ class instance_halls_of_stone : public InstanceMapScript }; - void AddSC_instance_halls_of_stone() { new instance_halls_of_stone(); diff --git a/src/server/scripts/Northrend/Ulduar/ulduar/boss_algalon.cpp b/src/server/scripts/Northrend/Ulduar/ulduar/boss_algalon.cpp index 217bcfbeca88e..7a665be714ec6 100644 --- a/src/server/scripts/Northrend/Ulduar/ulduar/boss_algalon.cpp +++ b/src/server/scripts/Northrend/Ulduar/ulduar/boss_algalon.cpp @@ -177,7 +177,7 @@ class boss_algalon : public CreatureScript { if (pSummoned->GetEntry() == CREATURE_COLLAPSING_STAR) { - Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0); if (me->getVictim()) pSummoned->AI()->AttackStart(pTarget ? pTarget : me->getVictim()); m_lCollapsingStarGUIDList.push_back(pSummoned->GetGUID()); @@ -288,7 +288,7 @@ class boss_algalon : public CreatureScript if (CosmicSmash_Timer <= diff) { - DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), RAID_MODE(SPELL_COSMIC_SMASH,H_SPELL_COSMIC_SMASH), true); + DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0), RAID_MODE(SPELL_COSMIC_SMASH,H_SPELL_COSMIC_SMASH), true); CosmicSmash_Timer = urand(30000, 60000); } else CosmicSmash_Timer -= diff; 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 e50d4ebc6d185..6e58205041a7c 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 @@ -297,7 +297,7 @@ class boss_steelbreaker : public CreatureScript events.ScheduleEvent(EVENT_FUSION_PUNCH, urand(15000, 20000)); break; case EVENT_STATIC_DISRUPTION: - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(pTarget, SPELL_STATIC_DISRUPTION); events.ScheduleEvent(EVENT_STATIC_DISRUPTION, 20000 + (rand()%20)*1000); break; @@ -469,13 +469,13 @@ class boss_runemaster_molgeim : public CreatureScript break; case EVENT_RUNE_OF_DEATH: DoScriptText(SAY_MOLGEIM_RUNE_DEATH, me); - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(pTarget, SPELL_RUNE_OF_DEATH); events.ScheduleEvent(EVENT_RUNE_OF_DEATH, 30000); break; case EVENT_RUNE_OF_SUMMONING: DoScriptText(SAY_MOLGEIM_SUMMON, me); - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(pTarget, SPELL_RUNE_OF_SUMMONING); events.ScheduleEvent(EVENT_RUNE_OF_SUMMONING, urand(40000, 50000)); break; @@ -733,7 +733,7 @@ class boss_stormcaller_brundir : public CreatureScript DoCast(SPELL_BERSERK); break; case EVENT_CHAIN_LIGHTNING: - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(pTarget, SPELL_CHAIN_LIGHTNING); events.ScheduleEvent(EVENT_CHAIN_LIGHTNING, urand(4000, 6000)); break; @@ -761,7 +761,7 @@ class boss_stormcaller_brundir : public CreatureScript events.ScheduleEvent(EVENT_LIGHTNING_TENDRILS, 90000); break; case EVENT_FLIGHT: - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) me->GetMotionMaster()->MovePoint(0, pTarget->GetPositionX(), pTarget->GetPositionY(), 435); events.ScheduleEvent(EVENT_FLIGHT, 6000); break; diff --git a/src/server/scripts/Northrend/Ulduar/ulduar/boss_auriaya.cpp b/src/server/scripts/Northrend/Ulduar/ulduar/boss_auriaya.cpp index 888f891940584..ad32cfe9f0b8a 100644 --- a/src/server/scripts/Northrend/Ulduar/ulduar/boss_auriaya.cpp +++ b/src/server/scripts/Northrend/Ulduar/ulduar/boss_auriaya.cpp @@ -113,7 +113,7 @@ class boss_auriaya : public CreatureScript if (Creature* Sentry = me->SummonCreature(NPC_SANCTUM_SENTRY, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000)) Sentry->GetMotionMaster()->MoveFollow(me, 0.5, -1.5, MOTION_SLOT_ACTIVE); - if (getDifficulty() == RAID_DIFFICULTY_25MAN_NORMAL) + if (GetDifficulty() == RAID_DIFFICULTY_25MAN_NORMAL) { if (Creature* Sentry = me->SummonCreature(NPC_SANCTUM_SENTRY, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000)) Sentry->GetMotionMaster()->MoveFollow(me, -2.5, 1.5, MOTION_SLOT_ACTIVE); 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 44aa5a1d1c964..03e5ea2cbc77d 100644 --- a/src/server/scripts/Northrend/Ulduar/ulduar/boss_flame_leviathan.cpp +++ b/src/server/scripts/Northrend/Ulduar/ulduar/boss_flame_leviathan.cpp @@ -344,7 +344,7 @@ class boss_flame_leviathan : public CreatureScript for (uint8 i = RAID_MODE(2,0); i < 4; ++i) { if (vehicle->GetPassenger(i)) - if (Vehicle *pSeat = vehicle->GetPassenger(i)->GetVehicleKit()) + if (Unit *pSeat = vehicle->GetPassenger(i)) { if (Creature* pTurret = (me->SummonCreature(NPC_TURRET, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_MANUAL_DESPAWN))) pTurret->EnterVehicle(pSeat, SEAT_TURRET); @@ -408,7 +408,7 @@ class boss_flame_leviathan : public CreatureScript void SpellHit(Unit* /*caster*/, const SpellEntry* pSpell) { if (pSpell->Id == SPELL_START_THE_ENGINE) - vehicle->InstallAllAccessories(me->GetEntry()); + vehicle->InstallAllAccessories(); if (pSpell->Id == SPELL_ELECTROSHOCK) me->InterruptSpell(CURRENT_CHANNELED_SPELL); 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 4d09902adefb0..3406bc1acef23 100644 --- a/src/server/scripts/Northrend/Ulduar/ulduar/boss_general_vezax.cpp +++ b/src/server/scripts/Northrend/Ulduar/ulduar/boss_general_vezax.cpp @@ -120,7 +120,6 @@ class boss_general_vezax : public CreatureScript void Reset() { _Reset(); - me->ResetLootMode(); VaporsCount = 0; HardMode = true; Dodged = true; @@ -197,7 +196,7 @@ class boss_general_vezax : public CreatureScript switch(eventId) { case EVENT_SHADOW_CRASH: - if (Unit *pTarget = SelectUnit(SELECT_TARGET_FARTHEST, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_FARTHEST, 0)) if (!pTarget->IsWithinDist(me, 15)) DoCast(pTarget, SPELL_SHADOW_CRASH); events.ScheduleEvent(EVENT_SHADOW_CRASH, urand(6000, 10000)); @@ -213,7 +212,7 @@ class boss_general_vezax : public CreatureScript events.ScheduleEvent(EVENT_DARKNESS, urand(60000, 70000)); break; case EVENT_MARK: - if (Unit *pTarget = SelectUnit(SELECT_TARGET_FARTHEST, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_FARTHEST, 0)) DoCast(pTarget, SPELL_MARK_OF_THE_FACELESS); events.ScheduleEvent(EVENT_MARK, urand(35000, 40000)); break; diff --git a/src/server/scripts/Northrend/Ulduar/ulduar/boss_hodir.cpp b/src/server/scripts/Northrend/Ulduar/ulduar/boss_hodir.cpp index e50ce09b1787c..4b0378387bc11 100644 --- a/src/server/scripts/Northrend/Ulduar/ulduar/boss_hodir.cpp +++ b/src/server/scripts/Northrend/Ulduar/ulduar/boss_hodir.cpp @@ -879,7 +879,6 @@ class npc_flash_freeze : public CreatureScript }; - void AddSC_boss_hodir() { new boss_hodir(); diff --git a/src/server/scripts/Northrend/Ulduar/ulduar/boss_ignis.cpp b/src/server/scripts/Northrend/Ulduar/ulduar/boss_ignis.cpp index ff0b69a3c1453..ad68086970fef 100644 --- a/src/server/scripts/Northrend/Ulduar/ulduar/boss_ignis.cpp +++ b/src/server/scripts/Northrend/Ulduar/ulduar/boss_ignis.cpp @@ -23,7 +23,6 @@ EndScriptData */ #include "ScriptPCH.h" #include "ulduar.h" -#include "SpellAuraEffects.h" enum Yells { @@ -226,7 +225,7 @@ class boss_ignis : public CreatureScript case EVENT_GRAB_POT: if (Unit* SlagPotTarget = Unit::GetUnit(*me, SlagPotGUID)) { - SlagPotTarget->EnterVehicle(me, 0); + SlagPotTarget->_EnterVehicle(vehicle, 0); events.ScheduleEvent(EVENT_CHANGE_POT, 1000); } break; diff --git a/src/server/scripts/Northrend/Ulduar/ulduar/boss_kologarn.cpp b/src/server/scripts/Northrend/Ulduar/ulduar/boss_kologarn.cpp index 042e624eb4298..6de400d367094 100644 --- a/src/server/scripts/Northrend/Ulduar/ulduar/boss_kologarn.cpp +++ b/src/server/scripts/Northrend/Ulduar/ulduar/boss_kologarn.cpp @@ -129,7 +129,6 @@ class boss_kologarn : public CreatureScript me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_GRIP, true); me->SetStandState(UNIT_STAND_STATE_SUBMERGED); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED); - SetCombatMovement(false); emerged = false; } @@ -143,7 +142,7 @@ class boss_kologarn : public CreatureScript void MoveInLineOfSight(Unit* who) { // Birth animation - if (!emerged && me->IsWithinDistInMap(who, 40.0f) && who->GetTypeId() == TYPEID_PLAYER && !who->ToPlayer()->isGameMaster()) + if (!emerged && me->IsWithinDistInMap(who, 40.0f) && who->ToPlayer() && !who->ToPlayer()->isGameMaster()) { me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetStandState(UNIT_STAND_STATE_STAND); @@ -243,11 +242,8 @@ class boss_kologarn : public CreatureScript if (instance) instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_DISARMED_START_EVENT); - - if (Unit* LeftArm = me->SummonCreature(NPC_LEFT_ARM, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation())) - LeftArm->EnterVehicle(vehicle, 0); - if (Unit* RightArm = me->SummonCreature(NPC_RIGHT_ARM, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation())) - RightArm->EnterVehicle(vehicle, 1); + + vehicle->Reset(); } void UpdateAI(const uint32 diff) @@ -320,11 +316,13 @@ class boss_kologarn : public CreatureScript if (Creature* EyeBeam = me->SummonCreature(NPC_EYEBEAM_1,pTarget->GetPositionX(),pTarget->GetPositionY()+3,pTarget->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,10000)) { EyeBeam->CastSpell(me, SPELL_EYEBEAM_VISUAL_1, true); + EyeBeam->ClearUnitState(UNIT_STAT_CASTING); EyeBeam->AI()->AttackStart(pTarget); } if (Creature* EyeBeam = me->SummonCreature(NPC_EYEBEAM_2,pTarget->GetPositionX(),pTarget->GetPositionY()-3,pTarget->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,10000)) { EyeBeam->CastSpell(me, SPELL_EYEBEAM_VISUAL_2, true); + EyeBeam->ClearUnitState(UNIT_STAT_CASTING); EyeBeam->AI()->AttackStart(pTarget); } } @@ -333,7 +331,7 @@ class boss_kologarn : public CreatureScript case EVENT_LEFT: if (Unit* LeftArm = me->SummonCreature(NPC_LEFT_ARM, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation())) { - LeftArm->EnterVehicle(vehicle, 0); + LeftArm->_EnterVehicle(vehicle, 0); DoCast(me, SPELL_ARM_RESPAWN, true); me->MonsterTextEmote(EMOTE_LEFT, 0, true); if (instance) @@ -344,7 +342,7 @@ class boss_kologarn : public CreatureScript case EVENT_RIGHT: if (Unit* RightArm = me->SummonCreature(NPC_RIGHT_ARM, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation())) { - RightArm->EnterVehicle(vehicle, 1); + RightArm->_EnterVehicle(vehicle, 1); DoCast(me, SPELL_ARM_RESPAWN, true); me->MonsterTextEmote(EMOTE_RIGHT, 0, true); if (instance) @@ -403,21 +401,6 @@ class npc_focused_eyebeam : public CreatureScript DoCast(me, SPELL_EYEBEAM_IMMUNITY); DoCast(me, SPELL_FOCUSED_EYEBEAM); me->SetDisplayId(11686); - checkTimer = 1500; - } - - uint32 checkTimer; - - void UpdateAI(const uint32 diff) - { - if (checkTimer <= diff) - { - if (me->getVictim() && me->getVictim()->isAlive()) - me->GetMotionMaster()->MovePoint(0,me->getVictim()->GetPositionX(),me->getVictim()->GetPositionY(),me->getVictim()->GetPositionZ()); - - checkTimer = 500; - } - else checkTimer -= diff; } }; @@ -561,7 +544,7 @@ class npc_right_arm : public CreatureScript { if (GripTarget && GripTarget->isAlive()) { - GripTarget->EnterVehicle(me, n); + GripTarget->_EnterVehicle(me->GetVehicleKit(), n); me->AddAura(SPELL_STONE_GRIP, GripTarget); me->AddAura(SPELL_STONE_GRIP_STUN, GripTarget); GripTargetGUID[n] = NULL; diff --git a/src/server/scripts/Northrend/Ulduar/ulduar/boss_mimiron.cpp b/src/server/scripts/Northrend/Ulduar/ulduar/boss_mimiron.cpp index 4f59479a46b98..2d4aaef1160ca 100644 --- a/src/server/scripts/Northrend/Ulduar/ulduar/boss_mimiron.cpp +++ b/src/server/scripts/Northrend/Ulduar/ulduar/boss_mimiron.cpp @@ -219,7 +219,7 @@ class boss_mimiron : public CreatureScript uint32 EnrageTimer; uint32 FlameTimer; uint32 uiBotTimer; - bool checkBotAlive; + bool CheckBotAlive; bool Enraged; Phases phase; @@ -237,7 +237,7 @@ class boss_mimiron : public CreatureScript instance->SetData(DATA_MIMIRON_ELEVATOR, GO_STATE_ACTIVE); instance->SetBossState(BOSS_MIMIRON, FAIL); - for (uint8 data = DATA_LEVIATHAN_MK_II; data <= DATA_AERIAL_UNIT; ++data) + for (uint8 data = DATA_VX_001; data <= DATA_AERIAL_UNIT; ++data) { if (Creature *pCreature = me->GetCreature(*me, instance->GetData64(data))) { @@ -254,7 +254,7 @@ class boss_mimiron : public CreatureScript uiPhase_timer = -1; uiBotTimer = 0; MimironHardMode = false; - checkBotAlive = true; + CheckBotAlive = true; Enraged = false; DespawnCreatures(34362, 100); } @@ -330,7 +330,7 @@ class boss_mimiron : public CreatureScript } // All sections need to die within 10 seconds, else they respawn - if (checkBotAlive) + if (CheckBotAlive) uiBotTimer = 0; else { @@ -344,7 +344,7 @@ class boss_mimiron : public CreatureScript if (Creature *pAerialUnit = me->GetCreature(*me, instance->GetData64(DATA_AERIAL_UNIT))) pAerialUnit->AI()->DoAction(DO_AERIAL_ASSEMBLED); - checkBotAlive = true; + CheckBotAlive = true; } else { @@ -359,7 +359,7 @@ class boss_mimiron : public CreatureScript pVX_001->DisappearAndDie(); pAerialUnit->DisappearAndDie(); me->Kill(me, false); - checkBotAlive = true; + CheckBotAlive = true; } } } @@ -381,7 +381,7 @@ class boss_mimiron : public CreatureScript if (instance) { if (Creature *pLeviathan = me->GetCreature(*me, instance->GetData64(DATA_LEVIATHAN_MK_II))) - me->EnterVehicle(pLeviathan->GetVehicleKit(), 4); + me->_EnterVehicle(pLeviathan->GetVehicleKit(), 4); } JumpToNextStep(2000); break; @@ -455,7 +455,7 @@ class boss_mimiron : public CreatureScript if (instance) { if (Creature *pVX_001 = me->GetCreature(*me, instance->GetData64(DATA_VX_001))) - me->EnterVehicle(pVX_001->GetVehicleKit(), 0); + me->_EnterVehicle(pVX_001->GetVehicleKit(), 0); } JumpToNextStep(3500); break; @@ -561,8 +561,8 @@ class boss_mimiron : public CreatureScript { pLeviathan->GetMotionMaster()->MoveTargetedHome(); pVX_001->SetStandState(UNIT_STAND_STATE_STAND); - pVX_001->EnterVehicle(pLeviathan->GetVehicleKit(), 7); - me->EnterVehicle(pVX_001->GetVehicleKit(), 1); + pVX_001->_EnterVehicle(pLeviathan->GetVehicleKit(), 7); + me->_EnterVehicle(pVX_001->GetVehicleKit(), 1); } } JumpToNextStep(8000); @@ -574,7 +574,7 @@ class boss_mimiron : public CreatureScript { DoScriptText(SAY_V07TRON_ACTIVATE, me); pAerialUnit->SetFlying(false); - pAerialUnit->EnterVehicle(pVX_001->GetVehicleKit(), 3); + pAerialUnit->_EnterVehicle(pVX_001->GetVehicleKit(), 3); } JumpToNextStep(10000); break; @@ -623,7 +623,7 @@ class boss_mimiron : public CreatureScript JumpToNextStep(1000); break; case DO_ACTIVATE_DEATH_TIMER: - checkBotAlive = false; + CheckBotAlive = false; break; case DO_ACTIVATE_HARD_MODE: MimironHardMode = true; @@ -632,7 +632,7 @@ class boss_mimiron : public CreatureScript } } - void DespawnCreatures(uint32 entry, float distance, bool discs = false) + void DespawnCreatures(uint32 entry, float distance) { std::list m_pCreatures; GetCreatureListWithEntryInGrid(m_pCreatures, me, entry, distance); @@ -643,7 +643,6 @@ class boss_mimiron : public CreatureScript for(std::list::iterator iter = m_pCreatures.begin(); iter != m_pCreatures.end(); ++iter) (*iter)->DespawnOrUnsummon(); } - }; }; @@ -685,16 +684,8 @@ class boss_leviathan_mk : public CreatureScript me->RemoveAllAuras(); phase = PHASE_NULL; events.SetPhase(PHASE_NULL); - } - - void JustReachedHome() - { - if (Creature *turret = CAST_CRE(me->GetVehicleKit()->GetPassenger(3))) - { - turret->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); - turret->SetReactState(REACT_PASSIVE); - turret->AI()->EnterEvadeMode(); - } + if (vehicle->HasEmptySeat(3)) + vehicle->Reset(); } void KilledUnit(Unit *who) @@ -725,7 +716,7 @@ class boss_leviathan_mk : public CreatureScript phase = PHASE_NULL; if (Creature *pMimiron = me->GetCreature(*me, instance->GetData64(DATA_MIMIRON))) pMimiron->AI()->DoAction(DO_ACTIVATE_VX001); - if (Creature *turret = CAST_CRE(me->GetVehicleKit()->GetPassenger(3))) + if (Creature *turret = CAST_CRE(vehicle->GetPassenger(3))) turret->Kill(turret, false); me->SetSpeed(MOVE_RUN, 1.5f, true); me->GetMotionMaster()->MovePoint(0, 2790.11f, 2595.83f, 364.32f); @@ -756,7 +747,7 @@ class boss_leviathan_mk : public CreatureScript events.ScheduleEvent(EVENT_FLAME_SUPPRESSANT, 60000, 0, PHASE_LEVIATHAN_SOLO); } - if (Creature *turret = CAST_CRE(me->GetVehicleKit()->GetPassenger(3))) + if (Creature *turret = CAST_CRE(vehicle->GetPassenger(3))) { turret->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); turret->SetReactState(REACT_AGGRESSIVE); @@ -871,6 +862,8 @@ class boss_leviathan_mk_turret : public CreatureScript { me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true); me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_GRIP, true); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); + me->SetReactState(REACT_PASSIVE); uiNapalmShell = urand(4000, 8000); } @@ -1111,11 +1104,11 @@ class boss_vx_001 : public CreatureScript break; case EVENT_ROCKET_STRIKE: if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) - if (Creature *missile = CAST_CRE(me->GetVehicleKit()->GetPassenger(5))) + if (Creature *missile = CAST_CRE(vehicle->GetPassenger(5))) missile->CastSpell(pTarget, SPELL_ROCKET_STRIKE, true); if (phase == PHASE_VX001_ASSEMBLED) if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) - if (Creature *missile = CAST_CRE(me->GetVehicleKit()->GetPassenger(6))) + if (Creature *missile = CAST_CRE(vehicle->GetPassenger(6))) missile->CastSpell(pTarget, SPELL_ROCKET_STRIKE, true); events.RescheduleEvent(EVENT_ROCKET_STRIKE, urand(20000, 25000)); break; @@ -1299,7 +1292,7 @@ class boss_aerial_unit : public CreatureScript { if (me->getVictim()->IsWithinDist3d(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 35)) DoCastVictim(SPELL_PLASMA_BALL); - else if (Unit *pTarget = SelectUnit(SELECT_TARGET_NEAREST, 0)) + else if (Unit *pTarget = SelectTarget(SELECT_TARGET_NEAREST, 0)) DoCast(pTarget, SPELL_PLASMA_BALL); } events.RescheduleEvent(EVENT_PLASMA_BALL, 2000); diff --git a/src/server/scripts/Northrend/Ulduar/ulduar/boss_razorscale.cpp b/src/server/scripts/Northrend/Ulduar/ulduar/boss_razorscale.cpp index 19b67be02294c..bd9e7615bada8 100644 --- a/src/server/scripts/Northrend/Ulduar/ulduar/boss_razorscale.cpp +++ b/src/server/scripts/Northrend/Ulduar/ulduar/boss_razorscale.cpp @@ -562,7 +562,6 @@ class npc_expedition_commander : public CreatureScript }; - class npc_mole_machine_trigger : public CreatureScript { public: @@ -627,7 +626,6 @@ class npc_mole_machine_trigger : public CreatureScript }; - class npc_devouring_flame : public CreatureScript { public: @@ -654,7 +652,6 @@ class npc_devouring_flame : public CreatureScript }; - class npc_darkrune_watcher : public CreatureScript { public: @@ -703,7 +700,6 @@ class npc_darkrune_watcher : public CreatureScript }; - class npc_darkrune_guardian : public CreatureScript { public: @@ -743,7 +739,6 @@ class npc_darkrune_guardian : public CreatureScript }; - class npc_darkrune_sentinel : public CreatureScript { public: @@ -801,7 +796,6 @@ class npc_darkrune_sentinel : public CreatureScript }; - void AddSC_boss_razorscale() { new boss_razorscale(); @@ -811,4 +805,4 @@ void AddSC_boss_razorscale() new npc_darkrune_watcher(); new npc_darkrune_guardian(); new npc_darkrune_sentinel(); -} \ No newline at end of file +} diff --git a/src/server/scripts/Northrend/Ulduar/ulduar/boss_thorim.cpp b/src/server/scripts/Northrend/Ulduar/ulduar/boss_thorim.cpp index ceab2b287b37a..bcb4c21ff77d2 100644 --- a/src/server/scripts/Northrend/Ulduar/ulduar/boss_thorim.cpp +++ b/src/server/scripts/Northrend/Ulduar/ulduar/boss_thorim.cpp @@ -38,7 +38,7 @@ enum Spells SPELL_LIGHTNING_CHARGE = 62279, SPELL_LIGHTNING_DESTRUCTION = 62393, SPELL_LIGHTNING_RELEASE = 62466, - SPELL_UNBALANCING_STRIKE = 62130, + SPELL_UNBALANCING_STRIKE = 62130, SPELL_BERSERK = 62560 }; @@ -172,73 +172,73 @@ enum ThorimChests CACHE_OF_STORMS_HARDMODE_25 = 194315 }; -const Position Pos[7] = -{ -{2095.53f, -279.48f, 419.84f, 0.504f}, -{2092.93f, -252.96f, 419.84f, 6.024f}, -{2097.86f, -240.97f, 419.84f, 5.643f}, -{2113.14f, -225.94f, 419.84f, 5.259f}, -{2156.87f, -226.12f, 419.84f, 4.202f}, -{2172.42f, -242.70f, 419.84f, 3.583f}, -{2171.92f, -284.59f, 419.84f, 2.691f} +const Position Pos[7] = +{ +{2095.53f, -279.48f, 419.84f, 0.504f}, +{2092.93f, -252.96f, 419.84f, 6.024f}, +{2097.86f, -240.97f, 419.84f, 5.643f}, +{2113.14f, -225.94f, 419.84f, 5.259f}, +{2156.87f, -226.12f, 419.84f, 4.202f}, +{2172.42f, -242.70f, 419.84f, 3.583f}, +{2171.92f, -284.59f, 419.84f, 2.691f} +}; + +const Position PosOrbs[7] = +{ +{2104.99f, -233.484f, 433.576f, 5.49779f}, +{2092.64f, -262.594f, 433.576f, 6.26573f}, +{2104.76f, -292.719f, 433.576f, 0.78539f}, +{2164.97f, -293.375f, 433.576f, 2.35619f}, +{2164.58f, -233.333f, 433.576f, 3.90954f}, +{2145.81f, -222.196f, 433.576f, 4.45059f}, +{2123.91f, -222.443f, 433.576f, 4.97419f} }; -const Position PosOrbs[7] = -{ -{2104.99f, -233.484f, 433.576f, 5.49779f}, -{2092.64f, -262.594f, 433.576f, 6.26573f}, -{2104.76f, -292.719f, 433.576f, 0.78539f}, -{2164.97f, -293.375f, 433.576f, 2.35619f}, -{2164.58f, -233.333f, 433.576f, 3.90954f}, -{2145.81f, -222.196f, 433.576f, 4.45059f}, -{2123.91f, -222.443f, 433.576f, 4.97419f} +const Position PosCharge[7] = +{ +{2104.99f, -233.484f, 419.573f, 5.49779f}, +{2092.64f, -262.594f, 419.573f, 6.26573f}, +{2104.76f, -292.719f, 419.573f, 0.78539f}, +{2164.97f, -293.375f, 419.573f, 2.35619f}, +{2164.58f, -233.333f, 419.573f, 3.90954f}, +{2145.81f, -222.196f, 419.573f, 4.45059f}, +{2123.91f, -222.443f, 419.573f, 4.97419f} }; -const Position PosCharge[7] = -{ -{2104.99f, -233.484f, 419.573f, 5.49779f}, -{2092.64f, -262.594f, 419.573f, 6.26573f}, -{2104.76f, -292.719f, 419.573f, 0.78539f}, -{2164.97f, -293.375f, 419.573f, 2.35619f}, -{2164.58f, -233.333f, 419.573f, 3.90954f}, -{2145.81f, -222.196f, 419.573f, 4.45059f}, -{2123.91f, -222.443f, 419.573f, 4.97419f} +struct SummonLocation +{ + float x,y,z,o; + uint32 entry; }; -struct SummonLocation -{ - float x,y,z,o; - uint32 entry; -}; - -SummonLocation preAddLocations[]= -{ - {2149.68f, -263.477f, 419.679f, 3.120f, 32882}, - {2131.31f, -271.640f, 419.840f, 2.188f, 32908}, - {2127.24f, -259.182f, 419.974f, 5.917f, 32885}, - {2123.32f, -254.770f, 419.840f, 6.170f, 32885}, - {2120.10f, -258.990f, 419.840f, 6.250f, 32885}, - {2129.09f, -277.142f, 419.756f, 1.222f, 32886} -}; - -SummonLocation colossusAddLocations[]= -{ - {2218.38f, -297.50f, 412.18f, 1.030f, 32874}, - {2235.07f, -297.98f, 412.18f, 1.613f, 32874}, - {2235.26f, -338.34f, 412.18f, 1.589f, 32874}, - {2217.69f, -337.39f, 412.18f, 1.241f, 32874}, - {2227.58f, -308.30f, 412.18f, 1.591f, 33110}, - {2227.47f, -345.37f, 412.18f, 1.566f, 33110} -}; - -SummonLocation giantAddLocations[]= -{ - {2198.05f, -428.77f, 419.95f, 6.056f, 32875}, - {2220.31f, -436.22f, 412.26f, 1.064f, 32875}, - {2158.88f, -441.73f, 438.25f, 0.127f, 32875}, - {2198.29f, -436.92f, 419.95f, 0.261f, 33110}, - {2230.93f, -434.27f, 412.26f, 1.931f, 33110} -}; +SummonLocation preAddLocations[]= +{ + {2149.68f, -263.477f, 419.679f, 3.120f, 32882}, + {2131.31f, -271.640f, 419.840f, 2.188f, 32907}, + {2127.24f, -259.182f, 419.974f, 5.917f, 32885}, + {2123.32f, -254.770f, 419.840f, 6.170f, 32885}, + {2120.10f, -258.990f, 419.840f, 6.250f, 32885}, + {2129.09f, -277.142f, 419.756f, 1.222f, 32886} +}; + +SummonLocation colossusAddLocations[]= +{ + {2218.38f, -297.50f, 412.18f, 1.030f, 32874}, + {2235.07f, -297.98f, 412.18f, 1.613f, 32874}, + {2235.26f, -338.34f, 412.18f, 1.589f, 32874}, + {2217.69f, -337.39f, 412.18f, 1.241f, 32874}, + {2227.58f, -308.30f, 412.18f, 1.591f, 33110}, + {2227.47f, -345.37f, 412.18f, 1.566f, 33110} +}; + +SummonLocation giantAddLocations[]= +{ + {2198.05f, -428.77f, 419.95f, 6.056f, 32875}, + {2220.31f, -436.22f, 412.26f, 1.064f, 32875}, + {2158.88f, -441.73f, 438.25f, 0.127f, 32875}, + {2198.29f, -436.92f, 419.95f, 0.261f, 33110}, + {2230.93f, -434.27f, 412.26f, 1.931f, 33110} +}; #define POS_X_ARENA 2181.19f #define POS_Y_ARENA -299.12f @@ -288,12 +288,12 @@ class boss_thorim : public CreatureScript // Respawn Mini Bosses for (uint8 i = DATA_RUNIC_COLOSSUS; i <= DATA_RUNE_GIANT; i++) - if (Creature* pMiniBoss = me->GetCreature(*me, instance->GetData64(i))) + if (Creature* pMiniBoss = me->GetCreature(*me, instance->GetData64(i))) pMiniBoss->Respawn(true); // Spawn Pre-Phase Adds - for (uint8 i = 0; i < 6; i++) - me->SummonCreature(preAddLocations[i].entry,preAddLocations[i].x,preAddLocations[i].y,preAddLocations[i].z,preAddLocations[i].o,TEMPSUMMON_CORPSE_TIMED_DESPAWN,3000); + for (uint8 i = 0; i < 6; i++) + me->SummonCreature(preAddLocations[i].entry,preAddLocations[i].x,preAddLocations[i].y,preAddLocations[i].z,preAddLocations[i].o,TEMPSUMMON_CORPSE_TIMED_DESPAWN,3000); } void KilledUnit(Unit * /*victim*/) @@ -332,8 +332,8 @@ class boss_thorim : public CreatureScript _EnterCombat(); // Spawn Thunder Orbs - for(uint8 n = 0; n < 7; n++) - me->SummonCreature(33378, PosOrbs[n], TEMPSUMMON_CORPSE_DESPAWN); + for(uint8 n = 0; n < 7; n++) + me->SummonCreature(33378, PosOrbs[n], TEMPSUMMON_CORPSE_DESPAWN); bWipe = true; EncounterTime = 0; @@ -368,20 +368,20 @@ class boss_thorim : public CreatureScript if (pTarget->isAlive() && IN_ARENA(pTarget)) DoCast(pTarget, SPELL_STORMHAMMER); events.ScheduleEvent(EVENT_STORMHAMMER, urand(15000, 20000), 0, PHASE_1); - break; + break; case EVENT_CHARGE_ORB: DoCastAOE(SPELL_CHARGE_ORB); events.ScheduleEvent(EVENT_CHARGE_ORB, urand(15000, 20000), 0, PHASE_1); - break; + break; case EVENT_SUMMON_ADDS: spawnAdd(); events.ScheduleEvent(EVENT_SUMMON_ADDS, 10000, 0, PHASE_1); - break; + break; case EVENT_BERSERK: DoCast(me, SPELL_BERSERK); DoScriptText(SAY_BERSERK, me); events.CancelEvent(EVENT_BERSERK); - break; + break; } } } @@ -394,26 +394,26 @@ class boss_thorim : public CreatureScript case EVENT_UNBALANCING_STRIKE: DoCastVictim(SPELL_UNBALANCING_STRIKE); events.ScheduleEvent(EVENT_UNBALANCING_STRIKE, 25000, 0, PHASE_2); - break; + break; case EVENT_CHAIN_LIGHTNING: if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) if (pTarget->isAlive()) DoCast(pTarget, SPELL_CHAIN_LIGHTNING); events.ScheduleEvent(EVENT_CHAIN_LIGHTNING, urand(15000, 20000), 0, PHASE_2); - break; + break; /*case EVENT_TRANSFER_ENERGY: events.ScheduleEvent(EVENT_TRANSFER_ENERGY, 20000, 0, PHASE_2); - break;*/ + break;*/ case EVENT_RELEASE_ENERGY: DoCast(me, SPELL_LIGHTNING_CHARGE); - //DoCast(EnergySource, SPELL_LIGHTNING_RELEASE); + //DoCast(EnergySource, SPELL_LIGHTNING_RELEASE); events.ScheduleEvent(EVENT_RELEASE_ENERGY, 20000, 0, PHASE_2); - break; + break; case EVENT_BERSERK: DoCast(me, SPELL_BERSERK); DoScriptText(SAY_BERSERK, me); events.CancelEvent(EVENT_BERSERK); - break; + break; } } } @@ -438,34 +438,34 @@ class boss_thorim : public CreatureScript } } - void spawnAdd() - { - switch(spawnedAdds) - { - case 0: - for (uint8 n = 0; n < 3; n++) - me->SummonCreature(ARENA_PHASE_ADD[n], Pos[rand()%7], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000); - break; - case 1: - for (uint8 n = 0; n < 7; n++) - me->SummonCreature(ARENA_PHASE_ADD[3], Pos[n], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000); - break; - } - - spawnedAdds++; - if(spawnedAdds > 1) - { - spawnedAdds = 0; - } + void spawnAdd() + { + switch(spawnedAdds) + { + case 0: + for (uint8 n = 0; n < 3; n++) + me->SummonCreature(ARENA_PHASE_ADD[n], Pos[rand()%7], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000); + break; + case 1: + for (uint8 n = 0; n < 7; n++) + me->SummonCreature(ARENA_PHASE_ADD[3], Pos[n], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000); + break; + } + + spawnedAdds++; + if(spawnedAdds > 1) + { + spawnedAdds = 0; + } } - void DamageTaken(Unit* pKiller, uint32 &damage) - { - if (phase == PHASE_1 && pKiller && instance) - { - if (Creature* pRunicColossus = me->GetCreature(*me, instance->GetData64(DATA_RUNIC_COLOSSUS))) + void DamageTaken(Unit* pKiller, uint32 &damage) + { + if (phase == PHASE_1 && pKiller && instance) + { + if (Creature* pRunicColossus = me->GetCreature(*me, instance->GetData64(DATA_RUNIC_COLOSSUS))) if (pRunicColossus->isDead()) - if (Creature* pRuneGiant = me->GetCreature(*me, instance->GetData64(DATA_RUNE_GIANT))) + if (Creature* pRuneGiant = me->GetCreature(*me, instance->GetData64(DATA_RUNE_GIANT))) if (pRuneGiant->isDead()) if (me->IsWithinDistInMap(pKiller, 10.0f) && pKiller->ToPlayer()) { @@ -499,7 +499,6 @@ class boss_thorim : public CreatureScript }; - class npc_thorim_pre_phase : public CreatureScript { public: @@ -534,7 +533,7 @@ class npc_thorim_pre_phase : public CreatureScript void JustDied(Unit* /*victim*/) { - if (Creature* pThorim = me->GetCreature(*me, pInstance->GetData64(DATA_THORIM))) + if (Creature* pThorim = me->GetCreature(*me, pInstance->GetData64(DATA_THORIM))) pThorim->AI()->DoAction(INCREASE_PREADDS_COUNT); } @@ -621,6 +620,7 @@ class npc_thorim_arena_phase : public CreatureScript DoCast(me, SPELL_AURA_OF_CELERITY); me->getThreatManager().clearReferences(); + me->AttackStop(); if (me->getThreatManager().isThreatListEmpty()) { Map* pMap = me->GetMap(); @@ -632,10 +632,10 @@ class npc_thorim_arena_phase : public CreatureScript for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) { if (i->getSource() && i->getSource()->isAlive() && isOnSameSide(i->getSource())) - me->getThreatManager().addThreat(i->getSource(), 10.0f); + me->getThreatManager().addThreat(i->getSource(), 150.0f); } } - } + } } } @@ -662,12 +662,13 @@ class npc_thorim_arena_phase : public CreatureScript { if (id == DARK_RUNE_CHAMPION) if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 40, true)) - DoCast(pTarget, SPELL_CHARGE); + if (isOnSameSide(pTarget)) + DoCast(pTarget, SPELL_CHARGE); ChargeTimer = 12000; } else ChargeTimer -= diff; - if (id == DARK_RUNE_ACOLYTE) + if (id == DARK_RUNE_ACOLYTE_2) DoSpellAttackIfReady(SPELL_HOLY_SMITE); else DoMeleeAttackIfReady(); @@ -717,18 +718,18 @@ class npc_runic_colossus : public CreatureScript // Spawn trashes summons.DespawnAll(); - for (uint8 i = 0; i < 6; i++) - me->SummonCreature(colossusAddLocations[i].entry,colossusAddLocations[i].x,colossusAddLocations[i].y,colossusAddLocations[i].z,colossusAddLocations[i].o,TEMPSUMMON_CORPSE_TIMED_DESPAWN,3000); + for (uint8 i = 0; i < 6; i++) + me->SummonCreature(colossusAddLocations[i].entry,colossusAddLocations[i].x,colossusAddLocations[i].y,colossusAddLocations[i].z,colossusAddLocations[i].o,TEMPSUMMON_CORPSE_TIMED_DESPAWN,3000); } - void JustSummoned(Creature *summon) - { + void JustSummoned(Creature *summon) + { summons.Summon(summon); } void JustDied(Unit* /*victim*/) { - // Runed Door opened + // Runed Door opened if (pInstance) pInstance->SetData(DATA_RUNIC_DOOR, GO_STATE_ACTIVE); } @@ -736,7 +737,7 @@ class npc_runic_colossus : public CreatureScript void UpdateAI(const uint32 diff) { // I cannot find the real spell - if (!me->IsWithinMeleeRange(me->getVictim())) + if (!me->IsWithinMeleeRange(me->getVictim())) DoCast(me, SPELL_SMASH); if (!UpdateVictim() || me->HasUnitState(UNIT_STAT_CASTING)) @@ -810,12 +811,12 @@ class npc_ancient_rune_giant : public CreatureScript // Spawn trashes summons.DespawnAll(); - for (uint8 i = 0; i < 5; i++) - me->SummonCreature(giantAddLocations[i].entry,giantAddLocations[i].x,giantAddLocations[i].y,giantAddLocations[i].z,giantAddLocations[i].o,TEMPSUMMON_CORPSE_TIMED_DESPAWN,3000); + for (uint8 i = 0; i < 5; i++) + me->SummonCreature(giantAddLocations[i].entry,giantAddLocations[i].x,giantAddLocations[i].y,giantAddLocations[i].z,giantAddLocations[i].o,TEMPSUMMON_CORPSE_TIMED_DESPAWN,3000); } - void JustSummoned(Creature *summon) - { + void JustSummoned(Creature *summon) + { summons.Summon(summon); } @@ -827,7 +828,7 @@ class npc_ancient_rune_giant : public CreatureScript void JustDied(Unit* /*victim*/) { - // Stone Door opened + // Stone Door opened if (pInstance) pInstance->SetData(DATA_STONE_DOOR, GO_STATE_ACTIVE); } @@ -899,7 +900,7 @@ class npc_sif : public CreatureScript if (FrostTimer <= diff) { if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 60, true)) - DoCast(pTarget, SPELL_FROSTBOLT); + DoCast(pTarget, SPELL_FROSTBOLT); FrostTimer = 4000; } else FrostTimer -= diff; @@ -907,10 +908,10 @@ class npc_sif : public CreatureScript if (VolleyTimer <= diff) { if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 40, true)) - { - DoResetThreat(); - me->AddThreat(pTarget, 5000000.0f); - DoCast(pTarget, SPELL_FROSTBOLT_VOLLEY, true); + { + DoResetThreat(); + me->AddThreat(pTarget, 5000000.0f); + DoCast(pTarget, SPELL_FROSTBOLT_VOLLEY, true); } VolleyTimer = urand(15000, 20000); } @@ -918,14 +919,14 @@ class npc_sif : public CreatureScript if (BlizzardTimer <= diff) { - DoCast(me, SPELL_BLIZZARD, true); + DoCast(me, SPELL_BLIZZARD, true); BlizzardTimer = 45000; } else BlizzardTimer -= diff; if (NovaTimer <= diff) { - DoCastAOE(SPELL_FROSTNOVA, true); + DoCastAOE(SPELL_FROSTNOVA, true); NovaTimer = urand(20000, 25000); } else NovaTimer -= diff; diff --git a/src/server/scripts/Northrend/Ulduar/ulduar/boss_xt002.cpp b/src/server/scripts/Northrend/Ulduar/ulduar/boss_xt002.cpp index 7a4b0db0bc9c4..6574e947a50c8 100644 --- a/src/server/scripts/Northrend/Ulduar/ulduar/boss_xt002.cpp +++ b/src/server/scripts/Northrend/Ulduar/ulduar/boss_xt002.cpp @@ -21,12 +21,11 @@ enum Spells { SPELL_TYMPANIC_TANTRUM = 62776, - SPELL_SEARING_LIGHT = 63018, - - SPELL_GRAVITY_BOMB = 63024, - + SPELL_SEARING_LIGHT_10 = 63018, + SPELL_SEARING_LIGHT_25 = 65121, + SPELL_GRAVITY_BOMB_10 = 63024, + SPELL_GRAVITY_BOMB_25 = 64234, SPELL_HEARTBREAK = 65737, - SPELL_ENRAGE = 26662, //------------------VOID ZONE-------------------- @@ -112,7 +111,6 @@ enum Yells #define ACHIEV_TIMED_START_EVENT 21027 #define ACHIEVEMENT_HEARTBREAKER RAID_MODE(3058, 3059) #define ACHIEVEMENT_NERF_ENG RAID_MODE(2931, 2932) - /************************************************ -----------------SPAWN LOCATIONS----------------- ************************************************/ @@ -206,6 +204,8 @@ class boss_xt002 : public CreatureScript phase = 1; heart_exposed = 0; + vehicle->Reset(); + if (instance) instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT); } @@ -292,9 +292,9 @@ class boss_xt002 : public CreatureScript { if (uiSearingLightTimer <= diff) { - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) { - me->AddAura(SPELL_SEARING_LIGHT, pTarget); + me->AddAura(RAID_MODE(SPELL_SEARING_LIGHT_10, SPELL_SEARING_LIGHT_25), pTarget); uiSearingLightTarget = pTarget->GetGUID(); } uiSpawnLifeSparkTimer = TIMER_SPAWN_LIFE_SPARK; @@ -305,9 +305,9 @@ class boss_xt002 : public CreatureScript if (uiGravityBombTimer <= diff) { - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) { - me->AddAura(SPELL_GRAVITY_BOMB, pTarget); + me->AddAura(RAID_MODE(SPELL_GRAVITY_BOMB_10, SPELL_GRAVITY_BOMB_25), pTarget); uiGravityBombTarget = pTarget->GetGUID(); } uiGravityBombTimer = TIMER_GRAVITY_BOMB; @@ -427,7 +427,7 @@ class boss_xt002 : public CreatureScript DoMeleeAttackIfReady(); } - //Enrage stuff + // Enrage stuff if (!enraged) if (uiEnrageTimer <= diff) { @@ -439,25 +439,24 @@ class boss_xt002 : public CreatureScript void exposeHeart() { - //Make untargetable + // Make untargetable me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_DISABLE_MOVE); me->SetReactState(REACT_PASSIVE); me->SetStandState(UNIT_STAND_STATE_SUBMERGED); me->AttackStop(); - //Summon the heart npc - if (Creature* Heart = me->SummonCreature(NPC_XT002_HEART, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, - TEMPSUMMON_TIMED_DESPAWN, TIMER_HEART_PHASE)) - Heart->EnterVehicle(me, 0); + // Expose the heart npc + if (Unit *Heart = vehicle->GetPassenger(0)) + Heart->ToCreature()->AI()->DoAction(0); // Start "end of phase 2 timer" uiHeartPhaseTimer = TIMER_HEART_PHASE; - //Phase 2 has offically started + // Phase 2 has offically started phase = 2; heart_exposed++; - //Reset the add spawning timer + // Reset the add spawning timer uiSpawnAddTimer = TIMER_SPAWN_ADD; DoScriptText(SAY_HEART_OPENED, me); @@ -500,66 +499,58 @@ class mob_xt002_heart : public CreatureScript { mob_xt002_heartAI(Creature* pCreature) : ScriptedAI(pCreature) { - m_pInstance = pCreature->GetInstanceScript(); me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true); me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_GRIP, true); - me->SetReactState(REACT_PASSIVE); } - InstanceScript* m_pInstance; - uint32 uiExposeTimer; - uint32 uiEndExposedTimer; bool Exposed; - bool EndExposed; void JustDied(Unit* /*victim*/) { - if (m_pInstance) - if (Creature* pXT002 = me->GetCreature(*me, m_pInstance->GetData64(DATA_XT002))) - pXT002->AI()->DoAction(ACTION_ENTER_HARD_MODE); + if (Unit* pXT002 = me->ToTempSummon()->GetSummoner()) + pXT002->ToCreature()->AI()->DoAction(ACTION_ENTER_HARD_MODE); me->DespawnOrUnsummon(); } void UpdateAI(const uint32 diff) { - if (!Exposed) + if (Exposed) { - if (uiExposeTimer <= diff) + if (!me->HasAura(SPELL_EXPOSED_HEART)) { - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); - me->ChangeSeat(1); - DoCast(me, SPELL_EXPOSED_HEART, true); - Exposed = true; + Exposed = false; + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); + me->RemoveAllAuras(); + me->SetFullHealth(); + me->ChangeSeat(0); } - else uiExposeTimer -= diff; } - - if (!EndExposed) + else { - if (uiEndExposedTimer <= diff) + if (!me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) { - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); - me->RemoveAllAuras(); - me->ChangeSeat(0); - EndExposed = true; + if (uiExposeTimer <= diff) + { + Exposed = true; + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + DoCast(me, SPELL_EXPOSED_HEART, true); + } + else uiExposeTimer -= diff; } - else uiEndExposedTimer -= diff; } } - + void Reset() { - uiExposeTimer = 3000; - uiEndExposedTimer = 33000; Exposed = false; - EndExposed = false; + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); } void DamageTaken(Unit *pDone, uint32 &damage) { - if (Creature* pXT002 = me->GetCreature(*me, m_pInstance->GetData64(DATA_XT002))) + if (Unit *pXT002 = me->ToTempSummon()->GetSummoner()) { if (damage > me->GetHealth()) damage = me->GetHealth(); @@ -568,6 +559,16 @@ class mob_xt002_heart : public CreatureScript pDone->DealDamage(pXT002, damage); } } + + void DoAction(const int32 action) + { + if (action == 0) + { + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + me->ChangeSeat(1); + uiExposeTimer = 3500; + } + } }; }; @@ -631,7 +632,6 @@ class mob_scrapbot : public CreatureScript }; - /*------------------------------------------------------- * * XM-024 PUMMELLER @@ -698,7 +698,6 @@ class mob_pummeller : public CreatureScript }; - /*------------------------------------------------------- * * XE-321 BOOMBOT @@ -744,7 +743,6 @@ class mob_boombot : public CreatureScript }; - /*------------------------------------------------------- * * VOID ZONE @@ -788,7 +786,6 @@ class mob_void_zone : public CreatureScript }; - /*------------------------------------------------------- * * LIFE SPARK @@ -839,6 +836,33 @@ class mob_life_spark : public CreatureScript }; +class spell_xt002_gravity_bomb : public SpellScriptLoader +{ + public: + spell_xt002_gravity_bomb() : SpellScriptLoader("spell_xt002_gravity_bomb") { } + + class spell_xt002_gravity_bomb_SpellScript : public SpellScript + { + PrepareSpellScript(spell_xt002_gravity_bomb_SpellScript); + + void FilterTargets(std::list& unitList) + { + unitList.remove(GetTargetUnit()); + } + + void Register() + { + OnUnitTargetSelect += SpellUnitTargetFn(spell_xt002_gravity_bomb_SpellScript::FilterTargets, EFFECT_0, TARGET_DST_CASTER); + } + }; + + SpellScript *GetSpellScript() const + { + return new spell_xt002_gravity_bomb_SpellScript(); + } +}; + + void AddSC_boss_xt002() { new mob_xt002_heart(); @@ -848,7 +872,8 @@ void AddSC_boss_xt002() new mob_void_zone(); new mob_life_spark(); new boss_xt002(); - - if (VehicleSeatEntry* vehSeat = const_cast(sVehicleSeatStore.LookupEntry(3004))) + new spell_xt002_gravity_bomb(); + + if (VehicleSeatEntry* vehSeat = const_cast(sVehicleSeatStore.LookupEntry(3846))) vehSeat->m_flags |= 0x400; } diff --git a/src/server/scripts/Northrend/Ulduar/ulduar/boss_yoggsaron.cpp b/src/server/scripts/Northrend/Ulduar/ulduar/boss_yoggsaron.cpp index d44483a4f631f..27fac31b0def4 100644 --- a/src/server/scripts/Northrend/Ulduar/ulduar/boss_yoggsaron.cpp +++ b/src/server/scripts/Northrend/Ulduar/ulduar/boss_yoggsaron.cpp @@ -1,60 +1,2007 @@ -/* - * Copyright (C) 2008-2011 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 "ulduar.h" - -enum Sara_Yells +/* + * Copyright (C) 2008-2011 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: Yogg-Saron +SDAuthor: PrinceCreed +SD%Complete: 90 +SDComments: Hodir's Protective Gaze and Mimiron's Destabilization Matrix don't work. +EndScriptData */ + +#include "ScriptPCH.h" +#include "ulduar.h" + +enum Sara_Yells +{ + SAY_SARA_PREFIGHT_1 = -1603310, + SAY_SARA_PREFIGHT_2 = -1603311, + SAY_SARA_AGGRO_1 = -1603312, + SAY_SARA_AGGRO_2 = -1603313, + SAY_SARA_AGGRO_3 = -1603314, + SAY_SARA_SLAY_1 = -1603315, + SAY_SARA_SLAY_2 = -1603316, + WHISP_SARA_INSANITY = -1603317, + SAY_SARA_PHASE2_1 = -1603318, + SAY_SARA_PHASE2_2 = -1603319 +}; + +enum YoggSaron_Yells +{ + SAY_PHASE2_1 = -1603330, + SAY_PHASE2_2 = -1603331, + SAY_PHASE2_3 = -1603332, + SAY_PHASE2_4 = -1603333, + SAY_PHASE2_5 = -1603334, + SAY_PHASE3 = -1603335, + SAY_VISION = -1603336, + SAY_LUNATIC_GAZE = -1603337, + SAY_DEAFENING_ROAR = -1603338, + WHISP_INSANITY_1 = -1603339, + WHISP_INSANITY_2 = -1603340, + SAY_DEATH = -1603341, + EMOTE_PORTALS = -1603342, + EMOTE_OPEN_CHAMBER = -1603343, + EMOTE_EMPOWERING = -1603344 +}; + +enum Achievements +{ + ACHIEV_TIMED_START_EVENT = 21001, +}; + +#define GOSSIP_KEEPER_HELP "I need your help." + +enum Keepers_Yells +{ + SAY_MIMIRON_HELP = -1603259, + SAY_FREYA_HELP = -1603189, + SAY_THORIM_HELP = -1603287, + SAY_HODIR_HELP = -1603217, +}; + +enum Phases { - SAY_SARA_PREFIGHT_1 = -1603310, - SAY_SARA_PREFIGHT_2 = -1603311, - SAY_SARA_AGGRO_1 = -1603312, - SAY_SARA_AGGRO_2 = -1603313, - SAY_SARA_AGGRO_3 = -1603314, - SAY_SARA_SLAY_1 = -1603315, - SAY_SARA_SLAY_2 = -1603316, - WHISP_SARA_INSANITY = -1603317, - SAY_SARA_PHASE2_1 = -1603318, - SAY_SARA_PHASE2_2 = -1603319, -}; - -enum YoggSaron_Yells + PHASE_NULL = 0, + PHASE_1, + PHASE_2, + PHASE_3 +}; + +Phases phase; + +enum Npcs { - SAY_PHASE2_1 = -1603330, - SAY_PHASE2_2 = -1603331, - SAY_PHASE2_3 = -1603332, - SAY_PHASE2_4 = -1603333, - SAY_PHASE2_5 = -1603334, - SAY_PHASE3 = -1603335, - SAY_VISION = -1603336, - SAY_SLAY_1 = -1603337, - SAY_SLAY_2 = -1603338, - WHISP_INSANITY_1 = -1603339, - WHISP_INSANITY_2 = -1603340, - SAY_DEATH = -1603341, -}; - -enum + NPC_IMAGE_OF_FREYA = 33241, + NPC_IMAGE_OF_THORIM = 33242, + NPC_IMAGE_OF_MIMIRON = 33244, + NPC_IMAGE_OF_HODIR = 33213, + + NPC_SANITY_WELL = 33991, + NPC_SARA = 33134, + NPC_YOGG_SARON = 33288, + NPC_YOGG_SARON_VOICE = 33280, + + NPC_GUARDIAN_OF_YOGGSARON = 33136, + NPC_OMINOUS_CLOUD = 33292, + NPC_DEATH_ORB = 33882, + NPC_CRUSHER_TENTACLE = 33966, + NPC_CONSTRICTOR_TENTACLE = 33983, + NPC_CORRUPTOR_TENTACLE = 33985, + + NPC_PORTAL_STORMWIND = 34072, + NPC_PORTAL_CHAMBER = 34122, + NPC_PORTAL_ICECROWN = 34123, + + NPC_LAUGHING_SKULL = 33990, + NPC_INFLUENCE_TENTACLE = 33943, + NPC_IMMORTAL_GUARDIAN = 33988, + + NPC_YOGG_SARON_BRAIN = 33890, + NPC_SUIT_OF_ARMOR = 33433, + NPC_RUBY_CONSORT = 33716, + NPC_AZURE_CONSORT = 33717, + NPC_EMERALD_CONSORT = 33719, + NPC_OBSIDIAN_CONSORT = 33720, + NPC_DEATHSWORN_ZEALOT = 33567, + + GOB_CHAMBER_DOOR = 194635, + GOB_ICECROWN_DOOR = 194636, + GOB_STORMWIND_DOOR = 194637 +}; + +enum Spells +{ + // Sara + SPELL_SARA_ANGER = 63147, + SPELL_SARA_BLESSING = 63134, + SPELL_SARA_FERVOR = 63138, + SPELL_SHADOWY_BARRIED = 64775, + SPELL_BRAIN_LINK = 63802, + SPELL_DEATH_RAY_DAMAGE = 63883, + SPELL_DEATH_RAY_DAMAGE_VISUAL = 63886, + SPELL_DEATH_RAY_WARNING_VISUAL = 63882, + SPELL_PSYCHOSIS = 63795, + SPELL_MALADY_OF_THE_MIND = 63830, + + // Guardian of Yogg Saron + SPELL_SUMMON_GUARDIAN = 63031, + SPELL_INSTANT_SUMMON_GUARDIAN = 62979, + SPELL_OMINOUS_CLOUD = 60984, + SPELL_OMINOUS_CLOUD_VISUAL = 63084, + SPELL_DARK_VOLLEY = 63038, + SPELL_SHADOW_NOVA_10 = 62714, + SPELL_SHADOW_NOVA_25 = 65209, + + // Yogg Saron + SPELL_SANITY = 63050, + SPELL_INSANE = 63120, + SPELL_YOGG_SARON_TRANSFORMATION = 63895, + SPELL_CRUSHER_TENTACLE_SUMMON = 64139, + SPELL_CORRUPTOR_TENTACLE_SUMMON = 64143, + SPELL_CONSTRICTOR_TENTACLE_SUMMON = 64133, + SPELL_IMMORTAL_GUARDIAN_SUMMON = 64158, + SPELL_SHADOWY_BARRIER_LARGE = 63894, + + // Tentacles + SPELL_ERUPT = 64144, + + // Crusher Tentacle + SPELL_DIMINISH_POWER = 64145, + SPELL_FOCUSED_ANGER = 57688, + + // Corruptor Tentacle + SPELL_APATHY = 64156, + SPELL_BLACK_PLAGUE = 64153, + SPELL_CURSE_OF_DOOM = 64157, + SPELL_DRAINING_POISON = 64152, + + // Constrictor Tentacle + SPELL_SQUEEZE_10 = 64125, + SPELL_SQUEEZE_25 = 64126, + + // Influence Tentacle + SPELL_GRIM_REPRISAL = 63305, + SPELL_TENTACLE_VOID_ZONE = 64384, + + // Brain of Yogg Saron + SPELL_INDUCE_MADNESS = 64059, + SPELL_SHATTERED_ILLUSION = 64173, + SPELL_BRAIN_HURT = 64361, + SPELL_ILLUSION_ROOM = 63988, + + // Laughing skull + SPELL_LUNATIC_GAZE = 64167, + + // Yogg Saron + SPELL_LUNATIC_GAZE_P3 = 64163, + SPELL_SHADOW_BEACON = 64465, + SPELL_DEAFENING_ROAR = 64189, + SPELL_EXTINGUISH_ALL_LIFE = 64166, + SPELL_EMPOWERING_SHADOWS = 64468, + SPELL_MAWS_OF_THE_OLD_GOD = 64184, + + // Immortal Guardian + SPELL_EMPOWERED = 65294, + SPELL_DRAIN_LIFE_10 = 64159, + SPELL_DRAIN_LIFE_25 = 64160 +}; + +enum Keepers_Spells { - ACHIEV_TIMED_START_EVENT = 21001, + SPELL_KEEPER_ACTIVE = 62647, + + // Freya + SPELL_RESILIENCE_OF_NATURE = 62670, + SPELL_SANITY_WELL_SPAWN = 64170, + SPELL_SANITY_WELL_VISUAL = 63288, + SPELL_SANITY_WELL = 64169, + + // Thorim + SPELL_FURY_OF_THE_STORMS = 62702, + SPELL_TITANIC_STORM = 64171, + SPELL_TITANIC_STORM_EFFECT = 64172, + SPELL_WEAKENED = 64162, + + // Mimiron + SPELL_SPEED_OF_INVENTION = 62671, + SPELL_DESTABILIZATION = 65210, + + // Hodir + SPELL_FORTITUDE_OF_FROST = 62650, + SPELL_PROTECTIVE_GAZE = 64174 }; +enum Events +{ + EVENT_NONE, + EVENT_BERSERK, + EVENT_FERVOR, + EVENT_BLESSING, + EVENT_ANGER, + EVENT_SUMMON_GUARDIAN, + EVENT_PSYCHOSIS, + EVENT_MALADY_OF_THE_MIND, + EVENT_BRAIN_LINK, + EVENT_DEATH_RAY, + EVENT_ILLUSION, + EVENT_TENTACLES, + EVENT_LUNATIC_GAZE, + EVENT_SHADOW_BEACON, + EVENT_IMMORTAL_GUARDIAN, + EVENT_DEAFENING_ROAR +}; -void AddSC_boss_yoggsaron() +enum Actions { + ACTION_CHAMBER_ILLUSION, + ACTION_ICECROWN_ILLUSION, + ACTION_STORMWIND_ILLUSION, + ACTION_TENTACLE_COUNT, + ACTION_YOGGSARON_PHASE_3 +}; + +struct SummonLocation +{ + float x,y,z,o; + uint32 entry; +}; + +SummonLocation stormwindLocations[]= +{ + // Stormwind Illusion + {1931.05f, 38.86f, 239.667f, 1.70f, 33433}, // Suit of Armor + {1909.03f, 44.80f, 239.667f, 0.94f, 33433}, + {1897.92f, 64.40f, 239.667f, 0.17f, 33433}, + {1903.98f, 86.29f, 239.667f, 5.61f, 33433}, + {1923.45f, 97.54f, 239.667f, 4.83f, 33433}, + {1945.17f, 91.73f, 239.667f, 4.07f, 33433}, + {1956.38f, 72.04f, 239.667f, 3.27f, 33433}, + {1950.47f, 50.35f, 239.667f, 2.48f, 33433}, + {1928.65f, 65.71f, 242.376f, 2.09f, 33436}, // Garona + {1927.21f, 68.26f, 242.376f, 5.22f, 33437}, // King Llane + {1915.97f, 26.83f, 239.667f, 1.30f, 33990}, // Laughing Skull + {1901.90f, 74.99f, 239.667f, 6.02f, 33990}, + {1969.02f, 57.13f, 239.667f, 2.87f, 33990}, + {1933.89f, 93.48f, 239.667f, 4.44f, 33990} +}; + +SummonLocation chamberLocations[]= +{ + // Chamber of the Aspects Illusion + {2068.97f, -7.30f, 239.760f, 5.85f, 33716}, // Dragons + {2070.18f,-45.92f, 239.720f, 0.43f, 33716}, + {2113.69f,-65.53f, 239.720f, 1.82f, 33717}, + {2139.57f,-51.13f, 239.750f, 2.40f, 33717}, + {2146.88f,-33.45f, 239.720f, 3.14f, 33720}, + {2146.88f,-16.41f, 239.740f, 3.14f, 33720}, + {2137.49f, -0.26f, 239.720f, 3.83f, 33719}, + {2109.89f, 15.72f, 239.760f, 4.54f, 33719}, + {2064.12f,-58.09f, 239.720f, 0.64f, 33990}, // Laughing Skull + {2062.18f, 10.04f, 239.803f, 5.51f, 33990}, + {2129.46f, 20.66f, 239.720f, 4.14f, 33990}, + {2130.60f,-68.93f, 239.720f, 2.09f, 33990}, + {2091.82f,-25.39f, 242.647f, 0.0f, 33536}, // Alexstrasza + {2108.34f,-37.05f, 242.647f, 1.96f, 33535}, // Malygos + {2109.43f,-14.25f, 242.647f, 4.29f, 33495}, // Ysera + {2117.95f,-25.46f, 242.647f, 3.14f, 33523} // Neltharion +}; + +SummonLocation icecrownLocations[]= +{ + // Icecrown Illusion + {1955.67f,-133.19f, 240.0f, 5.75f, 33567}, // Deathsworn Zealot + {1958.09f,-140.64f, 240.0f, 5.75f, 33567}, + {1950.62f,-141.74f, 240.0f, 5.75f, 33567}, + {1897.75f, -99.84f, 240.0f, 2.62f, 33567}, + {1892.86f,-108.44f, 240.0f, 2.62f, 33567}, + {1890.07f,-100.78f, 240.0f, 2.62f, 33567}, + {1910.01f,-137.30f, 240.0f, 4.17f, 33567}, + {1918.60f,-142.42f, 240.0f, 4.17f, 33567}, + {1972.79f,-149.09f, 240.0f, 2.62f, 33990}, // Laughing Skull + {1941.27f,-169.01f, 240.0f, 1.04f, 33990}, + {1877.66f, -94.06f, 240.0f, 5.78f, 33990}, + {1873.27f,-129.11f, 240.0f, 1.04f, 33990}, + {1907.81f,-152.84f, 240.0f, 4.17f, 33441}, // The Lich King + {1905.19f,-157.67f, 240.0f, 1.04f, 33442} // Immolated Champion +}; + +const Position DeathRayPos[12] = +{ + {1934.73f,-25.43f,327.82f,0}, + {1974.43f,-72.74f,329.10f,0}, + {2016.19f,-16.32f,326.93f,0}, + {1961.54f, 9.78f,327.55f,0}, + {1955.90f,-54.43f,326.33f,0}, + {2011.09f,-54.67f,327.90f,0}, + {2003.48f, -0.03f,326.40f,0}, + {1954.04f, 4.59f,327.63f,0}, + {1943.14f, -5.17f,327.41f,0}, + {1943.72f,-48.29f,327.10f,0}, + {1990.30f,-67.09f,328.40f,0}, + {1980.22f, 12.33f,327.44f,0} +}; + +const Position PortalPos[10] = +{ + {1956.64f,-25.28f,325.17f,0}, + {1986.71f, -2.74f,325.17f,0}, + {2003.67f,-25.73f,325.07f,0}, + {1983.82f,-48.92f,324.70f,0}, + {1961.22f,-12.52f,325.02f,0}, + {1972.70f, -4.15f,324.89f,0}, + {1998.22f,-10.92f,325.11f,0}, + {1998.22f,-40.10f,324.89f,0}, + {1969.66f,-46.10f,324.87f,0}, + {1959.70f,-37.28f,325.11f,0} +}; + +const Position TentaclesPos[22] = +{ + {1986.53f, 14.69f,328.08f,4.44f}, + {1974.22f, 17.11f,327.86f,4.56f}, + {1956.55f, 0.83f,326.81f,5.19f}, + {1928.61f,-37.30f,327.74f,0.30f}, + {1939.52f,-45.68f,327.14f,0.26f}, + {1953.44f,-62.17f,327.49f,0.85f}, + {1976.65f,-76.02f,328.89f,1.48f}, + {1993.38f,-61.91f,327.60f,1.27f}, + {2016.65f,-52.52f,327.77f,2.70f}, + {2026.97f,-28.09f,327.98f,3.32f}, + {2022.59f,-16.85f,327.59f,3.37f}, + {1938.22f,-10.54f,328.19f,5.99f}, + {1944.06f,-38.17f,326.84f,0.36f}, + {1973.28f,-62.51f,327.32f,1.44f}, + {1999.19f,-57.96f,327.34f,2.04f}, + {2017.89f,-25.34f,327.12f,3.14f}, + {2000.26f, 4.49f,326.98f,4.15f}, + {2006.91f,-13.70f,326.03f,3.80f}, + {2007.72f, 3.27f,327.28f,4.02f}, + {2002.52f, 16.73f,328.80f,4.07f}, + {1974.55f, 9.30f,326.85f,4.65f}, + {1945.29f,-25.78f,327.12f, 0} +}; + +const Position SanityWellPos[10] = +{ + {2008.38f, 35.41f,331.251f,0}, + {1990.63f, 50.35f,332.041f,0}, + {1973.40f, 41.09f,330.989f,0}, + {1973.12f,-90.27f, 330.14f,0}, + {1994.26f,-96.62f, 330.62f,0}, + {2005.41f,-82.88f, 329.50f,0}, + {2042.09f,-41.70f, 329.12f,0}, + {1918.06f, 16.50f, 330.97f,0}, + {1899.59f, -4.87f,332.137f,0}, + {1897.75f,-48.24f, 332.35f,0} +}; + + + +/*------------------------------------------------------* + * Sara * + *------------------------------------------------------*/ + +class boss_sara : public CreatureScript +{ +public: + boss_sara() : CreatureScript("boss_sara") { } + + CreatureAI* GetAI(Creature* pCreature) const + { + return new boss_sara_AI (pCreature); + } + + struct boss_sara_AI : public BossAI + { + boss_sara_AI(Creature *pCreature) : BossAI(pCreature, BOSS_YOGGSARON) + { + me->ApplySpellImmune(0, IMMUNITY_ID, SPELL_RESILIENCE_OF_NATURE, true); + me->ApplySpellImmune(0, IMMUNITY_ID, SPELL_FURY_OF_THE_STORMS, true); + me->ApplySpellImmune(0, IMMUNITY_ID, SPELL_SPEED_OF_INVENTION, true); + me->ApplySpellImmune(0, IMMUNITY_ID, SPELL_FORTITUDE_OF_FROST, true); + me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true); + me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_GRIP, true); + me->SetFlying(true); + wipe = false; + } + + std::vector ominous_list; + uint32 uiPhase_timer; + uint32 uiStep; + uint8 keepers; + bool wipe; + + void Reset() + { + if (instance) + { + instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_SANITY); + // Reset Keepers + for (uint8 data = DATA_YS_FREYA; data <= DATA_YS_HODIR; ++data) + { + if (Creature *pCreature = Creature::GetCreature((*me), instance->GetData64(data))) + { + if (pCreature->HasAura(SPELL_KEEPER_ACTIVE)) + { + pCreature->AI()->EnterEvadeMode(); + pCreature->AddAura(SPELL_KEEPER_ACTIVE, pCreature); + } + } + } + // Reset Yogg-Saron + for (uint8 data = DATA_YOGGSARON_BRAIN; data <= DATA_YOGGSARON; ++data) + { + if (Creature *pCreature = Creature::GetCreature((*me), instance->GetData64(data))) + pCreature->AI()->EnterEvadeMode(); + } + Map::PlayerList const &players = instance->instance->GetPlayers(); + for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + { + Player* pPlayer = itr->getSource(); + if (!pPlayer) + continue; + + // Phase One wipe + if (wipe && phase == PHASE_1) + { + if (Creature* pVoice = me->SummonCreature(NPC_YOGG_SARON_VOICE,me->GetPositionX(),me->GetPositionY(),me->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,1000)) + DoScriptText(WHISP_SARA_INSANITY, pVoice, pPlayer); + } + // Kills insane players + if (pPlayer->HasAura(SPELL_INSANE)) + me->Kill(pPlayer, true); + } + } + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_NON_ATTACKABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetVisible(true); + me->RestoreDisplayId(); + me->RestoreFaction(); + me->GetMotionMaster()->MoveTargetedHome(); + phase = PHASE_NULL; + keepers = 0; + _Reset(); + } + + void JustReachedHome() + { + ominous_list.clear(); + for (uint8 n = 0; n < 5; n++) + { + Position pos; + me->GetRandomNearPosition(pos, 50); + if (Creature* OminousCloud = me->SummonCreature(NPC_OMINOUS_CLOUD, pos)) + ominous_list.push_back(OminousCloud); + } + } + + void MoveInLineOfSight(Unit *who) + { + if (!me->isInCombat() && me->IsWithinDist(who, 70.0f) && who->ToPlayer() && !who->ToPlayer()->isGameMaster()) + { + me->setFaction(16); + DoZoneInCombat(); + } + } + + void EnterCombat(Unit *who) + { + DoScriptText(RAND(SAY_SARA_AGGRO_1,SAY_SARA_AGGRO_2,SAY_SARA_AGGRO_3), me); + // Keepers activation + if (instance) + { + for (uint8 data = DATA_YS_FREYA; data <= DATA_YS_HODIR; ++data) + { + if (Creature *pCreature = Creature::GetCreature((*me), instance->GetData64(data))) + { + if (pCreature->HasAura(SPELL_KEEPER_ACTIVE)) + { + pCreature->SetInCombatWith(me); + pCreature->AddThreat(me, 150.0f); + ++keepers; + } + } + } + + if (!ominous_list.empty()) + { + for (std::vector::iterator itr = ominous_list.begin(); itr != ominous_list.end(); ++itr) + { + Creature* pTarget = *itr; + if (pTarget) + pTarget->AddThreat(me->getVictim(), 0.0f); + } + } + } + wipe = true; + me->RestoreFaction(); + uiStep = 0; + uiPhase_timer = -1; + JumpToNextStep(5000); + phase = PHASE_1; + events.SetPhase(PHASE_1); + events.ScheduleEvent(EVENT_FERVOR, urand(6000, 8000), 0, PHASE_1); + events.ScheduleEvent(EVENT_BLESSING, urand(10000, 12000), 0, PHASE_1); + events.ScheduleEvent(EVENT_ANGER, urand(15000, 20000), 0, PHASE_1); + events.ScheduleEvent(EVENT_SUMMON_GUARDIAN, 0, 0, PHASE_1); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + events.Update(diff); + + if (me->HasUnitState(UNIT_STAT_CASTING)) + return; + + if (phase == PHASE_1) + { + while (uint32 eventId = events.ExecuteEvent()) + { + switch(eventId) + { + case EVENT_FERVOR: + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 80, true)) + DoCast(pTarget, SPELL_SARA_FERVOR); + events.ScheduleEvent(EVENT_FERVOR, urand(8000, 10000), 0, PHASE_1); + break; + case EVENT_BLESSING: + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 80, true)) + DoCast(pTarget, SPELL_SARA_BLESSING); + events.ScheduleEvent(EVENT_BLESSING, urand(10000, 15000), 0, PHASE_1); + break; + case EVENT_ANGER: + if (Creature *pGuardian = me->FindNearestCreature(NPC_GUARDIAN_OF_YOGGSARON,50,true)) + DoCast(pGuardian, SPELL_SARA_ANGER); + events.ScheduleEvent(EVENT_ANGER, urand(15000, 20000), 0, PHASE_1); + break; + case EVENT_SUMMON_GUARDIAN: + if (!ominous_list.empty()) + { + std::vector::iterator itr = (ominous_list.begin()+rand()%ominous_list.size()); + Creature* pTarget = *itr; + if (pTarget) + pTarget->CastSpell(pTarget, SPELL_SUMMON_GUARDIAN, true); + } + events.ScheduleEvent(EVENT_SUMMON_GUARDIAN, 8000 + urand(6000, 8000)*((float)me->GetHealth()/me->GetMaxHealth()), 0, PHASE_1); + break; + } + } + + if (uiPhase_timer <= diff) + { + switch (uiStep) + { + case 1: + // Close door + _EnterCombat(); + uiStep = 2; + break; + default: + break; + } + } + else + uiPhase_timer -= diff; + } + else if (phase == PHASE_2) + { + while (uint32 eventId = events.ExecuteEvent()) + { + switch(eventId) + { + case EVENT_PSYCHOSIS: + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 60, true)) + DoCast(pTarget, SPELL_PSYCHOSIS); + events.ScheduleEvent(EVENT_PSYCHOSIS, urand(4000, 6000), 0, PHASE_2); + break; + case EVENT_MALADY_OF_THE_MIND: + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 60, true)) + DoCast(pTarget, SPELL_MALADY_OF_THE_MIND); + events.ScheduleEvent(EVENT_MALADY_OF_THE_MIND, urand(15000, 20000), 0, PHASE_2); + break; + case EVENT_BRAIN_LINK: + DoCastAOE(SPELL_BRAIN_LINK); + events.ScheduleEvent(EVENT_BRAIN_LINK, 30000, 0, PHASE_2); + break; + case EVENT_DEATH_RAY: + for (uint32 i = 0; i < 4; ++i) + me->SummonCreature(NPC_DEATH_ORB, DeathRayPos[rand()%12], TEMPSUMMON_TIMED_DESPAWN, 17000); + events.ScheduleEvent(EVENT_DEATH_RAY, 20000, 0, PHASE_2); + break; + } + } + + if (uiPhase_timer <= diff) + { + switch (uiStep) + { + case 1: + DoScriptText(SAY_PHASE2_1, me); + me->HandleEmoteCommand(EMOTE_ONESHOT_TALK); + if (!ominous_list.empty()) + { + for (std::vector::iterator itr = ominous_list.begin(); itr != ominous_list.end(); ++itr) + { + Creature* pTarget = *itr; + if (pTarget) + pTarget->ForcedDespawn(); + } + } + JumpToNextStep(5000); + break; + case 2: + DoScriptText(SAY_PHASE2_2, me); + JumpToNextStep(4000); + break; + case 3: + DoScriptText(SAY_PHASE2_3, me); + JumpToNextStep(5000); + break; + case 4: + DoScriptText(SAY_PHASE2_4, me); + JumpToNextStep(3000); + break; + case 5: + me->SetDisplayId(29182); + me->setFaction(16); + events.SetPhase(PHASE_2); + DoZoneInCombat(); + me->GetMotionMaster()->MoveJump(me->GetPositionX(),me->GetPositionY(),me->GetPositionZ()+20, 10, 15); + me->SummonCreature(NPC_YOGG_SARON,me->GetPositionX(),me->GetPositionY(),me->GetPositionZ(),M_PI,TEMPSUMMON_CORPSE_TIMED_DESPAWN,600000); + JumpToNextStep(5000); + break; + case 6: + DoScriptText(RAND(SAY_SARA_PHASE2_1, SAY_SARA_PHASE2_2), me); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + events.ScheduleEvent(EVENT_PSYCHOSIS, 0, 0, PHASE_2); + events.ScheduleEvent(EVENT_MALADY_OF_THE_MIND, urand(4000, 6000), 0, PHASE_2); + events.ScheduleEvent(EVENT_BRAIN_LINK, 30000, 0, PHASE_2); + events.ScheduleEvent(EVENT_DEATH_RAY, 25000, 0, PHASE_2); + uiStep = 7; + break; + default: + break; + } + } + else + uiPhase_timer -= diff; + } + } + + void DamageTaken(Unit *who, uint32 &damage) + { + if (phase == PHASE_1 && damage >= me->GetHealth()) + { + damage = 0; + me->SetFullHealth(); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + phase = PHASE_2; + uiStep = 0; + uiPhase_timer = -1; + JumpToNextStep(100); + } + } + + void JumpToNextStep(uint32 uiTimer) + { + uiPhase_timer = uiTimer; + ++uiStep; + } + }; + +}; + +/*------------------------------------------------------* + * Yogg-Saron * + *------------------------------------------------------*/ + +class boss_yoggsaron : public CreatureScript +{ +public: + boss_yoggsaron() : CreatureScript("boss_yoggsaron") { } + + CreatureAI* GetAI(Creature* pCreature) const + { + return new boss_yoggsaron_AI (pCreature); + } + + struct boss_yoggsaron_AI : public BossAI + { + boss_yoggsaron_AI(Creature *pCreature) : BossAI(pCreature, BOSS_YOGGSARON) + { + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED | UNIT_FLAG_DISABLE_MOVE); + me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true); + me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_GRIP, true); + DoCast(me, SPELL_SHADOWY_BARRIER_LARGE, true); + me->SetReactState(REACT_PASSIVE); + DoScriptText(SAY_PHASE2_5, me); + } + + uint32 insaneTimer; + uint8 illusionOrder[3]; + uint8 illusionCount; + uint8 spawnedTentacles; + + void Reset() + { + events.Reset(); + summons.DespawnAll(); + } + + void EnterCombat(Unit *who) + { + _EnterCombat(); + + // 100% Sanity + if (instance) + { + Map::PlayerList const &players = instance->instance->GetPlayers(); + for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + { + Player* pPlayer = itr->getSource(); + if (pPlayer) + me->SetAuraStack(SPELL_SANITY, pPlayer, 100); + } + // Spawn Brain of Yogg-Saron + me->SummonCreature(NPC_YOGG_SARON_BRAIN, 1980.70f, -25.16f, 262.77f, M_PI); + insaneTimer = 4000; + illusionCount = 0; + spawnedTentacles = 0; + randomizeIllusion(); + events.SetPhase(PHASE_2); + events.ScheduleEvent(EVENT_TENTACLES, 1000, 0, PHASE_2); + events.ScheduleEvent(EVENT_ILLUSION, 60000, 0, PHASE_2); + } + } + + void UpdateAI(const uint32 diff) + { + if(!UpdateVictim()) + return; + + events.Update(diff); + + if (insaneTimer <= diff) + { + if (instance) + { + // Sanity Check + Map::PlayerList const &players = instance->instance->GetPlayers(); + for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + { + Player* pPlayer = itr->getSource(); + + if (!pPlayer) + continue; + + if (pPlayer->isDead() || pPlayer->HasAura(SPELL_SANITY) || pPlayer->HasAura(SPELL_INSANE)) + continue; + + if (Creature* pVoice = me->SummonCreature(NPC_YOGG_SARON_VOICE,me->GetPositionX(),me->GetPositionY(),me->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,1000)) + DoScriptText(RAND(WHISP_INSANITY_1, WHISP_INSANITY_1), pVoice, pPlayer); + + DoCast(pPlayer, SPELL_INSANE, true); + } + } + insaneTimer = 4000; + } + else insaneTimer -= diff; + + if (me->HasUnitState(UNIT_STAT_CASTING)) + return; + + if (phase == PHASE_2) + { + while(uint32 eventId = events.ExecuteEvent()) + { + switch(eventId) + { + case EVENT_TENTACLES: + spawnTentacles(); + events.ScheduleEvent(EVENT_TENTACLES, urand(25000, 30000), 0, PHASE_2); + break; + case EVENT_ILLUSION: + DoScriptText(SAY_VISION, me); + Map::PlayerList const &players = instance->instance->GetPlayers(); + for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + DoScriptText(EMOTE_PORTALS, me, itr->getSource()); + OpenIllusion(); + events.ScheduleEvent(EVENT_ILLUSION, urand(80000, 85000), 0, PHASE_2); + break; + + } + } + } + else + { + while(uint32 eventId = events.ExecuteEvent()) + { + switch(eventId) + { + case EVENT_LUNATIC_GAZE: + DoScriptText(SAY_LUNATIC_GAZE, me); + DoCast(me, SPELL_LUNATIC_GAZE_P3); + events.ScheduleEvent(EVENT_LUNATIC_GAZE, urand(15000, 20000), 0, PHASE_3); + break; + case EVENT_IMMORTAL_GUARDIAN: + Position pos; + me->GetRandomNearPosition(pos, 25); + me->SummonCreature(NPC_IMMORTAL_GUARDIAN, pos, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); + events.ScheduleEvent(EVENT_IMMORTAL_GUARDIAN, urand(25000, 30000), 0, PHASE_3); + break; + case EVENT_SHADOW_BEACON: + if (Creature *pImmortal = me->FindNearestCreature(NPC_IMMORTAL_GUARDIAN,80,true)) + { + Map::PlayerList const &players = instance->instance->GetPlayers(); + for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + DoScriptText(EMOTE_EMPOWERING, me, itr->getSource()); me->AddAura(SPELL_SHADOW_BEACON, pImmortal); + } + events.ScheduleEvent(EVENT_SHADOW_BEACON, 45000, 0, PHASE_3); + break; + case EVENT_DEAFENING_ROAR: + DoScriptText(SAY_DEAFENING_ROAR, me); + DoCast(me, SPELL_DEAFENING_ROAR); + events.ScheduleEvent(EVENT_DEAFENING_ROAR, urand(20000, 25000), 0, PHASE_3); + break; + } + } + } + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_DEATH, me); + _JustDied(); + + if (Unit *pSara = me->ToTempSummon()->GetSummoner()) + pSara->ToCreature()->DisappearAndDie(); + + me->SetStandState(UNIT_STAND_STATE_SUBMERGED); + me->HandleEmoteCommand(EMOTE_ONESHOT_EMERGE); + + if (instance) + { + instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_SANITY); + } + } + + void randomizeIllusion() + { + illusionOrder[0] = 0; // Chamber of the Aspects Illusion + illusionOrder[1] = 1; // Icecrown Illusion + illusionOrder[2] = 2; // Stormwind Illusion + + //Swaps the entire array + for(uint8 n = 0; n < 3; n++) + { + uint8 random = rand() % 2; + uint8 temp = illusionOrder[random]; + illusionOrder[random] = illusionOrder[n]; + illusionOrder[n] = temp; + } + } + + void OpenIllusion() + { + switch(illusionCount) + { + case 0: illusionHandler(illusionOrder[0]); break; + case 1: illusionHandler(illusionOrder[1]); break; + case 2: illusionHandler(illusionOrder[2]); break; + } + + illusionCount++; + if(illusionCount > 2) + { + illusionCount = 0; + } + } + + void illusionHandler(uint8 illusion) + { + if (instance) + { + switch(illusion) + { + case 0: // Chamber of the Aspects Illusion + if (Creature *pBrain = Creature::GetCreature((*me), instance->GetData64(DATA_YOGGSARON_BRAIN))) + { + pBrain->AI()->Reset(); + pBrain->AI()->DoAction(ACTION_CHAMBER_ILLUSION); + for (int32 i = 0; i < RAID_MODE(4, 10); ++i) + me->SummonCreature(NPC_PORTAL_CHAMBER, PortalPos[i], TEMPSUMMON_TIMED_DESPAWN, 30000); + } + break; + case 1: // Icecrown Illusion + if (Creature *pBrain = Creature::GetCreature((*me), instance->GetData64(DATA_YOGGSARON_BRAIN))) + { + pBrain->AI()->Reset(); + pBrain->AI()->DoAction(ACTION_ICECROWN_ILLUSION); + for (int32 i = 0; i < RAID_MODE(4, 10); ++i) + me->SummonCreature(NPC_PORTAL_ICECROWN, PortalPos[i], TEMPSUMMON_TIMED_DESPAWN, 30000); + } + break; + case 2: // Stormwind Illusion + if (Creature *pBrain = Creature::GetCreature((*me), instance->GetData64(DATA_YOGGSARON_BRAIN))) + { + pBrain->AI()->Reset(); + pBrain->AI()->DoAction(ACTION_STORMWIND_ILLUSION); + for (int32 i = 0; i < RAID_MODE(4, 10); ++i) + me->SummonCreature(NPC_PORTAL_STORMWIND, PortalPos[i], TEMPSUMMON_TIMED_DESPAWN, 30000); + } + break; + } + } + } + + void spawnTentacles() + { + switch(spawnedTentacles) + { + case 0: + me->SummonCreature(NPC_CRUSHER_TENTACLE, TentaclesPos[rand()%22]); + case 1: + case 2: + me->SummonCreature(NPC_CORRUPTOR_TENTACLE, TentaclesPos[rand()%22]); + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 60, true)) + { + Position pos; + pTarget->GetPosition(&pos); + if (Creature* Constrict = me->SummonCreature(NPC_CONSTRICTOR_TENTACLE, pos)) + pTarget->EnterVehicle(Constrict, 0); + } + break; + } + + spawnedTentacles++; + if(spawnedTentacles > 2) + { + spawnedTentacles = 0; + } + } + + void DoAction(const int32 action) + { + switch (action) + { + case ACTION_YOGGSARON_PHASE_3: + if (Unit *pSara = me->ToTempSummon()->GetSummoner()) + pSara->SetVisible(false); + DoScriptText(SAY_PHASE3, me); + me->RemoveAurasDueToSpell(SPELL_SHADOWY_BARRIER_LARGE); + DoCast(me, SPELL_YOGG_SARON_TRANSFORMATION, true); + events.SetPhase(PHASE_3); + events.ScheduleEvent(EVENT_LUNATIC_GAZE, 15000, 0, PHASE_3); + events.ScheduleEvent(EVENT_IMMORTAL_GUARDIAN, 8000, 0, PHASE_3); + events.ScheduleEvent(EVENT_SHADOW_BEACON, 45000, 0, PHASE_3); + if (GetDifficulty() == RAID_DIFFICULTY_25MAN_NORMAL) + events.ScheduleEvent(EVENT_DEAFENING_ROAR, urand(5000, 7000), 0, PHASE_3); + break; + } + } + }; + +}; + + +/*------------------------------------------------------* + * Brain of Yogg-Saron * + *------------------------------------------------------*/ + +class boss_brain_yoggsaron : public CreatureScript +{ +public: + boss_brain_yoggsaron() : CreatureScript("boss_brain_yoggsaron") { } + + CreatureAI* GetAI(Creature* pCreature) const + { + return new boss_brain_yoggsaron_AI (pCreature); + } + + struct boss_brain_yoggsaron_AI : public BossAI + { + boss_brain_yoggsaron_AI(Creature *pCreature) : BossAI(pCreature, BOSS_YOGGSARON) + { + me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true); + me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_GRIP, true); + me->SetReactState(REACT_PASSIVE); + me->SetFlying(true); + } + + int32 tentacleCount; + int32 illusion; + + void Reset() + { + events.Reset(); + summons.DespawnAll(); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + tentacleCount = 0; + illusion = 0; + if (instance) + { + for (uint32 i = GOB_CHAMBER_DOOR; i <= GOB_STORMWIND_DOOR; i++) + { + if (GameObject* Door = me->FindNearestGameObject(i, 60)) + Door->SetGoState(GO_STATE_READY); + } + } + } + + void EnterCombat(Unit *who) + { + _EnterCombat(); + } + + void UpdateAI(const uint32 diff) + { + if(!UpdateVictim()) + return; + + if (HealthBelowPct(30) && phase == PHASE_2) + { + // Enter Phase 3 + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE); + me->InterruptNonMeleeSpells(true); + DoCast(me, SPELL_BRAIN_HURT, true); + phase = PHASE_3; + if (Unit* pYoggSaron = me->ToTempSummon()->GetSummoner()) + pYoggSaron->ToCreature()->AI()->DoAction(ACTION_YOGGSARON_PHASE_3); + } + } + + void DoAction(const int32 action) + { + switch (action) + { + case ACTION_TENTACLE_COUNT: + tentacleCount++; + if (tentacleCount == 8) + { + DoCastAOE(SPELL_SHATTERED_ILLUSION, true); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + if (GameObject* pDoor = me->FindNearestGameObject(GOB_CHAMBER_DOOR + illusion, 60)) + pDoor->SetGoState(GO_STATE_ACTIVE); + // The Illusion shatters and a path to the central chamber opens! + std::list unitList; + me->GetRaidMember(unitList, 80); + for (std::list::iterator itr = unitList.begin(); itr != unitList.end(); ++itr) + DoScriptText(EMOTE_OPEN_CHAMBER, me, *itr); + } + break; + case ACTION_CHAMBER_ILLUSION: + illusion = 0; + for (uint32 i = 0; i < 16; i++) + me->SummonCreature(chamberLocations[i].entry,chamberLocations[i].x,chamberLocations[i].y,chamberLocations[i].z,chamberLocations[i].o); + DoCast(SPELL_INDUCE_MADNESS); + break; + case ACTION_ICECROWN_ILLUSION: + illusion = 1; + for (uint32 i = 0; i < 14; i++) + me->SummonCreature(icecrownLocations[i].entry,icecrownLocations[i].x,icecrownLocations[i].y,icecrownLocations[i].z,icecrownLocations[i].o); + DoCast(SPELL_INDUCE_MADNESS); + break; + case ACTION_STORMWIND_ILLUSION: + illusion = 2; + for (uint32 i = 0; i < 14; i++) + me->SummonCreature(stormwindLocations[i].entry,stormwindLocations[i].x,stormwindLocations[i].y,stormwindLocations[i].z,stormwindLocations[i].o); + DoCast(SPELL_INDUCE_MADNESS); + break; + } + } + }; + +}; + +class npc_ominous_cloud : public CreatureScript +{ +public: + npc_ominous_cloud() : CreatureScript("npc_ominous_cloud") { } + + CreatureAI* GetAI(Creature* pCreature) const + { + return new npc_ominous_cloud_AI (pCreature); + } + + struct npc_ominous_cloud_AI : public ScriptedAI + { + npc_ominous_cloud_AI(Creature* pCreature) : ScriptedAI(pCreature), summons(me) + { + me->GetMotionMaster()->MoveRandom(5); + me->SetDisplayId(28549); + } + + SummonList summons; + bool SummonCooldown; + int32 uiCooldownTimer; + + void Reset() + { + summons.DespawnAll(); + DoCast(me, SPELL_OMINOUS_CLOUD_VISUAL, true); + SummonCooldown = false; + uiCooldownTimer = 3000; + } + + void MoveInLineOfSight(Unit *who) + { + if (!SummonCooldown && me->IsWithinDistInMap(who, 6.0f) && who->ToPlayer() && !who->ToPlayer()->isGameMaster()) + { + DoCast(me, SPELL_INSTANT_SUMMON_GUARDIAN, true); + SummonCooldown = true; + uiCooldownTimer = 3000; + } + } + + void UpdateAI(const uint32 diff) + { + if(!UpdateVictim()) + return; + + if(uiCooldownTimer <= 0) + { + SummonCooldown = false; + uiCooldownTimer = 10000; + } + else uiCooldownTimer -= diff; + } + + void JustSummoned(Creature *summon) + { + summons.Summon(summon); + } + }; + +}; + +class npc_guardian_yoggsaron : public CreatureScript +{ +public: + npc_guardian_yoggsaron() : CreatureScript("npc_guardian_yoggsaron") { } + + CreatureAI* GetAI(Creature* pCreature) const + { + return new npc_guardian_yoggsaron_AI (pCreature); + } + + struct npc_guardian_yoggsaron_AI : public ScriptedAI + { + npc_guardian_yoggsaron_AI(Creature* pCreature) : ScriptedAI(pCreature) { } + + int32 uiDarkVolleyTimer; + + void Reset() + { + DoZoneInCombat(); + uiDarkVolleyTimer = 8000; + } + + void JustDied(Unit *victim) + { + DoCast(me, RAID_MODE(SPELL_SHADOW_NOVA_10, SPELL_SHADOW_NOVA_25), true); + if (Creature *pSara = me->FindNearestCreature(NPC_SARA, 10.0f, true)) + if (phase == PHASE_1) + me->DealDamage(pSara, 25000); + me->ForcedDespawn(3000); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + me->ForcedDespawn(); + + if (uiDarkVolleyTimer <= 0) + { + DoCast(SPELL_DARK_VOLLEY); + uiDarkVolleyTimer = urand(10000, 15000); + } + else uiDarkVolleyTimer -= diff; + + DoMeleeAttackIfReady(); + } + }; + +}; + +class npc_death_orb : public CreatureScript +{ +public: + npc_death_orb() : CreatureScript("npc_death_orb") { } + + CreatureAI* GetAI(Creature* pCreature) const + { + return new npc_death_orb_AI (pCreature); + } + + struct npc_death_orb_AI : public ScriptedAI + { + npc_death_orb_AI(Creature* pCreature) : ScriptedAI(pCreature) + { + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); + me->SetReactState(REACT_PASSIVE); + me->SetDisplayId(16946); + DoCast(SPELL_DEATH_RAY_WARNING_VISUAL); + } + + int32 RayTimer; + + void Reset() + { + RayTimer = 5000; + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (RayTimer <= 0) + { + DoCast(SPELL_DEATH_RAY_DAMAGE); + DoCast(SPELL_DEATH_RAY_DAMAGE_VISUAL); + me->ClearUnitState(UNIT_STAT_CASTING); + me->GetMotionMaster()->MoveRandom(10.0f); + RayTimer = 15000; + } + else RayTimer -= diff; + } + }; + +}; + +class npc_laughing_skull : public CreatureScript +{ +public: + npc_laughing_skull() : CreatureScript("npc_laughing_skull") { } + + CreatureAI* GetAI(Creature* pCreature) const + { + return new npc_laughing_skull_AI (pCreature); + } + + struct npc_laughing_skull_AI : public Scripted_NoMovementAI + { + npc_laughing_skull_AI(Creature* pCreature) : Scripted_NoMovementAI(pCreature) + { + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); + me->SetDisplayId(15880); + me->SetReactState(REACT_PASSIVE); + me->AddAura(SPELL_LUNATIC_GAZE, me); + } + }; + +}; + +class npc_illusion : public CreatureScript +{ +public: + npc_illusion() : CreatureScript("npc_illusion") { } + + CreatureAI* GetAI(Creature* pCreature) const + { + return new npc_illusion_AI (pCreature); + } + + struct npc_illusion_AI : public Scripted_NoMovementAI + { + npc_illusion_AI(Creature* pCreature) : Scripted_NoMovementAI(pCreature) { } + + void DamageTaken(Unit *attacker, uint32 &damage) + { + if (me->GetEntry() != NPC_INFLUENCE_TENTACLE) + { + me->UpdateEntry(NPC_INFLUENCE_TENTACLE); + DoCast(me, SPELL_GRIM_REPRISAL, true); + DoCast(me, SPELL_TENTACLE_VOID_ZONE, true); + } + } + + void JustDied(Unit *victim) + { + if (Unit* pBrain = me->ToTempSummon()->GetSummoner()) + pBrain->ToCreature()->AI()->DoAction(ACTION_TENTACLE_COUNT); + } + }; + +}; + +class npc_descend_into_madness : public CreatureScript +{ +public: + npc_descend_into_madness() : CreatureScript("npc_descend_into_madness") { } + + CreatureAI* GetAI(Creature* pCreature) const + { + return new npc_descend_into_madness_AI (pCreature); + } + + struct npc_descend_into_madness_AI : public PassiveAI + { + npc_descend_into_madness_AI(Creature *c) : PassiveAI(c) {} + + void DoAction(const int32 param) + { + if (param == EVENT_SPELLCLICK) + { + me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK); + me->ForcedDespawn(); + } + } + }; + +}; + +class npc_passive_illusion : public CreatureScript +{ +public: + npc_passive_illusion() : CreatureScript("npc_passive_illusion") { } + + CreatureAI* GetAI(Creature* pCreature) const + { + return new npc_passive_illusion_AI (pCreature); + } + + struct npc_passive_illusion_AI : public PassiveAI + { + npc_passive_illusion_AI(Creature *c) : PassiveAI(c) + { + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_NON_ATTACKABLE); + } + }; + +}; -} +/*------------------------------------------------------* + * Tentacles * + *------------------------------------------------------*/ + +class npc_crusher_tentacle : public CreatureScript +{ +public: + npc_crusher_tentacle() : CreatureScript("npc_crusher_tentacle") { } + + CreatureAI* GetAI(Creature* pCreature) const + { + return new npc_crusher_tentacle_AI (pCreature); + } + + struct npc_crusher_tentacle_AI : public Scripted_NoMovementAI + { + npc_crusher_tentacle_AI(Creature* pCreature) : Scripted_NoMovementAI(pCreature) + { + DoCast(me, SPELL_TENTACLE_VOID_ZONE, true); + DoCast(me, SPELL_ERUPT, true); + DoCast(me, SPELL_FOCUSED_ANGER, true); + DoCast(me, SPELL_DIMINISH_POWER, true); + DiminishTimer = 3000; + } + + int32 DiminishTimer; + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim() || me->HasUnitState(UNIT_STAT_CASTING)) + return; + + if (DiminishTimer <= 0) + { + DoCast(me, SPELL_DIMINISH_POWER, true); + DiminishTimer = 3000; + } + else DiminishTimer -= diff; + + DoMeleeAttackIfReady(); + } + + void DamageTaken(Unit *attacker, uint32 &damage) + { + if (attacker->IsWithinMeleeRange(me) && me->HasUnitState(UNIT_STAT_CASTING)) + me->InterruptNonMeleeSpells(true, SPELL_DIMINISH_POWER); + } + }; + +}; + +class npc_constrictor_tentacle : public CreatureScript +{ +public: + npc_constrictor_tentacle() : CreatureScript("npc_constrictor_tentacle") { } + + CreatureAI* GetAI(Creature* pCreature) const + { + return new npc_constrictor_tentacle_AI (pCreature); + } + + struct npc_constrictor_tentacle_AI : public Scripted_NoMovementAI + { + npc_constrictor_tentacle_AI(Creature* pCreature) : Scripted_NoMovementAI(pCreature) + { + me->SetReactState(REACT_PASSIVE); + DoCast(me, SPELL_TENTACLE_VOID_ZONE, true); + } + + void PassengerBoarded(Unit* who, int8 /*seatId*/, bool apply) + { + if (apply) + me->AddAura(RAID_MODE(SPELL_SQUEEZE_10, SPELL_SQUEEZE_25), who); + else + who->RemoveAurasDueToSpell(RAID_MODE(SPELL_SQUEEZE_10, SPELL_SQUEEZE_25)); + } + }; + +}; + +class npc_corruptor_tentacle : public CreatureScript +{ +public: + npc_corruptor_tentacle() : CreatureScript("npc_corruptor_tentacle") { } + + CreatureAI* GetAI(Creature* pCreature) const + { + return new npc_corruptor_tentacle_AI (pCreature); + } + + struct npc_corruptor_tentacle_AI : public Scripted_NoMovementAI + { + npc_corruptor_tentacle_AI(Creature* pCreature) : Scripted_NoMovementAI(pCreature) + { + DoCast(me, SPELL_TENTACLE_VOID_ZONE, true); + DoCast(me, SPELL_ERUPT, true); + ApathyTimer = 0; + PoisonTimer = 1000; + PlagueTimer = 2000; + CurseTimer = 3000; + // Destabilization Matrix doesn't work + ApathyTimer = 0; + PoisonTimer = 4000; + PlagueTimer = 8000; + CurseTimer = 12000; + } + + int32 ApathyTimer; + int32 PoisonTimer; + int32 PlagueTimer; + int32 CurseTimer; + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim() || me->HasUnitState(UNIT_STAT_CASTING)) + return; + + if (ApathyTimer <= 0) + { + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 80, true)) + DoCast(pTarget, SPELL_APATHY); + //ApathyTimer = 4000; + ApathyTimer = 16000; + } + else ApathyTimer -= diff; + + if (PoisonTimer <= 0) + { + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 80, true)) + DoCast(pTarget, SPELL_DRAINING_POISON); + //PoisonTimer = 4000; + PoisonTimer = 16000; + } + else PoisonTimer -= diff; + + if (PlagueTimer <= 0) + { + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 80, true)) + DoCast(pTarget, SPELL_BLACK_PLAGUE); + //PlagueTimer = 4000; + PlagueTimer = 16000; + } + else PlagueTimer -= diff; + + if (CurseTimer <= 0) + { + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 80, true)) + DoCast(pTarget, SPELL_CURSE_OF_DOOM); + //CurseTimer = 4000; + CurseTimer = 16000; + } + else CurseTimer -= diff; + } + }; + +}; + + +/*------------------------------------------------------* + * Immortal Guardian * + *------------------------------------------------------*/ + + +class npc_immortal_guardian : public CreatureScript +{ +public: + npc_immortal_guardian() : CreatureScript("npc_immortal_guardian") { } + + CreatureAI* GetAI(Creature* pCreature) const + { + return new npc_immortal_guardian_AI (pCreature); + } + + struct npc_immortal_guardian_AI : public ScriptedAI + { + npc_immortal_guardian_AI(Creature* pCreature) : ScriptedAI(pCreature) + { + me->SetAuraStack(SPELL_EMPOWERED, me, 10); + } + + int32 uiDrainLifeTimer; + + void Reset() + { + uiDrainLifeTimer = 10000; + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (HealthBelowPct(10)) + { + me->RemoveAurasDueToSpell(SPELL_EMPOWERED); + me->AddAura(SPELL_WEAKENED, me); + } + else + { + me->RemoveAurasDueToSpell(SPELL_WEAKENED); + me->SetAuraStack(SPELL_EMPOWERED, me, ((float)me->GetHealth() / me->GetMaxHealth()) * 10); + } + + if (uiDrainLifeTimer <= 0) + { + DoCast(me->getVictim(), RAID_MODE(SPELL_DRAIN_LIFE_10, SPELL_DRAIN_LIFE_25)); + uiDrainLifeTimer = urand(15000, 20000); + } + else uiDrainLifeTimer -= diff; + + DoMeleeAttackIfReady(); + } + + void DamageTaken(Unit* who, uint32 &damage) + { + // Immortal Guardians stop taking damage when their health reaches 1% + if (damage >= me->GetHealth()) + { + me->SetHealth(me->GetMaxHealth() / 100); + damage = 0 ; + } + } + + void SpellHit(Unit *caster, const SpellEntry *spell) + { + // Thorim kills weakened immortal creatures + if (spell->Id == SPELL_TITANIC_STORM_EFFECT) + { + caster->Kill(me, false); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + } + }; + +}; + +/*------------------------------------------------------* + * Images of Keepers * + *------------------------------------------------------*/ + +class npc_keeper_image : public CreatureScript +{ +public: + npc_keeper_image() : CreatureScript("npc_keeper_image") { } + + bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction) + { + InstanceScript* instance = pCreature->GetInstanceScript(); + + if (pPlayer) + pPlayer->CLOSE_GOSSIP_MENU(); + + switch (pCreature->GetEntry()) + { + case NPC_IMAGE_OF_FREYA: + DoScriptText(SAY_FREYA_HELP, pCreature); + pCreature->AddAura(SPELL_KEEPER_ACTIVE, pCreature); + if (Creature *pFreya = pCreature->GetCreature(*pCreature, instance->GetData64(DATA_YS_FREYA))) + pFreya->AddAura(SPELL_KEEPER_ACTIVE, pFreya); + break; + case NPC_IMAGE_OF_THORIM: + DoScriptText(SAY_THORIM_HELP, pCreature); + pCreature->AddAura(SPELL_KEEPER_ACTIVE, pCreature); + if (Creature *pThorim = pCreature->GetCreature(*pCreature, instance->GetData64(DATA_YS_THORIM))) + pThorim->AddAura(SPELL_KEEPER_ACTIVE, pThorim); + break; + case NPC_IMAGE_OF_MIMIRON: + DoScriptText(SAY_MIMIRON_HELP, pCreature); + pCreature->AddAura(SPELL_KEEPER_ACTIVE, pCreature); + if (Creature *pMimiron = pCreature->GetCreature(*pCreature, instance->GetData64(DATA_YS_MIMIRON))) + pMimiron->AddAura(SPELL_KEEPER_ACTIVE, pMimiron); + break; + case NPC_IMAGE_OF_HODIR: + DoScriptText(SAY_HODIR_HELP, pCreature); + pCreature->AddAura(SPELL_KEEPER_ACTIVE, pCreature); + if (Creature *pHodir = pCreature->GetCreature(*pCreature, instance->GetData64(DATA_YS_HODIR))) + pHodir->AddAura(SPELL_KEEPER_ACTIVE, pHodir); + break; + } + return true; + } + + bool OnGossipHello(Player* pPlayer, Creature* pCreature) + { + InstanceScript* instance = pCreature->GetInstanceScript(); + + if (instance && pPlayer) + { + if (!pCreature->HasAura(SPELL_KEEPER_ACTIVE)) + { + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_KEEPER_HELP, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + } + } + return true; + } + + CreatureAI* GetAI(Creature* pCreature) const + { + return new npc_keeper_image_AI (pCreature); + } + + struct npc_keeper_image_AI : public ScriptedAI + { + npc_keeper_image_AI(Creature* pCreature) : ScriptedAI(pCreature) + { + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_NON_ATTACKABLE); + me->SetReactState(REACT_PASSIVE); + } + }; + +}; + + +class npc_ys_freya : public CreatureScript +{ +public: + npc_ys_freya() : CreatureScript("npc_ys_freya") { } + + CreatureAI* GetAI(Creature* pCreature) const + { + return new npc_ys_freya_AI (pCreature); + } + + struct npc_ys_freya_AI : public ScriptedAI + { + npc_ys_freya_AI(Creature* pCreature) : ScriptedAI(pCreature) + { + me->ApplySpellImmune(0, IMMUNITY_ID, SPELL_FURY_OF_THE_STORMS, true); + me->ApplySpellImmune(0, IMMUNITY_ID, SPELL_SPEED_OF_INVENTION, true); + me->ApplySpellImmune(0, IMMUNITY_ID, SPELL_FORTITUDE_OF_FROST, true); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_NON_ATTACKABLE); + me->SetReactState(REACT_PASSIVE); + } + + uint32 WellTimer; + + void Reset() + { + WellTimer = urand(5000, 10000); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!UpdateVictim()) + return; + + if (!me->HasAura(SPELL_RESILIENCE_OF_NATURE)) + DoCast(me, SPELL_RESILIENCE_OF_NATURE); + + if (WellTimer <= uiDiff) + { + DoCast(SPELL_SANITY_WELL_SPAWN); + me->SummonCreature(NPC_SANITY_WELL, SanityWellPos[rand()%10], TEMPSUMMON_TIMED_DESPAWN, 60000); + WellTimer = 20000; + } + else WellTimer -= uiDiff; + } + }; + +}; + +class npc_sanity_well : public CreatureScript +{ +public: + npc_sanity_well() : CreatureScript("npc_sanity_well") { } + + CreatureAI* GetAI(Creature* pCreature) const + { + return new npc_sanity_well_AI (pCreature); + } + + struct npc_sanity_well_AI : public Scripted_NoMovementAI + { + npc_sanity_well_AI(Creature* pCreature) : Scripted_NoMovementAI(pCreature) + { + pInstance = pCreature->GetInstanceScript(); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); + me->SetDisplayId(11686); + DoCast(me, SPELL_SANITY_WELL_VISUAL); + DoCast(me, SPELL_SANITY_WELL); + sanityTimer = 2000; + } + + InstanceScript* pInstance; + uint32 sanityTimer; + + void UpdateAI(const uint32 uiDiff) + { + if (sanityTimer <= uiDiff) + { + Map::PlayerList const &players = pInstance->instance->GetPlayers(); + for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + { + Player* pPlayer = itr->getSource(); + if (!pPlayer) + continue; + // Standing in the well brings you back to your senses, regenerating 20% Sanity every 2 sec + if (me->IsWithinDist(pPlayer, 8.0f) && pPlayer->HasAura(SPELL_SANITY_WELL)) + { + if (Aura * aur = pPlayer->GetAura(SPELL_SANITY)) + { + uint32 stack = aur->GetStackAmount() + 20; + if (stack > 100) + stack = 100; + pPlayer->SetAuraStack(SPELL_SANITY, pPlayer, stack); + } + } + } + sanityTimer = 2000; + } + else sanityTimer -= uiDiff; + } + }; + +}; + + +class npc_ys_thorim : public CreatureScript +{ +public: + npc_ys_thorim() : CreatureScript("npc_ys_thorim") { } + + CreatureAI* GetAI(Creature* pCreature) const + { + return new npc_ys_thorim_AI (pCreature); + } + + struct npc_ys_thorim_AI : public ScriptedAI + { + npc_ys_thorim_AI(Creature* pCreature) : ScriptedAI(pCreature) + { + me->ApplySpellImmune(0, IMMUNITY_ID, SPELL_RESILIENCE_OF_NATURE, true); + me->ApplySpellImmune(0, IMMUNITY_ID, SPELL_SPEED_OF_INVENTION, true); + me->ApplySpellImmune(0, IMMUNITY_ID, SPELL_FORTITUDE_OF_FROST, true); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_NON_ATTACKABLE); + me->SetReactState(REACT_PASSIVE); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!UpdateVictim() || me->HasUnitState(UNIT_STAT_CASTING)) + return; + + if (!me->HasAura(SPELL_FURY_OF_THE_STORMS)) + DoCast(me, SPELL_FURY_OF_THE_STORMS); + + if (!me->HasAura(SPELL_TITANIC_STORM) && phase == PHASE_3) + DoCast(me, SPELL_TITANIC_STORM); + } + }; + +}; + +class npc_ys_mimiron : public CreatureScript +{ +public: + npc_ys_mimiron() : CreatureScript("npc_ys_mimiron") { } + + CreatureAI* GetAI(Creature* pCreature) const + { + return new npc_ys_mimiron_AI (pCreature); + } + + struct npc_ys_mimiron_AI : public ScriptedAI + { + npc_ys_mimiron_AI(Creature* pCreature) : ScriptedAI(pCreature) + { + me->ApplySpellImmune(0, IMMUNITY_ID, SPELL_RESILIENCE_OF_NATURE, true); + me->ApplySpellImmune(0, IMMUNITY_ID, SPELL_FURY_OF_THE_STORMS, true); + me->ApplySpellImmune(0, IMMUNITY_ID, SPELL_FORTITUDE_OF_FROST, true); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_NON_ATTACKABLE); + me->SetReactState(REACT_PASSIVE); + } + + uint32 DestabilizeTimer; + + void Reset() + { + DestabilizeTimer = 15000; + } + + void UpdateAI(const uint32 uiDiff) + { + if (!UpdateVictim()) + return; + + if (!me->HasAura(SPELL_SPEED_OF_INVENTION)) + DoCast(me, SPELL_SPEED_OF_INVENTION); + + if (DestabilizeTimer <= uiDiff) + { + //if (phase == PHASE_2) + //DoCast(SPELL_DESTABILIZATION); + DestabilizeTimer = 45000; + } + else DestabilizeTimer -= uiDiff; + } + }; + +}; + +class npc_ys_hodir : public CreatureScript +{ +public: + npc_ys_hodir() : CreatureScript("npc_ys_hodir") { } + + CreatureAI* GetAI(Creature* pCreature) const + { + return new npc_ys_hodir_AI (pCreature); + } + + struct npc_ys_hodir_AI : public ScriptedAI + { + npc_ys_hodir_AI(Creature* pCreature) : ScriptedAI(pCreature) + { + me->ApplySpellImmune(0, IMMUNITY_ID, SPELL_RESILIENCE_OF_NATURE, true); + me->ApplySpellImmune(0, IMMUNITY_ID, SPELL_FURY_OF_THE_STORMS, true); + me->ApplySpellImmune(0, IMMUNITY_ID, SPELL_SPEED_OF_INVENTION, true); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_NON_ATTACKABLE); + me->SetReactState(REACT_PASSIVE); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!UpdateVictim()) + return; + + if (!me->HasAura(SPELL_FORTITUDE_OF_FROST)) + DoCast(me, SPELL_FORTITUDE_OF_FROST); + } + }; + +}; + +class OrientationCheck +{ + public: + explicit OrientationCheck(Unit* _caster) : caster(_caster) { } + + bool operator() (Unit* unit) + { + return !unit->isInFront(caster, 40.0f, 2.5f); + } + + private: + Unit* caster; +}; + +class spell_yoggsaron_lunatic_gaze : public SpellScriptLoader +{ + public: + spell_yoggsaron_lunatic_gaze() : SpellScriptLoader("spell_yoggsaron_lunatic_gaze") { } + + class spell_yoggsaron_lunatic_gaze_SpellScript : public SpellScript + { + PrepareSpellScript(spell_yoggsaron_lunatic_gaze_SpellScript); + + void FilterTargets(std::list& unitList) + { + unitList.remove_if(OrientationCheck(GetCaster())); + } + + void Register() + { + OnUnitTargetSelect += SpellUnitTargetFn(spell_yoggsaron_lunatic_gaze_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_AREA_ENEMY_SRC); + OnUnitTargetSelect += SpellUnitTargetFn(spell_yoggsaron_lunatic_gaze_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_AREA_ENEMY_SRC); + } + }; + + SpellScript *GetSpellScript() const + { + return new spell_yoggsaron_lunatic_gaze_SpellScript(); + } +}; + +class IllusionRoomCheck +{ + public: + bool operator() (Unit* unit) + { + return !unit->HasAura(SPELL_ILLUSION_ROOM); + } +}; + +class spell_yoggsaron_induce_madness : public SpellScriptLoader +{ + public: + spell_yoggsaron_induce_madness() : SpellScriptLoader("spell_yoggsaron_induce_madness") { } + + class spell_yoggsaron_induce_madness_SpellScript : public SpellScript + { + PrepareSpellScript(spell_yoggsaron_induce_madness_SpellScript); + + void FilterTargets(std::list& unitList) + { + unitList.remove_if(IllusionRoomCheck()); + } + + void Register() + { + OnUnitTargetSelect += SpellUnitTargetFn(spell_yoggsaron_induce_madness_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_AREA_ENTRY_SRC); + } + }; + + SpellScript *GetSpellScript() const + { + return new spell_yoggsaron_induce_madness_SpellScript(); + } +}; + +void AddSC_boss_yoggsaron() +{ + new boss_sara(); + new boss_yoggsaron(); + new boss_brain_yoggsaron(); + new npc_ominous_cloud(); + new npc_guardian_yoggsaron(); + new npc_death_orb(); + new npc_laughing_skull(); + new npc_illusion(); + new npc_descend_into_madness(); + new npc_passive_illusion(); + new npc_crusher_tentacle(); + new npc_constrictor_tentacle(); + new npc_corruptor_tentacle(); + new npc_immortal_guardian(); + new npc_keeper_image(); + new npc_ys_freya(); + new npc_sanity_well(); + new npc_ys_thorim(); + new npc_ys_mimiron(); + new npc_ys_hodir(); + new spell_yoggsaron_lunatic_gaze(); + new spell_yoggsaron_induce_madness(); +} diff --git a/src/server/scripts/Northrend/Ulduar/ulduar/instance_ulduar.cpp b/src/server/scripts/Northrend/Ulduar/ulduar/instance_ulduar.cpp index 0e17e2c86b8fc..5c87b24fe70b3 100644 --- a/src/server/scripts/Northrend/Ulduar/ulduar/instance_ulduar.cpp +++ b/src/server/scripts/Northrend/Ulduar/ulduar/instance_ulduar.cpp @@ -245,11 +245,12 @@ class instance_ulduar : public InstanceMapScript return; } - // Hodir: Alliance npcs are spawned by default + // Some npcs are faction dependent if (TeamInInstance == HORDE) { switch(pCreature->GetEntry()) { + case 33062: pCreature->SetDisplayId(25871); return; case 33325: pCreature->UpdateEntry(32941, HORDE); return; case 32901: pCreature->UpdateEntry(33333, HORDE); return; case 33328: pCreature->UpdateEntry(33332, HORDE); return; @@ -258,7 +259,7 @@ class instance_ulduar : public InstanceMapScript case 33327: pCreature->UpdateEntry(32946, HORDE); return; case 32897: pCreature->UpdateEntry(32948, HORDE); return; case 33326: pCreature->UpdateEntry(33330, HORDE); return; - case 32908: pCreature->UpdateEntry(32907, HORDE); return; + case 32907: pCreature->UpdateEntry(32908, HORDE); return; case 32885: pCreature->UpdateEntry(32883, HORDE); return; } } 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 96e2a2c3d248e..a32c68fdf3bec 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 @@ -242,7 +242,7 @@ class boss_ingvar_the_plunderer : public CreatureScript if (!me->HasUnitState(UNIT_STAT_CASTING)) { // Spawn target for Axe - Unit *pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO, 1); + Unit *pTarget = SelectTarget(SELECT_TARGET_TOPAGGRO, 1); if (pTarget) { me->SummonCreature(ENTRY_THROW_TARGET,pTarget->GetPositionX(),pTarget->GetPositionY(),pTarget->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,2000); @@ -272,7 +272,6 @@ class boss_ingvar_the_plunderer : public CreatureScript }; - enum eSpells { //we don't have that text in db so comment it until we get this text @@ -392,7 +391,6 @@ class mob_annhylde_the_caller : public CreatureScript }; }; - enum eShadowAxe { SPELL_SHADOW_AXE_DAMAGE = 42750, @@ -445,7 +443,6 @@ class mob_ingvar_throw_dummy : public CreatureScript }; - void AddSC_boss_ingvar_the_plunderer() { new boss_ingvar_the_plunderer(); diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_keleseth.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_keleseth.cpp index 4b4a365bd1fe1..1e874b3d5eee3 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_keleseth.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_keleseth.cpp @@ -205,7 +205,7 @@ class boss_keleseth : public CreatureScript if (ShadowboltTimer <= diff) { - Unit *pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO, 0); + Unit *pTarget = SelectTarget(SELECT_TARGET_TOPAGGRO, 0); if (pTarget && pTarget->isAlive() && pTarget->GetTypeId() == TYPEID_PLAYER) me->CastSpell(pTarget, DUNGEON_MODE(SPELL_SHADOWBOLT, SPELL_SHADOWBOLT_HEROIC), true); ShadowboltTimer = 10000; @@ -362,9 +362,6 @@ class mob_vrykul_skeleton : public CreatureScript }; - - - void AddSC_boss_keleseth() { new boss_keleseth(); 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 ed0eaafe7c3f6..dd5fb2a6c8246 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp @@ -193,7 +193,7 @@ class boss_skarvald_the_constructor : public CreatureScript if (Charge_Timer <= diff) { - DoCast(SelectUnit(SELECT_TARGET_RANDOM, 1), SPELL_CHARGE); + DoCast(SelectTarget(SELECT_TARGET_RANDOM, 1), SPELL_CHARGE); Charge_Timer = 5000+rand()%5000; } else Charge_Timer -= diff; @@ -209,7 +209,6 @@ class boss_skarvald_the_constructor : public CreatureScript }; - class boss_dalronn_the_controller : public CreatureScript { public: @@ -365,7 +364,7 @@ class boss_dalronn_the_controller : public CreatureScript { if (!me->IsNonMeleeSpellCasted(false)) { - DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_SHADOW_BOLT); + DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0), SPELL_SHADOW_BOLT); ShadowBolt_Timer = 2100;//give a 100ms pause to try cast other spells } } else ShadowBolt_Timer -= diff; @@ -374,7 +373,7 @@ class boss_dalronn_the_controller : public CreatureScript { if (!me->IsNonMeleeSpellCasted(false)) { - DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_DEBILITATE); + DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0), SPELL_DEBILITATE); Debilitate_Timer = 5000+rand()%5000; } } else Debilitate_Timer -= diff; @@ -397,7 +396,6 @@ class boss_dalronn_the_controller : public CreatureScript }; - void AddSC_boss_skarvald_dalronn() { new boss_skarvald_the_constructor(); 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 44a0182eeb6ad..6b2443b8d72d5 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/instance_utgarde_keep.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/instance_utgarde_keep.cpp @@ -118,7 +118,7 @@ class instance_utgarde_keep : public InstanceMapScript } } - sLog->outDebug("TSCR: Instance Utgarde Keep: GetPlayerInMap, but PlayerList is empty!"); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Utgarde Keep: GetPlayerInMap, but PlayerList is empty!"); return NULL; } @@ -308,7 +308,6 @@ class instance_utgarde_keep : public InstanceMapScript }; - void AddSC_instance_utgarde_keep() { new instance_utgarde_keep(); diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp index 4ac6863e303c1..5f3a93e0d57ab 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp @@ -155,7 +155,6 @@ class npc_dragonflayer_forge_master : public CreatureScript }; - void AddSC_utgarde_keep() { new npc_dragonflayer_forge_master(); diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp index 41ff2f1e19100..04d7a38b4c008 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp @@ -276,7 +276,6 @@ class boss_palehoof : public CreatureScript }; - //ravenous furbolg's spells enum RavenousSpells { @@ -390,7 +389,6 @@ class mob_ravenous_furbolg : public CreatureScript }; - //frenzied worgen's spells enum FrenziedSpells { @@ -506,7 +504,6 @@ class mob_frenzied_worgen : public CreatureScript }; - //ferocious rhino's spells enum FerociousSpells { @@ -622,7 +619,6 @@ class mob_ferocious_rhino : public CreatureScript }; - //massive jormungar's spells enum MassiveSpells { diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp index 82f2ab743317e..fefe785675f95 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp @@ -256,7 +256,7 @@ class boss_skadi : public CreatureScript case CREATURE_YMIRJAR_HARPOONER: pSummoned->setActive(true); pSummoned->SetInCombatWithZone(); - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) pSummoned->AI()->AttackStart(pTarget); break; case CREATURE_TRIGGER: @@ -301,7 +301,6 @@ class boss_skadi : public CreatureScript } } - void UpdateAI(const uint32 diff) { switch(Phase) @@ -475,7 +474,6 @@ class go_harpoon_launcher : public GameObjectScript }; - void AddSC_boss_skadi() { new boss_skadi(); diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_ymiron.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_ymiron.cpp index 55cd747b245b7..16caa1adadb62 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_ymiron.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_ymiron.cpp @@ -300,7 +300,7 @@ class boss_ymiron : public CreatureScript //DoCast(me, SPELL_SUMMON_AVENGING_SPIRIT); // works fine, but using summon has better control if (Creature* pTemp = me->SummonCreature(CREATURE_AVENGING_SPIRIT, x + rand() % 10, y + rand() % 10, z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000)) { - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) { pTemp->AddThreat(pTarget, 0.0f); pTemp->AI()->AttackStart(pTarget); diff --git a/src/server/scripts/Northrend/VaultOfArchavon/boss_archavon.cpp b/src/server/scripts/Northrend/VaultOfArchavon/boss_archavon.cpp index 5f2ce3ca2705f..7e7cdc01d22e9 100644 --- a/src/server/scripts/Northrend/VaultOfArchavon/boss_archavon.cpp +++ b/src/server/scripts/Northrend/VaultOfArchavon/boss_archavon.cpp @@ -89,12 +89,12 @@ class boss_archavon : public CreatureScript switch (eventId) { case EVENT_ROCK_SHARDS: - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(target, SPELL_ROCK_SHARDS); events.ScheduleEvent(EVENT_ROCK_SHARDS, 15000); break; case EVENT_CHOKING_CLOUD: - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(target, SPELL_CRUSHING_LEAP, true); //10y~80y, ignore range events.ScheduleEvent(EVENT_CHOKING_CLOUD, 30000); break; @@ -169,7 +169,7 @@ class mob_archavon_warder : public CreatureScript switch (eventId) { case EVENT_ROCK_SHOWER: - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(target, SPELL_ROCK_SHOWER); events.ScheduleEvent(EVENT_ROCK_SHARDS, 6000); break; diff --git a/src/server/scripts/Northrend/VaultOfArchavon/boss_emalon.cpp b/src/server/scripts/Northrend/VaultOfArchavon/boss_emalon.cpp index e06c4018f0f5c..9f4a2eb0192c9 100644 --- a/src/server/scripts/Northrend/VaultOfArchavon/boss_emalon.cpp +++ b/src/server/scripts/Northrend/VaultOfArchavon/boss_emalon.cpp @@ -128,7 +128,7 @@ class boss_emalon : public CreatureScript switch (eventId) { case EVENT_CHAIN_LIGHTNING: - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(target, SPELL_CHAIN_LIGHTNING); events.ScheduleEvent(EVENT_CHAIN_LIGHTNING, 25000); break; diff --git a/src/server/scripts/Northrend/VaultOfArchavon/boss_koralon.cpp b/src/server/scripts/Northrend/VaultOfArchavon/boss_koralon.cpp index 9a25c5a59619b..1c0fe3e0ae8aa 100644 --- a/src/server/scripts/Northrend/VaultOfArchavon/boss_koralon.cpp +++ b/src/server/scripts/Northrend/VaultOfArchavon/boss_koralon.cpp @@ -20,17 +20,17 @@ enum Events { + EVENT_NULL, // Koralon - EVENT_BURNING_BREATH = 1, - EVENT_BURNING_FURY = 2, - EVENT_FLAME_CINDER_A = 3, - EVENT_METEOR_FISTS_A = 4, - EVENT_METEOR_FISTS_B = 5, + EVENT_BURNING_BREATH, + EVENT_BURNING_FURY, + EVENT_FLAME_CINDER, + EVENT_METEOR_FISTS, // Flame Warder - EVENT_FW_LAVA_BIRST = 6, - EVENT_FW_METEOR_FISTS_A = 7, - EVENT_FW_METEOR_FISTS_B = 8, + EVENT_FW_LAVA_BIRST, + EVENT_FW_METEOR_FISTS_A, + EVENT_FW_METEOR_FISTS_B, }; enum Spells @@ -38,10 +38,9 @@ enum Spells // Spells Koralon SPELL_BURNING_BREATH = 66665, SPELL_BURNING_FURY = 66721, - SPELL_FLAME_CINDER_A = 66684, + SPELL_FLAME_CINDER = 66684, SPELL_FLAME_CINDER_B = 66681, // don't know the real relation to SPELL_FLAME_CINDER_A atm. - SPELL_METEOR_FISTS_A = 66725, - SPELL_METEOR_FISTS_B = 67333, + SPELL_METEOR_FISTS = 66725, // Spells Flame Warder SPELL_FW_LAVA_BIRST = 66813, @@ -49,6 +48,8 @@ enum Spells SPELL_FW_METEOR_FISTS_B = 67331, }; +#define EMOTE_METEOR_FISTS "Koralon the Flame Watcher casts Meteor Fists!" + class boss_koralon : public CreatureScript { public: @@ -62,14 +63,14 @@ class boss_koralon : public CreatureScript void EnterCombat(Unit* /*who*/) { - DoCast(me, SPELL_BURNING_FURY); + _EnterCombat(); - events.ScheduleEvent(EVENT_BURNING_FURY, 20000); // TODO check timer - events.ScheduleEvent(EVENT_BURNING_BREATH, 15000); // 1st after 15sec, then every 45sec - events.ScheduleEvent(EVENT_METEOR_FISTS_A, 75000); // 1st after 75sec, then every 45sec - events.ScheduleEvent(EVENT_FLAME_CINDER_A, 30000); // TODO check timer + DoCast(me, SPELL_BURNING_FURY); - _EnterCombat(); + events.ScheduleEvent(EVENT_BURNING_FURY, 20000); + events.ScheduleEvent(EVENT_BURNING_BREATH, 15000); + events.ScheduleEvent(EVENT_METEOR_FISTS, 35000); + events.ScheduleEvent(EVENT_FLAME_CINDER, 25000); } void UpdateAI(const uint32 diff) @@ -94,17 +95,14 @@ class boss_koralon : public CreatureScript DoCast(me, SPELL_BURNING_BREATH); events.ScheduleEvent(EVENT_BURNING_BREATH, 45000); break; - case EVENT_METEOR_FISTS_A: - DoCast(me, SPELL_METEOR_FISTS_A); - events.ScheduleEvent(EVENT_METEOR_FISTS_B, 1500); - break; - case EVENT_METEOR_FISTS_B: - DoCast(me, SPELL_METEOR_FISTS_B); - events.ScheduleEvent(EVENT_METEOR_FISTS_A, 45000); + case EVENT_METEOR_FISTS: + DoCast(me, SPELL_METEOR_FISTS); + me->MonsterTextEmote(EMOTE_METEOR_FISTS, 0, true); + events.ScheduleEvent(EVENT_METEOR_FISTS, 45000); break; - case EVENT_FLAME_CINDER_A: - DoCast(me, SPELL_FLAME_CINDER_A); - events.ScheduleEvent(EVENT_FLAME_CINDER_A, 30000); + case EVENT_FLAME_CINDER: + DoCast(me, SPELL_FLAME_CINDER); + events.ScheduleEvent(EVENT_FLAME_CINDER, 25000); break; default: break; @@ -189,8 +187,58 @@ class mob_flame_warder : public CreatureScript } }; +class spell_koralon_meteor_fists : public SpellScriptLoader +{ + public: + spell_koralon_meteor_fists() : SpellScriptLoader("spell_koralon_meteor_fists") { } + + class spell_koralon_meteor_fists_SpellScript : public SpellScript + { + PrepareSpellScript(spell_koralon_meteor_fists_SpellScript); + + uint32 totalTargets; + + void FilterTargets(std::list& unitList) + { + totalTargets = NULL; + for (std::list::iterator itr = unitList.begin() ; itr != unitList.end(); ++itr) + { + Unit *target = (*itr); + if (!target) + continue; + + if (!target->IsWithinDist(GetTargetUnit(), 10.0f)) + { + unitList.remove(target); + continue; + } + + totalTargets++; + } + } + + void CalculateSplitDamage() + { + if (totalTargets) + SetHitDamage(GetHitDamage() / totalTargets); + } + + void Register() + { + OnUnitTargetSelect += SpellUnitTargetFn(spell_koralon_meteor_fists_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_TARGET_ENEMY); + OnHit += SpellHitFn(spell_koralon_meteor_fists_SpellScript::CalculateSplitDamage); + } + }; + + SpellScript *GetSpellScript() const + { + return new spell_koralon_meteor_fists_SpellScript(); + } +}; + void AddSC_boss_koralon() { new boss_koralon(); new mob_flame_warder(); + new spell_koralon_meteor_fists(); } diff --git a/src/server/scripts/Northrend/VaultOfArchavon/boss_toravon.cpp b/src/server/scripts/Northrend/VaultOfArchavon/boss_toravon.cpp index 6213a1cd82ccc..6041c0dca15cb 100644 --- a/src/server/scripts/Northrend/VaultOfArchavon/boss_toravon.cpp +++ b/src/server/scripts/Northrend/VaultOfArchavon/boss_toravon.cpp @@ -96,7 +96,7 @@ class boss_toravon : public CreatureScript events.ScheduleEvent(EVENT_WHITEOUT, 38000); break; case EVENT_FREEZING_GROUND: - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1)) + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1)) DoCast(target, SPELL_FREEZING_GROUND); events.ScheduleEvent(EVENT_FREEZING_GROUND, 20000); break; diff --git a/src/server/scripts/Northrend/VioletHold/boss_cyanigosa.cpp b/src/server/scripts/Northrend/VioletHold/boss_cyanigosa.cpp index 6387cfc872794..31ca69c11c3ca 100644 --- a/src/server/scripts/Northrend/VioletHold/boss_cyanigosa.cpp +++ b/src/server/scripts/Northrend/VioletHold/boss_cyanigosa.cpp @@ -159,7 +159,6 @@ class boss_cyanigosa : public CreatureScript }; - void AddSC_boss_cyanigosa() { new boss_cyanigosa(); diff --git a/src/server/scripts/Northrend/VioletHold/boss_erekem.cpp b/src/server/scripts/Northrend/VioletHold/boss_erekem.cpp index 78e6404c7530d..1e540c0922017 100644 --- a/src/server/scripts/Northrend/VioletHold/boss_erekem.cpp +++ b/src/server/scripts/Northrend/VioletHold/boss_erekem.cpp @@ -251,7 +251,6 @@ class boss_erekem : public CreatureScript }; - enum GuardSpells { SPELL_GUSHING_WOUND = 39215, @@ -334,7 +333,6 @@ class mob_erekem_guard : public CreatureScript }; - void AddSC_boss_erekem() { new boss_erekem(); diff --git a/src/server/scripts/Northrend/VioletHold/boss_ichoron.cpp b/src/server/scripts/Northrend/VioletHold/boss_ichoron.cpp index 7b8d72194bd0f..b6db8eaf8f6d3 100644 --- a/src/server/scripts/Northrend/VioletHold/boss_ichoron.cpp +++ b/src/server/scripts/Northrend/VioletHold/boss_ichoron.cpp @@ -311,7 +311,6 @@ class boss_ichoron : public CreatureScript } } - void SummonedCreatureDespawn(Creature *pSummoned) { if (pSummoned) @@ -331,7 +330,6 @@ class boss_ichoron : public CreatureScript }; - class mob_ichor_globule : public CreatureScript { public: @@ -396,7 +394,6 @@ class mob_ichor_globule : public CreatureScript }; - void AddSC_boss_ichoron() { new boss_ichoron(); diff --git a/src/server/scripts/Northrend/VioletHold/boss_lavanthor.cpp b/src/server/scripts/Northrend/VioletHold/boss_lavanthor.cpp index 61705af6ed41a..65de6aef578c9 100644 --- a/src/server/scripts/Northrend/VioletHold/boss_lavanthor.cpp +++ b/src/server/scripts/Northrend/VioletHold/boss_lavanthor.cpp @@ -157,7 +157,6 @@ class boss_lavanthor : public CreatureScript }; - void AddSC_boss_lavanthor() { new boss_lavanthor(); diff --git a/src/server/scripts/Northrend/VioletHold/boss_moragg.cpp b/src/server/scripts/Northrend/VioletHold/boss_moragg.cpp index e2f24f22aa048..2ef3a9b6df6e2 100644 --- a/src/server/scripts/Northrend/VioletHold/boss_moragg.cpp +++ b/src/server/scripts/Northrend/VioletHold/boss_moragg.cpp @@ -135,7 +135,6 @@ class boss_moragg : public CreatureScript }; - void AddSC_boss_moragg() { new boss_moragg(); diff --git a/src/server/scripts/Northrend/VioletHold/boss_xevozz.cpp b/src/server/scripts/Northrend/VioletHold/boss_xevozz.cpp index d99ad1830785a..19aea5f876961 100644 --- a/src/server/scripts/Northrend/VioletHold/boss_xevozz.cpp +++ b/src/server/scripts/Northrend/VioletHold/boss_xevozz.cpp @@ -114,7 +114,7 @@ class boss_xevozz : public CreatureScript void JustSummoned(Creature* pSummoned) { pSummoned->SetSpeed(MOVE_RUN, 0.5f); - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) { pSummoned->AddThreat(pTarget, 0.00f); pSummoned->AI()->AttackStart(pTarget); @@ -224,7 +224,6 @@ class boss_xevozz : public CreatureScript }; - class mob_ethereal_sphere : public CreatureScript { public: @@ -302,7 +301,6 @@ class mob_ethereal_sphere : public CreatureScript }; - void AddSC_boss_xevozz() { new boss_xevozz(); diff --git a/src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp b/src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp index 976bc43fb3e25..9ed5d0053214b 100644 --- a/src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp +++ b/src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp @@ -133,7 +133,7 @@ class boss_zuramat : public CreatureScript if (SpellVoidShiftTimer <= diff) { - if (Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* pUnit = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(pUnit, SPELL_VOID_SHIFT); SpellVoidShiftTimer = 20000; } else SpellVoidShiftTimer -=diff; @@ -184,7 +184,6 @@ class boss_zuramat : public CreatureScript }; - void AddSC_boss_zuramat() { new boss_zuramat(); diff --git a/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp b/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp index a0d5eb3d173df..ebc634422e1ed 100644 --- a/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp +++ b/src/server/scripts/Northrend/VioletHold/instance_violet_hold.cpp @@ -798,18 +798,20 @@ class instance_violet_hold : public InstanceMapScript void ProcessEvent(GameObject* /*pGO*/, uint32 uiEventId) { - switch(uiEventId) + switch (uiEventId) { case EVENT_ACTIVATE_CRYSTAL: bCrystalActivated = true; // Activation by player's will throw event signal ActivateCrystal(); break; } - } + } + void ProcessEvent(Unit* /*unit*/, uint32 /*eventId*/) + { + } + }; }; -}; - void AddSC_instance_violet_hold() { diff --git a/src/server/scripts/Northrend/VioletHold/violet_hold.cpp b/src/server/scripts/Northrend/VioletHold/violet_hold.cpp index 012d67f1846d5..cd6a0c66641c9 100644 --- a/src/server/scripts/Northrend/VioletHold/violet_hold.cpp +++ b/src/server/scripts/Northrend/VioletHold/violet_hold.cpp @@ -414,9 +414,6 @@ class npc_sinclari_vh : public CreatureScript }; - - - class mob_azure_saboteur : public CreatureScript { public: @@ -541,7 +538,6 @@ class mob_azure_saboteur : public CreatureScript }; - class npc_teleportation_portal_vh : public CreatureScript { public: diff --git a/src/server/scripts/Northrend/dragonblight.cpp b/src/server/scripts/Northrend/dragonblight.cpp index a2eac46635085..7c86de5eefe83 100644 --- a/src/server/scripts/Northrend/dragonblight.cpp +++ b/src/server/scripts/Northrend/dragonblight.cpp @@ -73,7 +73,6 @@ class npc_alexstrasza_wr_gate : public CreatureScript ## npc_inquisitor_hallard. Quest 12321 ######*/ - enum eInquisitor { NPC_GODFREY = 27577, diff --git a/src/server/scripts/Northrend/storm_peaks.cpp b/src/server/scripts/Northrend/storm_peaks.cpp index 1b1e4f0693960..a8575d72ee7f9 100644 --- a/src/server/scripts/Northrend/storm_peaks.cpp +++ b/src/server/scripts/Northrend/storm_peaks.cpp @@ -674,8 +674,8 @@ class npc_icefang : public CreatureScript { npc_icefangAI(Creature* creature) : npc_escortAI(creature) {} - void AttackStart(Unit* who) {} - void EnterCombat(Unit* who) {} + void AttackStart(Unit* /*who*/) {} + void EnterCombat(Unit* /*who*/) {} void EnterEvadeMode() {} void PassengerBoarded(Unit* who, int8 /*seatId*/, bool apply) @@ -687,11 +687,11 @@ class npc_icefang : public CreatureScript } } - void WaypointReached(uint32 wp) + void WaypointReached(uint32 /*wp*/) { } - void JustDied(Unit* killer) + void JustDied(Unit* /*killer*/) { } diff --git a/src/server/scripts/Northrend/zuldrak.cpp b/src/server/scripts/Northrend/zuldrak.cpp index f7bb246481756..568b9e848a912 100644 --- a/src/server/scripts/Northrend/zuldrak.cpp +++ b/src/server/scripts/Northrend/zuldrak.cpp @@ -102,7 +102,6 @@ class npc_drakuru_shackles : public CreatureScript } }; - CreatureAI *GetAI(Creature *creature) const { return new npc_drakuru_shacklesAI(creature); @@ -647,7 +646,7 @@ class npc_orinoko_tuskbreaker : public CreatureScript if (uiFishyScentTimer <= uiDiff) { - if (Unit *pAffected = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit *pAffected = SelectTarget(SELECT_TARGET_RANDOM,0)) { DoCast(pAffected, SPELL_FISHY_SCENT); AffectedGUID = pAffected->GetGUID(); @@ -768,14 +767,14 @@ class npc_korrak_bloodrager : public CreatureScript if (uiUppercutTimer <= uiDiff) { - if (Unit* pTarget = SelectUnit(SELECT_TARGET_NEAREST, 0)) + if (Unit* pTarget = SelectTarget(SELECT_TARGET_NEAREST, 0)) DoCast(pTarget, SPELL_UPPERCUT); uiUppercutTimer = 12000; } else uiUppercutTimer -= uiDiff; if (uiChargeTimer <= uiDiff) { - if (Unit* pTarget = SelectUnit(SELECT_TARGET_FARTHEST, 0)) + if (Unit* pTarget = SelectTarget(SELECT_TARGET_FARTHEST, 0)) DoCast(pTarget, SPELL_CHARGE); uiChargeTimer = 15000; } else uiChargeTimer -= uiDiff; @@ -876,7 +875,6 @@ class npc_yggdras : public CreatureScript pSummoner->MonsterYell(sText.c_str(),LANG_UNIVERSAL,0); } - if (Player* pPlayer = pKiller->GetCharmerOrOwnerPlayerOrPlayerItself()) { pPlayer->GroupEventHappens(QUEST_AMPHITHEATER_ANGUISH_YGGDRAS_1, pKiller); @@ -985,7 +983,7 @@ class npc_stinkbeard : public CreatureScript if (uiKnockAwayTimer <= uiDiff) { - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) { if (pTarget && pTarget->isAlive()) DoCast(pTarget, SPELL_KNOCK_AWAY); @@ -995,7 +993,7 @@ class npc_stinkbeard : public CreatureScript if (uiStinkyBeardTimer <= uiDiff) { - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) { if (pTarget && pTarget->isAlive()) DoCast(pTarget, SPELL_STINKY_BEARD); 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 f76c99f699e64..f29eae06ad87f 100644 --- a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_exarch_maladaar.cpp +++ b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_exarch_maladaar.cpp @@ -125,7 +125,6 @@ class mob_stolen_soul : public CreatureScript }; - #define SAY_INTRO -1558000 #define SAY_SUMMON -1558001 @@ -260,7 +259,7 @@ class boss_exarch_maladaar : public CreatureScript if (StolenSoul_Timer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) { if (pTarget->GetTypeId() == TYPEID_PLAYER) { @@ -287,7 +286,7 @@ class boss_exarch_maladaar : public CreatureScript if (Ribbon_of_Souls_timer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) DoCast(pTarget, SPELL_RIBBON_OF_SOULS); Ribbon_of_Souls_timer = 5000 + (rand()%20 * 1000); @@ -305,7 +304,6 @@ class boss_exarch_maladaar : public CreatureScript }; - #define SPELL_AV_MORTAL_STRIKE 16856 #define SPELL_AV_SUNDER_ARMOR 16145 @@ -351,7 +349,6 @@ class mob_avatar_of_martyred : public CreatureScript }; - void AddSC_boss_exarch_maladaar() { new boss_exarch_maladaar(); 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 b27d0316b655c..b893f22b32853 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 @@ -136,7 +136,7 @@ class boss_shirrak_the_dead_watcher : public CreatureScript if (FocusFire_Timer <= diff) { // Summon Focus Fire & Emote - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1); + Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,1); if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER && pTarget->isAlive()) { FocusedTargetGUID = pTarget->GetGUID(); @@ -160,7 +160,6 @@ class boss_shirrak_the_dead_watcher : public CreatureScript }; - class mob_focus_fire : public CreatureScript { public: @@ -212,7 +211,6 @@ class mob_focus_fire : public CreatureScript }; - void AddSC_boss_shirrak_the_dead_watcher() { new boss_shirrak_the_dead_watcher(); 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 e67cec43b0eea..72f628c2988b4 100644 --- a/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_nexusprince_shaffar.cpp +++ b/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_nexusprince_shaffar.cpp @@ -128,7 +128,7 @@ class boss_nexusprince_shaffar : public CreatureScript { summoned->CastSpell(summoned,SPELL_ETHEREAL_BEACON_VISUAL,false); - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) summoned->AI()->AttackStart(pTarget); } @@ -215,7 +215,6 @@ class boss_nexusprince_shaffar : public CreatureScript }; - enum eEnums { SPELL_ARCANE_BOLT = 15254, @@ -308,7 +307,6 @@ class mob_ethereal_beacon : public CreatureScript }; - enum eEthereal { SPELL_ETHEREAL_APPRENTICE_FIREBOLT = 32369, @@ -361,7 +359,6 @@ class mob_ethereal_apprentice : public CreatureScript }; - void AddSC_boss_nexusprince_shaffar() { new boss_nexusprince_shaffar(); diff --git a/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_pandemonius.cpp b/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_pandemonius.cpp index ca06fb97e5256..2345ae4c41b9e 100644 --- a/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_pandemonius.cpp +++ b/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_pandemonius.cpp @@ -90,7 +90,7 @@ class boss_pandemonius : public CreatureScript if (VoidBlast_Timer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) { DoCast(pTarget, SPELL_VOID_BLAST); VoidBlast_Timer = 500; @@ -124,7 +124,6 @@ class boss_pandemonius : public CreatureScript }; - void AddSC_boss_pandemonius() { new boss_pandemonius(); 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 3187dcdb2b655..6daae1372fa90 100644 --- a/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_darkweaver_syth.cpp +++ b/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_darkweaver_syth.cpp @@ -112,7 +112,7 @@ class boss_darkweaver_syth : public CreatureScript void JustSummoned(Creature *summoned) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) summoned->AI()->AttackStart(pTarget); } @@ -154,7 +154,7 @@ class boss_darkweaver_syth : public CreatureScript if (flameshock_timer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) DoCast(pTarget, SPELL_FLAME_SHOCK); flameshock_timer = 10000 + rand()%5000; @@ -162,7 +162,7 @@ class boss_darkweaver_syth : public CreatureScript if (arcaneshock_timer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) DoCast(pTarget, SPELL_ARCANE_SHOCK); arcaneshock_timer = 10000 + rand()%5000; @@ -170,7 +170,7 @@ class boss_darkweaver_syth : public CreatureScript if (frostshock_timer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) DoCast(pTarget, SPELL_FROST_SHOCK); frostshock_timer = 10000 + rand()%5000; @@ -178,7 +178,7 @@ class boss_darkweaver_syth : public CreatureScript if (shadowshock_timer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) DoCast(pTarget, SPELL_SHADOW_SHOCK); shadowshock_timer = 10000 + rand()%5000; @@ -186,7 +186,7 @@ class boss_darkweaver_syth : public CreatureScript if (chainlightning_timer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) DoCast(pTarget, SPELL_CHAIN_LIGHTNING); chainlightning_timer = 25000; @@ -198,7 +198,6 @@ class boss_darkweaver_syth : public CreatureScript }; - /* ELEMENTALS */ class mob_syth_fire : public CreatureScript { @@ -230,7 +229,7 @@ class mob_syth_fire : public CreatureScript if (flameshock_timer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) DoCast(pTarget, SPELL_FLAME_SHOCK); flameshock_timer = 5000; @@ -238,7 +237,7 @@ class mob_syth_fire : public CreatureScript if (flamebuffet_timer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) DoCast(pTarget, SPELL_FLAME_BUFFET); flamebuffet_timer = 5000; @@ -289,7 +288,7 @@ class mob_syth_arcane : public CreatureScript if (arcaneshock_timer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) DoCast(pTarget, SPELL_ARCANE_SHOCK); arcaneshock_timer = 5000; @@ -297,7 +296,7 @@ class mob_syth_arcane : public CreatureScript if (arcanebuffet_timer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) DoCast(pTarget, SPELL_ARCANE_BUFFET); arcanebuffet_timer = 5000; @@ -308,7 +307,6 @@ class mob_syth_arcane : public CreatureScript }; }; - class mob_syth_frost : public CreatureScript { public: @@ -344,7 +342,7 @@ class mob_syth_frost : public CreatureScript if (frostshock_timer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) DoCast(pTarget, SPELL_FROST_SHOCK); frostshock_timer = 5000; @@ -352,7 +350,7 @@ class mob_syth_frost : public CreatureScript if (frostbuffet_timer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) DoCast(pTarget, SPELL_FROST_BUFFET); frostbuffet_timer = 5000; @@ -364,7 +362,6 @@ class mob_syth_frost : public CreatureScript }; - class mob_syth_shadow : public CreatureScript { public: @@ -400,7 +397,7 @@ class mob_syth_shadow : public CreatureScript if (shadowshock_timer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) DoCast(pTarget, SPELL_SHADOW_SHOCK); shadowshock_timer = 5000; @@ -408,7 +405,7 @@ class mob_syth_shadow : public CreatureScript if (shadowbuffet_timer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) DoCast(pTarget, SPELL_SHADOW_BUFFET); shadowbuffet_timer = 5000; @@ -420,7 +417,6 @@ class mob_syth_shadow : public CreatureScript }; - void AddSC_boss_darkweaver_syth() { new boss_darkweaver_syth(); 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 8ad78b1aedc72..d19b756a5c7d6 100644 --- a/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_tailonking_ikiss.cpp +++ b/src/server/scripts/Outland/Auchindoun/SethekkHalls/boss_tailonking_ikiss.cpp @@ -155,9 +155,9 @@ class boss_talon_king_ikiss : public CreatureScript //second top aggro target in normal, random target in heroic correct? if (IsHeroic()) - pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); + pTarget = SelectTarget(SELECT_TARGET_RANDOM,0); else - pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO,1); + pTarget = SelectTarget(SELECT_TARGET_TOPAGGRO,1); if (pTarget) DoCast(pTarget, SPELL_POLYMORPH); @@ -184,7 +184,7 @@ class boss_talon_king_ikiss : public CreatureScript { DoScriptText(EMOTE_ARCANE_EXP, me); - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) { if (me->IsNonMeleeSpellCasted(false)) me->InterruptNonMeleeSpells(false); @@ -211,7 +211,6 @@ class boss_talon_king_ikiss : public CreatureScript }; - void AddSC_boss_talon_king_ikiss() { new boss_talon_king_ikiss(); 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 6280145aaa56b..93a4abd848534 100644 --- a/src/server/scripts/Outland/Auchindoun/SethekkHalls/instance_sethekk_halls.cpp +++ b/src/server/scripts/Outland/Auchindoun/SethekkHalls/instance_sethekk_halls.cpp @@ -89,7 +89,6 @@ class instance_sethekk_halls : public InstanceMapScript }; - void AddSC_instance_sethekk_halls() { new instance_sethekk_halls(); 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 1a479ce7658fa..de106876d15b8 100644 --- a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_ambassador_hellmaw.cpp +++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_ambassador_hellmaw.cpp @@ -204,7 +204,6 @@ class boss_ambassador_hellmaw : public CreatureScript }; - void AddSC_boss_ambassador_hellmaw() { new boss_ambassador_hellmaw(); 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 27857f34e9976..984a55f2a44ac 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 @@ -150,7 +150,7 @@ class boss_blackheart_the_inciter : public CreatureScript //Charge_Timer if (Charge_Timer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(pTarget, SPELL_CHARGE); Charge_Timer = 15000 + rand()%10000; } else Charge_Timer -= diff; diff --git a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_murmur.cpp b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_murmur.cpp index 1f72046ad710c..c583349ca67cb 100644 --- a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_murmur.cpp +++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_murmur.cpp @@ -149,7 +149,7 @@ class boss_murmur : public CreatureScript // Magnetic Pull if (MagneticPull_Timer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) if (pTarget->GetTypeId() == TYPEID_PLAYER && pTarget->isAlive()) { DoCast(pTarget, SPELL_MAGNETIC_PULL); @@ -203,7 +203,6 @@ class boss_murmur : public CreatureScript }; - void AddSC_boss_murmur() { new boss_murmur(); 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 d3844202f6ad7..f3f3fe7dabd02 100644 --- a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/instance_shadow_labyrinth.cpp +++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/instance_shadow_labyrinth.cpp @@ -108,7 +108,7 @@ class instance_shadow_labyrinth : public InstanceMapScript if (creature->isAlive()) { ++m_uiFelOverseerCount; - sLog->outDebug("TSCR: Shadow Labyrinth: counting %u Fel Overseers.",m_uiFelOverseerCount); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Shadow Labyrinth: counting %u Fel Overseers.",m_uiFelOverseerCount); } break; } @@ -133,11 +133,11 @@ class instance_shadow_labyrinth : public InstanceMapScript --m_uiFelOverseerCount; if (m_uiFelOverseerCount) - sLog->outDebug("TSCR: Shadow Labyrinth: %u Fel Overseers left to kill.",m_uiFelOverseerCount); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Shadow Labyrinth: %u Fel Overseers left to kill.",m_uiFelOverseerCount); else { m_auiEncounter[1] = DONE; - sLog->outDebug("TSCR: Shadow Labyrinth: TYPE_OVERSEER == DONE"); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Shadow Labyrinth: TYPE_OVERSEER == DONE"); } } break; @@ -225,7 +225,6 @@ class instance_shadow_labyrinth : public InstanceMapScript }; - void AddSC_instance_shadow_labyrinth() { new instance_shadow_labyrinth(); diff --git a/src/server/scripts/Outland/BlackTemple/black_temple.cpp b/src/server/scripts/Outland/BlackTemple/black_temple.cpp index 6840c73253128..7936745263831 100644 --- a/src/server/scripts/Outland/BlackTemple/black_temple.cpp +++ b/src/server/scripts/Outland/BlackTemple/black_temple.cpp @@ -66,7 +66,6 @@ class npc_spirit_of_olum : public CreatureScript }; - void AddSC_black_temple() { new npc_spirit_of_olum(); diff --git a/src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp b/src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp index c81f12f211427..b2a7ff4287f0f 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp @@ -228,7 +228,7 @@ class boss_gurtogg_bloodboil : public CreatureScript { DoCast(me->getVictim(), SPELL_BEWILDERING_STRIKE); float mt_threat = DoGetThreat(me->getVictim()); - if (Unit *pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO, 1)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_TOPAGGRO, 1)) me->AddThreat(pTarget, mt_threat); BewilderingStrikeTimer = 20000; } else BewilderingStrikeTimer -= diff; @@ -277,7 +277,7 @@ class boss_gurtogg_bloodboil : public CreatureScript { if (Phase1) { - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0); if (pTarget && pTarget->isAlive()) { Phase1 = false; @@ -330,7 +330,6 @@ class boss_gurtogg_bloodboil : public CreatureScript }; - void AddSC_boss_gurtogg_bloodboil() { new boss_gurtogg_bloodboil(); diff --git a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp index 3fa1f349bc0fb..3c3752c7c0b09 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp @@ -411,7 +411,7 @@ class mob_flame_of_azzinoth : public CreatureScript Glaive->InterruptNonMeleeSpells(true); DoCast(me, SPELL_FLAME_ENRAGE, true); DoResetThreat(); - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0); if (pTarget && pTarget->isAlive()) { me->AddThreat(me->getVictim(), 5000000.0f); @@ -1055,7 +1055,7 @@ class boss_illidan_stormrage : public CreatureScript //PHASE_NORMAL_2 case EVENT_AGONIZING_FLAMES: - DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_AGONIZING_FLAMES); + DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0), SPELL_AGONIZING_FLAMES); Timer[EVENT_AGONIZING_FLAMES] = 0; break; @@ -1080,12 +1080,12 @@ class boss_illidan_stormrage : public CreatureScript switch(Event) { case EVENT_FIREBALL: - DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_FIREBALL); + DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0), SPELL_FIREBALL); Timer[EVENT_FIREBALL] = 3000; break; case EVENT_DARK_BARRAGE: - DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_DARK_BARRAGE); + DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0), SPELL_DARK_BARRAGE); Timer[EVENT_DARK_BARRAGE] = 0; break; @@ -1271,7 +1271,7 @@ class boss_maiev_shadowsong : public CreatureScript { if (GETCRE(Illidan, IllidanGUID)) { - Unit *pTarget = CAST_AI(boss_illidan_stormrage::boss_illidan_stormrageAI, Illidan->AI())->SelectUnit(SELECT_TARGET_RANDOM, 0); + Unit *pTarget = Illidan->AI()->SelectTarget(SELECT_TARGET_RANDOM, 0); if (!pTarget || !me->IsWithinDistInMap(pTarget, 80) || Illidan->IsWithinDistInMap(pTarget, 20)) { diff --git a/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp b/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp index 51637085bf1c3..c996a3ea35aef 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp @@ -165,7 +165,7 @@ class boss_mother_shahraz : public CreatureScript float Z = TeleportPoint[random].z; for (uint8 i = 0; i < 3; ++i) { - Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 1); + Unit* pUnit = SelectTarget(SELECT_TARGET_RANDOM, 1); if (pUnit && pUnit->isAlive() && (pUnit->GetTypeId() == TYPEID_PLAYER)) { TargetGUID[i] = pUnit->GetGUID(); @@ -190,7 +190,7 @@ class boss_mother_shahraz : public CreatureScript //Randomly cast one beam. if (BeamTimer <= diff) { - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0); if (!pTarget || !pTarget->isAlive()) return; @@ -302,7 +302,6 @@ class boss_mother_shahraz : public CreatureScript }; - void AddSC_boss_mother_shahraz() { new boss_mother_shahraz(); 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 30889ff69adfa..732f35c22a756 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp @@ -199,7 +199,7 @@ class boss_reliquary_of_souls : public CreatureScript float y = Coords[random].y; Creature* Soul = me->SummonCreature(CREATURE_ENSLAVED_SOUL, x, y, me->GetPositionZ(), me->GetOrientation(), TEMPSUMMON_CORPSE_DESPAWN, 0); if (!Soul) return false; - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) { CAST_AI(npc_enslaved_soul::npc_enslaved_soulAI, Soul->AI())->ReliquaryGUID = me->GetGUID(); Soul->AI()->AttackStart(pTarget); @@ -274,7 +274,7 @@ class boss_reliquary_of_souls : public CreatureScript if (Creature* Summon = DoSpawnCreature(23417+Phase, 0, 0, 0, 0, TEMPSUMMON_DEAD_DESPAWN, 0)) { me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_SUBMERGED); // Ribs: open - Summon->AI()->AttackStart(SelectUnit(SELECT_TARGET_TOPAGGRO, 0)); + Summon->AI()->AttackStart(SelectTarget(SELECT_TARGET_TOPAGGRO, 0)); EssenceGUID = Summon->GetGUID(); DoStartNoMovement(me); } else EnterEvadeMode(); @@ -482,7 +482,7 @@ class boss_essence_of_suffering : public CreatureScript if (SoulDrainTimer <= diff) { - DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_SOUL_DRAIN); + DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0), SPELL_SOUL_DRAIN); SoulDrainTimer = 60000; } else SoulDrainTimer -= diff; @@ -696,13 +696,6 @@ class boss_essence_of_anger : public CreatureScript }; - - - - - - - void AddSC_boss_reliquary_of_souls() { new boss_reliquary_of_souls(); 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 c7a781f826237..f7f31ca08c184 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp @@ -331,7 +331,7 @@ class boss_shade_of_akama : public CreatureScript if (reseting) return; - sLog->outDebug("TSCR: Increasing Death Count for Shade of Akama encounter"); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Increasing Death Count for Shade of Akama encounter"); ++DeathCount; me->RemoveAuraFromStack(SPELL_SHADE_SOUL_CHANNEL_2); if (guid) @@ -371,7 +371,7 @@ class boss_shade_of_akama : public CreatureScript { Spawn->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); Spawn->GetMotionMaster()->MovePoint(0, AGGRO_X, AGGRO_Y, AGGRO_Z); - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1); + Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1); Spawn->AI()->AttackStart(pTarget); } } @@ -389,7 +389,7 @@ class boss_shade_of_akama : public CreatureScript { CAST_AI(mob_ashtongue_channeler::mob_ashtongue_channelerAI, (*itr)->AI())->ShadeGUID = me->GetGUID(); Channelers.push_back((*itr)->GetGUID()); - sLog->outDebug("TSCR: Shade of Akama Grid Search found channeler " UI64FMTD ". Adding to list", (*itr)->GetGUID()); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Shade of Akama Grid Search found channeler " UI64FMTD ". Adding to list", (*itr)->GetGUID()); } } else sLog->outError("SD2 ERROR: Grid Search was unable to find any channelers. Shade of Akama encounter will be buggy"); @@ -881,8 +881,6 @@ class npc_akama_shade : public CreatureScript }; - - void AddSC_boss_shade_of_akama() { new boss_shade_of_akama(); diff --git a/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp b/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp index e344a83501b72..5ff1a565f33d3 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_supremus.cpp @@ -298,9 +298,6 @@ class npc_volcano : public CreatureScript }; - - - void AddSC_boss_supremus() { new boss_supremus(); diff --git a/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp b/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp index 2aa532d0e411e..7ccf85bc82132 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp @@ -106,7 +106,7 @@ class mob_doom_blossom : public CreatureScript if (ShadowBoltTimer < diff && me->isInCombat()) { - DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_SHADOWBOLT); + DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0), SPELL_SHADOWBOLT); ShadowBoltTimer = 10000; } else ShadowBoltTimer -= diff; return; @@ -365,7 +365,7 @@ class boss_teron_gorefiend : public CreatureScript Construct->CastSpell(Construct, SPELL_PASSIVE_SHADOWFORM, true); SetThreatList(Construct); // Use same function as Doom Blossom to set Threat List. CAST_AI(mob_shadowy_construct::mob_shadowy_constructAI, Construct->AI())->GhostGUID = GhostGUID; - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1); + Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1); if (!pTarget) // someone's trying to solo. pTarget = me->getVictim(); @@ -417,7 +417,7 @@ class boss_teron_gorefiend : public CreatureScript Shadow = me->SummonCreature(CREATURE_SHADOWY_CONSTRUCT, X, me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 0); if (Shadow) { - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1); + Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1); if (!pTarget) pTarget = me->getVictim(); @@ -430,7 +430,7 @@ class boss_teron_gorefiend : public CreatureScript if (SummonDoomBlossomTimer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) { float X = CalculateRandomLocation(pTarget->GetPositionX(), 20); float Y = CalculateRandomLocation(pTarget->GetPositionY(), 20); @@ -452,7 +452,7 @@ class boss_teron_gorefiend : public CreatureScript if (IncinerateTimer <= diff) { - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1); + Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1); if (!pTarget) pTarget = me->getVictim(); @@ -466,7 +466,7 @@ class boss_teron_gorefiend : public CreatureScript if (CrushingShadowsTimer <= diff) { - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0); if (pTarget && pTarget->isAlive()) DoCast(pTarget, SPELL_CRUSHING_SHADOWS); CrushingShadowsTimer = 10000 + rand()%16 * 1000; @@ -510,9 +510,6 @@ class boss_teron_gorefiend : public CreatureScript }; - - - void AddSC_boss_teron_gorefiend() { new mob_doom_blossom(); diff --git a/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp b/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp index 285157080d473..299fa50adf401 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp @@ -167,7 +167,7 @@ class boss_najentus : public CreatureScript break; case EVENT_SPINE: { - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1); + Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1); if (!pTarget) pTarget = me->getVictim(); if (pTarget) { @@ -226,7 +226,6 @@ class go_najentus_spine : public GameObjectScript }; - void AddSC_boss_najentus() { new boss_najentus(); diff --git a/src/server/scripts/Outland/BlackTemple/illidari_council.cpp b/src/server/scripts/Outland/BlackTemple/illidari_council.cpp index 195bf936921bd..3b44f115b9394 100644 --- a/src/server/scripts/Outland/BlackTemple/illidari_council.cpp +++ b/src/server/scripts/Outland/BlackTemple/illidari_council.cpp @@ -557,7 +557,7 @@ class boss_gathios_the_shatterer : public CreatureScript if (HammerOfJusticeTimer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) { // is in ~10-40 yd range if (me->IsInRange(pTarget, 10.0f, 40.0f, false)) @@ -670,7 +670,7 @@ class boss_high_nethermancer_zerevor : public CreatureScript if (BlizzardTimer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) { DoCast(pTarget, SPELL_BLIZZARD); BlizzardTimer = 45000 + rand()%46 * 1000; @@ -681,7 +681,7 @@ class boss_high_nethermancer_zerevor : public CreatureScript if (FlamestrikeTimer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) { DoCast(pTarget, SPELL_FLAMESTRIKE); FlamestrikeTimer = 55000 + rand()%46 * 1000; @@ -738,7 +738,7 @@ class boss_lady_malande : public CreatureScript if (EmpoweredSmiteTimer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) { DoCast(pTarget, SPELL_EMPOWERED_SMITE); EmpoweredSmiteTimer = 38000; @@ -753,7 +753,7 @@ class boss_lady_malande : public CreatureScript if (DivineWrathTimer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) { DoCast(pTarget, SPELL_DIVINE_WRATH); DivineWrathTimer = 40000 + rand()%41 * 1000; @@ -838,7 +838,7 @@ class boss_veras_darkshadow : public CreatureScript if (VanishTimer <= diff) // Disappear and stop attacking, but follow a random unit { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) { VanishTimer = 30000; AppearEnvenomTimer= 28000; diff --git a/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp b/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp index 2d8b2a71d2731..3aadb149de60d 100644 --- a/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp +++ b/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp @@ -136,7 +136,7 @@ class instance_black_temple : public InstanceMapScript } } - sLog->outDebug("TSCR: Instance Black Temple: GetPlayerInMap, but PlayerList is empty!"); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Black Temple: GetPlayerInMap, but PlayerList is empty!"); return NULL; } @@ -344,7 +344,6 @@ class instance_black_temple : public InstanceMapScript }; - void AddSC_instance_black_temple() { new instance_black_temple(); 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 cdfada6efde50..6705f4dda018d 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp @@ -249,7 +249,7 @@ class boss_fathomlord_karathress : public CreatureScript if (CataclysmicBolt_Timer <= diff) { //select a random unit other than the main tank - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1); + Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1); //if there aren't other units, cast on the tank if (!pTarget) @@ -444,7 +444,7 @@ class boss_fathomguard_sharkkis : public CreatureScript } //DoCast(me, spell_id, true); Creature *Pet = DoSpawnCreature(pet_id,0,0,0,0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); + Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0); if (Pet && pTarget) { Pet->AI()->AttackStart(pTarget); @@ -695,7 +695,7 @@ class boss_fathomguard_caribdis : public CreatureScript Cyclone->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); Cyclone->setFaction(me->getFaction()); Cyclone->CastSpell(Cyclone, SPELL_CYCLONE_CYCLONE, true); - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0); if (pTarget) { Cyclone->AI()->AttackStart(pTarget); 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 9ac0838898082..d5a6f0d177c6c 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 @@ -262,7 +262,7 @@ class boss_hydross_the_unstable : public CreatureScript //VileSludge_Timer if (VileSludge_Timer <= diff) { - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0); if (pTarget) DoCast(pTarget, SPELL_VILE_SLUDGE); 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 dfe92fd5ad69f..fadd533c65a89 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp @@ -426,7 +426,7 @@ class boss_lady_vashj : public CreatureScript if (Sporebat) { Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0); if (pTarget) Sporebat->AI()->AttackStart(pTarget); } @@ -479,7 +479,7 @@ class boss_lady_vashj : public CreatureScript //Forked Lightning //Used constantly in Phase 2, it shoots out completely randomly targeted bolts of lightning which hit everybody in a roughtly 60 degree cone in front of Vashj for 2313-2687 nature damage. Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0); if (!pTarget) pTarget = me->getVictim(); @@ -520,7 +520,7 @@ class boss_lady_vashj : public CreatureScript if (CoilfangElite) { Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0); if (pTarget) CoilfangElite->AI()->AttackStart(pTarget); else if (me->getVictim()) @@ -538,7 +538,7 @@ class boss_lady_vashj : public CreatureScript if (CoilfangStrider) { Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0); if (pTarget) CoilfangStrider->AI()->AttackStart(pTarget); else if (me->getVictim()) @@ -728,7 +728,7 @@ class mob_tainted_elemental : public CreatureScript if (PoisonBolt_Timer <= diff) { Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0); if (pTarget && pTarget->IsWithinDistInMap(me, 30)) DoCast(pTarget, SPELL_POISON_BOLT); @@ -820,7 +820,7 @@ class mob_toxic_sporebat : public CreatureScript if (bolt_timer <= diff) { Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0); if (pTarget) { Creature* trig = me->SummonCreature(TOXIC_SPORES_TRIGGER,pTarget->GetPositionX(),pTarget->GetPositionY(),pTarget->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,30000); 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 bb2f006c36670..bf91825bae922 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 @@ -420,7 +420,7 @@ class boss_leotheras_the_blind : public CreatureScript { if (Whirlwind_Timer <= diff) { - Unit *newTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + Unit *newTarget = SelectTarget(SELECT_TARGET_RANDOM, 0); if (newTarget) { DoResetThreat(); @@ -760,7 +760,7 @@ class mob_greyheart_spellbinder : public CreatureScript if (Mindblast_Timer <= diff) { Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); + pTarget = SelectTarget(SELECT_TARGET_RANDOM,0); if (pTarget)DoCast(pTarget, SPELL_MINDBLAST); 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 3793a689602ce..b05ed6ff25e8e 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp @@ -299,7 +299,7 @@ class boss_the_lurker_below : public CreatureScript if (GeyserTimer <= diff) { - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1); + Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,1); if (!pTarget && me->getVictim()) pTarget = me->getVictim(); if (pTarget) @@ -311,7 +311,7 @@ class boss_the_lurker_below : public CreatureScript { if (WaterboltTimer <= diff) { - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); + Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0); if (!pTarget && me->getVictim()) pTarget = me->getVictim(); if (pTarget) @@ -454,7 +454,7 @@ class mob_coilfang_ambusher : public CreatureScript if (ShootBowTimer <= diff) { Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0); int bp0 = 1100; if (pTarget) me->CastCustomSpell(pTarget,SPELL_SHOOT,&bp0,NULL,NULL,true); 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 b89fa7af86be1..cf228240c2706 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_morogrim_tidewalker.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_morogrim_tidewalker.cpp @@ -187,7 +187,7 @@ class boss_morogrim_tidewalker : public CreatureScript for (uint8 i = 0; i < 10; ++i) { - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0); Creature* Murloc = me->SummonCreature(NPC_TIDEWALKER_LURKER, MurlocCords[i][0], MurlocCords[i][1], MurlocCords[i][2], MurlocCords[i][3], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); if (pTarget && Murloc) Murloc->AI()->AttackStart(pTarget); @@ -349,7 +349,6 @@ class mob_water_globule : public CreatureScript }; - void AddSC_boss_morogrim_tidewalker() { new boss_morogrim_tidewalker(); 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 e217753c660c9..432eba5ae7047 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/instance_serpent_shrine.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/instance_serpent_shrine.cpp @@ -441,7 +441,6 @@ class instance_serpent_shrine : public InstanceMapScript } }; - void AddSC_instance_serpentshrine_cavern() { new instance_serpent_shrine(); 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 75302367d4c46..a8d7c1ce0b791 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_hydromancer_thespia.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_hydromancer_thespia.cpp @@ -108,12 +108,12 @@ class boss_hydromancer_thespia : public CreatureScript //LightningCloud_Timer if (LightningCloud_Timer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) DoCast(pTarget, SPELL_LIGHTNING_CLOUD); //cast twice in Heroic mode if (IsHeroic()) - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) DoCast(pTarget, SPELL_LIGHTNING_CLOUD); LightningCloud_Timer = 15000+rand()%10000; @@ -122,7 +122,7 @@ class boss_hydromancer_thespia : public CreatureScript //LungBurst_Timer if (LungBurst_Timer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) DoCast(pTarget, SPELL_LUNG_BURST); LungBurst_Timer = 7000+rand()%5000; } else LungBurst_Timer -=diff; @@ -130,12 +130,12 @@ class boss_hydromancer_thespia : public CreatureScript //EnvelopingWinds_Timer if (EnvelopingWinds_Timer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) DoCast(pTarget, SPELL_ENVELOPING_WINDS); //cast twice in Heroic mode if (IsHeroic()) - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) DoCast(pTarget, SPELL_ENVELOPING_WINDS); EnvelopingWinds_Timer = 10000+rand()%5000; } else EnvelopingWinds_Timer -=diff; 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 9058a8640a978..f57d8cb25e986 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_mekgineer_steamrigger.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_mekgineer_steamrigger.cpp @@ -137,7 +137,7 @@ class boss_mekgineer_steamrigger : public CreatureScript if (Saw_Blade_Timer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,1)) DoCast(pTarget, SPELL_SAW_BLADE); else DoCast(me->getVictim(), SPELL_SAW_BLADE); @@ -185,7 +185,6 @@ class boss_mekgineer_steamrigger : public CreatureScript }; - #define SPELL_DISPEL_MAGIC 17201 #define SPELL_REPAIR 31532 #define H_SPELL_REPAIR 37936 @@ -264,7 +263,6 @@ class mob_steamrigger_mechanic : public CreatureScript }; - void AddSC_boss_mekgineer_steamrigger() { new boss_mekgineer_steamrigger(); 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 aa00db8ba0578..e4102fe6b1123 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_warlord_kalithresh.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_warlord_kalithresh.cpp @@ -191,7 +191,7 @@ class boss_warlord_kalithresh : public CreatureScript //Impale_Timer if (Impale_Timer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) DoCast(pTarget, SPELL_IMPALE); Impale_Timer = 7500+rand()%5000; @@ -203,8 +203,6 @@ class boss_warlord_kalithresh : public CreatureScript }; - - void AddSC_boss_warlord_kalithresh() { new mob_naga_distiller(); 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 5eb091e16ee43..5d27df6b3064d 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/instance_steam_vault.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/instance_steam_vault.cpp @@ -138,7 +138,7 @@ class instance_steam_vault : public InstanceMapScript if (GetData(TYPE_MEKGINEER_STEAMRIGGER) == SPECIAL) HandleGameObject(MainChambersDoor, true); - sLog->outDebug("TSCR: Instance Steamvault: Access panel used."); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Steamvault: Access panel used."); } m_auiEncounter[0] = data; break; @@ -150,7 +150,7 @@ class instance_steam_vault : public InstanceMapScript if (GetData(TYPE_HYDROMANCER_THESPIA) == SPECIAL) HandleGameObject(MainChambersDoor, true); - sLog->outDebug("TSCR: Instance Steamvault: Access panel used."); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Steamvault: Access panel used."); } m_auiEncounter[1] = data; break; @@ -230,7 +230,6 @@ class instance_steam_vault : public InstanceMapScript }; - void AddSC_instance_steam_vault() { new go_main_chambers_access_panel(); diff --git a/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_hungarfen.cpp b/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_hungarfen.cpp index 62ec7b400f720..289cbc781a065 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_hungarfen.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_hungarfen.cpp @@ -75,7 +75,7 @@ class boss_hungarfen : public CreatureScript if (Mushroom_Timer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) me->SummonCreature(17990, pTarget->GetPositionX()+(rand()%8), pTarget->GetPositionY()+(rand()%8), pTarget->GetPositionZ(), float(rand()%5), TEMPSUMMON_TIMED_DESPAWN, 22000); else me->SummonCreature(17990, me->GetPositionX()+(rand()%8), me->GetPositionY()+(rand()%8), me->GetPositionZ(), float(rand()%5), TEMPSUMMON_TIMED_DESPAWN, 22000); @@ -85,7 +85,7 @@ class boss_hungarfen : public CreatureScript if (AcidGeyser_Timer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) DoCast(pTarget, SPELL_ACID_GEYSER); AcidGeyser_Timer = 10000+rand()%7500; } else AcidGeyser_Timer -= diff; 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 efec0d2c9a153..92be08c2daefc 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 @@ -80,7 +80,7 @@ class boss_the_black_stalker : public CreatureScript if (summon && summon->GetEntry() == ENTRY_SPORE_STRIDER) { Striders.push_back(summon->GetGUID()); - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,1)) summon->AI()->AttackStart(pTarget); else if (me->getVictim()) @@ -150,7 +150,7 @@ class boss_the_black_stalker : public CreatureScript } if (Levitate_Timer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,1)) { DoCast(pTarget, SPELL_LEVITATE); LevitatedTarget = pTarget->GetGUID(); @@ -163,7 +163,7 @@ class boss_the_black_stalker : public CreatureScript // Chain Lightning if (ChainLightning_Timer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) DoCast(pTarget, SPELL_CHAIN_LIGHTNING); ChainLightning_Timer = 7000; } else ChainLightning_Timer -= diff; @@ -182,7 +182,6 @@ class boss_the_black_stalker : public CreatureScript }; - void AddSC_boss_the_black_stalker() { new boss_the_black_stalker(); diff --git a/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp b/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp index 55a5bcc9e112d..01b7546506f72 100644 --- a/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp +++ b/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp @@ -197,7 +197,7 @@ class boss_gruul : public CreatureScript // Hurtful Strike if (m_uiHurtfulStrike_Timer <= uiDiff) { - Unit *pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO,1); + Unit *pTarget = SelectTarget(SELECT_TARGET_TOPAGGRO,1); if (pTarget && me->IsWithinMeleeRange(me->getVictim())) DoCast(pTarget, SPELL_HURTFUL_STRIKE); @@ -221,7 +221,7 @@ class boss_gruul : public CreatureScript // Cave In if (m_uiCaveIn_Timer <= uiDiff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) DoCast(pTarget, SPELL_CAVE_IN); if (m_uiCaveIn_StaticTimer >= 4000) @@ -253,7 +253,6 @@ class boss_gruul : public CreatureScript }; - void AddSC_boss_gruul() { new boss_gruul(); 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 05395d3fab4c8..d48edfb8e07bc 100644 --- a/src/server/scripts/Outland/GruulsLair/boss_high_king_maulgar.cpp +++ b/src/server/scripts/Outland/GruulsLair/boss_high_king_maulgar.cpp @@ -281,7 +281,7 @@ class boss_high_king_maulgar : public CreatureScript if (Charging_Timer <= diff) { Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0); if (pTarget) { AttackStart(pTarget); @@ -420,7 +420,7 @@ class boss_olm_the_summoner : public CreatureScript if (DeathCoil_Timer <= diff) { Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0); if (pTarget) DoCast(pTarget, SPELL_DEATH_COIL); DeathCoil_Timer = 20000; @@ -520,7 +520,7 @@ class boss_kiggler_the_crazed : public CreatureScript //GreaterPolymorph_Timer if (GreaterPolymorph_Timer <= diff) { - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0); if (pTarget) DoCast(pTarget, SPELL_GREATER_POLYMORPH); diff --git a/src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp b/src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp index 2fd902504be8d..7ede42708aedc 100644 --- a/src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp +++ b/src/server/scripts/Outland/GruulsLair/instance_gruuls_lair.cpp @@ -191,7 +191,6 @@ class instance_gruuls_lair : public InstanceMapScript }; - void AddSC_instance_gruuls_lair() { new instance_gruuls_lair(); 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 b3c3c628edffb..efb99e41278ef 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 @@ -352,7 +352,7 @@ class mob_shadowmoon_channeler : public CreatureScript if (MarkOfShadow_Timer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(pTarget, SPELL_MARK_OF_SHADOW); MarkOfShadow_Timer = 15000+rand()%5000; } 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 3a63827e20ccc..c1c86aad7e9d8 100644 --- a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_the_maker.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_the_maker.cpp @@ -122,7 +122,7 @@ class boss_the_maker : public CreatureScript if (ExplodingBreaker_Timer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) DoCast(pTarget, SPELL_EXPLODING_BREAKER); ExplodingBreaker_Timer = 4000+rand()%8000; } 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 bbd8dfee649cd..04ad98a965d50 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 @@ -107,7 +107,7 @@ class boss_omor_the_unscarred : public CreatureScript { DoScriptText(SAY_SUMMON, me); - if (Unit* random = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit* random = SelectTarget(SELECT_TARGET_RANDOM,0)) summoned->AI()->AttackStart(random); ++SummonedCount; @@ -162,7 +162,7 @@ class boss_omor_the_unscarred : public CreatureScript Unit* temp = NULL; if (me->IsWithinMeleeRange(me->getVictim())) temp = me->getVictim(); - else temp = SelectUnit(SELECT_TARGET_RANDOM,0); + else temp = SelectTarget(SELECT_TARGET_RANDOM,0); if (temp && temp->GetTypeId() == TYPEID_PLAYER) { @@ -192,7 +192,7 @@ class boss_omor_the_unscarred : public CreatureScript { DoScriptText(SAY_CURSE, me); - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) { DoCast(pTarget, SPELL_TREACHEROUS_AURA); Aura_Timer = 8000+rand()%8000; @@ -203,7 +203,7 @@ class boss_omor_the_unscarred : public CreatureScript if (Shadowbolt_Timer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) { if (pTarget) pTarget = me->getVictim(); 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 b1a69490c259c..840d28065b445 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 @@ -130,7 +130,7 @@ class boss_nazan : public CreatureScript if (Fireball_Timer <= diff) { - if (Unit* pVictim = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit* pVictim = SelectTarget(SELECT_TARGET_RANDOM,0)) DoCast(pVictim, DUNGEON_MODE(SPELL_FIREBALL, SPELL_FIREBALL_H), true); Fireball_Timer = urand(4000,7000); } @@ -148,7 +148,7 @@ class boss_nazan : public CreatureScript me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING); me->GetMotionMaster()->Clear(); - if (Unit* pVictim = SelectUnit(SELECT_TARGET_NEAREST,0)) + if (Unit* pVictim = SelectTarget(SELECT_TARGET_NEAREST,0)) me->AI()->AttackStart(pVictim); DoStartMovement(me->getVictim()); DoScriptText(EMOTE, me); 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 e5fe4ddb0b81f..96d8e17c23830 100644 --- a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_watchkeeper_gargolmar.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_watchkeeper_gargolmar.cpp @@ -131,7 +131,7 @@ class boss_watchkeeper_gargolmar : public CreatureScript { DoScriptText(SAY_SURGE, me); - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) DoCast(pTarget, SPELL_SURGE); Surge_Timer = 5000+rand()%8000; 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 b27da1b5a5b4a..2f6ca3b7a2915 100644 --- a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/instance_hellfire_ramparts.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/instance_hellfire_ramparts.cpp @@ -66,7 +66,7 @@ class instance_ramparts : public InstanceMapScript void SetData(uint32 uiType, uint32 uiData) { - sLog->outDebug("TSCR: Instance Ramparts: SetData received for type %u with data %u",uiType,uiData); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Ramparts: SetData received for type %u with data %u",uiType,uiData); switch(uiType) { diff --git a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp index fb2ef71c57616..d58cb83ce9228 100644 --- a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp @@ -426,7 +426,7 @@ class boss_magtheridon : public CreatureScript if (Blaze_Timer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) { float x, y, z; pTarget->GetPosition(x, y, z); @@ -460,7 +460,7 @@ class boss_magtheridon : public CreatureScript { if (Debris_Timer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) { float x, y, z; pTarget->GetPosition(x, y, z); @@ -577,7 +577,7 @@ class mob_hellfire_channeler : public CreatureScript if (Fear_Timer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1)) DoCast(pTarget, SPELL_FEAR); Fear_Timer = 25000 + rand()%15000; } @@ -586,7 +586,7 @@ class mob_hellfire_channeler : public CreatureScript if (Infernal_Timer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(pTarget, SPELL_BURNING_ABYSSAL, true); Infernal_Timer = 30000 + rand()%10000; } 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 5f2fb7b774143..93049694318c1 100644 --- a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/instance_magtheridons_lair.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/instance_magtheridons_lair.cpp @@ -257,7 +257,6 @@ class instance_magtheridons_lair : public InstanceMapScript } }; - void AddSC_instance_magtheridons_lair() { new instance_magtheridons_lair(); diff --git a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp index a6ce1ec3af1b2..332cd1792b187 100644 --- a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp @@ -277,7 +277,7 @@ class boss_grand_warlock_nethekurse : public CreatureScript { if (ShadowFissure_Timer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) DoCast(pTarget, SPELL_SHADOW_FISSURE); ShadowFissure_Timer = urand(7500,15000); } @@ -286,7 +286,7 @@ class boss_grand_warlock_nethekurse : public CreatureScript if (DeathCoil_Timer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) DoCast(pTarget, SPELL_DEATH_COIL); DeathCoil_Timer = urand(15000,20000); } @@ -307,7 +307,6 @@ class boss_grand_warlock_nethekurse : public CreatureScript } }; - class mob_fel_orc_convert : public CreatureScript { public: 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 bd44ee23faa9a..b02521d61363d 100644 --- a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warbringer_omrogg.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warbringer_omrogg.cpp @@ -383,7 +383,7 @@ class boss_warbringer_omrogg : public CreatureScript if (ResetThreat_Timer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) { DoYellForThreat(); DoResetThreat(); 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 323520a4696e5..e7098b1ffe1da 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 @@ -120,7 +120,7 @@ class boss_warchief_kargath_bladefist : public CreatureScript case MOB_HEARTHEN_GUARD: case MOB_SHARPSHOOTER_GUARD: case MOB_REAVER_GUARD: - summoned->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM,0)); + summoned->AI()->AttackStart(SelectTarget(SELECT_TARGET_RANDOM,0)); adds.push_back(summoned->GetGUID()); break; case MOB_SHATTERED_ASSASSIN: @@ -267,7 +267,7 @@ class boss_warchief_kargath_bladefist : public CreatureScript { if (Charge_timer <= diff) { - DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), H_SPELL_CHARGE); + DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0), H_SPELL_CHARGE); Charge_timer = 0; } else diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp index 2836e329f80f2..a948ab70a34e2 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp @@ -154,7 +154,7 @@ class boss_alar : public CreatureScript void JustSummoned(Creature *summon) { if (summon->GetEntry() == CREATURE_EMBER_OF_ALAR) - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) summon->AI()->AttackStart(pTarget); } @@ -283,7 +283,7 @@ class boss_alar : public CreatureScript WaitTimer = 4000; return; case WE_DIVE: - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) { me->RemoveAurasDueToSpell(SPELL_DIVE_BOMB_VISUAL); DoCast(pTarget, SPELL_DIVE_BOMB, true); @@ -403,7 +403,7 @@ class boss_alar : public CreatureScript if (FlamePatch_Timer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) { Creature* Summoned = me->SummonCreature(CREATURE_FLAME_PATCH_ALAR, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 120000); if (Summoned) diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp index 75c1e2e5b3e22..5d7fb7e9f35c3 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp @@ -171,7 +171,7 @@ class boss_high_astromancer_solarian : public CreatureScript Creature* Summoned = me->SummonCreature(entry, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); if (Summoned) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) Summoned->AI()->AttackStart(pTarget); Summons.Summon(Summoned); @@ -243,7 +243,7 @@ class boss_high_astromancer_solarian : public CreatureScript } else { - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0); if (!me->HasInArc(2.5f, pTarget)) pTarget = me->getVictim(); if (pTarget) @@ -258,7 +258,7 @@ class boss_high_astromancer_solarian : public CreatureScript { me->InterruptNonMeleeSpells(false); //Target the tank ? - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1)) + if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1)) { if (pTarget->GetTypeId() == TYPEID_PLAYER) { diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp index 4035d07d20a30..60b92956a34ad 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_kaelthas.cpp @@ -267,7 +267,6 @@ struct advisorbase_ai : public ScriptedAI } }; - class boss_kaelthas : public CreatureScript { public: @@ -377,7 +376,7 @@ class boss_kaelthas : public CreatureScript me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) AttackStart(pTarget); } @@ -440,7 +439,7 @@ class boss_kaelthas : public CreatureScript // if not phoenix, then it's one of the 7 weapons if (pSummoned->GetEntry() != NPC_PHOENIX) { - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) pSummoned->AI()->AttackStart(pTarget); summons.Summon(pSummoned); @@ -504,7 +503,7 @@ class boss_kaelthas : public CreatureScript Advisor->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); Advisor->setFaction(me->getFaction()); - pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0); if (pTarget) Advisor->AI()->AttackStart(pTarget); } @@ -538,7 +537,7 @@ class boss_kaelthas : public CreatureScript Advisor->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); Advisor->setFaction(me->getFaction()); - pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0); if (pTarget) Advisor->AI()->AttackStart(pTarget); } @@ -572,7 +571,7 @@ class boss_kaelthas : public CreatureScript Advisor->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); Advisor->setFaction(me->getFaction()); - pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0); if (pTarget) Advisor->AI()->AttackStart(pTarget); } @@ -606,7 +605,7 @@ class boss_kaelthas : public CreatureScript Advisor->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); Advisor->setFaction(me->getFaction()); - pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0); if (pTarget) Advisor->AI()->AttackStart(pTarget); } @@ -684,7 +683,7 @@ class boss_kaelthas : public CreatureScript if (PhaseSubphase == 0) { //Respawn advisors - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0); Creature *Advisor; for (uint8 i = 0; i < MAX_ADVISORS; ++i) @@ -715,7 +714,7 @@ class boss_kaelthas : public CreatureScript me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) AttackStart(pTarget); Phase_Timer = 30000; @@ -772,7 +771,7 @@ class boss_kaelthas : public CreatureScript if (FlameStrike_Timer <= diff) { - if (Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* pUnit = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(pUnit, SPELL_FLAME_STRIKE); FlameStrike_Timer = 30000; @@ -785,7 +784,7 @@ class boss_kaelthas : public CreatureScript if (me->getThreatManager().getThreatList().size() >= 2) for (uint32 i = 0; i < 3; ++i) { - sLog->outDebug("SD2: Kael'Thas mind control not supported."); + sLog->outDebug(LOG_FILTER_TSCR, "SD2: Kael'Thas mind control not supported."); //DoCast(pUnit, SPELL_MIND_CONTROL); } @@ -984,7 +983,7 @@ class boss_kaelthas : public CreatureScript //NetherBeam_Timer if (NetherBeam_Timer <= diff) { - if (Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* pUnit = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(pUnit, SPELL_NETHER_BEAM); NetherBeam_Timer = 4000; @@ -1065,7 +1064,7 @@ class boss_thaladred_the_darkener : public CreatureScript //Gaze_Timer if (Gaze_Timer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) { DoResetThreat(); me->AddThreat(pTarget, 5000000.0f); @@ -1268,7 +1267,7 @@ class boss_grand_astromancer_capernian : public CreatureScript if (Conflagration_Timer <= diff) { Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0); if (pTarget && me->IsWithinDistInMap(pTarget, 30)) DoCast(pTarget, SPELL_CONFLAGRATION); @@ -1381,7 +1380,7 @@ class boss_master_engineer_telonicus : public CreatureScript //RemoteToy_Timer if (RemoteToy_Timer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(pTarget, SPELL_REMOTE_TOY); RemoteToy_Timer = 10000+rand()%5000; @@ -1517,7 +1516,6 @@ class mob_phoenix_tk : public CreatureScript } }; - //Phoenix Egg AI class mob_phoenix_egg_tk : public CreatureScript { @@ -1579,7 +1577,6 @@ class mob_phoenix_egg_tk : public CreatureScript } }; - void AddSC_boss_kaelthas() { new boss_kaelthas(); diff --git a/src/server/scripts/Outland/TempestKeep/Eye/the_eye.cpp b/src/server/scripts/Outland/TempestKeep/Eye/the_eye.cpp index 059f24610fce5..a0b954870df8d 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/the_eye.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/the_eye.cpp @@ -73,10 +73,10 @@ class mob_crystalcore_devastator : public CreatureScript DoCast(me->getVictim(), SPELL_KNOCKAWAY, true); // current aggro target is knocked away pick new target - Unit* pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO, 0); + Unit* pTarget = SelectTarget(SELECT_TARGET_TOPAGGRO, 0); if (!pTarget || pTarget == me->getVictim()) - pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO, 1); + pTarget = SelectTarget(SELECT_TARGET_TOPAGGRO, 1); if (pTarget) me->TauntApply(pTarget); 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 8d72e3802b731..ba6318a468692 100644 --- a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp +++ b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp @@ -114,7 +114,6 @@ class boss_nethermancer_sepethrea : public CreatureScript if (!UpdateVictim()) return; - //Frost Attack if (frost_attack_Timer <= diff) { @@ -234,7 +233,7 @@ class mob_ragin_flames : public CreatureScript if (!onlyonce) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) me->GetMotionMaster()->MoveChase(pTarget); onlyonce = true; } 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 a45df068425a0..6e06fd4920e8e 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 @@ -129,7 +129,7 @@ class boss_pathaleon_the_calculator : public CreatureScript { for (uint8 i = 0; i < 3; ++i) { - Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); + Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0); Creature* Wraith = me->SummonCreature(21062,me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); if (pTarget && Wraith) Wraith->AI()->AttackStart(pTarget); @@ -158,7 +158,7 @@ class boss_pathaleon_the_calculator : public CreatureScript if (Domination_Timer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,1)) { DoScriptText(RAND(SAY_DOMINATION_1,SAY_DOMINATION_2), me); DoCast(pTarget, SPELL_DOMINATION); @@ -233,7 +233,7 @@ class mob_nether_wraith : public CreatureScript if (ArcaneMissiles_Timer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,1)) DoCast(pTarget, SPELL_ARCANE_MISSILES); else DoCast(me->getVictim(), SPELL_ARCANE_MISSILES); diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp index c963c1109c34a..befa6ed52516a 100644 --- a/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp +++ b/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp @@ -86,7 +86,6 @@ class instance_mechanar : public InstanceMapScript } }; - void AddSC_instance_mechanar() { new instance_mechanar; 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 d88522b5ccfe2..02c8c6bb4e53d 100644 --- a/src/server/scripts/Outland/TempestKeep/arcatraz/boss_harbinger_skyriss.cpp +++ b/src/server/scripts/Outland/TempestKeep/arcatraz/boss_harbinger_skyriss.cpp @@ -57,7 +57,6 @@ enum eSpells SPELL_33_ILLUSION = 36932, //entry 21467 }; - class boss_harbinger_skyriss : public CreatureScript { public: @@ -129,7 +128,7 @@ class boss_harbinger_skyriss : public CreatureScript else summon->SetHealth(summon->CountPctFromMaxHealth(66)); if (me->getVictim()) - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) summon->AI()->AttackStart(pTarget); } @@ -209,7 +208,7 @@ class boss_harbinger_skyriss : public CreatureScript if (MindRend_Timer <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,1)) DoCast(pTarget, SPELL_MIND_REND); else DoCast(me->getVictim(), SPELL_MIND_REND); @@ -226,7 +225,7 @@ class boss_harbinger_skyriss : public CreatureScript DoScriptText(RAND(SAY_FEAR_1,SAY_FEAR_2), me); - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,1)) DoCast(pTarget, SPELL_FEAR); else DoCast(me->getVictim(), SPELL_FEAR); @@ -243,7 +242,7 @@ class boss_harbinger_skyriss : public CreatureScript DoScriptText(RAND(SAY_MIND_1,SAY_MIND_2), me); - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,1)) DoCast(pTarget, SPELL_DOMINATION); else DoCast(me->getVictim(), SPELL_DOMINATION); @@ -260,7 +259,7 @@ class boss_harbinger_skyriss : public CreatureScript if (me->IsNonMeleeSpellCasted(false)) return; - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,1)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,1)) DoCast(pTarget, H_SPELL_MANA_BURN); ManaBurn_Timer = 16000+rand()%16000; @@ -278,7 +277,6 @@ class boss_harbinger_skyriss : public CreatureScript } }; - #define SPELL_MIND_REND_IMAGE 36929 #define H_SPELL_MIND_REND_IMAGE 39021 @@ -305,7 +303,6 @@ class boss_harbinger_skyriss_illusion : public CreatureScript } }; - void AddSC_boss_harbinger_skyriss() { new boss_harbinger_skyriss(); diff --git a/src/server/scripts/Outland/TempestKeep/arcatraz/instance_arcatraz.cpp b/src/server/scripts/Outland/TempestKeep/arcatraz/instance_arcatraz.cpp index f981102aa519b..4eab5823fa523 100644 --- a/src/server/scripts/Outland/TempestKeep/arcatraz/instance_arcatraz.cpp +++ b/src/server/scripts/Outland/TempestKeep/arcatraz/instance_arcatraz.cpp @@ -43,7 +43,6 @@ enum eUnits MELLICHAR = 20904,//skyriss will kill this unit }; - /* Arcatraz encounters: 1 - Zereketh the Unbound event 2 - Dalliah the Doomsayer event @@ -99,7 +98,6 @@ class instance_arcatraz : public InstanceMapScript return false; } - void OnGameObjectCreate(GameObject* go) { switch(go->GetEntry()) diff --git a/src/server/scripts/Outland/TempestKeep/botanica/boss_laj.cpp b/src/server/scripts/Outland/TempestKeep/botanica/boss_laj.cpp index ce8c2b01c90fa..eaaaaec92cd38 100644 --- a/src/server/scripts/Outland/TempestKeep/botanica/boss_laj.cpp +++ b/src/server/scripts/Outland/TempestKeep/botanica/boss_laj.cpp @@ -162,7 +162,7 @@ class boss_laj : public CreatureScript void JustSummoned(Creature *summon) { if (summon && me->getVictim()) - summon->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0)); + summon->AI()->AttackStart(SelectTarget(SELECT_TARGET_RANDOM, 0)); } void UpdateAI(const uint32 diff) diff --git a/src/server/scripts/Outland/blades_edge_mountains.cpp b/src/server/scripts/Outland/blades_edge_mountains.cpp index be4904a6fa6e2..aa5a432742ad0 100644 --- a/src/server/scripts/Outland/blades_edge_mountains.cpp +++ b/src/server/scripts/Outland/blades_edge_mountains.cpp @@ -255,7 +255,6 @@ class mobs_nether_drake : public CreatureScript }; - /*###### ## npc_daranelle ######*/ @@ -302,7 +301,6 @@ class npc_daranelle : public CreatureScript }; - /*###### ## npc_overseer_nuaar ######*/ @@ -337,7 +335,6 @@ class npc_overseer_nuaar : public CreatureScript }; - /*###### ## npc_saikkal_the_elder ######*/ @@ -379,7 +376,6 @@ class npc_saikkal_the_elder : public CreatureScript }; - /*###### ## go_legion_obelisk ######*/ @@ -429,12 +425,10 @@ class go_legion_obelisk : public GameObjectScript }; - /*###### ## npc_bloodmaul_brutebane ######*/ - enum eBloodmaul { NPC_OGRE_BRUTE = 19995, @@ -475,7 +469,6 @@ class npc_bloodmaul_brutebane : public CreatureScript }; - /*###### ## npc_ogre_brute ######*/ @@ -538,7 +531,6 @@ class npc_ogre_brute : public CreatureScript }; - /*###### ## AddSC ######*/ diff --git a/src/server/scripts/Outland/boss_doomlord_kazzak.cpp b/src/server/scripts/Outland/boss_doomlord_kazzak.cpp index 4b54d778c3b06..a841dacf9b534 100644 --- a/src/server/scripts/Outland/boss_doomlord_kazzak.cpp +++ b/src/server/scripts/Outland/boss_doomlord_kazzak.cpp @@ -143,7 +143,7 @@ class boss_doomlord_kazzak : public CreatureScript //MarkOfKazzak_Timer if (MarkOfKazzak_Timer <= diff) { - Unit* victim = SelectUnit(SELECT_TARGET_RANDOM, 0); + Unit* victim = SelectTarget(SELECT_TARGET_RANDOM, 0); if (victim->GetPower(POWER_MANA)) { DoCast(victim, SPELL_MARKOFKAZZAK); @@ -161,7 +161,7 @@ class boss_doomlord_kazzak : public CreatureScript if (Twisted_Reflection_Timer <= diff) { - DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_TWISTEDREFLECTION); + DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0), SPELL_TWISTEDREFLECTION); Twisted_Reflection_Timer = 15000; } else Twisted_Reflection_Timer -= diff; @@ -172,7 +172,6 @@ class boss_doomlord_kazzak : public CreatureScript }; - void AddSC_boss_doomlordkazzak() { new boss_doomlord_kazzak(); diff --git a/src/server/scripts/Outland/boss_doomwalker.cpp b/src/server/scripts/Outland/boss_doomwalker.cpp index cd74c1cb08eff..ba37b119623fe 100644 --- a/src/server/scripts/Outland/boss_doomwalker.cpp +++ b/src/server/scripts/Outland/boss_doomwalker.cpp @@ -152,7 +152,7 @@ class boss_doomwalker : public CreatureScript if (Chain_Timer <= diff) { Unit *pTarget = NULL; - pTarget = SelectUnit(SELECT_TARGET_RANDOM,1); + pTarget = SelectTarget(SELECT_TARGET_RANDOM,1); if (!pTarget) pTarget = me->getVictim(); @@ -176,7 +176,6 @@ class boss_doomwalker : public CreatureScript }; - void AddSC_boss_doomwalker() { new boss_doomwalker(); diff --git a/src/server/scripts/Outland/hellfire_peninsula.cpp b/src/server/scripts/Outland/hellfire_peninsula.cpp index 6647f597a96c7..414efdc7fb563 100644 --- a/src/server/scripts/Outland/hellfire_peninsula.cpp +++ b/src/server/scripts/Outland/hellfire_peninsula.cpp @@ -127,7 +127,6 @@ class npc_aeranas : public CreatureScript }; - /*###### ## npc_ancestral_wolf ######*/ @@ -202,7 +201,6 @@ class npc_ancestral_wolf : public CreatureScript }; - /*###### ## go_haaleshi_altar ######*/ @@ -257,7 +255,6 @@ class npc_naladu : public CreatureScript }; - /*###### ## npc_tracy_proudwell ######*/ @@ -314,7 +311,6 @@ class npc_tracy_proudwell : public CreatureScript }; - /*###### ## npc_trollbane ######*/ @@ -368,7 +364,6 @@ class npc_trollbane : public CreatureScript }; - /*###### ## npc_wounded_blood_elf ######*/ @@ -464,8 +459,6 @@ class npc_wounded_blood_elf : public CreatureScript }; - - /*###### ## npc_fel_guard_hound ######*/ @@ -539,7 +532,6 @@ class npc_fel_guard_hound : public CreatureScript }; - void AddSC_hellfire_peninsula() { new npc_aeranas(); diff --git a/src/server/scripts/Outland/nagrand.cpp b/src/server/scripts/Outland/nagrand.cpp index 8ddb91779850e..4a53c3d7d020d 100644 --- a/src/server/scripts/Outland/nagrand.cpp +++ b/src/server/scripts/Outland/nagrand.cpp @@ -243,9 +243,6 @@ class mob_lump : public CreatureScript }; - - - /*#### # mob_sunspring_villager - should be done with ACID ####*/ @@ -384,8 +381,6 @@ class npc_altruis_the_sufferer : public CreatureScript }; - - /*###### ## npc_greatmother_geyah ######*/ @@ -497,7 +492,6 @@ class npc_greatmother_geyah : public CreatureScript }; - /*###### ## npc_lantresor_of_the_blade ######*/ @@ -575,7 +569,6 @@ class npc_lantresor_of_the_blade : public CreatureScript }; - /*##### ## npc_maghar_captive #####*/ @@ -747,8 +740,6 @@ class npc_maghar_captive : public CreatureScript }; - - /*###### ## npc_creditmarker_visist_with_ancestors ######*/ @@ -794,7 +785,6 @@ class npc_creditmarker_visit_with_ancestors : public CreatureScript }; - /*###### ## mob_sparrowhawk ######*/ @@ -904,7 +894,6 @@ class mob_sparrowhawk : public CreatureScript }; - /*#### # ####*/ diff --git a/src/server/scripts/Outland/netherstorm.cpp b/src/server/scripts/Outland/netherstorm.cpp index ba9ecc77550c2..d9ffcf311d847 100644 --- a/src/server/scripts/Outland/netherstorm.cpp +++ b/src/server/scripts/Outland/netherstorm.cpp @@ -497,7 +497,7 @@ class npc_commander_dawnforge : public CreatureScript return true; } - sLog->outDebug("TSCR: npc_commander_dawnforge event already in progress, need to wait."); + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: npc_commander_dawnforge event already in progress, need to wait."); return false; } @@ -635,7 +635,6 @@ class npc_commander_dawnforge : public CreatureScript }; - class at_commander_dawnforge : public AreaTriggerScript { public: @@ -717,8 +716,6 @@ class npc_professor_dabiri : public CreatureScript }; - - /*###### ## mob_phase_hunter ######*/ @@ -856,7 +853,6 @@ class mob_phase_hunter : public CreatureScript }; - /*###### ## npc_bessy ######*/ @@ -1052,7 +1048,6 @@ class npc_maxx_a_million_escort : public CreatureScript } }; - void AddSC_netherstorm() { new go_manaforge_control_console(); diff --git a/src/server/scripts/Outland/shadowmoon_valley.cpp b/src/server/scripts/Outland/shadowmoon_valley.cpp index 5301dd91381d1..9a2bae54f339f 100644 --- a/src/server/scripts/Outland/shadowmoon_valley.cpp +++ b/src/server/scripts/Outland/shadowmoon_valley.cpp @@ -19,7 +19,7 @@ /* ScriptData SDName: Shadowmoon_Valley SD%Complete: 100 -SDComment: Quest support: 10519, 10583, 10601, 10814, 10804, 10854, 10458, 10481, 10480, 11082, 10781, 10451. Vendor Drake Dealer Hurlunk. +SDComment: Quest support: 10519, 10583, 10601, 10804, 10854, 10458, 10481, 10480, 11082, 10781, 10451. Vendor Drake Dealer Hurlunk. SDCategory: Shadowmoon Valley EndScriptData */ @@ -29,7 +29,6 @@ mob_enslaved_netherwing_drake npc_drake_dealer_hurlunk npcs_flanis_swiftwing_and_kagrosh npc_murkblood_overseer -npc_neltharaku npc_karynaku npc_oronok_tornheart npc_overlord_morghor @@ -183,7 +182,6 @@ class mob_mature_netherwing_drake : public CreatureScript }; - /*### # mob_enslaved_netherwing_drake ####*/ @@ -211,12 +209,10 @@ class mob_enslaved_netherwing_drake : public CreatureScript { mob_enslaved_netherwing_drakeAI(Creature* c) : ScriptedAI(c) { - PlayerGUID = 0; Tapped = false; Reset(); } - uint64 PlayerGUID; uint32 FlyTimer; bool Tapped; @@ -238,7 +234,6 @@ class mob_enslaved_netherwing_drake : public CreatureScript if (caster->GetTypeId() == TYPEID_PLAYER && spell->Id == SPELL_HIT_FORCE_OF_NELTHARAKU && !Tapped) { Tapped = true; - PlayerGUID = caster->GetGUID(); me->setFaction(FACTION_FRIENDLY); DoCast(caster, SPELL_FORCE_OF_NELTHARAKU, true); @@ -264,14 +259,6 @@ class mob_enslaved_netherwing_drake : public CreatureScript if (id == 1) { - if (PlayerGUID) - { - Unit* plr = Unit::GetUnit((*me), PlayerGUID); - if (plr) - DoCast(plr, SPELL_FORCE_OF_NELTHARAKU, true); - - PlayerGUID = 0; - } me->SetVisible(false); me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); @@ -288,33 +275,17 @@ class mob_enslaved_netherwing_drake : public CreatureScript if (FlyTimer <= diff) { Tapped = false; - if (PlayerGUID) + Position pos; + if (Unit* EscapeDummy = me->FindNearestCreature(CREATURE_ESCAPE_DUMMY, 30)) + EscapeDummy->GetPosition(&pos); + else { - Player* plr = Unit::GetPlayer(*me, PlayerGUID); - if (plr && plr->GetQuestStatus(10854) == QUEST_STATUS_INCOMPLETE) - { - DoCast(plr, SPELL_FORCE_OF_NELTHARAKU, true); - /* - float x,y,z; - me->GetPosition(x,y,z); - - float dx,dy,dz; - me->GetRandomPoint(x, y, z, 20, dx, dy, dz); - dz += 20; // so it's in the air, not ground*/ - - Position pos; - if (Unit* EscapeDummy = me->FindNearestCreature(CREATURE_ESCAPE_DUMMY, 30)) - EscapeDummy->GetPosition(&pos); - else - { - me->GetRandomNearPosition(pos, 20); - pos.m_positionZ += 25; - } - - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - me->GetMotionMaster()->MovePoint(1, pos); - } + me->GetRandomNearPosition(pos, 20); + pos.m_positionZ += 25; } + + me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->GetMotionMaster()->MovePoint(1, pos); } else FlyTimer -= diff; } return; @@ -326,7 +297,6 @@ class mob_enslaved_netherwing_drake : public CreatureScript }; - /*##### # mob_dragonmaw_peon #####*/ @@ -407,7 +377,6 @@ class mob_dragonmaw_peon : public CreatureScript }; - /*###### ## npc_drake_dealer_hurlunk ######*/ @@ -438,7 +407,6 @@ class npc_drake_dealer_hurlunk : public CreatureScript }; - /*###### ## npc_flanis_swiftwing_and_kagrosh ######*/ @@ -491,7 +459,6 @@ class npcs_flanis_swiftwing_and_kagrosh : public CreatureScript }; - /*###### ## npc_murkblood_overseer ######*/ @@ -561,62 +528,6 @@ class npc_murkblood_overseer : public CreatureScript }; - -/*###### -## npc_neltharaku -######*/ - -#define GOSSIP_HN "I am listening, dragon" -#define GOSSIP_SN1 "But you are dragons! How could orcs do this to you?" -#define GOSSIP_SN2 "Your mate?" -#define GOSSIP_SN3 "I have battled many beasts, dragon. I will help you." - -class npc_neltharaku : public CreatureScript -{ -public: - npc_neltharaku() : CreatureScript("npc_neltharaku") { } - - bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction) - { - pPlayer->PlayerTalkClass->ClearMenus(); - switch (uiAction) - { - case GOSSIP_ACTION_INFO_DEF+1: - pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_SN1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); - pPlayer->SEND_GOSSIP_MENU(10614, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+2: - pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_SN2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); - pPlayer->SEND_GOSSIP_MENU(10615, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+3: - pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_SN3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4); - pPlayer->SEND_GOSSIP_MENU(10616, pCreature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+4: - pPlayer->CLOSE_GOSSIP_MENU(); - pPlayer->AreaExploredOrEventHappens(10814); - break; - } - return true; - } - - bool OnGossipHello(Player* pPlayer, Creature* pCreature) - { - if (pCreature->isQuestGiver()) - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); - - if (pPlayer->GetQuestStatus(10814) == QUEST_STATUS_INCOMPLETE) - pPlayer->ADD_GOSSIP_ITEM(0, GOSSIP_HN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - pPlayer->SEND_GOSSIP_MENU(10613, pCreature->GetGUID()); - - return true; - } - -}; - - /*###### ## npc_oronok ######*/ @@ -693,7 +604,6 @@ class npc_oronok_tornheart : public CreatureScript }; - /*#### # npc_karynaku ####*/ @@ -945,8 +855,6 @@ class npc_overlord_morghor : public CreatureScript }; - - /*#### # npc_earthmender_wilda ####*/ @@ -1125,8 +1033,6 @@ class npc_earthmender_wilda : public CreatureScript }; - - /*##### # Quest: Battle of the crimson watch #####*/ @@ -1608,7 +1514,7 @@ class mob_illidari_spawn : public CreatureScript { if (SpellTimer1 <= diff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0)) { if (pTarget->GetTypeId() == TYPEID_PLAYER) { @@ -1746,9 +1652,6 @@ class go_crystal_prison : public GameObjectScript }; - - - /*#### # npc_enraged_spirits ####*/ @@ -1882,7 +1785,6 @@ void AddSC_shadowmoon_valley() new npc_drake_dealer_hurlunk(); new npcs_flanis_swiftwing_and_kagrosh(); new npc_murkblood_overseer(); - new npc_neltharaku(); new npc_karynaku(); new npc_oronok_tornheart(); new npc_overlord_morghor(); diff --git a/src/server/scripts/Outland/shattrath_city.cpp b/src/server/scripts/Outland/shattrath_city.cpp index d6e40737e9c7b..1437702fbb54c 100644 --- a/src/server/scripts/Outland/shattrath_city.cpp +++ b/src/server/scripts/Outland/shattrath_city.cpp @@ -114,9 +114,6 @@ class npc_raliq_the_drunk : public CreatureScript }; - - - /*###### # npc_salsalabim ######*/ @@ -193,7 +190,6 @@ class npc_salsalabim : public CreatureScript }; - /* ################################################## Shattrath City Flask Vendors provides flasks to people exalted with 3 factions: @@ -254,7 +250,6 @@ class npc_shattrathflaskvendors : public CreatureScript }; - /*###### # npc_zephyr ######*/ @@ -287,7 +282,6 @@ class npc_zephyr : public CreatureScript }; - /*###### # npc_kservant ######*/ @@ -581,8 +575,6 @@ class npc_dirty_larry : public CreatureScript }; - - /*###### # npc_ishanah ######*/ @@ -621,7 +613,6 @@ class npc_ishanah : public CreatureScript }; - /*###### # npc_khadgar ######*/ @@ -690,7 +681,6 @@ class npc_khadgar : public CreatureScript }; - void AddSC_shattrath_city() { new npc_raliq_the_drunk(); diff --git a/src/server/scripts/Outland/terokkar_forest.cpp b/src/server/scripts/Outland/terokkar_forest.cpp index c6da2b0e4179c..b9a4d2c48e3b1 100644 --- a/src/server/scripts/Outland/terokkar_forest.cpp +++ b/src/server/scripts/Outland/terokkar_forest.cpp @@ -153,7 +153,6 @@ class mob_unkor_the_ruthless : public CreatureScript }; - /*###### ## mob_infested_root_walker ######*/ @@ -443,9 +442,6 @@ class npc_floon : public CreatureScript }; - - - /*###### ## npc_isla_starmane ######*/ @@ -539,7 +535,6 @@ class npc_isla_starmane : public CreatureScript }; - /*###### ## go_skull_pile ######*/ @@ -635,7 +630,6 @@ class npc_slim : public CreatureScript }; - /*######## ####npc_akuno #####*/ diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index 42eeb582bbb69..3e17a4303cc9e 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -239,6 +239,47 @@ class spell_dk_corpse_explosion : public SpellScriptLoader } }; +class spell_dk_death_gate : public SpellScriptLoader +{ + public: + spell_dk_death_gate() : SpellScriptLoader("spell_dk_death_gate") {} + + class spell_dk_death_gate_SpellScript : public SpellScript + { + PrepareSpellScript(spell_dk_death_gate_SpellScript); + + SpellCastResult CheckClass() + { + if (GetCaster()->getClass() != CLASS_DEATH_KNIGHT) + { + SetCustomCastResultMessage(SPELL_CUSTOM_ERROR_MUST_BE_DEATH_KNIGHT); + return SPELL_FAILED_CUSTOM_ERROR; + } + + return SPELL_CAST_OK; + } + + void HandleScript(SpellEffIndex effIndex) + { + PreventHitDefaultEffect(effIndex); + if (!GetHitUnit()) + return; + GetHitUnit()->CastSpell(GetHitUnit(), GetEffectValue(), false); + } + + void Register() + { + OnCheckCast += SpellCheckCastFn(spell_dk_death_gate_SpellScript::CheckClass); + OnEffect += SpellEffectFn(spell_dk_death_gate_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_dk_death_gate_SpellScript(); + } +}; + // 55090 Scourge Strike (55265, 55270, 55271) class spell_dk_scourge_strike : public SpellScriptLoader { @@ -401,7 +442,7 @@ class spell_dk_spell_deflection : public SpellScriptLoader void Absorb(AuraEffect * /*aurEff*/, DamageInfo & dmgInfo, uint32 & absorbAmount) { // You have a chance equal to your Parry chance - if ((dmgInfo.GetDamageType() == DIRECT_DAMAGE) && roll_chance_f(GetTarget()->GetUnitParryChance())) + if ((dmgInfo.GetDamageType() == SPELL_DIRECT_DAMAGE) && roll_chance_f(GetTarget()->GetUnitParryChance())) absorbAmount = CalculatePctN(dmgInfo.GetDamage(), absorbPct); } @@ -488,6 +529,7 @@ void AddSC_deathknight_spell_scripts() new spell_dk_anti_magic_shell_self(); new spell_dk_anti_magic_zone(); new spell_dk_corpse_explosion(); + new spell_dk_death_gate(); new spell_dk_death_pact(); new spell_dk_scourge_strike(); new spell_dk_raise_dead(); diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp index 1fcc83ccd2ed9..f61681a838aa1 100644 --- a/src/server/scripts/Spells/spell_druid.cpp +++ b/src/server/scripts/Spells/spell_druid.cpp @@ -53,12 +53,12 @@ class spell_dru_glyph_of_starfire : public SpellScriptLoader { Unit* caster = GetCaster(); if (Unit* unitTarget = GetHitUnit()) - if (AuraEffect const * aurEff = unitTarget->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE,SPELLFAMILY_DRUID, 0x00000002, 0, 0, caster->GetGUID())) + if (AuraEffect const * aurEff = unitTarget->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_DRUID, 0x00000002, 0, 0, caster->GetGUID())) { Aura* aura = aurEff->GetBase(); uint32 countMin = aura->GetMaxDuration(); - uint32 countMax = 18000; + uint32 countMax = GetSpellMaxDuration(aura->GetSpellProto()) + 9000; if (caster->HasAura(DRUID_INCREASED_MOONFIRE_DURATION)) countMax += 3000; if (caster->HasAura(DRUID_NATURES_SPLENDOR)) diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 245adbd6dd651..af0020dffd457 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -25,95 +25,98 @@ #include "ScriptPCH.h" #include "SpellAuraEffects.h" #include "DBCEnums.h" +#include "SkillDiscovery.h" class spell_gen_absorb0_hitlimit1 : public SpellScriptLoader { -public: - spell_gen_absorb0_hitlimit1() : SpellScriptLoader("spell_gen_absorb0_hitlimit1") { } + public: + spell_gen_absorb0_hitlimit1() : SpellScriptLoader("spell_gen_absorb0_hitlimit1") { } - class spell_gen_absorb0_hitlimit1_AuraScript : public AuraScript - { - PrepareAuraScript(spell_gen_absorb0_hitlimit1_AuraScript); + class spell_gen_absorb0_hitlimit1_AuraScript : public AuraScript + { + PrepareAuraScript(spell_gen_absorb0_hitlimit1_AuraScript); - uint32 limit; + uint32 limit; - bool Load() - { - // Max absorb stored in 1 dummy effect - limit = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(), EFFECT_1); - return true; - } + bool Load() + { + // Max absorb stored in 1 dummy effect + limit = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(), EFFECT_1); + return true; + } - void Absorb(AuraEffect * /*aurEff*/, DamageInfo & /*dmgInfo*/, uint32 & absorbAmount) - { - absorbAmount = std::min(limit, absorbAmount); - } + void Absorb(AuraEffect* /*aurEff*/, DamageInfo& /*dmgInfo*/, uint32& absorbAmount) + { + absorbAmount = std::min(limit, absorbAmount); + } - void Register() + void Register() + { + OnEffectAbsorb += AuraEffectAbsorbFn(spell_gen_absorb0_hitlimit1_AuraScript::Absorb, EFFECT_0); + } + }; + + AuraScript* GetAuraScript() const { - OnEffectAbsorb += AuraEffectAbsorbFn(spell_gen_absorb0_hitlimit1_AuraScript::Absorb, EFFECT_0); + return new spell_gen_absorb0_hitlimit1_AuraScript(); } - }; - - AuraScript *GetAuraScript() const - { - return new spell_gen_absorb0_hitlimit1_AuraScript(); - } }; // 41337 Aura of Anger class spell_gen_aura_of_anger : public SpellScriptLoader { -public: - spell_gen_aura_of_anger() : SpellScriptLoader("spell_gen_aura_of_anger") { } + public: + spell_gen_aura_of_anger() : SpellScriptLoader("spell_gen_aura_of_anger") { } - class spell_gen_aura_of_anger_AuraScript : public AuraScript - { - PrepareAuraScript(spell_gen_aura_of_anger_AuraScript) - void HandleEffectPeriodicUpdate(AuraEffect * aurEff) + class spell_gen_aura_of_anger_AuraScript : public AuraScript { - if (AuraEffect * aurEff1 = aurEff->GetBase()->GetEffect(EFFECT_1)) - aurEff1->ChangeAmount(aurEff1->GetAmount() + 5); - aurEff->SetAmount(100 * aurEff->GetTickNumber()); - } + PrepareAuraScript(spell_gen_aura_of_anger_AuraScript); - void Register() + void HandleEffectPeriodicUpdate(AuraEffect* aurEff) + { + if (AuraEffect* aurEff1 = aurEff->GetBase()->GetEffect(EFFECT_1)) + aurEff1->ChangeAmount(aurEff1->GetAmount() + 5); + aurEff->SetAmount(100 * aurEff->GetTickNumber()); + } + + void Register() + { + OnEffectUpdatePeriodic += AuraEffectUpdatePeriodicFn(spell_gen_aura_of_anger_AuraScript::HandleEffectPeriodicUpdate, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE); + } + }; + + AuraScript* GetAuraScript() const { - OnEffectUpdatePeriodic += AuraEffectUpdatePeriodicFn(spell_gen_aura_of_anger_AuraScript::HandleEffectPeriodicUpdate, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE); + return new spell_gen_aura_of_anger_AuraScript(); } - }; - - AuraScript *GetAuraScript() const - { - return new spell_gen_aura_of_anger_AuraScript(); - } }; // 46394 Brutallus Burn class spell_gen_burn_brutallus : public SpellScriptLoader { -public: - spell_gen_burn_brutallus() : SpellScriptLoader("spell_gen_burn_brutallus") { } + public: + spell_gen_burn_brutallus() : SpellScriptLoader("spell_gen_burn_brutallus") { } - class spell_gen_burn_brutallus_AuraScript : public AuraScript - { - PrepareAuraScript(spell_gen_burn_brutallus_AuraScript) - void HandleEffectPeriodicUpdate(AuraEffect * aurEff) + class spell_gen_burn_brutallus_AuraScript : public AuraScript { - if (aurEff->GetTickNumber() % 11 == 0) - aurEff->SetAmount(aurEff->GetAmount() * 2); - } + PrepareAuraScript(spell_gen_burn_brutallus_AuraScript); - void Register() + void HandleEffectPeriodicUpdate(AuraEffect* aurEff) + { + if (aurEff->GetTickNumber() % 11 == 0) + aurEff->SetAmount(aurEff->GetAmount() * 2); + } + + void Register() + { + OnEffectUpdatePeriodic += AuraEffectUpdatePeriodicFn(spell_gen_burn_brutallus_AuraScript::HandleEffectPeriodicUpdate, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE); + } + }; + + AuraScript* GetAuraScript() const { - OnEffectUpdatePeriodic += AuraEffectUpdatePeriodicFn(spell_gen_burn_brutallus_AuraScript::HandleEffectPeriodicUpdate, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE); + return new spell_gen_burn_brutallus_AuraScript(); } - }; - - AuraScript *GetAuraScript() const - { - return new spell_gen_burn_brutallus_AuraScript(); - } }; // 45472 Parachute @@ -125,135 +128,138 @@ enum eParachuteSpells class spell_gen_parachute : public SpellScriptLoader { -public: - spell_gen_parachute() : SpellScriptLoader("spell_gen_parachute") { } - - class spell_gen_parachute_AuraScript : public AuraScript - { - PrepareAuraScript(spell_gen_parachute_AuraScript) - bool Validate(SpellEntry const * /*spellEntry*/) - { - if (!sSpellStore.LookupEntry(SPELL_PARACHUTE)) - return false; - if (!sSpellStore.LookupEntry(SPELL_PARACHUTE_BUFF)) - return false; - return true; - } + public: + spell_gen_parachute() : SpellScriptLoader("spell_gen_parachute") { } - void HandleEffectPeriodic(AuraEffect const * /*aurEff*/) + class spell_gen_parachute_AuraScript : public AuraScript { - Unit* pTarget = GetTarget(); - if (Player* pPlayerTarget = pTarget->ToPlayer()) - if (pPlayerTarget->IsFalling()) + PrepareAuraScript(spell_gen_parachute_AuraScript); + + bool Validate(SpellEntry const* /*spellEntry*/) + { + if (!sSpellStore.LookupEntry(SPELL_PARACHUTE)) + return false; + if (!sSpellStore.LookupEntry(SPELL_PARACHUTE_BUFF)) + return false; + return true; + } + + void HandleEffectPeriodic(AuraEffect const* /*aurEff*/) + { + if (Player* target = GetTarget()->ToPlayer()) { - pPlayerTarget->RemoveAurasDueToSpell(SPELL_PARACHUTE); - pPlayerTarget->CastSpell(pPlayerTarget, SPELL_PARACHUTE_BUFF, true); + if (target->IsFalling()) + { + target->RemoveAurasDueToSpell(SPELL_PARACHUTE); + target->CastSpell(target, SPELL_PARACHUTE_BUFF, true); + } } - } + } - void Register() + void Register() + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_gen_parachute_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY); + } + }; + + AuraScript* GetAuraScript() const { - OnEffectPeriodic += AuraEffectPeriodicFn(spell_gen_parachute_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY); + return new spell_gen_parachute_AuraScript(); } - }; - - AuraScript *GetAuraScript() const - { - return new spell_gen_parachute_AuraScript(); - } }; enum NPCEntries { - NPC_DOOMGUARD = 11859, - NPC_INFERNAL = 89, - NPC_IMP = 416, + NPC_DOOMGUARD = 11859, + NPC_INFERNAL = 89, + NPC_IMP = 416, }; class spell_gen_pet_summoned : public SpellScriptLoader { -public: - spell_gen_pet_summoned() : SpellScriptLoader("spell_gen_pet_summoned") { } + public: + spell_gen_pet_summoned() : SpellScriptLoader("spell_gen_pet_summoned") { } - class spell_gen_pet_summonedSpellScript : public SpellScript - { - PrepareSpellScript(spell_gen_pet_summonedSpellScript) - void HandleScript(SpellEffIndex /*effIndex*/) + class spell_gen_pet_summoned_SpellScript : public SpellScript { - Unit *caster = GetCaster(); - if (caster->GetTypeId() != TYPEID_PLAYER) - return; + PrepareSpellScript(spell_gen_pet_summoned_SpellScript); - Player* plr = caster->ToPlayer(); - if (plr && plr->GetLastPetNumber()) + void HandleScript(SpellEffIndex /*effIndex*/) { - PetType NewPetType = (plr->getClass() == CLASS_HUNTER) ? HUNTER_PET : SUMMON_PET; - if (Pet* NewPet = new Pet(plr, NewPetType)) + Unit* caster = GetCaster(); + if (caster->GetTypeId() != TYPEID_PLAYER) + return; + + Player* plr = caster->ToPlayer(); + if (plr->GetLastPetNumber()) { - if (NewPet->LoadPetFromDB(plr, 0, plr->GetLastPetNumber(), true)) + PetType newPetType = (plr->getClass() == CLASS_HUNTER) ? HUNTER_PET : SUMMON_PET; + if (Pet* newPet = new Pet(plr, newPetType)) { - // revive the pet if it is dead - if (NewPet->getDeathState() == DEAD) - NewPet->setDeathState(ALIVE); + if (newPet->LoadPetFromDB(plr, 0, plr->GetLastPetNumber(), true)) + { + // revive the pet if it is dead + if (newPet->getDeathState() == DEAD) + newPet->setDeathState(ALIVE); - NewPet->SetFullHealth(); - NewPet->SetPower(NewPet->getPowerType(),NewPet->GetMaxPower(NewPet->getPowerType())); + newPet->SetFullHealth(); + newPet->SetPower(newPet->getPowerType(), newPet->GetMaxPower(newPet->getPowerType())); - switch (NewPet->GetEntry()) - { - case NPC_DOOMGUARD: - case NPC_INFERNAL: - NewPet->SetEntry(NPC_IMP); - break; - default: - break; + switch (newPet->GetEntry()) + { + case NPC_DOOMGUARD: + case NPC_INFERNAL: + newPet->SetEntry(NPC_IMP); + break; + default: + break; + } } + else + delete newPet; } - else - delete NewPet; } } - } - void Register() + void Register() + { + OnEffect += SpellEffectFn(spell_gen_pet_summoned_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const { - OnEffect += SpellEffectFn(spell_gen_pet_summonedSpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + return new spell_gen_pet_summoned_SpellScript(); } - }; - - SpellScript* GetSpellScript() const - { - return new spell_gen_pet_summonedSpellScript(); - } }; class spell_gen_remove_flight_auras : public SpellScriptLoader { -public: - spell_gen_remove_flight_auras() : SpellScriptLoader("spell_gen_remove_flight_auras") {} + public: + spell_gen_remove_flight_auras() : SpellScriptLoader("spell_gen_remove_flight_auras") {} - class spell_gen_remove_flight_auras_SpellScript : public SpellScript - { - PrepareSpellScript(spell_gen_remove_flight_auras_SpellScript) - void HandleScript(SpellEffIndex /*effIndex*/) - { - Unit *target = GetHitUnit(); - if (!target) - return; - target->RemoveAurasByType(SPELL_AURA_FLY); - target->RemoveAurasByType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED); - } + class spell_gen_remove_flight_auras_SpellScript : public SpellScript + { + PrepareSpellScript(spell_gen_remove_flight_auras_SpellScript); + void HandleScript(SpellEffIndex /*effIndex*/) + { + Unit* target = GetHitUnit(); + if (!target) + return; + target->RemoveAurasByType(SPELL_AURA_FLY); + target->RemoveAurasByType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED); + } - void Register() + void Register() + { + OnEffect += SpellEffectFn(spell_gen_remove_flight_auras_SpellScript::HandleScript, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const { - OnEffect += SpellEffectFn(spell_gen_remove_flight_auras_SpellScript::HandleScript, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT); + return new spell_gen_remove_flight_auras_SpellScript(); } - }; - - SpellScript* GetSpellScript() const - { - return new spell_gen_remove_flight_auras_SpellScript(); - } }; // 66118 Leeching Swarm @@ -265,46 +271,46 @@ enum eLeechingSwarmSpells class spell_gen_leeching_swarm : public SpellScriptLoader { -public: - spell_gen_leeching_swarm() : SpellScriptLoader("spell_gen_leeching_swarm") { } - - class spell_gen_leeching_swarm_AuraScript : public AuraScript - { - PrepareAuraScript(spell_gen_leeching_swarm_AuraScript) - bool Validate(SpellEntry const * /*spellEntry*/) - { - if (!sSpellStore.LookupEntry(SPELL_LEECHING_SWARM_DMG)) - return false; - if (!sSpellStore.LookupEntry(SPELL_LEECHING_SWARM_HEAL)) - return false; - return true; - } + public: + spell_gen_leeching_swarm() : SpellScriptLoader("spell_gen_leeching_swarm") { } - void HandleEffectPeriodic(AuraEffect const * aurEff) + class spell_gen_leeching_swarm_AuraScript : public AuraScript { - if (Unit* pTarget = GetTarget()) - if (Unit* pCaster = GetCaster()) + PrepareAuraScript(spell_gen_leeching_swarm_AuraScript); + + bool Validate(SpellEntry const* /*spellEntry*/) + { + if (!sSpellStore.LookupEntry(SPELL_LEECHING_SWARM_DMG)) + return false; + if (!sSpellStore.LookupEntry(SPELL_LEECHING_SWARM_HEAL)) + return false; + return true; + } + + void HandleEffectPeriodic(AuraEffect const* aurEff) + { + if (Unit* caster = GetCaster()) { - int32 lifeLeeched = pTarget->CountPctFromCurHealth(aurEff->GetAmount()); + int32 lifeLeeched = GetTarget()->CountPctFromCurHealth(aurEff->GetAmount()); if (lifeLeeched < 250) lifeLeeched = 250; // Damage - pCaster->CastCustomSpell(pTarget, SPELL_LEECHING_SWARM_DMG, &lifeLeeched, 0, 0, false); + caster->CastCustomSpell(GetTarget(), SPELL_LEECHING_SWARM_DMG, &lifeLeeched, 0, 0, false); // Heal - pCaster->CastCustomSpell(pCaster, SPELL_LEECHING_SWARM_HEAL, &lifeLeeched, 0, 0, false); + caster->CastCustomSpell(caster, SPELL_LEECHING_SWARM_HEAL, &lifeLeeched, 0, 0, false); } - } + } - void Register() + void Register() + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_gen_leeching_swarm_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY); + } + }; + + AuraScript* GetAuraScript() const { - OnEffectPeriodic += AuraEffectPeriodicFn(spell_gen_leeching_swarm_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY); + return new spell_gen_leeching_swarm_AuraScript(); } - }; - - AuraScript *GetAuraScript() const - { - return new spell_gen_leeching_swarm_AuraScript(); - } }; // 24750 Trick @@ -324,65 +330,78 @@ enum eTrickSpells class spell_gen_trick : public SpellScriptLoader { -public: - spell_gen_trick() : SpellScriptLoader("spell_gen_trick") {} - - class spell_gen_trick_SpellScript : public SpellScript - { - PrepareSpellScript(spell_gen_trick_SpellScript) - bool Validate(SpellEntry const * /*spellEntry*/) - { - if (!sSpellStore.LookupEntry(SPELL_PIRATE_COSTUME_MALE)) - return false; - if (!sSpellStore.LookupEntry(SPELL_PIRATE_COSTUME_FEMALE)) - return false; - if (!sSpellStore.LookupEntry(SPELL_NINJA_COSTUME_MALE)) - return false; - if (!sSpellStore.LookupEntry(SPELL_NINJA_COSTUME_FEMALE)) - return false; - if (!sSpellStore.LookupEntry(SPELL_LEPER_GNOME_COSTUME_MALE)) - return false; - if (!sSpellStore.LookupEntry(SPELL_LEPER_GNOME_COSTUME_FEMALE)) - return false; - if (!sSpellStore.LookupEntry(SPELL_SKELETON_COSTUME)) - return false; - if (!sSpellStore.LookupEntry(SPELL_GHOST_COSTUME_MALE)) - return false; - if (!sSpellStore.LookupEntry(SPELL_GHOST_COSTUME_FEMALE)) - return false; - if (!sSpellStore.LookupEntry(SPELL_TRICK_BUFF)) - return false; - return true; - } + public: + spell_gen_trick() : SpellScriptLoader("spell_gen_trick") {} - void HandleScript(SpellEffIndex /*effIndex*/) + class spell_gen_trick_SpellScript : public SpellScript { - if (Player* pTarget = GetHitPlayer()) + PrepareSpellScript(spell_gen_trick_SpellScript); + bool Validate(SpellEntry const* /*spellEntry*/) + { + if (!sSpellStore.LookupEntry(SPELL_PIRATE_COSTUME_MALE)) + return false; + if (!sSpellStore.LookupEntry(SPELL_PIRATE_COSTUME_FEMALE)) + return false; + if (!sSpellStore.LookupEntry(SPELL_NINJA_COSTUME_MALE)) + return false; + if (!sSpellStore.LookupEntry(SPELL_NINJA_COSTUME_FEMALE)) + return false; + if (!sSpellStore.LookupEntry(SPELL_LEPER_GNOME_COSTUME_MALE)) + return false; + if (!sSpellStore.LookupEntry(SPELL_LEPER_GNOME_COSTUME_FEMALE)) + return false; + if (!sSpellStore.LookupEntry(SPELL_SKELETON_COSTUME)) + return false; + if (!sSpellStore.LookupEntry(SPELL_GHOST_COSTUME_MALE)) + return false; + if (!sSpellStore.LookupEntry(SPELL_GHOST_COSTUME_FEMALE)) + return false; + if (!sSpellStore.LookupEntry(SPELL_TRICK_BUFF)) + return false; + return true; + } + + void HandleScript(SpellEffIndex /*effIndex*/) { - uint8 gender = pTarget->getGender(); - uint32 spellId = SPELL_TRICK_BUFF; - switch (urand(0, 5)) + if (Player* target = GetHitPlayer()) { - case 1: spellId = gender ? SPELL_LEPER_GNOME_COSTUME_FEMALE : SPELL_LEPER_GNOME_COSTUME_MALE; break; - case 2: spellId = gender ? SPELL_PIRATE_COSTUME_FEMALE : SPELL_PIRATE_COSTUME_MALE; break; - case 3: spellId = gender ? SPELL_GHOST_COSTUME_FEMALE : SPELL_GHOST_COSTUME_MALE; break; - case 4: spellId = gender ? SPELL_NINJA_COSTUME_FEMALE : SPELL_NINJA_COSTUME_MALE; break; - case 5: spellId = SPELL_SKELETON_COSTUME; break; + uint8 gender = target->getGender(); + uint32 spellId = SPELL_TRICK_BUFF; + switch (urand(0, 5)) + { + case 1: + spellId = gender ? SPELL_LEPER_GNOME_COSTUME_FEMALE : SPELL_LEPER_GNOME_COSTUME_MALE; + break; + case 2: + spellId = gender ? SPELL_PIRATE_COSTUME_FEMALE : SPELL_PIRATE_COSTUME_MALE; + break; + case 3: + spellId = gender ? SPELL_GHOST_COSTUME_FEMALE : SPELL_GHOST_COSTUME_MALE; + break; + case 4: + spellId = gender ? SPELL_NINJA_COSTUME_FEMALE : SPELL_NINJA_COSTUME_MALE; + break; + case 5: + spellId = SPELL_SKELETON_COSTUME; + break; + default: + break; + } + + GetCaster()->CastSpell(target, spellId, true, NULL); } - GetCaster()->CastSpell(pTarget, spellId, true, NULL); } - } - void Register() + void Register() + { + OnEffect += SpellEffectFn(spell_gen_trick_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const { - OnEffect += SpellEffectFn(spell_gen_trick_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + return new spell_gen_trick_SpellScript(); } - }; - - SpellScript* GetSpellScript() const - { - return new spell_gen_trick_SpellScript(); - } }; // 24751 Trick or Treat @@ -395,42 +414,43 @@ enum eTrickOrTreatSpells class spell_gen_trick_or_treat : public SpellScriptLoader { -public: - spell_gen_trick_or_treat() : SpellScriptLoader("spell_gen_trick_or_treat") {} - - class spell_gen_trick_or_treat_SpellScript : public SpellScript - { - PrepareSpellScript(spell_gen_trick_or_treat_SpellScript) - bool Validate(SpellEntry const * /*spellEntry*/) - { - if (!sSpellStore.LookupEntry(SPELL_TRICK)) - return false; - if (!sSpellStore.LookupEntry(SPELL_TREAT)) - return false; - if (!sSpellStore.LookupEntry(SPELL_TRICKED_OR_TREATED)) - return false; - return true; - } + public: + spell_gen_trick_or_treat() : SpellScriptLoader("spell_gen_trick_or_treat") {} - void HandleScript(SpellEffIndex /*effIndex*/) + class spell_gen_trick_or_treat_SpellScript : public SpellScript { - if (Player* pTarget = GetHitPlayer()) + PrepareSpellScript(spell_gen_trick_or_treat_SpellScript); + + bool Validate(SpellEntry const* /*spellEntry*/) { - GetCaster()->CastSpell(pTarget, roll_chance_i(50) ? SPELL_TRICK : SPELL_TREAT, true, NULL); - GetCaster()->CastSpell(pTarget, SPELL_TRICKED_OR_TREATED, true, NULL); + if (!sSpellStore.LookupEntry(SPELL_TRICK)) + return false; + if (!sSpellStore.LookupEntry(SPELL_TREAT)) + return false; + if (!sSpellStore.LookupEntry(SPELL_TRICKED_OR_TREATED)) + return false; + return true; } - } - void Register() + void HandleScript(SpellEffIndex /*effIndex*/) + { + if (Player* pTarget = GetHitPlayer()) + { + GetCaster()->CastSpell(pTarget, roll_chance_i(50) ? SPELL_TRICK : SPELL_TREAT, true, NULL); + GetCaster()->CastSpell(pTarget, SPELL_TRICKED_OR_TREATED, true, NULL); + } + } + + void Register() + { + OnEffect += SpellEffectFn(spell_gen_trick_or_treat_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const { - OnEffect += SpellEffectFn(spell_gen_trick_or_treat_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + return new spell_gen_trick_or_treat_SpellScript(); } - }; - - SpellScript* GetSpellScript() const - { - return new spell_gen_trick_or_treat_SpellScript(); - } }; class spell_creature_permanent_feign_death : public SpellScriptLoader @@ -438,27 +458,27 @@ class spell_creature_permanent_feign_death : public SpellScriptLoader public: spell_creature_permanent_feign_death() : SpellScriptLoader("spell_creature_permanent_feign_death") { } - class spell_creature_permanent_feign_deathAuraScript : public AuraScript + class spell_creature_permanent_feign_death_AuraScript : public AuraScript { - PrepareAuraScript(spell_creature_permanent_feign_deathAuraScript) - void HandleEffectApply(AuraEffect const * /*aurEff*/, AuraEffectHandleModes /*mode*/) - { - Unit* pTarget = GetTarget(); + PrepareAuraScript(spell_creature_permanent_feign_death_AuraScript); - pTarget->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD); - pTarget->SetFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FEIGN_DEATH); + void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + Unit* target = GetTarget(); + target->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD); + target->SetFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FEIGN_DEATH); } void Register() { - OnEffectApply += AuraEffectApplyFn(spell_creature_permanent_feign_deathAuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + OnEffectApply += AuraEffectApplyFn(spell_creature_permanent_feign_death_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); } }; - AuraScript *GetAuraScript() const - { - return new spell_creature_permanent_feign_deathAuraScript(); - } + AuraScript* GetAuraScript() const + { + return new spell_creature_permanent_feign_death_AuraScript(); + } }; enum PvPTrinketTriggeredSpells @@ -469,47 +489,48 @@ enum PvPTrinketTriggeredSpells class spell_pvp_trinket_wotf_shared_cd : public SpellScriptLoader { -public: - spell_pvp_trinket_wotf_shared_cd() : SpellScriptLoader("spell_pvp_trinket_wotf_shared_cd") {} - - class spell_pvp_trinket_wotf_shared_cd_SpellScript : public SpellScript - { - PrepareSpellScript(spell_pvp_trinket_wotf_shared_cd_SpellScript) - bool Validate(SpellEntry const * /*spellEntry*/) - { - if (!sSpellStore.LookupEntry(SPELL_WILL_OF_THE_FORSAKEN_COOLDOWN_TRIGGER)) - return false; - if (!sSpellStore.LookupEntry(SPELL_WILL_OF_THE_FORSAKEN_COOLDOWN_TRIGGER_WOTF)) - return false; - return true; - } + public: + spell_pvp_trinket_wotf_shared_cd() : SpellScriptLoader("spell_pvp_trinket_wotf_shared_cd") {} - void HandleScript(SpellEffIndex /*effIndex*/) + class spell_pvp_trinket_wotf_shared_cd_SpellScript : public SpellScript { - Player* pCaster = GetCaster()->ToPlayer(); - if (!pCaster) - return; - const SpellEntry* m_spellInfo = GetSpellInfo(); + PrepareSpellScript(spell_pvp_trinket_wotf_shared_cd_SpellScript); - pCaster->AddSpellCooldown(m_spellInfo->Id, NULL, time(NULL) + GetSpellRecoveryTime(sSpellStore.LookupEntry(SPELL_WILL_OF_THE_FORSAKEN_COOLDOWN_TRIGGER)) / IN_MILLISECONDS); - WorldPacket data(SMSG_SPELL_COOLDOWN, 8+1+4); - data << uint64(pCaster->GetGUID()); - data << uint8(0); - data << uint32(m_spellInfo->Id); - data << uint32(0); - pCaster->GetSession()->SendPacket(&data); - } + bool Validate(SpellEntry const* /*spellEntry*/) + { + if (!sSpellStore.LookupEntry(SPELL_WILL_OF_THE_FORSAKEN_COOLDOWN_TRIGGER)) + return false; + if (!sSpellStore.LookupEntry(SPELL_WILL_OF_THE_FORSAKEN_COOLDOWN_TRIGGER_WOTF)) + return false; + return true; + } - void Register() + void HandleScript(SpellEffIndex /*effIndex*/) + { + Player* caster = GetCaster()->ToPlayer(); + if (!caster) + return; + SpellEntry const* spellInfo = GetSpellInfo(); + + caster->AddSpellCooldown(spellInfo->Id, NULL, time(NULL) + GetSpellRecoveryTime(sSpellStore.LookupEntry(SPELL_WILL_OF_THE_FORSAKEN_COOLDOWN_TRIGGER)) / IN_MILLISECONDS); + WorldPacket data(SMSG_SPELL_COOLDOWN, 8+1+4); + data << uint64(caster->GetGUID()); + data << uint8(0); + data << uint32(spellInfo->Id); + data << uint32(0); + caster->GetSession()->SendPacket(&data); + } + + void Register() + { + OnEffect += SpellEffectFn(spell_pvp_trinket_wotf_shared_cd_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const { - OnEffect += SpellEffectFn(spell_pvp_trinket_wotf_shared_cd_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_DUMMY); + return new spell_pvp_trinket_wotf_shared_cd_SpellScript(); } - }; - - SpellScript* GetSpellScript() const - { - return new spell_pvp_trinket_wotf_shared_cd_SpellScript(); - } }; enum AnimalBloodPoolSpell @@ -565,18 +586,18 @@ class spell_gen_shroud_of_death : public SpellScriptLoader public: spell_gen_shroud_of_death() : SpellScriptLoader("spell_gen_shroud_of_death") { } - class spell_gen_shroud_of_deathAuraScript : public AuraScript + class spell_gen_shroud_of_death_AuraScript : public AuraScript { - PrepareAuraScript(spell_gen_shroud_of_deathAuraScript) + PrepareAuraScript(spell_gen_shroud_of_death_AuraScript); - void HandleEffectApply(AuraEffect const * /*aurEff*/, AuraEffectHandleModes /*mode*/) + void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { Unit* target = GetTarget(); target->m_serverSideVisibility.SetValue(SERVERSIDE_VISIBILITY_GHOST, GHOST_VISIBILITY_GHOST); target->m_serverSideVisibilityDetect.SetValue(SERVERSIDE_VISIBILITY_GHOST, GHOST_VISIBILITY_GHOST); } - void HandleEffectRemove(AuraEffect const * /*aurEff*/, AuraEffectHandleModes /*mode*/) + void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { Unit* target = GetTarget(); target->m_serverSideVisibility.SetValue(SERVERSIDE_VISIBILITY_GHOST, GHOST_VISIBILITY_ALIVE); @@ -585,14 +606,14 @@ class spell_gen_shroud_of_death : public SpellScriptLoader void Register() { - OnEffectApply += AuraEffectApplyFn(spell_gen_shroud_of_deathAuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); - OnEffectRemove += AuraEffectRemoveFn(spell_gen_shroud_of_deathAuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + OnEffectApply += AuraEffectApplyFn(spell_gen_shroud_of_death_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + OnEffectRemove += AuraEffectRemoveFn(spell_gen_shroud_of_death_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); } }; - AuraScript *GetAuraScript() const + AuraScript* GetAuraScript() const { - return new spell_gen_shroud_of_deathAuraScript(); + return new spell_gen_shroud_of_death_AuraScript(); } }; @@ -604,69 +625,69 @@ enum DivineStormSpell // 70769 Divine Storm! class spell_gen_divine_storm_cd_reset : public SpellScriptLoader { -public: - spell_gen_divine_storm_cd_reset() : SpellScriptLoader("spell_gen_divine_storm_cd_reset") {} + public: + spell_gen_divine_storm_cd_reset() : SpellScriptLoader("spell_gen_divine_storm_cd_reset") {} - class spell_gen_divine_storm_cd_reset_SpellScript : public SpellScript - { - PrepareSpellScript(spell_gen_divine_storm_cd_reset_SpellScript) - bool Validate(SpellEntry const * /*spellEntry*/) + class spell_gen_divine_storm_cd_reset_SpellScript : public SpellScript { - if (!sSpellStore.LookupEntry(SPELL_DIVINE_STORM)) - return false; - return true; - } + PrepareSpellScript(spell_gen_divine_storm_cd_reset_SpellScript); - void HandleScript(SpellEffIndex /*effIndex*/) - { - if (Player *caster = GetCaster()->ToPlayer()) - if (caster->HasSpellCooldown(SPELL_DIVINE_STORM)) - caster->RemoveSpellCooldown(SPELL_DIVINE_STORM, true); - } + bool Validate(SpellEntry const* /*spellEntry*/) + { + if (!sSpellStore.LookupEntry(SPELL_DIVINE_STORM)) + return false; + return true; + } - void Register() + void HandleScript(SpellEffIndex /*effIndex*/) + { + if (Player *caster = GetCaster()->ToPlayer()) + if (caster->HasSpellCooldown(SPELL_DIVINE_STORM)) + caster->RemoveSpellCooldown(SPELL_DIVINE_STORM, true); + } + + void Register() + { + OnEffect += SpellEffectFn(spell_gen_divine_storm_cd_reset_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const { - OnEffect += SpellEffectFn(spell_gen_divine_storm_cd_reset_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_DUMMY); + return new spell_gen_divine_storm_cd_reset_SpellScript(); } - }; - - SpellScript* GetSpellScript() const - { - return new spell_gen_divine_storm_cd_reset_SpellScript(); - } }; class spell_gen_gunship_portal : public SpellScriptLoader { -public: - spell_gen_gunship_portal() : SpellScriptLoader("spell_gen_gunship_portal") { } + public: + spell_gen_gunship_portal() : SpellScriptLoader("spell_gen_gunship_portal") { } - class spell_gen_gunship_portalSpellScript : public SpellScript - { - PrepareSpellScript(spell_gen_gunship_portalSpellScript) - void HandleScript(SpellEffIndex /*effIndex*/) + class spell_gen_gunship_portal_SpellScript : public SpellScript { - Unit* caster = GetCaster(); - if (!caster->ToPlayer()) - return; + PrepareSpellScript(spell_gen_gunship_portal_SpellScript); - if (Battleground *bg = caster->ToPlayer()->GetBattleground()) + void HandleScript(SpellEffIndex /*effIndex*/) { - if (bg->GetTypeID(true) == BATTLEGROUND_IC) - bg->DoAction(1,caster->GetGUID()); + Unit* caster = GetCaster(); + if (caster->GetTypeId() != TYPEID_PLAYER) + return; + + if (Battleground *bg = caster->ToPlayer()->GetBattleground()) + if (bg->GetTypeID(true) == BATTLEGROUND_IC) + bg->DoAction(1, caster->GetGUID()); } - } - void Register() + void Register() + { + OnEffect += SpellEffectFn(spell_gen_gunship_portal_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const { - OnEffect += SpellEffectFn(spell_gen_gunship_portalSpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + return new spell_gen_gunship_portal_SpellScript(); } - }; - - SpellScript* GetSpellScript() const - { - return new spell_gen_gunship_portalSpellScript(); - } }; enum parachuteIC @@ -679,11 +700,11 @@ class spell_gen_parachute_ic : public SpellScriptLoader public: spell_gen_parachute_ic() : SpellScriptLoader("spell_gen_parachute_ic") { } - class spell_gen_parachute_icAuraScript : public AuraScript + class spell_gen_parachute_ic_AuraScript : public AuraScript { - PrepareAuraScript(spell_gen_parachute_icAuraScript) + PrepareAuraScript(spell_gen_parachute_ic_AuraScript) - void HandleTriggerSpell(AuraEffect const * /*aurEff*/) + void HandleTriggerSpell(AuraEffect const* /*aurEff*/) { Unit* target = GetTarget(); @@ -696,13 +717,13 @@ class spell_gen_parachute_ic : public SpellScriptLoader void Register() { - OnEffectPeriodic += AuraEffectPeriodicFn(spell_gen_parachute_icAuraScript::HandleTriggerSpell, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL); + OnEffectPeriodic += AuraEffectPeriodicFn(spell_gen_parachute_ic_AuraScript::HandleTriggerSpell, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL); } }; - AuraScript *GetAuraScript() const + AuraScript* GetAuraScript() const { - return new spell_gen_parachute_icAuraScript(); + return new spell_gen_parachute_ic_AuraScript(); } }; @@ -747,6 +768,38 @@ class spell_gen_dungeon_credit : public SpellScriptLoader } }; +class spell_gen_profession_research : public SpellScriptLoader +{ + public: + spell_gen_profession_research() : SpellScriptLoader("spell_gen_profession_research") {} + + class spell_gen_profession_research_SpellScript : public SpellScript + { + PrepareSpellScript(spell_gen_profession_research_SpellScript); + + SpellCastResult CheckRequirement() + { + if (GetCaster()->GetTypeId() == TYPEID_PLAYER && HasDiscoveredAllSpells(GetSpellInfo()->Id, GetCaster()->ToPlayer())) + { + SetCustomCastResultMessage(SPELL_CUSTOM_ERROR_NOTHING_TO_DISCOVER); + return SPELL_FAILED_CUSTOM_ERROR; + } + + return SPELL_CAST_OK; + } + + void Register() + { + OnCheckCast += SpellCheckCastFn(spell_gen_profession_research_SpellScript::CheckRequirement); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_gen_profession_research_SpellScript(); + } +}; + // 66313 Fire Bomb enum FireBombNPC { @@ -958,6 +1011,45 @@ class spell_gen_biting_cold_dot : public SpellScriptLoader } }; +// 67039 Argent Squire/Gruntling - Mounting Check - Aura +class spell_gen_mounting_check : public SpellScriptLoader +{ +public: + spell_gen_mounting_check() : SpellScriptLoader("spell_gen_mounting_check") { } + + class spell_gen_mounting_check_AuraScript : public AuraScript + { + PrepareAuraScript(spell_gen_mounting_check_AuraScript) + + public: + spell_gen_mounting_check_AuraScript() { } + + void HandleEffectPeriodic(AuraEffect const * aurEff) + { + if (Unit* caster = GetCaster()) + { + if (caster->GetOwner()) + { + if (caster->GetOwner()->IsMounted()) + caster->Mount(29736); + else if (caster->IsMounted()) + caster->Unmount(); + } + } + } + + void Register() + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_gen_mounting_check_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_gen_mounting_check_AuraScript(); + } +}; + void AddSC_generic_spell_scripts() { new spell_gen_absorb0_hitlimit1(); @@ -977,8 +1069,10 @@ void AddSC_generic_spell_scripts() new spell_gen_parachute_ic(); new spell_gen_gunship_portal(); new spell_gen_dungeon_credit(); + new spell_gen_profession_research(); new spell_gen_fire_bomb(); new spell_gen_rapid_burst(); new spell_gen_biting_cold(); new spell_gen_biting_cold_dot(); + new spell_gen_mounting_check(); } diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index 43589c68180ee..3ddd5af6ed1ea 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -22,6 +22,7 @@ */ #include "ScriptPCH.h" +#include "SkillDiscovery.h" // Generic script for handling item dummy effects which trigger another spell. class spell_item_trigger_spell : public SpellScriptLoader @@ -827,6 +828,7 @@ class spell_item_create_heart_candy : public SpellScriptLoader void HandleScript(SpellEffIndex effIndex) { + PreventHitDefaultEffect(effIndex); if (!GetHitUnit() || !GetHitUnit()->ToPlayer()) return; @@ -849,6 +851,118 @@ class spell_item_create_heart_candy : public SpellScriptLoader } }; +class spell_item_book_of_glyph_mastery : public SpellScriptLoader +{ + public: + spell_item_book_of_glyph_mastery() : SpellScriptLoader("spell_item_book_of_glyph_mastery") {} + + class spell_item_book_of_glyph_mastery_SpellScript : public SpellScript + { + PrepareSpellScript(spell_item_book_of_glyph_mastery_SpellScript); + + SpellCastResult CheckRequirement() + { + if (GetCaster()->GetTypeId() == TYPEID_PLAYER && HasDiscoveredAllSpells(GetSpellInfo()->Id, GetCaster()->ToPlayer())) + { + SetCustomCastResultMessage(SPELL_CUSTOM_ERROR_LEARNED_EVERYTHING); + return SPELL_FAILED_CUSTOM_ERROR; + } + + return SPELL_CAST_OK; + } + + void Register() + { + OnCheckCast += SpellCheckCastFn(spell_item_book_of_glyph_mastery_SpellScript::CheckRequirement); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_item_book_of_glyph_mastery_SpellScript(); + } +}; + +enum GiftOfTheHarvester +{ + NPC_GHOUL = 28845, + MAX_GHOULS = 5, +}; + +class spell_item_gift_of_the_harvester : public SpellScriptLoader +{ + public: + spell_item_gift_of_the_harvester() : SpellScriptLoader("spell_item_gift_of_the_harvester") {} + + class spell_item_gift_of_the_harvester_SpellScript : public SpellScript + { + PrepareSpellScript(spell_item_gift_of_the_harvester_SpellScript); + + SpellCastResult CheckRequirement() + { + std::list ghouls; + GetCaster()->GetAllMinionsByEntry(ghouls, NPC_GHOUL); + if (ghouls.size() >= MAX_GHOULS) + { + SetCustomCastResultMessage(SPELL_CUSTOM_ERROR_TOO_MANY_GHOULS); + return SPELL_FAILED_CUSTOM_ERROR; + } + + return SPELL_CAST_OK; + } + + void Register() + { + OnCheckCast += SpellCheckCastFn(spell_item_gift_of_the_harvester_SpellScript::CheckRequirement); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_item_gift_of_the_harvester_SpellScript(); + } +}; + +enum Sinkholes +{ + NPC_SOUTH_SINKHOLE = 25664, + NPC_NORTHEAST_SINKHOLE = 25665, + NPC_NORTHWEST_SINKHOLE = 25666, +}; + +class spell_item_map_of_the_geyser_fields : public SpellScriptLoader +{ + public: + spell_item_map_of_the_geyser_fields() : SpellScriptLoader("spell_item_map_of_the_geyser_fields") {} + + class spell_item_map_of_the_geyser_fields_SpellScript : public SpellScript + { + PrepareSpellScript(spell_item_map_of_the_geyser_fields_SpellScript); + + SpellCastResult CheckSinkholes() + { + Unit* caster = GetCaster(); + if (caster->FindNearestCreature(NPC_SOUTH_SINKHOLE, 30.0f, true) || + caster->FindNearestCreature(NPC_NORTHEAST_SINKHOLE, 30.0f, true) || + caster->FindNearestCreature(NPC_NORTHWEST_SINKHOLE, 30.0f, true)) + return SPELL_CAST_OK; + + SetCustomCastResultMessage(SPELL_CUSTOM_ERROR_MUST_BE_CLOSE_TO_SINKHOLE); + return SPELL_FAILED_CUSTOM_ERROR; + } + + void Register() + { + OnCheckCast += SpellCheckCastFn(spell_item_map_of_the_geyser_fields_SpellScript::CheckSinkholes); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_item_map_of_the_geyser_fields_SpellScript(); + } +}; + void AddSC_item_spell_scripts() { // 23074 Arcanite Dragonling @@ -874,4 +988,7 @@ void AddSC_item_spell_scripts() new spell_item_red_rider_air_rifle(); new spell_item_create_heart_candy(); + new spell_item_book_of_glyph_mastery(); + new spell_item_gift_of_the_harvester(); + new spell_item_map_of_the_geyser_fields(); } diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index c6fb1332333a7..b45038e52a1e4 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -27,7 +27,7 @@ class spell_generic_quest_update_entry_SpellScript : public SpellScript { PrepareSpellScript(spell_generic_quest_update_entry_SpellScript) private: - uint32 _spellEffect; + uint16 _spellEffect; uint8 _effIndex; uint32 _originalEntry; uint32 _newEntry; @@ -35,21 +35,21 @@ class spell_generic_quest_update_entry_SpellScript : public SpellScript uint32 _despawnTime; public: - spell_generic_quest_update_entry_SpellScript(uint32 spellEffect, uint8 effIndex, uint32 originalEntry, uint32 newEntry, bool shouldAttack, uint32 despawnTime = 0) : + spell_generic_quest_update_entry_SpellScript(uint16 spellEffect, uint8 effIndex, uint32 originalEntry, uint32 newEntry, bool shouldAttack, uint32 despawnTime = 0) : SpellScript(), _spellEffect(spellEffect), _effIndex(effIndex), _originalEntry(originalEntry), _newEntry(newEntry), _shouldAttack(shouldAttack), _despawnTime(despawnTime) { } void HandleDummy(SpellEffIndex /*effIndex*/) { - if (Creature* pCreatureTarget = GetHitCreature()) - if (!pCreatureTarget->isPet() && pCreatureTarget->GetEntry() == _originalEntry) + if (Creature* creatureTarget = GetHitCreature()) + if (!creatureTarget->isPet() && creatureTarget->GetEntry() == _originalEntry) { - pCreatureTarget->UpdateEntry(_newEntry); - if (_shouldAttack && pCreatureTarget->IsAIEnabled) - pCreatureTarget->AI()->AttackStart(GetCaster()); + creatureTarget->UpdateEntry(_newEntry); + if (_shouldAttack && creatureTarget->IsAIEnabled) + creatureTarget->AI()->AttackStart(GetCaster()); if (_despawnTime) - pCreatureTarget->DespawnOrUnsummon(_despawnTime); + creatureTarget->DespawnOrUnsummon(_despawnTime); } } @@ -729,6 +729,53 @@ class spell_q12937_relief_for_the_fallen : public SpellScriptLoader } }; +enum eWhoarethey +{ + SPELL_QUESTGIVER = 48917, + + SPELL_MALE_DISGUISE = 38080, + SPELL_FEMALE_DISGUISE = 38081, + SPELL_GENERIC_DISGUISE = 32756 +}; + +class spell_q10041_q10040_who_are_they : public SpellScriptLoader +{ + public: + spell_q10041_q10040_who_are_they() : SpellScriptLoader("spell_q10041_q10040_who_are_they") { } + + class spell_q10041_q10040_who_are_they_SpellScript : public SpellScript + { + PrepareSpellScript(spell_q10041_q10040_who_are_they_SpellScript); + + bool Validate(SpellEntry const * /*spellEntry*/) + { + if (!sSpellStore.LookupEntry(SPELL_QUESTGIVER)) + return false; + return true; + } + + void HandleScript(SpellEffIndex effIndex) + { + PreventHitDefaultEffect(effIndex); + if (!GetHitUnit() || !GetHitUnit()->ToPlayer()) + return; + + GetHitUnit()->CastSpell(GetHitUnit(), GetHitUnit()->getGender() == GENDER_MALE ? SPELL_MALE_DISGUISE : SPELL_FEMALE_DISGUISE, true); + GetHitUnit()->CastSpell(GetHitUnit(), SPELL_GENERIC_DISGUISE, true); + } + + void Register() + { + OnEffect += SpellEffectFn(spell_q10041_q10040_who_are_they_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_q10041_q10040_who_are_they_SpellScript(); + } +}; + void AddSC_quest_spell_scripts() { new spell_q55_sacred_cleansing(); @@ -746,4 +793,5 @@ void AddSC_quest_spell_scripts() new spell_q12683_take_sputum_sample(); new spell_q12851_going_bearback(); new spell_q12937_relief_for_the_fallen(); + new spell_q10041_q10040_who_are_they(); } diff --git a/src/server/scripts/Spells/spell_rogue.cpp b/src/server/scripts/Spells/spell_rogue.cpp index 080426fc75cba..b34a543580855 100644 --- a/src/server/scripts/Spells/spell_rogue.cpp +++ b/src/server/scripts/Spells/spell_rogue.cpp @@ -252,7 +252,6 @@ class spell_rog_prey_on_the_weak : public SpellScriptLoader } }; - class spell_rog_shiv : public SpellScriptLoader { public: diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp index 363988bbe92d2..4806457435dcb 100644 --- a/src/server/scripts/Spells/spell_shaman.cpp +++ b/src/server/scripts/Spells/spell_shaman.cpp @@ -102,24 +102,33 @@ class spell_sha_fire_nova : public SpellScriptLoader return true; } + SpellCastResult CheckFireTotem() + { + // fire totem + if (!GetCaster()->m_SummonSlot[1]) + { + SetCustomCastResultMessage(SPELL_CUSTOM_ERROR_MUST_HAVE_FIRE_TOTEM); + return SPELL_FAILED_CUSTOM_ERROR; + } + + return SPELL_CAST_OK; + } + void HandleDummy(SpellEffIndex /*effIndex*/) { - if (Unit* caster = GetCaster()) + Unit* caster = GetCaster(); + uint8 rank = sSpellMgr->GetSpellRank(GetSpellInfo()->Id); + if (uint32 spellId = sSpellMgr->GetSpellWithRank(SHAMAN_SPELL_FIRE_NOVA_TRIGGERED_R1, rank)) { - uint8 rank = sSpellMgr->GetSpellRank(GetSpellInfo()->Id); - uint32 spellId = sSpellMgr->GetSpellWithRank(SHAMAN_SPELL_FIRE_NOVA_TRIGGERED_R1, rank); - // fire slot - if (spellId && caster->m_SummonSlot[1]) - { - Creature* totem = caster->GetMap()->GetCreature(caster->m_SummonSlot[1]); - if (totem && totem->isTotem()) - totem->CastSpell(totem, spellId, true); - } + Creature* totem = caster->GetMap()->GetCreature(caster->m_SummonSlot[1]); + if (totem && totem->isTotem()) + totem->CastSpell(totem, spellId, true); } } void Register() { + OnCheckCast += SpellCheckCastFn(spell_sha_fire_nova_SpellScript::CheckFireTotem); OnEffect += SpellEffectFn(spell_sha_fire_nova_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); } }; diff --git a/src/server/scripts/World/boss_emeriss.cpp b/src/server/scripts/World/boss_emeriss.cpp index db91df51d2c52..9051e6f1a6dea 100644 --- a/src/server/scripts/World/boss_emeriss.cpp +++ b/src/server/scripts/World/boss_emeriss.cpp @@ -75,7 +75,7 @@ class boss_emeriss : public CreatureScript //Sleep_Timer if (m_uiSleep_Timer <= uiDiff) { - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(pTarget, SPELL_SLEEP); m_uiSleep_Timer = 8000 + rand()%8000; diff --git a/src/server/scripts/World/boss_taerar.cpp b/src/server/scripts/World/boss_taerar.cpp index b90f1b6939e5d..e83aef49e16b8 100644 --- a/src/server/scripts/World/boss_taerar.cpp +++ b/src/server/scripts/World/boss_taerar.cpp @@ -90,7 +90,7 @@ class boss_taerar : public CreatureScript void JustSummoned(Creature* pSummoned) { - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) pSummoned->AI()->AttackStart(pTarget); } @@ -117,7 +117,7 @@ class boss_taerar : public CreatureScript //Sleep_Timer if (m_uiSleep_Timer <= uiDiff) { - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(pTarget, SPELL_SLEEP); m_uiSleep_Timer = 8000 + rand()%7000; @@ -164,7 +164,7 @@ class boss_taerar : public CreatureScript //Summon 3 Shades at 75%, 50% and 25% (if bShades is true we already left in line 117, no need to check here again) if (!m_bShades && !HealthAbovePct(100 - 25 * m_uiShadesSummoned)) { - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) { //Interrupt any spell casting me->InterruptNonMeleeSpells(false); diff --git a/src/server/scripts/World/boss_ysondre.cpp b/src/server/scripts/World/boss_ysondre.cpp index 9f5e3c66a9af2..9c3c5d40291aa 100644 --- a/src/server/scripts/World/boss_ysondre.cpp +++ b/src/server/scripts/World/boss_ysondre.cpp @@ -75,7 +75,7 @@ class boss_ysondre : public CreatureScript void JustSummoned(Creature* pSummoned) { - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) pSummoned->AI()->AttackStart(pTarget); } @@ -87,7 +87,7 @@ class boss_ysondre : public CreatureScript //Sleep_Timer if (m_uiSleep_Timer <= uiDiff) { - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(pTarget, SPELL_SLEEP); m_uiSleep_Timer = 8000 + rand()%7000; @@ -107,7 +107,7 @@ class boss_ysondre : public CreatureScript //Tailsweep every 2 seconds if (m_uiTailSweep_Timer <= uiDiff) { - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(pTarget, SPELL_TAILSWEEP); m_uiTailSweep_Timer = 2000; @@ -119,7 +119,7 @@ class boss_ysondre : public CreatureScript if (m_uiLightningWave_Timer <= uiDiff) { //Cast LIGHTNINGWAVE on a Random target - if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0)) DoCast(pTarget, SPELL_LIGHTNINGWAVE); m_uiLightningWave_Timer = 7000 + rand()%5000; diff --git a/src/server/scripts/World/guards.cpp b/src/server/scripts/World/guards.cpp index 107ada8186304..f3f7bd27720ac 100644 --- a/src/server/scripts/World/guards.cpp +++ b/src/server/scripts/World/guards.cpp @@ -19,7 +19,7 @@ /* ScriptData SDName: Guards SD%Complete: 100 -SDComment: +SDComment: SDCategory: Guards EndScriptData */ @@ -35,7 +35,7 @@ EndContentData */ enum GuardGeneric { GENERIC_CREATURE_COOLDOWN = 5000, - + SAY_GUARD_SIL_AGGRO1 = -1070001, SAY_GUARD_SIL_AGGRO2 = -1070002, SAY_GUARD_SIL_AGGRO3 = -1070003, @@ -118,9 +118,9 @@ class guard_generic : public CreatureScript info = SelectSpell(me, 0, 0, SELECT_TARGET_ANY_FRIEND, 0, 0, 0, 0, SELECT_EFFECT_HEALING); //No healing spell available, select a hostile spell - if (info) + if (info) healing = true; - else + else info = SelectSpell(me->getVictim(), 0, 0, SELECT_TARGET_ANY_ENEMY, 0, 0, 0, 0, SELECT_EFFECT_DONTCARE); //20% chance to replace our white hit with a spell @@ -129,13 +129,13 @@ class guard_generic : public CreatureScript //Cast the spell if (healing) DoCast(me, info->Id); - else + else DoCast(me->getVictim(), info->Id); //Set our global cooldown globalCooldown = GENERIC_CREATURE_COOLDOWN; } - else + else me->AttackerStateUpdate(me->getVictim()); me->resetAttackTimer(); @@ -154,7 +154,7 @@ class guard_generic : public CreatureScript info = SelectSpell(me, 0, 0, SELECT_TARGET_ANY_FRIEND, 0, 0, 0, 0, SELECT_EFFECT_HEALING); //No healing spell available, See if we can cast a ranged spell (Range must be greater than ATTACK_DISTANCE) - if (info) + if (info) healing = true; else info = SelectSpell(me->getVictim(), 0, 0, SELECT_TARGET_ANY_ENEMY, 0, 0, NOMINAL_MELEE_RANGE, 0, SELECT_EFFECT_DONTCARE); @@ -170,9 +170,9 @@ class guard_generic : public CreatureScript } //Cast spell - if (healing) + if (healing) DoCast(me,info->Id); - else + else DoCast(me->getVictim(),info->Id); //Set our global cooldown @@ -204,7 +204,7 @@ class guard_generic : public CreatureScript case TEXTEMOTE_CHICKEN: me->HandleEmoteCommand(EMOTE_ONESHOT_POINT); break; } } - + void ReceiveEmote(Player* player, uint32 textEmote) { switch(me->GetEntry()) diff --git a/src/server/scripts/World/item_scripts.cpp b/src/server/scripts/World/item_scripts.cpp index f34f36ab97de3..71c3a1661edcd 100644 --- a/src/server/scripts/World/item_scripts.cpp +++ b/src/server/scripts/World/item_scripts.cpp @@ -140,32 +140,6 @@ class item_nether_wraith_beacon : public ItemScript } }; -/*##### -# item_flying_machine -#####*/ - -class item_flying_machine : public ItemScript -{ -public: - item_flying_machine() : ItemScript("item_flying_machine") { } - - bool OnUse(Player* pPlayer, Item* pItem, SpellCastTargets const& /*targets*/) - { - uint32 itemId = pItem->GetEntry(); - if (itemId == 34060) - if (pPlayer->GetBaseSkillValue(SKILL_RIDING) >= 225) - return false; - - if (itemId == 34061) - if (pPlayer->GetBaseSkillValue(SKILL_RIDING) == 300) - return false; - - sLog->outDebug("TSCR: Player attempt to use item %u, but did not meet riding requirement",itemId); - pPlayer->SendEquipError(EQUIP_ERR_CANT_EQUIP_SKILL,pItem,NULL); - return true; - } -}; - /*##### # item_gor_dreks_ointment #####*/ @@ -246,42 +220,6 @@ class item_disgusting_jar : public ItemScript } }; -/*##### -# item_harvesters_gift -#####*/ -#define GHOULS 28845 - -class item_harvesters_gift : public ItemScript -{ -public: - item_harvesters_gift() : ItemScript("item_harvesters_gift") { } - - bool OnUse(Player* pPlayer, Item* /*pItem*/, SpellCastTargets const& /*targets*/) - { - std::list MinionList; - pPlayer->GetAllMinionsByEntry(MinionList,GHOULS); - - if (pPlayer->GetQuestStatus(12698) == QUEST_STATUS_INCOMPLETE) - { - if (!MinionList.empty()) - { - if (MinionList.size() < 5) - return false; - else - { - // This should be sent to the player as red text. - // TODO: Text should be moved to DB - pPlayer->Say("You have created enough ghouls. Return to Gothik the Harvester at Death's Breach.", LANG_UNIVERSAL); - return true; - } - } - else - return false; - } - return true; - } -}; - /*##### # item_pile_fake_furs #####*/ @@ -512,18 +450,16 @@ class item_captured_frog : public ItemScript void AddSC_item_scripts() { - new item_only_for_flight; - new item_draenei_fishing_net; - new item_nether_wraith_beacon; - new item_flying_machine; - new item_gor_dreks_ointment; - new item_incendiary_explosives; - new item_mysterious_egg; - new item_disgusting_jar; - new item_harvesters_gift; - new item_pile_fake_furs; - new item_petrov_cluster_bombs; - new item_dehta_trap_smasher; - new item_trident_of_nazjan; + new item_only_for_flight(); + new item_draenei_fishing_net(); + new item_nether_wraith_beacon(); + new item_gor_dreks_ointment(); + new item_incendiary_explosives(); + new item_mysterious_egg(); + new item_disgusting_jar(); + new item_pile_fake_furs(); + new item_petrov_cluster_bombs(); + new item_dehta_trap_smasher(); + new item_trident_of_nazjan(); new item_captured_frog(); } diff --git a/src/server/scripts/World/npc_professions.cpp b/src/server/scripts/World/npc_professions.cpp index 4884439b0cb81..f6067313cc7c4 100644 --- a/src/server/scripts/World/npc_professions.cpp +++ b/src/server/scripts/World/npc_professions.cpp @@ -236,7 +236,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 - sLog->outDebug("TSCR: player attempt to unlearn spell %u, but item %u is equipped.",reqSpell,pItem->GetProto()->ItemId); + sLog->outDebug(LOG_FILTER_TSCR, "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/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index aa0a3705d5476..95785f048d7fc 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -40,6 +40,7 @@ npc_sayge 100% Darkmoon event fortune teller, buff player based npc_snake_trap_serpents 80% AI for snakes that summoned by Snake Trap npc_shadowfiend 100% restore 5% of owner's mana when shadowfiend die from damage npc_locksmith 75% list of keys needs to be confirmed +npc_argent_squire 100% Script for the Argent Squire/Gruntling EndContentData */ #include "ScriptPCH.h" @@ -254,7 +255,6 @@ class npc_air_force_bots : public CreatureScript } }; - CreatureAI *GetAI(Creature *creature) const { return new npc_air_force_botsAI(creature); @@ -479,7 +479,6 @@ class npc_dancing_flames : public CreatureScript } }; - /*###### ## Triage quest ######*/ @@ -1974,13 +1973,6 @@ class npc_ebon_gargoyle : public CreatureScript } } - void JustDied(Unit * /*killer*/) - { - // Stop Feeding Gargoyle when it dies - if (Unit *owner = me->GetOwner()) - owner->RemoveAurasDueToSpell(50514); - } - // Fly away when dismissed void SpellHit(Unit *source, const SpellEntry *spell) { @@ -2667,6 +2659,213 @@ class npc_experience : public CreatureScript } }; +/*###### +## npc_argent_squire/gruntling +######*/ + +enum Misc +{ + STATE_BANK = 0x1, + STATE_SHOP = 0x2, + STATE_MAIL = 0x4, + + GOSSIP_ACTION_MAIL = 3, + ACHI_PONY_UP = 3736, + + SPELL_CHECK_MOUNT = 67039, + SPELL_CHECK_TIRED = 67334, + SPELL_SQUIRE_BANK_ERRAND = 67368, + SPELL_SQUIRE_POSTMAN = 67376, + SPELL_SQUIRE_SHOP = 67377, + SPELL_SQUIRE_TIRED = 67401 +}; +enum Quests +{ + QUEST_CHAMP_ORGRIMMAR = 13726, + QUEST_CHAMP_UNDERCITY = 13729, + QUEST_CHAMP_SENJIN = 13727, + QUEST_CHAMP_SILVERMOON = 13731, + QUEST_CHAMP_THUNDERBLUFF = 13728, + QUEST_CHAMP_STORMWIND = 13699, + QUEST_CHAMP_IRONFORGE = 13713, + QUEST_CHAMP_GNOMEREGAN = 13723, + QUEST_CHAMP_DARNASSUS = 13725, + QUEST_CHAMP_EXODAR = 13724 +}; +enum Pennants +{ + SPELL_DARNASSUS_PENNANT = 63443, + SPELL_EXODAR_PENNANT = 63439, + SPELL_GNOMEREGAN_PENNANT = 63442, + SPELL_IRONFORGE_PENNANT = 63440, + SPELL_ORGRIMMAR_PENNANT = 63444, + SPELL_SENJIN_PENNANT = 63446, + SPELL_SILVERMOON_PENNANT = 63438, + SPELL_STORMWIND_PENNANT = 62727, + SPELL_THUNDERBLUFF_PENNANT = 63445, + SPELL_UNDERCITY_PENNANT = 63441 +}; + +class npc_argent_squire : public CreatureScript +{ +public: + npc_argent_squire() : CreatureScript("npc_argent_squire") { } + + bool OnGossipHello(Player* pPlayer, Creature* pCreature) + { + // Argent Pony Bridle options + const AchievementEntry * achiPonyUp = GetAchievementStore()->LookupEntry(ACHI_PONY_UP); + if (pPlayer->GetAchievementMgr().HasAchieved(achiPonyUp)) + if (!pCreature->HasAura(SPELL_SQUIRE_TIRED)) + { + uint8 uiBuff = (STATE_BANK | STATE_SHOP | STATE_MAIL); + if (pCreature->HasAura(SPELL_SQUIRE_BANK_ERRAND)) + uiBuff = STATE_BANK; + if (pCreature->HasAura(SPELL_SQUIRE_SHOP)) + uiBuff = STATE_SHOP; + if (pCreature->HasAura(SPELL_SQUIRE_POSTMAN)) + uiBuff = STATE_MAIL; + + if (uiBuff & STATE_BANK) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_MONEY_BAG, "Visit a bank.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_BANK); + if (uiBuff & STATE_SHOP) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, "Visit a trader.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); + if (uiBuff & STATE_MAIL) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Visit a mailbox.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_MAIL); + } + + // Horde + if (pPlayer->GetQuestRewardStatus(QUEST_CHAMP_SENJIN)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Darkspear Champion's Pennant", GOSSIP_SENDER_MAIN, SPELL_SENJIN_PENNANT); + if (pPlayer->GetQuestRewardStatus(QUEST_CHAMP_UNDERCITY)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Forsaken Champion's Pennant", GOSSIP_SENDER_MAIN, SPELL_UNDERCITY_PENNANT); + if (pPlayer->GetQuestRewardStatus(QUEST_CHAMP_ORGRIMMAR)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Orgrimmar Champion's Pennant", GOSSIP_SENDER_MAIN, SPELL_ORGRIMMAR_PENNANT); + if (pPlayer->GetQuestRewardStatus(QUEST_CHAMP_SILVERMOON)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Silvermoon Champion's Pennant", GOSSIP_SENDER_MAIN, SPELL_SILVERMOON_PENNANT); + if (pPlayer->GetQuestRewardStatus(QUEST_CHAMP_THUNDERBLUFF)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Thunder Bluff Champion's Pennant", GOSSIP_SENDER_MAIN, SPELL_THUNDERBLUFF_PENNANT); + + //Alliance + if (pPlayer->GetQuestRewardStatus(QUEST_CHAMP_DARNASSUS)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Darnassus Champion's Pennant", GOSSIP_SENDER_MAIN, SPELL_DARNASSUS_PENNANT); + if (pPlayer->GetQuestRewardStatus(QUEST_CHAMP_EXODAR)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Exodar Champion's Pennant", GOSSIP_SENDER_MAIN, SPELL_EXODAR_PENNANT); + if (pPlayer->GetQuestRewardStatus(QUEST_CHAMP_GNOMEREGAN)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Gnomeregan Champion's Pennant", GOSSIP_SENDER_MAIN, SPELL_GNOMEREGAN_PENNANT); + if (pPlayer->GetQuestRewardStatus(QUEST_CHAMP_IRONFORGE)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Ironforge Champion's Pennant", GOSSIP_SENDER_MAIN, SPELL_IRONFORGE_PENNANT); + if (pPlayer->GetQuestRewardStatus(QUEST_CHAMP_STORMWIND)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Stormwind Champion's Pennant", GOSSIP_SENDER_MAIN, SPELL_STORMWIND_PENNANT); + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + return true; + } + + bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction) + { + pPlayer->PlayerTalkClass->ClearMenus(); + if (uiAction >= 1000) // remove old pennant aura + pCreature->AI()->SetData(0, 0); + switch (uiAction) + { + case GOSSIP_ACTION_BANK: + pCreature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_BANKER); + pPlayer->GetSession()->SendShowBank(pCreature->GetGUID()); + if (!pCreature->HasAura(SPELL_SQUIRE_BANK_ERRAND)) + pCreature->AddAura(SPELL_SQUIRE_BANK_ERRAND, pCreature); + if (!pPlayer->HasAura(SPELL_CHECK_TIRED)) + pPlayer->AddAura(SPELL_CHECK_TIRED, pPlayer); + break; + case GOSSIP_ACTION_TRADE: + pCreature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_VENDOR); + pPlayer->SEND_VENDORLIST(pCreature->GetGUID()); + if (!pCreature->HasAura(SPELL_SQUIRE_SHOP)) + pCreature->AddAura(SPELL_SQUIRE_SHOP, pCreature); + if (!pPlayer->HasAura(SPELL_CHECK_TIRED)) + pPlayer->AddAura(SPELL_CHECK_TIRED, pPlayer); + break; + case GOSSIP_ACTION_MAIL: + pCreature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_MAILBOX); + pCreature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + if (!pCreature->HasAura(SPELL_SQUIRE_POSTMAN)) + pCreature->AddAura(SPELL_SQUIRE_POSTMAN, pCreature); + if (!pPlayer->HasAura(SPELL_CHECK_TIRED)) + pPlayer->AddAura(SPELL_CHECK_TIRED, pPlayer); + break; + + case SPELL_SENJIN_PENNANT: + case SPELL_UNDERCITY_PENNANT: + case SPELL_ORGRIMMAR_PENNANT: + case SPELL_SILVERMOON_PENNANT: + case SPELL_THUNDERBLUFF_PENNANT: + case SPELL_DARNASSUS_PENNANT: + case SPELL_EXODAR_PENNANT: + case SPELL_GNOMEREGAN_PENNANT: + case SPELL_IRONFORGE_PENNANT: + case SPELL_STORMWIND_PENNANT: + pCreature->AI()->SetData(1, uiAction); + break; + } + pPlayer->PlayerTalkClass->CloseGossip(); + return true; + } + + struct npc_argent_squireAI : public ScriptedAI + { + npc_argent_squireAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_current_pennant = 0; + check_timer = 1000; + } + + uint32 m_current_pennant; + uint32 check_timer; + + void UpdateAI(const uint32 uiDiff) + { + // have to delay the check otherwise it wont work + if (check_timer && (check_timer <= uiDiff)) + { + me->AddAura(SPELL_CHECK_MOUNT, me); + if (Aura* tired = me->GetOwner()->GetAura(SPELL_CHECK_TIRED)) + { + int32 duration = tired->GetDuration(); + tired = me->AddAura(SPELL_SQUIRE_TIRED, me); + tired->SetDuration(duration); + } + check_timer = 0; + } + else check_timer -= uiDiff; + + if (me->HasAura(SPELL_SQUIRE_TIRED) && me->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_BANKER | UNIT_NPC_FLAG_MAILBOX | UNIT_NPC_FLAG_VENDOR)) + { + me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_BANKER | UNIT_NPC_FLAG_MAILBOX | UNIT_NPC_FLAG_VENDOR); + me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + } + } + + void SetData(uint32 add, uint32 spell) + { + if (add) + { + me->AddAura(spell, me); + m_current_pennant = spell; + } + else if (m_current_pennant) + { + me->RemoveAura(m_current_pennant); + m_current_pennant = 0; + } + } + }; + + CreatureAI *GetAI(Creature *creature) const + { + return new npc_argent_squireAI(creature); + } +}; + void AddSC_npcs_special() { new npc_air_force_bots; @@ -2697,5 +2896,6 @@ void AddSC_npcs_special() new npc_locksmith; new npc_tabard_vendor; new npc_experience; + new npc_argent_squire; } diff --git a/src/server/shared/Common.h b/src/server/shared/Common.h index cefefa7f1cb42..68825e4892578 100755 --- a/src/server/shared/Common.h +++ b/src/server/shared/Common.h @@ -180,7 +180,7 @@ const uint8 TOTAL_LOCALES = 9; const LocaleConstant DEFAULT_LOCALE = LOCALE_enUS; #define MAX_LOCALES 8 -#define MAX_CHARACTER_TUTORIAL_VALUES 8 +#define MAX_ACCOUNT_TUTORIAL_VALUES 8 extern char const* localeNames[TOTAL_LOCALES]; diff --git a/src/server/shared/DataStores/DBCFileLoader.cpp b/src/server/shared/DataStores/DBCFileLoader.cpp index 524012cc28e54..d6fbbc1b86a2b 100755 --- a/src/server/shared/DataStores/DBCFileLoader.cpp +++ b/src/server/shared/DataStores/DBCFileLoader.cpp @@ -21,6 +21,7 @@ #include #include "DBCFileLoader.h" +#include "Errors.h" DBCFileLoader::DBCFileLoader() { @@ -28,7 +29,7 @@ DBCFileLoader::DBCFileLoader() fieldsOffset = NULL; } -bool DBCFileLoader::Load(const char *filename, const char *fmt) +bool DBCFileLoader::Load(const char* filename, const char* fmt) { uint32 header; if (data) @@ -37,11 +38,11 @@ bool DBCFileLoader::Load(const char *filename, const char *fmt) data = NULL; } - FILE * f = fopen(filename,"rb"); + FILE* f = fopen(filename,"rb"); if (!f) return false; - if (fread(&header,4,1,f) != 1) // Number of records + if (fread(&header, 4, 1, f) != 1) // Number of records { fclose(f); return false; @@ -56,7 +57,7 @@ bool DBCFileLoader::Load(const char *filename, const char *fmt) return false; } - if (fread(&recordCount,4,1,f) != 1) // Number of records + if (fread(&recordCount, 4, 1, f) != 1) // Number of records { fclose(f); return false; @@ -64,7 +65,7 @@ bool DBCFileLoader::Load(const char *filename, const char *fmt) EndianConvert(recordCount); - if (fread(&fieldCount,4,1,f) != 1) // Number of fields + if (fread(&fieldCount, 4, 1, f) != 1) // Number of fields { fclose(f); return false; @@ -72,7 +73,7 @@ bool DBCFileLoader::Load(const char *filename, const char *fmt) EndianConvert(fieldCount); - if (fread(&recordSize,4,1,f) != 1) // Size of a record + if (fread(&recordSize, 4, 1, f) != 1) // Size of a record { fclose(f); return false; @@ -80,7 +81,7 @@ bool DBCFileLoader::Load(const char *filename, const char *fmt) EndianConvert(recordSize); - if (fread(&stringSize,4,1,f) != 1) // String size + if (fread(&stringSize, 4, 1, f) != 1) // String size { fclose(f); return false; @@ -90,19 +91,19 @@ bool DBCFileLoader::Load(const char *filename, const char *fmt) fieldsOffset = new uint32[fieldCount]; fieldsOffset[0] = 0; - for (uint32 i = 1; i < fieldCount; i++) + for (uint32 i = 1; i < fieldCount; ++i) { fieldsOffset[i] = fieldsOffset[i - 1]; if (fmt[i - 1] == 'b' || fmt[i - 1] == 'X') // byte fields - fieldsOffset[i] += 1; + fieldsOffset[i] += sizeof(uint8); else // 4 byte fields (int32/float/strings) - fieldsOffset[i] += 4; + fieldsOffset[i] += sizeof(uint32); } - data = new unsigned char[recordSize*recordCount+stringSize]; + data = new unsigned char[recordSize * recordCount + stringSize]; stringTable = data + recordSize*recordCount; - if (fread(data,recordSize*recordCount+stringSize,1,f) != 1) + if (fread(data, recordSize * recordCount + stringSize, 1, f) != 1) { fclose(f); return false; @@ -125,33 +126,44 @@ DBCFileLoader::~DBCFileLoader() DBCFileLoader::Record DBCFileLoader::getRecord(size_t id) { assert(data); - return Record(*this, data + id*recordSize); + return Record(*this, data + id * recordSize); } -uint32 DBCFileLoader::GetFormatRecordSize(const char * format,int32* index_pos) +uint32 DBCFileLoader::GetFormatRecordSize(const char* format, int32* index_pos) { uint32 recordsize = 0; int32 i = -1; - for (uint32 x=0; format[x]; ++x) + for (uint32 x = 0; format[x]; ++x) { - switch(format[x]) + switch (format[x]) { case FT_FLOAT: + recordsize += sizeof(float); + break; case FT_INT: - recordsize+=4; + recordsize += sizeof(uint32); break; case FT_STRING: - recordsize+=sizeof(char*); + recordsize += sizeof(char*); break; case FT_SORT: - i=x; + i = x; break; case FT_IND: - i=x; - recordsize+=4; + i = x; + recordsize += sizeof(uint32); break; case FT_BYTE: - recordsize += 1; + recordsize += sizeof(uint8); + break; + case FT_NA: + case FT_NA_BYTE: + break; + case FT_LOGIC: + ASSERT(false && "Attempted to load DBC files that do not have field types that match what is in the core. Check DBCfmt.h or your DBC files."); + break; + default: + ASSERT(false && "Unknown field format character in DBCfmt.h"); break; } } @@ -162,7 +174,7 @@ uint32 DBCFileLoader::GetFormatRecordSize(const char * format,int32* index_pos) return recordsize; } -char* DBCFileLoader::AutoProduceData(const char* format, uint32& records, char**& indexTable, uint32 sqlRecordCount, uint32 sqlHighestIndex, char *& sqlDataTable) +char* DBCFileLoader::AutoProduceData(const char* format, uint32& records, char**& indexTable, uint32 sqlRecordCount, uint32 sqlHighestIndex, char*& sqlDataTable) { /* format STRING, NA, FLOAT,NA,INT <=> @@ -175,22 +187,23 @@ char* DBCFileLoader::AutoProduceData(const char* format, uint32& records, char** this func will generate entry[rows] data; */ - typedef char * ptr; - if (strlen(format)!=fieldCount) + typedef char* ptr; + if (strlen(format) != fieldCount) return NULL; //get struct size and index pos int32 i; - uint32 recordsize=GetFormatRecordSize(format,&i); + uint32 recordsize = GetFormatRecordSize(format, &i); - if (i>=0) + if (i >= 0) { - uint32 maxi=0; + uint32 maxi = 0; //find max index - for (uint32 y=0; ymaxi)maxi=ind; + uint32 ind = getRecord(y).getUInt(i); + if (ind > maxi) + maxi = ind; } // If higher index avalible from sql - use it instead of dbcs @@ -198,47 +211,57 @@ char* DBCFileLoader::AutoProduceData(const char* format, uint32& records, char** maxi = sqlHighestIndex; ++maxi; - records=maxi; - indexTable=new ptr[maxi]; - memset(indexTable,0,maxi*sizeof(ptr)); + records = maxi; + indexTable = new ptr[maxi]; + memset(indexTable, 0, maxi * sizeof(ptr)); } else { records = recordCount + sqlRecordCount; - indexTable = new ptr[recordCount+ sqlRecordCount]; + indexTable = new ptr[recordCount + sqlRecordCount]; } - char* dataTable= new char[(recordCount + sqlRecordCount)*recordsize]; + char* dataTable = new char[(recordCount + sqlRecordCount) * recordsize]; - uint32 offset=0; + uint32 offset = 0; - for (uint32 y =0; y=0) - indexTable[getRecord(y).getUInt(i)]=&dataTable[offset]; + if (i >= 0) + indexTable[getRecord(y).getUInt(i)] = &dataTable[offset]; else - indexTable[y]=&dataTable[offset]; + indexTable[y] = &dataTable[offset]; - for (uint32 x=0; x ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_DEL_OLD_GUILD_BANK_EVENT_LOGS, "DELETE FROM guild_bank_eventlog WHERE LogGuid > ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_DEL_NONEXISTENT_GUILD_BANK_ITEM, "DELETE FROM guild_bank_item WHERE guildid = ? AND TabId = ? AND SlotId = ?", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_DEL_NONEXISTENT_CHARACTER_GROUP_MEMBERS, "DELETE FROM group_member WHERE NOT EXISTS (SELECT guid FROM characters WHERE guid=memberGuid)", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_DEL_LEADERLESS_GROUPS, "DELETE FROM groups WHERE NOT EXISTS (SELECT guid FROM characters WHERE guid=leaderGuid)", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_DEL_TINY_GROUPS, "DELETE FROM groups WHERE guid NOT IN (SELECT guid FROM group_member GROUP BY guid HAVING COUNT(guid) > 1)", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_DEL_NONEXISTENT_GROUP_MEMBERS, "DELETE FROM group_member WHERE guid NOT IN (SELECT guid FROM groups)", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_DEL_NONEXISTENT_GROUP_INSTANCES, "DELETE FROM group_instance WHERE guid NOT IN (SELECT guid FROM groups)", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_DEL_EXPIRED_BANS, "UPDATE character_banned SET active = 0 WHERE unbandate <= UNIX_TIMESTAMP() AND unbandate <> bandate", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_GET_GUID_BY_NAME, "SELECT guid FROM characters WHERE name = ?", CONNECTION_SYNCH) PREPARE_STATEMENT(CHAR_ADD_BAN, "INSERT INTO character_banned VALUES (?, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()+?, ?, ?, 1)", CONNECTION_ASYNC) @@ -79,7 +74,6 @@ bool CharacterDatabaseConnection::Open() PREPARE_STATEMENT(CHAR_LOAD_PLAYER_BGDATA, "SELECT instance_id, team, join_x, join_y, join_z, join_o, join_map, taxi_start, taxi_end, mount_spell FROM character_battleground_data WHERE guid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_LOAD_PLAYER_GLYPHS, "SELECT spec, glyph1, glyph2, glyph3, glyph4, glyph5, glyph6 FROM character_glyphs WHERE guid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_LOAD_PLAYER_TALENTS, "SELECT spell, spec FROM character_talent WHERE guid = ?", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_LOAD_PLAYER_ACCOUNTDATA, "SELECT type, time, data FROM character_account_data WHERE guid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_LOAD_PLAYER_SKILLS, "SELECT skill, value, max FROM character_skills WHERE guid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_LOAD_PLAYER_RANDOMBG, "SELECT guid FROM character_battleground_random WHERE guid = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_LOAD_PLAYER_ARENASTATS, "SELECT slot, personal_rating, matchmaker_rating FROM character_arena_stats WHERE guid = ? ORDER BY slot ASC", CONNECTION_ASYNC) @@ -89,7 +83,6 @@ bool CharacterDatabaseConnection::Open() // End LoginQueryHolder content PREPARE_STATEMENT(CHAR_LOAD_PLAYER_ACTIONS_SPEC, "SELECT button, action, type FROM character_action WHERE guid = ? AND spec = ? ORDER BY button", CONNECTION_SYNCH) - PREPARE_STATEMENT(CHAR_LOAD_ACCOUNT_DATA, "SELECT type, time, data FROM account_data WHERE account = ?", CONNECTION_SYNCH) PREPARE_STATEMENT(CHAR_LOAD_PLAYER_MAILITEMS, "SELECT creatorGuid, giftCreatorGuid, count, duration, charges, flags, enchantments, randomPropertyId, durability, playedTime, text, item_guid, itemEntry, owner_guid FROM mail_items mi JOIN item_instance ii ON mi.item_guid = ii.guid WHERE mail_id = ?", CONNECTION_SYNCH) PREPARE_STATEMENT(CHAR_LOAD_AUCTION_ITEMS, "SELECT creatorGuid, giftCreatorGuid, count, duration, charges, flags, enchantments, randomPropertyId, durability, playedTime, text, itemguid, itemEntry FROM auctionhouse ah JOIN item_instance ii ON ah.itemguid = ii.guid", CONNECTION_SYNCH) PREPARE_STATEMENT(CHAR_LOAD_AUCTIONS, "SELECT id, auctioneerguid, itemguid, itemEntry, itemowner, buyoutprice, time, buyguid, lastbid, startbid, deposit FROM auctionhouse ah INNER JOIN item_instance ii ON ii.guid = ah.itemguid", CONNECTION_SYNCH) @@ -231,11 +224,12 @@ bool CharacterDatabaseConnection::Open() // 11 12 13 14 15 "guildid, TabId, SlotId, item_guid, itemEntry FROM guild_bank_item gbi INNER JOIN item_instance ii ON gbi.item_guid = ii.guid", CONNECTION_SYNCH) - PREPARE_STATEMENT(CHAR_CLEAN_GUILD_RANKS, "DELETE FROM guild_rank WHERE guildId NOT IN (SELECT guildid FROM guild)", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_CLEAN_GUILD_MEMBERS, "DELETE FROM guild_member WHERE guildId NOT IN (SELECT guildid FROM guild)", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_CLEAN_GUILD_BANK_TABS, "DELETE FROM guild_bank_tab WHERE guildId NOT IN (SELECT guildid FROM guild)", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_CLEAN_GUILD_BANK_RIGHTS, "DELETE FROM guild_bank_right WHERE guildId NOT IN (SELECT guildid FROM guild)", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_CLEAN_GUILD_BANK_ITEMS, "DELETE FROM guild_bank_item WHERE guildId NOT IN (SELECT guildid FROM guild)", CONNECTION_ASYNC) + PREPARE_STATEMENT(CHAR_DEL_NONEXISTENT_GUILD_RANKS, "DELETE FROM guild_rank WHERE guildId NOT IN (SELECT guildid FROM guild)", CONNECTION_ASYNC) + PREPARE_STATEMENT(CHAR_DEL_NONEXISTENT_GUILD_MEMBERS, "DELETE FROM guild_member WHERE guildId NOT IN (SELECT guildid FROM guild)", CONNECTION_ASYNC) + PREPARE_STATEMENT(CHAR_DEL_NONEXISTENT_GUILD_BANK_TABS, "DELETE FROM guild_bank_tab WHERE guildId NOT IN (SELECT guildid FROM guild)", CONNECTION_ASYNC) + PREPARE_STATEMENT(CHAR_DEL_NONEXISTENT_GUILD_BANK_RIGHTS, "DELETE FROM guild_bank_right WHERE guildId NOT IN (SELECT guildid FROM guild)", CONNECTION_ASYNC) + PREPARE_STATEMENT(CHAR_DEL_NONEXISTENT_GUILD_BANK_ITEMS, "DELETE FROM guild_bank_item WHERE guildId NOT IN (SELECT guildid FROM guild)", CONNECTION_ASYNC) + PREPARE_STATEMENT(CHAR_DEL_CREATURE_RESPAWN_TIME, "DELETE FROM creature_respawn WHERE guid = ? AND instance = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_ADD_CREATURE_RESPAWN_TIME, "REPLACE INTO creature_respawn VALUES (?, ?, ?)", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_DEL_EXPIRED_GO_RESPAWN_TIMES, "DELETE FROM gameobject_respawn WHERE respawntime <= UNIX_TIMESTAMP()", CONNECTION_SYNCH) @@ -243,11 +237,12 @@ bool CharacterDatabaseConnection::Open() PREPARE_STATEMENT(CHAR_ADD_GO_RESPAWN_TIME, "REPLACE INTO gameobject_respawn VALUES (?, ?, ?)", CONNECTION_ASYNC) // Chat channel handling - PREPARE_STATEMENT(CHAR_LOAD_CHANNEL, "SELECT m_announce, m_ownership, m_password, BannedList FROM channels WHERE m_name = ? AND m_team = ?", CONNECTION_SYNCH) - PREPARE_STATEMENT(CHAR_ADD_CHANNEL, "INSERT INTO channels (m_name, m_team, last_used) VALUES (? , ?, UNIX_TIMESTAMP())", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_SET_CHANNEL, "UPDATE channels SET m_announce = ?, m_ownership = ?, m_password = ?, BannedList = ?, last_used = UNIX_TIMESTAMP() WHERE m_name = ? AND m_team = ?", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_SET_CHANNEL_USAGE, "UPDATE channels SET last_used = UNIX_TIMESTAMP() WHERE m_name = ? AND m_team = ?", CONNECTION_ASYNC) - PREPARE_STATEMENT(CHAR_CLEAN_CHANNEL, "DELETE FROM channels WHERE m_ownership = 1 AND (last_used + ?) < UNIX_TIMESTAMP()", CONNECTION_ASYNC) + PREPARE_STATEMENT(CHAR_LOAD_CHANNEL, "SELECT announce, ownership, password, bannedList FROM channels WHERE name = ? AND team = ?", CONNECTION_SYNCH) + PREPARE_STATEMENT(CHAR_ADD_CHANNEL, "INSERT INTO channels(name, team, lastUsed) VALUES (?, ?, UNIX_TIMESTAMP())", CONNECTION_ASYNC) + PREPARE_STATEMENT(CHAR_SET_CHANNEL, "UPDATE channels SET announce = ?, ownership = ?, password = ?, bannedList = ?, lastUsed = UNIX_TIMESTAMP() WHERE name = ? AND team = ?", CONNECTION_ASYNC) + PREPARE_STATEMENT(CHAR_SET_CHANNEL_USAGE, "UPDATE channels SET lastUsed = UNIX_TIMESTAMP() WHERE name = ? AND team = ?", CONNECTION_ASYNC) + PREPARE_STATEMENT(CHAR_SET_CHANNEL_OWNERSHIP, "UPDATE channels SET ownership = ? WHERE name LIKE ?", CONNECTION_ASYNC) + PREPARE_STATEMENT(CHAR_DEL_OLD_CHANNELS, "DELETE FROM channels WHERE ownership = 1 AND lastUsed + ? < UNIX_TIMESTAMP()", CONNECTION_ASYNC) // Equipmentsets PREPARE_STATEMENT(CHAR_SET_EQUIP_SET, "UPDATE character_equipmentsets SET name=?, iconname=?, item0=?, item1=?, item2=?, item3=?, item4=?, item5=?, item6=?, item7=?, item8=?, item9=?, item10=?, item11=?, item12=?, item13=?, item14=?, item15=?, item16=?, item17=?, item18=? WHERE guid=? AND setguid=? AND setindex=?", CONNECTION_ASYNC) @@ -259,10 +254,34 @@ bool CharacterDatabaseConnection::Open() PREPARE_STATEMENT(CHAR_ADD_AURA, "INSERT INTO character_aura (guid,caster_guid,item_guid,spell,effect_mask,recalculate_mask,stackcount,amount0,amount1,amount2,base_amount0,base_amount1,base_amount2,maxduration,remaintime,remaincharges) " "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC) + // Account data + PREPARE_STATEMENT(CHAR_LOAD_ACCOUNT_DATA, "SELECT type, time, data FROM account_data WHERE accountId = ?", CONNECTION_SYNCH) + PREPARE_STATEMENT(CHAR_SET_ACCOUNT_DATA, "REPLACE INTO account_data(accountId, type, time, data) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC) + PREPARE_STATEMENT(CHAR_DEL_ACCOUNT_DATA, "DELETE FROM account_data WHERE accountId = ?", CONNECTION_ASYNC) + PREPARE_STATEMENT(CHAR_LOAD_PLAYER_ACCOUNT_DATA, "SELECT type, time, data FROM character_account_data WHERE guid = ?", CONNECTION_ASYNC) + PREPARE_STATEMENT(CHAR_SET_PLAYER_ACCOUNT_DATA, "REPLACE INTO character_account_data(guid, type, time, data) VALUES (?, ?, ?, ?)", CONNECTION_ASYNC) + PREPARE_STATEMENT(CHAR_DEL_PLAYER_ACCOUNT_DATA, "DELETE FROM character_account_data WHERE guid = ?", CONNECTION_ASYNC) + + // Tutorials + PREPARE_STATEMENT(CHAR_LOAD_TUTORIALS, "SELECT tut0, tut1, tut2, tut3, tut4, tut5, tut6, tut7 FROM account_tutorial WHERE accountId = ?", CONNECTION_SYNCH) + PREPARE_STATEMENT(CHAR_GET_HAS_TUTORIALS, "SELECT 1 FROM account_tutorial WHERE accountId = ?", CONNECTION_SYNCH) + PREPARE_STATEMENT(CHAR_ADD_TUTORIALS, "INSERT INTO account_tutorial(tut0, tut1, tut2, tut3, tut4, tut5, tut6, tut7, accountId) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC) + PREPARE_STATEMENT(CHAR_SET_TUTORIALS, "UPDATE account_tutorial SET tut0 = ?, tut1 = ?, tut2 = ?, tut3 = ?, tut4 = ?, tut5 = ?, tut6 = ?, tut7 = ? WHERE accountId = ?", CONNECTION_ASYNC) + PREPARE_STATEMENT(CHAR_DEL_TUTORIALS, "DELETE FROM account_tutorial WHERE accountId = ?", CONNECTION_ASYNC) + // Instance saves PREPARE_STATEMENT(CHAR_ADD_INSTANCE_SAVE, "INSERT INTO instance (id,map,resettime,difficulty,completedEncounters,data) VALUES (?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_UPDATE_INSTANCE_DATA, "UPDATE instance SET completedEncounters=?, data=? WHERE id=?", CONNECTION_ASYNC) + // Game event saves + PREPARE_STATEMENT(CHAR_DEL_GAME_EVENT_SAVE, "DELETE FROM game_event_save WHERE eventEntry = ?", CONNECTION_ASYNC) + PREPARE_STATEMENT(CHAR_ADD_GAME_EVENT_SAVE, "INSERT INTO game_event_save (eventEntry, state, next_start) VALUES (?, ? , ?)", CONNECTION_ASYNC) + + // Game event condition saves + PREPARE_STATEMENT(CHAR_DEL_ALL_GAME_EVENT_CONDITION_SAVE, "DELETE FROM game_event_condition_save WHERE eventEntry = ?", CONNECTION_ASYNC) + PREPARE_STATEMENT(CHAR_DEL_GAME_EVENT_CONDITION_SAVE, "DELETE FROM game_event_condition_save WHERE eventEntry = ? AND condition_id = ?", CONNECTION_ASYNC) + PREPARE_STATEMENT(CHAR_ADD_GAME_EVENT_CONDITION_SAVE, "INSERT INTO game_event_condition_save (eventEntry, condition_id, done) VALUES (?, ?, ?)", CONNECTION_ASYNC) + for (PreparedStatementMap::const_iterator itr = m_queries.begin(); itr != m_queries.end(); ++itr) PrepareStatement(itr->first, itr->second.first, itr->second.second); diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.h b/src/server/shared/Database/Implementation/CharacterDatabase.h index 4d47878eba6be..9abc7a65b680f 100755 --- a/src/server/shared/Database/Implementation/CharacterDatabase.h +++ b/src/server/shared/Database/Implementation/CharacterDatabase.h @@ -47,11 +47,6 @@ enum CharacterDatabaseStatements CHAR_DEL_OLD_GUILD_EVENT_LOGS, CHAR_DEL_OLD_GUILD_BANK_EVENT_LOGS, CHAR_DEL_NONEXISTENT_GUILD_BANK_ITEM, - CHAR_DEL_NONEXISTENT_CHARACTER_GROUP_MEMBERS, - CHAR_DEL_LEADERLESS_GROUPS, - CHAR_DEL_TINY_GROUPS, - CHAR_DEL_NONEXISTENT_GROUP_MEMBERS, - CHAR_DEL_NONEXISTENT_GROUP_INSTANCES, CHAR_DEL_EXPIRED_BANS, CHAR_GET_GUID_BY_NAME, CHAR_ADD_BAN, @@ -86,14 +81,12 @@ enum CharacterDatabaseStatements CHAR_LOAD_PLAYER_BGDATA, CHAR_LOAD_PLAYER_GLYPHS, CHAR_LOAD_PLAYER_TALENTS, - CHAR_LOAD_PLAYER_ACCOUNTDATA, CHAR_LOAD_PLAYER_SKILLS, CHAR_LOAD_PLAYER_RANDOMBG, CHAR_LOAD_PLAYER_ARENASTATS, CHAR_LOAD_PLAYER_BANNED, CHAR_LOAD_PLAYER_QUESTSTATUSREW, CHAR_LOAD_ACCOUNT_INSTANCELOCKTIMES, - CHAR_LOAD_ACCOUNT_DATA, CHAR_LOAD_PLAYER_MAILITEMS, CHAR_LOAD_AUCTION_ITEMS, CHAR_ADD_AUCTION, @@ -193,11 +186,11 @@ enum CharacterDatabaseStatements CHAR_LOAD_GUILD_BANK_TABS, CHAR_LOAD_GUILD_EVENTLOGS, CHAR_LOAD_GUILD_BANK_EVENTLOGS, - CHAR_CLEAN_GUILD_RANKS, - CHAR_CLEAN_GUILD_MEMBERS, - CHAR_CLEAN_GUILD_BANK_TABS, - CHAR_CLEAN_GUILD_BANK_RIGHTS, - CHAR_CLEAN_GUILD_BANK_ITEMS, + CHAR_DEL_NONEXISTENT_GUILD_RANKS, + CHAR_DEL_NONEXISTENT_GUILD_MEMBERS, + CHAR_DEL_NONEXISTENT_GUILD_BANK_TABS, + CHAR_DEL_NONEXISTENT_GUILD_BANK_RIGHTS, + CHAR_DEL_NONEXISTENT_GUILD_BANK_ITEMS, CHAR_DEL_CREATURE_RESPAWN_TIME, CHAR_ADD_CREATURE_RESPAWN_TIME, @@ -209,7 +202,8 @@ enum CharacterDatabaseStatements CHAR_ADD_CHANNEL, CHAR_SET_CHANNEL, CHAR_SET_CHANNEL_USAGE, - CHAR_CLEAN_CHANNEL, + CHAR_SET_CHANNEL_OWNERSHIP, + CHAR_DEL_OLD_CHANNELS, CHAR_SET_EQUIP_SET, CHAR_ADD_EQUIP_SET, @@ -218,9 +212,29 @@ enum CharacterDatabaseStatements CHAR_DEL_AURA, CHAR_ADD_AURA, + CHAR_LOAD_ACCOUNT_DATA, + CHAR_SET_ACCOUNT_DATA, + CHAR_DEL_ACCOUNT_DATA, + CHAR_LOAD_PLAYER_ACCOUNT_DATA, + CHAR_SET_PLAYER_ACCOUNT_DATA, + CHAR_DEL_PLAYER_ACCOUNT_DATA, + + CHAR_LOAD_TUTORIALS, + CHAR_GET_HAS_TUTORIALS, + CHAR_ADD_TUTORIALS, + CHAR_SET_TUTORIALS, + CHAR_DEL_TUTORIALS, + CHAR_ADD_INSTANCE_SAVE, CHAR_UPDATE_INSTANCE_DATA, + CHAR_DEL_GAME_EVENT_SAVE, + CHAR_ADD_GAME_EVENT_SAVE, + + CHAR_DEL_ALL_GAME_EVENT_CONDITION_SAVE, + CHAR_DEL_GAME_EVENT_CONDITION_SAVE, + CHAR_ADD_GAME_EVENT_CONDITION_SAVE, + MAX_CHARACTERDATABASE_STATEMENTS, }; diff --git a/src/server/shared/Database/MySQLConnection.cpp b/src/server/shared/Database/MySQLConnection.cpp index e2f2c698632ea..fad7384474346 100755 --- a/src/server/shared/Database/MySQLConnection.cpp +++ b/src/server/shared/Database/MySQLConnection.cpp @@ -477,7 +477,7 @@ PreparedResultSet* MySQLConnection::Query(PreparedStatement* stmt) bool MySQLConnection::_HandleMySQLErrno(uint32 errNo) { - sLog->outDebug("%s", __FUNCTION__); + sLog->outSQLDriver("%s", __FUNCTION__); switch (errNo) { diff --git a/src/server/shared/Database/QueryResult.cpp b/src/server/shared/Database/QueryResult.cpp index a38e605fcf226..9c6ad20222ed3 100755 --- a/src/server/shared/Database/QueryResult.cpp +++ b/src/server/shared/Database/QueryResult.cpp @@ -65,8 +65,8 @@ m_length(NULL) //- This is where we prepare the buffer based on metadata uint32 i = 0; - MYSQL_FIELD* field; - while ((field = mysql_fetch_field(m_res))) + MYSQL_FIELD* field = mysql_fetch_field(m_res); + while (field) { size_t size = Field::SizeForType(field); @@ -80,6 +80,7 @@ m_length(NULL) m_rBind[i].is_unsigned = field->flags & UNSIGNED_FLAG; ++i; + field = mysql_fetch_field(m_res); } //- This is where we bind the bind the buffer to the statement diff --git a/src/server/shared/Database/SQLStorage.cpp b/src/server/shared/Database/SQLStorage.cpp index 7371cbded85ab..c568fe9a74e23 100755 --- a/src/server/shared/Database/SQLStorage.cpp +++ b/src/server/shared/Database/SQLStorage.cpp @@ -45,22 +45,44 @@ SQLStorage sInstanceTemplate(InstanceTemplatesrcfmt, InstanceTemplatedstfmt, "ma void SQLStorage::Free () { - uint32 offset=0; - for (uint32 x=0; x template -void SQLStorageLoaderBase::convert(uint32 /*field_pos*/, S src, D &dst) +void SQLStorageLoaderBase::convert(uint32 /*field_pos*/, S src, D& dst) { dst = D(src); } template -void SQLStorageLoaderBase::convert_str_to_str(uint32 /*field_pos*/, char *src, char *&dst) +void SQLStorageLoaderBase::convert_str_to_str(uint32 /*field_pos*/, char* src, char*& dst) { - if(!src) + if (!src) { dst = new char[1]; *dst = 0; @@ -44,7 +44,7 @@ void SQLStorageLoaderBase::convert_str_to_str(uint32 /*field_pos*/, char *src template template -void SQLStorageLoaderBase::convert_to_str(uint32 /*field_pos*/, S /*src*/, char * & dst) +void SQLStorageLoaderBase::convert_to_str(uint32 /*field_pos*/, S /*src*/, char*& dst) { dst = new char[1]; *dst = 0; @@ -52,86 +52,102 @@ void SQLStorageLoaderBase::convert_to_str(uint32 /*field_pos*/, S /*src*/, ch template template -void SQLStorageLoaderBase::convert_from_str(uint32 /*field_pos*/, char * /*src*/, D& dst) +void SQLStorageLoaderBase::convert_from_str(uint32 /*field_pos*/, char* /*src*/, D& dst) { dst = 0; } template template -void SQLStorageLoaderBase::storeValue(V value, SQLStorage &store, char *p, int x, uint32 &offset) +void SQLStorageLoaderBase::storeValue(V value, SQLStorage& store, char* p, int x, uint32 &offset) { - T * subclass = (static_cast(this)); - switch(store.dst_format[x]) + T* subclass = (static_cast(this)); + switch (store.dst_format[x]) { case FT_LOGIC: subclass->convert(x, value, *((bool*)(&p[offset])) ); - offset+=sizeof(bool); + offset += sizeof(bool); break; case FT_BYTE: subclass->convert(x, value, *((char*)(&p[offset])) ); - offset+=sizeof(char); + offset += sizeof(char); break; case FT_INT: subclass->convert(x, value, *((uint32*)(&p[offset])) ); - offset+=sizeof(uint32); + offset += sizeof(uint32); break; case FT_FLOAT: subclass->convert(x, value, *((float*)(&p[offset])) ); - offset+=sizeof(float); + offset += sizeof(float); break; case FT_STRING: subclass->convert_to_str(x, value, *((char**)(&p[offset])) ); - offset+=sizeof(char*); + offset += sizeof(char*); break; + case FT_NA: + case FT_NA_BYTE: + break; + case FT_SORT: + assert(false && "SQL storage has a field type that does not match what is in the core. Check SQLStorage.cpp or your database."); + break; + default: + assert(false && "Unknown field format character in SQLStorage.cpp"); } } template -void SQLStorageLoaderBase::storeValue(char * value, SQLStorage &store, char *p, int x, uint32 &offset) +void SQLStorageLoaderBase::storeValue(char* value, SQLStorage& store, char* p, int x, uint32& offset) { - T * subclass = (static_cast(this)); - switch(store.dst_format[x]) + T* subclass = (static_cast(this)); + switch (store.dst_format[x]) { case FT_LOGIC: subclass->convert_from_str(x, value, *((bool*)(&p[offset])) ); - offset+=sizeof(bool); + offset += sizeof(bool); break; case FT_BYTE: subclass->convert_from_str(x, value, *((char*)(&p[offset])) ); - offset+=sizeof(char); + offset += sizeof(char); break; case FT_INT: subclass->convert_from_str(x, value, *((uint32*)(&p[offset])) ); - offset+=sizeof(uint32); + offset += sizeof(uint32); break; case FT_FLOAT: subclass->convert_from_str(x, value, *((float*)(&p[offset])) ); - offset+=sizeof(float); + offset += sizeof(float); break; case FT_STRING: subclass->convert_str_to_str(x, value, *((char**)(&p[offset])) ); - offset+=sizeof(char*); + offset += sizeof(char*); + break; + case FT_NA: + case FT_NA_BYTE: break; + case FT_SORT: + assert(false && "SQL storage has a field type that does not match what is in the core. Check SQLStorage.cpp or your database."); + break; + default: + assert(false && "Unknown field format character in SQLStorage.cpp"); } } template -void SQLStorageLoaderBase::Load(SQLStorage &store) +void SQLStorageLoaderBase::Load(SQLStorage& store) { uint32 maxi; - Field *fields; - QueryResult result = WorldDatabase.PQuery("SELECT MAX(%s) FROM %s", store.entry_field, store.table); - if(!result) + Field* fields; + QueryResult result = WorldDatabase.PQuery("SELECT MAX(%s) FROM %s", store.entry_field, store.table); + if (!result) { - sLog->outError("Error loading %s table (not exist?)\n", store.table); + sLog->outError("Error loading %s table (does not exist?)\n", store.table); exit(1); // Stop server at loading non exited table or not accessable table } - maxi = (*result)[0].GetUInt32()+1; + maxi = result->Fetch()[0].GetUInt32() + 1; result = WorldDatabase.PQuery("SELECT COUNT(*) FROM %s", store.table); - if(result) + if (result) { fields = result->Fetch(); store.RecordCount = fields[0].GetUInt32(); @@ -141,7 +157,7 @@ void SQLStorageLoaderBase::Load(SQLStorage &store) result = WorldDatabase.PQuery("SELECT * FROM %s", store.table); - if(!result) + if (!result) { sLog->outError("%s table is empty!\n", store.table); store.RecordCount = 0; @@ -151,57 +167,90 @@ void SQLStorageLoaderBase::Load(SQLStorage &store) uint32 recordsize = 0; uint32 offset = 0; - if(store.iNumFields != result->GetFieldCount()) + if (store.iNumFields != result->GetFieldCount()) { store.RecordCount = 0; - sLog->outError("Error in %s table, probably sql file format was updated (there should be %d fields in sql).\n", store.table, store.iNumFields); + sLog->outError("Error loading table %s, probably table format was updated (there should be %u fields in sql).\n", store.table, store.iNumFields); exit(1); // Stop server at loading broken or non-compatible table. } - //get struct size - uint32 sc=0; - uint32 bo=0; - uint32 bb=0; - for (uint32 x=0; x< store.iNumFields; x++) - if(store.dst_format[x]==FT_STRING) - ++sc; - else if (store.dst_format[x]==FT_LOGIC) - ++bo; - else if (store.dst_format[x]==FT_BYTE) - ++bb; - recordsize=(store.iNumFields-sc-bo-bb)*4+sc*sizeof(char*)+bo*sizeof(bool)+bb*sizeof(char); - - char** newIndex=new char*[maxi]; - memset(newIndex,0,maxi*sizeof(char*)); - - char * _data= new char[store.RecordCount *recordsize]; - uint32 count=0; + for (uint32 x = 0; x < store.iNumFields; ++x) + { + switch (store.dst_format[x]) + { + case FT_LOGIC: + recordsize += sizeof(bool); + break; + case FT_BYTE: + recordsize += sizeof(char); + break; + case FT_INT: + recordsize += sizeof(uint32); + break; + case FT_FLOAT: + recordsize += sizeof(float); + break; + case FT_STRING: + recordsize += sizeof(char*); + break; + case FT_NA: + case FT_NA_BYTE: + break; + case FT_IND: + case FT_SORT: + assert(false && "SQL storage does not have sort field types!"); + break; + default: + assert(false && "Unknown field format character in SQLStorage.cpp"); + break; + } + } + + char** newIndex = new char*[maxi]; + memset(newIndex, 0, maxi * sizeof(char*)); + + char * _data = new char[store.RecordCount * recordsize]; + uint32 count = 0; do { fields = result->Fetch(); - char *p=(char*)&_data[recordsize*count]; - newIndex[fields[0].GetUInt32()]=p; + char* p = (char*)&_data[recordsize * count]; + newIndex[fields[0].GetUInt32()] = p; - offset=0; - for (uint32 x = 0; x < store.iNumFields; x++) - switch(store.src_format[x]) + offset = 0; + for (uint32 x = 0; x < store.iNumFields; ++x) + switch (store.src_format[x]) { case FT_LOGIC: - storeValue((bool)(fields[x].GetUInt32() > 0), store, p, x, offset); break; + storeValue((bool)(fields[x].GetUInt32() > 0), store, p, x, offset); + break; case FT_BYTE: - storeValue((char)fields[x].GetUInt8(), store, p, x, offset); break; + storeValue((char)fields[x].GetUInt8(), store, p, x, offset); + break; case FT_INT: - storeValue((uint32)fields[x].GetUInt32(), store, p, x, offset); break; + storeValue((uint32)fields[x].GetUInt32(), store, p, x, offset); + break; case FT_FLOAT: - storeValue((float)fields[x].GetFloat(), store, p, x, offset); break; + storeValue((float)fields[x].GetFloat(), store, p, x, offset); + break; case FT_STRING: - storeValue((char*)fields[x].GetCString(), store, p, x, offset); break; + storeValue((char*)fields[x].GetCString(), store, p, x, offset); + break; + case FT_NA: + case FT_NA_BYTE: + break; + case FT_IND: + case FT_SORT: + assert(false && "SQL storage has a field type that is not allowed. Check your SQLStorage.cpp!"); + break; + default: + assert(false && "Unknown field format character in SQLStorage.cpp"); + } ++count; - }while( result->NextRow() ); + } while (result->NextRow()); store.pIndex = newIndex; store.MaxEntry = maxi; store.data = _data; } - diff --git a/src/server/shared/Debugging/Errors.h b/src/server/shared/Debugging/Errors.h index 756947b516b1a..52f0f4d74b86c 100755 --- a/src/server/shared/Debugging/Errors.h +++ b/src/server/shared/Debugging/Errors.h @@ -20,17 +20,13 @@ #define TRINITYCORE_ERRORS_H #include "Common.h" +#include "Log.h" +#include -#ifdef HAVE_ACE_STACK_TRACE_H // old versions ACE not have Stack_Trace.h but used at some oS for better compatibility -#define WPAssert( assertion ) { if (!(assertion)) { ACE_Stack_Trace st; fprintf( stderr, "\n%s:%i in %s ASSERTION FAILED:\n %s\n%s\n", __FILE__, __LINE__,__FUNCTION__, #assertion, st.c_str()); assert( #assertion &&0 ); ((void(*)())NULL)();} } -#else -#define WPAssert( assertion ) { if (!(assertion)) { fprintf( stderr, "\n%s:%i in %s ASSERTION FAILED2:\n %s\n", __FILE__, __LINE__,__FUNCTION__, #assertion); assert( #assertion &&0 ); ((void(*)())NULL)();} } -#endif +#define WPAssert( assertion ) { if (!(assertion)) { ACE_Stack_Trace st; sLog->outError( "\n%s:%i in %s ASSERTION FAILED:\n %s\n%s\n", __FILE__, __LINE__,__FUNCTION__, #assertion, st.c_str()); assert( #assertion &&0 ); ((void(*)())NULL)();} } #define WPError( assertion, errmsg ) if( ! (assertion) ) { sLog->outError( "%\n%s:%i in %s ERROR:\n %s\n", __FILE__, __LINE__, __FUNCTION__, (char *)errmsg ); assert( false ); } #define WPWarning( assertion, errmsg ) if( ! (assertion) ) { sLog->outError( "\n%s:%i in %s WARNING:\n %s\n", __FILE__, __LINE__, __FUNCTION__, (char *)errmsg ); } - #define WPFatal( assertion, errmsg ) if( ! (assertion) ) { sLog->outError( "\n%s:%i in %s FATAL ERROR:\n %s\n", __FILE__, __LINE__, __FUNCTION__, (char *)errmsg ); assert( #assertion &&0 ); abort(); } #define ASSERT WPAssert #endif - diff --git a/src/server/shared/Debugging/WheatyExceptionReport.cpp b/src/server/shared/Debugging/WheatyExceptionReport.cpp index b5171fa5f89b9..835d8bb87af7b 100644 --- a/src/server/shared/Debugging/WheatyExceptionReport.cpp +++ b/src/server/shared/Debugging/WheatyExceptionReport.cpp @@ -753,7 +753,7 @@ bool bWriteVariables, HANDLE pThreadHandle) BOOL CALLBACK WheatyExceptionReport::EnumerateSymbolsCallback( PSYMBOL_INFO pSymInfo, -ULONG SymbolSize, +ULONG /*SymbolSize*/, PVOID UserContext) { @@ -782,7 +782,7 @@ bool WheatyExceptionReport::FormatSymbolValue( PSYMBOL_INFO pSym, STACKFRAME * sf, char * pszBuffer, -unsigned cbBuffer) +unsigned /*cbBuffer*/) { char * pszCurrBuffer = pszBuffer; @@ -853,7 +853,7 @@ DWORD dwTypeIndex, unsigned nestingLevel, DWORD_PTR offset, bool & bHandled, -char* Name) +char* /*Name*/) { bHandled = false; diff --git a/src/server/shared/Logging/Log.cpp b/src/server/shared/Logging/Log.cpp index dd66e3e0811a1..eaff7cbd8fa45 100755 --- a/src/server/shared/Logging/Log.cpp +++ b/src/server/shared/Logging/Log.cpp @@ -168,16 +168,7 @@ void Log::Initialize() m_dbLogLevel = sConfig->GetIntDefault("DBLogLevel", LOGL_NORMAL); m_sqlDriverQueryLogging = sConfig->GetBoolDefault("SQLDriverQueryLogging", false); - m_logFilter = 0; - - if(sConfig->GetBoolDefault("LogFilter_TransportMoves", true)) - m_logFilter |= LOG_FILTER_TRANSPORT_MOVES; - if(sConfig->GetBoolDefault("LogFilter_CreatureMoves", true)) - m_logFilter |= LOG_FILTER_CREATURE_MOVES; - if(sConfig->GetBoolDefault("LogFilter_VisibilityChanges", true)) - m_logFilter |= LOG_FILTER_VISIBILITY_CHANGES; - if(sConfig->GetBoolDefault("LogFilter_AchievementUpdates", true)) - m_logFilter |= LOG_FILTER_ACHIEVEMENT_UPDATES; + m_DebugLogMask = DebugLogFilters(sConfig->GetIntDefault("DebugLogMask", LOG_FILTER_NONE)); // Char log settings m_charLog_Dump = sConfig->GetBoolDefault("CharLogDump", false); @@ -723,8 +714,11 @@ void Log::outDebugInLine(const char * str, ...) } } -void Log::outDebug(const char * str, ...) +void Log::outDebug(DebugLogFilters f, const char * str, ...) { + if (!(m_DebugLogMask & f)) + return; + if (!str) return; diff --git a/src/server/shared/Logging/Log.h b/src/server/shared/Logging/Log.h index 61bb8b8ef9da1..5f0fd8d27f292 100755 --- a/src/server/shared/Logging/Log.h +++ b/src/server/shared/Logging/Log.h @@ -24,12 +24,32 @@ class Config; -enum LogFilters +enum DebugLogFilters { - LOG_FILTER_TRANSPORT_MOVES = 1, - LOG_FILTER_CREATURE_MOVES = 2, - LOG_FILTER_VISIBILITY_CHANGES = 4, - LOG_FILTER_ACHIEVEMENT_UPDATES = 8 + LOG_FILTER_NONE = 0x00000000, + LOG_FILTER_UNITS = 0x00000001, // Anything related to units that doesn't fit in other categories. ie. creature formations + LOG_FILTER_PETS = 0x00000002, + LOG_FILTER_VEHICLES = 0x00000004, + LOG_FILTER_TSCR = 0x00000008, // C++ AI, instance scripts, etc. + LOG_FILTER_DATABASE_AI = 0x08000010, // SmartAI, EventAI, CreatureAI + LOG_FILTER_MAPSCRIPTS = 0x00000020, + LOG_FILTER_NETWORKIO = 0x00000040, // Anything packet/netcode related + LOG_FILTER_SPELLS_AURAS = 0x00000080, + LOG_FILTER_ACHIEVEMENTSYS = 0x00000100, + LOG_FILTER_CONDITIONSYS = 0x00000200, + LOG_FILTER_POOLSYS = 0x00000400, + LOG_FILTER_AUCTIONHOUSE = 0x00000800, + LOG_FILTER_BATTLEGROUND = 0x00001000, // Anything related to arena's and battlegrounds + LOG_FILTER_OUTDOORPVP = 0x00002000, + LOG_FILTER_CHATSYS = 0x00004000, + LOG_FILTER_LFG = 0x00008000, + LOG_FILTER_MAPS = 0x00010000, // Maps, instances, grids, cells, visibility + LOG_FILTER_PLAYER_LOADING = 0x00020000, // Debug output from Player::_Load functions + LOG_FILTER_PLAYER_ITEMS = 0x00040000, // Anything item related + LOG_FILTER_PLAYER_SKILLS = 0x00080000, // Skills related + LOG_FILTER_LOOT = 0x00100000, // Loot related + LOG_FILTER_GUILD = 0x00200000, // Guild related + LOG_FILTER_TRANSPORTS = 0x00400000, // Transport related }; enum LogTypes @@ -100,7 +120,7 @@ class Log void outCrash( const char * err, ... ) ATTR_PRINTF(2,3); void outBasic( const char * str, ... ) ATTR_PRINTF(2,3); void outDetail( const char * str, ... ) ATTR_PRINTF(2,3); - void outDebug( const char * str, ... ) ATTR_PRINTF(2,3); + void outDebug(DebugLogFilters f, const char* str, ...) ATTR_PRINTF(3,4); void outStaticDebug( const char * str, ... ) ATTR_PRINTF(2,3); void outDebugInLine( const char * str, ... ) ATTR_PRINTF(2,3); void outErrorDb( const char * str, ... ) ATTR_PRINTF(2,3); @@ -121,7 +141,6 @@ class Log void SetSQLDriverQueryLogging(bool newStatus) { m_sqlDriverQueryLogging = newStatus; } void SetRealmID(uint32 id) { realm = id; } - uint32 getLogFilter() const { return m_logFilter; } bool IsOutDebug() const { return m_logLevel > 2 || (m_logFileLevel > 2 && logfile); } bool IsOutCharDump() const { return m_charLog_Dump; } @@ -168,7 +187,6 @@ class Log uint8 m_dbLogLevel; uint8 m_logLevel; uint8 m_logFileLevel; - uint8 m_logFilter; bool m_dbChar; bool m_dbRA; bool m_dbGM; @@ -176,6 +194,8 @@ class Log bool m_charLog_Dump; bool m_charLog_Dump_Separate; std::string m_dumpsDir; + + DebugLogFilters m_DebugLogMask; }; #define sLog ACE_Singleton::instance() diff --git a/src/server/shared/Packets/ByteBuffer.h b/src/server/shared/Packets/ByteBuffer.h index 198772c1d3aca..e66727192265c 100755 --- a/src/server/shared/Packets/ByteBuffer.h +++ b/src/server/shared/Packets/ByteBuffer.h @@ -416,10 +416,10 @@ class ByteBuffer if(!sLog->IsOutDebug()) // optimize disabled debug output return; - sLog->outDebug("STORAGE_SIZE: %lu", (unsigned long)size() ); + sLog->outDebug(LOG_FILTER_NETWORKIO, "STORAGE_SIZE: %lu", (unsigned long)size() ); for (uint32 i = 0; i < size(); ++i) sLog->outDebugInLine("%u - ", read(i) ); - sLog->outDebug(" "); + sLog->outDebug(LOG_FILTER_NETWORKIO, " "); } void textlike() const @@ -427,10 +427,10 @@ class ByteBuffer if(!sLog->IsOutDebug()) // optimize disabled debug output return; - sLog->outDebug("STORAGE_SIZE: %lu", (unsigned long)size() ); + sLog->outDebug(LOG_FILTER_NETWORKIO, "STORAGE_SIZE: %lu", (unsigned long)size() ); for (uint32 i = 0; i < size(); ++i) sLog->outDebugInLine("%c", read(i) ); - sLog->outDebug(" "); + sLog->outDebug(LOG_FILTER_NETWORKIO, " "); } void hexlike() const @@ -439,7 +439,7 @@ class ByteBuffer return; uint32 j = 1, k = 1; - sLog->outDebug("STORAGE_SIZE: %lu", (unsigned long)size() ); + sLog->outDebug(LOG_FILTER_NETWORKIO, "STORAGE_SIZE: %lu", (unsigned long)size() ); for (uint32 i = 0; i < size(); ++i) { diff --git a/src/server/shared/Utilities/Util.h b/src/server/shared/Utilities/Util.h index aa16b082a88e1..47fda705d579f 100755 --- a/src/server/shared/Utilities/Util.h +++ b/src/server/shared/Utilities/Util.h @@ -137,21 +137,30 @@ inline T AddPctU(T& base, uint32 pct) } template -inline T AddFlatPctF(T& base, float pct) +inline T AddFlatPctF(T& pos, T& neg, float pct) { - return base += (pct >= 0) ? pct / 100.0f : CalculatePctF(base, pct); + if (pct >= 0) + return pos += pct / 100.0f; + else + return neg += CalculatePctF(neg, pct); } template -inline T AddFlatPctN(T& base, int32 pct) +inline T AddFlatPctN(T& pos, T& neg, int32 pct) { - return base += (pct >= 0) ? float(pct) / 100.0f : CalculatePctN(base, pct); + if (pct >= 0) + return pos += float(pct) / 100.0f; + else + return neg += CalculatePctN(neg, pct); } template -inline T AddFlatPctU(T& base, uint32 pct) +inline T AddFlatPctU(T& pos, T& neg, uint32 pct) { - return base += (pct >= 0) ? float(pct) / 100.0f : CalculatePctU(base, pct); + if (pct >= 0) + return pos += float(pct) / 100.0f; + else + return neg += CalculatePctU(neg, pct); } template diff --git a/src/server/worldserver/CommandLine/CliRunnable.cpp b/src/server/worldserver/CommandLine/CliRunnable.cpp index e8def4532e8d7..957191c693a69 100755 --- a/src/server/worldserver/CommandLine/CliRunnable.cpp +++ b/src/server/worldserver/CommandLine/CliRunnable.cpp @@ -35,7 +35,7 @@ #include "Player.h" #include "Util.h" -#if PLATFORM != WINDOWS +#if PLATFORM != PLATFORM_WINDOWS #include #include @@ -564,7 +564,7 @@ void CliRunnable::run() { ///- Display the list of available CLI functions then beep //sLog->outString(""); - #if PLATFORM != WINDOWS + #if PLATFORM != PLATFORM_WINDOWS rl_attempted_completion_function = cli_completion; rl_event_hook = cli_hook_func; #endif @@ -582,9 +582,9 @@ void CliRunnable::run() char *command_str ; // = fgets(commandbuf,sizeof(commandbuf),stdin); - #if PLATFORM == WINDOWS + #if PLATFORM == PLATFORM_WINDOWS char commandbuf[256]; - command_str = fgets(commandbuf,sizeof(commandbuf),stdin); + command_str = fgets(commandbuf, sizeof(commandbuf), stdin); #else command_str = readline("TC>"); rl_bind_key('\t',rl_complete); @@ -600,23 +600,23 @@ void CliRunnable::run() if (!*command_str) { - #if PLATFORM == WINDOWS + #if PLATFORM == PLATFORM_WINDOWS printf("TC>"); #endif continue; } std::string command; - if (!consoleToUtf8(command_str,command)) // convert from console encoding to utf8 + if (!consoleToUtf8(command_str, command)) // convert from console encoding to utf8 { - #if PLATFORM == WINDOWS + #if PLATFORM == PLATFORM_WINDOWS printf("TC>"); #endif continue; } fflush(stdout); sWorld->QueueCliCommand(new CliCommandHolder(NULL, command.c_str(), &utf8print, &commandFinished)); - #if PLATFORM != WINDOWS + #if PLATFORM != PLATFORM_WINDOWS add_history(command.c_str()); #endif diff --git a/src/server/worldserver/Master.cpp b/src/server/worldserver/Master.cpp index a08f3bb332f85..1ef0203ba8544 100755 --- a/src/server/worldserver/Master.cpp +++ b/src/server/worldserver/Master.cpp @@ -83,7 +83,7 @@ class FreezeDetectorRunnable : public ACE_Based::Runnable { if (!_delaytime) return; - sLog->outString("Starting up anti-freeze thread (%u seconds max stuck time)...",_delaytime/1000); + sLog->outString("Starting up anti-freeze thread (%u seconds max stuck time)...", _delaytime/1000); m_loops = 0; w_loops = 0; m_lastchange = 0; @@ -167,7 +167,6 @@ int Master::Run() ///- Initialize the World sWorld->SetInitialWorldSettings(); - // Initialise the signal handlers CoredSignalHandler SignalINT, SignalTERM; #ifdef _WIN32 @@ -182,7 +181,6 @@ int Master::Run() Handler.register_handler(SIGBREAK, &SignalBREAK); #endif /* _WIN32 */ - ///- Launch WorldRunnable thread ACE_Based::Thread world_thread(new WorldRunnable); world_thread.setPriority(ACE_Based::Highest); @@ -212,13 +210,13 @@ int Master::Run() ULONG_PTR appAff; ULONG_PTR sysAff; - if (GetProcessAffinityMask(hProcess,&appAff,&sysAff)) + if (GetProcessAffinityMask(hProcess, &appAff, &sysAff)) { ULONG_PTR curAff = Aff & appAff; // remove non accessible processors if (!curAff) { - sLog->outError("Processors marked in UseProcessors bitmask (hex) %x not accessible for Trinityd. Accessible processors bitmask (hex): %x",Aff,appAff); + sLog->outError("Processors marked in UseProcessors bitmask (hex) %x not accessible for Trinityd. Accessible processors bitmask (hex): %x", Aff, appAff); } else { @@ -236,7 +234,7 @@ int Master::Run() //if (Prio && (m_ServiceStatus == -1)/* need set to default process priority class in service mode*/) if (Prio) { - if(SetPriorityClass(hProcess,HIGH_PRIORITY_CLASS)) + if (SetPriorityClass(hProcess, HIGH_PRIORITY_CLASS)) sLog->outString("TrinityCore process priority class set to HIGH"); else sLog->outError("Can't set Trinityd process priority class."); @@ -254,9 +252,6 @@ int Master::Run() soap_thread = new ACE_Based::Thread(runnable); } - uint32 realCurrTime, realPrevTime; - realCurrTime = realPrevTime = getMSTime(); - ///- Start up freeze catcher thread if (uint32 freeze_delay = sConfig->GetIntDefault("MaxCoreStuckTime", 0)) { @@ -272,7 +267,7 @@ int Master::Run() if (sWorldSocketMgr->StartNetwork(wsport, bind_ip.c_str ()) == -1) { - sLog->outError ("Failed to start network"); + sLog->outError("Failed to start network"); World::StopNow(ERROR_EXIT_CODE); // go down and shutdown the server } @@ -387,13 +382,13 @@ bool Master::_StartDB() } synch_threads = sConfig->GetIntDefault("WorldDatabase.SynchThreads", 1); - ///- Initialise the world database if (!WorldDatabase.Open(dbstring, async_threads, synch_threads)) { sLog->outError("Cannot connect to world database %s", dbstring.c_str()); return false; } + ///- Get character database info from configuration file dbstring = sConfig->GetStringDefault("CharacterDatabaseInfo", ""); if (dbstring.empty()) @@ -461,13 +456,13 @@ bool Master::_StartDB() } synch_threads = sConfig->GetIntDefault("LoginDatabase.SynchThreads", 1); - ///- Initialise the login database if (!LoginDatabase.Open(dbstring, async_threads, synch_threads)) { sLog->outError("Cannot connect to login database %s", dbstring.c_str()); return false; } + ///- Get the realm Id from the configuration file realmID = sConfig->GetIntDefault("RealmID", 0); if (!realmID) @@ -511,9 +506,9 @@ void Master::clearOnlineAccounts() /// \todo Only accounts with characters logged on *this* realm should have online status reset. Move the online column from 'account' to 'realmcharacters'? LoginDatabase.DirectPExecute( "UPDATE account SET online = 0 WHERE online > 0 " - "AND id IN (SELECT acctid FROM realmcharacters WHERE realmid = '%d')",realmID); + "AND id IN (SELECT acctid FROM realmcharacters WHERE realmid = '%d')", realmID); - CharacterDatabase.DirectExecute("UPDATE characters SET online = 0 WHERE online<>0"); + CharacterDatabase.DirectExecute("UPDATE characters SET online = 0 WHERE online <> 0"); // Battleground instance ids reset at server restart CharacterDatabase.DirectExecute("UPDATE character_battleground_data SET instance_id = 0"); diff --git a/src/server/worldserver/TCSoap/TCSoap.cpp b/src/server/worldserver/TCSoap/TCSoap.cpp index 66a58caba80b1..c0b3f8faebb53 100755 --- a/src/server/worldserver/TCSoap/TCSoap.cpp +++ b/src/server/worldserver/TCSoap/TCSoap.cpp @@ -49,7 +49,7 @@ void TCSoapRunnable::run() if (!soap_valid_socket(soap_accept(&soap))) continue; // ran into an accept timeout - sLog->outDebug("TCSoap: accepted connection from IP=%d.%d.%d.%d", (int)(soap.ip>>24)&0xFF, (int)(soap.ip>>16)&0xFF, (int)(soap.ip>>8)&0xFF, (int)soap.ip&0xFF); + sLog->outDebug(LOG_FILTER_NETWORKIO, "TCSoap: accepted connection from IP=%d.%d.%d.%d", (int)(soap.ip>>24)&0xFF, (int)(soap.ip>>16)&0xFF, (int)(soap.ip>>8)&0xFF, (int)soap.ip&0xFF); struct soap* thread_soap = soap_copy(&soap);// make a safe copy ACE_Message_Block *mb = new ACE_Message_Block(sizeof(struct soap*)); @@ -87,33 +87,33 @@ int ns1__executeCommand(soap* soap, char* command, char** result) // security check if (!soap->userid || !soap->passwd) { - sLog->outDebug("TCSoap: Client didn't provide login information"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "TCSoap: Client didn't provide login information"); return 401; } uint32 accountId = sAccountMgr->GetId(soap->userid); if(!accountId) { - sLog->outDebug("TCSoap: Client used invalid username '%s'", soap->userid); + sLog->outDebug(LOG_FILTER_NETWORKIO, "TCSoap: Client used invalid username '%s'", soap->userid); return 401; } if(!sAccountMgr->CheckPassword(accountId, soap->passwd)) { - sLog->outDebug("TCSoap: invalid password for account '%s'", soap->userid); + sLog->outDebug(LOG_FILTER_NETWORKIO, "TCSoap: invalid password for account '%s'", soap->userid); return 401; } if(sAccountMgr->GetSecurity(accountId) < SEC_ADMINISTRATOR) { - sLog->outDebug("TCSoap: %s's gmlevel is too low", soap->userid); + sLog->outDebug(LOG_FILTER_NETWORKIO, "TCSoap: %s's gmlevel is too low", soap->userid); return 403; } if(!command || !*command) return soap_sender_fault(soap, "Command mustn't be empty", "The supplied command was an empty string"); - sLog->outDebug("TCSoap: got command '%s'", command); + sLog->outDebug(LOG_FILTER_NETWORKIO, "TCSoap: got command '%s'", command); SOAPCommand connection; // commands are executed in the world thread. We have to wait for them to be completed @@ -143,7 +143,6 @@ int ns1__executeCommand(soap* soap, char* command, char** result) return soap_sender_fault(soap, printBuffer, printBuffer); } - void SOAPCommand::commandFinished(void* soapconnection, bool success) { SOAPCommand* con = (SOAPCommand*)soapconnection; diff --git a/src/server/worldserver/TCSoap/TCSoap.h b/src/server/worldserver/TCSoap/TCSoap.h index e9aeeaefc012d..d5232f3377355 100755 --- a/src/server/worldserver/TCSoap/TCSoap.h +++ b/src/server/worldserver/TCSoap/TCSoap.h @@ -72,7 +72,6 @@ class SOAPWorkingThread : public ACE_Task void process_message(ACE_Message_Block *mb); }; - class SOAPCommand { public: diff --git a/src/server/worldserver/WorldThread/WorldRunnable.cpp b/src/server/worldserver/WorldThread/WorldRunnable.cpp index acf71223791bf..664e767d11f18 100755 --- a/src/server/worldserver/WorldThread/WorldRunnable.cpp +++ b/src/server/worldserver/WorldThread/WorldRunnable.cpp @@ -90,6 +90,7 @@ void WorldRunnable::run() sWorldSocketMgr->StopNetwork(); - sObjectAccessor->UnloadAll(); // unload 'i_player2corpse' storage and remove from world sMapMgr->UnloadAll(); // unload all grids (including locked in memory) + sObjectAccessor->UnloadAll(); // unload 'i_player2corpse' storage and remove from world + sScriptMgr->Unload(); } diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist index f5c9fb769b25c..e18436674c458 100644 --- a/src/server/worldserver/worldserver.conf.dist +++ b/src/server/worldserver/worldserver.conf.dist @@ -446,21 +446,45 @@ LogTimestamp = 0 LogFileLevel = 0 # -# LogFilter_AchievementUpdates -# LogFilter_CreatureMoves -# LogFilter_TransportMoves -# LogFilter_VisibilityChanges -# Description: Filter log events -# Default: 1 - (Enabled, LogFilter_AchievementUpdates) -# 1 - (Enabled, LogFilter_CreatureMoves) -# 1 - (Enabled, LogFilter_TransportMoves) -# 1 - (Enabled, LogFilter_VisibilityChanges) -# 0 - (Disabled) - -LogFilter_AchievementUpdates = 1 -LogFilter_CreatureMoves = 1 -LogFilter_TransportMoves = 1 -LogFilter_VisibilityChanges = 1 +# Debug Log Mask +# Description: Bitmask that determines which debug log output (level 3) +# will be logged. +# Possible flags: +# 1 - Anything related to units that doesn't fit in other +# categories. +# 2 - Anything related to pets. +# 4 - Anything related to vehicles. +# 8 - Anything related to C++ AI, instance scripts, etc. +# 16 - Anything related to DB AI, such as SAI, EAI, CreatureAI +# 32 - Anything related to DB map scripts +# 64 - Anything related to network input/output, +# such as packet handlers and netcode logs +# 128 - Anything related to the spellsystem and aurasystem +# 256 - Anything related to the achievement system +# 512 - Anything related to the condition system +# 1024 - Anything related to the pool system +# 2048 - Anything related to the auction house +# 4096 - Anything related to arena's and battlegrounds +# 8192 - Anything related to outdoor PVP +# 16384 - Anything related to the chat system +# 32768 - Anything related to the LFG system +# 65536 - Anything related to maps, instances (not scripts), +# grids, cells, visibility, etc. +# 131072 - Anything related to player loading from DB +# (Player::_LoadXXX functions) +# 262144 - Anything related to items +# 524288 - Anything related to player skills +# (do not confuse with spells) +# 1048576 - Anything related to loot +# 2097152 - Anything related to guilds +# 4194304 - Anything related to transports +# +# Simply add the values together to create a bitmask. +# For more info see enum DebugLogFilters in Log.h +# +# Default: 0 (nothing) + +DebugLogMask = 0 # # WorldLogFile